fix(Scripts/ZulAman): Akilzon Gauntlet hyperspawn, handling Eagle Trash Triggers (#21129)

This commit is contained in:
Jelle Meeus
2025-01-14 12:22:37 +01:00
committed by GitHub
parent 1fdc887780
commit 995eed88a5
3 changed files with 44 additions and 1 deletions

View File

@@ -251,6 +251,23 @@ public:
creature->Respawn(true);
}
void OnUnitDeath(Unit* unit) override
{
Creature* creature = unit->ToCreature();
if (!creature)
return;
switch (creature->GetEntry())
{
case NPC_AMINISHI_PROTECTOR:
case NPC_AMANISHI_WIND_WALKER:
if (_akilzonGauntlet == NOT_STARTED && AkilzonTrash.contains(creature->GetGUID()))
creature->DespawnOrUnsummon(30s, 1s);
default:
break;
}
}
void OnCreatureEvade(Creature* creature) override
{
switch (creature->GetEntry())

View File

@@ -561,7 +561,7 @@ struct npc_amanishi_lookout : public NullCreatureAI
void MoveInLineOfSight(Unit* who) override
{
if (!me->IsWithinDist(who, 25.0f, false)) // distance not confirmed
if (!me->IsWithinDist(who, me->GetAggroRange(who), false))
return;
Player* player = who->GetCharmerOrOwnerPlayerOrPlayerItself();
@@ -596,6 +596,29 @@ private:
InstanceScript* _instance;
};
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 (who->GetLevel() > 70)
return;
if (!me->IsWithinDist(who, me->GetAggroRange(who), false))
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;
};
enum AmanishiTempest
{
GROUP_AKILZON_GAUNTLET = 1,
@@ -845,6 +868,7 @@ void AddSC_zulaman()
RegisterZulAmanCreatureAI(npc_harrison_jones);
RegisterSpellScript(spell_ritual_of_power);
RegisterZulAmanCreatureAI(npc_amanishi_lookout);
RegisterZulAmanCreatureAI(npc_eagle_trash_aggro_trigger);
RegisterZulAmanCreatureAI(npc_amanishi_tempest);
RegisterZulAmanCreatureAI(npc_amanishi_scout);
RegisterSpellScript(spell_alert_drums);