Core/Entities: Use ObjectGuid class in game project

This commit is contained in:
Shauren committed 2014-09-14 16:14:12 +02:00
1 parent ce67a097bf
commit a0e50ea35f
256 files changed
+3334 -3833

No files matched your search

@@ -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.
@@ -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()
@@ -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
+6 -6
View File
@@ -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;
};
+15 -16
View File
@@ -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