diff --git a/zone/bot.cpp b/zone/bot.cpp index ccbcae8a4..9fc169319 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -11734,6 +11734,10 @@ void Bot::CopySettings(Bot* to, uint8 settingType, uint16 spellType) { void Bot::CopyBotSpellSettings(Bot* to) { + if (!to) { + return; + } + to->ResetBotSpellSettings(); to->bot_spell_settings.clear(); @@ -11784,6 +11788,38 @@ void Bot::ResetBotSpellSettings() SetBotEnforceSpellSetting(false); } +void Bot::CopyBotBlockedBuffs(Bot* to) { + if (!to) { + return; + } + + to->ClearBotBlockedBuffs(); + + std::vector blockedBuffs = GetBotBlockedBuffs(); + + if (!blockedBuffs.empty()) { + for (auto& blocked_buff : blockedBuffs) { + to->SetBotBlockedBuff(blocked_buff.spell_id, blocked_buff.blocked); + } + } +} + +void Bot::CopyBotBlockedPetBuffs(Bot* to) { + if (!to) { + return; + } + + to->ClearBotBlockedBuffs(); + + std::vector blockedBuffs = GetBotBlockedBuffs(); + + if (!blockedBuffs.empty()) { + for (auto& blocked_buff : blockedBuffs) { + to->SetBotBlockedPetBuff(blocked_buff.spell_id, blocked_buff.blocked_pet); + } + } +} + bool Bot::BotPassiveCheck() { if (GetBotStance() == Stance::Passive) { GetOwner()->Message( diff --git a/zone/bot.h b/zone/bot.h index c96632d8e..7eb348ec3 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -472,6 +472,7 @@ public: void CopyBotSpellSettings(Bot* to); void ResetBotSpellSettings(); void CopyBotBlockedBuffs(Bot* to); + void CopyBotBlockedPetBuffs(Bot* to); int GetBotBaseSetting(uint16 botSetting); int GetDefaultBotBaseSetting(uint16 botSetting, uint8 stance = Stance::Balanced); void SetBotBaseSetting(uint16 botSetting, int settingValue); diff --git a/zone/bot_commands/default_settings.cpp b/zone/bot_commands/default_settings.cpp index 506607401..2e3ecc9c2 100644 --- a/zone/bot_commands/default_settings.cpp +++ b/zone/bot_commands/default_settings.cpp @@ -358,7 +358,7 @@ void bot_command_default_settings(Client* c, const Seperator* sep) } else if (!strcasecmp(sep->arg[1], "targetcounts")) { if (spellType != UINT16_MAX) { - myBot->SetSpellDelay(spellType, myBot->GetDefaultSpellDelay(spellType, botStance)); + myBot->SetSpellTypeAEOrGroupTargetCount(spellType, myBot->GetDefaultSpellTypeAEOrGroupTargetCount(spellType, botStance)); } else { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { @@ -366,7 +366,7 @@ void bot_command_default_settings(Client* c, const Seperator* sep) } } - output = "ae/group count settings"; + output = "target count settings"; } else if (!strcasecmp(sep->arg[1], "spellsettings")) { myBot->ResetBotSpellSettings(); @@ -430,6 +430,9 @@ void bot_command_default_settings(Client* c, const Seperator* sep) }; myBot->ResetBotSpellSettings(); + myBot->ClearBotBlockedBuffs(); + + myBot->Save(); output = "settings"; diff --git a/zone/mob.cpp b/zone/mob.cpp index 44151a06f..af159dfbc 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -8751,6 +8751,16 @@ std::string Mob::GetBotSpellCategoryName(uint8 setting_type) { return "Null"; } +uint16 Mob::GetBotSpellCategoryIDByShortName(std::string settingString) { + for (int i = BotSettingCategories::START; i <= BotSettingCategories::END; ++i) { + if (!Strings::ToLower(settingString).compare(Strings::ToLower(GetBotSpellCategoryName(i)))) { + return i; + } + } + + return UINT16_MAX; +} + std::string Mob::GetBotSettingCategoryName(uint8 setting_type) { switch (setting_type) { case BotBaseSettings::ExpansionBitmask: @@ -8789,9 +8799,8 @@ std::string Mob::GetBotSettingCategoryName(uint8 setting_type) { } uint16 Mob::GetBaseSettingIDByShortName(std::string settingString) { - for (int i = BotSettingCategories::START; i <= BotSettingCategories::END; ++i) { - if (!Strings::ToLower(settingString).compare(GetBotSettingCategoryName(i))) { + if (!Strings::ToLower(settingString).compare(Strings::ToLower(GetBotSettingCategoryName(i)))) { return i; } } diff --git a/zone/mob.h b/zone/mob.h index 29baea67e..e38e13337 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -435,6 +435,7 @@ public: uint16 GetSpellTypeIDByShortName(std::string spellTypeString); std::string GetBotSpellCategoryName(uint8 setting_type); + uint16 GetBotSpellCategoryIDByShortName(std::string settingString); std::string GetBotSettingCategoryName(uint8 setting_type); uint16 GetBaseSettingIDByShortName(std::string settingString); std::string GetSpellTypeNameByID(uint16 spellType);