Skip to content

Commit

Permalink
NPCBots: Fix class set equipment vendor items for extra bot classes
Browse files Browse the repository at this point in the history
(cherry picked from commit 68204c659c05779a592298df14baf03be76b3993)
  • Loading branch information
trickerer committed Apr 30, 2024
1 parent 6077113 commit 8352af3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
35 changes: 34 additions & 1 deletion src/server/game/AI/NpcBots/botmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ uint32 BotMgr::GetAllNpcBotsClassMask() const
{
uint32 classMask = 0;
for (BotMap::const_iterator itr = _bots.begin(); itr != _bots.end(); ++itr)
classMask |= (1 << (itr->second->GetBotClass() - 1));
classMask |= (1 << (BotMgr::GetBotEquipmentClass(itr->second->GetBotClass()) - 1));

return classMask;
}
Expand Down Expand Up @@ -1975,6 +1975,39 @@ uint8 BotMgr::GetBotPlayerRace(Creature const* bot)
return GetBotPlayerRace(bot->GetBotAI()->GetBotClass(), bot->GetRace());
}

uint8 BotMgr::GetBotEquipmentClass(uint8 bot_class)
{
if (bot_class >= BOT_CLASS_EX_START)
{
switch (bot_class)
{
case BOT_CLASS_BM:
return BOT_CLASS_WARRIOR;
case BOT_CLASS_SPHYNX:
return BOT_CLASS_PALADIN;
case BOT_CLASS_ARCHMAGE:
return BOT_CLASS_MAGE;
case BOT_CLASS_DREADLORD:
return BOT_CLASS_PALADIN;
case BOT_CLASS_SPELLBREAKER:
return BOT_CLASS_PALADIN;
case BOT_CLASS_DARK_RANGER:
return BOT_CLASS_HUNTER;
case BOT_CLASS_NECROMANCER:
return BOT_CLASS_PALADIN;
case BOT_CLASS_SEA_WITCH:
return BOT_CLASS_MAGE;
case BOT_CLASS_CRYPT_LORD:
return BOT_CLASS_WARRIOR;
default:
TC_LOG_ERROR("npcbots", "GetPlayerClass: unknown Ex bot class {}!", bot_class);
return BOT_CLASS_PALADIN;
}
}

return BotMgr::GetBotPlayerClass(bot_class);
}

std::string BotMgr::GetTargetIconString(uint8 icon) const
{
std::ostringstream ss;
Expand Down
1 change: 1 addition & 0 deletions src/server/game/AI/NpcBots/botmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ class TC_GAME_API BotMgr
static uint8 GetBotPlayerRace(uint8 bot_class, uint8 bot_race);
static uint8 GetBotPlayerClass(Creature const* bot);
static uint8 GetBotPlayerRace(Creature const* bot);
static uint8 GetBotEquipmentClass(uint8 bot_class);

std::string GetTargetIconString(uint8 icon) const;

Expand Down

0 comments on commit 8352af3

Please sign in to comment.