aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
authorJeremy <Golrag@users.noreply.github.com>2023-05-09 05:20:35 +0200
committerGitHub <noreply@github.com>2023-05-09 05:20:35 +0200
commit205aba1ff3a6f1ff92a8b26af646fd25f139c697 (patch)
treea2273ad956ee236dd4044d114759d9e24211468c /src/server/game/Spells/SpellEffects.cpp
parentdc284750968d1816cc4271f4c6a6dbcdcdfd3f51 (diff)
Core/Battlegrounds: Moved AreaSpiritHealer resurrection handling to respective npc flags (#28508)
* UNIT_NPC_FLAG_AREA_SPIRIT_HEALER * UNIT_NPC_FLAG_2_AREA_SPIRIT_HEALER_INDIVIDUAL
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 2dab2a3d9c5..1dbc2269e84 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -4488,26 +4488,29 @@ void Spell::EffectSkill()
TC_LOG_DEBUG("spells", "WORLD: SkillEFFECT");
}
-/* There is currently no need for this effect. We handle it in Battleground.cpp
- If we would handle the resurrection here, the spiritguide would instantly disappear as the
- player revives, and so we wouldn't see the spirit heal visual effect on the npc.
- This is why we use a half sec delay between the visual effect and the resurrection itself */
void Spell::EffectSpiritHeal()
{
+ Unit* caster = GetCaster()->ToUnit();
+ if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT)
+ caster->CastSpell(nullptr, SPELL_RESURRECTION_VISUAL, true);
+
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
return;
- /*
- if (unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
- if (!unitTarget->IsInWorld())
- return;
+ if (Player* playerTarget = unitTarget->ToPlayer())
+ {
+ if (!playerTarget->IsInWorld())
+ return;
+
+ // skip if player does not want to live
+ if (!playerTarget->CanAcceptAreaSpiritHealFrom(caster))
+ return;
- //m_spellInfo->Effects[i].BasePoints; == 99 (percent?)
- //unitTarget->ToPlayer()->setResurrect(m_caster->GetGUID(), unitTarget->GetPositionX(), unitTarget->GetPositionY(), unitTarget->GetPositionZ(), unitTarget->GetMaxHealth(), unitTarget->GetMaxPower(POWER_MANA));
- unitTarget->ToPlayer()->ResurrectPlayer(1.0f);
- unitTarget->ToPlayer()->SpawnCorpseBones();
- */
+ playerTarget->ResurrectPlayer(1.0f);
+ playerTarget->CastSpell(playerTarget, SPELL_PET_SUMMONED, true);
+ playerTarget->CastSpell(playerTarget, SPELL_SPIRIT_HEAL_MANA, true);
+ playerTarget->SpawnCorpseBones(false);
+ }
}
// remove insignia spell effect