aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Kalimdor
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2014-09-15 00:23:47 +0200
committerShauren <shauren.trinity@gmail.com>2014-09-15 00:23:47 +0200
commit6ce0a3107d06cb5485e09afca42dbef4baa9553b (patch)
treef2640c707e183ce5b7dc63200daf4713f3f24d1c /src/server/scripts/Kalimdor
parent56f46e3ce543af8ffdc708eaa4ceecc173a5eb29 (diff)
Core/Scripts: Changed GetGUID/SetGUID script hooks to operate on ObjectGuid class
Fixed compile for boss scripts starting with letters B, C and D
Diffstat (limited to 'src/server/scripts/Kalimdor')
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp8
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp40
2 files changed, 22 insertions, 26 deletions
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp
index dc0429d94fd..d6640b5a0ab 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp
@@ -76,8 +76,8 @@ class boss_buru : public CreatureScript
{
BossAI::EnterEvadeMode();
- for (std::list<uint64>::iterator i = Eggs.begin(); i != Eggs.end(); ++i)
- if (Creature* egg = me->GetMap()->GetCreature(*Eggs.begin()))
+ for (ObjectGuid eggGuid : Eggs)
+ if (Creature* egg = me->GetMap()->GetCreature(eggGuid))
egg->Respawn();
Eggs.clear();
@@ -127,7 +127,7 @@ class boss_buru : public CreatureScript
}
}
- void ManageRespawn(uint64 EggGUID)
+ void ManageRespawn(ObjectGuid EggGUID)
{
ChaseNewVictim();
Eggs.push_back(EggGUID);
@@ -183,8 +183,8 @@ class boss_buru : public CreatureScript
DoMeleeAttackIfReady();
}
private:
+ GuidList Eggs;
uint8 _phase;
- std::list<uint64> Eggs;
};
CreatureAI* GetAI(Creature* creature) const override
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
index c9795133d14..218aa69304c 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
@@ -307,7 +307,7 @@ public:
me->SetReactState(REACT_PASSIVE);
//Remove any target
- me->SetTarget(0);
+ me->SetTarget(ObjectGuid::Empty);
//Select random target for dark beam to start on
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
@@ -384,7 +384,7 @@ public:
//Transition phase
case PHASE_CTHUN_TRANSITION:
//Remove any target
- me->SetTarget(0);
+ me->SetTarget(ObjectGuid::Empty);
me->SetHealth(0);
me->SetVisible(false);
break;
@@ -420,7 +420,7 @@ public:
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
//Remove Target field
- me->SetTarget(0);
+ me->SetTarget(ObjectGuid::Empty);
//Death animation/respawning;
instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_TRANSITION);
@@ -475,7 +475,7 @@ public:
PhaseTimer = 10000; //Emerge in 10 seconds
//No hold player for transition
- HoldPlayer = 0;
+ HoldPlayer.Clear();
//Body Phase
EyeTentacleTimer = 30000;
@@ -485,7 +485,7 @@ public:
StomachAcidTimer = 4000; //Every 4 seconds
StomachEnterTimer = 10000; //Every 10 seconds
StomachEnterVisTimer = 0; //Always 3.5 seconds after Stomach Enter Timer
- StomachEnterTarget = 0; //Target to be teleported to stomach
+ StomachEnterTarget.Clear(); //Target to be teleported to stomach
}
InstanceScript* instance;
@@ -499,7 +499,7 @@ public:
//-------------------
//Phase transition
- uint64 HoldPlayer;
+ ObjectGuid HoldPlayer;
//Body Phase
uint32 EyeTentacleTimer;
@@ -509,10 +509,10 @@ public:
uint32 StomachAcidTimer;
uint32 StomachEnterTimer;
uint32 StomachEnterVisTimer;
- uint64 StomachEnterTarget;
+ ObjectGuid StomachEnterTarget;
//Stomach map, bool = true then in stomach
- std::unordered_map<uint64, bool> Stomach_Map;
+ std::unordered_map<ObjectGuid, bool> Stomach_Map;
void Reset() override
{
@@ -548,7 +548,7 @@ public:
if (Stomach_Map.empty())
return NULL;
- std::unordered_map<uint64, bool>::const_iterator i = Stomach_Map.begin();
+ std::unordered_map<ObjectGuid, bool>::const_iterator i = Stomach_Map.begin();
std::list<Unit*> temp;
std::list<Unit*>::const_iterator j;
@@ -610,7 +610,7 @@ public:
return;
}
- me->SetTarget(0);
+ me->SetTarget(ObjectGuid::Empty);
uint32 currentPhase = instance->GetData(DATA_CTHUN_PHASE);
if (currentPhase == PHASE_CTHUN_STOMACH || currentPhase == PHASE_CTHUN_WEAK)
@@ -680,7 +680,7 @@ public:
//Body Phase
case PHASE_CTHUN_STOMACH:
//Remove Target field
- me->SetTarget(0);
+ me->SetTarget(ObjectGuid::Empty);
//Weaken
if (FleshTentaclesKilled > 1)
@@ -692,7 +692,7 @@ public:
DoCast(me, SPELL_PURPLE_COLORATION, true);
- std::unordered_map<uint64, bool>::iterator i = Stomach_Map.begin();
+ std::unordered_map<ObjectGuid, bool>::iterator i = Stomach_Map.begin();
//Kick all players out of stomach
while (i != Stomach_Map.end())
@@ -724,7 +724,7 @@ public:
if (StomachAcidTimer <= diff)
{
//Apply aura to all players in stomach
- std::unordered_map<uint64, bool>::iterator i = Stomach_Map.begin();
+ std::unordered_map<ObjectGuid, bool>::iterator i = Stomach_Map.begin();
while (i != Stomach_Map.end())
{
@@ -786,7 +786,7 @@ public:
DoTeleportPlayer(unit, STOMACH_X, STOMACH_Y, STOMACH_Z, STOMACH_O);
}
- StomachEnterTarget = 0;
+ StomachEnterTarget.Clear();
StomachEnterVisTimer = 0;
} else StomachEnterVisTimer -= diff;
}
@@ -913,7 +913,6 @@ public:
MindflayTimer = 500;
KillSelfTimer = 35000;
- Portal = 0;
if (Creature* pPortal = me->SummonCreature(NPC_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
@@ -925,7 +924,7 @@ public:
uint32 MindflayTimer;
uint32 KillSelfTimer;
- uint64 Portal;
+ ObjectGuid Portal;
void JustDied(Unit* /*killer*/) override
{
@@ -995,7 +994,6 @@ public:
SetCombatMovement(false);
- Portal = 0;
if (Creature* pPortal = me->SummonCreature(NPC_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
@@ -1006,7 +1004,7 @@ public:
uint32 GroundRuptureTimer;
uint32 HamstringTimer;
uint32 EvadeTimer;
- uint64 Portal;
+ ObjectGuid Portal;
void JustDied(Unit* /*killer*/) override
{
@@ -1111,7 +1109,6 @@ public:
SetCombatMovement(false);
- Portal = 0;
if (Creature* pPortal = me->SummonCreature(NPC_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
@@ -1123,7 +1120,7 @@ public:
uint32 ThrashTimer;
uint32 HamstringTimer;
uint32 EvadeTimer;
- uint64 Portal;
+ ObjectGuid Portal;
void JustDied(Unit* /*killer*/) override
{
@@ -1233,7 +1230,6 @@ public:
SetCombatMovement(false);
- Portal = 0;
if (Creature* pPortal = me->SummonCreature(NPC_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
@@ -1242,7 +1238,7 @@ public:
}
uint32 BeamTimer;
- uint64 Portal;
+ ObjectGuid Portal;
void JustDied(Unit* /*killer*/) override
{