mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 02:20:27 +00:00
fix(Scripts/ZulAman): Eagle Gauntlet behavior (#20947)
This commit is contained in:
@@ -238,8 +238,12 @@ public:
|
||||
_akilzonGauntlet = NOT_STARTED;
|
||||
for (ObjectGuid guid : AkilzonTrash)
|
||||
if (Creature* creature = instance->GetCreature(guid))
|
||||
{
|
||||
if (!creature->IsAlive())
|
||||
creature->Respawn();
|
||||
else if (creature->GetEntry() == NPC_AMINISHI_TEMPEST)
|
||||
creature->AI()->DoAction(ACTION_RESET_AKILZON_GAUNTLET);
|
||||
}
|
||||
if (Creature* creature = GetCreature(DATA_LOOKOUT))
|
||||
if (creature->isMoving())
|
||||
creature->Respawn(true);
|
||||
|
||||
@@ -590,7 +590,6 @@ private:
|
||||
|
||||
enum AmanishiTempest
|
||||
{
|
||||
ACTION_START_GAUNTLET = 1,
|
||||
GROUP_AKILZON_GAUNTLET = 1,
|
||||
SPELL_SUMMON_EAGLE = 43487,
|
||||
SPELL_SUMMON_WARRIOR = 43486,
|
||||
@@ -605,6 +604,11 @@ struct npc_amanishi_tempest : public ScriptedAI
|
||||
{
|
||||
_summons.DespawnAll();
|
||||
scheduler.CancelAll();
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
scheduler.CancelGroup(GROUP_AKILZON_GAUNTLET);
|
||||
scheduler.Schedule(9s, 11s, [this](TaskContext context)
|
||||
{
|
||||
DoCastVictim(SPELL_THUNDERCLAP);
|
||||
@@ -627,8 +631,15 @@ struct npc_amanishi_tempest : public ScriptedAI
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
if (action == ACTION_START_GAUNTLET)
|
||||
if (action == ACTION_START_AKILZON_GAUNTLET)
|
||||
ScheduleEvents();
|
||||
else if (action == ACTION_RESET_AKILZON_GAUNTLET)
|
||||
Reset();
|
||||
}
|
||||
|
||||
void SummonedCreatureEvade(Creature* /*summon*/) override
|
||||
{
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
@@ -639,7 +650,6 @@ struct npc_amanishi_tempest : public ScriptedAI
|
||||
|
||||
void ScheduleEvents()
|
||||
{
|
||||
me->SetInCombatWithZone();
|
||||
scheduler.Schedule(29s, 53s, GROUP_AKILZON_GAUNTLET, [this](TaskContext context)
|
||||
{
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
@@ -656,11 +666,6 @@ struct npc_amanishi_tempest : public ScriptedAI
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
scheduler.Update(diff);
|
||||
if (!me->IsEngaged())
|
||||
return;
|
||||
Unit* victim = me->SelectVictim();
|
||||
if (!victim || me->GetExactDist(victim) > me->GetAggroRange(victim))
|
||||
return;
|
||||
ScriptedAI::UpdateAI(diff);
|
||||
}
|
||||
|
||||
@@ -669,26 +674,6 @@ private:
|
||||
SummonList _summons;
|
||||
};
|
||||
|
||||
struct npc_eagle_trash_aggro_trigger : public ScriptedAI
|
||||
{
|
||||
npc_eagle_trash_aggro_trigger(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) {}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
{
|
||||
if (!me->IsWithinDist(who, 10.0f, false)) // distance not confirmed
|
||||
return;
|
||||
|
||||
Player* player = who->GetCharmerOrOwnerPlayerOrPlayerItself();
|
||||
if (!player || player->IsGameMaster())
|
||||
return;
|
||||
|
||||
if (_instance->GetData(TYPE_AKILZON_GAUNTLET) == NOT_STARTED)
|
||||
_instance->SetData(TYPE_AKILZON_GAUNTLET, IN_PROGRESS);
|
||||
}
|
||||
private:
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
void AddSC_zulaman()
|
||||
{
|
||||
RegisterZulAmanCreatureAI(npc_forest_frog);
|
||||
@@ -697,5 +682,4 @@ void AddSC_zulaman()
|
||||
RegisterSpellScript(spell_ritual_of_power);
|
||||
RegisterZulAmanCreatureAI(npc_amanishi_lookout);
|
||||
RegisterZulAmanCreatureAI(npc_amanishi_tempest);
|
||||
RegisterZulAmanCreatureAI(npc_eagle_trash_aggro_trigger);
|
||||
}
|
||||
|
||||
@@ -92,6 +92,7 @@ enum MiscIds
|
||||
DATA_TIMED_RUN = 0,
|
||||
ACTION_START_TIMED_RUN = 0,
|
||||
ACTION_START_AKILZON_GAUNTLET = 1,
|
||||
ACTION_RESET_AKILZON_GAUNTLET = 2,
|
||||
GROUP_TIMED_RUN = 1
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user