diff options
| author | Benjamin Jackson <38561765+benjymansy123@users.noreply.github.com> | 2022-06-15 09:28:07 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-15 15:28:07 +0200 |
| commit | 105af22b8f6ea5823ed3be271c27d250315fced7 (patch) | |
| tree | f4dd2dd66168b606258e4b50e306cebf286ea73c /docs/add-a-module.md | |
| parent | 41bb7bb85a112e13462450400db6bf5b06a78179 (diff) | |
| download | wiki-105af22b8f6ea5823ed3be271c27d250315fced7.tar.gz wiki-105af22b8f6ea5823ed3be271c27d250315fced7.tar.bz2 wiki-105af22b8f6ea5823ed3be271c27d250315fced7.zip | |
Update add-a-module.md (#729)
Diffstat (limited to 'docs/add-a-module.md')
| -rw-r--r-- | docs/add-a-module.md | 77 |
1 files changed, 33 insertions, 44 deletions
diff --git a/docs/add-a-module.md b/docs/add-a-module.md index e630ab9..5c0bd8d 100644 --- a/docs/add-a-module.md +++ b/docs/add-a-module.md @@ -4,65 +4,54 @@ redirect_from: "/Add-a-module" # Add a module -## **How to add a module** +1. Get the module from the catalogue: [https://www.azerothcore.org/catalogue](https://www.azerothcore.org/catalogue) (For this example, we'll be using this module: [mod-npc-services](https://www.azerothcore.org/catalogue.html#/details/177019524)) +2. - Clone it using Git as you did during the [core installation](core-installation.md). Set the `Destination` to "C:\Azerothcore\modules\mod-npc-services" (Recommended method) [Jump to step 9 to make sure it cloned correctly] + - Use the download button on the catalogue page + - Use `Download ZIP` button on the module's Github page -1. Get the module from this website [https://www.azerothcore.org/catalogue](https://www.azerothcore.org/catalogue) -2. Clone it using git (recommended) or just download it -3. I'll use this for Exmple: [https://www.azerothcore.org/catalogue/details.html?id=177019524](https://www.azerothcore.org/catalogue/details.html?id=177019524). -4. Once you downloaded it or cloned: ( Extract it, you will have than Folder looks like this : - +3. If in the previous step you chose not to clone the repo, you'll need to extract the downloaded ZIP archive. Once this is done, your resulting folder should look like this: + +4. Due to a discrepancy between the way AzerothCore loads modules and how Github names ZIP code archives, you will need to rename the directory name. The folder will have the branch name placed onto the end of it, as in mod-npc-services-_master_. You will need to remove this branch name, leaving only mod-npc-services: + -5. Copy this folder you will have to paste it in next steps: - +5. Copy the renamed folder, as you'll be pasting it into the modules folder -6. Now go in your AzerothCore folder (for example C:\azerothcore-wotlk-master) +6. Navigate to your AzerothCore modules folder (C:\Azerothcore) -7. When you are there, you will see there folder named modules like on this image: - +7. You will see in that directory the modules folder: + -8. Open that folder modules -> It will look like this : - +8. Open the modules folder, it should look quite sparse: + -9. Paste there your downloaded module ( That we use in step 4., in my case we use : NPC Services Module -And it will look like this when you paste it there : - +9. Paste the module folder into the modules folder, it should now look like this: + -10. Than, open Cmake -> Press Configure - +10. Now to recompile! Open CMake and configure. If the module has loaded correctly, you should now see it in the CMake log as well: + -11. Than press Generate : - +11. Then generate: + -12. And you are done. P.S You have also to check in the module folder (SQL folder) if there is any .sql file required to be executed in your database ( Like on this image ) : - +12. Now open the generated project file, clean, and build the solution - then World : - +## SQL Queries -- this module has an SQL file which needs to be executed in your World Database : - +- If your module contains a `sql` folder, you will need to run the queries inside for the module to function correctly: + -- Let's do it : -13. Open it with any text editor and copy all content from the file, or run it directly : ( I'll use Editor ) -This is what i have there : + - Opening this folder, we should then see any of these three folders: auth, characters, or world. In the example module, it contains a world folder: + -``` -DELETE FROM `creature_template` WHERE `entry` = 55003; -Set @NpcName = "Visual Weapon NPC", - @NpcSubname = "AzerothCore", - @NpcEntry = 55003, - @NpcDisplayID = 31833, - @NpcLevel = 80; + - Depending on the module, there could be more than one query file you would need to execute. Refer to the readme of the module for information regarding this. In our case, there is only one `.sql` file to run, so our job is easy: + -INSERT INTO `creature_template` (`entry`, `modelid1`, `name`, `subname`, `minlevel`, `maxlevel`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `dmgschool`, `BaseAttackTime`, `RangeAttackTime`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES -(@NpcEntry, @NpcDisplayID, @NpcName, @NpcSubname, @NpcLevel, @NpcLevel, 35, 1, 1, 1.14286, 1, 1, 0, 2000, 2000, 2, 0, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 50, 50, 1, 0, 0, 1, 0, 0, 'npc_visualweapon', 12340); -``` +13. Open your SQL editor of choice. In this case, we will be using HeidiSQL. You will need to select the database the query applies to on the left before you run the query. Since our query was in the world folder, we will select `acore_world`. Once the database is selected, we will then load the SQL file: + -14. So, We have to run (paste) this query in the Database, Let's do it. -Open your DB Program ( Example : Navicat, HeidiSQL ) and run our code there, in this way : - +14. Once you navigate to the SQL file and open it up, it will open the query in a new tab. Double check that the database tab is pointing to the right database, then run the query using the marked button above the tabs: + -15. We are done now. Go in game and spawn this NPC with command .npc add 55003 -@NpcEntry = 55003 <---- This is our NPC ENTRY +With that, the module is installed! In the case of mod-npc-services, we'd then launch our server and run the command `.npc add 55002` (The NPC Entry) to spawn the NPC. |
