Add bots to UseSpellImpliedTargeting

This commit is contained in:
nytmyr
2025-01-24 20:29:16 -06:00
parent 41f362ce61
commit b82ed57cd4
+3 -3
View File
@@ -182,14 +182,14 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
}
//Goal of Spells:UseSpellImpliedTargeting is to replicate the EQ2 feature where spells will 'pass through' invalid targets to target's target to try to find a valid target.
if (RuleB(Spells,UseSpellImpliedTargeting) && IsClient()) {
if (RuleB(Spells,UseSpellImpliedTargeting) && IsOfClientBot()) {
Mob* spell_target = entity_list.GetMobID(target_id);
if (spell_target) {
Mob* targets_target = spell_target->GetTarget();
if (targets_target) {
// If either this is beneficial and the target is not a player or player's pet or vis versa
if ((IsBeneficialSpell(spell_id) && (!(spell_target->IsClient() || (spell_target->HasOwner() && spell_target->GetOwner()->IsClient()))))
|| (IsDetrimentalSpell(spell_id) && (spell_target->IsClient() || (spell_target->HasOwner() && spell_target->GetOwner()->IsClient())))) {
if ((IsBeneficialSpell(spell_id) && (!(spell_target->IsOfClientBot() || (spell_target->HasOwner() && spell_target->GetOwner()->IsOfClientBot()))))
|| (IsDetrimentalSpell(spell_id) && (spell_target->IsOfClientBot() || (spell_target->HasOwner() && spell_target->GetOwner()->IsOfClientBot())))) {
//Check if the target's target is a valid target; we can use DoCastingChecksOnTarget() here because we can let it handle the failure as vanilla would
if (DoCastingChecksOnTarget(true, spell_id, targets_target)) {
target_id = targets_target->GetID();