refactor(Core/Scripts): Move AQ scripts to new scripting system (#12623)
This commit is contained in:
@@ -68,18 +68,13 @@ const Position LarvaPos[2] =
|
|||||||
{ -9701.6005f, 1566.9993f, 24.118f, 0.0f }
|
{ -9701.6005f, 1566.9993f, 24.118f, 0.0f }
|
||||||
};
|
};
|
||||||
|
|
||||||
class boss_ayamiss : public CreatureScript
|
struct boss_ayamiss : public BossAI
|
||||||
{
|
{
|
||||||
public:
|
boss_ayamiss(Creature* creature) : BossAI(creature, DATA_AYAMISS) {}
|
||||||
boss_ayamiss() : CreatureScript("boss_ayamiss") { }
|
|
||||||
|
|
||||||
struct boss_ayamissAI : public BossAI
|
|
||||||
{
|
|
||||||
boss_ayamissAI(Creature* creature) : BossAI(creature, DATA_AYAMISS) {}
|
|
||||||
|
|
||||||
void Reset() override
|
void Reset() override
|
||||||
{
|
{
|
||||||
_Reset();
|
BossAI::Reset();
|
||||||
_phase = PHASE_AIR;
|
_phase = PHASE_AIR;
|
||||||
_enraged = false;
|
_enraged = false;
|
||||||
SetCombatMovement(false);
|
SetCombatMovement(false);
|
||||||
@@ -131,11 +126,11 @@ public:
|
|||||||
void EnterCombat(Unit* attacker) override
|
void EnterCombat(Unit* attacker) override
|
||||||
{
|
{
|
||||||
BossAI::EnterCombat(attacker);
|
BossAI::EnterCombat(attacker);
|
||||||
events.ScheduleEvent(EVENT_STINGER_SPRAY, urand(20000, 30000));
|
events.ScheduleEvent(EVENT_STINGER_SPRAY, 20s, 30s);
|
||||||
events.ScheduleEvent(EVENT_POISON_STINGER, 5000);
|
events.ScheduleEvent(EVENT_POISON_STINGER, 5s);
|
||||||
events.ScheduleEvent(EVENT_SUMMON_SWARMER, 5000);
|
events.ScheduleEvent(EVENT_SUMMON_SWARMER, 5s);
|
||||||
events.ScheduleEvent(EVENT_SWARMER_ATTACK, 60000);
|
events.ScheduleEvent(EVENT_SWARMER_ATTACK, 60s);
|
||||||
events.ScheduleEvent(EVENT_PARALYZE, 15000);
|
events.ScheduleEvent(EVENT_PARALYZE, 15s);
|
||||||
me->SetCanFly(true);
|
me->SetCanFly(true);
|
||||||
me->SetDisableGravity(true);
|
me->SetDisableGravity(true);
|
||||||
me->GetMotionMaster()->MovePoint(POINT_AIR, AyamissAirPos);
|
me->GetMotionMaster()->MovePoint(POINT_AIR, AyamissAirPos);
|
||||||
@@ -155,7 +150,7 @@ public:
|
|||||||
Position victimPos = victim->GetPosition();
|
Position victimPos = victim->GetPosition();
|
||||||
me->GetMotionMaster()->MovePoint(POINT_GROUND, victimPos);
|
me->GetMotionMaster()->MovePoint(POINT_GROUND, victimPos);
|
||||||
}
|
}
|
||||||
events.ScheduleEvent(EVENT_LASH, urand(5000, 8000));
|
events.ScheduleEvent(EVENT_LASH, 5s, 8s);
|
||||||
events.CancelEvent(EVENT_POISON_STINGER);
|
events.CancelEvent(EVENT_POISON_STINGER);
|
||||||
DoResetThreat();
|
DoResetThreat();
|
||||||
}
|
}
|
||||||
@@ -179,21 +174,21 @@ public:
|
|||||||
{
|
{
|
||||||
case EVENT_STINGER_SPRAY:
|
case EVENT_STINGER_SPRAY:
|
||||||
DoCastSelf(SPELL_STINGER_SPRAY);
|
DoCastSelf(SPELL_STINGER_SPRAY);
|
||||||
events.ScheduleEvent(EVENT_STINGER_SPRAY, urand(15000, 20000));
|
events.ScheduleEvent(EVENT_STINGER_SPRAY, 15s, 20s);
|
||||||
break;
|
break;
|
||||||
case EVENT_POISON_STINGER:
|
case EVENT_POISON_STINGER:
|
||||||
DoCastVictim(SPELL_POISON_STINGER);
|
DoCastVictim(SPELL_POISON_STINGER);
|
||||||
events.ScheduleEvent(EVENT_POISON_STINGER, urand(2000, 3000));
|
events.ScheduleEvent(EVENT_POISON_STINGER, 2s, 3s);
|
||||||
break;
|
break;
|
||||||
case EVENT_PARALYZE:
|
case EVENT_PARALYZE:
|
||||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0, true))
|
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0, true))
|
||||||
{
|
{
|
||||||
DoCast(target, SPELL_PARALYZE);
|
DoCast(target, SPELL_PARALYZE);
|
||||||
instance->SetGuidData(DATA_PARALYZED, target->GetGUID());
|
instance->SetGuidData(DATA_PARALYZED, target->GetGUID());
|
||||||
uint8 Index = urand(0, 1);
|
uint8 index = urand(0, 1);
|
||||||
me->SummonCreature(NPC_LARVA, LarvaPos[Index], TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
|
me->SummonCreature(NPC_LARVA, LarvaPos[index], TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
|
||||||
}
|
}
|
||||||
events.ScheduleEvent(EVENT_PARALYZE, 15000);
|
events.ScheduleEvent(EVENT_PARALYZE, 15s);
|
||||||
break;
|
break;
|
||||||
case EVENT_SWARMER_ATTACK:
|
case EVENT_SWARMER_ATTACK:
|
||||||
for (ObjectGuid const& guid : _swarmers)
|
for (ObjectGuid const& guid : _swarmers)
|
||||||
@@ -207,43 +202,32 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
_swarmers.clear();
|
_swarmers.clear();
|
||||||
events.ScheduleEvent(EVENT_SWARMER_ATTACK, 60000);
|
events.ScheduleEvent(EVENT_SWARMER_ATTACK, 60s);
|
||||||
break;
|
break;
|
||||||
case EVENT_SUMMON_SWARMER:
|
case EVENT_SUMMON_SWARMER:
|
||||||
{
|
{
|
||||||
Position Pos = me->GetRandomPoint(SwarmerPos, 80.0f);
|
Position Pos = me->GetRandomPoint(SwarmerPos, 80.0f);
|
||||||
me->SummonCreature(NPC_SWARMER, Pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
|
me->SummonCreature(NPC_SWARMER, Pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
|
||||||
events.ScheduleEvent(EVENT_SUMMON_SWARMER, 5000);
|
events.ScheduleEvent(EVENT_SUMMON_SWARMER, 5s);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EVENT_LASH:
|
case EVENT_LASH:
|
||||||
DoCastVictim(SPELL_LASH);
|
DoCastVictim(SPELL_LASH);
|
||||||
events.ScheduleEvent(EVENT_LASH, urand(8000, 15000));
|
events.ScheduleEvent(EVENT_LASH, 8s, 15s);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
GuidList _swarmers;
|
GuidList _swarmers;
|
||||||
uint8 _phase;
|
uint8 _phase;
|
||||||
bool _enraged;
|
bool _enraged;
|
||||||
};
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return GetRuinsOfAhnQirajAI<boss_ayamissAI>(creature);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class npc_hive_zara_larva : public CreatureScript
|
struct npc_hive_zara_larva : public ScriptedAI
|
||||||
{
|
{
|
||||||
public:
|
npc_hive_zara_larva(Creature* creature) : ScriptedAI(creature)
|
||||||
npc_hive_zara_larva() : CreatureScript("npc_hive_zara_larva") { }
|
|
||||||
|
|
||||||
struct npc_hive_zara_larvaAI : public ScriptedAI
|
|
||||||
{
|
|
||||||
npc_hive_zara_larvaAI(Creature* creature) : ScriptedAI(creature)
|
|
||||||
{
|
{
|
||||||
_instance = me->GetInstanceScript();
|
_instance = me->GetInstanceScript();
|
||||||
}
|
}
|
||||||
@@ -294,18 +278,12 @@ public:
|
|||||||
|
|
||||||
ScriptedAI::UpdateAI(diff);
|
ScriptedAI::UpdateAI(diff);
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
InstanceScript* _instance;
|
InstanceScript* _instance;
|
||||||
};
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return GetRuinsOfAhnQirajAI<npc_hive_zara_larvaAI>(creature);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void AddSC_boss_ayamiss()
|
void AddSC_boss_ayamiss()
|
||||||
{
|
{
|
||||||
new boss_ayamiss();
|
RegisterRuinsOfAhnQirajCreatureAI(boss_ayamiss);
|
||||||
new npc_hive_zara_larva();
|
RegisterRuinsOfAhnQirajCreatureAI(npc_hive_zara_larva);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ struct boss_buru : public BossAI
|
|||||||
|
|
||||||
void EnterCombat(Unit* who) override
|
void EnterCombat(Unit* who) override
|
||||||
{
|
{
|
||||||
_EnterCombat();
|
BossAI::EnterCombat(who);
|
||||||
Talk(EMOTE_TARGET, who);
|
Talk(EMOTE_TARGET, who);
|
||||||
DoCastSelf(SPELL_THORNS);
|
DoCastSelf(SPELL_THORNS);
|
||||||
ManipulateEggs(true);
|
ManipulateEggs(true);
|
||||||
|
|||||||
@@ -66,9 +66,9 @@ struct boss_moam : public BossAI
|
|||||||
{
|
{
|
||||||
BossAI::EnterCombat(who);
|
BossAI::EnterCombat(who);
|
||||||
Talk(EMOTE_AGGRO);
|
Talk(EMOTE_AGGRO);
|
||||||
events.ScheduleEvent(EVENT_STONE_PHASE, 90000);
|
events.ScheduleEvent(EVENT_STONE_PHASE, 90s);
|
||||||
events.ScheduleEvent(EVENT_SPELL_TRAMPLE, 9000);
|
events.ScheduleEvent(EVENT_SPELL_TRAMPLE, 9s);
|
||||||
events.ScheduleEvent(EVENT_SPELL_DRAIN_MANA, 3000);
|
events.ScheduleEvent(EVENT_SPELL_DRAIN_MANA, 3s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustDied(Unit* /*killer*/) override
|
void JustDied(Unit* /*killer*/) override
|
||||||
@@ -113,20 +113,20 @@ struct boss_moam : public BossAI
|
|||||||
DoCastAOE(SPELL_SUMMON_MANA_FIENDS);
|
DoCastAOE(SPELL_SUMMON_MANA_FIENDS);
|
||||||
DoCastSelf(SPELL_ENERGIZE);
|
DoCastSelf(SPELL_ENERGIZE);
|
||||||
events.CancelEvent(EVENT_SPELL_DRAIN_MANA);
|
events.CancelEvent(EVENT_SPELL_DRAIN_MANA);
|
||||||
events.ScheduleEvent(EVENT_STONE_PHASE_END, 90000);
|
events.ScheduleEvent(EVENT_STONE_PHASE_END, 90s);
|
||||||
break;
|
break;
|
||||||
case EVENT_STONE_PHASE_END:
|
case EVENT_STONE_PHASE_END:
|
||||||
me->RemoveAurasDueToSpell(SPELL_ENERGIZE);
|
me->RemoveAurasDueToSpell(SPELL_ENERGIZE);
|
||||||
events.ScheduleEvent(EVENT_SPELL_DRAIN_MANA, urand(2000, 6000));
|
events.ScheduleEvent(EVENT_SPELL_DRAIN_MANA, 2s, 6s);
|
||||||
events.ScheduleEvent(EVENT_STONE_PHASE, 90000);
|
events.ScheduleEvent(EVENT_STONE_PHASE, 90s);
|
||||||
break;
|
break;
|
||||||
case EVENT_SPELL_DRAIN_MANA:
|
case EVENT_SPELL_DRAIN_MANA:
|
||||||
DoCastAOE(SPELL_DRAIN_MANA_SERVERSIDE);
|
DoCastAOE(SPELL_DRAIN_MANA_SERVERSIDE);
|
||||||
events.ScheduleEvent(EVENT_SPELL_DRAIN_MANA, urand(2000, 6000));
|
events.ScheduleEvent(EVENT_SPELL_DRAIN_MANA, 2s, 6s);
|
||||||
break;
|
break;
|
||||||
case EVENT_SPELL_TRAMPLE:
|
case EVENT_SPELL_TRAMPLE:
|
||||||
DoCastAOE(SPELL_TRAMPLE);
|
DoCastAOE(SPELL_TRAMPLE);
|
||||||
events.ScheduleEvent(EVENT_SPELL_TRAMPLE, 15000);
|
events.ScheduleEvent(EVENT_SPELL_TRAMPLE, 15s);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -46,18 +46,13 @@ enum Events
|
|||||||
EVENT_CHANGE_AGGRO = 3,
|
EVENT_CHANGE_AGGRO = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
class boss_rajaxx : public CreatureScript
|
struct boss_rajaxx : public BossAI
|
||||||
{
|
{
|
||||||
public:
|
boss_rajaxx(Creature* creature) : BossAI(creature, DATA_RAJAXX) { }
|
||||||
boss_rajaxx() : CreatureScript("boss_rajaxx") { }
|
|
||||||
|
|
||||||
struct boss_rajaxxAI : public BossAI
|
|
||||||
{
|
|
||||||
boss_rajaxxAI(Creature* creature) : BossAI(creature, DATA_RAJAXX) { }
|
|
||||||
|
|
||||||
void Reset() override
|
void Reset() override
|
||||||
{
|
{
|
||||||
_Reset();
|
BossAI::Reset();
|
||||||
enraged = false;
|
enraged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,8 +65,8 @@ public:
|
|||||||
void EnterCombat(Unit* /*victim*/) override
|
void EnterCombat(Unit* /*victim*/) override
|
||||||
{
|
{
|
||||||
_EnterCombat();
|
_EnterCombat();
|
||||||
events.ScheduleEvent(EVENT_DISARM, 10000);
|
events.ScheduleEvent(EVENT_DISARM, 10s);
|
||||||
events.ScheduleEvent(EVENT_THUNDERCRASH, 12000);
|
events.ScheduleEvent(EVENT_THUNDERCRASH, 12s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(uint32 diff) override
|
void UpdateAI(uint32 diff) override
|
||||||
@@ -90,11 +85,11 @@ public:
|
|||||||
{
|
{
|
||||||
case EVENT_DISARM:
|
case EVENT_DISARM:
|
||||||
DoCastVictim(SPELL_DISARM);
|
DoCastVictim(SPELL_DISARM);
|
||||||
events.ScheduleEvent(EVENT_DISARM, 22000);
|
events.ScheduleEvent(EVENT_DISARM, 22s);
|
||||||
break;
|
break;
|
||||||
case EVENT_THUNDERCRASH:
|
case EVENT_THUNDERCRASH:
|
||||||
DoCast(me, SPELL_THUNDERCRASH);
|
DoCastSelf(SPELL_THUNDERCRASH);
|
||||||
events.ScheduleEvent(EVENT_THUNDERCRASH, 21000);
|
events.ScheduleEvent(EVENT_THUNDERCRASH, 21s);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -103,14 +98,8 @@ public:
|
|||||||
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
bool enraged;
|
bool enraged;
|
||||||
};
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return GetRuinsOfAhnQirajAI<boss_rajaxxAI>(creature);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class spell_rajaxx_thundercrash : public SpellScript
|
class spell_rajaxx_thundercrash : public SpellScript
|
||||||
@@ -136,6 +125,6 @@ class spell_rajaxx_thundercrash : public SpellScript
|
|||||||
|
|
||||||
void AddSC_boss_rajaxx()
|
void AddSC_boss_rajaxx()
|
||||||
{
|
{
|
||||||
new boss_rajaxx();
|
RegisterRuinsOfAhnQirajCreatureAI(boss_rajaxx);
|
||||||
RegisterSpellScript(spell_rajaxx_thundercrash);
|
RegisterSpellScript(spell_rajaxx_thundercrash);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -454,9 +454,9 @@ class spell_vem_vengeance : public SpellScript
|
|||||||
|
|
||||||
void AddSC_bug_trio()
|
void AddSC_bug_trio()
|
||||||
{
|
{
|
||||||
RegisterCreatureAI(boss_kri);
|
RegisterTempleOfAhnQirajCreatureAI(boss_kri);
|
||||||
RegisterCreatureAI(boss_vem);
|
RegisterTempleOfAhnQirajCreatureAI(boss_vem);
|
||||||
RegisterCreatureAI(boss_yauj);
|
RegisterTempleOfAhnQirajCreatureAI(boss_yauj);
|
||||||
RegisterSpellScript(spell_vem_knockback);
|
RegisterSpellScript(spell_vem_knockback);
|
||||||
RegisterSpellScript(spell_vem_vengeance);
|
RegisterSpellScript(spell_vem_vengeance);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,19 +142,9 @@ public:
|
|||||||
//Kick out position
|
//Kick out position
|
||||||
const Position KickPos = { -8545.0f, 1984.0f, -96.0f, 0.0f};
|
const Position KickPos = { -8545.0f, 1984.0f, -96.0f, 0.0f};
|
||||||
|
|
||||||
class boss_eye_of_cthun : public CreatureScript
|
struct boss_eye_of_cthun : public ScriptedAI
|
||||||
{
|
{
|
||||||
public:
|
boss_eye_of_cthun(Creature* creature) : ScriptedAI(creature), _summons(creature)
|
||||||
boss_eye_of_cthun() : CreatureScript("boss_eye_of_cthun") { }
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return GetTempleOfAhnQirajAI<eye_of_cthunAI>(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct eye_of_cthunAI : public ScriptedAI
|
|
||||||
{
|
|
||||||
eye_of_cthunAI(Creature* creature) : ScriptedAI(creature), _summons(creature)
|
|
||||||
{
|
{
|
||||||
instance = creature->GetInstanceScript();
|
instance = creature->GetInstanceScript();
|
||||||
|
|
||||||
@@ -223,12 +213,14 @@ public:
|
|||||||
|
|
||||||
void ScheduleTasks()
|
void ScheduleTasks()
|
||||||
{
|
{
|
||||||
_scheduler.Schedule(3s, [this](TaskContext task)
|
_scheduler.
|
||||||
|
Schedule(3s, [this](TaskContext task)
|
||||||
{
|
{
|
||||||
DoCastRandomTarget(SPELL_GREEN_BEAM);
|
DoCastRandomTarget(SPELL_GREEN_BEAM);
|
||||||
task.SetGroup(GROUP_BEAM_PHASE);
|
task.SetGroup(GROUP_BEAM_PHASE);
|
||||||
task.Repeat();
|
task.Repeat();
|
||||||
}).Schedule(12s, [this](TaskContext task)
|
})
|
||||||
|
.Schedule(12s, [this](TaskContext task)
|
||||||
{
|
{
|
||||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
|
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
|
||||||
{
|
{
|
||||||
@@ -240,12 +232,14 @@ public:
|
|||||||
|
|
||||||
task.SetGroup(GROUP_BEAM_PHASE);
|
task.SetGroup(GROUP_BEAM_PHASE);
|
||||||
task.Repeat();
|
task.Repeat();
|
||||||
}).Schedule(45s, [this](TaskContext task)
|
})
|
||||||
|
.Schedule(45s, [this](TaskContext task)
|
||||||
{
|
{
|
||||||
DoAction(ACTION_SPAWN_EYE_TENTACLES);
|
DoAction(ACTION_SPAWN_EYE_TENTACLES);
|
||||||
task.SetGroup(GROUP_BEAM_PHASE);
|
task.SetGroup(GROUP_BEAM_PHASE);
|
||||||
task.Repeat();
|
task.Repeat();
|
||||||
}).Schedule(50s, [this](TaskContext /*task*/)
|
})
|
||||||
|
.Schedule(50s, [this](TaskContext /*task*/)
|
||||||
{
|
{
|
||||||
_scheduler.CancelGroup(GROUP_BEAM_PHASE);
|
_scheduler.CancelGroup(GROUP_BEAM_PHASE);
|
||||||
|
|
||||||
@@ -393,7 +387,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
InstanceScript* instance;
|
InstanceScript* instance;
|
||||||
|
|
||||||
//Dark Glare phase
|
//Dark Glare phase
|
||||||
@@ -404,22 +398,11 @@ public:
|
|||||||
uint32 _eyeTentacleCounter;
|
uint32 _eyeTentacleCounter;
|
||||||
TaskScheduler _scheduler;
|
TaskScheduler _scheduler;
|
||||||
SummonList _summons;
|
SummonList _summons;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class boss_cthun : public CreatureScript
|
struct boss_cthun : public ScriptedAI
|
||||||
{
|
{
|
||||||
public:
|
boss_cthun(Creature* creature) : ScriptedAI(creature)
|
||||||
boss_cthun() : CreatureScript("boss_cthun") { }
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return GetTempleOfAhnQirajAI<cthunAI>(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct cthunAI : public ScriptedAI
|
|
||||||
{
|
|
||||||
cthunAI(Creature* creature) : ScriptedAI(creature)
|
|
||||||
{
|
{
|
||||||
SetCombatMovement(false);
|
SetCombatMovement(false);
|
||||||
|
|
||||||
@@ -519,7 +502,7 @@ public:
|
|||||||
|
|
||||||
//Get random but only if we have more than one unit on threat list
|
//Get random but only if we have more than one unit on threat list
|
||||||
if (temp.size() > 1)
|
if (temp.size() > 1)
|
||||||
advance (j, rand() % (temp.size() - 1));
|
advance(j, rand() % (temp.size() - 1));
|
||||||
|
|
||||||
return (*j);
|
return (*j);
|
||||||
}
|
}
|
||||||
@@ -839,22 +822,11 @@ public:
|
|||||||
++FleshTentaclesKilled;
|
++FleshTentaclesKilled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class npc_eye_tentacle : public CreatureScript
|
struct npc_eye_tentacle : public ScriptedAI
|
||||||
{
|
{
|
||||||
public:
|
npc_eye_tentacle(Creature* creature) : ScriptedAI(creature)
|
||||||
npc_eye_tentacle() : CreatureScript("npc_eye_tentacle") { }
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return new eye_tentacleAI(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct eye_tentacleAI : public ScriptedAI
|
|
||||||
{
|
|
||||||
eye_tentacleAI(Creature* creature) : ScriptedAI(creature)
|
|
||||||
{
|
{
|
||||||
if (Creature* portal = me->SummonCreature(NPC_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
|
if (Creature* portal = me->SummonCreature(NPC_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
|
||||||
{
|
{
|
||||||
@@ -878,10 +850,12 @@ public:
|
|||||||
_scheduler.Schedule(500ms, [this](TaskContext /*task*/)
|
_scheduler.Schedule(500ms, [this](TaskContext /*task*/)
|
||||||
{
|
{
|
||||||
DoCastAOE(SPELL_GROUND_RUPTURE);
|
DoCastAOE(SPELL_GROUND_RUPTURE);
|
||||||
}).Schedule(5min, [this](TaskContext /*task*/)
|
})
|
||||||
|
.Schedule(5min, [this](TaskContext /*task*/)
|
||||||
{
|
{
|
||||||
me->DespawnOrUnsummon();
|
me->DespawnOrUnsummon();
|
||||||
}).Schedule(1s, 5s, [this](TaskContext context)
|
})
|
||||||
|
.Schedule(1s, 5s, [this](TaskContext context)
|
||||||
{
|
{
|
||||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, [&](Unit* u) { return u && u->GetTypeId() == TYPEID_PLAYER && !u->HasAura(SPELL_DIGESTIVE_ACID) && !u->HasAura(SPELL_MIND_FLAY); }))
|
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, [&](Unit* u) { return u && u->GetTypeId() == TYPEID_PLAYER && !u->HasAura(SPELL_DIGESTIVE_ACID) && !u->HasAura(SPELL_MIND_FLAY); }))
|
||||||
{
|
{
|
||||||
@@ -906,25 +880,14 @@ public:
|
|||||||
_scheduler.Update(diff);
|
_scheduler.Update(diff);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TaskScheduler _scheduler;
|
TaskScheduler _scheduler;
|
||||||
ObjectGuid _portalGUID;
|
ObjectGuid _portalGUID;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class npc_claw_tentacle : public CreatureScript
|
struct npc_claw_tentacle : public ScriptedAI
|
||||||
{
|
{
|
||||||
public:
|
npc_claw_tentacle(Creature* creature) : ScriptedAI(creature)
|
||||||
npc_claw_tentacle() : CreatureScript("npc_claw_tentacle") { }
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return new claw_tentacleAI(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct claw_tentacleAI : public ScriptedAI
|
|
||||||
{
|
|
||||||
claw_tentacleAI(Creature* creature) : ScriptedAI(creature)
|
|
||||||
{
|
{
|
||||||
SetCombatMovement(false);
|
SetCombatMovement(false);
|
||||||
|
|
||||||
@@ -976,25 +939,14 @@ public:
|
|||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TaskScheduler _scheduler;
|
TaskScheduler _scheduler;
|
||||||
ObjectGuid _portalGUID;
|
ObjectGuid _portalGUID;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class npc_giant_claw_tentacle : public CreatureScript
|
struct npc_giant_claw_tentacle : public ScriptedAI
|
||||||
{
|
{
|
||||||
public:
|
npc_giant_claw_tentacle(Creature* creature) : ScriptedAI(creature)
|
||||||
npc_giant_claw_tentacle() : CreatureScript("npc_giant_claw_tentacle") { }
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return new giant_claw_tentacleAI(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct giant_claw_tentacleAI : public ScriptedAI
|
|
||||||
{
|
|
||||||
giant_claw_tentacleAI(Creature* creature) : ScriptedAI(creature)
|
|
||||||
{
|
{
|
||||||
SetCombatMovement(false);
|
SetCombatMovement(false);
|
||||||
|
|
||||||
@@ -1029,7 +981,8 @@ public:
|
|||||||
{
|
{
|
||||||
DoCastVictim(SPELL_HAMSTRING);
|
DoCastVictim(SPELL_HAMSTRING);
|
||||||
context.Repeat(10s);
|
context.Repeat(10s);
|
||||||
}).Schedule(5s, [this](TaskContext context) {
|
}).Schedule(5s, [this](TaskContext context)
|
||||||
|
{
|
||||||
DoCastSelf(SPELL_THRASH);
|
DoCastSelf(SPELL_THRASH);
|
||||||
context.Repeat(10s);
|
context.Repeat(10s);
|
||||||
});
|
});
|
||||||
@@ -1117,25 +1070,14 @@ public:
|
|||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TaskScheduler _scheduler;
|
TaskScheduler _scheduler;
|
||||||
ObjectGuid _portalGUID;
|
ObjectGuid _portalGUID;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class npc_giant_eye_tentacle : public CreatureScript
|
struct npc_giant_eye_tentacle : public ScriptedAI
|
||||||
{
|
{
|
||||||
public:
|
npc_giant_eye_tentacle(Creature* creature) : ScriptedAI(creature)
|
||||||
npc_giant_eye_tentacle() : CreatureScript("npc_giant_eye_tentacle") { }
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return new giant_eye_tentacleAI(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct giant_eye_tentacleAI : public ScriptedAI
|
|
||||||
{
|
|
||||||
giant_eye_tentacleAI(Creature* creature) : ScriptedAI(creature)
|
|
||||||
{
|
{
|
||||||
SetCombatMovement(false);
|
SetCombatMovement(false);
|
||||||
|
|
||||||
@@ -1159,7 +1101,8 @@ public:
|
|||||||
_scheduler.Schedule(500ms, [this](TaskContext /*task*/)
|
_scheduler.Schedule(500ms, [this](TaskContext /*task*/)
|
||||||
{
|
{
|
||||||
DoCastAOE(SPELL_MASSIVE_GROUND_RUPTURE);
|
DoCastAOE(SPELL_MASSIVE_GROUND_RUPTURE);
|
||||||
}).Schedule(1s, 5s, [this](TaskContext context) {
|
}).Schedule(1s, 5s, [this](TaskContext context)
|
||||||
|
{
|
||||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, -SPELL_DIGESTIVE_ACID))
|
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, -SPELL_DIGESTIVE_ACID))
|
||||||
{
|
{
|
||||||
DoCast(target, SPELL_GREEN_BEAM);
|
DoCast(target, SPELL_GREEN_BEAM);
|
||||||
@@ -1183,20 +1126,17 @@ public:
|
|||||||
_scheduler.Update(diff);
|
_scheduler.Update(diff);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TaskScheduler _scheduler;
|
TaskScheduler _scheduler;
|
||||||
ObjectGuid _portalGUID;
|
ObjectGuid _portalGUID;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//GetAIs
|
|
||||||
|
|
||||||
void AddSC_boss_cthun()
|
void AddSC_boss_cthun()
|
||||||
{
|
{
|
||||||
new boss_eye_of_cthun();
|
RegisterTempleOfAhnQirajCreatureAI(boss_eye_of_cthun);
|
||||||
new boss_cthun();
|
RegisterTempleOfAhnQirajCreatureAI(boss_cthun);
|
||||||
new npc_eye_tentacle();
|
RegisterTempleOfAhnQirajCreatureAI(npc_eye_tentacle);
|
||||||
new npc_claw_tentacle();
|
RegisterTempleOfAhnQirajCreatureAI(npc_claw_tentacle);
|
||||||
new npc_giant_claw_tentacle();
|
RegisterTempleOfAhnQirajCreatureAI(npc_giant_claw_tentacle);
|
||||||
new npc_giant_eye_tentacle();
|
RegisterTempleOfAhnQirajCreatureAI(npc_giant_eye_tentacle);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,19 +42,9 @@ enum Spells
|
|||||||
SPELL_ENRAGE = 28798
|
SPELL_ENRAGE = 28798
|
||||||
};
|
};
|
||||||
|
|
||||||
class boss_fankriss : public CreatureScript
|
struct boss_fankriss : public ScriptedAI
|
||||||
{
|
{
|
||||||
public:
|
boss_fankriss(Creature* creature) : ScriptedAI(creature) { }
|
||||||
boss_fankriss() : CreatureScript("boss_fankriss") { }
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return GetTempleOfAhnQirajAI<boss_fankrissAI>(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct boss_fankrissAI : public ScriptedAI
|
|
||||||
{
|
|
||||||
boss_fankrissAI(Creature* creature) : ScriptedAI(creature) { }
|
|
||||||
|
|
||||||
void SummonSpawn()
|
void SummonSpawn()
|
||||||
{
|
{
|
||||||
@@ -87,10 +77,14 @@ public:
|
|||||||
{
|
{
|
||||||
_scheduler.CancelAll();
|
_scheduler.CancelAll();
|
||||||
|
|
||||||
_scheduler.Schedule(4s, 8s, [this](TaskContext context) {
|
_scheduler
|
||||||
|
.Schedule(4s, 8s, [this](TaskContext context)
|
||||||
|
{
|
||||||
DoCastVictim(SPELL_MORTAL_WOUND);
|
DoCastVictim(SPELL_MORTAL_WOUND);
|
||||||
context.Repeat();
|
context.Repeat();
|
||||||
}).Schedule(15s, 45s, [this](TaskContext context) {
|
})
|
||||||
|
.Schedule(15s, 45s, [this](TaskContext context)
|
||||||
|
{
|
||||||
switch (urand(0, 2))
|
switch (urand(0, 2))
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
@@ -107,7 +101,9 @@ public:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
context.Repeat(30s, 60s);
|
context.Repeat(30s, 60s);
|
||||||
}).Schedule(15s, 45s, [this](TaskContext context) {
|
})
|
||||||
|
.Schedule(15s, 45s, [this](TaskContext context)
|
||||||
|
{
|
||||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
|
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
|
||||||
{
|
{
|
||||||
DoCast(target, SPELL_ROOT);
|
DoCast(target, SPELL_ROOT);
|
||||||
@@ -154,15 +150,14 @@ public:
|
|||||||
std::bind(&ScriptedAI::DoMeleeAttackIfReady, this));
|
std::bind(&ScriptedAI::DoMeleeAttackIfReady, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TaskScheduler _scheduler;
|
TaskScheduler _scheduler;
|
||||||
int Rand;
|
int Rand;
|
||||||
float RandX;
|
float RandX;
|
||||||
float RandY;
|
float RandY;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void AddSC_boss_fankriss()
|
void AddSC_boss_fankriss()
|
||||||
{
|
{
|
||||||
new boss_fankriss();
|
RegisterTempleOfAhnQirajCreatureAI(boss_fankriss);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,19 +41,9 @@ enum Huhuran
|
|||||||
SPELL_WYVERN_STING_DAMAGE = 26233
|
SPELL_WYVERN_STING_DAMAGE = 26233
|
||||||
};
|
};
|
||||||
|
|
||||||
class boss_huhuran : public CreatureScript
|
struct boss_huhuran : public ScriptedAI
|
||||||
{
|
{
|
||||||
public:
|
boss_huhuran(Creature* creature) : ScriptedAI(creature) { }
|
||||||
boss_huhuran() : CreatureScript("boss_huhuran") { }
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return GetTempleOfAhnQirajAI<boss_huhuranAI>(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct boss_huhuranAI : public ScriptedAI
|
|
||||||
{
|
|
||||||
boss_huhuranAI(Creature* creature) : ScriptedAI(creature) { }
|
|
||||||
|
|
||||||
uint32 Frenzy_Timer;
|
uint32 Frenzy_Timer;
|
||||||
uint32 Wyvern_Timer;
|
uint32 Wyvern_Timer;
|
||||||
@@ -149,7 +139,6 @@ public:
|
|||||||
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 26180 - Wyvern Sting
|
// 26180 - Wyvern Sting
|
||||||
@@ -173,6 +162,6 @@ class spell_huhuran_wyvern_sting : public AuraScript
|
|||||||
|
|
||||||
void AddSC_boss_huhuran()
|
void AddSC_boss_huhuran()
|
||||||
{
|
{
|
||||||
new boss_huhuran();
|
RegisterTempleOfAhnQirajCreatureAI(boss_huhuran);
|
||||||
RegisterSpellScript(spell_huhuran_wyvern_sting);
|
RegisterSpellScript(spell_huhuran_wyvern_sting);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,19 +36,9 @@ enum Spells
|
|||||||
SPELL_SUMMON_OURO = 26061
|
SPELL_SUMMON_OURO = 26061
|
||||||
};
|
};
|
||||||
|
|
||||||
class npc_ouro_spawner : public CreatureScript
|
struct npc_ouro_spawner : public ScriptedAI
|
||||||
{
|
{
|
||||||
public:
|
npc_ouro_spawner(Creature* creature) : ScriptedAI(creature)
|
||||||
npc_ouro_spawner() : CreatureScript("npc_ouro_spawner") {}
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const
|
|
||||||
{
|
|
||||||
return new npc_ouro_spawnerAI(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct npc_ouro_spawnerAI : public ScriptedAI
|
|
||||||
{
|
|
||||||
npc_ouro_spawnerAI(Creature* creature) : ScriptedAI(creature)
|
|
||||||
{
|
{
|
||||||
Reset();
|
Reset();
|
||||||
}
|
}
|
||||||
@@ -84,22 +74,11 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class boss_ouro : public CreatureScript
|
struct boss_ouro : public ScriptedAI
|
||||||
{
|
{
|
||||||
public:
|
boss_ouro(Creature* creature) : ScriptedAI(creature) { }
|
||||||
boss_ouro() : CreatureScript("boss_ouro") { }
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return GetTempleOfAhnQirajAI<boss_ouroAI>(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct boss_ouroAI : public ScriptedAI
|
|
||||||
{
|
|
||||||
boss_ouroAI(Creature* creature) : ScriptedAI(creature) { }
|
|
||||||
|
|
||||||
uint32 Sweep_Timer;
|
uint32 Sweep_Timer;
|
||||||
uint32 SandBlast_Timer;
|
uint32 SandBlast_Timer;
|
||||||
@@ -192,11 +171,10 @@ public:
|
|||||||
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void AddSC_boss_ouro()
|
void AddSC_boss_ouro()
|
||||||
{
|
{
|
||||||
new npc_ouro_spawner();
|
RegisterTempleOfAhnQirajCreatureAI(npc_ouro_spawner);
|
||||||
new boss_ouro();
|
RegisterTempleOfAhnQirajCreatureAI(boss_ouro);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,14 +47,9 @@ enum Events
|
|||||||
|
|
||||||
uint32 const BlinkSpells[3] = { 4801, 8195, 20449 };
|
uint32 const BlinkSpells[3] = { 4801, 8195, 20449 };
|
||||||
|
|
||||||
class boss_skeram : public CreatureScript
|
struct boss_skeram : public BossAI
|
||||||
{
|
{
|
||||||
public:
|
boss_skeram(Creature* creature) : BossAI(creature, DATA_SKERAM) { }
|
||||||
boss_skeram() : CreatureScript("boss_skeram") { }
|
|
||||||
|
|
||||||
struct boss_skeramAI : public BossAI
|
|
||||||
{
|
|
||||||
boss_skeramAI(Creature* creature) : BossAI(creature, DATA_SKERAM) { }
|
|
||||||
|
|
||||||
void Reset() override
|
void Reset() override
|
||||||
{
|
{
|
||||||
@@ -127,10 +122,10 @@ public:
|
|||||||
_EnterCombat();
|
_EnterCombat();
|
||||||
events.Reset();
|
events.Reset();
|
||||||
|
|
||||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(6000, 12000));
|
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 6s, 12s);
|
||||||
events.ScheduleEvent(EVENT_FULLFILMENT, 15000);
|
events.ScheduleEvent(EVENT_FULLFILMENT, 15s);
|
||||||
events.ScheduleEvent(EVENT_BLINK, urand(30000, 45000));
|
events.ScheduleEvent(EVENT_BLINK, 30s, 45s);
|
||||||
events.ScheduleEvent(EVENT_EARTH_SHOCK, 2000);
|
events.ScheduleEvent(EVENT_EARTH_SHOCK, 2s);
|
||||||
|
|
||||||
Talk(SAY_AGGRO);
|
Talk(SAY_AGGRO);
|
||||||
}
|
}
|
||||||
@@ -148,23 +143,23 @@ public:
|
|||||||
{
|
{
|
||||||
case EVENT_ARCANE_EXPLOSION:
|
case EVENT_ARCANE_EXPLOSION:
|
||||||
DoCastAOE(SPELL_ARCANE_EXPLOSION, true);
|
DoCastAOE(SPELL_ARCANE_EXPLOSION, true);
|
||||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(8000, 18000));
|
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 8s, 18s);
|
||||||
break;
|
break;
|
||||||
case EVENT_FULLFILMENT:
|
case EVENT_FULLFILMENT:
|
||||||
/// @todo For some weird reason boss does not cast this
|
/// @todo For some weird reason boss does not cast this
|
||||||
// Spell actually works, tested in duel
|
// Spell actually works, tested in duel
|
||||||
DoCast(SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true), SPELL_TRUE_FULFILLMENT, true);
|
DoCast(SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true), SPELL_TRUE_FULFILLMENT, true);
|
||||||
events.ScheduleEvent(EVENT_FULLFILMENT, urand(20000, 30000));
|
events.ScheduleEvent(EVENT_FULLFILMENT, 20s, 30s);
|
||||||
break;
|
break;
|
||||||
case EVENT_BLINK:
|
case EVENT_BLINK:
|
||||||
DoCast(me, BlinkSpells[urand(0, 2)]);
|
DoCast(me, BlinkSpells[urand(0, 2)]);
|
||||||
DoResetThreat();
|
DoResetThreat();
|
||||||
me->SetVisible(true);
|
me->SetVisible(true);
|
||||||
events.ScheduleEvent(EVENT_BLINK, urand(10000, 30000));
|
events.ScheduleEvent(EVENT_BLINK, 10s, 30s);
|
||||||
break;
|
break;
|
||||||
case EVENT_EARTH_SHOCK:
|
case EVENT_EARTH_SHOCK:
|
||||||
DoCastVictim(SPELL_EARTH_SHOCK);
|
DoCastVictim(SPELL_EARTH_SHOCK);
|
||||||
events.ScheduleEvent(EVENT_EARTH_SHOCK, 2000);
|
events.ScheduleEvent(EVENT_EARTH_SHOCK, 2s);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -175,35 +170,24 @@ public:
|
|||||||
Talk(SAY_SPLIT);
|
Talk(SAY_SPLIT);
|
||||||
_hpct -= 25.0f;
|
_hpct -= 25.0f;
|
||||||
me->SetVisible(false);
|
me->SetVisible(false);
|
||||||
events.RescheduleEvent(EVENT_BLINK, 2000);
|
events.RescheduleEvent(EVENT_BLINK, 2s);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (me->IsWithinMeleeRange(me->GetVictim()))
|
if (me->IsWithinMeleeRange(me->GetVictim()))
|
||||||
{
|
{
|
||||||
events.RescheduleEvent(EVENT_EARTH_SHOCK, 2000);
|
events.RescheduleEvent(EVENT_EARTH_SHOCK, 2s);
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float _hpct;
|
float _hpct;
|
||||||
uint8 _flag;
|
uint8 _flag;
|
||||||
};
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return GetTempleOfAhnQirajAI<boss_skeramAI>(creature);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class spell_skeram_arcane_explosion : public SpellScriptLoader
|
class spell_skeram_arcane_explosion : public SpellScript
|
||||||
{
|
{
|
||||||
public:
|
PrepareSpellScript(spell_skeram_arcane_explosion);
|
||||||
spell_skeram_arcane_explosion() : SpellScriptLoader("spell_skeram_arcane_explosion") { }
|
|
||||||
|
|
||||||
class spell_skeram_arcane_explosion_SpellScript : public SpellScript
|
|
||||||
{
|
|
||||||
PrepareSpellScript(spell_skeram_arcane_explosion_SpellScript);
|
|
||||||
|
|
||||||
void FilterTargets(std::list<WorldObject*>& targets)
|
void FilterTargets(std::list<WorldObject*>& targets)
|
||||||
{
|
{
|
||||||
@@ -212,18 +196,12 @@ public:
|
|||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
{
|
{
|
||||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_skeram_arcane_explosion_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_skeram_arcane_explosion::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
SpellScript* GetSpellScript() const override
|
|
||||||
{
|
|
||||||
return new spell_skeram_arcane_explosion_SpellScript();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void AddSC_boss_skeram()
|
void AddSC_boss_skeram()
|
||||||
{
|
{
|
||||||
new boss_skeram();
|
RegisterTempleOfAhnQirajCreatureAI(boss_skeram);
|
||||||
new spell_skeram_arcane_explosion();
|
RegisterSpellScript(spell_skeram_arcane_explosion);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -377,20 +377,11 @@ struct boss_twinemperorsAI : public ScriptedAI
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class boss_veknilash : public CreatureScript
|
struct boss_veknilash : public boss_twinemperorsAI
|
||||||
{
|
{
|
||||||
public:
|
boss_veknilash(Creature* creature) : boss_twinemperorsAI(creature) { }
|
||||||
boss_veknilash() : CreatureScript("boss_veknilash") { }
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
bool IAmVeklor() override { return false; }
|
||||||
{
|
|
||||||
return GetTempleOfAhnQirajAI<boss_veknilashAI>(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct boss_veknilashAI : public boss_twinemperorsAI
|
|
||||||
{
|
|
||||||
bool IAmVeklor() override {return false;}
|
|
||||||
boss_veknilashAI(Creature* creature) : boss_twinemperorsAI(creature) { }
|
|
||||||
|
|
||||||
uint32 UpperCut_Timer;
|
uint32 UpperCut_Timer;
|
||||||
uint32 UnbalancingStrike_Timer;
|
uint32 UnbalancingStrike_Timer;
|
||||||
@@ -462,23 +453,13 @@ public:
|
|||||||
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class boss_veklor : public CreatureScript
|
struct boss_veklor : public boss_twinemperorsAI
|
||||||
{
|
{
|
||||||
public:
|
boss_veklor(Creature* creature) : boss_twinemperorsAI(creature) { }
|
||||||
boss_veklor() : CreatureScript("boss_veklor") { }
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
bool IAmVeklor() override { return true; }
|
||||||
{
|
|
||||||
return GetTempleOfAhnQirajAI<boss_veklorAI>(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct boss_veklorAI : public boss_twinemperorsAI
|
|
||||||
{
|
|
||||||
bool IAmVeklor() override {return true;}
|
|
||||||
boss_veklorAI(Creature* creature) : boss_twinemperorsAI(creature) { }
|
|
||||||
|
|
||||||
uint32 ShadowBolt_Timer;
|
uint32 ShadowBolt_Timer;
|
||||||
uint32 Blizzard_Timer;
|
uint32 Blizzard_Timer;
|
||||||
@@ -589,11 +570,10 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void AddSC_boss_twinemperors()
|
void AddSC_boss_twinemperors()
|
||||||
{
|
{
|
||||||
new boss_veknilash();
|
RegisterTempleOfAhnQirajCreatureAI(boss_veknilash);
|
||||||
new boss_veklor();
|
RegisterTempleOfAhnQirajCreatureAI(boss_veklor);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,14 +84,9 @@ enum MovePoints
|
|||||||
Position const ViscidusCoord = { -7992.36f, 908.19f, -52.62f, 1.68f }; /// @todo Visci isn't in room middle
|
Position const ViscidusCoord = { -7992.36f, 908.19f, -52.62f, 1.68f }; /// @todo Visci isn't in room middle
|
||||||
float const RoomRadius = 40.0f; /// @todo Not sure if its correct
|
float const RoomRadius = 40.0f; /// @todo Not sure if its correct
|
||||||
|
|
||||||
class boss_viscidus : public CreatureScript
|
struct boss_viscidus : public BossAI
|
||||||
{
|
{
|
||||||
public:
|
boss_viscidus(Creature* creature) : BossAI(creature, DATA_VISCIDUS) { }
|
||||||
boss_viscidus() : CreatureScript("boss_viscidus") { }
|
|
||||||
|
|
||||||
struct boss_viscidusAI : public BossAI
|
|
||||||
{
|
|
||||||
boss_viscidusAI(Creature* creature) : BossAI(creature, DATA_VISCIDUS) { }
|
|
||||||
|
|
||||||
void Reset() override
|
void Reset() override
|
||||||
{
|
{
|
||||||
@@ -178,8 +173,8 @@ public:
|
|||||||
void InitSpells()
|
void InitSpells()
|
||||||
{
|
{
|
||||||
DoCast(me, SPELL_TOXIN);
|
DoCast(me, SPELL_TOXIN);
|
||||||
events.ScheduleEvent(EVENT_POISONBOLT_VOLLEY, urand(10000, 15000));
|
events.ScheduleEvent(EVENT_POISONBOLT_VOLLEY, 10s, 15s);
|
||||||
events.ScheduleEvent(EVENT_POISON_SHOCK, urand(7000, 12000));
|
events.ScheduleEvent(EVENT_POISON_SHOCK, 7s, 12s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnterEvadeMode(EvadeReason why) override
|
void EnterEvadeMode(EvadeReason why) override
|
||||||
@@ -221,11 +216,11 @@ public:
|
|||||||
{
|
{
|
||||||
case EVENT_POISONBOLT_VOLLEY:
|
case EVENT_POISONBOLT_VOLLEY:
|
||||||
DoCast(me, SPELL_POISONBOLT_VOLLEY);
|
DoCast(me, SPELL_POISONBOLT_VOLLEY);
|
||||||
events.ScheduleEvent(EVENT_POISONBOLT_VOLLEY, urand(10000, 15000));
|
events.ScheduleEvent(EVENT_POISONBOLT_VOLLEY, 10s, 15s);
|
||||||
break;
|
break;
|
||||||
case EVENT_POISON_SHOCK:
|
case EVENT_POISON_SHOCK:
|
||||||
DoCast(me, SPELL_POISON_SHOCK);
|
DoCast(me, SPELL_POISON_SHOCK);
|
||||||
events.ScheduleEvent(EVENT_POISON_SHOCK, urand(7000, 12000));
|
events.ScheduleEvent(EVENT_POISON_SHOCK, 7s, 12s);
|
||||||
break;
|
break;
|
||||||
case EVENT_RESET_PHASE:
|
case EVENT_RESET_PHASE:
|
||||||
_hitcounter = 0;
|
_hitcounter = 0;
|
||||||
@@ -240,44 +235,33 @@ public:
|
|||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint8 _hitcounter;
|
uint8 _hitcounter;
|
||||||
Phases _phase;
|
Phases _phase;
|
||||||
};
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return GetTempleOfAhnQirajAI<boss_viscidusAI>(creature);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class npc_glob_of_viscidus : public CreatureScript
|
struct boss_glob_of_viscidus : public ScriptedAI
|
||||||
{
|
{
|
||||||
public:
|
boss_glob_of_viscidus(Creature* creature) : ScriptedAI(creature) { }
|
||||||
npc_glob_of_viscidus() : CreatureScript("boss_glob_of_viscidus") { }
|
|
||||||
|
|
||||||
struct npc_glob_of_viscidusAI : public ScriptedAI
|
|
||||||
{
|
|
||||||
npc_glob_of_viscidusAI(Creature* creature) : ScriptedAI(creature) { }
|
|
||||||
|
|
||||||
void JustDied(Unit* /*killer*/) override
|
void JustDied(Unit* /*killer*/) override
|
||||||
{
|
{
|
||||||
InstanceScript* Instance = me->GetInstanceScript();
|
InstanceScript* instance = me->GetInstanceScript();
|
||||||
|
|
||||||
if (Creature* Viscidus = me->GetMap()->GetCreature(Instance->GetGuidData(DATA_VISCIDUS)))
|
if (Creature* viscidus = me->GetMap()->GetCreature(instance->GetGuidData(DATA_VISCIDUS)))
|
||||||
{
|
{
|
||||||
if (BossAI* ViscidusAI = dynamic_cast<BossAI*>(Viscidus->GetAI()))
|
if (BossAI* viscidusAI = dynamic_cast<BossAI*>(viscidus->GetAI()))
|
||||||
ViscidusAI->SummonedCreatureDespawn(me);
|
viscidusAI->SummonedCreatureDespawn(me);
|
||||||
|
|
||||||
if (Viscidus->IsAlive() && Viscidus->GetHealthPct() < 5.0f)
|
if (viscidus->IsAlive() && viscidus->GetHealthPct() < 5.0f)
|
||||||
{
|
{
|
||||||
Viscidus->SetVisible(true);
|
viscidus->SetVisible(true);
|
||||||
Unit::Kill(Viscidus->GetVictim(), Viscidus);
|
Unit::Kill(viscidus->GetVictim(), viscidus);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Viscidus->SetHealth(Viscidus->GetHealth() - Viscidus->GetMaxHealth() / 20);
|
viscidus->SetHealth(viscidus->GetHealth() - viscidus->GetMaxHealth() / 20);
|
||||||
Viscidus->CastSpell(Viscidus, SPELL_VISCIDUS_SHRINKS);
|
viscidus->CastSpell(viscidus, SPELL_VISCIDUS_SHRINKS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -291,16 +275,10 @@ public:
|
|||||||
summon->UnSummon();
|
summon->UnSummon();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return GetTempleOfAhnQirajAI<npc_glob_of_viscidusAI>(creature);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void AddSC_boss_viscidus()
|
void AddSC_boss_viscidus()
|
||||||
{
|
{
|
||||||
new boss_viscidus();
|
RegisterTempleOfAhnQirajCreatureAI(boss_viscidus);
|
||||||
new npc_glob_of_viscidus();
|
RegisterTempleOfAhnQirajCreatureAI(boss_glob_of_viscidus);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,4 +75,6 @@ inline AI* GetTempleOfAhnQirajAI(T* obj)
|
|||||||
return GetInstanceAI<AI>(obj, TempleOfAhnQirajScriptName);
|
return GetInstanceAI<AI>(obj, TempleOfAhnQirajScriptName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define RegisterTempleOfAhnQirajCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetTempleOfAhnQirajAI)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user