How to create custom npc on Mangos


 
now i gonna show u guys ,
Because i’ve seen several people asking on how to create custom npc on my previous mangos guide, i decided that perhaps it’ll be better if i create a separate guide on how to create custom npc in mangos and in this example we’re going to create a custom vendor npc plus repairer. And so let’s begin the guide

 

 

 

Requirements

- A functional wow private server using Mangos
This is the most important thing, if you haven’t configured your wow server properly, please check how to configure mangos first
- WoW Model Viewer – http://code.google.com/p/wowmodelviewer/
This is needed in order to get WoW Display ID. And in this case to get the display / model id for specific creature
As a side note, actually you can also get the display ID of creatures you want by looking through UDB database which we’ve installed previously. But because i never play on official server, i know nothing about any cool creatures that can be found inside WoW World so looking through Model Viewer seems to be the best choice for me because i can see how the creature looks :P
And make sure that mangosd.exe process isn’t running before starting this process

Lookup creature display ID

All you have to do is just open WOW Model Viewer and then choose View -> View NPC to see NPC Model with it’s Display ID (Display ID is listed as the second value) and you’ll get the creature display id

Creating new entry for custom NPC

In this example we’re going to create a new custom vendor + repair npc (4224) for mangos using The Lich King Model (28672) with creature id 100001 plus 100000 health called Reaper-X with subname www.reaper-x.com (obviously you’re free to change the npc name to your liking)
Anyway, now we need to open command prompt as usual, then type this
mysql -uroot -p

# switch database to mangos
use mangos

# inserting new rows for creature on mangos, updated on 31 October 2011 because the column name has been changed
INSERT INTO creature_template (entry, modelid_1, name, subname, minhealth, maxhealth, npcflag) VALUES ( 100001, 28672, 'Reaper-X', 'www.reaper-x.com', 100000, 100000, 4224 );

# check whether the previous value has been inserted to database
SELECT entry, name, subname from creature_template where entry = 100001;

# quit mysql

quit

Adding the new custom vendor npc in WoW

1. Delete everything inside your WoW cache directory (Your WoW Installation Directory\Cache)
2. Now start mangosd.exe and then open your wow client, and finally log on to your server
3. Choose the best position on where your new custom npc should be placed (the new custom npc will be added to your current character position in WoW, and also facing the same position as your character so make sure to position your character properly)
4. type .npc add 100001
5. And voila! you’re done adding your new custom vendor npc

Adding item(s) to your new custom vendor

1. Click on the npc
2. Type .lookup item itemname where itemname should be replaced with whatever item you want your new custom vendor sell (in this example i choose Shadowmourne)
3. Type .npc additem #itemid where itemid should be replaced with previous value displayed on the previous lookup (in this example i type .npc additem 49623 to add Shadowmourne to the npc)
4. You’re done

Special Note

If you asked me, on where did i get the NPCFlag value from, well the answer is you can see the NPCFlag by looking at the source code of Mangos (unit.h). And to make things easier for you, here’s an example of where i get that 4224 value (Vendor NPC + Repairer)
Mangos NPCFlag


enum NPCFlags

{

UNIT_NPC_FLAG_NONE                  = 0x00000000,

UNIT_NPC_FLAG_GOSSIP                = 0x00000001,       // 100%

UNIT_NPC_FLAG_QUESTGIVER            = 0x00000002,       // guessed, probably ok

UNIT_NPC_FLAG_UNK1                  = 0x00000004,

UNIT_NPC_FLAG_UNK2                  = 0x00000008,

UNIT_NPC_FLAG_TRAINER               = 0x00000010,       // 100%

UNIT_NPC_FLAG_TRAINER_CLASS         = 0x00000020,       // 100%

UNIT_NPC_FLAG_TRAINER_PROFESSION    = 0x00000040,       // 100%

UNIT_NPC_FLAG_VENDOR                = 0x00000080,       // 100%

UNIT_NPC_FLAG_VENDOR_AMMO           = 0x00000100,       // 100%, general goods vendor

UNIT_NPC_FLAG_VENDOR_FOOD           = 0x00000200,       // 100%

UNIT_NPC_FLAG_VENDOR_POISON         = 0x00000400,       // guessed

UNIT_NPC_FLAG_VENDOR_REAGENT        = 0x00000800,       // 100%

UNIT_NPC_FLAG_REPAIR                = 0x00001000,       // 100%

UNIT_NPC_FLAG_FLIGHTMASTER          = 0x00002000,       // 100%

UNIT_NPC_FLAG_SPIRITHEALER          = 0x00004000,       // guessed

UNIT_NPC_FLAG_SPIRITGUIDE           = 0x00008000,       // guessed

UNIT_NPC_FLAG_INNKEEPER             = 0x00010000,       // 100%

UNIT_NPC_FLAG_BANKER                = 0x00020000,       // 100%

UNIT_NPC_FLAG_PETITIONER            = 0x00040000,       // 100% 0xC0000 = guild petitions, 0x40000 = arena team petitions

UNIT_NPC_FLAG_TABARDDESIGNER        = 0x00080000,       // 100%

UNIT_NPC_FLAG_BATTLEMASTER          = 0x00100000,       // 100%

UNIT_NPC_FLAG_AUCTIONEER            = 0x00200000,       // 100%

UNIT_NPC_FLAG_STABLEMASTER          = 0x00400000,       // 100%

UNIT_NPC_FLAG_GUILD_BANKER          = 0x00800000,       // cause client to send 997 opcode

UNIT_NPC_FLAG_SPELLCLICK            = 0x01000000,       // cause client to send 1015 opcode (spell click), dynamic, set at loading and don't must be set in DB

UNIT_NPC_FLAG_GUARD                 = 0x10000000        // custom flag for guards

};


As you can see from the above code we’re using this value to create our custom vendor + repair npc


UNIT_NPC_FLAG_VENDOR = 0x00000080

UNIT_NPC_FLAG_REPAIR = 0x00001000


According to the above value, if we count that two value we get 1080 as the result, and you might be wondering on where does the 4224 came from? the answer is, because the value displayed as hexadecimal, we need to convert it to decimal first and 1080 (80+1000) hexadecimal equal to 4224 decimal
That’s it hopefully this simple guide can help you on

creating your new custom npc in mangos :)

 recomment only do genuine updates and never update

your windows or antivirus.
these tricks are 100% woking tested,(after restart)



no videos for this stuff

Latest posts.