diff options
Diffstat (limited to 'src/server/scripts/World')
| -rw-r--r-- | src/server/scripts/World/action_ip_logger.cpp | 8 | ||||
| -rw-r--r-- | src/server/scripts/World/areatrigger_scripts.cpp | 8 | ||||
| -rw-r--r-- | src/server/scripts/World/boss_emerald_dragons.cpp | 6 | ||||
| -rw-r--r-- | src/server/scripts/World/go_scripts.cpp | 8 | ||||
| -rw-r--r-- | src/server/scripts/World/guards.cpp | 12 | ||||
| -rw-r--r-- | src/server/scripts/World/item_scripts.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/World/npcs_special.cpp | 41 |
7 files changed, 42 insertions, 43 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/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 1fdd314a9ed..65cb2c2abce 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -770,7 +770,7 @@ public: return false; pPrisoner->DisappearAndDie(); - player->KilledMonsterCredit(NPC_EBON_BLADE_PRISONER_HUMAN, 0); + player->KilledMonsterCredit(NPC_EBON_BLADE_PRISONER_HUMAN); switch (pPrisoner->GetEntry()) { case NPC_EBON_BLADE_PRISONER_HUMAN: @@ -917,7 +917,7 @@ public: if (qInfo) { /// @todo prisoner should help player for a short period of time - player->KilledMonsterCredit(qInfo->RequiredNpcOrGo[0], 0); + player->KilledMonsterCredit(qInfo->RequiredNpcOrGo[0]); pPrisoner->DisappearAndDie(); } return true; @@ -949,7 +949,7 @@ public: if (pTadpole) { pTadpole->DisappearAndDie(); - player->KilledMonsterCredit(NPC_WINTERFIN_TADPOLE, 0); + player->KilledMonsterCredit(NPC_WINTERFIN_TADPOLE); //FIX: Summon minion tadpole } } @@ -1083,7 +1083,7 @@ class go_gjalerbron_cage : public GameObjectScript { if (Creature* prisoner = go->FindNearestCreature(NPC_GJALERBRON_PRISONER, 5.0f)) { - player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, 0); + player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER); prisoner->AI()->Talk(SAY_FREE); prisoner->DespawnOrUnsummon(6000); 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/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index 45886fd4361..f9cd44ca88c 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -349,7 +349,7 @@ public: { pMammoth->AI()->DoAction(1); pTrap->SetGoState(GO_STATE_READY); - player->KilledMonsterCredit(NPC_TRAPPED_MAMMOTH_CALF, 0); + player->KilledMonsterCredit(NPC_TRAPPED_MAMMOTH_CALF); return true; } } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index d04b25147c7..e733f5581f9 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 { } @@ -196,11 +196,11 @@ public: if (!playerTarget) return; - Creature* lastSpawnedGuard = SpawnedGUID == 0 ? NULL : GetSummonedGuard(); + Creature* lastSpawnedGuard = SpawnedGUID.IsEmpty() ? NULL : GetSummonedGuard(); // prevent calling Unit::GetUnit at next MoveInLineOfSight call - speedup if (!lastSpawnedGuard) - SpawnedGUID = 0; + SpawnedGUID.Clear(); switch (SpawnAssoc->spawnType) { @@ -591,7 +591,7 @@ public: void Initialize() { - PlayerGUID = 0; + PlayerGUID.Clear(); SummonPatientTimer = 10000; SummonPatientCount = 0; @@ -604,7 +604,7 @@ public: Event = false; } - uint64 PlayerGUID; + ObjectGuid PlayerGUID; uint32 SummonPatientTimer; uint32 SummonPatientCount; @@ -613,7 +613,7 @@ public: bool Event; - std::list<uint64> Patients; + GuidList Patients; std::vector<Location*> Coordinates; void Reset() override @@ -684,10 +684,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); } } @@ -743,11 +742,11 @@ public: void Initialize() { - DoctorGUID = 0; + DoctorGUID.Clear(); Coord = NULL; } - uint64 DoctorGUID; + ObjectGuid DoctorGUID; Location* Coord; void Reset() override @@ -944,7 +943,7 @@ public: Reset(); } - uint64 CasterGUID; + ObjectGuid CasterGUID; bool IsHealed; bool CanRun; @@ -953,7 +952,7 @@ public: void Reset() override { - CasterGUID = 0; + CasterGUID.Clear(); IsHealed = false; CanRun = false; @@ -1101,7 +1100,7 @@ public: break; } - Start(false, true, true); + Start(false, true); } else EnterEvadeMode(); //something went wrong @@ -1473,7 +1472,7 @@ public: } EventMap _events; - std::unordered_map<uint64, time_t> _damageTimes; + std::unordered_map<ObjectGuid, time_t> _damageTimes; void Reset() override { @@ -1520,7 +1519,7 @@ public: case EVENT_TD_CHECK_COMBAT: { time_t now = time(NULL); - for (std::unordered_map<uint64, time_t>::iterator itr = _damageTimes.begin(); itr != _damageTimes.end();) + for (std::unordered_map<ObjectGuid, time_t>::iterator itr = _damageTimes.begin(); itr != _damageTimes.end();) { // If unit has not dealt damage to training dummy for 5 seconds, remove him from combat if (itr->second < now - 5) @@ -2256,7 +2255,7 @@ public: void Initialize() { inLove = false; - rabbitGUID = 0; + rabbitGUID.Clear(); jumpTimer = urand(5000, 10000); bunnyTimer = urand(10000, 20000); searchTimer = urand(5000, 10000); @@ -2266,7 +2265,7 @@ public: uint32 jumpTimer; uint32 bunnyTimer; uint32 searchTimer; - uint64 rabbitGUID; + ObjectGuid rabbitGUID; void Reset() override { @@ -2341,7 +2340,7 @@ public: { npc_imp_in_a_ballAI(Creature* creature) : ScriptedAI(creature) { - summonerGUID = 0; + summonerGUID.Clear(); } void IsSummonedBy(Unit* summoner) override @@ -2369,7 +2368,7 @@ public: private: EventMap events; - uint64 summonerGUID; + ObjectGuid summonerGUID; }; CreatureAI* GetAI(Creature* creature) const override |
