Reputation: 478
I can change the weapons for a creature like follows.
But how can I also change the cloths like head, chest, neck etc?
switch (i)
{
case SLOT_MAIN_HAND:
creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, itemID);
break;
case SLOT_OFF_HAND:
creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, itemID);
break;
case SLOT_RANGED:
creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, itemID);
break;
}
Upvotes: 1
Views: 657
Reputation: 1
If you want to change their gear you have 2 options. Depending on the core you are using.
For azerothcore, you will have to edit the dbc files.
-CreaturedisplayinfoExtra.dbc
is resposible for creating unique creature displays. Here you can set the face hair race and sex, but also the itemID's they should be wearing as gear.
For Trinitycore, you can install DressNPC from rochet2 http://rochet2.github.io/Dress-NPCs.html
this is an incredible time save compared to Azerothcore but works kinda the same way.
You will have a table called creatureoutfits if i'm not mistaken, here you can fill in the same stuff like azeroth asks. Race, sex, hair, face but also the itemID's for the gears. THE ID OF THIS COSTUME MUST BE OVER 2147M (been a while since i used this but pretty sure this is still the case)
Then assign for both cores. Assign this new DisplayID/CostumeID as a displayid to the creature in creaturetemplate
then for azerothcore you will need to make sure you adjusted the dbc file mentioned above and saved this. Then restart the worldserver.
For trinitycore, after installing dressnpc. You can reload the table ingame to see the effect. After creating the new ID i believe a restart is required to see the effect. After that reloads will work for adjustments.
Upvotes: 0
Reputation: 425
There is the creature_equip_template
table, where predefined gear can be stored. Even multiple sets of it. I'd try and track the functions loading that table.
Upvotes: 1