Fixes trigger spells not working.

This commit is contained in:
hondacrx
2022-08-08 18:01:54 -04:00
parent 3102a12bfe
commit ac3a068ec0
6 changed files with 42 additions and 22 deletions
+5 -3
View File
@@ -1485,17 +1485,19 @@ namespace Game.Spells
if (player.IsImmunedToSpellEffect(m_spellInfo, spellEffectInfo, null))
return;
var spell = this;
var targetGuid = rafTarget.GetGUID();
rafTarget.GetMap().AddFarSpellCallback(map =>
{
Player player = Global.ObjAccessor.GetPlayer(map, rafTarget.GetGUID());
Player player = Global.ObjAccessor.GetPlayer(map, targetGuid);
if (player == null)
return;
// check immunity again in case it changed during update
if (player.IsImmunedToSpellEffect(GetSpellInfo(), spellEffectInfo, null))
if (player.IsImmunedToSpellEffect(spell.GetSpellInfo(), spellEffectInfo, null))
return;
HandleEffects(player, null, null, null, spellEffectInfo, SpellEffectHandleMode.HitTarget);
spell.HandleEffects(player, null, null, null, spellEffectInfo, SpellEffectHandleMode.HitTarget);
});
}
}