chore(Scripts/Hyjal): Remove unneeded Archimonde spell scripts (#19080)

* chore(Scripts/Hyjal): Remove unneeded spell scripts

* use trigger flags

* Update boss_archimonde.cpp

* Update boss_archimonde.cpp
This commit is contained in:
Andrew
2024-06-17 16:37:43 -03:00
committed by GitHub
parent 20ff8df91c
commit 5f966e8e0c
2 changed files with 7 additions and 68 deletions

View File

@@ -194,15 +194,6 @@ struct boss_archimonde : public BossAI
_availableAuras.clear();
_availableSpells.clear();
if (Map* map = me->GetMap())
{
map->DoForAllPlayers([&](Player* player)
{
player->ApplySpellImmune(SPELL_HAND_OF_DEATH, IMMUNITY_ID, SPELL_HAND_OF_DEATH, false);
player->ApplySpellImmune(0, IMMUNITY_ID, SPELL_HAND_OF_DEATH, false);
});
}
if (instance->GetBossState(DATA_AZGALOR) != DONE)
{
me->SetVisible(false);
@@ -216,7 +207,7 @@ struct boss_archimonde : public BossAI
ScheduleHealthCheckEvent(10, [&]{
scheduler.CancelAll();
me->SetReactState(REACT_PASSIVE);
DoCastProtection();
DoCastAOE(SPELL_PROTECTION_OF_ELUNE, true);
Talk(SAY_ENRAGE);
_enraged = true;
me->GetMotionMaster()->Clear(false);
@@ -225,7 +216,7 @@ struct boss_archimonde : public BossAI
{
if (_wispCount >= 30)
{
Unit::DealDamage(me, me, me->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
me->KillSelf();
}
Position wispPosition = { me->GetPositionX() + float(rand() % WISP_OFFSET), me->GetPositionY() + float(rand() % WISP_OFFSET), me->GetPositionZ(), 0.0f };
if (Creature* wisp = me->SummonCreature(CREATURE_ANCIENT_WISP, wispPosition))
@@ -253,8 +244,6 @@ struct boss_archimonde : public BossAI
{
if (Creature* nordrassil = me->SummonCreature(CREATURE_CHANNEL_TARGET, nordrassilPosition, TEMPSUMMON_TIMED_DESPAWN, 1200000))
{
nordrassil->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
nordrassil->SetDisplayId(DISPLAY_ID_TRIGGER);
DoCast(nordrassil, SPELL_DRAIN_WORLD_TREE);
_isChanneling = true;
nordrassil->AI()->DoCast(me, SPELL_DRAIN_WORLD_TREE_2, true);
@@ -264,20 +253,7 @@ struct boss_archimonde : public BossAI
}
}
void DoCastProtection()
{
if (Map* map = me->GetMap())
{
map->DoForAllPlayers([&](Player* player)
{
player->AddAura(SPELL_PROTECTION_OF_ELUNE, player);
player->ApplySpellImmune(SPELL_HAND_OF_DEATH, IMMUNITY_ID, SPELL_HAND_OF_DEATH, true);
player->ApplySpellImmune(0, IMMUNITY_ID, SPELL_HAND_OF_DEATH, true);
});
}
}
void JustEngagedWith(Unit* who) override
void JustEngagedWith(Unit* /*who*/) override
{
_JustEngagedWith();
me->InterruptNonMeleeSpells(false);
@@ -345,7 +321,7 @@ struct boss_archimonde : public BossAI
instance->SetData(DATA_SPAWN_WAVES, 1);
}
void KilledUnit(Unit* victim) override
void KilledUnit(Unit* /*victim*/) override
{
Talk(SAY_SLAY);
}
@@ -431,8 +407,6 @@ struct boss_archimonde : public BossAI
{
if (Creature* doomfire = me->SummonCreature(CREATURE_DOOMFIRE, doomfirePosition, TEMPSUMMON_TIMED_DESPAWN, 27000))
{
doomfireSpirit->SetVisible(false);
doomfire->SetVisible(false);
doomfireSpirit->SetWalk(false);
doomfireSpirit->SetReactState(REACT_PASSIVE);
doomfire->SetReactState(REACT_PASSIVE);
@@ -495,42 +469,6 @@ class spell_red_sky_effect : public SpellScript
}
};
class spell_finger_of_death : public SpellScript
{
PrepareSpellScript(spell_finger_of_death);
void HandleHit(SpellEffIndex /*effIndex*/)
{
if (GetHitUnit() && GetHitUnit()->GetAura(SPELL_PROTECTION_OF_ELUNE))
PreventHitDamage();
else
GetHitUnit()->RemoveAurasByType(SPELL_AURA_EFFECT_IMMUNITY);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_finger_of_death::HandleHit, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
class spell_hand_of_death : public SpellScript
{
PrepareSpellScript(spell_hand_of_death);
void HandleHit(SpellEffIndex /*effIndex*/)
{
if (GetHitUnit() && GetHitUnit()->GetAura(SPELL_PROTECTION_OF_ELUNE))
PreventHitDamage();
else
GetHitUnit()->RemoveAurasByType(SPELL_AURA_EFFECT_IMMUNITY);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_hand_of_death::HandleHit, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
class spell_air_burst : public SpellScript
{
PrepareSpellScript(spell_air_burst);
@@ -552,8 +490,6 @@ class spell_air_burst : public SpellScript
void AddSC_boss_archimonde()
{
RegisterSpellScript(spell_red_sky_effect);
RegisterSpellScript(spell_hand_of_death);
RegisterSpellScript(spell_finger_of_death);
RegisterSpellScript(spell_air_burst);
RegisterHyjalAI(boss_archimonde);
RegisterHyjalAI(npc_ancient_wisp);