aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells
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
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')
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp10
-rw-r--r--src/server/game/Spells/SpellEffects.cpp31
-rw-r--r--src/server/game/Spells/SpellInfo.cpp2
3 files changed, 17 insertions, 26 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 2a205b09882..8992a14462c 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -4662,16 +4662,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
case SPELLFAMILY_GENERIC:
switch (GetId())
{
- case 2584: // Waiting to Resurrect
- // Waiting to resurrect spell cancel, we must remove player from resurrect queue
- if (target->GetTypeId() == TYPEID_PLAYER)
- {
- if (Battleground* bg = target->ToPlayer()->GetBattleground())
- bg->RemovePlayerFromResurrectQueue(target->GetGUID());
- if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetMap(), target->GetZoneId()))
- bf->RemovePlayerFromResurrectQueue(target->GetGUID());
- }
- break;
case 43681: // Inactive
{
if (target->GetTypeId() != TYPEID_PLAYER || aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
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
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index cf9c1fa9997..43844717a11 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -2052,8 +2052,6 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a
case 34976: // Netherstorm Flag
return map_id == 566 && player && player->InBattleground() ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
case 2584: // Waiting to Resurrect
- case 22011: // Spirit Heal Channel
- case 22012: // Spirit Heal
case 42792: // Recently Dropped Flag
case 43681: // Inactive
case 44535: // Spirit Heal (mana)