Core/Battlegrounds: Moved AreaSpiritHealer resurrection handling to respective npc flags

Port From (https://github.com/TrinityCore/TrinityCore/commit/205aba1ff3a6f1ff92a8b26af646fd25f139c697)
This commit is contained in:
hondacrx
2023-05-21 18:38:55 -04:00
parent 3e72da9f1e
commit 35961a0121
17 changed files with 248 additions and 331 deletions
-12
View File
@@ -4317,18 +4317,6 @@ namespace Game.Spells
case SpellFamilyNames.Generic:
switch (GetId())
{
case 2584: // Waiting to Resurrect
// Waiting to resurrect spell cancel, we must remove player from resurrect queue
if (target.IsTypeId(TypeId.Player))
{
Battleground bg = target.ToPlayer().GetBattleground();
if (bg)
bg.RemovePlayerFromResurrectQueue(target.GetGUID());
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(target.GetMap(), target.GetZoneId());
if (bf != null)
bf.RemovePlayerFromResurrectQueue(target.GetGUID());
}
break;
case 36730: // Flame Strike
target.CastSpell(target, 36731, new CastSpellExtraArgs(this));
break;
+2
View File
@@ -7960,6 +7960,8 @@ namespace Game.Spells
public SpellInfo GetTriggeredByAuraSpell() { return m_triggeredByAuraSpell; }
public int GetTimer() { return m_timer; }
public static implicit operator bool(Spell spell)
{
return spell != null;
+20 -4
View File
@@ -4221,14 +4221,30 @@ namespace Game.Spells
Log.outDebug(LogFilter.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 EffectSpiritHeal()
{
Unit caster = GetCaster().ToUnit();
if (effectHandleMode == SpellEffectHandleMode.Hit)
caster.CastSpell(null, BattlegroundConst.SpellResurrectionVisual, true);
if (effectHandleMode != SpellEffectHandleMode.HitTarget)
return;
Player playerTarget = unitTarget.ToPlayer();
if (playerTarget != null)
{
if (!playerTarget.IsInWorld)
return;
// skip if player does not want to live
if (!playerTarget.CanAcceptAreaSpiritHealFrom(caster))
return;
playerTarget.ResurrectPlayer(1.0f);
playerTarget.CastSpell(playerTarget, BattlegroundConst.SpellPetSummoned, true);
playerTarget.CastSpell(playerTarget, BattlegroundConst.SpellSpiritHealMana, true);
playerTarget.SpawnCorpseBones(false);
}
}
// remove insignia spell effect
-2
View File
@@ -902,8 +902,6 @@ namespace Game.Spells
case 34976: // Netherstorm Flag
return map_id == 566 && player != null && player.InBattleground() ? SpellCastResult.SpellCastOk : SpellCastResult.RequiresArea;
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)