`ClassID` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
`SubclassID` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
`Sound_Override_Subclassid` TINYINT(3) NOT NULL DEFAULT '-1',
`Material` TINYINT(4) NOT NULL DEFAULT '0',
`DisplayInfoID` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
`InventoryType` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
`SheatheType` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`),
INDEX `items_index` (`ClassID`)
)
COMMENT='Item System'
COLLATE='utf8_general_ci'
ENGINE=MyISAM
ROW_FORMAT=FIXED;
复制代码
建表的sql语句,程序猿还应该都熟悉,比较基础。不解释,看不懂的自学下sql和数据库基础。
Run this query 运行这个查询
Code:
INSERT INTO patch_table SELECT entry, class, subclass, SoundOverrideSubclass, Material, displayid, InventoryType, sheath FROM item_template
插数据到库表的操作
-有用的社区指南一览表。
1. 如何添加c++脚本到您的服务器- By JameyBoor
2. 让你的trinity服务器公开- By Jeutie
3. Stoneharry's 的技能编辑 - By StoneHarry
4. RBAC系统- MyLilSuccy
5. Server on a Stick (便携式服务端)-由MyLilSuccy
6. 更好的物品重加载方案
后面附上英文原文:
This tutorial was written in hopes of getting you, the newest member of our community, on the right track.
This tutorial holds only the basic knowledge related to wow emulation, and is in no way intended for veteran members of the community.
In this tutorial we'll briefly go over:
- Databases, what they are and what they are used for.
- DBC files, what they are and what they are used for (Includes info on client sided modifications)
- Source code, what it is and what it can be used for. (Includes info on compiling the source)
- The differences and benefits between compiling your own source and using a repack.
- Databases.
- In order to explain the difference between repacks and compiled sources, we will have to explain what databases and dbc files are first.
- Database editing can be done both on repacks and compiled servers.
- Databases are storage units, which are used for storing data ranging from, items, creatures and quests, to stuff like, characters, character achievements, character inventories, active quests, accounts and so on.
- When you start up your worldserver executable, it reads and collects all of the data from these tables, and "places" them into C++ containers.
- This data can easily be modified using any database editing tool. The preferred tool of the community is HeidiSQL. This tool will allow you to connect to your database, and view and edit all of the information stored inside of it.
- For example you can edit item/creature appearances, their stats, their names, their size etc.
- Client sided, all of this information is stored in the cache folder, so upon making any changes, you will have to, a) restart the world server, or, if possible, reload the table you were working in with the .reload *table_name* command, b) restart your game, and delete your cache folder.
- DBC Files.
- DBC files are in a sense similar to the database, they are also used as storage units, but unlike the database, these files store client sided data, while the database holds all server data. Everything you see in game, from spell names, their visuals, item displays, creature displays etc. is handled using DBC files.
- As well as the database data, the data stored in the DBC files can also be manipulated. You can create custom spells, you can change the textures of some displays, insert custom objects from other games, retro port data from Legion to Woltk, and much more.
- The main difference between editing DBC files and editing Database data, is that, in order to see the actual changes ingame, you will have to create a custom .MPQ Patch containing all of your modified DBC Files (or the additional .blp, .m2, .skin or other files you added) and place it in your clients data folder. Here is a short tutorial on how to create a custom MPQ file.
- This example tutorial will be using the client sided implementation of custom items as an example, but the part of the tutorial which requires the creation of the custom patch, and placing DBC files into it, applies to almost all if not all DBC related edits.
Make a table in the database which will hold all item.dbc data
Code:
CREATE TABLE `patch_table` (
`ID` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
`ClassID` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
`SubclassID` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
`Sound_Override_Subclassid` TINYINT(3) NOT NULL DEFAULT '-1',
`Material` TINYINT(4) NOT NULL DEFAULT '0',
`DisplayInfoID` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
`InventoryType` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
`SheatheType` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`),
INDEX `items_index` (`ClassID`)
)
COMMENT='Item System'
COLLATE='utf8_general_ci'
ENGINE=MyISAM
ROW_FORMAT=FIXED
;
Run this query
Code:
INSERT INTO patch_table SELECT entry, class, subclass, SoundOverrideSubclass, Material, displayid, InventoryType, sheath FROM item_template
After that use the build in option found in WDBXEditor to import all of the data from the newly created patch_table after that save the dbc changes.
(This is the fasted method I've discovered. It should take around half a minute to do everything)
Now that you have your dbc file set up, it's time to create a custom mpq patch containing the dbc file.
In order to do that you will need an MPQ editor, which you can grab here Ladik's MPQ Editor
Run the program and select the option to create a new mpq file. Then, create a new folder called "DBFilesClient" and place your newly created dbc file inside of it, like so:
Please ignore the other .dbc files and the two folders located inside my patch, those are not needed.
After that you can save your patch, place it in your data folder, delete your cache folder and re-run the game. Once in game you should be able to use spells with your weapons, and they should no longer appear as question marks in your inventory.
- Source code and compiling.
- Quite possibly the "scariest" part of emulation, and the part at which most members get stuck at and give up.
- Although it might be easier to pick up a repack, compiling the source brings a variety of benefits.
- The trinitycore source is written in C++, which is by most, considered one of the hardest languages to master. Although the language itself is hard to learn, if you only plan on doing minor edits in the source, you're not expected to fully comprehend it.
- Most of the Classes, methods and variables inside the trinity source are really well named, and in most cases their name perfectly describes their purpose. For example,
is a method which checks if the player can, equip an item.
If you use common knowledge, you'll be able to find and edit whichever function you want in a breeze.
- Compiling the source is an extremely easy process, once you're given the right documentation.
- The trinitycore wiki page has compiling tutorials for both Linux and Windows, and the tutorials are always kept up to date. So instead of writing a tutorial here, I'll post the links to the Linux and Windows requirements.
- Eluna - is a lua engine implementation for MaNGOS and TrinityCore based cores.
This engine allows one to write scripts using the Lua scripting language.
Lua is more flexible than the default database scripting systems and easier to use than C++.
Lua allows for fast paced development - scripts can be reloaded without recompiling or restarting.
- Linux
- Windows
- Server Setup
- Database Installation
- Compiling Trinity on CentOS 7 by MyLilSuccy
- Compiling your own source vs Using a Repack.
- While it may seem easier to pick up a repack, compiling your own source brings a vast amount of benefits.
- For example, if you're going for a custom/fun WoW experience, without the source, you'll only rely on the database and the dbc files for customization. While that may be enough for some project, having the source on the side is always a benefit. You can add custom scripts like Rochet's Transmogrification which allows you to change the appearance of your armor, or you can add some source modifications like Rochet's Item Gossip Script which allows you to trigger gossip windows using an item instead of a creature, or trigger a player gossip window when a certain event occurs (a gossip window popup when the player kills a creature, or something similar). This can be used for creating Teleportation Stones, fun creature killstreak systems and a lot more.
- Even if you're going for a blizzlike experience, having your own source will allow you to script bosses, modify pathfinding, write spell scripts etc. you wont be just relying on SmartAI and dbc fixes to achieve this.
- List of useful community guides.
How to add C++ scripts to your server - By JameyBoor
Making your trinity server public - By Jeutie
Stoneharry's spell editor - By StoneHarry
RBAC System - By MyLilSuccy
Server on a Stick (Portable Server) - By MyLilSuccy