aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms/Karazhan
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts/EasternKingdoms/Karazhan')
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp12
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp12
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp29
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp31
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp14
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp18
6 files changed, 52 insertions, 64 deletions
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp
index bbddf0aa5f5..87f7ab5f07e 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp
@@ -75,10 +75,10 @@ public:
void Initialize()
{
ResetTimer = 0;
- Midnight = 0;
+ Midnight.Clear();
}
- uint64 Midnight;
+ ObjectGuid Midnight;
uint8 Phase;
uint32 CleaveTimer;
uint32 CurseTimer;
@@ -141,11 +141,11 @@ public:
void Initialize()
{
Phase = 1;
- Attumen = 0;
+ Attumen.Clear();
Mount_Timer = 0;
}
- uint64 Attumen;
+ ObjectGuid Attumen;
uint8 Phase;
uint32 Mount_Timer;
@@ -242,7 +242,7 @@ public:
Mount_Timer = 1000;
}
- void SetMidnight(Creature* pAttumen, uint64 value)
+ void SetMidnight(Creature* pAttumen, ObjectGuid value)
{
ENSURE_AI(boss_attumen::boss_attumenAI, pAttumen->AI())->Midnight = value;
}
@@ -262,7 +262,7 @@ void boss_attumen::boss_attumenAI::UpdateAI(uint32 diff)
pMidnight->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pMidnight->SetVisible(true);
}
- Midnight = 0;
+ Midnight.Clear();
me->SetVisible(false);
me->Kill(me);
} else ResetTimer -= diff;
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
index 62fdaa94739..0d9827d390c 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
@@ -107,7 +107,6 @@ public:
{
Initialize();
memset(AddId, 0, sizeof(AddId));
- memset(AddGUID, 0, sizeof(AddGUID));
instance = creature->GetInstanceScript();
}
@@ -126,7 +125,7 @@ public:
InstanceScript* instance;
- uint64 AddGUID[4];
+ ObjectGuid AddGUID[4];
uint32 Vanish_Timer;
uint32 Blind_Timer;
@@ -339,13 +338,10 @@ struct boss_moroes_guestAI : public ScriptedAI
{
InstanceScript* instance;
- uint64 GuestGUID[4];
+ ObjectGuid GuestGUID[4];
boss_moroes_guestAI(Creature* creature) : ScriptedAI(creature)
{
- for (uint8 i = 0; i < 4; ++i)
- GuestGUID[i] = 0;
-
instance = creature->GetInstanceScript();
}
@@ -358,13 +354,13 @@ struct boss_moroes_guestAI : public ScriptedAI
{
if (Creature* Moroes = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MOROES)))
for (uint8 i = 0; i < 4; ++i)
- if (uint64 GUID = ENSURE_AI(boss_moroes::boss_moroesAI, Moroes->AI())->AddGUID[i])
+ if (ObjectGuid GUID = ENSURE_AI(boss_moroes::boss_moroesAI, Moroes->AI())->AddGUID[i])
GuestGUID[i] = GUID;
}
Unit* SelectGuestTarget()
{
- uint64 TempGUID = GuestGUID[rand32() % 4];
+ ObjectGuid TempGUID = GuestGUID[rand32() % 4];
if (TempGUID)
{
Unit* unit = ObjectAccessor::GetUnit(*me, TempGUID);
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp
index d71061259c4..77e9e3fe86d 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp
@@ -81,13 +81,6 @@ public:
Initialize();
instance = creature->GetInstanceScript();
- for (int i=0; i<3; ++i)
- {
- PortalGUID[i] = 0;
- BeamTarget[i] = 0;
- BeamerGUID[i] = 0;
- }
-
PortalPhase = false;
PhaseTimer = 0;
EmpowermentTimer = 0;
@@ -112,9 +105,9 @@ public:
uint32 NetherbreathTimer;
uint32 EmpowermentTimer;
uint32 PortalTimer; // timer for beam checking
- uint64 PortalGUID[3]; // guid's of portals
- uint64 BeamerGUID[3]; // guid's of auxiliary beaming portals
- uint64 BeamTarget[3]; // guid's of portals' current targets
+ ObjectGuid PortalGUID[3]; // guid's of portals
+ ObjectGuid BeamerGUID[3]; // guid's of auxiliary beaming portals
+ ObjectGuid BeamTarget[3]; // guid's of portals' current targets
bool IsBetween(WorldObject* u1, WorldObject* target, WorldObject* u2) // the in-line checker
{
@@ -157,7 +150,7 @@ public:
pos[GREEN_PORTAL] = ((r % 2) ? 0 : (r > 1 ? 2 : 1));
pos[BLUE_PORTAL] = (r > 1 ? 1 : 2); // Blue Portal not on the left side (0)
- for (int i=0; i<3; ++i)
+ for (int i = 0; i < 3; ++i)
if (Creature* portal = me->SummonCreature(PortalID[i], PortalCoord[pos[i]][0], PortalCoord[pos[i]][1], PortalCoord[pos[i]][2], 0, TEMPSUMMON_TIMED_DESPAWN, 60000))
{
PortalGUID[i] = portal->GetGUID();
@@ -173,14 +166,14 @@ public:
portal->DisappearAndDie();
if (Creature* portal = ObjectAccessor::GetCreature(*me, BeamerGUID[i]))
portal->DisappearAndDie();
- PortalGUID[i] = 0;
- BeamTarget[i] = 0;
+ PortalGUID[i].Clear();
+ BeamTarget[i].Clear();
}
}
void UpdatePortals() // Here we handle the beams' behavior
{
- for (int j=0; j<3; ++j) // j = color
+ for (int j = 0; j < 3; ++j) // j = color
if (Creature* portal = ObjectAccessor::GetCreature(*me, PortalGUID[j]))
{
// the one who's been cast upon before
@@ -198,9 +191,9 @@ public:
Player* p = i->GetSource();
if (p && p->IsAlive() // alive
&& (!target || target->GetDistance2d(portal)>p->GetDistance2d(portal)) // closer than current best
- && !p->HasAura(PlayerDebuff[j], 0) // not exhausted
- && !p->HasAura(PlayerBuff[(j+1)%3], 0) // not on another beam
- && !p->HasAura(PlayerBuff[(j+2)%3], 0)
+ && !p->HasAura(PlayerDebuff[j]) // not exhausted
+ && !p->HasAura(PlayerBuff[(j + 1) % 3]) // not on another beam
+ && !p->HasAura(PlayerBuff[(j + 2) % 3])
&& IsBetween(me, p, portal)) // on the beam
target = p;
}
@@ -220,7 +213,7 @@ public:
{
beamer->CastSpell(target, PortalBeam[j], false);
beamer->DisappearAndDie();
- BeamerGUID[j] = 0;
+ BeamerGUID[j].Clear();
}
// create new one and start beaming on the target
if (Creature* beamer = portal->SummonCreature(PortalID[j], portal->GetPositionX(), portal->GetPositionY(), portal->GetPositionZ(), portal->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 60000))
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
index c22e61fda42..06e4859a931 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
@@ -110,11 +110,11 @@ public:
struct netherspite_infernalAI : public ScriptedAI
{
netherspite_infernalAI(Creature* creature) : ScriptedAI(creature),
- HellfireTimer(0), CleanupTimer(0), malchezaar(0), point(NULL) { }
+ HellfireTimer(0), CleanupTimer(0), point(NULL) { }
uint32 HellfireTimer;
uint32 CleanupTimer;
- uint64 malchezaar;
+ ObjectGuid malchezaar;
InfernalPoint *point;
void Reset() override { }
@@ -189,7 +189,6 @@ public:
Initialize();
instance = creature->GetInstanceScript();
- memset(axes, 0, sizeof(axes));
}
void Initialize()
@@ -208,7 +207,7 @@ public:
for (uint8 i = 0; i < 5; ++i)
{
- enfeeble_targets[i] = 0;
+ enfeeble_targets[i].Clear();
enfeeble_health[i] = 0;
}
}
@@ -225,12 +224,12 @@ public:
uint32 AxesTargetSwitchTimer;
uint32 InfernalCleanupTimer;
- std::vector<uint64> infernals;
+ GuidVector infernals;
std::vector<InfernalPoint*> positions;
- uint64 axes[2];
- uint64 enfeeble_targets[5];
- uint32 enfeeble_health[5];
+ ObjectGuid axes[2];
+ ObjectGuid enfeeble_targets[5];
+ uint64 enfeeble_health[5];
uint32 phase;
@@ -279,7 +278,7 @@ public:
void InfernalCleanup()
{
//Infernal Cleanup
- for (std::vector<uint64>::const_iterator itr = infernals.begin(); itr != infernals.end(); ++itr)
+ for (GuidVector::const_iterator itr = infernals.begin(); itr != infernals.end(); ++itr)
if (Unit* pInfernal = ObjectAccessor::GetUnit(*me, *itr))
if (pInfernal->IsAlive())
{
@@ -297,7 +296,7 @@ public:
Unit* axe = ObjectAccessor::GetUnit(*me, axes[i]);
if (axe && axe->IsAlive())
axe->Kill(axe);
- axes[i] = 0;
+ axes[i].Clear();
}
}
@@ -350,7 +349,7 @@ public:
Unit* target = ObjectAccessor::GetUnit(*me, enfeeble_targets[i]);
if (target && target->IsAlive())
target->SetHealth(enfeeble_health[i]);
- enfeeble_targets[i] = 0;
+ enfeeble_targets[i].Clear();
enfeeble_health[i] = 0;
}
}
@@ -576,11 +575,13 @@ public:
void Cleanup(Creature* infernal, InfernalPoint *point)
{
- for (std::vector<uint64>::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr)
- if (*itr == infernal->GetGUID())
+ for (GuidVector::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr)
{
- infernals.erase(itr);
- break;
+ if (*itr == infernal->GetGUID())
+ {
+ infernals.erase(itr);
+ break;
+ }
}
positions.push_back(point);
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
index 6733ccb3f9f..db8b1327585 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
@@ -144,10 +144,10 @@ public:
void Initialize()
{
- SacrificeGUID = 0;
+ SacrificeGUID.Clear();
}
- uint64 SacrificeGUID;
+ ObjectGuid SacrificeGUID;
void Reset() override
{
@@ -269,10 +269,8 @@ public:
{
boss_terestianAI(Creature* creature) : ScriptedAI(creature)
{
- Initialize();
- for (uint8 i = 0; i < 2; ++i)
- PortalGUID[i] = 0;
instance = creature->GetInstanceScript();
+ Initialize();
}
void Initialize()
@@ -289,7 +287,7 @@ public:
InstanceScript* instance;
- uint64 PortalGUID[2];
+ ObjectGuid PortalGUID[2];
uint8 PortalsCount;
uint32 SacrificeTimer;
@@ -312,7 +310,7 @@ public:
pPortal->DespawnOrUnsummon();
}
- PortalGUID[i] = 0;
+ PortalGUID[i].Clear();
}
}
@@ -367,7 +365,7 @@ public:
if (Creature* pPortal = ObjectAccessor::GetCreature((*me), PortalGUID[i]))
pPortal->DespawnOrUnsummon();
- PortalGUID[i] = 0;
+ PortalGUID[i].Clear();
}
}
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
index 863bdd6db78..63d543568fb 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
@@ -250,11 +250,11 @@ public:
void Initialize()
{
- DorotheeGUID = 0;
+ DorotheeGUID.Clear();
YipTimer = 10000;
}
- uint64 DorotheeGUID;
+ ObjectGuid DorotheeGUID;
uint32 YipTimer;
void Reset() override
@@ -868,7 +868,7 @@ public:
FearTimer = urand(25000, 35000);
SwipeTimer = 5000;
- HoodGUID = 0;
+ HoodGUID.Clear();
TempThreat = 0;
IsChasing = false;
@@ -880,7 +880,7 @@ public:
uint32 FearTimer;
uint32 SwipeTimer;
- uint64 HoodGUID;
+ ObjectGuid HoodGUID;
float TempThreat;
bool IsChasing;
@@ -947,7 +947,7 @@ public:
if (Unit* target = ObjectAccessor::GetUnit(*me, HoodGUID))
{
- HoodGUID = 0;
+ HoodGUID.Clear();
if (DoGetThreat(target))
DoModifyThreatPercent(target, -100);
me->AddThreat(target, TempThreat);
@@ -1073,7 +1073,7 @@ public:
void Initialize()
{
- RomuloGUID = 0;
+ RomuloGUID.Clear();
Phase = PHASE_JULIANNE;
BlindingPassionTimer = 30000;
@@ -1093,7 +1093,7 @@ public:
uint32 EntryYellTimer;
uint32 AggroYellTimer;
- uint64 RomuloGUID;
+ ObjectGuid RomuloGUID;
uint32 Phase;
@@ -1197,7 +1197,7 @@ public:
void Initialize()
{
- JulianneGUID = 0;
+ JulianneGUID.Clear();
Phase = PHASE_ROMULO;
BackwardLungeTimer = 15000;
@@ -1212,7 +1212,7 @@ public:
InstanceScript* instance;
- uint64 JulianneGUID;
+ ObjectGuid JulianneGUID;
uint32 Phase;
uint32 EntryYellTimer;