Core/Scripts: Fixed build of boss_* scripts

This commit is contained in:
Shauren
2014-09-15 22:07:11 +02:00
parent 6ce0a3107d
commit a3d8f1d879
88 changed files with 453 additions and 508 deletions

View File

@@ -174,7 +174,7 @@ public:
}
uint32 soulmodel;
uint64 soulholder;
ObjectGuid soulholder;
uint8 soulclass;
uint32 Fear_timer;
@@ -187,7 +187,7 @@ public:
void Reset() override
{
soulmodel = 0;
soulholder = 0;
soulholder.Clear();
soulclass = 0;
Fear_timer = 15000 + rand32() % 5000;

View File

@@ -69,7 +69,7 @@ public:
uint32 Carnivorousbite_Timer;
uint32 FocusFire_Timer;
uint64 FocusedTargetGUID;
ObjectGuid FocusedTargetGUID;
void Reset() override
{
@@ -77,7 +77,7 @@ public:
Attractmagic_Timer = 28000;
Carnivorousbite_Timer = 10000;
FocusFire_Timer = 17000;
FocusedTargetGUID = 0;
FocusedTargetGUID.Clear();
}
void EnterCombat(Unit* /*who*/) override

View File

@@ -73,7 +73,7 @@ public:
InstanceScript* instance;
uint64 TargetGUID;
ObjectGuid TargetGUID;
float TargetThreat;
@@ -94,7 +94,7 @@ public:
{
instance->SetBossState(DATA_GURTOGG_BLOODBOIL, NOT_STARTED);
TargetGUID = 0;
TargetGUID.Clear();
TargetThreat = 0;
@@ -134,7 +134,7 @@ public:
Talk(SAY_DEATH);
}
void RevertThreatOnTarget(uint64 guid)
void RevertThreatOnTarget(ObjectGuid guid)
{
if (Unit* unit = ObjectAccessor::GetUnit(*me, guid))
{
@@ -258,7 +258,7 @@ public:
{
if (TargetGUID)
RevertThreatOnTarget(TargetGUID);
TargetGUID = 0;
TargetGUID.Clear();
Phase1 = true;
BloodboilTimer = 10000;
BloodboilCount = 0;

View File

@@ -383,7 +383,7 @@ public:
{
FlameBlastTimer = 15000;
CheckTimer = 5000;
GlaiveGUID = 0;
GlaiveGUID.Clear();
}
void EnterCombat(Unit* /*who*/) override
@@ -426,7 +426,7 @@ public:
}
}
void SetGlaiveGUID(uint64 guid)
void SetGlaiveGUID(ObjectGuid guid)
{
GlaiveGUID = guid;
}
@@ -457,7 +457,7 @@ public:
private:
uint32 FlameBlastTimer;
uint32 CheckTimer;
uint64 GlaiveGUID;
ObjectGuid GlaiveGUID;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -478,7 +478,6 @@ public:
{
instance = creature->GetInstanceScript();
DoCast(me, SPELL_DUAL_WIELD, true);
AkamaGUID = 0;
}
void Reset() override;
@@ -491,7 +490,7 @@ public:
{
for (uint8 i = 0; i < 2; ++i)
if (summon->GetGUID() == FlameGUID[i])
FlameGUID[i] = 0;
FlameGUID[i].Clear();
if (!FlameGUID[0] && !FlameGUID[1] && Phase != PHASE_ILLIDAN_NULL)
{
@@ -575,7 +574,7 @@ public:
}
}
void DeleteFromThreatList(uint64 TargetGUID)
void DeleteFromThreatList(ObjectGuid TargetGUID)
{
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
@@ -852,7 +851,7 @@ public:
if (Creature* glaive = ObjectAccessor::GetCreature(*me, GlaiveGUID[i]))
glaive->DespawnOrUnsummon();
GlaiveGUID[i] = 0;
GlaiveGUID[i].Clear();
}
}
Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
@@ -1105,7 +1104,7 @@ public:
}
public:
uint64 AkamaGUID;
ObjectGuid AkamaGUID;
uint32 Timer[EVENT_ENRAGE + 1];
PhaseIllidan Phase;
private:
@@ -1115,9 +1114,9 @@ public:
uint32 TransformCount;
uint32 FlightCount;
uint32 HoverPoint;
uint64 MaievGUID;
uint64 FlameGUID[2];
uint64 GlaiveGUID[2];
ObjectGuid MaievGUID;
ObjectGuid FlameGUID[2];
ObjectGuid GlaiveGUID[2];
SummonList Summons;
};
@@ -1143,7 +1142,7 @@ public:
{
MaxTimer = 0;
Phase = PHASE_NORMAL_MAIEV;
IllidanGUID = 0;
IllidanGUID.Clear();
Timer[EVENT_MAIEV_STEALTH] = 0;
Timer[EVENT_MAIEV_TAUNT] = urand(22, 43) * 1000;
Timer[EVENT_MAIEV_SHADOW_STRIKE] = 30000;
@@ -1156,7 +1155,7 @@ public:
void EnterEvadeMode() override { }
void GetIllidanGUID(uint64 guid)
void GetIllidanGUID(ObjectGuid guid)
{
IllidanGUID = guid;
}
@@ -1336,7 +1335,7 @@ public:
}
private:
uint64 IllidanGUID;
ObjectGuid IllidanGUID;
PhaseIllidan Phase;
EventMaiev Event;
uint32 Timer[5];
@@ -1388,9 +1387,9 @@ public:
instance->HandleGameObject(DoorGUID[i], true);
}
ChannelGUID = 0;
SpiritGUID[0] = 0;
SpiritGUID[1] = 0;
ChannelGUID.Clear();
SpiritGUID[0].Clear();
SpiritGUID[1].Clear();
Phase = PHASE_AKAMA_NULL;
Timer = 0;
@@ -1761,11 +1760,11 @@ public:
PhaseAkama Phase;
bool Event;
uint32 Timer;
uint64 IllidanGUID;
uint64 ChannelGUID;
uint64 SpiritGUID[2];
uint64 GateGUID;
uint64 DoorGUID[2];
ObjectGuid IllidanGUID;
ObjectGuid ChannelGUID;
ObjectGuid SpiritGUID[2];
ObjectGuid GateGUID;
ObjectGuid DoorGUID[2];
uint32 ChannelCount;
uint32 WalkCount;
uint32 TalkCount;
@@ -1790,11 +1789,11 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::Reset()
akama->AI()->EnterEvadeMode();
}
MaievGUID = 0;
MaievGUID.Clear();
for (uint8 i = 0; i < 2; ++i)
{
FlameGUID[i] = 0;
GlaiveGUID[i] = 0;
FlameGUID[i].Clear();
GlaiveGUID[i].Clear();
}
Phase = PHASE_ILLIDAN_NULL;
@@ -1959,7 +1958,7 @@ public:
void Reset() override
{
IllidanGUID = 0;
IllidanGUID.Clear();
Active = false;
SummonedBeams = false;
@@ -2017,7 +2016,7 @@ public:
public:
bool Active;
private:
uint64 IllidanGUID;
ObjectGuid IllidanGUID;
uint32 DespawnTimer;
bool SummonedBeams;
};
@@ -2062,7 +2061,7 @@ public:
void Reset() override
{
TargetGUID = 0;
TargetGUID.Clear();
DoCast(me, SPELL_SHADOW_DEMON_PASSIVE, true);
}
@@ -2093,7 +2092,7 @@ public:
}
private:
uint64 TargetGUID;
ObjectGuid TargetGUID;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -2198,7 +2197,7 @@ public:
private:
InstanceScript* instance;
uint64 IllidanGUID;
ObjectGuid IllidanGUID;
uint32 CheckTimer;
};

View File

@@ -112,8 +112,8 @@ public:
void Initialize()
{
for (uint8 i = 0; i<3; ++i)
TargetGUID[i] = 0;
for (uint8 i = 0; i < 3; ++i)
TargetGUID[i].Clear();
BeamCount = 0;
CurrentBeam = SINISTER_BEAM; // 0 - Sinister, 1 - Vile, 2 - Wicked, 3 - Sinful
@@ -236,7 +236,7 @@ public:
{
if (Unit* unit = ObjectAccessor::GetUnit(*me, TargetGUID[i]))
unit->CastSpell(unit, SPELL_ATTRACTION, true);
TargetGUID[i] = 0;
TargetGUID[i].Clear();
}
}
++ExplosionCount;
@@ -267,7 +267,7 @@ public:
}
private:
uint64 TargetGUID[3];
ObjectGuid TargetGUID[3];
uint32 BeamCount;
uint32 CurrentBeam;
uint32 ExplosionCount;

View File

@@ -113,9 +113,12 @@ public:
{
npc_enslaved_soulAI(Creature* creature) : ScriptedAI(creature) { }
uint64 ReliquaryGUID;
ObjectGuid ReliquaryGUID;
void Reset() override { ReliquaryGUID = 0; }
void Reset() override
{
ReliquaryGUID.Clear();
}
void EnterCombat(Unit* /*who*/) override
{
@@ -142,12 +145,11 @@ public:
boss_reliquary_of_soulsAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
EssenceGUID = 0;
}
InstanceScript* instance;
uint64 EssenceGUID;
ObjectGuid EssenceGUID;
uint32 Phase;
uint32 Counter;
@@ -165,7 +167,7 @@ public:
if (Creature* essence = ObjectAccessor::GetCreature(*me, EssenceGUID))
essence->DespawnOrUnsummon();
EssenceGUID = 0;
EssenceGUID.Clear();
}
Phase = 0;
@@ -334,17 +336,15 @@ public:
if (Essence)
{
if (Phase == 1)
{
Essence->AI()->Talk(SUFF_SAY_AFTER);
}
else
{
Essence->AI()->Talk(DESI_SAY_AFTER);
}
Essence->DespawnOrUnsummon();
}
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
EssenceGUID = 0;
EssenceGUID.Clear();
SoulCount = 0;
SoulDeathCount = 0;
Timer = 3000;
@@ -624,7 +624,7 @@ public:
{
boss_essence_of_angerAI(Creature* creature) : ScriptedAI(creature) { }
uint64 AggroTargetGUID;
ObjectGuid AggroTargetGUID;
uint32 CheckTankTimer;
uint32 SoulScreamTimer;
@@ -636,7 +636,7 @@ public:
void Reset() override
{
AggroTargetGUID = 0;
AggroTargetGUID.Clear();
CheckTankTimer = 5000;
SoulScreamTimer = 10000;

View File

@@ -175,11 +175,11 @@ public:
{
if (!HasKilledAkamaAndReseting)
{
for (std::list<uint64>::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
for (GuidList::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
if (Creature* Channeler = ObjectAccessor::GetCreature(*me, *itr))
Channeler->DespawnOrUnsummon();
for (std::list<uint64>::const_iterator itr = Spawners.begin(); itr != Spawners.end(); ++itr)
for (GuidList::const_iterator itr = Spawners.begin(); itr != Spawners.end(); ++itr)
if (Creature* Spawner = ObjectAccessor::GetCreature(*me, *itr))
Spawner->AI()->SetData(SETDATA_DATA, SETDATA_DESPAWN_ALL_SPAWNS);
@@ -307,17 +307,13 @@ public:
{
case EVENT_SET_CHANNELERS_SPAWNERS:
{
for (std::list<uint64>::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
{
for (GuidList::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
if (Creature* Channeler = ObjectAccessor::GetCreature(*me, *itr))
Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
for (std::list<uint64>::const_iterator itr = Spawners.begin(); itr != Spawners.end(); ++itr)
{
for (GuidList::const_iterator itr = Spawners.begin(); itr != Spawners.end(); ++itr)
if (Creature* Spawner = ObjectAccessor::GetCreature(*me, *itr))
Spawner->AI()->SetData(SETDATA_DATA, SETDATA_START_SPAWNING);
}
break;
}
case EVENT_START_ATTACK_AKAMA:
@@ -350,11 +346,11 @@ public:
if (Creature* Akama = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
Akama->DespawnOrUnsummon();
for (std::list<uint64>::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
for (GuidList::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
if (Creature* Channeler = ObjectAccessor::GetCreature(*me, *itr))
Channeler->DespawnOrUnsummon();
for (std::list<uint64>::const_iterator itr = Spawners.begin(); itr != Spawners.end(); ++itr)
for (GuidList::const_iterator itr = Spawners.begin(); itr != Spawners.end(); ++itr)
if (Creature* Spawner = ObjectAccessor::GetCreature(*me, *itr))
Spawner->AI()->SetData(SETDATA_DATA, SETDATA_DESPAWN_ALL_SPAWNS);
@@ -379,7 +375,7 @@ public:
events.CancelEvent(EVENT_START_ATTACK_AKAMA);
events.ScheduleEvent(EVENT_ADD_THREAT, 100);
for (std::list<uint64>::const_iterator itr = Spawners.begin(); itr != Spawners.end(); ++itr)
for (GuidList::const_iterator itr = Spawners.begin(); itr != Spawners.end(); ++itr)
if (Creature* Spawner = ObjectAccessor::GetCreature(*me, *itr))
Spawner->AI()->SetData(SETDATA_DATA, SETDATA_STOP_SPAWNING);
}
@@ -395,8 +391,8 @@ public:
private:
InstanceScript* instance;
EventMap events;
std::list<uint64> Channelers;
std::list<uint64> Spawners;
GuidList Channelers;
GuidList Spawners;
bool akamaReached;
bool combatStarted;
bool HasKilledAkamaAndReseting;
@@ -763,7 +759,7 @@ public:
}
}
summonerGuid = 0;
summonerGuid.Clear();
startedBanishing = false;
switchToCombat = false;
}
@@ -841,7 +837,7 @@ public:
private:
InstanceScript* instance;
EventMap events;
uint64 summonerGuid;
ObjectGuid summonerGuid;
bool startedBanishing;
bool switchToCombat;
};
@@ -870,7 +866,7 @@ public:
void Reset() override
{
summonerGuid = 0;
summonerGuid.Clear();
if (Unit* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
AttackStart(target);
@@ -933,7 +929,7 @@ public:
private:
InstanceScript* instance;
EventMap events;
uint64 summonerGuid;
ObjectGuid summonerGuid;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -960,7 +956,7 @@ public:
void Reset() override
{
summonerGuid = 0;
summonerGuid.Clear();
if (Unit* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
AttackStart(target);
@@ -1013,7 +1009,7 @@ public:
private:
InstanceScript* instance;
EventMap events;
uint64 summonerGuid;
ObjectGuid summonerGuid;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -1040,7 +1036,7 @@ public:
void Reset() override
{
summonerGuid = 0;
summonerGuid.Clear();
if (Unit* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
AttackStart(target);
@@ -1093,7 +1089,7 @@ public:
private:
InstanceScript* instance;
EventMap events;
uint64 summonerGuid;
ObjectGuid summonerGuid;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -1122,7 +1118,7 @@ public:
{
spiritMend = false;
chainHeal = false;
summonerGuid = 0;
summonerGuid.Clear();
if (Unit* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
AttackStart(target);
@@ -1188,7 +1184,7 @@ public:
private:
InstanceScript* instance;
EventMap events;
uint64 summonerGuid;
ObjectGuid summonerGuid;
bool spiritMend;
bool chainHeal;
};

View File

@@ -67,13 +67,13 @@ public:
uint32 CheckTeronTimer;
uint32 ShadowBoltTimer;
uint64 TeronGUID;
ObjectGuid TeronGUID;
void Reset() override
{
CheckTeronTimer = 5000;
ShadowBoltTimer = 12000;
TeronGUID = 0;
TeronGUID.Clear();
}
void EnterCombat(Unit* /*who*/) override { }
@@ -113,7 +113,7 @@ public:
return;
}
void SetTeronGUID(uint64 guid)
void SetTeronGUID(ObjectGuid guid)
{
TeronGUID = guid;
}
@@ -134,16 +134,16 @@ public:
{
npc_shadowy_constructAI(Creature* creature) : ScriptedAI(creature) { }
uint64 GhostGUID;
uint64 TeronGUID;
ObjectGuid GhostGUID;
ObjectGuid TeronGUID;
uint32 CheckPlayerTimer;
uint32 CheckTeronTimer;
void Reset() override
{
GhostGUID = 0;
TeronGUID = 0;
GhostGUID.Clear();
TeronGUID.Clear();
CheckPlayerTimer = 2000;
CheckTeronTimer = 5000;
@@ -238,8 +238,8 @@ public:
uint32 RandomYellTimer;
uint32 AggroTimer;
uint64 AggroTargetGUID;
uint64 GhostGUID; // Player that gets killed by Shadow of Death and gets turned into a ghost
ObjectGuid AggroTargetGUID;
ObjectGuid GhostGUID; // Player that gets killed by Shadow of Death and gets turned into a ghost
bool Intro;
bool Done;
@@ -260,7 +260,7 @@ public:
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
AggroTimer = 20000;
AggroTargetGUID = 0;
AggroTargetGUID.Clear();
Intro = false;
Done = false;
}

View File

@@ -67,13 +67,12 @@ public:
{
boss_najentusAI(Creature* creature) : BossAI(creature, DATA_HIGH_WARLORD_NAJENTUS)
{
SpineTargetGUID = 0;
}
void Reset() override
{
_Reset();
SpineTargetGUID = 0;
SpineTargetGUID.Clear();
}
void KilledUnit(Unit* /*victim*/) override
@@ -115,7 +114,7 @@ public:
Unit* target = ObjectAccessor::GetUnit(*me, SpineTargetGUID);
if (target && target->HasAura(SPELL_IMPALING_SPINE))
target->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE);
SpineTargetGUID=0;
SpineTargetGUID.Clear();
return true;
}
@@ -181,7 +180,7 @@ public:
}
private:
uint64 SpineTargetGUID;
ObjectGuid SpineTargetGUID;
};
CreatureAI* GetAI(Creature* creature) const override

View File

@@ -112,9 +112,6 @@ public:
boss_fathomlord_karathressAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
Advisors[0] = 0;
Advisors[1] = 0;
Advisors[2] = 0;
}
InstanceScript* instance;
@@ -125,7 +122,7 @@ public:
bool BlessingOfTides;
uint64 Advisors[MAX_ADVISORS];
ObjectGuid Advisors[MAX_ADVISORS];
void Reset() override
{
@@ -135,7 +132,7 @@ public:
BlessingOfTides = false;
uint64 RAdvisors[MAX_ADVISORS];
ObjectGuid RAdvisors[MAX_ADVISORS];
RAdvisors[0] = instance->GetGuidData(DATA_SHARKKIS);
RAdvisors[1] = instance->GetGuidData(DATA_TIDALVESS);
RAdvisors[2] = instance->GetGuidData(DATA_CARIBDIS);
@@ -308,7 +305,6 @@ public:
boss_fathomguard_sharkkisAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
SummonedPet = 0;
}
InstanceScript* instance;
@@ -320,7 +316,7 @@ public:
bool pet;
uint64 SummonedPet;
ObjectGuid SummonedPet;
void Reset() override
{
@@ -335,7 +331,7 @@ public:
if (Pet && Pet->IsAlive())
Pet->DealDamage(Pet, Pet->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
SummonedPet = 0;
SummonedPet.Clear();
instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
}
@@ -515,7 +511,7 @@ public:
if (Spitfire_Timer <= diff)
{
DoCast(me, SPELL_SPITFIRE_TOTEM);
if (Unit* SpitfireTotem = ObjectAccessor::GetUnit(*me, CREATURE_SPITFIRE_TOTEM))
if (Unit* SpitfireTotem = me->FindNearestCreature(CREATURE_SPITFIRE_TOTEM, 100.0f))
SpitfireTotem->ToCreature()->AI()->AttackStart(me->GetVictim());
Spitfire_Timer = 60000;

View File

@@ -94,13 +94,11 @@ public:
boss_hydross_the_unstableAI(Creature* creature) : ScriptedAI(creature), Summons(me)
{
instance = creature->GetInstanceScript();
beams[0] = 0;
beams[1] = 0;
}
InstanceScript* instance;
uint64 beams[2];
ObjectGuid beams[2];
uint32 PosCheck_Timer;
uint32 MarkOfHydross_Timer;
uint32 MarkOfCorruption_Timer;
@@ -116,8 +114,8 @@ public:
void Reset() override
{
DeSummonBeams();
beams[0] = 0;
beams[1] = 0;
beams[0].Clear();
beams[1].Clear();
PosCheck_Timer = 2500;
MarkOfHydross_Timer = 15000;
MarkOfCorruption_Timer = 15000;
@@ -147,7 +145,7 @@ public:
beamer->CastSpell(me, SPELL_BLUE_BEAM, true);
beamer->SetDisplayId(11686); //invisible
beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
beams[0]=beamer->GetGUID();
beams[0] = beamer->GetGUID();
}
beamer = me->SummonCreature(ENTRY_BEAM_DUMMY, -219.918f, -371.308f, 22.0042f, 2.73072f, TEMPSUMMON_CORPSE_DESPAWN, 0);
if (beamer)
@@ -155,7 +153,7 @@ public:
beamer->CastSpell(me, SPELL_BLUE_BEAM, true);
beamer->SetDisplayId(11686); //invisible
beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
beams[1]=beamer->GetGUID();
beams[1] = beamer->GetGUID();
}
}
void DeSummonBeams()

View File

@@ -151,13 +151,11 @@ public:
Intro = false;
JustCreated = true;
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // set it only once on Creature create (no need do intro if wiped)
for (uint8 i = 0; i < 4; ++i)
ShieldGeneratorChannel[i] = 0;
}
InstanceScript* instance;
uint64 ShieldGeneratorChannel[4];
ObjectGuid ShieldGeneratorChannel[4];
uint32 AggroTimer;
uint32 ShockBlastTimer;
@@ -210,7 +208,7 @@ public:
if (Unit* remo = ObjectAccessor::GetUnit(*me, ShieldGeneratorChannel[i]))
{
remo->setDeathState(JUST_DIED);
ShieldGeneratorChannel[i] = 0;
ShieldGeneratorChannel[i].Clear();
}
}
}
@@ -565,7 +563,7 @@ public:
uint32 Phase;
float X, Y, Z;
uint64 VashjGUID;
ObjectGuid VashjGUID;
void Reset() override
{

View File

@@ -83,13 +83,12 @@ public:
{
npc_inner_demonAI(Creature* creature) : ScriptedAI(creature)
{
victimGUID = 0;
}
uint32 ShadowBolt_Timer;
uint32 Link_Timer;
uint64 victimGUID;
ObjectGuid victimGUID;
void Reset() override
{
@@ -190,10 +189,6 @@ public:
{
creature->GetPosition(x, y, z);
instance = creature->GetInstanceScript();
Demon = 0;
for (uint8 i = 0; i < 3; ++i)//clear guids
SpellBinderGUID[i] = 0;
}
InstanceScript* instance;
@@ -213,10 +208,10 @@ public:
bool EnrageUsed;
float x, y, z;
uint64 InnderDemon[5];
ObjectGuid InnderDemon[5];
uint32 InnerDemon_Count;
uint64 Demon;
uint64 SpellBinderGUID[3];
ObjectGuid Demon;
ObjectGuid SpellBinderGUID[3];
void Reset() override
{
@@ -349,13 +344,12 @@ public:
{
if (InnderDemon[i])
{
//delete creature
Creature* creature = ObjectAccessor::GetCreature((*me), InnderDemon[i]);
if (creature && creature->IsAlive())
{
creature->DespawnOrUnsummon();
}
InnderDemon[i] = 0;
//delete creature
Creature* creature = ObjectAccessor::GetCreature((*me), InnderDemon[i]);
if (creature && creature->IsAlive())
creature->DespawnOrUnsummon();
InnderDemon[i].Clear();
}
}
@@ -364,9 +358,9 @@ public:
void CastConsumingMadness() //remove this once SPELL_INSIDIOUS_WHISPER is supported by core
{
for (uint8 i=0; i<5; ++i)
for (uint8 i = 0; i < 5; ++i)
{
if (InnderDemon[i] > 0)
if (InnderDemon[i])
{
Creature* unit = ObjectAccessor::GetCreature((*me), InnderDemon[i]);
if (unit && unit->IsAlive())
@@ -481,7 +475,7 @@ public:
if (SwitchToDemon_Timer <= diff)
{
//switch to demon form
me->RemoveAurasDueToSpell(SPELL_WHIRLWIND, 0);
me->RemoveAurasDueToSpell(SPELL_WHIRLWIND);
me->SetDisplayId(MODEL_DEMON);
Talk(SAY_SWITCH_TO_DEMON);
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
@@ -576,8 +570,8 @@ public:
Creature* Copy = NULL;
Copy = DoSpawnCreature(DEMON_FORM, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 6000);
if (Copy)
{
Demon = Copy->GetGUID();
{
Demon = Copy->GetGUID();
if (me->GetVictim())
Copy->AI()->AttackStart(me->GetVictim());
}
@@ -682,13 +676,12 @@ public:
npc_greyheart_spellbinderAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
leotherasGUID = 0;
AddedBanish = false;
}
InstanceScript* instance;
uint64 leotherasGUID;
ObjectGuid leotherasGUID;
uint32 Mindblast_Timer;
uint32 Earthshock_Timer;
@@ -700,7 +693,7 @@ public:
Mindblast_Timer = urand(3000, 8000);
Earthshock_Timer = urand(5000, 10000);
instance->SetGuidData(DATA_LEOTHERAS_EVENT_STARTER, 0);
instance->SetGuidData(DATA_LEOTHERAS_EVENT_STARTER, ObjectGuid::Empty);
Creature* leotheras = ObjectAccessor::GetCreature(*me, leotherasGUID);
if (leotheras && leotheras->IsAlive())
ENSURE_AI(boss_leotheras_the_blind::boss_leotheras_the_blindAI, leotheras->AI())->CheckChannelers(/*false*/);

View File

@@ -215,8 +215,8 @@ public:
{
//Teleport 4 players under the waterfalls
Unit* target;
std::set<uint64> list;
std::set<uint64>::const_iterator itr;
GuidSet targets;
GuidSet::const_iterator itr;
for (uint8 i = 0; i < 4; ++i)
{
counter = 0;
@@ -226,13 +226,13 @@ public:
if (counter < Playercount)
break;
if (target)
itr = list.find(target->GetGUID());
itr = targets.find(target->GetGUID());
++counter;
} while (itr != list.end());
} while (itr != targets.end());
if (target)
{
list.insert(target->GetGUID());
targets.insert(target->GetGUID());
ApplyWateryGrave(target, i);
}
}
@@ -253,8 +253,8 @@ public:
if (WateryGlobules_Timer <= diff)
{
Unit* pGlobuleTarget;
std::set<uint64> globulelist;
std::set<uint64>::const_iterator itr;
GuidSet globules;
GuidSet::const_iterator itr;
for (uint8 g = 0; g < 4; g++) //one unit can't cast more than one spell per update, so some players have to cast for us XD
{
counter = 0;
@@ -262,14 +262,14 @@ public:
{
pGlobuleTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true);
if (pGlobuleTarget)
itr = globulelist.find(pGlobuleTarget->GetGUID());
itr = globules.find(pGlobuleTarget->GetGUID());
if (counter > Playercount)
break;
++counter;
} while (itr != globulelist.end());
} while (itr != globules.end());
if (pGlobuleTarget)
{
globulelist.insert(pGlobuleTarget->GetGUID());
globules.insert(pGlobuleTarget->GetGUID());
pGlobuleTarget->CastSpell(pGlobuleTarget, globulespell[g], true);
}
}

View File

@@ -54,7 +54,7 @@ public:
struct boss_the_black_stalkerAI : public ScriptedAI
{
boss_the_black_stalkerAI(Creature* creature) : ScriptedAI(creature)
boss_the_black_stalkerAI(Creature* creature) : ScriptedAI(creature), Striders(creature)
{
}
@@ -62,11 +62,11 @@ public:
uint32 Levitate_Timer;
uint32 ChainLightning_Timer;
uint32 StaticCharge_Timer;
uint64 LevitatedTarget;
ObjectGuid LevitatedTarget;
uint32 LevitatedTarget_Timer;
bool InAir;
uint32 check_Timer;
std::list<uint64> Striders;
SummonList Striders;
void Reset() override
{
@@ -75,9 +75,9 @@ public:
StaticCharge_Timer = 10000;
SporeStriders_Timer = 10000 + rand32() % 5000;
check_Timer = 5000;
LevitatedTarget = 0;
LevitatedTarget.Clear();
LevitatedTarget_Timer = 0;
Striders.clear();
Striders.DespawnAll();
}
void EnterCombat(Unit* /*who*/) override { }
@@ -86,7 +86,7 @@ public:
{
if (summon && summon->GetEntry() == ENTRY_SPORE_STRIDER)
{
Striders.push_back(summon->GetGUID());
Striders.Summon(summon);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
summon->AI()->AttackStart(target);
else
@@ -97,9 +97,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
for (std::list<uint64>::const_iterator i = Striders.begin(); i != Striders.end(); ++i)
if (Creature* strider = ObjectAccessor::GetCreature(*me, *i))
strider->DisappearAndDie();
Striders.DespawnAll();
}
void UpdateAI(uint32 diff) override
@@ -136,13 +134,13 @@ public:
{
if (!target->HasAura(SPELL_LEVITATE))
{
LevitatedTarget = 0;
LevitatedTarget.Clear();
return;
}
if (InAir)
{
target->AddAura(SPELL_SUSPENSION, target);
LevitatedTarget = 0;
LevitatedTarget.Clear();
}
else
{
@@ -152,7 +150,7 @@ public:
}
}
else
LevitatedTarget = 0;
LevitatedTarget.Clear();
} else LevitatedTarget_Timer -= diff;
}
if (Levitate_Timer <= diff)

View File

@@ -65,8 +65,6 @@ class boss_kelidan_the_breaker : public CreatureScript
{
boss_kelidan_the_breakerAI(Creature* creature) : BossAI(creature, DATA_KELIDAN_THE_BREAKER)
{
for (uint8 i = 0; i < 5; ++i)
Channelers[i] = 0;
}
uint32 ShadowVolley_Timer;
@@ -76,7 +74,7 @@ class boss_kelidan_the_breaker : public CreatureScript
uint32 check_Timer;
bool Firenova;
bool addYell;
uint64 Channelers[5];
ObjectGuid Channelers[5];
void Reset() override
{
@@ -116,7 +114,7 @@ class boss_kelidan_the_breaker : public CreatureScript
addYell = true;
Talk(SAY_ADD_AGGRO);
}
for (uint8 i=0; i<5; ++i)
for (uint8 i = 0; i<5; ++i)
{
Creature* channeler = ObjectAccessor::GetCreature(*me, Channelers[i]);
if (who && channeler && !channeler->IsInCombat())
@@ -126,7 +124,7 @@ class boss_kelidan_the_breaker : public CreatureScript
void ChannelerDied(Unit* killer)
{
for (uint8 i=0; i<5; ++i)
for (uint8 i = 0; i < 5; ++i)
{
Creature* channeler = ObjectAccessor::GetCreature(*me, Channelers[i]);
if (channeler && channeler->IsAlive())
@@ -138,25 +136,25 @@ class boss_kelidan_the_breaker : public CreatureScript
AttackStart(killer);
}
uint64 GetChanneled(Creature* channeler1)
ObjectGuid GetChanneled(Creature* channeler1)
{
SummonChannelers();
if (!channeler1)
return 0;
return ObjectGuid::Empty;
uint8 i;
for (i=0; i<5; ++i)
for (i = 0; i < 5; ++i)
{
Creature* channeler = ObjectAccessor::GetCreature(*me, Channelers[i]);
if (channeler && channeler->GetGUID() == channeler1->GetGUID())
break;
}
return Channelers[(i+2)%5];
return Channelers[(i + 2) % 5];
}
void SummonChannelers()
{
for (uint8 i=0; i<5; ++i)
for (uint8 i = 0; i < 5; ++i)
{
Creature* channeler = ObjectAccessor::GetCreature(*me, Channelers[i]);
if (!channeler || channeler->isDead())
@@ -164,7 +162,7 @@ class boss_kelidan_the_breaker : public CreatureScript
if (channeler)
Channelers[i] = channeler->GetGUID();
else
Channelers[i] = 0;
Channelers[i].Clear();
}
}
@@ -310,16 +308,19 @@ class npc_shadowmoon_channeler : public CreatureScript
if (check_Timer <= diff)
{
if (!me->IsNonMeleeSpellCast(false))
{
if (Creature* Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100))
{
uint64 channeler = ENSURE_AI(boss_kelidan_the_breaker::boss_kelidan_the_breakerAI, Kelidan->AI())->GetChanneled(me);
ObjectGuid channeler = ENSURE_AI(boss_kelidan_the_breaker::boss_kelidan_the_breakerAI, Kelidan->AI())->GetChanneled(me);
if (Unit* channeled = ObjectAccessor::GetUnit(*me, channeler))
DoCast(channeled, SPELL_CHANNELING);
}
}
check_Timer = 5000;
}
else
check_Timer -= diff;
return;
}

View File

@@ -74,7 +74,7 @@ class boss_omor_the_unscarred : public CreatureScript
Shadowbolt_Timer = 2000;
Summon_Timer = 10000;
SummonedCount = 0;
PlayerGUID = 0;
PlayerGUID.Clear();
CanPullBack = false;
_Reset();
@@ -141,7 +141,7 @@ class boss_omor_the_unscarred : public CreatureScript
DoCast(temp, SPELL_SHADOW_WHIP);
}
}
PlayerGUID = 0;
PlayerGUID.Clear();
ShadowWhip_Timer = 2000;
CanPullBack = false;
}
@@ -218,7 +218,7 @@ class boss_omor_the_unscarred : public CreatureScript
uint32 Shadowbolt_Timer;
uint32 Summon_Timer;
uint32 SummonedCount;
uint64 PlayerGUID;
ObjectGuid PlayerGUID;
bool CanPullBack;
};

View File

@@ -70,7 +70,6 @@ class boss_nazan : public CreatureScript
{
boss_nazanAI(Creature* creature) : BossAI(creature, DATA_NAZAN)
{
VazrudenGUID = 0;
flight = true;
}
@@ -183,7 +182,7 @@ class boss_nazan : public CreatureScript
uint32 Fly_Timer;
uint32 Turn_Timer;
bool flight;
uint64 VazrudenGUID;
ObjectGuid VazrudenGUID;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -282,8 +281,6 @@ class boss_vazruden_the_herald : public CreatureScript
summoned = false;
sentryDown = false;
lootSpawned = false;
NazanGUID = 0;
VazrudenGUID = 0;
}
void Reset() override
@@ -304,7 +301,7 @@ class boss_vazruden_the_herald : public CreatureScript
if (Nazan)
{
Nazan->DisappearAndDie();
NazanGUID = 0;
NazanGUID.Clear();
}
Creature* Vazruden = ObjectAccessor::GetCreature(*me, VazrudenGUID);
@@ -313,7 +310,7 @@ class boss_vazruden_the_herald : public CreatureScript
if (Vazruden)
{
Vazruden->DisappearAndDie();
VazrudenGUID = 0;
VazrudenGUID.Clear();
}
summoned = false;
me->ClearUnitState(UNIT_STATE_ROOT);
@@ -435,8 +432,8 @@ class boss_vazruden_the_herald : public CreatureScript
uint32 waypoint;
uint32 check;
bool sentryDown;
uint64 NazanGUID;
uint64 VazrudenGUID;
ObjectGuid NazanGUID;
ObjectGuid VazrudenGUID;
bool summoned;
bool lootSpawned;
};

View File

@@ -85,7 +85,7 @@ enum Spells
//count of clickers needed to interrupt blast nova
#define CLICKERS_COUNT 5
typedef std::map<uint64, uint64> CubeMap;
typedef std::map<ObjectGuid, ObjectGuid> CubeMap;
class npc_abyssal : public CreatureScript
{
@@ -253,10 +253,10 @@ class boss_magtheridon : public CreatureScript
instance->SetData(DATA_COLLAPSE, false);
}
void SetClicker(uint64 cubeGUID, uint64 clickerGUID)
void SetClicker(ObjectGuid cubeGUID, ObjectGuid clickerGUID)
{
// to avoid multiclicks from 1 cube
if (uint64 guid = Cube[cubeGUID])
if (ObjectGuid guid = Cube[cubeGUID])
DebuffClicker(ObjectAccessor::GetUnit(*me, guid));
Cube[cubeGUID] = clickerGUID;
NeedCheckCube = true;
@@ -284,7 +284,7 @@ class boss_magtheridon : public CreatureScript
if (!clicker || !clicker->HasAura(SPELL_SHADOW_GRASP))
{
DebuffClicker(clicker);
(*i).second = 0;
(*i).second.Clear();
}
else
++ClickerNum;

View File

@@ -136,8 +136,6 @@ class boss_warbringer_omrogg : public CreatureScript
{
boss_warbringer_omroggAI(Creature* creature) : BossAI(creature, DATA_OMROGG)
{
LeftHeadGUID = 0;
RightHeadGUID = 0;
}
void Reset() override
@@ -145,13 +143,13 @@ class boss_warbringer_omrogg : public CreatureScript
if (Unit* LeftHead = ObjectAccessor::GetUnit(*me, LeftHeadGUID))
{
LeftHead->setDeathState(JUST_DIED);
LeftHeadGUID = 0;
LeftHeadGUID.Clear();
}
if (Unit* RightHead = ObjectAccessor::GetUnit(*me, RightHeadGUID))
{
RightHead->setDeathState(JUST_DIED);
RightHeadGUID = 0;
RightHeadGUID.Clear();
}
AggroYell = false;
@@ -363,8 +361,8 @@ class boss_warbringer_omrogg : public CreatureScript
}
private:
uint64 LeftHeadGUID;
uint64 RightHeadGUID;
ObjectGuid LeftHeadGUID;
ObjectGuid RightHeadGUID;
int iaggro;
int ithreat;
int ikilling;

View File

@@ -143,7 +143,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript
void removeAdds()
{
for (std::vector<uint64>::const_iterator itr = adds.begin(); itr!= adds.end(); ++itr)
for (GuidVector::const_iterator itr = adds.begin(); itr!= adds.end(); ++itr)
{
Creature* creature = ObjectAccessor::GetCreature(*me, *itr);
if (creature && creature->IsAlive())
@@ -155,7 +155,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript
}
adds.clear();
for (std::vector<uint64>::const_iterator itr = assassins.begin(); itr!= assassins.end(); ++itr)
for (GuidVector::const_iterator itr = assassins.begin(); itr!= assassins.end(); ++itr)
{
Creature* creature = ObjectAccessor::GetCreature(*me, *itr);
if (creature && creature->IsAlive())
@@ -295,8 +295,8 @@ class boss_warchief_kargath_bladefist : public CreatureScript
}
private:
std::vector<uint64> adds;
std::vector<uint64> assassins;
GuidVector adds;
GuidVector assassins;
uint32 Charge_timer;
uint32 Blade_Dance_Timer;
uint32 Summon_Assistant_Timer;

View File

@@ -163,7 +163,7 @@ struct advisorbase_ai : public ScriptedAI
bool FakeDeath;
bool m_bDoubled_Health;
uint32 DelayRes_Timer;
uint64 DelayRes_Target;
ObjectGuid DelayRes_Target;
void Reset() override
{
@@ -175,7 +175,7 @@ struct advisorbase_ai : public ScriptedAI
FakeDeath = false;
DelayRes_Timer = 0;
DelayRes_Target = 0;
DelayRes_Target.Clear();
me->SetStandState(UNIT_STAND_STATE_STAND);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -245,7 +245,7 @@ struct advisorbase_ai : public ScriptedAI
me->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->ClearAllReactives();
me->SetTarget(0);
me->SetTarget(ObjectGuid::Empty);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
me->SetStandState(UNIT_STAND_STATE_DEAD);
@@ -290,7 +290,6 @@ class boss_kaelthas : public CreatureScript
boss_kaelthasAI(Creature* creature) : ScriptedAI(creature), summons(me)
{
instance = creature->GetInstanceScript();
memset(&m_auiAdvisorGuid, 0, sizeof(m_auiAdvisorGuid));
}
InstanceScript* instance;
@@ -316,7 +315,7 @@ class boss_kaelthas : public CreatureScript
SummonList summons;
uint64 m_auiAdvisorGuid[MAX_ADVISORS];
ObjectGuid m_auiAdvisorGuid[MAX_ADVISORS];
void Reset() override
{

View File

@@ -137,7 +137,7 @@ class boss_void_reaver : public CreatureScript
target = me->GetVictim();
if (target)
me->CastSpell(target, SPELL_ARCANE_ORB, false, NULL, NULL, 0);
me->CastSpell(target, SPELL_ARCANE_ORB, false, NULL, NULL);
ArcaneOrb_Timer = 3000;
}
else

View File

@@ -66,8 +66,6 @@ class boss_high_botanist_freywinn : public CreatureScript
{
boss_high_botanist_freywinnAI(Creature* creature) : BossAI(creature, DATA_HIGH_BOTANIST_FREYWINN) { }
std::list<uint64> Adds_List;
uint32 SummonSeedling_Timer;
uint32 TreeForm_Timer;
uint32 MoveCheck_Timer;
@@ -76,7 +74,7 @@ class boss_high_botanist_freywinn : public CreatureScript
void Reset() override
{
Adds_List.clear();
summons.DespawnAll();
SummonSeedling_Timer = 6000;
TreeForm_Timer = 30000;
@@ -93,7 +91,12 @@ class boss_high_botanist_freywinn : public CreatureScript
void JustSummoned(Creature* summoned) override
{
if (summoned->GetEntry() == NPC_FRAYER)
Adds_List.push_back(summoned->GetGUID());
summons.Summon(summoned);
}
void SummonedCreatureDespawn(Creature* summon) override
{
summons.Despawn(summon);
}
void DoSummonSeedling()
@@ -147,18 +150,15 @@ class boss_high_botanist_freywinn : public CreatureScript
{
if (MoveCheck_Timer <= diff)
{
if (!Adds_List.empty())
for (SummonList::iterator itr = summons.begin(); itr != summons.end(); ++itr)
{
for (std::list<uint64>::iterator itr = Adds_List.begin(); itr != Adds_List.end(); ++itr)
if (Unit* temp = ObjectAccessor::GetUnit(*me, *itr))
{
if (Unit* temp = ObjectAccessor::GetUnit(*me, *itr))
if (!temp->IsAlive())
{
if (!temp->IsAlive())
{
Adds_List.erase(itr);
++DeadAddsCount;
break;
}
summons.erase(itr);
++DeadAddsCount;
break;
}
}
}
@@ -168,7 +168,7 @@ class boss_high_botanist_freywinn : public CreatureScript
if (DeadAddsCount >= 3)
{
Adds_List.clear();
summons.DespawnAll();
DeadAddsCount = 0;
me->InterruptNonMeleeSpells(true);

View File

@@ -74,10 +74,9 @@ class npc_warp_splinter_treant : public CreatureScript
{
npc_warp_splinter_treantAI(Creature* creature) : ScriptedAI(creature)
{
WarpGuid = 0;
}
uint64 WarpGuid;
ObjectGuid WarpGuid;
uint32 check_Timer;
void Reset() override