aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/World
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2014-09-14 16:14:12 +0200
committerShauren <shauren.trinity@gmail.com>2014-09-14 16:14:12 +0200
commita0e50ea35fca61447bf07fc45d93c98234ba59f7 (patch)
treeb4ee69a63866f42e466a3c03fc031ce0710ac762 /src/server/scripts/World
parentce67a097bf3c0c3241f4441a808e32639ddbaafb (diff)
Core/Entities: Use ObjectGuid class in game project
Diffstat (limited to 'src/server/scripts/World')
-rw-r--r--src/server/scripts/World/action_ip_logger.cpp8
-rw-r--r--src/server/scripts/World/areatrigger_scripts.cpp8
-rw-r--r--src/server/scripts/World/boss_emerald_dragons.cpp6
-rw-r--r--src/server/scripts/World/guards.cpp12
-rw-r--r--src/server/scripts/World/npcs_special.cpp31
5 files changed, 32 insertions, 33 deletions
diff --git a/src/server/scripts/World/action_ip_logger.cpp b/src/server/scripts/World/action_ip_logger.cpp
index 057f3d6ee36..2977f4e974a 100644
--- a/src/server/scripts/World/action_ip_logger.cpp
+++ b/src/server/scripts/World/action_ip_logger.cpp
@@ -252,24 +252,24 @@ public:
CharacterDeleteActionIpLogger() : PlayerScript("CharacterDeleteActionIpLogger") { }
// CHARACTER_DELETE = 10
- void OnDelete(uint64 guid, uint32 accountId) override
+ void OnDelete(ObjectGuid guid, uint32 accountId) override
{
DeleteIPLogAction(guid, accountId, CHARACTER_DELETE);
}
// CHARACTER_FAILED_DELETE = 11
- void OnFailedDelete(uint64 guid, uint32 accountId) override
+ void OnFailedDelete(ObjectGuid guid, uint32 accountId) override
{
DeleteIPLogAction(guid, accountId, CHARACTER_FAILED_DELETE);
}
- void DeleteIPLogAction(uint64 guid, uint32 playerGuid, IPLoggingTypes aType)
+ void DeleteIPLogAction(ObjectGuid guid, uint32 playerGuid, IPLoggingTypes aType)
{
// Action IP Logger is only intialized if config is set up
// Else, this script isn't loaded in the first place: We require no config check.
// We declare all the required variables
- uint32 characterGuid = GUID_LOPART(guid); // We have no access to any member function of Player* or WorldSession*. So use old-fashioned way.
+ uint32 characterGuid = guid.GetCounter(); // We have no access to any member function of Player* or WorldSession*. So use old-fashioned way.
// Query playerGuid/accountId, as we only have characterGuid
std::string systemNote = "ERROR"; // "ERROR" is a placeholder here. We change it later.
diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp
index dcba4cf9573..a1e328ebaf0 100644
--- a/src/server/scripts/World/areatrigger_scripts.cpp
+++ b/src/server/scripts/World/areatrigger_scripts.cpp
@@ -431,8 +431,8 @@ class AreaTrigger_at_frostgrips_hollow : public AreaTriggerScript
public:
AreaTrigger_at_frostgrips_hollow() : AreaTriggerScript("at_frostgrips_hollow")
{
- stormforgedMonitorGUID = 0;
- stormforgedEradictorGUID = 0;
+ stormforgedMonitorGUID.Clear();
+ stormforgedEradictorGUID.Clear();
}
bool OnTrigger(Player* player, AreaTriggerEntry const* /* trigger */) override
@@ -469,8 +469,8 @@ public:
}
private:
- uint64 stormforgedMonitorGUID;
- uint64 stormforgedEradictorGUID;
+ ObjectGuid stormforgedMonitorGUID;
+ ObjectGuid stormforgedEradictorGUID;
};
void AddSC_areatrigger_scripts()
diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp
index a00c9465a05..01d36783d20 100644
--- a/src/server/scripts/World/boss_emerald_dragons.cpp
+++ b/src/server/scripts/World/boss_emerald_dragons.cpp
@@ -418,7 +418,7 @@ class npc_spirit_shade : public CreatureScript
struct npc_spirit_shadeAI : public PassiveAI
{
- npc_spirit_shadeAI(Creature* creature) : PassiveAI(creature), _summonerGuid(0)
+ npc_spirit_shadeAI(Creature* creature) : PassiveAI(creature), _summonerGuid()
{
}
@@ -430,7 +430,7 @@ class npc_spirit_shade : public CreatureScript
void MovementInform(uint32 moveType, uint32 data) override
{
- if (moveType == FOLLOW_MOTION_TYPE && data == _summonerGuid)
+ if (moveType == FOLLOW_MOTION_TYPE && data == _summonerGuid.GetCounter())
{
me->CastSpell((Unit*)NULL, SPELL_DARK_OFFERING, false);
me->DespawnOrUnsummon(1000);
@@ -438,7 +438,7 @@ class npc_spirit_shade : public CreatureScript
}
private:
- uint64 _summonerGuid;
+ ObjectGuid _summonerGuid;
};
CreatureAI* GetAI(Creature* creature) const override
diff --git a/src/server/scripts/World/guards.cpp b/src/server/scripts/World/guards.cpp
index bd953a285ab..13d811f3ff1 100644
--- a/src/server/scripts/World/guards.cpp
+++ b/src/server/scripts/World/guards.cpp
@@ -280,7 +280,7 @@ public:
{
banishTimer = 5000;
exileTimer = 8500;
- playerGUID = 0;
+ playerGUID.Clear();
canTeleport = false;
}
@@ -303,7 +303,7 @@ public:
temp->CastSpell(temp, SPELL_EXILE, true);
temp->CastSpell(temp, SPELL_BANISH_TELEPORT, true);
}
- playerGUID = 0;
+ playerGUID.Clear();
exileTimer = 8500;
canTeleport = false;
} else exileTimer -= diff;
@@ -327,7 +327,7 @@ public:
private:
uint32 exileTimer;
uint32 banishTimer;
- uint64 playerGUID;
+ ObjectGuid playerGUID;
bool canTeleport;
};
@@ -353,7 +353,7 @@ public:
{
banishTimer = 5000;
exileTimer = 8500;
- playerGUID = 0;
+ playerGUID.Clear();
canTeleport = false;
}
@@ -376,7 +376,7 @@ public:
temp->CastSpell(temp, SPELL_EXILE, true);
temp->CastSpell(temp, SPELL_BANISH_TELEPORT, true);
}
- playerGUID = 0;
+ playerGUID.Clear();
exileTimer = 8500;
canTeleport = false;
} else exileTimer -= diff;
@@ -399,7 +399,7 @@ public:
private:
uint32 exileTimer;
uint32 banishTimer;
- uint64 playerGUID;
+ ObjectGuid playerGUID;
bool canTeleport;
};
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index ff42743c496..fd5a101933f 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -124,7 +124,7 @@ public:
npc_air_force_botsAI(Creature* creature) : ScriptedAI(creature)
{
SpawnAssoc = NULL;
- SpawnedGUID = 0;
+ SpawnedGUID.Clear();
// find the correct spawnhandling
static uint32 entryCount = sizeof(spawnAssociations) / sizeof(SpawnAssociation);
@@ -154,7 +154,7 @@ public:
}
SpawnAssociation* SpawnAssoc;
- uint64 SpawnedGUID;
+ ObjectGuid SpawnedGUID;
void Reset() override { }
@@ -597,7 +597,7 @@ public:
void Initialize()
{
- PlayerGUID = 0;
+ PlayerGUID.Clear();
SummonPatientTimer = 10000;
SummonPatientCount = 0;
@@ -610,7 +610,7 @@ public:
Event = false;
}
- uint64 PlayerGUID;
+ ObjectGuid PlayerGUID;
uint32 SummonPatientTimer;
uint32 SummonPatientCount;
@@ -619,7 +619,7 @@ public:
bool Event;
- std::list<uint64> Patients;
+ GuidList Patients;
std::vector<Location*> Coordinates;
void Reset() override
@@ -690,10 +690,9 @@ public:
{
if (!Patients.empty())
{
- std::list<uint64>::const_iterator itr;
- for (itr = Patients.begin(); itr != Patients.end(); ++itr)
+ for (GuidList::const_iterator itr = Patients.begin(); itr != Patients.end(); ++itr)
{
- if (Creature* patient = ObjectAccessor::GetCreature((*me), *itr))
+ if (Creature* patient = ObjectAccessor::GetCreature(*me, *itr))
patient->setDeathState(JUST_DIED);
}
}
@@ -749,11 +748,11 @@ public:
void Initialize()
{
- DoctorGUID = 0;
+ DoctorGUID.Clear();
Coord = NULL;
}
- uint64 DoctorGUID;
+ ObjectGuid DoctorGUID;
Location* Coord;
void Reset() override
@@ -950,7 +949,7 @@ public:
Reset();
}
- uint64 CasterGUID;
+ ObjectGuid CasterGUID;
bool IsHealed;
bool CanRun;
@@ -959,7 +958,7 @@ public:
void Reset() override
{
- CasterGUID = 0;
+ CasterGUID.Clear();
IsHealed = false;
CanRun = false;
@@ -2262,7 +2261,7 @@ public:
void Initialize()
{
inLove = false;
- rabbitGUID = 0;
+ rabbitGUID.Clear();
jumpTimer = urand(5000, 10000);
bunnyTimer = urand(10000, 20000);
searchTimer = urand(5000, 10000);
@@ -2272,7 +2271,7 @@ public:
uint32 jumpTimer;
uint32 bunnyTimer;
uint32 searchTimer;
- uint64 rabbitGUID;
+ ObjectGuid rabbitGUID;
void Reset() override
{
@@ -2347,7 +2346,7 @@ public:
{
npc_imp_in_a_ballAI(Creature* creature) : ScriptedAI(creature)
{
- summonerGUID = 0;
+ summonerGUID.Clear();
}
void IsSummonedBy(Unit* summoner) override
@@ -2375,7 +2374,7 @@ public:
private:
EventMap events;
- uint64 summonerGUID;
+ ObjectGuid summonerGUID;
};
CreatureAI* GetAI(Creature* creature) const override