From 0f49fbcfcd265aeeb1d600c7d872276c3406dc38 Mon Sep 17 00:00:00 2001 From: Aeadoin <109764533+Aeadoin@users.noreply.github.com> Date: Mon, 13 Feb 2023 01:19:50 -0500 Subject: [PATCH] [Bots] Add Support for TryTriggerOnCastFocusEffect (#2864) --- zone/spell_effects.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 73d3b8b63..a141ad9f0 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -27,6 +27,7 @@ #include "../common/data_verification.h" #include "../common/misc_functions.h" +#include "bot.h" #include "quest_parser_collection.h" #include "lua_parser.h" #include "string_ids.h" @@ -6165,12 +6166,12 @@ void Mob::TryTriggerOnCastFocusEffect(focusType type, uint16 spell_id) int32 proc_spellid = 0; // item focus - if (IsClient() && itembonuses.FocusEffects[type]) { + if (IsOfClientBot() && itembonuses.FocusEffects[type]) { const EQ::ItemData *temp_item = nullptr; for (int x = EQ::invslot::EQUIPMENT_BEGIN; x <= EQ::invslot::EQUIPMENT_END; x++) { temp_item = nullptr; - EQ::ItemInstance *ins = CastToClient()->GetInv().GetItem(x); + EQ::ItemInstance const *ins = (IsClient()) ? CastToClient()->GetInv().GetItem(x) : CastToBot()->GetBotItem(x); if (!ins) { continue; } @@ -6230,7 +6231,7 @@ void Mob::TryTriggerOnCastFocusEffect(focusType type, uint16 spell_id) } // Only use one of this focus per AA effect. - if (IsClient() && aabonuses.FocusEffects[type]) { + if (IsOfClientBot() && aabonuses.FocusEffects[type]) { for (const auto &aa : aa_ranks) { auto ability_rank = zone->GetAlternateAdvancementAbilityAndRank(aa.first, aa.second.first); auto ability = ability_rank.first; @@ -6244,7 +6245,7 @@ void Mob::TryTriggerOnCastFocusEffect(focusType type, uint16 spell_id) continue; } - proc_spellid = CastToClient()->CalcAAFocus(type, *rank, spell_id); + proc_spellid = CalcAAFocus(type, *rank, spell_id); if (proc_spellid) { TryTriggerOnCastProc(0, spell_id, proc_spellid); }