mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 02:50:29 +00:00
fix(Scripts/ZulAman): eagle gauntlet (#20719)
* sql
* add script handling
4b890a4096
Co-authored-by: MantisLord <sabinprosper@gmail.com>
* set Akilzon call for help
boss should pull trash
* style: remove blank lines
* add passiveAI header and sort
* Revert "set Akilzon call for help"
This reverts commit 99143339a9f00f048d9bc707d5b8d348e8f6bbd4.
line of sight blocks call for help
---------
Co-authored-by: MantisLord <sabinprosper@gmail.com>
This commit is contained in:
@@ -59,10 +59,11 @@ DoorData const doorData[] =
|
||||
|
||||
ObjectData const creatureData[] =
|
||||
{
|
||||
{ NPC_JANALAI, DATA_JANALAI },
|
||||
{ NPC_SPIRIT_LYNX, DATA_SPIRIT_LYNX },
|
||||
{ NPC_HARRISON_JONES, DATA_HARRISON_JONES },
|
||||
{ 0, 0 }
|
||||
{ NPC_JANALAI, DATA_JANALAI },
|
||||
{ NPC_SPIRIT_LYNX, DATA_SPIRIT_LYNX },
|
||||
{ NPC_HARRISON_JONES, DATA_HARRISON_JONES },
|
||||
{ NPC_AMINISHI_LOOKOUT, DATA_LOOKOUT },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
ObjectData const gameObjectData[] =
|
||||
@@ -113,6 +114,29 @@ public:
|
||||
DoAction(ACTION_START_TIMED_RUN);
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
// Akil'zon gauntlet
|
||||
case NPC_AMINISHI_TEMPEST:
|
||||
if (creature->GetPositionZ() >= 50.0f) // excludes Tempest in Hexlord Malacrass' trash
|
||||
AkilzonTrash.insert(creature->GetGUID());
|
||||
break;
|
||||
case NPC_AMINISHI_LOOKOUT:
|
||||
case NPC_AMINISHI_PROTECTOR:
|
||||
case NPC_EAGLE_TRASH_AGGRO_TRIGGER:
|
||||
AkilzonTrash.insert(creature->GetGUID());
|
||||
break;
|
||||
case NPC_AMANISHI_WIND_WALKER:
|
||||
if (creature->GetPositionZ() >= 26.0f) // excludes Wind Walker in first patrol
|
||||
AkilzonTrash.insert(creature->GetGUID());
|
||||
break;
|
||||
}
|
||||
|
||||
InstanceScript::OnCreatureCreate(creature);
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go) override
|
||||
{
|
||||
if (go->GetEntry() == GO_GATE_HEXLORD)
|
||||
@@ -167,6 +191,61 @@ public:
|
||||
RandVendor[0] = data;
|
||||
else if (type == TYPE_RAND_VENDOR_2)
|
||||
RandVendor[1] = data;
|
||||
else if (type == TYPE_AKILZON_GAUNTLET)
|
||||
{
|
||||
if (data == IN_PROGRESS)
|
||||
StartAkilzonGauntlet();
|
||||
else if (data == NOT_STARTED)
|
||||
ResetAkilzonGauntlet();
|
||||
else if (data == DONE)
|
||||
_akilzonGauntlet = DONE;
|
||||
}
|
||||
}
|
||||
|
||||
void StartAkilzonGauntlet()
|
||||
{
|
||||
_akilzonGauntlet = IN_PROGRESS;
|
||||
for (ObjectGuid const& guid : AkilzonTrash)
|
||||
if (Creature* creature = instance->GetCreature(guid))
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_EAGLE_TRASH_AGGRO_TRIGGER:
|
||||
creature->DisappearAndDie();
|
||||
break;
|
||||
case NPC_AMINISHI_LOOKOUT:
|
||||
case NPC_AMINISHI_TEMPEST:
|
||||
creature->AI()->DoAction(ACTION_START_AKILZON_GAUNTLET);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ResetAkilzonGauntlet()
|
||||
{
|
||||
_akilzonGauntlet = NOT_STARTED;
|
||||
for (ObjectGuid guid : AkilzonTrash)
|
||||
if (Creature* creature = instance->GetCreature(guid))
|
||||
if (!creature->IsAlive())
|
||||
creature->Respawn();
|
||||
if (Creature* creature = GetCreature(DATA_LOOKOUT))
|
||||
if (creature->isMoving())
|
||||
creature->Respawn(true);
|
||||
}
|
||||
|
||||
void OnCreatureEvade(Creature* creature) override
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_AMINISHI_TEMPEST:
|
||||
case NPC_AMINISHI_PROTECTOR:
|
||||
case NPC_AMANISHI_WIND_WALKER:
|
||||
if (AkilzonTrash.contains(creature->GetGUID()))
|
||||
ResetAkilzonGauntlet();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 type, EncounterState state) override
|
||||
@@ -234,6 +313,8 @@ public:
|
||||
return RandVendor[0];
|
||||
else if (type == TYPE_RAND_VENDOR_2)
|
||||
return RandVendor[1];
|
||||
else if (type == TYPE_AKILZON_GAUNTLET)
|
||||
return _akilzonGauntlet;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -245,6 +326,8 @@ public:
|
||||
|
||||
private:
|
||||
uint32 RandVendor[RAND_VENDOR];
|
||||
GuidSet AkilzonTrash;
|
||||
EncounterState _akilzonGauntlet = NOT_STARTED;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
|
||||
@@ -15,14 +15,15 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "zulaman.h"
|
||||
#include "CreatureScript.h"
|
||||
#include "PassiveAI.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellScriptLoader.h"
|
||||
#include "zulaman.h"
|
||||
|
||||
/*######
|
||||
## npc_forest_frog
|
||||
@@ -530,10 +531,167 @@ class spell_ritual_of_power : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
enum AmanishiLookout
|
||||
{
|
||||
PATH_LOOKOUT = 2417500,
|
||||
SAY_INVADERS = 0,
|
||||
};
|
||||
|
||||
struct npc_amanishi_lookout : public NullCreatureAI
|
||||
{
|
||||
npc_amanishi_lookout(Creature* creature) : NullCreatureAI(creature), _instance(creature->GetInstanceScript()) {}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_RENAME);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
{
|
||||
if (!me->IsWithinDist(who, 25.0f, false)) // distance not confirmed
|
||||
return;
|
||||
|
||||
Player* player = who->GetCharmerOrOwnerPlayerOrPlayerItself();
|
||||
if (!player || player->IsGameMaster())
|
||||
return;
|
||||
|
||||
if (!who->IsWithinLOSInMap(me))
|
||||
return;
|
||||
|
||||
if (_instance->GetData(TYPE_AKILZON_GAUNTLET) == NOT_STARTED)
|
||||
_instance->SetData(TYPE_AKILZON_GAUNTLET, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
if (action == ACTION_START_AKILZON_GAUNTLET)
|
||||
{
|
||||
Talk(SAY_INVADERS);
|
||||
me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
|
||||
me->SetUnitFlag(UNIT_FLAG_RENAME);
|
||||
me->GetMotionMaster()->MovePath(PATH_LOOKOUT, false);
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id) override
|
||||
{
|
||||
// at boss
|
||||
if (type == WAYPOINT_MOTION_TYPE && id == 8) // should despawn with waypoint script
|
||||
me->DespawnOrUnsummon(0s, 0s);
|
||||
}
|
||||
private:
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
enum AmanishiTempest
|
||||
{
|
||||
ACTION_START_GAUNTLET = 1,
|
||||
GROUP_AKILZON_GAUNTLET = 1,
|
||||
SPELL_SUMMON_EAGLE = 43487,
|
||||
SPELL_SUMMON_WARRIOR = 43486,
|
||||
SPELL_THUNDERCLAP = 44033,
|
||||
};
|
||||
|
||||
struct npc_amanishi_tempest : public ScriptedAI
|
||||
{
|
||||
npc_amanishi_tempest(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _summons(creature) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_summons.DespawnAll();
|
||||
scheduler.CancelAll();
|
||||
scheduler.Schedule(9s, 11s, [this](TaskContext context)
|
||||
{
|
||||
DoCastVictim(SPELL_THUNDERCLAP);
|
||||
context.Repeat();
|
||||
});
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon) override
|
||||
{
|
||||
_summons.Summon(summon);
|
||||
summon->SetNoCallAssistance(true); // prevent eagles from pulling boss
|
||||
summon->SetInCombatWithZone();
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer) override
|
||||
{
|
||||
ScriptedAI::JustDied(killer);
|
||||
_instance->SetData(TYPE_AKILZON_GAUNTLET, DONE);
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
if (action == ACTION_START_GAUNTLET)
|
||||
ScheduleEvents();
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
scheduler.CancelAll();
|
||||
}
|
||||
|
||||
void ScheduleEvents()
|
||||
{
|
||||
me->SetInCombatWithZone();
|
||||
scheduler.Schedule(29s, 53s, GROUP_AKILZON_GAUNTLET, [this](TaskContext context)
|
||||
{
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
DoCastAOE(SPELL_SUMMON_EAGLE, true);
|
||||
context.Repeat();
|
||||
}).Schedule(40s, GROUP_AKILZON_GAUNTLET, [this](TaskContext context)
|
||||
{
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
DoCastAOE(SPELL_SUMMON_WARRIOR, true);
|
||||
context.Repeat();
|
||||
});
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
private:
|
||||
InstanceScript* _instance;
|
||||
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);
|
||||
new npc_zulaman_hostage();
|
||||
RegisterZulAmanCreatureAI(npc_harrison_jones);
|
||||
RegisterSpellScript(spell_ritual_of_power);
|
||||
RegisterZulAmanCreatureAI(npc_amanishi_lookout);
|
||||
RegisterZulAmanCreatureAI(npc_amanishi_tempest);
|
||||
RegisterZulAmanCreatureAI(npc_eagle_trash_aggro_trigger);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,9 @@ enum DataTypes
|
||||
DATA_STRANGE_GONG = 10,
|
||||
DATA_MASSIVE_GATE = 11,
|
||||
DATA_HEXLORD_GATE = 12,
|
||||
DATA_HARRISON_JONES = 13
|
||||
DATA_HARRISON_JONES = 13,
|
||||
TYPE_AKILZON_GAUNTLET = 14,
|
||||
DATA_LOOKOUT = 15,
|
||||
};
|
||||
|
||||
enum CreatureIds
|
||||
@@ -54,7 +56,13 @@ enum CreatureIds
|
||||
NPC_AMANISHI_TRIBESMAN = 23582,
|
||||
NPC_AMANISHI_MEDICINE_MAN = 23581,
|
||||
NPC_AMANISHI_AXE_THROWER = 23542,
|
||||
NPC_AMANI_HATCHLING = 23598 // 42493
|
||||
NPC_AMANI_HATCHLING = 23598, // 42493
|
||||
// Akil'zon gauntlet
|
||||
NPC_AMANISHI_WIND_WALKER = 24179,
|
||||
NPC_AMINISHI_LOOKOUT = 24175,
|
||||
NPC_AMINISHI_PROTECTOR = 24180,
|
||||
NPC_AMINISHI_TEMPEST = 24549,
|
||||
NPC_EAGLE_TRASH_AGGRO_TRIGGER = 24223
|
||||
};
|
||||
|
||||
enum GameobjectIds
|
||||
@@ -77,6 +85,7 @@ enum MiscIds
|
||||
{
|
||||
DATA_TIMED_RUN = 0,
|
||||
ACTION_START_TIMED_RUN = 0,
|
||||
ACTION_START_AKILZON_GAUNTLET = 1,
|
||||
GROUP_TIMED_RUN = 1
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user