From 8f4db9aa6919e2b3b22ec21ffea4eacb605e9bc2 Mon Sep 17 00:00:00 2001 From: Giacomo Pozzoni Date: Mon, 29 Jun 2020 21:03:03 +0000 Subject: Core/Spells: implement corpse target type support and properly fix resurrections (#24921) * Core/Spells: implement corpse target type support and properly fix resurrections (cherry picked from commit df193945d9aff8596985a20e2c654105354b0af7) * Core/Spells: implement TARGET_CORPSE_SRC_AREA_RAID and updated remaining resurrection effect handlers for updated corpse targeting (cherry picked from commit 98b075cb4b0da126d409ab42daa63a1f531a70ea) * Fix no-pch Co-authored-by: Ovahlord (cherry picked from commit cc71da35b5dc74abf71f8691161525a23d870bb5) --- src/server/game/Spells/SpellScript.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/server/game/Spells/SpellScript.cpp') diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 2941b1400e6..69e7da62a73 100644 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -561,6 +561,17 @@ int64 SpellScript::GetItemTargetCountForEffect(SpellEffIndex effect) const return m_spell->GetItemTargetCountForEffect(effect); } +int64 SpellScript::GetCorpseTargetCountForEffect(SpellEffIndex effect) const +{ + if (!IsAfterTargetSelectionPhase()) + { + TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetCorpseTargetCountForEffect was called, but function has no effect in current hook! (spell has not selected targets yet)", + m_scriptName->c_str(), m_scriptSpellId); + return 0; + } + return m_spell->GetCorpseTargetCountForEffect(effect); +} + Unit* SpellScript::GetHitUnit() const { if (!IsInTargetHook()) -- cgit v1.2.3