diff options
| author | Yehonal <yehonal.azeroth@gmail.com> | 2021-05-09 15:28:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-09 15:28:14 +0200 |
| commit | 7f57c9c3230a6656d8a9985421566b5fe422500e (patch) | |
| tree | 49566d333a5f65130bcc7176bd15b85a5a0484b4 /docs | |
| parent | 5ad0849fdd87d45d0db58a98867942a42458f1a4 (diff) | |
| download | wiki-7f57c9c3230a6656d8a9985421566b5fe422500e.tar.gz wiki-7f57c9c3230a6656d8a9985421566b5fe422500e.tar.bz2 wiki-7f57c9c3230a6656d8a9985421566b5fe422500e.zip | |
Create how-to-import-dbc-data-in-db.md (#472)
* Create how-to-import-dbc-data-in-db.md
* Update importing-spell-dbc.md
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/how-to-import-dbc-data-in-db.md | 98 | ||||
| -rw-r--r-- | docs/importing-spell-dbc.md | 3 |
2 files changed, 100 insertions, 1 deletions
diff --git a/docs/how-to-import-dbc-data-in-db.md b/docs/how-to-import-dbc-data-in-db.md new file mode 100644 index 0000000..79182e4 --- /dev/null +++ b/docs/how-to-import-dbc-data-in-db.md @@ -0,0 +1,98 @@ +# How to import DBC data inside the AC database + +This guide will show you how to import DBC data inside the AzerothCore database and edit them. For the guide we are going to use the AreaTable.dbc as example +by changing the Hyjal zone from "Normal" to "Sanctuary (with duels allowed)". +If you do this you will turn that zone into crossfaction and, for example, you can use it for events. + +However, the same guide can be used for any kind of DBC (Spell, Items etc.) by changing the values of the commands below. + +## Requirements + +- [Nodejs](https://nodejs.org/en/) for the node-dbc-reader + +## Getting started + +### 1. install my dbc-reader + +Clone or download [this repository](https://github.com/wowgaming/node-dbc-reader) and run `npm install` inside the downloaded folder. + +*Read the documentation of that repository if you need to run more complex commands.* + +### 2. Search your data + +Run this command to check that the zone is correct: `npm run start -- --search="[616].includes({*})" --columns=ID AreaTable` + +This command will search into the **ID** column with the following condition: `[616].includes({*})` which means that the program will search for all the IDs that include +the values within the [ ] array. In this case we only need the value 616. + +*Note: the --search option is backed by an eval, which means you can run any javascript method to execute a comparison* + +The result of that command will be: +``` +{ + "ID": 616, + "ContinentID": 1, + "ParentAreaID": 0, + "AreaBit": 619, + "Flags": 64, + "SoundProviderPref": 0, + "SoundProviderPrefUnderwater": 11, + "AmbienceID": 31, + "ZoneMusic": 0, + "IntroSound": 0, + "ExplorationLevel": 0, + "AreaName_Lang_enUS": "Hyjal", + "AreaName_Lang_enGB": "", + "AreaName_Lang_koKR": "", + "AreaName_Lang_frFR": "", + "AreaName_Lang_deDE": "", + "AreaName_Lang_enCN": "", + "AreaName_Lang_zhCN": "", + "AreaName_Lang_enTW": "", + "AreaName_Lang_zhTW": "", + "AreaName_Lang_esES": "", + "AreaName_Lang_esMX": "", + "AreaName_Lang_ruRU": "", + "AreaName_Lang_ptPT": "", + "AreaName_Lang_ptBR": "", + "AreaName_Lang_itIT": "", + "AreaName_Lang_Unk": "", + "AreaName_Lang_Mask": 16712190, + "FactionGroupMask": 0, + "LiquidTypeID_1": 0, + "LiquidTypeID_2": 0, + "LiquidTypeID_3": 0, + "LiquidTypeID_4": 0, + "MinElevation": -500, + "Ambient_Multiplier": 0, + "Lightid": 0 + } + ```` + +The value: `"Flags": 64` means "normal zone", we have to override it with `19456 - Sanctuary (Duels allowed)`. + +You can check the list of the flags [here](https://www.azerothcore.org/wiki/AreaTable) + +3. Export the SQL + +Now run the same command above but with the output type : `npm run start -- -s "[616].includes({*})" -t sql --columns=ID AreaTable` to extract the INSERT query + +Output: +```SQL +INSERT IGNORE INTO areatable_dbc (`ID`,`ContinentID`,`ParentAreaID`,`AreaBit`,`Flags`,`SoundProviderPref`,`SoundProviderPrefUnderwater`,`AmbienceID`,`ZoneMusic`,`IntroSound`,`ExplorationLevel`,`AreaName_Lang_enUS`,`AreaName_Lang_enGB`,`AreaName_Lang_koKR`,`AreaName_Lang_frFR`,`AreaName_Lang_deDE`,`AreaName_Lang_enCN`,`AreaName_Lang_zhCN`,`AreaName_Lang_enTW`,`AreaName_Lang_zhTW`,`AreaName_Lang_esES`,`AreaName_Lang_esMX`,`AreaName_Lang_ruRU`,`AreaName_Lang_ptPT`,`AreaName_Lang_ptBR`,`AreaName_Lang_itIT`,`AreaName_Lang_Unk`,`AreaName_Lang_Mask`,`FactionGroupMask`,`LiquidTypeID_1`,`LiquidTypeID_2`,`LiquidTypeID_3`,`LiquidTypeID_4`,`MinElevation`,`Ambient_Multiplier`,`Lightid`) + VALUES (616,1,0,619,64,0,11,31,0,0,0,"Hyjal","","","","","","","","","","","","","","","",16712190,0,0,0,0,0,-500,0,0); +```` + +4. Create the Update Query + +Create the update query to set the proper faction : + +```SQL +UPDATE areatable_dbc SET Flags=19456 WHERE ID=616 +``` + +5. Create your PR + +If you are using this guide to fix a bug (not for customization purpose), +now you can create [your PR](https://www.azerothcore.org/wiki/How-to-create-a-PR) with the 2 queries above + diff --git a/docs/importing-spell-dbc.md b/docs/importing-spell-dbc.md index ce5be91..fd3a2d1 100644 --- a/docs/importing-spell-dbc.md +++ b/docs/importing-spell-dbc.md @@ -15,4 +15,5 @@ When submitting a PR with a `spell_dbc` fix for a certain spell, if that spell w ## How to import spells from the DBC files to the spell_dbc table -TODO +To import data from Spell.dbc to our spell_dbc table, you can take a look at the general guide on [how to import data from DBC files](how-to-import-dbc-data-in-db.md). +You just need to use the same guidelines with by using the Spell.dbc file instead. |
