From 980aa65eccffd02dbeca9692760ca788723110af Mon Sep 17 00:00:00 2001 From: nytmyr <53322305+nytmyr@users.noreply.github.com> Date: Fri, 31 Jan 2025 17:05:50 -0600 Subject: [PATCH] Rename SpellHold, SpellDelay, SpellMinThreshold, SpellMaxThreshold, SpellRecastDelay to fit SpellType style naming --- zone/bot.cpp | 151 ++++++++++++--------- zone/bot.h | 34 ++--- zone/bot_commands/default_settings.cpp | 48 ++++--- zone/bot_commands/spell_delays.cpp | 12 +- zone/bot_commands/spell_holds.cpp | 6 +- zone/bot_commands/spell_max_thresholds.cpp | 12 +- zone/bot_commands/spell_min_thresholds.cpp | 12 +- zone/client.h | 18 +-- zone/client_bot.cpp | 34 ++--- 9 files changed, 177 insertions(+), 150 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index b40149aed..98b8a242b 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -2928,7 +2928,7 @@ bool Bot::TryFacingTarget(Mob* tar) { bool Bot::TryEvade(Mob* tar) { - if (GetSpellHold(BotSpellTypes::Escape)) { + if (GetSpellTypeHold(BotSpellTypes::Escape)) { return false; } @@ -7856,7 +7856,11 @@ bool Bot::GetNeedsHateRedux(Mob *tar) { } if (tar->IsBot()) { - if (tar->GetHPRatio() > GetUltimateSpellMinThreshold(BotSpellTypes::HateRedux, tar) && tar->GetHPRatio() < GetUltimateSpellMaxThreshold(BotSpellTypes::HateRedux, tar)) { + if (tar->GetHPRatio() > GetUltimateSpellTypeMinThreshold(BotSpellTypes::HateRedux, tar) && tar->GetHPRatio() < + GetUltimateSpellTypeMaxThreshold( + BotSpellTypes::HateRedux, + tar + )) { return true; } } @@ -9433,11 +9437,11 @@ bool Bot::PrecastChecks(Mob* tar, uint16 spell_type) { LogBotSpellChecksDetail("{} says, 'Running [{}] PreChecks on [{}].'", GetCleanName(), GetSpellTypeNameByID(spell_type), tar->GetCleanName()); - if (GetUltimateSpellHold(spell_type, tar)) { + if (GetUltimateSpellTypeHold(spell_type, tar)) { if (!IsCommandedSpell()) { SetSpellTypeAITimer(spell_type, RuleI(Bots, AICastSpellTypeHeldDelay)); } - LogBotSpellChecksDetail("{} says, 'Cancelling cast of [{}] on [{}] due to GetUltimateSpellHold.'", GetCleanName(), GetSpellTypeNameByID(spell_type), tar->GetCleanName()); + LogBotSpellChecksDetail("{} says, 'Cancelling cast of [{}] on [{}] due to GetUltimateSpellTypeHold.'", GetCleanName(), GetSpellTypeNameByID(spell_type), tar->GetCleanName()); return false; } @@ -9464,8 +9468,8 @@ bool Bot::PrecastChecks(Mob* tar, uint16 spell_type) { return false; } - if (!GetUltimateSpellDelayCheck(spell_type, tar)) { - LogBotSpellChecksDetail("{} says, 'Cancelling cast of [{}] on [{}] due to GetUltimateSpellDelayCheck.'", GetCleanName(), GetSpellTypeNameByID(spell_type), tar->GetCleanName()); + if (!GetUltimateSpellTypeDelayCheck(spell_type, tar)) { + LogBotSpellChecksDetail("{} says, 'Cancelling cast of [{}] on [{}] due to GetUltimateSpellTypeDelayCheck.'", GetCleanName(), GetSpellTypeNameByID(spell_type), tar->GetCleanName()); return false; } @@ -9475,10 +9479,10 @@ bool Bot::PrecastChecks(Mob* tar, uint16 spell_type) { return true; default: if ( - GetHPRatioForSpellType(spell_type, tar) < GetUltimateSpellMinThreshold(spell_type, tar) || - GetHPRatioForSpellType(spell_type, tar) > GetUltimateSpellMaxThreshold(spell_type, tar) + GetHPRatioForSpellType(spell_type, tar) < GetUltimateSpellTypeMinThreshold(spell_type, tar) || + GetHPRatioForSpellType(spell_type, tar) > GetUltimateSpellTypeMaxThreshold(spell_type, tar) ) { - LogBotSpellChecksDetail("{} says, 'Cancelling cast of [{}] on [{}] due to GetUltimateSpellMinThreshold or GetUltimateSpellMaxThreshold.'", GetCleanName(), GetSpellTypeNameByID(spell_type), tar->GetCleanName()); + LogBotSpellChecksDetail("{} says, 'Cancelling cast of [{}] on [{}] due to GetUltimateSpellTypeMinThreshold or GetUltimateSpellTypeMaxThreshold.'", GetCleanName(), GetSpellTypeNameByID(spell_type), tar->GetCleanName()); return false; } } @@ -10287,16 +10291,16 @@ void Bot::SetBotSetting(uint8 setting_type, uint16 bot_setting, int setting_valu SetBotBaseSetting(bot_setting, setting_value); break; case BotSettingCategories::SpellHold: - SetSpellHold(bot_setting, setting_value); + SetSpellTypeHold(bot_setting, setting_value); break; case BotSettingCategories::SpellDelay: - SetSpellDelay(bot_setting, setting_value); + SetSpellTypeDelay(bot_setting, setting_value); break; case BotSettingCategories::SpellMinThreshold: - SetSpellMinThreshold(bot_setting, setting_value); + SetSpellTypeMinThreshold(bot_setting, setting_value); break; case BotSettingCategories::SpellMaxThreshold: - SetSpellMaxThreshold(bot_setting, setting_value); + SetSpellTypeMaxThreshold(bot_setting, setting_value); break; case BotSettingCategories::SpellTypeResistLimit: SetSpellTypeResistLimit(bot_setting, setting_value); @@ -10493,10 +10497,10 @@ void Bot::LoadDefaultBotSettings() { t.spell_type = i; t.short_name = GetSpellTypeShortNameByID(i); t.name = GetSpellTypeNameByID(i); - t.hold = GetDefaultSpellHold(i, bot_stance); - t.delay = GetDefaultSpellDelay(i, bot_stance); - t.min_threshold = GetDefaultSpellMinThreshold(i, bot_stance); - t.max_threshold = GetDefaultSpellMaxThreshold(i, bot_stance); + t.hold = GetDefaultSpellTypeHold(i, bot_stance); + t.delay = GetDefaultSpellTypeDelay(i, bot_stance); + t.min_threshold = GetDefaultSpellTypeMinThreshold(i, bot_stance); + t.max_threshold = GetDefaultSpellTypeMaxThreshold(i, bot_stance); t.resist_limit = GetDefaultSpellTypeResistLimit(i, bot_stance); t.aggro_check = GetDefaultSpellTypeAggroCheck(i, bot_stance); t.min_mana_pct = GetDefaultSpellTypeMinManaLimit(i, bot_stance); @@ -10529,7 +10533,11 @@ void Bot::LoadDefaultBotSettings() { m_bot_spell_settings.push_back(t); LogBotSettingsDetail("{} says, 'Setting defaults for {} ({}) [#{}] - [{} [#{}] stance]'", GetCleanName(), t.name, t.short_name, t.spell_type, Stance::GetName(bot_stance), bot_stance); - LogBotSettingsDetail("{} says, 'Hold = [{}] | Delay = [{}ms] | MinThreshold = [{}\%] | MaxThreshold = [{}\%]'", GetCleanName(), GetDefaultSpellHold(i, bot_stance), GetDefaultSpellDelay(i, bot_stance), GetDefaultSpellMinThreshold(i, bot_stance), GetDefaultSpellMaxThreshold(i, bot_stance)); + LogBotSettingsDetail("{} says, 'Hold = [{}] | Delay = [{}ms] | MinThreshold = [{}\%] | MaxThreshold = [{}\%]'", GetCleanName(), + GetDefaultSpellTypeHold(i, bot_stance), + GetDefaultSpellTypeDelay(i, bot_stance), + GetDefaultSpellTypeMinThreshold(i, bot_stance), + GetDefaultSpellTypeMaxThreshold(i, bot_stance)); LogBotSettingsDetail("{} says, 'AggroCheck = [{}] | MinManaPCT = [{}\%] | MaxManaPCT = [{}\%] | MinHPPCT = [{}\% | MaxHPPCT = [{}\%]'", GetCleanName(), GetDefaultSpellTypeAggroCheck(i, bot_stance), GetDefaultSpellTypeMinManaLimit(i, bot_stance), GetDefaultSpellTypeMaxManaLimit(i, bot_stance), GetDefaultSpellTypeMinHPLimit(i, bot_stance), GetDefaultSpellTypeMaxHPLimit(i, bot_stance)); LogBotSettingsDetail("{} says, 'IdlePriority = [{}] | EngagedPriority = [{}] | PursuePriority = [{}]'", GetCleanName(), GetDefaultSpellTypeIdlePriority(i, GetClass(), bot_stance), GetDefaultSpellTypeEngagedPriority(i, GetClass(), bot_stance), GetDefaultSpellTypePursuePriority(i, GetClass(), bot_stance)); LogBotSettingsDetail("{} says, 'TargetCount = [{}] | AnnounceCast = [{}]'", GetCleanName(), GetDefaultSpellTypeAEOrGroupTargetCount(i, bot_stance), GetDefaultSpellTypeAnnounceCast(i, bot_stance)); @@ -10560,22 +10568,22 @@ void Bot::SetBotSpellRecastTimer(uint16 spell_type, Mob* tar, bool precast) { Mob* owner = tar->GetOwner(); if (owner->IsClient()) { - owner->CastToClient()->SetSpellTypeRecastTimer(spell_type, (GetUltimateSpellDelay(spell_type, tar) + added_delay)); + owner->CastToClient()->SetSpellTypeRecastTimer(spell_type, (GetUltimateSpellTypeDelay(spell_type, tar) + added_delay)); } else { - owner->CastToBot()->SetSpellTypeRecastTimer(spell_type, (GetUltimateSpellDelay(spell_type, tar) + added_delay)); + owner->CastToBot()->SetSpellTypeRecastTimer(spell_type, (GetUltimateSpellTypeDelay(spell_type, tar) + added_delay)); } } else if (IsBotSpellTypeOtherBeneficial(spell_type)) { if (tar->IsClient()) { - tar->CastToClient()->SetSpellTypeRecastTimer(spell_type, (GetUltimateSpellDelay(spell_type, tar) + added_delay)); + tar->CastToClient()->SetSpellTypeRecastTimer(spell_type, (GetUltimateSpellTypeDelay(spell_type, tar) + added_delay)); } else { - tar->CastToBot()->SetSpellTypeRecastTimer(spell_type, (GetUltimateSpellDelay(spell_type, tar) + added_delay)); + tar->CastToBot()->SetSpellTypeRecastTimer(spell_type, (GetUltimateSpellTypeDelay(spell_type, tar) + added_delay)); } } else { - SetSpellTypeRecastTimer(spell_type, (GetUltimateSpellDelay(spell_type, tar) + added_delay)); + SetSpellTypeRecastTimer(spell_type, (GetUltimateSpellTypeDelay(spell_type, tar) + added_delay)); } } @@ -10623,13 +10631,13 @@ int Bot::GetDefaultSetting(uint16 setting_category, uint16 setting_type, uint8 s case BotSettingCategories::BaseSetting: return GetDefaultBotBaseSetting(setting_type, stance); case BotSettingCategories::SpellHold: - return GetDefaultSpellHold(setting_type, stance); + return GetDefaultSpellTypeHold(setting_type, stance); case BotSettingCategories::SpellDelay: - return GetDefaultSpellDelay(setting_type, stance); + return GetDefaultSpellTypeDelay(setting_type, stance); case BotSettingCategories::SpellMinThreshold: - return GetDefaultSpellMinThreshold(setting_type, stance); + return GetDefaultSpellTypeMinThreshold(setting_type, stance); case BotSettingCategories::SpellMaxThreshold: - return GetDefaultSpellMaxThreshold(setting_type, stance); + return GetDefaultSpellTypeMaxThreshold(setting_type, stance); case BotSettingCategories::SpellTypeResistLimit: return GetDefaultSpellTypeResistLimit(setting_type, stance); case BotSettingCategories::SpellTypeAggroCheck: @@ -10662,13 +10670,13 @@ int Bot::GetSetting(uint16 setting_category, uint16 setting_type) { case BotSettingCategories::BaseSetting: return GetBotBaseSetting(setting_type); case BotSettingCategories::SpellHold: - return GetSpellHold(setting_type); + return GetSpellTypeHold(setting_type); case BotSettingCategories::SpellDelay: - return GetSpellDelay(setting_type); + return GetSpellTypeDelay(setting_type); case BotSettingCategories::SpellMinThreshold: - return GetSpellMinThreshold(setting_type); + return GetSpellTypeMinThreshold(setting_type); case BotSettingCategories::SpellMaxThreshold: - return GetSpellMaxThreshold(setting_type); + return GetSpellTypeMaxThreshold(setting_type); case BotSettingCategories::SpellTypeResistLimit: return GetSpellTypeResistLimit(setting_type); case BotSettingCategories::SpellTypeAggroCheck: @@ -10696,7 +10704,7 @@ int Bot::GetSetting(uint16 setting_category, uint16 setting_type) { } } -bool Bot::GetDefaultSpellHold(uint16 spell_type, uint8 stance) { +bool Bot::GetDefaultSpellTypeHold(uint16 spell_type, uint8 stance) { uint8 bot_class = GetClass(); switch (spell_type) { @@ -11162,16 +11170,16 @@ uint16 Bot::GetDefaultSpellTypeAnnounceCast(uint16 spell_type, uint8 stance) { return 1; } -bool Bot::GetUltimateSpellHold(uint16 spell_type, Mob* tar) { +bool Bot::GetUltimateSpellTypeHold(uint16 spell_type, Mob* tar) { if (!tar) { - return GetSpellHold(spell_type); + return GetSpellTypeHold(spell_type); } if (tar->IsPet() && tar->GetOwner() && tar->IsPetOwnerBot()) { - return tar->GetOwner()->CastToBot()->GetSpellHold(GetPetBotSpellType(spell_type)); + return tar->GetOwner()->CastToBot()->GetSpellTypeHold(GetPetBotSpellType(spell_type)); } - return GetSpellHold(spell_type); + return GetSpellTypeHold(spell_type); } void Bot::SetSpellTypePriority(uint16 spell_type, uint8 priority_type, uint16 priority) { @@ -11974,7 +11982,7 @@ bool Bot::RequiresLoSForPositioning() { } for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { - if (IsBotSpellTypeDetrimental(i) && !GetSpellHold(i)) { + if (IsBotSpellTypeDetrimental(i) && !GetSpellTypeHold(i)) { return true; } } @@ -12100,44 +12108,44 @@ void Bot::CopySettings(Bot* to, uint8 setting_type, uint16 spell_type) { break; case BotSettingCategories::SpellHold: if (spell_type != UINT16_MAX) { - to->SetSpellHold(spell_type, GetSpellHold(spell_type)); + to->SetSpellTypeHold(spell_type, GetSpellTypeHold(spell_type)); } else { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { - to->SetSpellHold(i, GetSpellHold(i)); + to->SetSpellTypeHold(i, GetSpellTypeHold(i)); } } break; case BotSettingCategories::SpellDelay: if (spell_type != UINT16_MAX) { - to->SetSpellDelay(spell_type, GetSpellDelay(spell_type)); + to->SetSpellTypeDelay(spell_type, GetSpellTypeDelay(spell_type)); } else { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { - to->SetSpellDelay(i, GetSpellDelay(i)); + to->SetSpellTypeDelay(i, GetSpellTypeDelay(i)); } } break; case BotSettingCategories::SpellMinThreshold: if (spell_type != UINT16_MAX) { - to->SetSpellMinThreshold(spell_type, GetSpellMinThreshold(spell_type)); + to->SetSpellTypeMinThreshold(spell_type, GetSpellTypeMinThreshold(spell_type)); } else { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { - to->SetSpellMinThreshold(i, GetSpellMinThreshold(i)); + to->SetSpellTypeMinThreshold(i, GetSpellTypeMinThreshold(i)); } } break; case BotSettingCategories::SpellMaxThreshold: if (spell_type != UINT16_MAX) { - to->SetSpellMaxThreshold(spell_type, GetSpellMaxThreshold(spell_type)); + to->SetSpellTypeMaxThreshold(spell_type, GetSpellTypeMaxThreshold(spell_type)); } else { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { - to->SetSpellMaxThreshold(i, GetSpellMaxThreshold(i)); + to->SetSpellTypeMaxThreshold(i, GetSpellTypeMaxThreshold(i)); } } @@ -12836,7 +12844,7 @@ std::string Bot::GetSubTypeNameByID(uint16 sub_type) { return IsValidBotSpellType(sub_type) ? botSubType_names[sub_type] : "UNKNOWN SUBTYPE"; } -uint16 Bot::GetDefaultSpellDelay(uint16 spell_type, uint8 stance) { +uint16 Bot::GetDefaultSpellTypeDelay(uint16 spell_type, uint8 stance) { switch (spell_type) { case BotSpellTypes::VeryFastHeals: case BotSpellTypes::PetVeryFastHeals: @@ -12909,7 +12917,7 @@ uint16 Bot::GetDefaultSpellDelay(uint16 spell_type, uint8 stance) { } } -uint8 Bot::GetDefaultSpellMinThreshold(uint16 spell_type, uint8 stance) { +uint8 Bot::GetDefaultSpellTypeMinThreshold(uint16 spell_type, uint8 stance) { switch (spell_type) { case BotSpellTypes::AEDebuff: case BotSpellTypes::Debuff: @@ -12957,7 +12965,7 @@ uint8 Bot::GetDefaultSpellMinThreshold(uint16 spell_type, uint8 stance) { } } -uint8 Bot::GetDefaultSpellMaxThreshold(uint16 spell_type, uint8 stance) { +uint8 Bot::GetDefaultSpellTypeMaxThreshold(uint16 spell_type, uint8 stance) { uint8 bot_class = GetClass(); switch (spell_type) { @@ -12989,7 +12997,7 @@ uint8 Bot::GetDefaultSpellMaxThreshold(uint16 spell_type, uint8 stance) { } case BotSpellTypes::GroupHeals: case BotSpellTypes::RegularHeal: - if (bot_class == Class::Necromancer || (bot_class == Class::Shaman && !GetSpellHold(BotSpellTypes::InCombatBuff))) { + if (bot_class == Class::Necromancer || (bot_class == Class::Shaman && !GetSpellTypeHold(BotSpellTypes::InCombatBuff))) { return 60; } @@ -13016,7 +13024,7 @@ uint8 Bot::GetDefaultSpellMaxThreshold(uint16 spell_type, uint8 stance) { } case BotSpellTypes::CompleteHeal: case BotSpellTypes::GroupCompleteHeals: - if (bot_class == Class::Necromancer || (bot_class == Class::Shaman && !GetSpellHold(BotSpellTypes::InCombatBuff))) { + if (bot_class == Class::Necromancer || (bot_class == Class::Shaman && !GetSpellTypeHold(BotSpellTypes::InCombatBuff))) { return 55; } @@ -13075,7 +13083,7 @@ uint8 Bot::GetDefaultSpellMaxThreshold(uint16 spell_type, uint8 stance) { case BotSpellTypes::GroupHoTHeals: case BotSpellTypes::HoTHeals: case BotSpellTypes::PetHoTHeals: - if (bot_class == Class::Necromancer || (bot_class == Class::Shaman && !GetSpellHold(BotSpellTypes::InCombatBuff))) { + if (bot_class == Class::Necromancer || (bot_class == Class::Shaman && !GetSpellTypeHold(BotSpellTypes::InCombatBuff))) { return 70; } else { @@ -13117,25 +13125,28 @@ uint8 Bot::GetDefaultSpellMaxThreshold(uint16 spell_type, uint8 stance) { } } -uint16 Bot::GetUltimateSpellDelay(uint16 spell_type, Mob* tar) { +uint16 Bot::GetUltimateSpellTypeDelay(uint16 spell_type, Mob* tar) { if (!tar) { - return GetSpellDelay(spell_type); + return GetSpellTypeDelay(spell_type); } if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) { Mob* owner = tar->GetOwner(); - return owner->IsClient() ? owner->CastToClient()->GetSpellDelay(GetPetBotSpellType(spell_type)) : owner->CastToBot()->GetSpellDelay(GetPetBotSpellType(spell_type)); + return owner->IsClient() ? owner->CastToClient()->GetSpellTypeDelay(GetPetBotSpellType(spell_type)) : owner->CastToBot()->GetSpellTypeDelay( + GetPetBotSpellType(spell_type)); } if (IsBotSpellTypeOtherBeneficial(spell_type) && tar->IsOfClientBot()) { - return tar->IsClient() ? tar->CastToClient()->GetSpellDelay(spell_type) : tar->CastToBot()->GetSpellDelay(spell_type); + return tar->IsClient() ? tar->CastToClient()->GetSpellTypeDelay(spell_type) : tar->CastToBot()->GetSpellTypeDelay( + spell_type + ); } - return GetSpellDelay(spell_type); + return GetSpellTypeDelay(spell_type); } -bool Bot::GetUltimateSpellDelayCheck(uint16 spell_type, Mob* tar) { +bool Bot::GetUltimateSpellTypeDelayCheck(uint16 spell_type, Mob* tar) { if (!tar) { return SpellTypeRecastCheck(spell_type); } @@ -13153,40 +13164,46 @@ bool Bot::GetUltimateSpellDelayCheck(uint16 spell_type, Mob* tar) { return SpellTypeRecastCheck(spell_type); } -uint8 Bot::GetUltimateSpellMinThreshold(uint16 spell_type, Mob* tar) { +uint8 Bot::GetUltimateSpellTypeMinThreshold(uint16 spell_type, Mob* tar) { if (!tar) { - return GetSpellMinThreshold(spell_type); + return GetSpellTypeMinThreshold(spell_type); } if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) { Mob* owner = tar->GetOwner(); - return owner->IsClient() ? owner->CastToClient()->GetSpellMinThreshold(GetPetBotSpellType(spell_type)) : owner->CastToBot()->GetSpellMinThreshold(GetPetBotSpellType(spell_type)); + return owner->IsClient() ? owner->CastToClient()->GetSpellTypeMinThreshold(GetPetBotSpellType(spell_type)) : owner->CastToBot()->GetSpellTypeMinThreshold( + GetPetBotSpellType(spell_type)); } if (IsBotSpellTypeOtherBeneficial(spell_type) && tar->IsOfClientBot()) { - return tar->IsClient() ? tar->CastToClient()->GetSpellMinThreshold(spell_type) : tar->CastToBot()->GetSpellMinThreshold(spell_type); + return tar->IsClient() ? tar->CastToClient()->GetSpellTypeMinThreshold(spell_type) : tar->CastToBot()->GetSpellTypeMinThreshold( + spell_type + ); } - return GetSpellMinThreshold(spell_type); + return GetSpellTypeMinThreshold(spell_type); } -uint8 Bot::GetUltimateSpellMaxThreshold(uint16 spell_type, Mob* tar) { +uint8 Bot::GetUltimateSpellTypeMaxThreshold(uint16 spell_type, Mob* tar) { if (!tar) { - return GetSpellMaxThreshold(spell_type); + return GetSpellTypeMaxThreshold(spell_type); } if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) { Mob* owner = tar->GetOwner(); - return owner->IsClient() ? owner->CastToClient()->GetSpellMaxThreshold(GetPetBotSpellType(spell_type)) : owner->CastToBot()->GetSpellMaxThreshold(GetPetBotSpellType(spell_type)); + return owner->IsClient() ? owner->CastToClient()->GetSpellTypeMaxThreshold(GetPetBotSpellType(spell_type)) : owner->CastToBot()->GetSpellTypeMaxThreshold( + GetPetBotSpellType(spell_type)); } if (IsBotSpellTypeOtherBeneficial(spell_type) && tar->IsOfClientBot()) { - return tar->IsClient() ? tar->CastToClient()->GetSpellMaxThreshold(spell_type) : tar->CastToBot()->GetSpellMaxThreshold(spell_type); + return tar->IsClient() ? tar->CastToClient()->GetSpellTypeMaxThreshold(spell_type) : tar->CastToBot()->GetSpellTypeMaxThreshold( + spell_type + ); } - return GetSpellMaxThreshold(spell_type); + return GetSpellTypeMaxThreshold(spell_type); } bool Bot::IsImmuneToBotSpell(uint16 spell_id, Mob* caster) { diff --git a/zone/bot.h b/zone/bot.h index 92ee7bc41..dd84509c8 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -570,7 +570,7 @@ public: void LoadDefaultBotSettings(); int GetDefaultSetting(uint16 setting_category, uint16 setting_type, uint8 stance = Stance::Balanced); int GetDefaultBotBaseSetting(uint16 bot_setting, uint8 stance = Stance::Balanced); - bool GetDefaultSpellHold(uint16 spell_type, uint8 stance = Stance::Balanced); + bool GetDefaultSpellTypeHold(uint16 spell_type, uint8 stance = Stance::Balanced); uint16 GetDefaultSpellTypePriority(uint16 spell_type, uint8 priority_type, uint8 bot_class, uint8 stance = Stance::Balanced); uint16 GetDefaultSpellTypeIdlePriority(uint16 spell_type, uint8 bot_class, uint8 stance = Stance::Balanced); uint16 GetDefaultSpellTypeEngagedPriority(uint16 spell_type, uint8 bot_class, uint8 stance = Stance::Balanced); @@ -607,9 +607,6 @@ public: void SetBotBlockedBuffs(std::vector blocked_buffs) { bot_blocked_buffs = blocked_buffs; } void SetBotSpellRecastTimer(uint16 spell_type, Mob* spelltar, bool pre_cast = false); - inline bool GetSpellHold(uint16 spell_type) const { return m_bot_spell_settings[spell_type].hold; } - inline void SetSpellHold(uint16 spell_type, bool value) { m_bot_spell_settings[spell_type].hold = value; } - bool GetUltimateSpellHold(uint16 spell_type, Mob* tar); uint16 GetSpellTypePriority(uint16 spell_type, uint8 priority_type); void SetSpellTypePriority(uint16 spell_type, uint8 priority_type, uint16 priority); inline uint16 GetSpellTypeResistLimit(uint16 spell_type) const { return m_bot_spell_settings[spell_type].resist_limit; } @@ -629,23 +626,26 @@ public: inline void SetSpellTypeAEOrGroupTargetCount(uint16 spell_type, uint16 value) { m_bot_spell_settings[spell_type].ae_or_group_target_count = value; } inline uint16 GetSpellTypeAnnounceCast(uint16 spell_type) const { return m_bot_spell_settings[spell_type].announce_cast; } inline void SetSpellTypeAnnounceCast(uint16 spell_type, uint16 value) { m_bot_spell_settings[spell_type].announce_cast = value; } - inline uint16 GetSpellDelay(uint16 spell_type) const { return m_bot_spell_settings[spell_type].delay; } - inline void SetSpellDelay(uint16 spell_type, uint16 delay_value) { m_bot_spell_settings[spell_type].delay = delay_value; } - inline uint8 GetSpellMinThreshold(uint16 spell_type) const { return m_bot_spell_settings[spell_type].min_threshold; } - inline void SetSpellMinThreshold(uint16 spell_type, uint8 threshold_value) { m_bot_spell_settings[spell_type].min_threshold = threshold_value; } - inline uint8 GetSpellMaxThreshold(uint16 spell_type) const { return m_bot_spell_settings[spell_type].max_threshold; } - inline void SetSpellMaxThreshold(uint16 spell_type, uint8 threshold_value) { m_bot_spell_settings[spell_type].max_threshold = threshold_value; } + inline bool GetSpellTypeHold(uint16 spell_type) const { return m_bot_spell_settings[spell_type].hold; } + inline void SetSpellTypeHold(uint16 spell_type, bool value) { m_bot_spell_settings[spell_type].hold = value; } + inline uint16 GetSpellTypeDelay(uint16 spell_type) const { return m_bot_spell_settings[spell_type].delay; } + inline void SetSpellTypeDelay(uint16 spell_type, uint16 delay_value) { m_bot_spell_settings[spell_type].delay = delay_value; } + inline uint8 GetSpellTypeMinThreshold(uint16 spell_type) const { return m_bot_spell_settings[spell_type].min_threshold; } + inline void SetSpellTypeMinThreshold(uint16 spell_type, uint8 threshold_value) { m_bot_spell_settings[spell_type].min_threshold = threshold_value; } + inline uint8 GetSpellTypeMaxThreshold(uint16 spell_type) const { return m_bot_spell_settings[spell_type].max_threshold; } + inline void SetSpellTypeMaxThreshold(uint16 spell_type, uint8 threshold_value) { m_bot_spell_settings[spell_type].max_threshold = threshold_value; } inline bool SpellTypeRecastCheck(uint16 spellType) { return !m_bot_spell_settings[spellType].recast_timer.GetRemainingTime(); } void SetSpellTypeRecastTimer(uint16 spell_type, uint32 recast_time) { m_bot_spell_settings[spell_type].recast_timer.Start(recast_time); } inline bool SpellTypeAIDelayCheck(uint16 spellType) { return !m_bot_spell_settings[spellType].ai_delay.GetRemainingTime(); } void SetSpellTypeAITimer(uint16 spell_type, uint32 recast_time) { m_bot_spell_settings[spell_type].ai_delay.Start(recast_time); } - uint16 GetDefaultSpellDelay(uint16 spell_type, uint8 stance = Stance::Balanced); - uint8 GetDefaultSpellMinThreshold(uint16 spell_type, uint8 stance = Stance::Balanced); - uint8 GetDefaultSpellMaxThreshold(uint16 spell_type, uint8 stance = Stance::Balanced); - uint16 GetUltimateSpellDelay(uint16 spell_type, Mob* tar); - bool GetUltimateSpellDelayCheck(uint16 spell_type, Mob* tar); - uint8 GetUltimateSpellMinThreshold(uint16 spell_type, Mob* tar); - uint8 GetUltimateSpellMaxThreshold(uint16 spell_type, Mob* tar); + bool GetUltimateSpellTypeHold(uint16 spell_type, Mob* tar); + uint16 GetDefaultSpellTypeDelay(uint16 spell_type, uint8 stance = Stance::Balanced); + uint8 GetDefaultSpellTypeMinThreshold(uint16 spell_type, uint8 stance = Stance::Balanced); + uint8 GetDefaultSpellTypeMaxThreshold(uint16 spell_type, uint8 stance = Stance::Balanced); + uint16 GetUltimateSpellTypeDelay(uint16 spell_type, Mob* tar); + bool GetUltimateSpellTypeDelayCheck(uint16 spell_type, Mob* tar); + uint8 GetUltimateSpellTypeMinThreshold(uint16 spell_type, Mob* tar); + uint8 GetUltimateSpellTypeMaxThreshold(uint16 spell_type, Mob* tar); void SetIllusionBlock(bool value) { _illusionBlock = value; } bool GetIllusionBlock() const { return _illusionBlock; } bool GetShowHelm() const { return _showHelm; } diff --git a/zone/bot_commands/default_settings.cpp b/zone/bot_commands/default_settings.cpp index 7c22312c0..40df68079 100644 --- a/zone/bot_commands/default_settings.cpp +++ b/zone/bot_commands/default_settings.cpp @@ -219,10 +219,14 @@ void bot_command_default_settings(Client* c, const Seperator* sep) } else if (!strcasecmp(sep->arg[1], "spelltypesettings")) { if (spell_type != UINT16_MAX) { - my_bot->SetSpellHold(spell_type, my_bot->GetDefaultSpellHold(spell_type, bot_stance)); - my_bot->SetSpellDelay(spell_type, my_bot->GetDefaultSpellDelay(spell_type, bot_stance)); - my_bot->SetSpellMinThreshold(spell_type, my_bot->GetDefaultSpellMinThreshold(spell_type, bot_stance)); - my_bot->SetSpellMaxThreshold(spell_type, my_bot->GetDefaultSpellMaxThreshold(spell_type, bot_stance)); + my_bot->SetSpellTypeHold(spell_type, my_bot->GetDefaultSpellTypeHold(spell_type, bot_stance)); + my_bot->SetSpellTypeDelay(spell_type, my_bot->GetDefaultSpellTypeDelay(spell_type, bot_stance)); + my_bot->SetSpellTypeMinThreshold( + spell_type, + my_bot->GetDefaultSpellTypeMinThreshold(spell_type, bot_stance)); + my_bot->SetSpellTypeMaxThreshold( + spell_type, + my_bot->GetDefaultSpellTypeMaxThreshold(spell_type, bot_stance)); my_bot->SetSpellTypeAggroCheck(spell_type, my_bot->GetDefaultSpellTypeAggroCheck(spell_type, bot_stance)); my_bot->SetSpellTypeResistLimit(spell_type, my_bot->GetDefaultSpellTypeResistLimit(spell_type, bot_stance)); my_bot->SetSpellTypeMinManaLimit(spell_type, my_bot->GetDefaultSpellTypeMinManaLimit(spell_type, bot_stance)); @@ -237,10 +241,10 @@ void bot_command_default_settings(Client* c, const Seperator* sep) } else { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { - my_bot->SetSpellHold(i, my_bot->GetDefaultSpellHold(i, bot_stance)); - my_bot->SetSpellDelay(i, my_bot->GetDefaultSpellDelay(i, bot_stance)); - my_bot->SetSpellMinThreshold(i, my_bot->GetDefaultSpellMinThreshold(i, bot_stance)); - my_bot->SetSpellMaxThreshold(i, my_bot->GetDefaultSpellMaxThreshold(i, bot_stance)); + my_bot->SetSpellTypeHold(i, my_bot->GetDefaultSpellTypeHold(i, bot_stance)); + my_bot->SetSpellTypeDelay(i, my_bot->GetDefaultSpellTypeDelay(i, bot_stance)); + my_bot->SetSpellTypeMinThreshold(i, my_bot->GetDefaultSpellTypeMinThreshold(i, bot_stance)); + my_bot->SetSpellTypeMaxThreshold(i, my_bot->GetDefaultSpellTypeMaxThreshold(i, bot_stance)); my_bot->SetSpellTypeAggroCheck(i, my_bot->GetDefaultSpellTypeAggroCheck(i, bot_stance)); my_bot->SetSpellTypeResistLimit(i, my_bot->GetDefaultSpellTypeResistLimit(i, bot_stance)); my_bot->SetSpellTypeMinManaLimit(i, my_bot->GetDefaultSpellTypeMinManaLimit(i, bot_stance)); @@ -263,10 +267,10 @@ void bot_command_default_settings(Client* c, const Seperator* sep) } for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { - my_bot->SetSpellHold(i, my_bot->GetDefaultSpellHold(i, bot_stance)); - my_bot->SetSpellDelay(i, my_bot->GetDefaultSpellDelay(i, bot_stance)); - my_bot->SetSpellMinThreshold(i, my_bot->GetDefaultSpellMinThreshold(i, bot_stance)); - my_bot->SetSpellMaxThreshold(i, my_bot->GetDefaultSpellMaxThreshold(i, bot_stance)); + my_bot->SetSpellTypeHold(i, my_bot->GetDefaultSpellTypeHold(i, bot_stance)); + my_bot->SetSpellTypeDelay(i, my_bot->GetDefaultSpellTypeDelay(i, bot_stance)); + my_bot->SetSpellTypeMinThreshold(i, my_bot->GetDefaultSpellTypeMinThreshold(i, bot_stance)); + my_bot->SetSpellTypeMaxThreshold(i, my_bot->GetDefaultSpellTypeMaxThreshold(i, bot_stance)); my_bot->SetSpellTypeAggroCheck(i, my_bot->GetDefaultSpellTypeAggroCheck(i, bot_stance)); my_bot->SetSpellTypeResistLimit(i, my_bot->GetDefaultSpellTypeResistLimit(i, bot_stance)); my_bot->SetSpellTypeMinManaLimit(i, my_bot->GetDefaultSpellTypeMinManaLimit(i, bot_stance)); @@ -288,11 +292,11 @@ void bot_command_default_settings(Client* c, const Seperator* sep) } else if (!strcasecmp(sep->arg[1], "holds")) { if (spell_type != UINT16_MAX) { - my_bot->SetSpellHold(spell_type, my_bot->GetDefaultSpellHold(spell_type, bot_stance)); + my_bot->SetSpellTypeHold(spell_type, my_bot->GetDefaultSpellTypeHold(spell_type, bot_stance)); } else { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { - my_bot->SetSpellHold(i, my_bot->GetDefaultSpellHold(i, bot_stance)); + my_bot->SetSpellTypeHold(i, my_bot->GetDefaultSpellTypeHold(i, bot_stance)); } } @@ -300,11 +304,11 @@ void bot_command_default_settings(Client* c, const Seperator* sep) } else if (!strcasecmp(sep->arg[1], "delays")) { if (spell_type != UINT16_MAX) { - my_bot->SetSpellDelay(spell_type, my_bot->GetDefaultSpellDelay(spell_type, bot_stance)); + my_bot->SetSpellTypeDelay(spell_type, my_bot->GetDefaultSpellTypeDelay(spell_type, bot_stance)); } else { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { - my_bot->SetSpellDelay(i, my_bot->GetDefaultSpellDelay(i, bot_stance)); + my_bot->SetSpellTypeDelay(i, my_bot->GetDefaultSpellTypeDelay(i, bot_stance)); } } @@ -312,11 +316,13 @@ void bot_command_default_settings(Client* c, const Seperator* sep) } else if (!strcasecmp(sep->arg[1], "minthresholds")) { if (spell_type != UINT16_MAX) { - my_bot->SetSpellMinThreshold(spell_type, my_bot->GetDefaultSpellMinThreshold(spell_type, bot_stance)); + my_bot->SetSpellTypeMinThreshold( + spell_type, + my_bot->GetDefaultSpellTypeMinThreshold(spell_type, bot_stance)); } else { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { - my_bot->SetSpellMinThreshold(i, my_bot->GetDefaultSpellMinThreshold(i, bot_stance)); + my_bot->SetSpellTypeMinThreshold(i, my_bot->GetDefaultSpellTypeMinThreshold(i, bot_stance)); } } @@ -324,11 +330,13 @@ void bot_command_default_settings(Client* c, const Seperator* sep) } else if (!strcasecmp(sep->arg[1], "maxthresholds")) { if (spell_type != UINT16_MAX) { - my_bot->SetSpellMaxThreshold(spell_type, my_bot->GetDefaultSpellMaxThreshold(spell_type, bot_stance)); + my_bot->SetSpellTypeMaxThreshold( + spell_type, + my_bot->GetDefaultSpellTypeMaxThreshold(spell_type, bot_stance)); } else { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { - my_bot->SetSpellMaxThreshold(i, my_bot->GetDefaultSpellMaxThreshold(i, bot_stance)); + my_bot->SetSpellTypeMaxThreshold(i, my_bot->GetDefaultSpellTypeMaxThreshold(i, bot_stance)); } } diff --git a/zone/bot_commands/spell_delays.cpp b/zone/bot_commands/spell_delays.cpp index 11547f4e1..98efb3f22 100644 --- a/zone/bot_commands/spell_delays.cpp +++ b/zone/bot_commands/spell_delays.cpp @@ -220,12 +220,12 @@ void bot_command_spell_delays(Client* c, const Seperator* sep) { "{} says, 'My [{}] spell delay is currently [{}] seconds.'", my_bot->GetCleanName(), Bot::GetSpellTypeNameByID(spell_type), - my_bot->GetSpellDelay(spell_type) / 1000.00 + my_bot->GetSpellTypeDelay(spell_type) / 1000.00 ).c_str() ); } else { - my_bot->SetSpellDelay(spell_type, type_value); + my_bot->SetSpellTypeDelay(spell_type, type_value); ++success_count; } } @@ -238,7 +238,7 @@ void bot_command_spell_delays(Client* c, const Seperator* sep) { "{} says, 'My [{}] spell delay was set to [{}] seconds.'", first_found->GetCleanName(), Bot::GetSpellTypeNameByID(spell_type), - first_found->GetSpellDelay(spell_type) / 1000.00 + first_found->GetSpellTypeDelay(spell_type) / 1000.00 ).c_str() ); } @@ -262,19 +262,19 @@ void bot_command_spell_delays(Client* c, const Seperator* sep) { fmt::format( "Your [{}] spell delay is currently [{}] seconds.", Bot::GetSpellTypeNameByID(spell_type), - c->GetSpellDelay(spell_type) / 1000.00 + c->GetSpellTypeDelay(spell_type) / 1000.00 ).c_str() ); } else { - c->SetSpellDelay(spell_type, type_value); + c->SetSpellTypeDelay(spell_type, type_value); c->Message( Chat::Green, fmt::format( "Your [{}] spell delay was set to [{}] seconds.", Bot::GetSpellTypeNameByID(spell_type), - c->GetSpellDelay(spell_type) / 1000.00 + c->GetSpellTypeDelay(spell_type) / 1000.00 ).c_str() ); } diff --git a/zone/bot_commands/spell_holds.cpp b/zone/bot_commands/spell_holds.cpp index d83274d39..26d42ad82 100644 --- a/zone/bot_commands/spell_holds.cpp +++ b/zone/bot_commands/spell_holds.cpp @@ -157,12 +157,12 @@ void bot_command_spell_holds(Client* c, const Seperator* sep) "{} says, 'My [{}] spell hold is currently [{}].'", my_bot->GetCleanName(), Bot::GetSpellTypeNameByID(spell_type), - my_bot->GetSpellHold(spell_type) ? "enabled" : "disabled" + my_bot->GetSpellTypeHold(spell_type) ? "enabled" : "disabled" ).c_str() ); } else { - my_bot->SetSpellHold(spell_type, type_value); + my_bot->SetSpellTypeHold(spell_type, type_value); ++success_count; } } @@ -174,7 +174,7 @@ void bot_command_spell_holds(Client* c, const Seperator* sep) "{} says, 'My [{}] spell hold was [{}].'", first_found->GetCleanName(), Bot::GetSpellTypeNameByID(spell_type), - first_found->GetSpellHold(spell_type) ? "enabled" : "disabled" + first_found->GetSpellTypeHold(spell_type) ? "enabled" : "disabled" ).c_str() ); } diff --git a/zone/bot_commands/spell_max_thresholds.cpp b/zone/bot_commands/spell_max_thresholds.cpp index 4ef30d2ad..ca7f78aa3 100644 --- a/zone/bot_commands/spell_max_thresholds.cpp +++ b/zone/bot_commands/spell_max_thresholds.cpp @@ -216,12 +216,12 @@ void bot_command_spell_max_thresholds(Client* c, const Seperator* sep) { "{} says, 'My [{}] maximum threshold is currently [{}%%].'", my_bot->GetCleanName(), Bot::GetSpellTypeNameByID(spell_type), - my_bot->GetSpellMaxThreshold(spell_type) + my_bot->GetSpellTypeMaxThreshold(spell_type) ).c_str() ); } else { - my_bot->SetSpellMaxThreshold(spell_type, type_value); + my_bot->SetSpellTypeMaxThreshold(spell_type, type_value); ++success_count; } } @@ -234,7 +234,7 @@ void bot_command_spell_max_thresholds(Client* c, const Seperator* sep) { "{} says, 'My [{}] maximum threshold was set to [{}%%].'", first_found->GetCleanName(), Bot::GetSpellTypeNameByID(spell_type), - first_found->GetSpellMaxThreshold(spell_type) + first_found->GetSpellTypeMaxThreshold(spell_type) ).c_str() ); } @@ -258,19 +258,19 @@ void bot_command_spell_max_thresholds(Client* c, const Seperator* sep) { fmt::format( "Your [{}] maximum threshold is currently [{}%%].", Bot::GetSpellTypeNameByID(spell_type), - c->GetSpellMaxThreshold(spell_type) + c->GetSpellTypeMaxThreshold(spell_type) ).c_str() ); } else { - c->SetSpellMaxThreshold(spell_type, type_value); + c->SetSpellTypeMaxThreshold(spell_type, type_value); c->Message( Chat::Green, fmt::format( "Your [{}] maximum threshold was set to [{}%%].", Bot::GetSpellTypeNameByID(spell_type), - c->GetSpellMaxThreshold(spell_type) + c->GetSpellTypeMaxThreshold(spell_type) ).c_str() ); } diff --git a/zone/bot_commands/spell_min_thresholds.cpp b/zone/bot_commands/spell_min_thresholds.cpp index 85d72a553..ba614530c 100644 --- a/zone/bot_commands/spell_min_thresholds.cpp +++ b/zone/bot_commands/spell_min_thresholds.cpp @@ -218,12 +218,12 @@ void bot_command_spell_min_thresholds(Client* c, const Seperator* sep) { "{} says, 'My [{}] minimum threshold is currently [{}%%].'", my_bot->GetCleanName(), Bot::GetSpellTypeNameByID(spell_type), - my_bot->GetSpellMinThreshold(spell_type) + my_bot->GetSpellTypeMinThreshold(spell_type) ).c_str() ); } else { - my_bot->SetSpellMinThreshold(spell_type, type_value); + my_bot->SetSpellTypeMinThreshold(spell_type, type_value); ++success_count; } } @@ -236,7 +236,7 @@ void bot_command_spell_min_thresholds(Client* c, const Seperator* sep) { "{} says, 'My [{}] minimum threshold was set to [{}%%].'", first_found->GetCleanName(), Bot::GetSpellTypeNameByID(spell_type), - first_found->GetSpellMinThreshold(spell_type) + first_found->GetSpellTypeMinThreshold(spell_type) ).c_str() ); } @@ -260,19 +260,19 @@ void bot_command_spell_min_thresholds(Client* c, const Seperator* sep) { fmt::format( "Your [{}] minimum threshold is currently [{}%%].", Bot::GetSpellTypeNameByID(spell_type), - c->GetSpellMinThreshold(spell_type) + c->GetSpellTypeMinThreshold(spell_type) ).c_str() ); } else { - c->SetSpellMinThreshold(spell_type, type_value); + c->SetSpellTypeMinThreshold(spell_type, type_value); c->Message( Chat::Green, fmt::format( "Your [{}] minimum threshold was set to [{}%%].", Bot::GetSpellTypeNameByID(spell_type), - c->GetSpellMinThreshold(spell_type) + c->GetSpellTypeMinThreshold(spell_type) ).c_str() ); } diff --git a/zone/client.h b/zone/client.h index 61d924f3b..b3ce3e3a7 100644 --- a/zone/client.h +++ b/zone/client.h @@ -2283,15 +2283,15 @@ public: int GetBotSetting(uint8 setting_type, uint16 bot_setting); void SetBotSetting(uint8 setting_type, uint16 bot_setting, uint32 setting_value); - uint16 GetDefaultSpellDelay(uint16 spell_type); - uint8 GetDefaultSpellMinThreshold(uint16 spell_type); - uint8 GetDefaultSpellMaxThreshold(uint16 spell_type); - inline uint16 GetSpellDelay(uint16 spell_type) const { return m_bot_spell_settings[spell_type].delay; } - inline void SetSpellDelay(uint16 spell_type, uint16 delay_value) { m_bot_spell_settings[spell_type].delay = delay_value; } - inline uint8 GetSpellMinThreshold(uint16 spell_type) const { return m_bot_spell_settings[spell_type].min_threshold; } - inline void SetSpellMinThreshold(uint16 spell_type, uint8 threshold_value) { m_bot_spell_settings[spell_type].min_threshold = threshold_value; } - inline uint8 GetSpellMaxThreshold(uint16 spell_type) const { return m_bot_spell_settings[spell_type].max_threshold; } - inline void SetSpellMaxThreshold(uint16 spell_type, uint8 threshold_value) { m_bot_spell_settings[spell_type].max_threshold = threshold_value; } + uint16 GetDefaultSpellTypeDelay(uint16 spell_type); + uint8 GetDefaultSpellTypeMinThreshold(uint16 spell_type); + uint8 GetDefaultSpellTypeMaxThreshold(uint16 spell_type); + inline uint16 GetSpellTypeDelay(uint16 spell_type) const { return m_bot_spell_settings[spell_type].delay; } + inline void SetSpellTypeDelay(uint16 spell_type, uint16 delay_value) { m_bot_spell_settings[spell_type].delay = delay_value; } + inline uint8 GetSpellTypeMinThreshold(uint16 spell_type) const { return m_bot_spell_settings[spell_type].min_threshold; } + inline void SetSpellTypeMinThreshold(uint16 spell_type, uint8 threshold_value) { m_bot_spell_settings[spell_type].min_threshold = threshold_value; } + inline uint8 GetSpellTypeMaxThreshold(uint16 spell_type) const { return m_bot_spell_settings[spell_type].max_threshold; } + inline void SetSpellTypeMaxThreshold(uint16 spell_type, uint8 threshold_value) { m_bot_spell_settings[spell_type].max_threshold = threshold_value; } inline bool SpellTypeRecastCheck(uint16 spellType) { return !m_bot_spell_settings[spellType].recast_timer.GetRemainingTime(); } void SetSpellTypeRecastTimer(uint16 spell_type, uint32 recast_time) { m_bot_spell_settings[spell_type].recast_timer.Start(recast_time); } diff --git a/zone/client_bot.cpp b/zone/client_bot.cpp index 2219c19dc..8e1f07c04 100644 --- a/zone/client_bot.cpp +++ b/zone/client_bot.cpp @@ -233,15 +233,17 @@ void Client::LoadDefaultBotSettings() { t.spell_type = i; t.short_name = Bot::GetSpellTypeShortNameByID(i); t.name = Bot::GetSpellTypeNameByID(i); - t.delay = GetDefaultSpellDelay(i); - t.min_threshold = GetDefaultSpellMinThreshold(i); - t.max_threshold = GetDefaultSpellMaxThreshold(i); + t.delay = GetDefaultSpellTypeDelay(i); + t.min_threshold = GetDefaultSpellTypeMinThreshold(i); + t.max_threshold = GetDefaultSpellTypeMaxThreshold(i); t.recast_timer.Start(); m_bot_spell_settings.push_back(t); LogBotSettingsDetail("{} says, 'Setting defaults for {} ({}) [#{}]'", GetCleanName(), t.name, t.short_name, t.spell_type); - LogBotSettingsDetail("{} says, 'Delay = [{}ms] | MinThreshold = [{}\%] | MaxThreshold = [{}\%]'", GetCleanName(), GetDefaultSpellDelay(i), GetDefaultSpellMinThreshold(i), GetDefaultSpellMaxThreshold(i)); + LogBotSettingsDetail("{} says, 'Delay = [{}ms] | MinThreshold = [{}\%] | MaxThreshold = [{}\%]'", GetCleanName(), + GetDefaultSpellTypeDelay(i), + GetDefaultSpellTypeMinThreshold(i), GetDefaultSpellTypeMaxThreshold(i)); } } @@ -250,11 +252,11 @@ int Client::GetDefaultBotSettings(uint8 setting_type, uint16 bot_setting) { case BotSettingCategories::BaseSetting: return false; // only setting supported currently is illusion block case BotSettingCategories::SpellDelay: - return GetDefaultSpellDelay(bot_setting); + return GetDefaultSpellTypeDelay(bot_setting); case BotSettingCategories::SpellMinThreshold: - return GetDefaultSpellMinThreshold(bot_setting); + return GetDefaultSpellTypeMinThreshold(bot_setting); case BotSettingCategories::SpellMaxThreshold: - return GetDefaultSpellMaxThreshold(bot_setting); + return GetDefaultSpellTypeMaxThreshold(bot_setting); } } @@ -263,11 +265,11 @@ int Client::GetBotSetting(uint8 setting_type, uint16 bot_setting) { case BotSettingCategories::BaseSetting: return GetIllusionBlock(); // only setting supported currently case BotSettingCategories::SpellDelay: - return GetSpellDelay(bot_setting); + return GetSpellTypeDelay(bot_setting); case BotSettingCategories::SpellMinThreshold: - return GetSpellMinThreshold(bot_setting); + return GetSpellTypeMinThreshold(bot_setting); case BotSettingCategories::SpellMaxThreshold: - return GetSpellMaxThreshold(bot_setting); + return GetSpellTypeMaxThreshold(bot_setting); } } @@ -277,13 +279,13 @@ void Client::SetBotSetting(uint8 setting_type, uint16 bot_setting, uint32 settin SetIllusionBlock(setting_value); // only setting supported currently break; case BotSettingCategories::SpellDelay: - SetSpellDelay(bot_setting, setting_value); + SetSpellTypeDelay(bot_setting, setting_value); break; case BotSettingCategories::SpellMinThreshold: - SetSpellMinThreshold(bot_setting, setting_value); + SetSpellTypeMinThreshold(bot_setting, setting_value); break; case BotSettingCategories::SpellMaxThreshold: - SetSpellMaxThreshold(bot_setting, setting_value); + SetSpellTypeMaxThreshold(bot_setting, setting_value); break; } } @@ -348,7 +350,7 @@ void Client::SendSpellTypePrompts(bool commanded_types, bool client_only_types) return; } -uint16 Client::GetDefaultSpellDelay(uint16 spell_type) { +uint16 Client::GetDefaultSpellTypeDelay(uint16 spell_type) { switch (spell_type) { case BotSpellTypes::VeryFastHeals: case BotSpellTypes::PetVeryFastHeals: @@ -379,14 +381,14 @@ uint16 Client::GetDefaultSpellDelay(uint16 spell_type) { } } -uint8 Client::GetDefaultSpellMinThreshold(uint16 spell_type) { +uint8 Client::GetDefaultSpellTypeMinThreshold(uint16 spell_type) { switch (spell_type) { default: return 0; } } -uint8 Client::GetDefaultSpellMaxThreshold(uint16 spell_type) { +uint8 Client::GetDefaultSpellTypeMaxThreshold(uint16 spell_type) { uint8 client_class = GetClass(); switch (spell_type) {