From 8f86cb353e92d749a1c0f4a01f1ad1a0eb608287 Mon Sep 17 00:00:00 2001 From: Fryguy Date: Thu, 10 Oct 2024 21:27:49 -0400 Subject: [PATCH] [Bug Fix] Spells - Self Only (Yellow) cast when non group member is targeted (#4503) * [Bug Fix] Spells - Self Only (Yellow) cast when non group member is targeted When using a Yellow gem invis spell, it should cast on yourself regardless of the targetted entity. * Update spells.cpp --------- Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com> --- zone/spells.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/zone/spells.cpp b/zone/spells.cpp index 05755f929..e8e3e2757 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -821,14 +821,12 @@ bool Mob::DoCastingChecksOnTarget(bool check_on_casting, int32 spell_id, Mob *sp } if (!spell_target) { - if (IsGroupSpell(spell_id)){ + if (IsGroupSpell(spell_id)) { return true; - } - else if (spells[spell_id].target_type == ST_Self) { + } else if (spells[spell_id].target_type == ST_Self) { spell_target = this; } - } - else { + } else { if (IsGroupSpell(spell_id) && spell_target != this) { ignore_on_casting = true; } @@ -942,7 +940,13 @@ bool Mob::DoCastingChecksOnTarget(bool check_on_casting, int32 spell_id, Mob *sp /* Requires target to be in same group or same raid in order to apply invisible. */ - if (check_on_casting && RuleB(Spells, InvisRequiresGroup) && IsInvisibleSpell(spell_id)) { + if ( + check_on_casting && + spells[spell_id].target_type != ST_Self && + GetTarget() != this && + RuleB(Spells, InvisRequiresGroup) && + IsInvisibleSpell(spell_id) + ) { if (IsClient() && spell_target && spell_target->IsClient()) { if (spell_target && spell_target->GetID() != GetID()) { bool cast_failed = true; @@ -954,8 +958,7 @@ bool Mob::DoCastingChecksOnTarget(bool check_on_casting, int32 spell_id, Mob *sp (target_group->GetID() == my_group->GetID())) { cast_failed = false; } - } - else if (spell_target->IsRaidGrouped()) { + } else if (spell_target->IsRaidGrouped()) { Raid *target_raid = spell_target->GetRaid(); Raid *my_raid = GetRaid(); if (target_raid &&