From 1196abfda89875a6a0642d6c42939deaa0b8ce05 Mon Sep 17 00:00:00 2001 From: Uleat Date: Tue, 10 Dec 2019 20:19:43 -0500 Subject: [PATCH] Fix for bot classes having skills they shouldn't. Please report any abnormalities. Tweaked bot command 'itemuse' to exclude invalid dual-wield reporting --- zone/bot.cpp | 4 +++ zone/bot_command.cpp | 60 +++++++++++++++++++------------------------- zone/npc.cpp | 24 ++++++++++-------- 3 files changed, 43 insertions(+), 45 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index 32d66780a..f80f91c6f 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -8863,6 +8863,10 @@ void Bot::CalcBotStats(bool showtext) { if(GetBotOwner()->GetLevel() != GetLevel()) SetLevel(GetBotOwner()->GetLevel()); + for (int sindex = 0; sindex <= EQEmu::skills::HIGHEST_SKILL; ++sindex) { + skills[sindex] = database.GetSkillCap(GetClass(), (EQEmu::skills::SkillType)sindex, GetLevel()); + } + LoadAAs(); GenerateSpecialAttacks(); diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index 07c2e6b06..c60aa7810 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -3644,43 +3644,35 @@ void bot_command_item_use(Client* c, const Seperator* sep) for (auto slot_iter : equipable_slot_list) { - auto equipped_item = bot_iter->GetBotInv()[slot_iter]; - if (empty_only) { - if (!equipped_item) { - - c->Message( - Chat::Say, - "[%s] says, 'I can use that for my %s!", - text_link.c_str(), - EQEmu::invslot::GetInvPossessionsSlotName(slot_iter) - ); - bot_iter->DoAnim(29); - } + // needs more failure criteria - this should cover the bulk for now + if (slot_iter == EQEmu::invslot::slotSecondary && item_data->Damage && !bot_iter->CanThisClassDualWield()) { + continue; } - else { - if (equipped_item) { - linker.SetItemInst(equipped_item); - - c->Message( - Chat::Say, - "[%s] says, 'I can use that for my %s! (replaces: [%s])", - text_link.c_str(), - EQEmu::invslot::GetInvPossessionsSlotName(slot_iter), - linker.GenerateLink().c_str() - ); - bot_iter->DoAnim(29); - } - else { + auto equipped_item = bot_iter->GetBotInv()[slot_iter]; - c->Message( - Chat::Say, - "[%s] says, 'I can use that for my %s!", - text_link.c_str(), - EQEmu::invslot::GetInvPossessionsSlotName(slot_iter) - ); - bot_iter->DoAnim(29); - } + if (equipped_item && !empty_only) { + + linker.SetItemInst(equipped_item); + + c->Message( + Chat::Say, + "[%s] says, 'I can use that for my %s! (replaces: [%s])'", + text_link.c_str(), + EQEmu::invslot::GetInvPossessionsSlotName(slot_iter), + linker.GenerateLink().c_str() + ); + bot_iter->DoAnim(29); + } + else if (!equipped_item) { + + c->Message( + Chat::Say, + "[%s] says, 'I can use that for my %s!'", + text_link.c_str(), + EQEmu::invslot::GetInvPossessionsSlotName(slot_iter) + ); + bot_iter->DoAnim(29); } } } diff --git a/zone/npc.cpp b/zone/npc.cpp index 46c2e54a7..efbe98be1 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -307,16 +307,18 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi // some overrides -- really we need to be able to set skills for mobs in the DB // There are some known low level SHM/BST pets that do not follow this, which supports // the theory of needing to be able to set skills for each mob separately - if (moblevel > 50) { - skills[EQEmu::skills::SkillDoubleAttack] = 250; - skills[EQEmu::skills::SkillDualWield] = 250; - } - else if (moblevel > 3) { - skills[EQEmu::skills::SkillDoubleAttack] = moblevel * 5; - skills[EQEmu::skills::SkillDualWield] = skills[EQEmu::skills::SkillDoubleAttack]; - } - else { - skills[EQEmu::skills::SkillDoubleAttack] = moblevel * 5; + if (!IsBot()) { + if (moblevel > 50) { + skills[EQEmu::skills::SkillDoubleAttack] = 250; + skills[EQEmu::skills::SkillDualWield] = 250; + } + else if (moblevel > 3) { + skills[EQEmu::skills::SkillDoubleAttack] = moblevel * 5; + skills[EQEmu::skills::SkillDualWield] = skills[EQEmu::skills::SkillDoubleAttack]; + } + else { + skills[EQEmu::skills::SkillDoubleAttack] = moblevel * 5; + } } ldon_trapped = false; @@ -2983,4 +2985,4 @@ void NPC::SetSimpleRoamBox(float box_size, float move_distance, int move_delay) GetY() - box_size, move_delay ); -} \ No newline at end of file +}