diff options
Diffstat (limited to 'src/server/scripts')
37 files changed, 64 insertions, 61 deletions
diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index c8961d4fad8..ed211673917 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -211,7 +211,7 @@ public: return; } - if (sObjectMgr->GetPlayerGUIDByName(delInfo.name)) + if (!sObjectMgr->GetPlayerGUIDByName(delInfo.name).IsEmpty()) { handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.guid.GetCounter(), delInfo.accountId); return; @@ -990,7 +990,7 @@ public: return false; } - switch (PlayerDumpWriter().WriteDump(fileStr, uint32(guid))) + switch (PlayerDumpWriter().WriteDump(fileStr, uint32(guid.GetCounter()))) { case DUMP_SUCCESS: handler->PSendSysMessage(LANG_COMMAND_EXPORT_SUCCESS); diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 862b683597a..b9207444f82 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -182,7 +182,7 @@ public: return false; } - if (handler->GetSession()->GetPlayer()->GetTarget()) + if (!handler->GetSession()->GetPlayer()->GetTarget().IsEmpty()) unit->PlayDistanceSound(soundId, handler->GetSession()->GetPlayer()); else unit->PlayDirectSound(soundId, handler->GetSession()->GetPlayer()); @@ -390,15 +390,15 @@ public: ifs.close(); return false; } - data << uint64(obj->GetGUID()); + data << obj->GetGUID(); } else if (type == "myguid") { - data << uint64(player->GetGUID()); + data << player->GetGUID(); } else if (type == "itsguid") { - data << uint64(unit->GetGUID()); + data << unit->GetGUID(); } else if (type == "itspos") { diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index c8168a1391a..f1c955f4b69 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -371,7 +371,7 @@ public: } ObjectGuid ownerGuid = object->GetOwnerGUID(); - if (ownerGuid) + if (!ownerGuid.IsEmpty()) { Unit* owner = ObjectAccessor::GetUnit(*handler->GetSession()->GetPlayer(), ownerGuid); if (!owner || !ownerGuid.IsPlayer()) diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 055f0aa8914..9b156612eae 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -138,7 +138,7 @@ public: if (*args) { ObjectGuid guid = handler->extractGuidFromLink((char*)args); - if (guid) + if (!guid.IsEmpty()) object = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT); if (!object) @@ -709,7 +709,7 @@ public: if (*args) { ObjectGuid guid = handler->extractGuidFromLink((char*)args); - if (guid) + if (!guid.IsEmpty()) obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); if (!obj) @@ -1766,7 +1766,7 @@ public: Player* player = handler->GetSession()->GetPlayer(); // accept only explicitly selected target (not implicitly self targeting case) - Creature* target = player->GetTarget() ? handler->getSelectedCreature() : nullptr; + Creature* target = !player->GetTarget().IsEmpty() ? handler->getSelectedCreature() : nullptr; if (target) { if (target->IsPet()) @@ -2519,7 +2519,7 @@ public: WorldPacket data(SMSG_PLAY_SOUND, 4 + 8); data << uint32(soundId); - data << uint64(handler->GetSession()->GetPlayer()->GetGUID()); + data << handler->GetSession()->GetPlayer()->GetGUID(); sWorld->SendGlobalMessage(&data); handler->PSendSysMessage(LANG_COMMAND_PLAYED_TO_ALL, soundId); diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 85bc6db46f5..0bfcc1b823f 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -1396,7 +1396,7 @@ public: Player* player = handler->GetSession()->GetPlayer(); - if (player->GetPetGUID()) + if (!player->GetPetGUID().IsEmpty()) { handler->SendSysMessage (LANG_YOU_ALREADY_HAVE_PET); handler->SetSentErrorMessage (true); diff --git a/src/server/scripts/Commands/cs_pet.cpp b/src/server/scripts/Commands/cs_pet.cpp index bb5e0764f2f..d36214d1898 100644 --- a/src/server/scripts/Commands/cs_pet.cpp +++ b/src/server/scripts/Commands/cs_pet.cpp @@ -65,7 +65,7 @@ public: return false; } - if (player->GetPetGUID()) + if (!player->GetPetGUID().IsEmpty()) { handler->PSendSysMessage("You already have a pet"); handler->SetSentErrorMessage(true); diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index 2823c2c8c5d..1b2fc2c0509 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -242,7 +242,7 @@ public: target->SendTalentsInfoData(true); return true; } - else if (targetGuid) + else if (!targetGuid.IsEmpty()) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); stmt->setUInt16(0, uint16(AT_LOGIN_NONE | AT_LOGIN_RESET_PET_TALENTS)); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp index 08b773bc61a..857ae04d41b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp @@ -233,7 +233,7 @@ public: { MobDeath_Timer = 2500; - if (RingBossGUID) + if (!RingBossGUID.IsEmpty()) { Creature* boss = ObjectAccessor::GetCreature(*me, RingBossGUID); if (boss && !boss->IsAlive() && boss->isDead()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp index 46cdd5edc7d..a8b373531a1 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp @@ -342,7 +342,7 @@ public: void TombOfSevenEvent() { - if (GhostKillCount < 7 && TombBossGUIDs[TombEventCounter]) + if (GhostKillCount < 7 && !TombBossGUIDs[TombEventCounter].IsEmpty()) { if (Creature* boss = instance->GetCreature(TombBossGUIDs[TombEventCounter])) { @@ -399,7 +399,7 @@ public: } void Update(uint32 diff) override { - if (TombEventStarterGUID && GhostKillCount < 7) + if (!TombEventStarterGUID.IsEmpty() && GhostKillCount < 7) { if (TombTimer <= diff) { @@ -419,7 +419,7 @@ public: } } else TombTimer -= diff; } - if (GhostKillCount >= 7 && TombEventStarterGUID) + if (GhostKillCount >= 7 && !TombEventStarterGUID.IsEmpty()) TombOfSevenEnd(); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/instance_molten_core.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/instance_molten_core.cpp index 7de89b41b7f..d87fd69cbf4 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/instance_molten_core.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/instance_molten_core.cpp @@ -135,7 +135,7 @@ class instance_molten_core : public InstanceMapScript void SummonMajordomoExecutus() { _executusSchedule = false; - if (_majordomoExecutusGUID) + if (!_majordomoExecutusGUID.IsEmpty()) return; if (GetBossState(BOSS_MAJORDOMO_EXECUTUS) != DONE) diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp index d4e32d8e908..177f35329be 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp @@ -195,8 +195,8 @@ class instance_deadmines : public InstanceMapScript switch (type) { case EVENT_STATE: - if (DefiasCannonGUID && IronCladDoorGUID) - State=data; + if (!DefiasCannonGUID.IsEmpty() && !IronCladDoorGUID.IsEmpty()) + State = data; break; case EVENT_RHAHKZOR: if (data == DONE) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp index be6d07571cf..e18aa3cd91c 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp @@ -410,7 +410,7 @@ public: if (!PortalGUID[1]) DoCastVictim(SPELL_FIENDISH_PORTAL_1, false); - if (PortalGUID[0] && PortalGUID[1]) + if (!PortalGUID[0].IsEmpty() && !PortalGUID[1].IsEmpty()) { if (Creature* pPortal = ObjectAccessor::GetCreature(*me, PortalGUID[urand(0, 1)])) pPortal->CastSpell(me->GetVictim(), SPELL_SUMMON_FIENDISIMP, false); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index c01affd3012..7249480108f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -324,9 +324,12 @@ public: bool OnGossipHello(Player* player, GameObject* go) override { if (Creature* anchor = go->FindNearestCreature(29521, 15)) - if (ObjectGuid prisonerGUID = anchor->AI()->GetGUID()) + { + ObjectGuid prisonerGUID = anchor->AI()->GetGUID(); + if (!prisonerGUID.IsEmpty()) if (Creature* prisoner = ObjectAccessor::GetCreature(*player, prisonerGUID)) ENSURE_AI(npc_unworthy_initiate::npc_unworthy_initiateAI, prisoner->AI())->EventStart(anchor, player); + } return false; } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index fe433a6692d..873ca94c033 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -708,7 +708,7 @@ public: void MoveInLineOfSight(Unit* who) override { - if (PlayerGUID || who->GetTypeId() != TYPEID_PLAYER || !who->IsWithinDist(me, INTERACTION_DISTANCE)) + if (!PlayerGUID.IsEmpty() || who->GetTypeId() != TYPEID_PLAYER || !who->IsWithinDist(me, INTERACTION_DISTANCE)) return; if (MeetQuestCondition(who->ToPlayer())) @@ -717,7 +717,7 @@ public: void UpdateAI(uint32 diff) override { - if (PlayerGUID && !me->GetVictim() && me->IsAlive()) + if (!PlayerGUID.IsEmpty() && !me->GetVictim() && me->IsAlive()) { if (ExecuteSpeech_Timer <= diff) { diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 58165df48ef..15d33256fb6 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -441,7 +441,7 @@ public: { Initialize(); DoCast(me, SPELL_HEAD); - if (headGUID) + if (!headGUID.IsEmpty()) { if (Creature* Head = ObjectAccessor::GetCreature((*me), headGUID)) Head->DespawnOrUnsummon(); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index f88c9c6159e..3a751f1769e 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -625,7 +625,7 @@ public: me->setActive(true); KalecgosGUID = instance->GetGuidData(DATA_KALECGOS_DRAGON); instance->SetBossState(DATA_KALECGOS, NOT_STARTED); - if (KalecGUID) + if (!KalecGUID.IsEmpty()) { if (Creature* Kalec = ObjectAccessor::GetCreature(*me, KalecGUID)) Kalec->setDeathState(JUST_DIED); diff --git a/src/server/scripts/Events/childrens_week.cpp b/src/server/scripts/Events/childrens_week.cpp index 6e95b9351fd..37dd666cce0 100644 --- a/src/server/scripts/Events/childrens_week.cpp +++ b/src/server/scripts/Events/childrens_week.cpp @@ -960,7 +960,7 @@ class at_bring_your_orphan_to : public AreaTriggerScript break; } - if (questId && orphanId && getOrphanGUID(player, orphanId) && player->GetQuestStatus(questId) == QUEST_STATUS_INCOMPLETE) + if (questId && orphanId && !getOrphanGUID(player, orphanId).IsEmpty() && player->GetQuestStatus(questId) == QUEST_STATUS_INCOMPLETE) player->AreaExploredOrEventHappens(questId); return true; @@ -1021,7 +1021,7 @@ class npc_cw_area_trigger : public CreatureScript orphanId = ORPHAN_BLOOD_ELF; break; case NPC_SILVERMOON_01_CW_TRIGGER: - if (player->GetQuestStatus(QUEST_NOW_WHEN_I_GROW_UP) == QUEST_STATUS_INCOMPLETE && getOrphanGUID(player, ORPHAN_BLOOD_ELF)) + if (player->GetQuestStatus(QUEST_NOW_WHEN_I_GROW_UP) == QUEST_STATUS_INCOMPLETE && !getOrphanGUID(player, ORPHAN_BLOOD_ELF).IsEmpty()) { player->AreaExploredOrEventHappens(QUEST_NOW_WHEN_I_GROW_UP); if (player->GetQuestStatus(QUEST_NOW_WHEN_I_GROW_UP) == QUEST_STATUS_COMPLETE) @@ -1051,7 +1051,7 @@ class npc_cw_area_trigger : public CreatureScript } break; } - if (questId && orphanId && getOrphanGUID(player, orphanId) && player->GetQuestStatus(questId) == QUEST_STATUS_INCOMPLETE) + if (questId && orphanId && !getOrphanGUID(player, orphanId).IsEmpty() && player->GetQuestStatus(questId) == QUEST_STATUS_INCOMPLETE) player->AreaExploredOrEventHappens(questId); } } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index a4745eade7d..700f1b75acc 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -949,7 +949,7 @@ void hyjalAI::WaypointReached(uint32 waypointId) TeleportTimer = 20000; if (me->GetEntry() == JAINA) DoCast(me, SPELL_MASS_TELEPORT, false); - if (me->GetEntry() == THRALL && DummyGuid) + if (me->GetEntry() == THRALL && !DummyGuid.IsEmpty()) { if (Creature* creature = ObjectAccessor::GetCreature(*me, DummyGuid)) { diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index 218aa69304c..dfb9941c501 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -774,7 +774,7 @@ public: StomachEnterTimer = 13800; } else StomachEnterTimer -= diff; - if (StomachEnterVisTimer && StomachEnterTarget) + if (StomachEnterVisTimer && !StomachEnterTarget.IsEmpty()) { if (StomachEnterVisTimer <= diff) { diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp index 7b20e5dd8a9..db4d0eec7b2 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp @@ -133,7 +133,7 @@ public: { aqsentinelAI* cai = ENSURE_AI(aqsentinelAI, (c)->AI()); for (int32 i = 0; i < 3; ++i) - if (NearbyGUID[i] && NearbyGUID[i] != c->GetGUID()) + if (!NearbyGUID[i].IsEmpty() && NearbyGUID[i] != c->GetGUID()) cai->AddBuddyToList(NearbyGUID[i]); cai->AddBuddyToList(me->GetGUID()); } diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp index c2b0d864b79..d34867f32b8 100644 --- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp +++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp @@ -451,7 +451,7 @@ public: if (WaveTimer <= diff) { - if (Wave < 6 && AffrayChallenger[Wave] && !EventBigWill) + if (Wave < 6 && !AffrayChallenger[Wave].IsEmpty() && !EventBigWill) { Talk(SAY_TWIGGY_FLATHEAD_FRAY); Creature* creature = ObjectAccessor::GetCreature(*me, AffrayChallenger[Wave]); @@ -479,7 +479,7 @@ public: WaveTimer = 1000; } } - else if (Wave >= 6 && EventBigWill && BigWill) + else if (Wave >= 6 && EventBigWill && !BigWill.IsEmpty()) { Creature* creature = ObjectAccessor::GetCreature(*me, BigWill); if (!creature || !creature->IsAlive()) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp index 316c3e6ca4d..b03321642b6 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -394,7 +394,7 @@ public: } }else uiPhaseTimer -= uiDiff; - if (!UpdateVictim() || me->m_movementInfo.transport.guid) + if (!UpdateVictim() || !me->m_movementInfo.transport.guid.IsEmpty()) return; if (uiInterceptTimer <= uiDiff) @@ -542,7 +542,7 @@ public: uiFireBallTimer = 5000; } else uiFireBallTimer -= uiDiff; - if (!UpdateVictim() || me->m_movementInfo.transport.guid) + if (!UpdateVictim() || !me->m_movementInfo.transport.guid.IsEmpty()) return; if (uiFireBallTimer <= uiDiff) @@ -684,7 +684,7 @@ public: } }else uiPhaseTimer -= uiDiff; - if (!UpdateVictim() || me->m_movementInfo.transport.guid) + if (!UpdateVictim() || !me->m_movementInfo.transport.guid.IsEmpty()) return; if (uiChainLightningTimer <= uiDiff) @@ -834,7 +834,7 @@ public: } }else uiPhaseTimer -= uiDiff; - if (!UpdateVictim() || me->m_movementInfo.transport.guid) + if (!UpdateVictim() || !me->m_movementInfo.transport.guid.IsEmpty()) return; if (uiLightningArrowsTimer <= uiDiff) @@ -986,7 +986,7 @@ public: } } else uiPhaseTimer -= uiDiff; - if (!UpdateVictim() || me->m_movementInfo.transport.guid) + if (!UpdateVictim() || !me->m_movementInfo.transport.guid.IsEmpty()) return; if (uiEviscerateTimer <= uiDiff) diff --git a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp index c9ea3a26f4d..4abcd6ead46 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp @@ -225,7 +225,7 @@ class boss_gal_darah : public CreatureScript } private: - std::set<uint64> impaledPlayers; + GuidSet impaledPlayers; uint8 _phaseCounter; }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index 640c06b1c28..da952dc31c3 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -1162,7 +1162,7 @@ class npc_ball_of_flame : public CreatureScript void MovementInform(uint32 type, uint32 id) override { - if (type == CHASE_MOTION_TYPE && id == _chaseGUID.GetCounter() && _chaseGUID) + if (type == CHASE_MOTION_TYPE && id == _chaseGUID.GetCounter() && !_chaseGUID.IsEmpty()) { me->RemoveAurasDueToSpell(SPELL_BALL_OF_FLAMES_PERIODIC); DoCast(me, SPELL_FLAMES); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index 8a325dee7b4..6053ff295a9 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -396,7 +396,7 @@ class boss_blood_queen_lana_thel : public CreatureScript break; } case EVENT_DELIRIOUS_SLASH: - if (_offtankGUID && !me->HasByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER)) + if (!_offtankGUID.IsEmpty() && !me->HasByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER)) if (Player* _offtank = ObjectAccessor::GetPlayer(*me, _offtankGUID)) DoCast(_offtank, SPELL_DELIRIOUS_SLASH); events.ScheduleEvent(EVENT_DELIRIOUS_SLASH, urand(20000, 24000), EVENT_GROUP_NORMAL); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp index aa284f1aaee..fc376a5439f 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp @@ -172,14 +172,14 @@ public: void SetGUID(ObjectGuid guid, int32 /*param*/) override { victimGUID = guid; - if (me->m_spells[0] && victimGUID) + if (me->m_spells[0] && !victimGUID.IsEmpty()) if (Unit* victim = ObjectAccessor::GetUnit(*me, victimGUID)) victim->CastSpell(victim, me->m_spells[0], true, NULL, NULL, me->GetGUID()); } void JustDied(Unit* /*killer*/) override { - if (me->m_spells[0] && victimGUID) + if (me->m_spells[0] && !victimGUID.IsEmpty()) if (Unit* victim = ObjectAccessor::GetUnit(*me, victimGUID)) victim->RemoveAurasDueToSpell(me->m_spells[0], me->GetGUID()); } diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index b9fa6617855..813e51ad23c 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -2041,7 +2041,7 @@ class spell_scion_of_eternity_arcane_barrage : public SpellScriptLoader // in longer terms this means if spell picks target X then 2nd cast of this spell will pick smth else // and if 3rd picks X again 4th will pick smth else (by not limiting the cast to certain caster). if (targets.size() > 1) - if (malygos && malygos->AI()->GetGUID(DATA_LAST_TARGET_BARRAGE_GUID)) + if (malygos && !malygos->AI()->GetGUID(DATA_LAST_TARGET_BARRAGE_GUID).IsEmpty()) targets.remove_if(Trinity::ObjectGUIDCheck(malygos->AI()->GetGUID(DATA_LAST_TARGET_BARRAGE_GUID))); // Remove players not on Hover Disk from second list diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index 2032c7b861d..67c68be502e 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -700,8 +700,8 @@ class npc_boombot : public CreatureScript _boomed = true; // Prevent recursive calls WorldPacket data(SMSG_SPELLINSTAKILLLOG, 8+8+4); - data << uint64(me->GetGUID()); - data << uint64(me->GetGUID()); + data << me->GetGUID(); + data << me->GetGUID(); data << uint32(SPELL_BOOM); me->SendMessageToSet(&data, false); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index 4f40abde5b6..a1ac2c8dfbf 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -995,7 +995,7 @@ class instance_ulduar : public InstanceMapScript data << GetData(DATA_COLOSSUS) << ' ' << _algalonTimer << ' ' << uint32(_algalonSummoned ? 1 : 0); for (uint8 i = 0; i < 4; ++i) - data << ' ' << uint32(KeeperGUIDs[i] ? 1 : 0); + data << ' ' << uint32(!KeeperGUIDs[i].IsEmpty() ? 1 : 0); } void ReadSaveDataMore(std::istringstream& data) override diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index 131222b5f8f..830f9624ae0 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -803,7 +803,7 @@ public: void UpdateAI(uint32 /*diff*/) override { - if (WithRedDragonBlood && HarpoonerGUID && !me->HasAura(SPELL_RED_DRAGONBLOOD)) + if (WithRedDragonBlood && !HarpoonerGUID.IsEmpty() && !me->HasAura(SPELL_RED_DRAGONBLOOD)) { if (Player* pHarpooner = ObjectAccessor::GetPlayer(*me, HarpoonerGUID)) { diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp index 89012b56b82..32325df7809 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp @@ -277,7 +277,7 @@ void OPvPCapturePointZM_GraveYard::SetBeaconState(uint32 controlling_faction) if (m_GraveYardState & ZM_GRAVEYARD_N) { // gy was neutral, thus neutral banner was spawned, it is possible that someone was taking the flag to the gy - if (m_FlagCarrierGUID) + if (!m_FlagCarrierGUID.IsEmpty()) { // remove flag from carrier, reset flag carrier guid Player* p = ObjectAccessor::FindPlayer(m_FlagCarrierGUID); @@ -318,7 +318,7 @@ bool OPvPCapturePointZM_GraveYard::HandleGossipOption(Player* player, ObjectGuid if (!cr) return true; // if the flag is already taken, then return - if (m_FlagCarrierGUID) + if (!m_FlagCarrierGUID.IsEmpty()) return true; if (itr->second == ZM_ALLIANCE_FIELD_SCOUT) { diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp index 94b75727d69..00d52727798 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp @@ -756,7 +756,7 @@ public: if (!leotherasGUID) leotherasGUID = instance->GetGuidData(DATA_LEOTHERAS); - if (!me->IsInCombat() && instance->GetGuidData(DATA_LEOTHERAS_EVENT_STARTER)) + if (!me->IsInCombat() && !instance->GetGuidData(DATA_LEOTHERAS_EVENT_STARTER).IsEmpty()) { Unit* victim = NULL; victim = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_LEOTHERAS_EVENT_STARTER)); diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp index fbebe897477..c4acdf2ded3 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp @@ -99,7 +99,7 @@ class npc_warp_splinter_treant : public CreatureScript { if (!UpdateVictim() || !me->GetVictim()) { - if (WarpGuid && check_Timer <= diff) + if (!WarpGuid.IsEmpty() && check_Timer <= diff) { if (Unit* Warp = ObjectAccessor::GetUnit(*me, WarpGuid)) { diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp index e6f32a07538..0952fc04512 100644 --- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp @@ -994,7 +994,7 @@ public: if (ConversationTimer <= diff) { - if (Event && PlayerGUID) + if (Event && !PlayerGUID.IsEmpty()) ConversationTimer = NextStep(++Step); } else ConversationTimer -= diff; } diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 892853b600f..f8ef7862c35 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -947,10 +947,10 @@ class spell_hun_tame_beast : public SpellScriptLoader if (!target->GetCreatureTemplate()->IsTameable(caster->ToPlayer()->CanTameExoticPets())) return SPELL_FAILED_BAD_TARGETS; - if (caster->GetPetGUID()) + if (!caster->GetPetGUID().IsEmpty()) return SPELL_FAILED_ALREADY_HAVE_SUMMON; - if (caster->GetCharmGUID()) + if (!caster->GetCharmGUID().IsEmpty()) return SPELL_FAILED_ALREADY_HAVE_CHARM; } else diff --git a/src/server/scripts/World/guards.cpp b/src/server/scripts/World/guards.cpp index 13d811f3ff1..ac0c50aa7dd 100644 --- a/src/server/scripts/World/guards.cpp +++ b/src/server/scripts/World/guards.cpp @@ -316,7 +316,7 @@ public: DoCast(temp, SPELL_BANISHED_SHATTRATH_A); banishTimer = 9000; playerGUID = temp->GetGUID(); - if (playerGUID) + if (!playerGUID.IsEmpty()) canTeleport = true; } } else banishTimer -= diff; @@ -389,7 +389,7 @@ public: DoCast(temp, SPELL_BANISHED_SHATTRATH_S); banishTimer = 9000; playerGUID = temp->GetGUID(); - if (playerGUID) + if (!playerGUID.IsEmpty()) canTeleport = true; } } else banishTimer -= diff; diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index e733f5581f9..f7c09fa21b9 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -790,7 +790,7 @@ public: return; if (player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE) - if (DoctorGUID) + if (!DoctorGUID.IsEmpty()) if (Creature* doctor = ObjectAccessor::GetCreature(*me, DoctorGUID)) ENSURE_AI(npc_doctor::npc_doctorAI, doctor->AI())->PatientSaved(me, player, Coord); @@ -836,7 +836,7 @@ public: me->setDeathState(JUST_DIED); me->SetFlag(UNIT_DYNAMIC_FLAGS, 32); - if (DoctorGUID) + if (!DoctorGUID.IsEmpty()) if (Creature* doctor = ObjectAccessor::GetCreature((*me), DoctorGUID)) ENSURE_AI(npc_doctor::npc_doctorAI, doctor->AI())->PatientDied(Coord); } |
