Closed RobertoHendo closed 1 month ago
Hello again, I have been messing with my SpellHandler.cpp in an attempt to change the visual appearance, (i have a backup of course) I have made some progress, they no longer wear the haliscan jacket or pants, they just have some type of boots, pants, belt etc. I am very new to this, so ive been attempting to use chatgpt to help me fill in the gaps of what to do, but no matter what it seems to just not hold any new appearances, I know you said it was pretty easy to add and change the default visuals, and I was wondering if you could lend some tips on how, it would be very appreciated, thank you.
It isn't clear to me what you tried exactly.
Here is an example code snippet (SpellHandler line 763) allowing to set default displayed equipment per bot class per slot (here it's only Druid). \
...
uint32 display_id = bot->GetBotAI()->GetEquipDisplayId(slot);
if (display_id)
data << uint32(display_id);
else
{
switch (bot->GetBotClass())
{
case BOT_CLASS_DRUID:
switch (slot)
{
case BOT_SLOT_SHOULDERS:
data << uint32(<PLACEHOLDER>);
break;
case BOT_SLOT_CHEST:
data << uint32(<PLACEHOLDER>);
break;
case BOT_SLOT_LEGS:
data << uint32(<PLACEHOLDER>);
break;
case BOT_SLOT_FEET:
data << uint32(<PLACEHOLDER>);
break;
case BOT_SLOT_HANDS:
data << uint32(<PLACEHOLDER>);
break;
default:
data << uint32(0);
break;
}
break;
default:
//don't allow to go naked
if (slot == BOT_SLOT_CHEST)
data << uint32(CHEST_HALISCAN);
else if (slot == BOT_SLOT_LEGS)
data << uint32(LEGS_HALISCAN);
else
data << uint32(0);
break;
}
}
...
Thanks for the fast response, I finally got a chance to try and input this in my SpellHandler.cpp it compiled with no errors, however upon adding and changing the
Are you sure you use item displayid and not item id?
Yes, I double checked just to be sure, maybe im inserting it wrong somehow? Because the druids spawn with just haliscan sleeves, and every other npcbot spawns naked, and remains naked even with clothes equipped. Ive got it inserted at line 763, and the only things ive changed has been the
this is the snippet from 755 to 808, ive included a little bit of code from before and a little after, ive got the displayid (doublechecked with trinity creator)
//Items not displayed on bot: tabard, head, back if (slot == 0 || (slot == BOT_SLOT_HEAD && BotMgr::ShowEquippedHelm() == false) || (slot == BOT_SLOT_BACK && BotMgr::ShowEquippedCloak() == false)) { data << uint32(0); continue; } uint32 display_id = bot->GetBotAI()->GetEquipDisplayId(slot); if (display_id) data << uint32(display_id); else { switch (bot->GetBotClass()) { case BOT_CLASS_DRUID: switch (slot) { case BOT_SLOT_SHOULDERS: data << uint32(32016); break; case BOT_SLOT_CHEST: data << uint32(31934); break; case BOT_SLOT_LEGS: data << uint32(33148); break; case BOT_SLOT_FEET: data << uint32(4389); break; case BOT_SLOT_HANDS: data << uint32(33842); break; default: data << uint32(0); break; } break; default: //don't allow to go naked if (slot == BOT_SLOT_CHEST) data << uint32(CHEST_HALISCAN); else if (slot == BOT_SLOT_LEGS) data << uint32(LEGS_HALISCAN); else data << uint32(0); break; } } display_id = bot->GetBotAI()->GetEquipDisplayId(slot); if (display_id) data << uint32(display_id); else {
Take a look at the original code
uint32 display_id = bot->GetBotAI()->GetEquipDisplayId(slot);
if (display_id)
data << uint32(display_id);
else
{
//don't allow to go naked
if (slot == BOT_SLOT_CHEST)
data << uint32(CHEST_HALISCAN);
else if (slot == BOT_SLOT_LEGS)
data << uint32(LEGS_HALISCAN);
else
data << uint32(0);
}
Looks like you've added the code I posted above this code block instead of replacing it. As a result you put a value onto a stream twice per equipment slot
This code chunk is duplicated:
display_id = bot->GetBotAI()->GetEquipDisplayId(slot);
if (display_id)
data << uint32(display_id);
...
Alright i got it to stick, i appreciate all your help! i assume to add other classes its simply just a copy / paste the following after the end bracket?
switch (bot->GetBotClass())
{
case BOT_CLASS_DRUID:
switch (slot)
{
case BOT_SLOT_SHOULDERS:
data << uint32(
No. First do some reading on how switch works and what scope is. Then notice that not all equipment slots were covered within druid case there (yes I did it on purpose). Once you add all remaining equipment slots you will be able to just copy whole druid block and and make it work for a new class, then another, ultimately adding all (standard) classes. Sorry but it isn't possible to guide you if you don't even know C++ basics.
DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
Description
Hello, I have been looking through the SQL and these forums and discussions and I was wondering if it was possible to change the Basic Clothing they are equipped with when they spawn to something more class oriented. I.e Plate for warrior / Robe for caster instead of the Matador jacket theyre equipped with. Im new to all this computer editing and programming stuff, I had seen in a post almost 2 years ago that it was hardcoded, is that still the case? Thanks
TrinityCore or AzerothCore
AzerothCore
Core rev. hash/commit
AzerothCore rev. 64c9e4a0a4d5+ 2024-09-15 21:16:14 +0000 (master branch) (Win64, RelWithDebInfo, Static) (authserver)
Operating system
Win10