mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Misc: Refactor scripts to fix static analysis warnings
Fifth batch of fixes targeting 100 issues reported by Coverity
This commit is contained in:
@@ -66,14 +66,22 @@ public:
|
||||
|
||||
struct boss_maexxnaAI : public BossAI
|
||||
{
|
||||
boss_maexxnaAI(Creature* creature) : BossAI(creature, BOSS_MAEXXNA) { }
|
||||
boss_maexxnaAI(Creature* creature) : BossAI(creature, BOSS_MAEXXNA)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
enraged = false;
|
||||
}
|
||||
|
||||
bool enraged;
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
{
|
||||
_EnterCombat();
|
||||
enraged = false;
|
||||
Initialize();
|
||||
events.ScheduleEvent(EVENT_WRAP, 20000);
|
||||
events.ScheduleEvent(EVENT_SPRAY, 40000);
|
||||
events.ScheduleEvent(EVENT_SHOCK, urand(5000, 10000));
|
||||
|
||||
@@ -72,7 +72,11 @@ public:
|
||||
|
||||
struct boss_nothAI : public BossAI
|
||||
{
|
||||
boss_nothAI(Creature* creature) : BossAI(creature, BOSS_NOTH) { }
|
||||
boss_nothAI(Creature* creature) : BossAI(creature, BOSS_NOTH)
|
||||
{
|
||||
balconyCount = 0;
|
||||
waveCount = 0;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
|
||||
@@ -61,7 +61,10 @@ public:
|
||||
|
||||
struct boss_patchwerkAI : public BossAI
|
||||
{
|
||||
boss_patchwerkAI(Creature* creature) : BossAI(creature, BOSS_PATCHWERK) { }
|
||||
boss_patchwerkAI(Creature* creature) : BossAI(creature, BOSS_PATCHWERK)
|
||||
{
|
||||
Enraged = false;
|
||||
}
|
||||
|
||||
bool Enraged;
|
||||
|
||||
|
||||
@@ -90,9 +90,19 @@ class boss_sapphiron : public CreatureScript
|
||||
struct boss_sapphironAI : public BossAI
|
||||
{
|
||||
boss_sapphironAI(Creature* creature) :
|
||||
BossAI(creature, BOSS_SAPPHIRON), _phase(PHASE_NULL),
|
||||
_map(me->GetMap())
|
||||
{ }
|
||||
BossAI(creature, BOSS_SAPPHIRON), _map(me->GetMap())
|
||||
{
|
||||
Initialize();
|
||||
_iceboltCount = 0;
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_phase = PHASE_NULL;
|
||||
|
||||
_canTheHundredClub = true;
|
||||
_checkFrostResistTimer = 5 * IN_MILLISECONDS;
|
||||
}
|
||||
|
||||
void InitializeAI() override
|
||||
{
|
||||
@@ -115,10 +125,7 @@ class boss_sapphiron : public CreatureScript
|
||||
if (_phase == PHASE_FLIGHT)
|
||||
ClearIceBlock();
|
||||
|
||||
_phase = PHASE_NULL;
|
||||
|
||||
_canTheHundredClub = true;
|
||||
_checkFrostResistTimer = 5 * IN_MILLISECONDS;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
|
||||
@@ -137,6 +137,9 @@ public:
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
polaritySwitch = false;
|
||||
uiAddsTimer = 0;
|
||||
}
|
||||
|
||||
bool checkStalaggAlive;
|
||||
@@ -287,9 +290,16 @@ public:
|
||||
{
|
||||
npc_stalaggAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
powerSurgeTimer = urand(20000, 25000);
|
||||
magneticPullTimer = 20000;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 powerSurgeTimer;
|
||||
@@ -300,8 +310,7 @@ public:
|
||||
if (Creature* pThaddius = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_THADDIUS)))
|
||||
if (pThaddius->AI())
|
||||
pThaddius->AI()->DoAction(ACTION_STALAGG_RESET);
|
||||
powerSurgeTimer = urand(20000, 25000);
|
||||
magneticPullTimer = 20000;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
@@ -379,9 +388,15 @@ public:
|
||||
{
|
||||
npc_feugenAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
staticFieldTimer = 5000;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 staticFieldTimer;
|
||||
@@ -391,7 +406,7 @@ public:
|
||||
if (Creature* pThaddius = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_THADDIUS)))
|
||||
if (pThaddius->AI())
|
||||
pThaddius->AI()->DoAction(ACTION_FEUGEN_RESET);
|
||||
staticFieldTimer = 5000;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
|
||||
@@ -126,6 +126,9 @@ class instance_naxxramas : public InstanceMapScript
|
||||
SapphironGUID = 0;
|
||||
KelthuzadGUID = 0;
|
||||
KelthuzadTriggerGUID = 0;
|
||||
minHorsemenDiedTime = 0;
|
||||
maxHorsemenDiedTime = 0;
|
||||
AbominationCount = 0;
|
||||
|
||||
playerDied = 0;
|
||||
|
||||
@@ -447,7 +450,6 @@ class instance_naxxramas : public InstanceMapScript
|
||||
uint64 BaronGUID;
|
||||
uint64 SirGUID;
|
||||
uint64 HorsemenChestGUID;
|
||||
uint64 HorsemenTeleporterGUID;
|
||||
time_t minHorsemenDiedTime;
|
||||
time_t maxHorsemenDiedTime;
|
||||
|
||||
|
||||
@@ -342,16 +342,13 @@ public:
|
||||
{
|
||||
boss_malygosAI(Creature* creature) : BossAI(creature, DATA_MALYGOS_EVENT)
|
||||
{
|
||||
Initialize();
|
||||
_despawned = false; // We determine if Malygos will be realocated to spawning position on reset triggered by boss despawn on evade
|
||||
_flySpeed = me->GetSpeed(MOVE_FLIGHT); // Get initial fly speed, otherwise on each wipe fly speed would add up if we get it
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
void Initialize()
|
||||
{
|
||||
// EnterEvadeMode and Reset() links are cut for the sake of properly functioning despawner.
|
||||
if (!_despawned)
|
||||
_Reset();
|
||||
|
||||
_summonDeaths = 0;
|
||||
_preparingPulsesChecker = 0;
|
||||
_arcaneOverloadGUID = 0;
|
||||
@@ -366,6 +363,15 @@ public:
|
||||
_firstCyclicMovementStarted = false;
|
||||
_performingSurgeOfPower = false;
|
||||
_performingDestroyPlatform = false;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
// EnterEvadeMode and Reset() links are cut for the sake of properly functioning despawner.
|
||||
if (!_despawned)
|
||||
_Reset();
|
||||
|
||||
Initialize();
|
||||
|
||||
me->SetDisableGravity(true);
|
||||
me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
|
||||
@@ -1173,17 +1179,23 @@ public:
|
||||
{
|
||||
npc_melee_hover_diskAI(Creature* creature) : VehicleAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
_instance = creature->GetInstanceScript();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
// TO DO: These were a bit faster than what they should be. Not sure what is the reason.
|
||||
me->SetSpeed(MOVE_FLIGHT, 1.25f);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_wpCount = 0;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
VehicleAI::Reset();
|
||||
|
||||
_wpCount = 0;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void PassengerBoarded(Unit* unit, int8 /*seat*/, bool apply) override
|
||||
@@ -1507,10 +1519,7 @@ public:
|
||||
void IsSummonedBy(Unit* summoner) override
|
||||
{
|
||||
if (Creature* creature = summoner->ToCreature())
|
||||
{
|
||||
_malygos = creature;
|
||||
_malygos->AI()->SetGUID(me->GetGUID(), DATA_LAST_OVERLOAD_GUID);
|
||||
}
|
||||
creature->AI()->SetGUID(me->GetGUID(), DATA_LAST_OVERLOAD_GUID);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 /*diff*/)
|
||||
@@ -1539,7 +1548,6 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
Creature* _malygos;
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
@@ -1559,6 +1567,7 @@ public:
|
||||
{
|
||||
npc_wyrmrest_skytalonAI(Creature* creature) : VehicleAI(creature)
|
||||
{
|
||||
_summoner = NULL;
|
||||
}
|
||||
|
||||
void IsSummonedBy(Unit* summoner) override
|
||||
|
||||
@@ -47,6 +47,8 @@ public:
|
||||
platformGUID = 0;
|
||||
exitPortalGUID = 0;
|
||||
alexstraszaBunnyGUID = 0;
|
||||
heartOfMagicGUID = 0;
|
||||
giftBoxBunnyGUID = 0;
|
||||
};
|
||||
|
||||
bool SetBossState(uint32 type, EncounterState state) override
|
||||
|
||||
@@ -77,23 +77,28 @@ class boss_anomalus : public CreatureScript
|
||||
{
|
||||
boss_anomalusAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
Phase = 0;
|
||||
uiSparkTimer = 5000;
|
||||
uiChaoticRiftGUID = 0;
|
||||
chaosTheory = true;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint8 Phase;
|
||||
uint32 uiSparkTimer;
|
||||
uint32 uiCreateRiftTimer;
|
||||
uint64 uiChaoticRiftGUID;
|
||||
bool chaosTheory;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Phase = 0;
|
||||
uiSparkTimer = 5000;
|
||||
uiChaoticRiftGUID = 0;
|
||||
chaosTheory = true;
|
||||
Initialize();
|
||||
|
||||
instance->SetData(DATA_ANOMALUS_EVENT, NOT_STARTED);
|
||||
}
|
||||
@@ -197,10 +202,17 @@ class npc_chaotic_rift : public CreatureScript
|
||||
{
|
||||
npc_chaotic_riftAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = me->GetInstanceScript();
|
||||
SetCombatMovement(false);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
uiChaoticEnergyBurstTimer = 1000;
|
||||
uiSummonCrazedManaWraithTimer = 5000;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 uiChaoticEnergyBurstTimer;
|
||||
@@ -208,8 +220,7 @@ class npc_chaotic_rift : public CreatureScript
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
uiChaoticEnergyBurstTimer = 1000;
|
||||
uiSummonCrazedManaWraithTimer = 5000;
|
||||
Initialize();
|
||||
me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
|
||||
DoCast(me, SPELL_ARCANEFORM, false);
|
||||
}
|
||||
|
||||
@@ -68,9 +68,20 @@ public:
|
||||
{
|
||||
boss_keristraszaAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
uiCrystalfireBreathTimer = 14 * IN_MILLISECONDS;
|
||||
uiCrystalChainsCrystalizeTimer = DUNGEON_MODE(30 * IN_MILLISECONDS, 11 * IN_MILLISECONDS);
|
||||
uiTailSweepTimer = 5 * IN_MILLISECONDS;
|
||||
bEnrage = false;
|
||||
|
||||
intenseCold = true;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
std::list<uint64> intenseColdList;
|
||||
@@ -83,12 +94,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
uiCrystalfireBreathTimer = 14*IN_MILLISECONDS;
|
||||
uiCrystalChainsCrystalizeTimer = DUNGEON_MODE(30*IN_MILLISECONDS, 11*IN_MILLISECONDS);
|
||||
uiTailSweepTimer = 5*IN_MILLISECONDS;
|
||||
bEnrage = false;
|
||||
|
||||
intenseCold = true;
|
||||
Initialize();
|
||||
intenseColdList.clear();
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
|
||||
@@ -72,7 +72,32 @@ public:
|
||||
{
|
||||
boss_magus_telestraAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
bFireMagusDead = false;
|
||||
bFrostMagusDead = false;
|
||||
bArcaneMagusDead = false;
|
||||
uiIsWaitingToAppearTimer = 0;
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
Phase = 0;
|
||||
//These times are probably wrong
|
||||
uiIceNovaTimer = 7 * IN_MILLISECONDS;
|
||||
uiFireBombTimer = 0;
|
||||
uiGravityWellTimer = 15 * IN_MILLISECONDS;
|
||||
uiCooldown = 0;
|
||||
|
||||
uiFireMagusGUID = 0;
|
||||
uiFrostMagusGUID = 0;
|
||||
uiArcaneMagusGUID = 0;
|
||||
|
||||
for (uint8 n = 0; n < 3; ++n)
|
||||
time[n] = 0;
|
||||
|
||||
splitPersonality = 0;
|
||||
bIsWaitingToAppear = false;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
@@ -98,22 +123,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Phase = 0;
|
||||
//These times are probably wrong
|
||||
uiIceNovaTimer = 7*IN_MILLISECONDS;
|
||||
uiFireBombTimer = 0;
|
||||
uiGravityWellTimer = 15*IN_MILLISECONDS;
|
||||
uiCooldown = 0;
|
||||
|
||||
uiFireMagusGUID = 0;
|
||||
uiFrostMagusGUID = 0;
|
||||
uiArcaneMagusGUID = 0;
|
||||
|
||||
for (uint8 n = 0; n < 3; ++n)
|
||||
time[n] = 0;
|
||||
|
||||
splitPersonality = 0;
|
||||
bIsWaitingToAppear = false;
|
||||
Initialize();
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetVisible(true);
|
||||
|
||||
@@ -68,12 +68,20 @@ public:
|
||||
|
||||
struct boss_ormorokAI : public BossAI
|
||||
{
|
||||
boss_ormorokAI(Creature* creature) : BossAI(creature, DATA_ORMOROK_EVENT) { }
|
||||
boss_ormorokAI(Creature* creature) : BossAI(creature, DATA_ORMOROK_EVENT)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
frenzy = false;
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
frenzy = false;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
|
||||
@@ -57,7 +57,15 @@ class boss_drakos : public CreatureScript
|
||||
|
||||
struct boss_drakosAI : public BossAI
|
||||
{
|
||||
boss_drakosAI(Creature* creature) : BossAI(creature, DATA_DRAKOS) { }
|
||||
boss_drakosAI(Creature* creature) : BossAI(creature, DATA_DRAKOS)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
postPull = false;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
@@ -67,7 +75,7 @@ class boss_drakos : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_STOMP, 17000);
|
||||
events.ScheduleEvent(EVENT_BOMB_SUMMON, 2000);
|
||||
|
||||
postPull = false;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
@@ -150,7 +158,15 @@ class npc_unstable_sphere : public CreatureScript
|
||||
|
||||
struct npc_unstable_sphereAI : public ScriptedAI
|
||||
{
|
||||
npc_unstable_sphereAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
npc_unstable_sphereAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
pulseTimer = 3000;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
@@ -160,7 +176,7 @@ class npc_unstable_sphere : public CreatureScript
|
||||
me->AddAura(SPELL_UNSTABLE_SPHERE_PASSIVE, me);
|
||||
me->AddAura(SPELL_UNSTABLE_SPHERE_TIMER, me);
|
||||
|
||||
pulseTimer = 3000;
|
||||
Initialize();
|
||||
|
||||
me->DespawnOrUnsummon(19000);
|
||||
}
|
||||
|
||||
@@ -85,16 +85,24 @@ class boss_eregos : public CreatureScript
|
||||
|
||||
struct boss_eregosAI : public BossAI
|
||||
{
|
||||
boss_eregosAI(Creature* creature) : BossAI(creature, DATA_EREGOS) { }
|
||||
|
||||
void Reset() override
|
||||
boss_eregosAI(Creature* creature) : BossAI(creature, DATA_EREGOS)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_Reset();
|
||||
_phase = PHASE_NORMAL;
|
||||
|
||||
_rubyVoid = true;
|
||||
_emeraldVoid = true;
|
||||
_amberVoid = true;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
Initialize();
|
||||
|
||||
DoAction(ACTION_SET_NORMAL_EVENTS);
|
||||
}
|
||||
|
||||
@@ -95,6 +95,7 @@ class boss_urom : public CreatureScript
|
||||
{
|
||||
boss_uromAI(Creature* creature) : BossAI(creature, DATA_UROM)
|
||||
{
|
||||
Initialize();
|
||||
platform = 0;
|
||||
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
@@ -103,19 +104,13 @@ class boss_urom : public CreatureScript
|
||||
std::random_shuffle(group, group + 3);
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
void Initialize()
|
||||
{
|
||||
me->CastSpell(me, SPELL_EVOCATE);
|
||||
|
||||
_Reset();
|
||||
|
||||
x = 0.0f;
|
||||
y = 0.0f;
|
||||
canCast = false;
|
||||
canGoBack = false;
|
||||
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
|
||||
teleportTimer = urand(30000, 35000);
|
||||
arcaneExplosionTimer = 9000;
|
||||
castArcaneExplosionTimer = 2000;
|
||||
@@ -123,6 +118,15 @@ class boss_urom : public CreatureScript
|
||||
timeBombTimer = urand(20000, 25000);
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
me->CastSpell(me, SPELL_EVOCATE);
|
||||
|
||||
_Reset();
|
||||
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
{
|
||||
_EnterCombat();
|
||||
|
||||
@@ -59,7 +59,16 @@ class boss_varos : public CreatureScript
|
||||
|
||||
struct boss_varosAI : public BossAI
|
||||
{
|
||||
boss_varosAI(Creature* creature) : BossAI(creature, DATA_VAROS) { }
|
||||
boss_varosAI(Creature* creature) : BossAI(creature, DATA_VAROS)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
firstCoreEnergize = false;
|
||||
coreEnergizeOrientation = 0.0f;
|
||||
}
|
||||
|
||||
void InitializeAI() override
|
||||
{
|
||||
@@ -77,8 +86,7 @@ class boss_varos : public CreatureScript
|
||||
// not sure if this is handled by a timer or hp percentage
|
||||
events.ScheduleEvent(EVENT_CALL_AZURE, urand(15, 30) * IN_MILLISECONDS);
|
||||
|
||||
firstCoreEnergize = false;
|
||||
coreEnergizeOrientation = 0.0f;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
@@ -170,12 +178,18 @@ class npc_azure_ring_captain : public CreatureScript
|
||||
{
|
||||
npc_azure_ring_captainAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
targetGUID = 0;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
targetGUID = 0;
|
||||
Initialize();
|
||||
|
||||
me->SetWalk(true);
|
||||
//! HACK: Creature's can't have MOVEMENTFLAG_FLYING
|
||||
|
||||
@@ -232,13 +232,19 @@ class npc_ruby_emerald_amber_drake : public CreatureScript
|
||||
{
|
||||
npc_ruby_emerald_amber_drakeAI(Creature* creature) : VehicleAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
_instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_healthWarning = true;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_events.Reset();
|
||||
_healthWarning = true;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void IsSummonedBy(Unit* summoner) override
|
||||
|
||||
@@ -106,12 +106,35 @@ public:
|
||||
{
|
||||
boss_bjarngrimAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
m_uiStance = STANCE_DEFENSIVE;
|
||||
memset(&m_auiStormforgedLieutenantGUID, 0, sizeof(m_auiStormforgedLieutenantGUID));
|
||||
canBuff = true;
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
m_bIsChangingStance = false;
|
||||
|
||||
m_uiChargingStatus = 0;
|
||||
m_uiCharge_Timer = 1000;
|
||||
|
||||
m_uiChangeStance_Timer = urand(20000, 25000);
|
||||
|
||||
m_uiReflection_Timer = 8000;
|
||||
m_uiKnockAway_Timer = 20000;
|
||||
m_uiPummel_Timer = 10000;
|
||||
m_uiIronform_Timer = 25000;
|
||||
|
||||
m_uiIntercept_Timer = 5000;
|
||||
m_uiWhirlwind_Timer = 10000;
|
||||
m_uiCleave_Timer = 8000;
|
||||
|
||||
m_uiMortalStrike_Timer = 8000;
|
||||
m_uiSlam_Timer = 10000;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
bool m_bIsChangingStance;
|
||||
@@ -143,24 +166,7 @@ public:
|
||||
if (!me->HasAura(SPELL_TEMPORARY_ELECTRICAL_CHARGE))
|
||||
me->AddAura(SPELL_TEMPORARY_ELECTRICAL_CHARGE, me);
|
||||
|
||||
m_bIsChangingStance = false;
|
||||
|
||||
m_uiChargingStatus = 0;
|
||||
m_uiCharge_Timer = 1000;
|
||||
|
||||
m_uiChangeStance_Timer = urand(20000, 25000);
|
||||
|
||||
m_uiReflection_Timer = 8000;
|
||||
m_uiKnockAway_Timer = 20000;
|
||||
m_uiPummel_Timer = 10000;
|
||||
m_uiIronform_Timer = 25000;
|
||||
|
||||
m_uiIntercept_Timer = 5000;
|
||||
m_uiWhirlwind_Timer = 10000;
|
||||
m_uiCleave_Timer = 8000;
|
||||
|
||||
m_uiMortalStrike_Timer = 8000;
|
||||
m_uiSlam_Timer = 10000;
|
||||
Initialize();
|
||||
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
{
|
||||
@@ -393,9 +399,16 @@ public:
|
||||
{
|
||||
npc_stormforged_lieutenantAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
m_uiArcWeld_Timer = urand(20000, 21000);
|
||||
m_uiRenewSteel_Timer = urand(10000, 11000);
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 m_uiArcWeld_Timer;
|
||||
@@ -403,8 +416,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
m_uiArcWeld_Timer = urand(20000, 21000);
|
||||
m_uiRenewSteel_Timer = urand(10000, 11000);
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who) override
|
||||
|
||||
@@ -76,9 +76,23 @@ public:
|
||||
{
|
||||
boss_ionarAI(Creature* creature) : ScriptedAI(creature), lSparkList(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
bIsSplitPhase = true;
|
||||
bHasDispersed = false;
|
||||
|
||||
uiSplitTimer = 25 * IN_MILLISECONDS;
|
||||
|
||||
uiStaticOverloadTimer = urand(5 * IN_MILLISECONDS, 6 * IN_MILLISECONDS);
|
||||
uiBallLightningTimer = urand(10 * IN_MILLISECONDS, 11 * IN_MILLISECONDS);
|
||||
|
||||
uiDisperseHealth = 45 + urand(0, 10);
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
SummonList lSparkList;
|
||||
@@ -97,15 +111,7 @@ public:
|
||||
{
|
||||
lSparkList.DespawnAll();
|
||||
|
||||
bIsSplitPhase = true;
|
||||
bHasDispersed = false;
|
||||
|
||||
uiSplitTimer = 25*IN_MILLISECONDS;
|
||||
|
||||
uiStaticOverloadTimer = urand(5*IN_MILLISECONDS, 6*IN_MILLISECONDS);
|
||||
uiBallLightningTimer = urand(10*IN_MILLISECONDS, 11*IN_MILLISECONDS);
|
||||
|
||||
uiDisperseHealth = 45 + urand(0, 10);
|
||||
Initialize();
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_DISABLE_MOVE);
|
||||
|
||||
@@ -297,16 +303,22 @@ public:
|
||||
{
|
||||
npc_spark_of_ionarAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
uiCheckTimer = 2 * IN_MILLISECONDS;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 uiCheckTimer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
uiCheckTimer = 2*IN_MILLISECONDS;
|
||||
Initialize();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
|
||||
@@ -74,9 +74,19 @@ public:
|
||||
{
|
||||
boss_lokenAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
m_uiArcLightning_Timer = 15000;
|
||||
m_uiLightningNova_Timer = 20000;
|
||||
m_uiResumePulsingShockwave_Timer = 1000;
|
||||
|
||||
m_uiHealthAmountModifier = 1;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 m_uiArcLightning_Timer;
|
||||
@@ -87,11 +97,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
m_uiArcLightning_Timer = 15000;
|
||||
m_uiLightningNova_Timer = 20000;
|
||||
m_uiResumePulsingShockwave_Timer = 1000;
|
||||
|
||||
m_uiHealthAmountModifier = 1;
|
||||
Initialize();
|
||||
|
||||
instance->SetBossState(DATA_LOKEN, NOT_STARTED);
|
||||
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMELY_DEATH_START_EVENT);
|
||||
|
||||
@@ -78,9 +78,26 @@ public:
|
||||
{
|
||||
boss_volkhanAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
m_bIsStriking = false;
|
||||
m_bHasTemper = false;
|
||||
m_bCanShatterGolem = false;
|
||||
|
||||
m_uiPause_Timer = 3500;
|
||||
m_uiShatteringStomp_Timer = 0;
|
||||
m_uiShatter_Timer = 5000;
|
||||
m_uiDelay_Timer = 1000;
|
||||
m_uiSummonPhase = 0;
|
||||
GolemsShattered = 0;
|
||||
|
||||
m_uiHealthAmountModifier = 1;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
std::list<uint64> m_lGolemGUIDList;
|
||||
@@ -100,18 +117,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
m_bIsStriking = false;
|
||||
m_bHasTemper = false;
|
||||
m_bCanShatterGolem = false;
|
||||
|
||||
m_uiPause_Timer = 3500;
|
||||
m_uiShatteringStomp_Timer = 0;
|
||||
m_uiShatter_Timer = 5000;
|
||||
m_uiDelay_Timer = 1000;
|
||||
m_uiSummonPhase = 0;
|
||||
GolemsShattered = 0;
|
||||
|
||||
m_uiHealthAmountModifier = 1;
|
||||
Initialize();
|
||||
|
||||
DespawnGolem();
|
||||
m_lGolemGUIDList.clear();
|
||||
@@ -362,7 +368,19 @@ public:
|
||||
|
||||
struct npc_molten_golemAI : public ScriptedAI
|
||||
{
|
||||
npc_molten_golemAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
npc_molten_golemAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
m_bIsFrozen = false;
|
||||
|
||||
m_uiBlast_Timer = 20000;
|
||||
m_uiDeathDelay_Timer = 0;
|
||||
m_uiImmolation_Timer = 5000;
|
||||
}
|
||||
|
||||
bool m_bIsFrozen;
|
||||
|
||||
@@ -372,11 +390,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
m_bIsFrozen = false;
|
||||
|
||||
m_uiBlast_Timer = 20000;
|
||||
m_uiDeathDelay_Timer = 0;
|
||||
m_uiImmolation_Timer = 5000;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who) override
|
||||
|
||||
@@ -76,12 +76,20 @@ class boss_sjonnir : public CreatureScript
|
||||
|
||||
struct boss_sjonnirAI : public BossAI
|
||||
{
|
||||
boss_sjonnirAI(Creature* creature) : BossAI(creature, DATA_SJONNIR) { }
|
||||
boss_sjonnirAI(Creature* creature) : BossAI(creature, DATA_SJONNIR)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
abuseTheOoze = 0;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
abuseTheOoze = 0;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who) override
|
||||
@@ -211,11 +219,19 @@ class npc_malformed_ooze : public CreatureScript
|
||||
|
||||
struct npc_malformed_oozeAI : public ScriptedAI
|
||||
{
|
||||
npc_malformed_oozeAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
npc_malformed_oozeAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_mergeTimer = 10000;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_mergeTimer = 10000;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
|
||||
@@ -138,10 +138,22 @@ public:
|
||||
{
|
||||
npc_tribuna_controllerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
SetCombatMovement(false);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
uiKaddrakEncounterTimer = 1500;
|
||||
uiMarnakEncounterTimer = 10000;
|
||||
uiAbedneumEncounterTimer = 10000;
|
||||
|
||||
bKaddrakActivated = false;
|
||||
bMarnakActivated = false;
|
||||
bAbedneumActivated = false;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 uiKaddrakEncounterTimer;
|
||||
@@ -156,13 +168,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
uiKaddrakEncounterTimer = 1500;
|
||||
uiMarnakEncounterTimer = 10000;
|
||||
uiAbedneumEncounterTimer = 10000;
|
||||
|
||||
bKaddrakActivated = false;
|
||||
bMarnakActivated = false;
|
||||
bAbedneumActivated = false;
|
||||
Initialize();
|
||||
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_KADDRAK), false);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_MARNAK), false);
|
||||
@@ -290,9 +296,20 @@ public:
|
||||
{
|
||||
npc_brann_hosAI(Creature* creature) : npc_escortAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
bIsLowHP = false;
|
||||
bIsBattle = false;
|
||||
uiStep = 0;
|
||||
uiPhaseTimer = 0;
|
||||
uiControllerGUID = 0;
|
||||
brannSparklinNews = true;
|
||||
}
|
||||
|
||||
uint32 uiStep;
|
||||
uint32 uiPhaseTimer;
|
||||
|
||||
@@ -309,12 +326,7 @@ public:
|
||||
{
|
||||
if (!HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
{
|
||||
bIsLowHP = false;
|
||||
bIsBattle = false;
|
||||
uiStep = 0;
|
||||
uiPhaseTimer = 0;
|
||||
uiControllerGUID = 0;
|
||||
brannSparklinNews = true;
|
||||
Initialize();
|
||||
|
||||
DespawnDwarf();
|
||||
|
||||
|
||||
@@ -301,17 +301,23 @@ class boss_algalon_the_observer : public CreatureScript
|
||||
{
|
||||
boss_algalon_the_observerAI(Creature* creature) : BossAI(creature, BOSS_ALGALON)
|
||||
{
|
||||
Initialize();
|
||||
_firstPull = true;
|
||||
_fedOnTears = false;
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_phaseTwo = false;
|
||||
_fightWon = false;
|
||||
_hasYelled = false;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
_phaseTwo = false;
|
||||
_fightWon = false;
|
||||
_hasYelled = false;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
@@ -715,13 +721,19 @@ class npc_living_constellation : public CreatureScript
|
||||
{
|
||||
npc_living_constellationAI(Creature* creature) : CreatureAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_isActive = false;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_events.Reset();
|
||||
_events.ScheduleEvent(EVENT_ARCANE_BARRAGE, 2500);
|
||||
_isActive = false;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 /*type*/) const override
|
||||
@@ -858,6 +870,7 @@ class npc_brann_bronzebeard_algalon : public CreatureScript
|
||||
{
|
||||
npc_brann_bronzebeard_algalonAI(Creature* creature) : CreatureAI(creature)
|
||||
{
|
||||
_currentPoint = 0;
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
|
||||
@@ -138,14 +138,22 @@ class boss_steelbreaker : public CreatureScript
|
||||
|
||||
struct boss_steelbreakerAI : public BossAI
|
||||
{
|
||||
boss_steelbreakerAI(Creature* creature) : BossAI(creature, BOSS_ASSEMBLY_OF_IRON) { }
|
||||
boss_steelbreakerAI(Creature* creature) : BossAI(creature, BOSS_ASSEMBLY_OF_IRON)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
phase = 0;
|
||||
}
|
||||
|
||||
uint32 phase;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
phase = 0;
|
||||
Initialize();
|
||||
me->RemoveAllAuras();
|
||||
}
|
||||
|
||||
@@ -275,14 +283,22 @@ class boss_runemaster_molgeim : public CreatureScript
|
||||
|
||||
struct boss_runemaster_molgeimAI : public BossAI
|
||||
{
|
||||
boss_runemaster_molgeimAI(Creature* creature) : BossAI(creature, BOSS_ASSEMBLY_OF_IRON) { }
|
||||
boss_runemaster_molgeimAI(Creature* creature) : BossAI(creature, BOSS_ASSEMBLY_OF_IRON)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
phase = 0;
|
||||
}
|
||||
|
||||
uint32 phase;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
phase = 0;
|
||||
Initialize();
|
||||
me->RemoveAllAuras();
|
||||
}
|
||||
|
||||
@@ -432,14 +448,22 @@ class boss_stormcaller_brundir : public CreatureScript
|
||||
|
||||
struct boss_stormcaller_brundirAI : public BossAI
|
||||
{
|
||||
boss_stormcaller_brundirAI(Creature* creature) : BossAI(creature, BOSS_ASSEMBLY_OF_IRON) { }
|
||||
boss_stormcaller_brundirAI(Creature* creature) : BossAI(creature, BOSS_ASSEMBLY_OF_IRON)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
phase = 0;
|
||||
}
|
||||
|
||||
uint32 phase;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
phase = 0;
|
||||
Initialize();
|
||||
me->RemoveAllAuras();
|
||||
me->SetDisableGravity(false);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, false); // Should be interruptable unless overridden by spell (Overload)
|
||||
|
||||
@@ -107,15 +107,21 @@ class boss_auriaya : public CreatureScript
|
||||
{
|
||||
boss_auriayaAI(Creature* creature) : BossAI(creature, BOSS_AURIAYA)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
DefenderGUID = 0;
|
||||
defenderLives = 8;
|
||||
crazyCatLady = true;
|
||||
nineLives = false;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
DefenderGUID = 0;
|
||||
defenderLives = 8;
|
||||
crazyCatLady = true;
|
||||
nineLives = false;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
|
||||
@@ -226,14 +226,12 @@ class boss_flame_leviathan : public CreatureScript
|
||||
{
|
||||
boss_flame_leviathanAI(Creature* creature) : BossAI(creature, BOSS_LEVIATHAN), vehicle(creature->GetVehicleKit())
|
||||
{
|
||||
Initialize();
|
||||
_pursueTarget = 0;
|
||||
}
|
||||
|
||||
void InitializeAI() override
|
||||
void Initialize()
|
||||
{
|
||||
ASSERT(vehicle);
|
||||
if (!me->isDead())
|
||||
Reset();
|
||||
|
||||
ActiveTowersCount = 4;
|
||||
Shutdown = 0;
|
||||
ActiveTowers = false;
|
||||
@@ -243,6 +241,15 @@ class boss_flame_leviathan : public CreatureScript
|
||||
towerOfFrost = false;
|
||||
Shutout = true;
|
||||
Unbroken = true;
|
||||
}
|
||||
|
||||
void InitializeAI() override
|
||||
{
|
||||
ASSERT(vehicle);
|
||||
if (!me->isDead())
|
||||
Reset();
|
||||
|
||||
Initialize();
|
||||
|
||||
DoCast(SPELL_INVIS_AND_STEALTH_DETECT);
|
||||
|
||||
@@ -634,13 +641,19 @@ class boss_flame_leviathan_defense_cannon : public CreatureScript
|
||||
{
|
||||
boss_flame_leviathan_defense_cannonAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
NapalmTimer = 5 * IN_MILLISECONDS;
|
||||
}
|
||||
|
||||
uint32 NapalmTimer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
NapalmTimer = 5*IN_MILLISECONDS;
|
||||
Initialize();
|
||||
DoCast(me, AURA_STEALTH_DETECTION);
|
||||
}
|
||||
|
||||
@@ -781,14 +794,20 @@ class npc_mechanolift : public CreatureScript
|
||||
{
|
||||
npc_mechanoliftAI(Creature* creature) : PassiveAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
ASSERT(me->GetVehicleKit());
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
MoveTimer = 0;
|
||||
}
|
||||
|
||||
uint32 MoveTimer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
MoveTimer = 0;
|
||||
Initialize();
|
||||
me->GetMotionMaster()->MoveRandom(50);
|
||||
}
|
||||
|
||||
@@ -956,11 +975,17 @@ public:
|
||||
{
|
||||
npc_mimirons_infernoAI(Creature* creature) : npc_escortAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->CastSpell(me, AURA_DUMMY_YELLOW, true);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
infernoTimer = 2000;
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 /*waypointId*/) override
|
||||
{
|
||||
|
||||
@@ -968,7 +993,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
infernoTimer = 2000;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
uint32 infernoTimer;
|
||||
@@ -1047,14 +1072,20 @@ class npc_freyas_ward : public CreatureScript
|
||||
{
|
||||
npc_freyas_wardAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
me->CastSpell(me, AURA_DUMMY_GREEN, true);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
summonTimer = 5000;
|
||||
}
|
||||
|
||||
uint32 summonTimer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
summonTimer = 5000;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@@ -1090,14 +1121,20 @@ class npc_freya_ward_summon : public CreatureScript
|
||||
{
|
||||
npc_freya_ward_summonAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
creature->GetMotionMaster()->MoveRandom(100);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
lashTimer = 5000;
|
||||
}
|
||||
|
||||
uint32 lashTimer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
lashTimer = 5000;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
|
||||
@@ -267,7 +267,35 @@ class boss_freya : public CreatureScript
|
||||
|
||||
struct boss_freyaAI : public BossAI
|
||||
{
|
||||
boss_freyaAI(Creature* creature) : BossAI(creature, BOSS_FREYA) { }
|
||||
boss_freyaAI(Creature* creature) : BossAI(creature, BOSS_FREYA)
|
||||
{
|
||||
Initialize();
|
||||
memset(elementalTimer, 0, sizeof(elementalTimer));
|
||||
diffTimer = 0;
|
||||
attunedToNature = 0;
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
trioWaveCount = 0;
|
||||
trioWaveController = 0;
|
||||
waveCount = 0;
|
||||
elderCount = 0;
|
||||
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
for (uint8 n = 0; n < 2; ++n)
|
||||
ElementalGUID[i][n] = 0;
|
||||
for (uint8 i = 0; i < 6; ++i)
|
||||
for (uint8 n = 0; n < 2; ++n)
|
||||
deforestation[i][n] = 0;
|
||||
for (uint8 n = 0; n < 2; ++n)
|
||||
{
|
||||
checkElementalAlive[n] = true;
|
||||
trioDefeated[n] = false;
|
||||
}
|
||||
for (uint8 n = 0; n < 3; ++n)
|
||||
random[n] = false;
|
||||
}
|
||||
|
||||
uint64 ElementalGUID[3][2];
|
||||
|
||||
@@ -287,24 +315,7 @@ class boss_freya : public CreatureScript
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
trioWaveCount = 0;
|
||||
trioWaveController = 0;
|
||||
waveCount = 0;
|
||||
elderCount = 0;
|
||||
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
for (uint8 n = 0; n < 2; ++n)
|
||||
ElementalGUID[i][n] = 0;
|
||||
for (uint8 i = 0; i < 6; ++i)
|
||||
for (uint8 n = 0; n < 2; ++n)
|
||||
deforestation[i][n] = 0;
|
||||
for (uint8 n = 0; n < 2; ++n)
|
||||
{
|
||||
checkElementalAlive[n] = true;
|
||||
trioDefeated[n] = false;
|
||||
}
|
||||
for (uint8 n = 0; n < 3; ++n)
|
||||
random[n] = false;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
@@ -689,8 +700,6 @@ class boss_elder_brightleaf : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_SOLAR_FLARE, urand(5000, 7000));
|
||||
events.ScheduleEvent(EVENT_UNSTABLE_SUN_BEAM, urand(7000, 12000));
|
||||
events.ScheduleEvent(EVENT_FLUX, 5000);
|
||||
elderCount = 0;
|
||||
lumberjack = false;
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
@@ -758,9 +767,6 @@ class boss_elder_brightleaf : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
if (lumberjack)
|
||||
lumberjackTimer += diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -768,21 +774,12 @@ class boss_elder_brightleaf : public CreatureScript
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_ELDER_DEATH:
|
||||
++elderCount;
|
||||
lumberjack = true;
|
||||
break;
|
||||
case ACTION_ELDER_FREYA_KILLED:
|
||||
me->DespawnOrUnsummon(10000);
|
||||
_JustDied();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 lumberjackTimer;
|
||||
uint8 elderCount;
|
||||
bool lumberjack;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
@@ -810,8 +807,6 @@ class boss_elder_stonebark : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_TREMOR, urand(10000, 12000));
|
||||
events.ScheduleEvent(EVENT_FISTS, urand(25000, 35000));
|
||||
events.ScheduleEvent(EVENT_BARK, urand(37500, 40000));
|
||||
elderCount = 0;
|
||||
lumberjack = false;
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
@@ -885,9 +880,6 @@ class boss_elder_stonebark : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
if (lumberjack)
|
||||
lumberjackTimer += diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -895,21 +887,12 @@ class boss_elder_stonebark : public CreatureScript
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_ELDER_DEATH:
|
||||
++elderCount;
|
||||
lumberjack = true;
|
||||
break;
|
||||
case ACTION_ELDER_FREYA_KILLED:
|
||||
me->DespawnOrUnsummon(10000);
|
||||
_JustDied();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 lumberjackTimer;
|
||||
uint8 elderCount;
|
||||
bool lumberjack;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
@@ -937,8 +920,6 @@ class boss_elder_ironbranch : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_IMPALE, urand(18000, 22000));
|
||||
events.ScheduleEvent(EVENT_IRON_ROOTS, urand(12000, 17000));
|
||||
events.ScheduleEvent(EVENT_THORN_SWARM, urand(7500, 12500));
|
||||
elderCount = 0;
|
||||
lumberjack = false;
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
@@ -999,9 +980,6 @@ class boss_elder_ironbranch : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
if (lumberjack)
|
||||
lumberjackTimer += diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -1009,21 +987,12 @@ class boss_elder_ironbranch : public CreatureScript
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_ELDER_DEATH:
|
||||
++elderCount;
|
||||
lumberjack = true;
|
||||
break;
|
||||
case ACTION_ELDER_FREYA_KILLED:
|
||||
me->DespawnOrUnsummon(10000);
|
||||
_JustDied();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 lumberjackTimer;
|
||||
uint8 elderCount;
|
||||
bool lumberjack;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
@@ -1041,13 +1010,19 @@ class npc_detonating_lasher : public CreatureScript
|
||||
{
|
||||
npc_detonating_lasherAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
lashTimer = 5000;
|
||||
changeTargetTimer = 7500;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
lashTimer = 5000;
|
||||
changeTargetTimer = 7500;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@@ -1099,14 +1074,22 @@ class npc_ancient_water_spirit : public CreatureScript
|
||||
{
|
||||
npc_ancient_water_spiritAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = me->GetInstanceScript();
|
||||
if (Creature* Freya = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_FREYA)))
|
||||
waveCount = ENSURE_AI(boss_freya::boss_freyaAI, Freya->AI())->trioWaveCount;
|
||||
else
|
||||
waveCount = 0;
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
tidalWaveTimer = 10000;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
tidalWaveTimer = 10000;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@@ -1159,15 +1142,23 @@ class npc_storm_lasher : public CreatureScript
|
||||
{
|
||||
npc_storm_lasherAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = me->GetInstanceScript();
|
||||
if (Creature* Freya = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_FREYA)))
|
||||
waveCount = ENSURE_AI(boss_freya::boss_freyaAI, Freya->AI())->trioWaveCount;
|
||||
else
|
||||
waveCount = 0;
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
lightningLashTimer = 10000;
|
||||
stormboltTimer = 5000;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
lightningLashTimer = 10000;
|
||||
stormboltTimer = 5000;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@@ -1229,6 +1220,8 @@ class npc_snaplasher : public CreatureScript
|
||||
instance = me->GetInstanceScript();
|
||||
if (Creature* Freya = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_FREYA)))
|
||||
waveCount = ENSURE_AI(boss_freya::boss_freyaAI, Freya->AI())->trioWaveCount;
|
||||
else
|
||||
waveCount = 0;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) override
|
||||
@@ -1271,12 +1264,18 @@ class npc_ancient_conservator : public CreatureScript
|
||||
{
|
||||
npc_ancient_conservatorAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
natureFuryTimer = 7500;
|
||||
healthySporeTimer = 3500;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
natureFuryTimer = 7500;
|
||||
healthySporeTimer = 3500;
|
||||
Initialize();
|
||||
SummonHealthySpores(2);
|
||||
}
|
||||
|
||||
|
||||
@@ -105,6 +105,15 @@ class boss_general_vezax : public CreatureScript
|
||||
{
|
||||
boss_general_vezaxAI(Creature* creature) : BossAI(creature, BOSS_VEZAX)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
shadowDodger = true;
|
||||
smellSaronite = true;
|
||||
animusDead = false;
|
||||
vaporCount = 0;
|
||||
}
|
||||
|
||||
bool shadowDodger;
|
||||
@@ -116,10 +125,7 @@ class boss_general_vezax : public CreatureScript
|
||||
{
|
||||
_Reset();
|
||||
|
||||
shadowDodger = true;
|
||||
smellSaronite = true;
|
||||
animusDead = false;
|
||||
vaporCount = 0;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
|
||||
@@ -181,11 +181,18 @@ class npc_flash_freeze : public CreatureScript
|
||||
{
|
||||
npc_flash_freezeAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = me->GetInstanceScript();
|
||||
me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
targetGUID = 0;
|
||||
checkDespawnTimer = 1000;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 targetGUID;
|
||||
@@ -193,8 +200,7 @@ class npc_flash_freeze : public CreatureScript
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
targetGUID = 0;
|
||||
checkDespawnTimer = 1000;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@@ -312,9 +318,19 @@ class boss_hodir : public CreatureScript
|
||||
{
|
||||
boss_hodirAI(Creature* creature) : BossAI(creature, BOSS_HODIR)
|
||||
{
|
||||
Initialize();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
gettingColdInHereTimer = 0;
|
||||
gettingColdInHere = false;
|
||||
cheeseTheFreeze = false;
|
||||
iHaveTheCoolestFriends = false;
|
||||
iCouldSayThatThisCacheWasRare = false;
|
||||
}
|
||||
|
||||
uint32 gettingColdInHereTimer;
|
||||
|
||||
bool gettingColdInHere;
|
||||
@@ -324,11 +340,7 @@ class boss_hodir : public CreatureScript
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
gettingColdInHereTimer = 0;
|
||||
gettingColdInHere = false;
|
||||
cheeseTheFreeze = false;
|
||||
iHaveTheCoolestFriends = false;
|
||||
iCouldSayThatThisCacheWasRare = false;
|
||||
Initialize();
|
||||
|
||||
_Reset();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
@@ -526,16 +538,22 @@ class npc_icicle : public CreatureScript
|
||||
{
|
||||
npc_icicleAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
me->SetDisplayId(me->GetCreatureTemplate()->Modelid1);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED | UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
icicleTimer = 2500;
|
||||
}
|
||||
|
||||
uint32 icicleTimer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
icicleTimer = 2500;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@@ -574,16 +592,22 @@ class npc_snowpacked_icicle : public CreatureScript
|
||||
{
|
||||
npc_snowpacked_icicleAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
despawnTimer = 12000;
|
||||
}
|
||||
|
||||
uint32 despawnTimer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
despawnTimer = 12000;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
|
||||
@@ -118,9 +118,17 @@ class boss_ignis : public CreatureScript
|
||||
{
|
||||
boss_ignis_AI(Creature* creature) : BossAI(creature, BOSS_IGNIS), _vehicle(me->GetVehicleKit())
|
||||
{
|
||||
Initialize();
|
||||
ASSERT(_vehicle);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_slagPotGUID = 0;
|
||||
_shattered = false;
|
||||
_firstConstructKill = 0;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
@@ -140,9 +148,7 @@ class boss_ignis : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_CONSTRUCT, 15000);
|
||||
events.ScheduleEvent(EVENT_END_POT, 40000);
|
||||
events.ScheduleEvent(EVENT_BERSERK, 480000);
|
||||
_slagPotGUID = 0;
|
||||
_shattered = false;
|
||||
_firstConstructKill = 0;
|
||||
Initialize();
|
||||
instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEVEMENT_IGNIS_START_EVENT);
|
||||
}
|
||||
|
||||
@@ -298,12 +304,18 @@ class npc_iron_construct : public CreatureScript
|
||||
{
|
||||
npc_iron_constructAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript())
|
||||
{
|
||||
Initialize();
|
||||
creature->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_brittled = false;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_brittled = false;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& damage) override
|
||||
@@ -365,12 +377,19 @@ class npc_scorch_ground : public CreatureScript
|
||||
{
|
||||
npc_scorch_groundAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE |UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
|
||||
creature->SetDisplayId(16925); //model 2 in db cannot overwrite wdb fields
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
void Initialize()
|
||||
{
|
||||
_heat = false;
|
||||
_constructGUID = 0;
|
||||
_heatTimer = 0;
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
{
|
||||
if (!_heat)
|
||||
{
|
||||
@@ -387,10 +406,8 @@ class npc_scorch_ground : public CreatureScript
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_heat = false;
|
||||
Initialize();
|
||||
DoCast(me, SPELL_GROUND);
|
||||
_constructGUID = 0;
|
||||
_heatTimer = 0;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 uiDiff) override
|
||||
|
||||
@@ -327,8 +327,19 @@ class boss_razorscale : public CreatureScript
|
||||
{
|
||||
boss_razorscaleAI(Creature* creature) : BossAI(creature, BOSS_RAZORSCALE)
|
||||
{
|
||||
Initialize();
|
||||
// Do not let Razorscale be affected by Battle Shout buff
|
||||
me->ApplySpellImmune(0, IMMUNITY_ID, (SPELL_BATTLE_SHOUT), true);
|
||||
FlyCount = 0;
|
||||
EnrageTimer = 0;
|
||||
Enraged = false;
|
||||
phase = PHASE_GROUND;
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
PermaGround = false;
|
||||
HarpoonCounter = 0;
|
||||
}
|
||||
|
||||
Phases phase;
|
||||
@@ -345,8 +356,7 @@ class boss_razorscale : public CreatureScript
|
||||
me->SetCanFly(true);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
PermaGround = false;
|
||||
HarpoonCounter = 0;
|
||||
Initialize();
|
||||
if (Creature* commander = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_EXPEDITION_COMMANDER)))
|
||||
commander->AI()->DoAction(ACTION_COMMANDER_RESET);
|
||||
}
|
||||
@@ -594,7 +604,16 @@ class npc_expedition_commander : public CreatureScript
|
||||
{
|
||||
npc_expedition_commanderAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = me->GetInstanceScript();
|
||||
memset(Engineer, 0, sizeof(Engineer));
|
||||
memset(Defender, 0, sizeof(Defender));
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
AttackStartTimer = 0;
|
||||
Phase = 0;
|
||||
Greet = false;
|
||||
}
|
||||
|
||||
@@ -604,14 +623,12 @@ class npc_expedition_commander : public CreatureScript
|
||||
bool Greet;
|
||||
uint32 AttackStartTimer;
|
||||
uint8 Phase;
|
||||
Creature* Engineer[4];
|
||||
Creature* Defender[4];
|
||||
uint64 Engineer[4];
|
||||
uint64 Defender[4];
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
AttackStartTimer = 0;
|
||||
Phase = 0;
|
||||
Greet = false;
|
||||
Initialize();
|
||||
summons.clear();
|
||||
}
|
||||
|
||||
@@ -659,31 +676,40 @@ class npc_expedition_commander : public CreatureScript
|
||||
case 2:
|
||||
for (uint8 n = 0; n < RAID_MODE(2, 4); n++)
|
||||
{
|
||||
Engineer[n] = me->SummonCreature(NPC_ENGINEER, PosEngSpawn, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
|
||||
Engineer[n]->SetWalk(false);
|
||||
Engineer[n]->SetSpeed(MOVE_RUN, 0.5f);
|
||||
Engineer[n]->SetHomePosition(PosEngRepair[n]);
|
||||
Engineer[n]->GetMotionMaster()->MoveTargetedHome();
|
||||
if (Creature* summonedEngineer = me->SummonCreature(NPC_ENGINEER, PosEngSpawn, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000))
|
||||
{
|
||||
summonedEngineer->SetWalk(false);
|
||||
summonedEngineer->SetSpeed(MOVE_RUN, 0.5f);
|
||||
summonedEngineer->SetHomePosition(PosEngRepair[n]);
|
||||
summonedEngineer->GetMotionMaster()->MoveTargetedHome();
|
||||
Engineer[n] = summonedEngineer->GetGUID();
|
||||
}
|
||||
}
|
||||
Engineer[0]->AI()->Talk(SAY_AGGRO_3);
|
||||
if (Creature* firstSummon = ObjectAccessor::GetCreature(*me, Engineer[0]))
|
||||
firstSummon->AI()->Talk(SAY_AGGRO_3);
|
||||
Phase = 3;
|
||||
AttackStartTimer = 14000;
|
||||
break;
|
||||
case 3:
|
||||
for (uint8 n = 0; n < 4; n++)
|
||||
{
|
||||
Defender[n] = me->SummonCreature(NPC_DEFENDER, PosDefSpawn[n], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
|
||||
Defender[n]->SetWalk(false);
|
||||
Defender[n]->SetHomePosition(PosDefCombat[n]);
|
||||
Defender[n]->GetMotionMaster()->MoveTargetedHome();
|
||||
if (Creature* summonedDefender = me->SummonCreature(NPC_DEFENDER, PosDefSpawn[n], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000))
|
||||
{
|
||||
summonedDefender->SetWalk(false);
|
||||
summonedDefender->SetHomePosition(PosDefCombat[n]);
|
||||
summonedDefender->GetMotionMaster()->MoveTargetedHome();
|
||||
Defender[n] = summonedDefender->GetGUID();
|
||||
}
|
||||
}
|
||||
Phase = 4;
|
||||
break;
|
||||
case 4:
|
||||
for (uint8 n = 0; n < RAID_MODE(2, 4); n++)
|
||||
Engineer[n]->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING);
|
||||
if (Creature* summonedEngineer = ObjectAccessor::GetCreature(*me, Engineer[n]))
|
||||
summonedEngineer->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING);
|
||||
for (uint8 n = 0; n < 4; ++n)
|
||||
Defender[n]->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
|
||||
if (Creature* summonedDefender = ObjectAccessor::GetCreature(*me, Defender[n]))
|
||||
summonedDefender->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
|
||||
Talk(SAY_AGGRO_2);
|
||||
AttackStartTimer = 16000;
|
||||
Phase = 5;
|
||||
@@ -694,7 +720,8 @@ class npc_expedition_commander : public CreatureScript
|
||||
Razorscale->AI()->DoAction(ACTION_EVENT_START);
|
||||
me->SetInCombatWith(Razorscale);
|
||||
}
|
||||
Engineer[0]->AI()->Talk(SAY_AGGRO_1);
|
||||
if (Creature* firstEngineer = ObjectAccessor::GetCreature(*me, Engineer[0]))
|
||||
firstEngineer->AI()->Talk(SAY_AGGRO_1);
|
||||
Phase = 6;
|
||||
break;
|
||||
}
|
||||
@@ -748,10 +775,20 @@ class npc_mole_machine_trigger : public CreatureScript
|
||||
{
|
||||
npc_mole_machine_triggerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
SetCombatMovement(false);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
SummonGobTimer = 2000;
|
||||
SummonNpcTimer = 6000;
|
||||
DissapearTimer = 10000;
|
||||
GobSummoned = false;
|
||||
NpcSummoned = false;
|
||||
}
|
||||
|
||||
uint32 SummonGobTimer;
|
||||
uint32 SummonNpcTimer;
|
||||
uint32 DissapearTimer;
|
||||
@@ -760,11 +797,7 @@ class npc_mole_machine_trigger : public CreatureScript
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
SummonGobTimer = 2000;
|
||||
SummonNpcTimer = 6000;
|
||||
DissapearTimer = 10000;
|
||||
GobSummoned = false;
|
||||
NpcSummoned = false;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 Diff) override
|
||||
@@ -851,15 +884,23 @@ class npc_darkrune_watcher : public CreatureScript
|
||||
|
||||
struct npc_darkrune_watcherAI : public ScriptedAI
|
||||
{
|
||||
npc_darkrune_watcherAI(Creature* creature) : ScriptedAI(creature){ }
|
||||
npc_darkrune_watcherAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
ChainTimer = urand(10000, 15000);
|
||||
LightTimer = urand(1000, 3000);
|
||||
}
|
||||
|
||||
uint32 ChainTimer;
|
||||
uint32 LightTimer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
ChainTimer = urand(10000, 15000);
|
||||
LightTimer = urand(1000, 3000);
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 Diff) override
|
||||
@@ -900,14 +941,22 @@ class npc_darkrune_guardian : public CreatureScript
|
||||
|
||||
struct npc_darkrune_guardianAI : public ScriptedAI
|
||||
{
|
||||
npc_darkrune_guardianAI(Creature* creature) : ScriptedAI(creature){ }
|
||||
npc_darkrune_guardianAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
StormTimer = urand(3000, 6000);
|
||||
killedByBreath = false;
|
||||
}
|
||||
|
||||
uint32 StormTimer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
StormTimer = urand(3000, 6000);
|
||||
killedByBreath = false;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const override
|
||||
@@ -955,7 +1004,17 @@ class npc_darkrune_sentinel : public CreatureScript
|
||||
|
||||
struct npc_darkrune_sentinelAI : public ScriptedAI
|
||||
{
|
||||
npc_darkrune_sentinelAI(Creature* creature) : ScriptedAI(creature){ }
|
||||
npc_darkrune_sentinelAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
HeroicTimer = urand(4000, 8000);
|
||||
WhirlTimer = urand(20000, 25000);
|
||||
ShoutTimer = urand(15000, 30000);
|
||||
}
|
||||
|
||||
uint32 HeroicTimer;
|
||||
uint32 WhirlTimer;
|
||||
@@ -963,9 +1022,7 @@ class npc_darkrune_sentinel : public CreatureScript
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
HeroicTimer = urand(4000, 8000);
|
||||
WhirlTimer = urand(20000, 25000);
|
||||
ShoutTimer = urand(15000, 30000);
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 Diff) override
|
||||
|
||||
@@ -196,6 +196,18 @@ class boss_xt002 : public CreatureScript
|
||||
{
|
||||
boss_xt002_AI(Creature* creature) : BossAI(creature, BOSS_XT002)
|
||||
{
|
||||
Initialize();
|
||||
_transferHealth = 0;
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_healthRecovered = false;
|
||||
_gravityBombCasualty = false;
|
||||
_hardMode = false;
|
||||
|
||||
_phase = 1;
|
||||
_heartExposed = 0;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
@@ -206,12 +218,7 @@ class boss_xt002 : public CreatureScript
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
DoCast(me, SPELL_STAND);
|
||||
|
||||
_healthRecovered = false;
|
||||
_gravityBombCasualty = false;
|
||||
_hardMode = false;
|
||||
|
||||
_phase = 1;
|
||||
_heartExposed = 0;
|
||||
Initialize();
|
||||
|
||||
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_MUST_DECONSTRUCT_FASTER);
|
||||
}
|
||||
@@ -489,14 +496,20 @@ class npc_scrapbot : public CreatureScript
|
||||
{
|
||||
npc_scrapbotAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
_instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_rangeCheckTimer = 500;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
|
||||
_rangeCheckTimer = 500;
|
||||
Initialize();
|
||||
|
||||
if (Creature* pXT002 = ObjectAccessor::GetCreature(*me, _instance->GetData64(BOSS_XT002)))
|
||||
me->GetMotionMaster()->MoveFollow(pXT002, 0.0f, 0.0f);
|
||||
@@ -546,14 +559,20 @@ class npc_pummeller : public CreatureScript
|
||||
{
|
||||
npc_pummellerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
_instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
void Initialize()
|
||||
{
|
||||
_arcingSmashTimer = TIMER_ARCING_SMASH;
|
||||
_trampleTimer = TIMER_TRAMPLE;
|
||||
_uppercutTimer = TIMER_UPPERCUT;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
|
||||
if (Creature* xt002 = ObjectAccessor::GetCreature(*me, _instance->GetData64(BOSS_XT002)))
|
||||
{
|
||||
@@ -647,12 +666,18 @@ class npc_boombot : public CreatureScript
|
||||
{
|
||||
npc_boombotAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
_instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_boomed = false;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_boomed = false;
|
||||
Initialize();
|
||||
|
||||
DoCast(SPELL_AURA_BOOMBOT); // For achievement
|
||||
|
||||
@@ -726,12 +751,18 @@ class npc_life_spark : public CreatureScript
|
||||
{
|
||||
npc_life_sparkAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_shockTimer = 0; // first one is immediate.
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
DoCast(me, SPELL_STATIC_CHARGED);
|
||||
_shockTimer = 0; // first one is immediate.
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
|
||||
@@ -427,9 +427,17 @@ class boss_voice_of_yogg_saron : public CreatureScript
|
||||
{
|
||||
boss_voice_of_yogg_saronAI(Creature* creature) : BossAI(creature, BOSS_YOGG_SARON)
|
||||
{
|
||||
Initialize();
|
||||
SetCombatMovement(false);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_guardiansCount = 0;
|
||||
_guardianTimer = 20000;
|
||||
_illusionShattered = false;
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
|
||||
{
|
||||
@@ -467,9 +475,7 @@ class boss_voice_of_yogg_saron : public CreatureScript
|
||||
instance->SetData(DATA_DRIVE_ME_CRAZY, uint32(true));
|
||||
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
|
||||
|
||||
_guardiansCount = 0;
|
||||
_guardianTimer = 20000;
|
||||
_illusionShattered = false;
|
||||
Initialize();
|
||||
|
||||
bool clockwise = false;
|
||||
std::list<TempSummon*> clouds;
|
||||
@@ -1014,7 +1020,10 @@ class boss_brain_of_yogg_saron : public CreatureScript
|
||||
|
||||
struct boss_brain_of_yogg_saronAI : public PassiveAI
|
||||
{
|
||||
boss_brain_of_yogg_saronAI(Creature* creature) : PassiveAI(creature), _instance(creature->GetInstanceScript()), _summons(creature) { }
|
||||
boss_brain_of_yogg_saronAI(Creature* creature) : PassiveAI(creature), _instance(creature->GetInstanceScript()), _summons(creature)
|
||||
{
|
||||
_tentaclesKilled = 0;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
@@ -1953,7 +1962,7 @@ class spell_yogg_saron_target_selectors : public SpellScriptLoader // 63744,
|
||||
class SanityReduction : public SpellScript
|
||||
{
|
||||
public:
|
||||
SanityReduction() : SpellScript() { }
|
||||
SanityReduction() : SpellScript(), _stacks(0) { }
|
||||
SanityReduction(uint8 stacks) : SpellScript(), _stacks(stacks) { }
|
||||
|
||||
void RemoveSanity(SpellEffIndex /*effIndex*/)
|
||||
|
||||
@@ -264,6 +264,9 @@ class npc_annhylde_the_caller : public CreatureScript
|
||||
{
|
||||
npc_annhylde_the_callerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
x = 0.f;
|
||||
y = 0.f;
|
||||
z = 0.f;
|
||||
_instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,15 @@ class boss_keleseth : public CreatureScript
|
||||
|
||||
struct boss_kelesethAI : public BossAI
|
||||
{
|
||||
boss_kelesethAI(Creature* creature) : BossAI(creature, DATA_PRINCE_KELESETH) { }
|
||||
boss_kelesethAI(Creature* creature) : BossAI(creature, DATA_PRINCE_KELESETH)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
onTheRocks = true;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
@@ -124,7 +132,7 @@ class boss_keleseth : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_FROST_TOMB, urand(14, 19)*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_SUMMON_SKELETONS, 6*IN_MILLISECONDS);
|
||||
|
||||
onTheRocks = true;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who) override
|
||||
|
||||
@@ -92,20 +92,11 @@ public:
|
||||
{
|
||||
boss_palehoofAI(Creature* creature) : BossAI(creature, DATA_GORTOK_PALEHOOF)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
uint32 uiArcingSmashTimer;
|
||||
uint32 uiImpaleTimer;
|
||||
uint32 uiWhiteringRoarTimer;
|
||||
uint32 uiWaitingTimer;
|
||||
Phase currentPhase;
|
||||
uint8 AddCount;
|
||||
Phase Sequence[4];
|
||||
|
||||
void Reset() override
|
||||
void Initialize()
|
||||
{
|
||||
_Reset();
|
||||
|
||||
/// There is a good reason to store them like this, we are going to shuffle the order.
|
||||
for (uint32 i = PHASE_FRENZIED_WORGEN; i < PHASE_GORTOK_PALEHOOF; ++i)
|
||||
Sequence[i] = Phase(i);
|
||||
@@ -117,11 +108,25 @@ public:
|
||||
uiImpaleTimer = 12000;
|
||||
uiWhiteringRoarTimer = 10000;
|
||||
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
AddCount = 0;
|
||||
|
||||
currentPhase = PHASE_NONE;
|
||||
}
|
||||
|
||||
uint32 uiArcingSmashTimer;
|
||||
uint32 uiImpaleTimer;
|
||||
uint32 uiWhiteringRoarTimer;
|
||||
Phase currentPhase;
|
||||
uint8 AddCount;
|
||||
Phase Sequence[4];
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
|
||||
Initialize();
|
||||
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
for (uint8 i = DATA_FRENZIED_WORGEN; i <= DATA_FEROCIOUS_RHINO; ++i)
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, instance->GetData64(i)))
|
||||
@@ -263,9 +268,17 @@ public:
|
||||
{
|
||||
npc_ravenous_furbolgAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
uiChainLightingTimer = 5000;
|
||||
uiCrazedTimer = 10000;
|
||||
uiTerrifyingRoarTimer = 15000;
|
||||
}
|
||||
|
||||
uint32 uiChainLightingTimer;
|
||||
uint32 uiCrazedTimer;
|
||||
uint32 uiTerrifyingRoarTimer;
|
||||
@@ -274,9 +287,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
uiChainLightingTimer = 5000;
|
||||
uiCrazedTimer = 10000;
|
||||
uiTerrifyingRoarTimer = 15000;
|
||||
Initialize();
|
||||
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
@@ -371,9 +382,17 @@ public:
|
||||
{
|
||||
npc_frenzied_worgenAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
uiMortalWoundTimer = 5000;
|
||||
uiEnrage1Timer = 15000;
|
||||
uiEnrage2Timer = 10000;
|
||||
}
|
||||
|
||||
uint32 uiMortalWoundTimer;
|
||||
uint32 uiEnrage1Timer;
|
||||
uint32 uiEnrage2Timer;
|
||||
@@ -382,9 +401,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
uiMortalWoundTimer = 5000;
|
||||
uiEnrage1Timer = 15000;
|
||||
uiEnrage2Timer = 10000;
|
||||
Initialize();
|
||||
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
@@ -481,9 +498,17 @@ public:
|
||||
{
|
||||
npc_ferocious_rhinoAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
uiStompTimer = 10000;
|
||||
uiGoreTimer = 15000;
|
||||
uiGrievousWoundTimer = 20000;
|
||||
}
|
||||
|
||||
uint32 uiStompTimer;
|
||||
uint32 uiGoreTimer;
|
||||
uint32 uiGrievousWoundTimer;
|
||||
@@ -492,9 +517,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
uiStompTimer = 10000;
|
||||
uiGoreTimer = 15000;
|
||||
uiGrievousWoundTimer = 20000;
|
||||
Initialize();
|
||||
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
@@ -596,9 +619,17 @@ public:
|
||||
{
|
||||
npc_massive_jormungarAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
uiAcidSpitTimer = 3000;
|
||||
uiAcidSplatterTimer = 12000;
|
||||
uiPoisonBreathTimer = 10000;
|
||||
}
|
||||
|
||||
uint32 uiAcidSpitTimer;
|
||||
uint32 uiAcidSplatterTimer;
|
||||
uint32 uiPoisonBreathTimer;
|
||||
@@ -607,9 +638,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
uiAcidSpitTimer = 3000;
|
||||
uiAcidSplatterTimer = 12000;
|
||||
uiPoisonBreathTimer = 10000;
|
||||
Initialize();
|
||||
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
@@ -697,17 +726,23 @@ public:
|
||||
{
|
||||
npc_palehoof_orbAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
currentPhase = PHASE_NONE;
|
||||
SummonTimer = 5000;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
uint32 SummonTimer;
|
||||
Phase currentPhase;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
currentPhase = PHASE_NONE;
|
||||
SummonTimer = 5000;
|
||||
Initialize();
|
||||
//! HACK: Creature's can't have MOVEMENTFLAG_FLYING
|
||||
me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
|
||||
me->RemoveAurasDueToSpell(SPELL_ORB_VISUAL);
|
||||
|
||||
@@ -169,8 +169,24 @@ public:
|
||||
{
|
||||
boss_skadiAI(Creature* creature) : ScriptedAI(creature), Summons(me)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
m_uiGraufGUID = 0;
|
||||
m_uiMovementTimer = 0;
|
||||
m_uiSummonTimer = 0;
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
m_uiCrushTimer = 8000;
|
||||
m_uiPoisonedSpearTimer = 10000;
|
||||
m_uiWhirlwindTimer = 20000;
|
||||
m_uiMountTimer = 3000;
|
||||
m_uiWaypointId = 0;
|
||||
m_bSaidEmote = false;
|
||||
m_uiSpellHitCount = 0;
|
||||
|
||||
Phase = SKADI;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
@@ -194,15 +210,7 @@ public:
|
||||
{
|
||||
triggersGUID.clear();
|
||||
|
||||
m_uiCrushTimer = 8000;
|
||||
m_uiPoisonedSpearTimer = 10000;
|
||||
m_uiWhirlwindTimer = 20000;
|
||||
m_uiMountTimer = 3000;
|
||||
m_uiWaypointId = 0;
|
||||
m_bSaidEmote = false;
|
||||
m_uiSpellHitCount = 0;
|
||||
|
||||
Phase = SKADI;
|
||||
Initialize();
|
||||
|
||||
Summons.DespawnAll();
|
||||
me->SetSpeed(MOVE_FLIGHT, 3.0f);
|
||||
|
||||
@@ -137,13 +137,20 @@ class boss_svala : public CreatureScript
|
||||
{
|
||||
boss_svalaAI(Creature* creature) : BossAI(creature, DATA_SVALA_SORROWGRAVE)
|
||||
{
|
||||
Initialize();
|
||||
_introCompleted = false;
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_arthasGUID = 0;
|
||||
_sacrificed = false;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
_sacrificed = false;
|
||||
|
||||
SetCombatMovement(true);
|
||||
|
||||
if (_introCompleted)
|
||||
@@ -153,7 +160,7 @@ class boss_svala : public CreatureScript
|
||||
|
||||
me->SetDisableGravity(events.IsInPhase(NORMAL));
|
||||
|
||||
_arthasGUID = 0;
|
||||
Initialize();
|
||||
|
||||
instance->SetData64(DATA_SACRIFICED_PLAYER, 0);
|
||||
}
|
||||
@@ -398,17 +405,23 @@ class npc_ritual_channeler : public CreatureScript
|
||||
{
|
||||
npc_ritual_channelerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
|
||||
SetCombatMovement(false);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
paralyzeTimer = 1600;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
uint32 paralyzeTimer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
paralyzeTimer = 1600;
|
||||
Initialize();
|
||||
|
||||
if (IsHeroic())
|
||||
DoCast(me, SPELL_SHADOWS_IN_THE_DARK);
|
||||
@@ -514,16 +527,24 @@ class npc_scourge_hulk : public CreatureScript
|
||||
|
||||
struct npc_scourge_hulkAI : public ScriptedAI
|
||||
{
|
||||
npc_scourge_hulkAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
npc_scourge_hulkAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
mightyBlow = urand(4000, 9000);
|
||||
volatileInfection = urand(10000, 14000);
|
||||
killedByRitualStrike = false;
|
||||
}
|
||||
|
||||
uint32 mightyBlow;
|
||||
uint32 volatileInfection;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
mightyBlow = urand(4000, 9000);
|
||||
volatileInfection = urand(10000, 14000);
|
||||
killedByRitualStrike = false;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const override
|
||||
|
||||
@@ -102,6 +102,7 @@ public:
|
||||
{
|
||||
boss_ymironAI(Creature* creature) : BossAI(creature, DATA_KING_YMIRON)
|
||||
{
|
||||
Initialize();
|
||||
for (int i = 0; i < 4; ++i)
|
||||
m_uiActiveOrder[i] = i;
|
||||
for (int i = 0; i < 3; ++i)
|
||||
@@ -113,6 +114,35 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
m_bIsWalking = false;
|
||||
m_bIsPause = false;
|
||||
m_bIsActiveWithBJORN = false;
|
||||
m_bIsActiveWithHALDOR = false;
|
||||
m_bIsActiveWithRANULF = false;
|
||||
m_bIsActiveWithTORGYN = false;
|
||||
kingsBane = true;
|
||||
|
||||
m_uiFetidRot_Timer = urand(8000, 13000);
|
||||
m_uiBane_Timer = urand(18000, 23000);
|
||||
m_uiDarkSlash_Timer = urand(28000, 33000);
|
||||
m_uiAncestors_Vengeance_Timer = DUNGEON_MODE(60000, 45000);
|
||||
m_uiPause_Timer = 0;
|
||||
|
||||
m_uiAbility_BJORN_Timer = 0;
|
||||
m_uiAbility_HALDOR_Timer = 0;
|
||||
m_uiAbility_RANULF_Timer = 0;
|
||||
m_uiAbility_TORGYN_Timer = 0;
|
||||
|
||||
m_uiActivedNumber = 0;
|
||||
m_uiHealthAmountModifier = 1;
|
||||
m_uiHealthAmountMultipler = DUNGEON_MODE(20, 25);
|
||||
|
||||
m_uiActivedCreatureGUID = 0;
|
||||
m_uiOrbGUID = 0;
|
||||
}
|
||||
|
||||
bool m_bIsWalking;
|
||||
bool m_bIsPause;
|
||||
bool m_bIsActiveWithBJORN;
|
||||
@@ -144,31 +174,7 @@ public:
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
m_bIsWalking = false;
|
||||
m_bIsPause = false;
|
||||
m_bIsActiveWithBJORN = false;
|
||||
m_bIsActiveWithHALDOR = false;
|
||||
m_bIsActiveWithRANULF = false;
|
||||
m_bIsActiveWithTORGYN = false;
|
||||
kingsBane = true;
|
||||
|
||||
m_uiFetidRot_Timer = urand(8000, 13000);
|
||||
m_uiBane_Timer = urand(18000, 23000);
|
||||
m_uiDarkSlash_Timer = urand(28000, 33000);
|
||||
m_uiAncestors_Vengeance_Timer = DUNGEON_MODE(60000, 45000);
|
||||
m_uiPause_Timer = 0;
|
||||
|
||||
m_uiAbility_BJORN_Timer = 0;
|
||||
m_uiAbility_HALDOR_Timer = 0;
|
||||
m_uiAbility_RANULF_Timer = 0;
|
||||
m_uiAbility_TORGYN_Timer = 0;
|
||||
|
||||
m_uiActivedNumber = 0;
|
||||
m_uiHealthAmountModifier = 1;
|
||||
m_uiHealthAmountMultipler = DUNGEON_MODE(20, 25);
|
||||
|
||||
m_uiActivedCreatureGUID = 0;
|
||||
m_uiOrbGUID = 0;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
|
||||
@@ -184,13 +184,19 @@ class npc_tempest_minion : public CreatureScript
|
||||
{
|
||||
npc_tempest_minionAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
OverchargedTimer = 0;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
events.Reset();
|
||||
OverchargedTimer = 0;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
|
||||
@@ -185,12 +185,18 @@ public:
|
||||
{
|
||||
npc_frozen_orbAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
done = false;
|
||||
killTimer = 60000; // if after this time there is no victim -> destroy!
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
done = false;
|
||||
killTimer = 60000; // if after this time there is no victim -> destroy!
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
|
||||
@@ -57,9 +57,19 @@ public:
|
||||
{
|
||||
boss_cyanigosaAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
uiArcaneVacuumTimer = 10000;
|
||||
uiBlizzardTimer = 15000;
|
||||
uiManaDestructionTimer = 30000;
|
||||
uiTailSweepTimer = 20000;
|
||||
uiUncontrollableEnergyTimer = 25000;
|
||||
}
|
||||
|
||||
uint32 uiArcaneVacuumTimer;
|
||||
uint32 uiBlizzardTimer;
|
||||
uint32 uiManaDestructionTimer;
|
||||
@@ -70,11 +80,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
uiArcaneVacuumTimer = 10000;
|
||||
uiBlizzardTimer = 15000;
|
||||
uiManaDestructionTimer = 30000;
|
||||
uiTailSweepTimer = 20000;
|
||||
uiUncontrollableEnergyTimer = 25000;
|
||||
Initialize();
|
||||
instance->SetData(DATA_CYANIGOSA_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,9 +56,19 @@ public:
|
||||
{
|
||||
boss_erekemAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
uiBloodlustTimer = 15000;
|
||||
uiChainHealTimer = 0;
|
||||
uiEarthShockTimer = urand(2000, 8000);
|
||||
uiLightningBoltTimer = urand(5000, 10000);
|
||||
uiEarthShieldTimer = 20000;
|
||||
}
|
||||
|
||||
uint32 uiBloodlustTimer;
|
||||
uint32 uiChainHealTimer;
|
||||
uint32 uiEarthShockTimer;
|
||||
@@ -69,11 +79,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
uiBloodlustTimer = 15000;
|
||||
uiChainHealTimer = 0;
|
||||
uiEarthShockTimer = urand(2000, 8000);
|
||||
uiLightningBoltTimer = urand(5000, 10000);
|
||||
uiEarthShieldTimer = 20000;
|
||||
Initialize();
|
||||
if (instance->GetData(DATA_WAVE_COUNT) == 6)
|
||||
instance->SetData(DATA_1ST_BOSS_EVENT, NOT_STARTED);
|
||||
else if (instance->GetData(DATA_WAVE_COUNT) == 12)
|
||||
@@ -264,9 +270,17 @@ public:
|
||||
{
|
||||
npc_erekem_guardAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
uiStrikeTimer = urand(4000, 8000);
|
||||
uiHowlingScreechTimer = urand(8000, 13000);
|
||||
uiGushingWoundTimer = urand(1000, 3000);
|
||||
}
|
||||
|
||||
uint32 uiGushingWoundTimer;
|
||||
uint32 uiHowlingScreechTimer;
|
||||
uint32 uiStrikeTimer;
|
||||
@@ -275,9 +289,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
uiStrikeTimer = urand(4000, 8000);
|
||||
uiHowlingScreechTimer = urand(8000, 13000);
|
||||
uiGushingWoundTimer = urand(1000, 3000);
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who) override
|
||||
|
||||
@@ -85,9 +85,19 @@ public:
|
||||
{
|
||||
boss_ichoronAI(Creature* creature) : ScriptedAI(creature), m_waterElements(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
bIsExploded = false;
|
||||
bIsFrenzy = false;
|
||||
dehydration = true;
|
||||
uiBubbleCheckerTimer = 1000;
|
||||
uiWaterBoltVolleyTimer = urand(10000, 15000);
|
||||
}
|
||||
|
||||
bool bIsExploded;
|
||||
bool bIsFrenzy;
|
||||
bool dehydration;
|
||||
@@ -101,11 +111,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
bIsExploded = false;
|
||||
bIsFrenzy = false;
|
||||
dehydration = true;
|
||||
uiBubbleCheckerTimer = 1000;
|
||||
uiWaterBoltVolleyTimer = urand(10000, 15000);
|
||||
Initialize();
|
||||
|
||||
me->SetVisible(true);
|
||||
DespawnWaterElements();
|
||||
@@ -340,16 +346,22 @@ public:
|
||||
{
|
||||
npc_ichor_globuleAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
uiRangeCheck_Timer = 1000;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 uiRangeCheck_Timer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
uiRangeCheck_Timer = 1000;
|
||||
Initialize();
|
||||
DoCast(me, SPELL_WATER_GLOBULE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user