fix(Scripts/Hyjal): Archimonde finger of death condition (#18681)

* init

* yes

* Update src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp
This commit is contained in:
Dan
2024-04-12 18:28:24 +02:00
committed by GitHub
parent c796d9291e
commit ec10eb841c

View File

@@ -66,6 +66,7 @@ enum Summons
CREATURE_DOOMFIRE_SPIRIT = 18104,
CREATURE_ANCIENT_WISP = 17946,
CREATURE_CHANNEL_TARGET = 22418,
DISPLAY_ID_TRIGGER = 11686
};
enum Events
@@ -279,13 +280,6 @@ struct boss_archimonde : public BossAI
DoCastVictim(SPELL_RED_SKY_EFFECT);
DoCastVictim(SPELL_HAND_OF_DEATH);
}, 3s);
ScheduleTimedEvent(2500ms, [&]
{
if (!(me->GetVictim() && me->IsWithinMeleeRange(me->GetVictim())))
{
DoCastRandomTarget(SPELL_FINGER_OF_DEATH);
}
}, 3500ms);
});
}
@@ -301,7 +295,7 @@ 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(11686); //TODO: make enum
nordrassil->SetDisplayId(DISPLAY_ID_TRIGGER);
DoCast(nordrassil, SPELL_DRAIN_WORLD_TREE);
_isChanneling = true;
nordrassil->AI()->DoCast(me, SPELL_DRAIN_WORLD_TREE_2, true);
@@ -365,6 +359,26 @@ struct boss_archimonde : public BossAI
}
}
}, 5s);
ScheduleTimedEvent(5000ms, [&]
{
bool noPlayersInRange = true;
if (Map* map = me->GetMap())
{
map->DoForAllPlayers([&noPlayersInRange, this](Player* player)
{
if (me->IsWithinMeleeRange(player))
{
noPlayersInRange = false;
return false;
}
return true;
});
}
if (noPlayersInRange)
{
DoCastRandomTarget(SPELL_FINGER_OF_DEATH);
}
}, 3500ms);
instance->SetData(DATA_SPAWN_WAVES, 1);
}