Core/Spells: implement corpse target type support and properly fix resurrections

Port From (https://github.com/TrinityCore/TrinityCore/commit/8f4db9aa6919e2b3b22ec21ffea4eacb605e9bc2)
This commit is contained in:
hondacrx
2022-02-27 21:12:11 -05:00
parent 9f72f655ab
commit 11768a594b
3 changed files with 206 additions and 84 deletions
+10
View File
@@ -640,6 +640,16 @@ namespace Game.Scripting
return m_spell.GetItemTargetCountForEffect(effect);
}
public long GetCorpseTargetCountForEffect(uint effect)
{
if (!IsAfterTargetSelectionPhase())
{
Log.outError(LogFilter.Scripts, $"Script: `{m_scriptName}` Spell: `{m_scriptSpellId}`: function SpellScript::GetCorpseTargetCountForEffect was called, but function has no effect in current hook! (spell has not selected targets yet)");
return 0;
}
return m_spell.GetCorpseTargetCountForEffect(effect);
}
// methods useable only during spell hit on target, or during spell launch on target:
// returns: target of current effect if it was Unit otherwise null
public Unit GetHitUnit()