diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp index 7de9d133e..ed5eecbca 100644 --- a/src/game/BattleGround.cpp +++ b/src/game/BattleGround.cpp @@ -64,13 +64,13 @@ namespace MaNGOS private: void do_helper(WorldPacket& data, char const* text) { - uint64 target_guid = i_source ? i_source ->GetGUID() : 0; + ObjectGuid targetGuid = i_source ? i_source ->GetObjectGuid() : ObjectGuid(); data << uint8(i_msgtype); data << uint32(LANG_UNIVERSAL); - data << uint64(target_guid); // there 0 for BG messages + data << ObjectGuid(targetGuid); // there 0 for BG messages data << uint32(0); // can be chat msg group or something - data << uint64(target_guid); + data << ObjectGuid(targetGuid); data << uint32(strlen(text)+1); data << text; data << uint8(i_source ? i_source->chatTag() : uint8(0)); @@ -110,16 +110,16 @@ namespace MaNGOS void do_helper(WorldPacket& data, char const* text) { //copyied from BuildMonsterChat - data << (uint8)CHAT_MSG_MONSTER_YELL; - data << (uint32)i_language; - data << (uint64)i_source->GetGUID(); - data << (uint32)0; //2.1.0 - data << (uint32)(strlen(i_source->GetName())+1); + data << uint8(CHAT_MSG_MONSTER_YELL); + data << uint32(i_language); + data << ObjectGuid(i_source->GetObjectGuid()); + data << uint32(0); // 2.1.0 + data << uint32(strlen(i_source->GetName())+1); data << i_source->GetName(); - data << (uint64)0; //Unit Target - isn't important for bgs - data << (uint32)strlen(text)+1; + data << ObjectGuid(); // Unit Target - isn't important for bgs + data << uint32(strlen(text)+1); data << text; - data << (uint8)0; // ChatTag - for bgs allways 0? + data << uint8(0); // ChatTag - for bgs allways 0? } uint32 i_language; @@ -143,13 +143,13 @@ namespace MaNGOS char str [2048]; snprintf(str,2048,text, arg1str, arg2str ); - uint64 target_guid = i_source ? i_source ->GetGUID() : 0; + ObjectGuid targetGuid = i_source ? i_source ->GetObjectGuid() : ObjectGuid(); data << uint8(i_msgtype); data << uint32(LANG_UNIVERSAL); - data << uint64(target_guid); // there 0 for BG messages + data << ObjectGuid(targetGuid); // there 0 for BG messages data << uint32(0); // can be chat msg group or something - data << uint64(target_guid); + data << ObjectGuid(targetGuid); data << uint32(strlen(str)+1); data << str; data << uint8(i_source ? i_source->chatTag() : uint8(0)); @@ -175,18 +175,18 @@ namespace MaNGOS char const* arg2str = i_arg2 ? sObjectMgr.GetMangosString(i_arg2,loc_idx) : ""; char str [2048]; - snprintf(str,2048,text, arg1str, arg2str ); + snprintf(str, 2048, text, arg1str, arg2str); //copyied from BuildMonsterChat - data << (uint8)CHAT_MSG_MONSTER_YELL; - data << (uint32)i_language; - data << (uint64)i_source->GetGUID(); - data << (uint32)0; //2.1.0 - data << (uint32)(strlen(i_source->GetName())+1); + data << uint8(CHAT_MSG_MONSTER_YELL); + data << uint32(i_language); + data << ObjectGuid(i_source->GetObjectGuid()); + data << uint32(0); // 2.1.0 + data << uint32(strlen(i_source->GetName())+1); data << i_source->GetName(); - data << (uint64)0; //Unit Target - isn't important for bgs - data << (uint32)strlen(str)+1; + data << uint64(0); // Unit Target - isn't important for bgs + data << uint32(strlen(str)+1); data << str; - data << (uint8)0; // ChatTag - for bgs allways 0? + data << uint8(0); // ChatTag - for bgs allways 0? } private: diff --git a/src/game/BattleGroundHandler.cpp b/src/game/BattleGroundHandler.cpp index 8b3c34c94..db8e88636 100644 --- a/src/game/BattleGroundHandler.cpp +++ b/src/game/BattleGroundHandler.cpp @@ -249,15 +249,15 @@ void WorldSession::HandleBattleGroundPlayerPositionsOpcode( WorldPacket & /*recv data << count2; // horde flag holders count - obsolete, now count of next fields if (ali_plr) { - data << (uint64)ali_plr->GetGUID(); - data << (float)ali_plr->GetPositionX(); - data << (float)ali_plr->GetPositionY(); + data << ObjectGuid(ali_plr->GetObjectGuid()); + data << float(ali_plr->GetPositionX()); + data << float(ali_plr->GetPositionY()); } if (horde_plr) { - data << (uint64)horde_plr->GetGUID(); - data << (float)horde_plr->GetPositionX(); - data << (float)horde_plr->GetPositionY(); + data << ObjectGuid(horde_plr->GetObjectGuid()); + data << float(horde_plr->GetPositionX()); + data << float(horde_plr->GetPositionY()); } SendPacket(&data); diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index 30026df8a..f58b04c36 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -484,7 +484,7 @@ bool BattleGroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, BattleGround * b BGQueueInviteEvent* inviteEvent = new BGQueueInviteEvent(plr->GetObjectGuid(), ginfo->IsInvitedToBGInstanceGUID, bgTypeId, ginfo->arenaType, ginfo->RemoveInviteTime); plr->m_Events.AddEvent(inviteEvent, plr->m_Events.CalculateTime(INVITATION_REMIND_TIME)); // create automatic remove events - BGQueueRemoveEvent* removeEvent = new BGQueueRemoveEvent(plr->GetGUID(), ginfo->IsInvitedToBGInstanceGUID, bgTypeId, bgQueueTypeId, ginfo->RemoveInviteTime); + BGQueueRemoveEvent* removeEvent = new BGQueueRemoveEvent(plr->GetObjectGuid(), ginfo->IsInvitedToBGInstanceGUID, bgTypeId, bgQueueTypeId, ginfo->RemoveInviteTime); plr->m_Events.AddEvent(removeEvent, plr->m_Events.CalculateTime(INVITE_ACCEPT_WAIT_TIME)); WorldPacket data; diff --git a/src/game/BattleGroundMgr.h b/src/game/BattleGroundMgr.h index 632941c1d..703656f67 100644 --- a/src/game/BattleGroundMgr.h +++ b/src/game/BattleGroundMgr.h @@ -168,8 +168,8 @@ class BGQueueInviteEvent : public BasicEvent class BGQueueRemoveEvent : public BasicEvent { public: - BGQueueRemoveEvent(const uint64& pl_guid, uint32 bgInstanceGUID, BattleGroundTypeId BgTypeId, BattleGroundQueueTypeId bgQueueTypeId, uint32 removeTime) - : m_PlayerGuid(pl_guid), m_BgInstanceGUID(bgInstanceGUID), m_RemoveTime(removeTime), m_BgTypeId(BgTypeId), m_BgQueueTypeId(bgQueueTypeId) + BGQueueRemoveEvent(ObjectGuid plGuid, uint32 bgInstanceGUID, BattleGroundTypeId BgTypeId, BattleGroundQueueTypeId bgQueueTypeId, uint32 removeTime) + : m_PlayerGuid(plGuid), m_BgInstanceGUID(bgInstanceGUID), m_RemoveTime(removeTime), m_BgTypeId(BgTypeId), m_BgQueueTypeId(bgQueueTypeId) {} virtual ~BGQueueRemoveEvent() {} @@ -177,7 +177,7 @@ class BGQueueRemoveEvent : public BasicEvent virtual bool Execute(uint64 e_time, uint32 p_time); virtual void Abort(uint64 e_time); private: - uint64 m_PlayerGuid; + ObjectGuid m_PlayerGuid; uint32 m_BgInstanceGUID; uint32 m_RemoveTime; BattleGroundTypeId m_BgTypeId; diff --git a/src/game/BattleGroundWS.cpp b/src/game/BattleGroundWS.cpp index eff3c3d8b..47e842b99 100644 --- a/src/game/BattleGroundWS.cpp +++ b/src/game/BattleGroundWS.cpp @@ -357,7 +357,7 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target type = CHAT_MSG_BG_SYSTEM_HORDE; PlaySoundToAll(BG_WS_SOUND_ALLIANCE_FLAG_PICKED_UP); SpawnEvent(WS_EVENT_FLAG_A, 0, false); - SetAllianceFlagPicker(Source->GetGUID()); + SetAllianceFlagPicker(Source->GetObjectGuid()); m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_PLAYER; //update world state to show correct flag carrier UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER); @@ -373,7 +373,7 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target type = CHAT_MSG_BG_SYSTEM_ALLIANCE; PlaySoundToAll(BG_WS_SOUND_HORDE_FLAG_PICKED_UP); SpawnEvent(WS_EVENT_FLAG_H, 0, false); - SetHordeFlagPicker(Source->GetGUID()); + SetHordeFlagPicker(Source->GetObjectGuid()); m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_PLAYER; //update world state to show correct flag carrier UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER); @@ -399,7 +399,7 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target type = CHAT_MSG_BG_SYSTEM_HORDE; PlaySoundToAll(BG_WS_SOUND_ALLIANCE_FLAG_PICKED_UP); SpawnEvent(WS_EVENT_FLAG_A, 0, false); - SetAllianceFlagPicker(Source->GetGUID()); + SetAllianceFlagPicker(Source->GetObjectGuid()); Source->CastSpell(Source, BG_WS_SPELL_SILVERWING_FLAG, true); m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_PLAYER; UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER); @@ -427,7 +427,7 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target type = CHAT_MSG_BG_SYSTEM_ALLIANCE; PlaySoundToAll(BG_WS_SOUND_HORDE_FLAG_PICKED_UP); SpawnEvent(WS_EVENT_FLAG_H, 0, false); - SetHordeFlagPicker(Source->GetGUID()); + SetHordeFlagPicker(Source->GetObjectGuid()); Source->CastSpell(Source, BG_WS_SPELL_WARSONG_FLAG, true); m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_PLAYER; UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER); diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index 685735a35..4bee5f944 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -1993,7 +1993,7 @@ valid examples: } //Note: target_guid used only in CHAT_MSG_WHISPER_INFORM mode (in this case channelName ignored) -void ChatHandler::FillMessageData( WorldPacket *data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit *speaker) +void ChatHandler::FillMessageData( WorldPacket *data, WorldSession* session, uint8 type, uint32 language, const char *channelName, ObjectGuid targetGuid, const char *message, Unit *speaker) { uint32 messageLength = (message ? strlen(message) : 0) + 1; @@ -2022,7 +2022,7 @@ void ChatHandler::FillMessageData( WorldPacket *data, WorldSession* session, uin case CHAT_MSG_BG_SYSTEM_HORDE: case CHAT_MSG_BATTLEGROUND: case CHAT_MSG_BATTLEGROUND_LEADER: - target_guid = session ? session->GetPlayer()->GetGUID() : 0; + targetGuid = session ? session->GetPlayer()->GetObjectGuid() : ObjectGuid(); break; case CHAT_MSG_MONSTER_SAY: case CHAT_MSG_MONSTER_PARTY: @@ -2033,7 +2033,7 @@ void ChatHandler::FillMessageData( WorldPacket *data, WorldSession* session, uin case CHAT_MSG_RAID_BOSS_EMOTE: case CHAT_MSG_BATTLENET: { - *data << speaker->GetObjectGuid(); + *data << ObjectGuid(speaker->GetObjectGuid()); *data << uint32(0); // 2.1.0 *data << uint32(strlen(speaker->GetName()) + 1); *data << speaker->GetName(); @@ -2051,11 +2051,11 @@ void ChatHandler::FillMessageData( WorldPacket *data, WorldSession* session, uin } default: if (type != CHAT_MSG_WHISPER_INFORM && type != CHAT_MSG_IGNORED && type != CHAT_MSG_DND && type != CHAT_MSG_AFK) - target_guid = 0; // only for CHAT_MSG_WHISPER_INFORM used original value target_guid + targetGuid.Clear(); // only for CHAT_MSG_WHISPER_INFORM used original value target_guid break; } - *data << uint64(target_guid); // there 0 for BG messages + *data << ObjectGuid(targetGuid); // there 0 for BG messages *data << uint32(0); // can be chat msg group or something if (type == CHAT_MSG_CHANNEL) @@ -2064,7 +2064,7 @@ void ChatHandler::FillMessageData( WorldPacket *data, WorldSession* session, uin *data << channelName; } - *data << uint64(target_guid); + *data << ObjectGuid(targetGuid); *data << uint32(messageLength); *data << message; if(session != 0 && type != CHAT_MSG_WHISPER_INFORM && type != CHAT_MSG_DND && type != CHAT_MSG_AFK) diff --git a/src/game/Chat.h b/src/game/Chat.h index 5591607ef..64030a938 100644 --- a/src/game/Chat.h +++ b/src/game/Chat.h @@ -69,16 +69,21 @@ class ChatHandler explicit ChatHandler(Player* player); ~ChatHandler(); - static void FillMessageData( WorldPacket *data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit *speaker); + static void FillMessageData( WorldPacket *data, WorldSession* session, uint8 type, uint32 language, const char *channelName, ObjectGuid targetGuid, const char *message, Unit *speaker); - void FillMessageData( WorldPacket *data, uint8 type, uint32 language, uint64 target_guid, const char* message) + static void FillMessageData( WorldPacket *data, WorldSession* session, uint8 type, uint32 language, ObjectGuid targetGuid, const char* message) { - FillMessageData( data, m_session, type, language, NULL, target_guid, message, NULL); + FillMessageData( data, session, type, language, NULL, targetGuid, message, NULL); + } + + static void FillMessageData( WorldPacket *data, WorldSession* session, uint8 type, uint32 language, const char* message) + { + FillMessageData( data, session, type, language, NULL, ObjectGuid(), message, NULL); } void FillSystemMessageData( WorldPacket *data, const char* message ) { - FillMessageData( data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, 0, message ); + FillMessageData( data, m_session, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, ObjectGuid(), message ); } static char* LineFromMessage(char*& pos) { char* start = strtok(pos,"\n"); pos = NULL; return start; } diff --git a/src/game/ChatHandler.cpp b/src/game/ChatHandler.cpp index 19e7eabc5..f28a94026 100644 --- a/src/game/ChatHandler.cpp +++ b/src/game/ChatHandler.cpp @@ -257,7 +257,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) return; WorldPacket data; - ChatHandler::FillMessageData(&data, this, type, lang, NULL, 0, msg.c_str(), NULL); + ChatHandler::FillMessageData(&data, this, type, lang, msg.c_str()); group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetObjectGuid())); } break; @@ -332,7 +332,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) } WorldPacket data; - ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID, lang, "", 0, msg.c_str(), NULL); + ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID, lang, msg.c_str()); group->BroadcastPacket(&data, false); } break; case CHAT_MSG_RAID_LEADER: @@ -362,7 +362,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) } WorldPacket data; - ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_LEADER, lang, "", 0, msg.c_str(), NULL); + ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_LEADER, lang, msg.c_str()); group->BroadcastPacket(&data, false); } break; @@ -384,7 +384,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) WorldPacket data; //in battleground, raid warning is sent only to players in battleground - code is ok - ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_WARNING, lang, "", 0, msg.c_str(), NULL); + ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_WARNING, lang, msg.c_str()); group->BroadcastPacket(&data, false); } break; @@ -405,7 +405,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) return; WorldPacket data; - ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND, lang, "", 0, msg.c_str(), NULL); + ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND, lang, msg.c_str()); group->BroadcastPacket(&data, false); } break; @@ -426,7 +426,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) return; WorldPacket data; - ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND_LEADER, lang, "", 0, msg.c_str(), NULL); + ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND_LEADER, lang, msg.c_str()); group->BroadcastPacket(&data, false); } break; @@ -520,14 +520,14 @@ namespace MaNGOS uint32 namlen = (nam ? strlen(nam) : 0) + 1; data.Initialize(SMSG_TEXT_EMOTE, (20+namlen)); - data << i_player.GetGUID(); - data << (uint32)i_text_emote; - data << i_emote_num; - data << (uint32)namlen; - if( namlen > 1 ) + data << ObjectGuid(i_player.GetObjectGuid()); + data << uint32(i_text_emote); + data << uint32(i_emote_num); + data << uint32(namlen); + if (namlen > 1) data.append(nam, namlen); else - data << (uint8)0x00; + data << uint8(0x00); } private: @@ -609,7 +609,7 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data ) return; WorldPacket data; - ChatHandler::FillMessageData(&data, this, CHAT_MSG_IGNORED, LANG_UNIVERSAL, NULL, GetPlayer()->GetGUID(), GetPlayer()->GetName(), NULL); + ChatHandler::FillMessageData(&data, this, CHAT_MSG_IGNORED, LANG_UNIVERSAL, NULL, GetPlayer()->GetObjectGuid(), GetPlayer()->GetName(), NULL); player->GetSession()->SendPacket(&data); } diff --git a/src/game/Corpse.cpp b/src/game/Corpse.cpp index e92bf9820..e1a7d8524 100644 --- a/src/game/Corpse.cpp +++ b/src/game/Corpse.cpp @@ -126,7 +126,7 @@ void Corpse::SaveToDB() void Corpse::DeleteBonesFromWorld() { MANGOS_ASSERT(GetType() == CORPSE_BONES); - Corpse* corpse = GetMap()->GetCorpse(GetGUID()); + Corpse* corpse = GetMap()->GetCorpse(GetObjectGuid()); if (!corpse) { diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 9e079583c..f48538b74 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -815,15 +815,15 @@ bool Creature::IsTrainerOf(Player* pPlayer, bool msg) const pPlayer->PlayerTalkClass->ClearMenus(); switch(GetCreatureInfo()->trainer_class) { - case CLASS_DRUID: pPlayer->PlayerTalkClass->SendGossipMenu( 4913,GetGUID()); break; - case CLASS_HUNTER: pPlayer->PlayerTalkClass->SendGossipMenu(10090,GetGUID()); break; - case CLASS_MAGE: pPlayer->PlayerTalkClass->SendGossipMenu( 328,GetGUID()); break; - case CLASS_PALADIN:pPlayer->PlayerTalkClass->SendGossipMenu( 1635,GetGUID()); break; - case CLASS_PRIEST: pPlayer->PlayerTalkClass->SendGossipMenu( 4436,GetGUID()); break; - case CLASS_ROGUE: pPlayer->PlayerTalkClass->SendGossipMenu( 4797,GetGUID()); break; - case CLASS_SHAMAN: pPlayer->PlayerTalkClass->SendGossipMenu( 5003,GetGUID()); break; - case CLASS_WARLOCK:pPlayer->PlayerTalkClass->SendGossipMenu( 5836,GetGUID()); break; - case CLASS_WARRIOR:pPlayer->PlayerTalkClass->SendGossipMenu( 4985,GetGUID()); break; + case CLASS_DRUID: pPlayer->PlayerTalkClass->SendGossipMenu( 4913, GetObjectGuid()); break; + case CLASS_HUNTER: pPlayer->PlayerTalkClass->SendGossipMenu(10090, GetObjectGuid()); break; + case CLASS_MAGE: pPlayer->PlayerTalkClass->SendGossipMenu( 328, GetObjectGuid()); break; + case CLASS_PALADIN:pPlayer->PlayerTalkClass->SendGossipMenu( 1635, GetObjectGuid()); break; + case CLASS_PRIEST: pPlayer->PlayerTalkClass->SendGossipMenu( 4436, GetObjectGuid()); break; + case CLASS_ROGUE: pPlayer->PlayerTalkClass->SendGossipMenu( 4797, GetObjectGuid()); break; + case CLASS_SHAMAN: pPlayer->PlayerTalkClass->SendGossipMenu( 5003, GetObjectGuid()); break; + case CLASS_WARLOCK:pPlayer->PlayerTalkClass->SendGossipMenu( 5836, GetObjectGuid()); break; + case CLASS_WARRIOR:pPlayer->PlayerTalkClass->SendGossipMenu( 4985, GetObjectGuid()); break; } } return false; @@ -835,7 +835,7 @@ bool Creature::IsTrainerOf(Player* pPlayer, bool msg) const if (msg) { pPlayer->PlayerTalkClass->ClearMenus(); - pPlayer->PlayerTalkClass->SendGossipMenu(3620, GetGUID()); + pPlayer->PlayerTalkClass->SendGossipMenu(3620, GetObjectGuid()); } return false; } @@ -855,16 +855,16 @@ bool Creature::IsTrainerOf(Player* pPlayer, bool msg) const pPlayer->PlayerTalkClass->ClearMenus(); switch(GetCreatureInfo()->trainer_class) { - case RACE_DWARF: pPlayer->PlayerTalkClass->SendGossipMenu(5865,GetGUID()); break; - case RACE_GNOME: pPlayer->PlayerTalkClass->SendGossipMenu(4881,GetGUID()); break; - case RACE_HUMAN: pPlayer->PlayerTalkClass->SendGossipMenu(5861,GetGUID()); break; - case RACE_NIGHTELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862,GetGUID()); break; - case RACE_ORC: pPlayer->PlayerTalkClass->SendGossipMenu(5863,GetGUID()); break; - case RACE_TAUREN: pPlayer->PlayerTalkClass->SendGossipMenu(5864,GetGUID()); break; - case RACE_TROLL: pPlayer->PlayerTalkClass->SendGossipMenu(5816,GetGUID()); break; - case RACE_UNDEAD: pPlayer->PlayerTalkClass->SendGossipMenu( 624,GetGUID()); break; - case RACE_BLOODELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862,GetGUID()); break; - case RACE_DRAENEI: pPlayer->PlayerTalkClass->SendGossipMenu(5864,GetGUID()); break; + case RACE_DWARF: pPlayer->PlayerTalkClass->SendGossipMenu(5865, GetObjectGuid()); break; + case RACE_GNOME: pPlayer->PlayerTalkClass->SendGossipMenu(4881, GetObjectGuid()); break; + case RACE_HUMAN: pPlayer->PlayerTalkClass->SendGossipMenu(5861, GetObjectGuid()); break; + case RACE_NIGHTELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862, GetObjectGuid()); break; + case RACE_ORC: pPlayer->PlayerTalkClass->SendGossipMenu(5863, GetObjectGuid()); break; + case RACE_TAUREN: pPlayer->PlayerTalkClass->SendGossipMenu(5864, GetObjectGuid()); break; + case RACE_TROLL: pPlayer->PlayerTalkClass->SendGossipMenu(5816, GetObjectGuid()); break; + case RACE_UNDEAD: pPlayer->PlayerTalkClass->SendGossipMenu( 624, GetObjectGuid()); break; + case RACE_BLOODELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862, GetObjectGuid()); break; + case RACE_DRAENEI: pPlayer->PlayerTalkClass->SendGossipMenu(5864, GetObjectGuid()); break; } } return false; @@ -876,7 +876,7 @@ bool Creature::IsTrainerOf(Player* pPlayer, bool msg) const if (msg) { pPlayer->PlayerTalkClass->ClearMenus(); - pPlayer->PlayerTalkClass->SendGossipMenu(11031, GetGUID()); + pPlayer->PlayerTalkClass->SendGossipMenu(11031, GetObjectGuid()); } return false; } @@ -904,9 +904,9 @@ bool Creature::CanInteractWithBattleMaster(Player* pPlayer, bool msg) const pPlayer->PlayerTalkClass->ClearMenus(); switch(bgTypeId) { - case BATTLEGROUND_AV: pPlayer->PlayerTalkClass->SendGossipMenu(7616, GetGUID()); break; - case BATTLEGROUND_WS: pPlayer->PlayerTalkClass->SendGossipMenu(7599, GetGUID()); break; - case BATTLEGROUND_AB: pPlayer->PlayerTalkClass->SendGossipMenu(7642, GetGUID()); break; + case BATTLEGROUND_AV: pPlayer->PlayerTalkClass->SendGossipMenu(7616, GetObjectGuid()); break; + case BATTLEGROUND_WS: pPlayer->PlayerTalkClass->SendGossipMenu(7599, GetObjectGuid()); break; + case BATTLEGROUND_AB: pPlayer->PlayerTalkClass->SendGossipMenu(7642, GetObjectGuid()); break; case BATTLEGROUND_EY: case BATTLEGROUND_NA: case BATTLEGROUND_BE: @@ -914,7 +914,7 @@ bool Creature::CanInteractWithBattleMaster(Player* pPlayer, bool msg) const case BATTLEGROUND_RL: case BATTLEGROUND_SA: case BATTLEGROUND_DS: - case BATTLEGROUND_RV: pPlayer->PlayerTalkClass->SendGossipMenu(10024, GetGUID()); break; + case BATTLEGROUND_RV: pPlayer->PlayerTalkClass->SendGossipMenu(10024, GetObjectGuid()); break; default: break; } return false; @@ -2412,7 +2412,8 @@ void Creature::SendAreaSpiritHealerQueryOpcode(Player *pl) if (Spell* pcurSpell = GetCurrentSpell(CURRENT_CHANNELED_SPELL)) next_resurrect = pcurSpell->GetCastedTime(); WorldPacket data(SMSG_AREA_SPIRIT_HEALER_TIME, 8 + 4); - data << GetGUID() << next_resurrect; + data << ObjectGuid(GetObjectGuid()); + data << uint32(next_resurrect); pl->SendDirectMessage(&data); } diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp index 2cfc7bea8..681399569 100644 --- a/src/game/CreatureEventAI.cpp +++ b/src/game/CreatureEventAI.cpp @@ -773,7 +773,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 return; } - pInst->SetData64(action.set_inst_data64.field, target->GetGUID()); + pInst->SetData64(action.set_inst_data64.field, target->GetObjectGuid().GetRawValue()); break; } case ACTION_T_UPDATE_TEMPLATE: diff --git a/src/game/DynamicObject.cpp b/src/game/DynamicObject.cpp index 9a2a2e703..e8701a377 100644 --- a/src/game/DynamicObject.cpp +++ b/src/game/DynamicObject.cpp @@ -141,14 +141,14 @@ void DynamicObject::Update(uint32 update_diff, uint32 p_time) if(deleteThis) { - caster->RemoveDynObjectWithGUID(GetGUID()); + caster->RemoveDynObjectWithGUID(GetObjectGuid()); Delete(); } } void DynamicObject::Delete() { - SendObjectDeSpawnAnim(GetGUID()); + SendObjectDeSpawnAnim(GetObjectGuid()); AddObjectToRemoveList(); } diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 0ac2218c9..95fcf22c5 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -199,7 +199,7 @@ void GameObject::Update(uint32 update_diff, uint32 /*p_time*/) udata.BuildPacket(&packet); ((Player*)caster)->GetSession()->SendPacket(&packet); - SendGameObjectCustomAnim(GetGUID()); + SendGameObjectCustomAnim(GetObjectGuid()); } m_lootState = GO_READY; // can be successfully open with some chance @@ -316,7 +316,7 @@ void GameObject::Update(uint32 update_diff, uint32 /*p_time*/) { Unit *caster = owner ? owner : ok; - caster->CastSpell(ok, goInfo->trap.spellId, true, NULL, NULL, GetGUID()); + caster->CastSpell(ok, goInfo->trap.spellId, true, NULL, NULL, GetObjectGuid()); // use template cooldown if provided m_cooldownTime = time(NULL) + (goInfo->trap.cooldown ? goInfo->trap.cooldown : uint32(4)); @@ -329,7 +329,7 @@ void GameObject::Update(uint32 update_diff, uint32 /*p_time*/) //BattleGround gameobjects case if (((Player*)ok)->InBattleGround()) if (BattleGround *bg = ((Player*)ok)->GetBattleGround()) - bg->HandleTriggerBuff(GetGUID()); + bg->HandleTriggerBuff(GetObjectGuid()); } } } @@ -380,7 +380,7 @@ void GameObject::Update(uint32 update_diff, uint32 /*p_time*/) for (GuidsSet::const_iterator itr = m_UniqueUsers.begin(); itr != m_UniqueUsers.end(); ++itr) { if (Player* owner = GetMap()->GetPlayer(*itr)) - owner->CastSpell(owner, spellId, false, NULL, NULL, GetGUID()); + owner->CastSpell(owner, spellId, false, NULL, NULL, GetObjectGuid()); } ClearAllUsesData(); @@ -404,7 +404,7 @@ void GameObject::Update(uint32 update_diff, uint32 /*p_time*/) // burning flags in some battlegrounds, if you find better condition, just add it if (GetGOInfo()->IsDespawnAtAction() || GetGoAnimProgress() > 0) { - SendObjectDeSpawnAnim(GetGUID()); + SendObjectDeSpawnAnim(GetObjectGuid()); //reset flags SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags); } @@ -458,7 +458,7 @@ void GameObject::AddUniqueUse(Player* player) void GameObject::Delete() { - SendObjectDeSpawnAnim(GetGUID()); + SendObjectDeSpawnAnim(GetObjectGuid()); SetGoState(GO_STATE_READY); SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags); @@ -1098,7 +1098,7 @@ void GameObject::Use(Unit* user) if (info->goober.pageId) // show page... { WorldPacket data(SMSG_GAMEOBJECT_PAGETEXT, 8); - data << GetGUID(); + data << ObjectGuid(GetObjectGuid()); player->GetSession()->SendPacket(&data); } else if (info->goober.gossipID) // ...or gossip, if page does not exist @@ -1139,7 +1139,7 @@ void GameObject::Use(Unit* user) // this appear to be ok, however others exist in addition to this that should have custom (ex: 190510, 188692, 187389) if (time_to_restore && info->goober.customAnim) - SendGameObjectCustomAnim(GetGUID()); + SendGameObjectCustomAnim(GetObjectGuid()); else SetGoState(GO_STATE_ACTIVE); diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp index fd67ce12b..21afc9782 100644 --- a/src/game/GossipDef.cpp +++ b/src/game/GossipDef.cpp @@ -149,10 +149,10 @@ bool PlayerMenu::GossipOptionCoded( unsigned int Selection ) return mGossipMenu.MenuItemCoded( Selection ); } -void PlayerMenu::SendGossipMenu(uint32 TitleTextId, uint64 objectGUID) +void PlayerMenu::SendGossipMenu(uint32 TitleTextId, ObjectGuid objectGuid) { WorldPacket data(SMSG_GOSSIP_MESSAGE, (100)); // guess size - data << uint64(objectGUID); + data << ObjectGuid(objectGuid); data << uint32(mGossipMenu.GetMenuId()); // new 2.4.0 data << uint32(TitleTextId); data << uint32(mGossipMenu.MenuItemCount()); // max count 0x20 @@ -160,17 +160,17 @@ void PlayerMenu::SendGossipMenu(uint32 TitleTextId, uint64 objectGUID) for (uint32 iI = 0; iI < mGossipMenu.MenuItemCount(); ++iI ) { GossipMenuItem const& gItem = mGossipMenu.GetItem(iI); - data << uint32( iI ); - data << uint8( gItem.m_gIcon ); - data << uint8( gItem.m_gCoded ); // makes pop up box password + data << uint32(iI); + data << uint8(gItem.m_gIcon); + data << uint8(gItem.m_gCoded); // makes pop up box password data << uint32(gItem.m_gBoxMoney); // money required to open menu, 2.0.3 data << gItem.m_gMessage; // text for gossip item, max 0x800 data << gItem.m_gBoxMessage; // accept text (related to money) pop up box, 2.0.3, max 0x800 } - data << uint32( mQuestMenu.MenuItemCount() ); // max count 0x20 + data << uint32(mQuestMenu.MenuItemCount()); // max count 0x20 - for (uint32 iI = 0; iI < mQuestMenu.MenuItemCount(); ++iI ) + for (uint32 iI = 0; iI < mQuestMenu.MenuItemCount(); ++iI) { QuestMenuItem const& qItem = mQuestMenu.GetItem(iI); uint32 questID = qItem.m_qId; diff --git a/src/game/GossipDef.h b/src/game/GossipDef.h index 42cbbefef..9e46bb23a 100644 --- a/src/game/GossipDef.h +++ b/src/game/GossipDef.h @@ -264,7 +264,7 @@ class MANGOS_DLL_SPEC PlayerMenu uint32 GossipOptionAction( unsigned int Selection ); bool GossipOptionCoded( unsigned int Selection ); - void SendGossipMenu( uint32 TitleTextId, uint64 npcGUID ); + void SendGossipMenu(uint32 titleTextId, ObjectGuid objectGuid); void CloseGossip(); void SendPointOfInterest( float X, float Y, uint32 Icon, uint32 Flags, uint32 Data, const char * locName ); void SendPointOfInterest( uint32 poi_id ); diff --git a/src/game/GridNotifiers.cpp b/src/game/GridNotifiers.cpp index 021cbd27e..acc7c36c9 100644 --- a/src/game/GridNotifiers.cpp +++ b/src/game/GridNotifiers.cpp @@ -47,12 +47,12 @@ VisibleNotifier::Notify() { for(Transport::PlayerSet::const_iterator itr = transport->GetPassengers().begin();itr!=transport->GetPassengers().end();++itr) { - if (i_clientGUIDs.find((*itr)->GetGUID()) != i_clientGUIDs.end()) + if (i_clientGUIDs.find((*itr)->GetObjectGuid()) != i_clientGUIDs.end()) { // ignore far sight case (*itr)->UpdateVisibilityOf(*itr, &player); player.UpdateVisibilityOf(&player, *itr, i_data, i_visibleNow); - i_clientGUIDs.erase((*itr)->GetGUID()); + i_clientGUIDs.erase((*itr)->GetObjectGuid()); } } } diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h index 4ddac7a3c..59b4dcd58 100644 --- a/src/game/GridNotifiersImpl.h +++ b/src/game/GridNotifiersImpl.h @@ -34,7 +34,7 @@ inline void MaNGOS::VisibleNotifier::Visit(GridRefManager &m) for(typename GridRefManager::iterator iter = m.begin(); iter != m.end(); ++iter) { i_camera.UpdateVisibilityOf(iter->getSource(), i_data, i_visibleNow); - i_clientGUIDs.erase(iter->getSource()->GetGUID()); + i_clientGUIDs.erase(iter->getSource()->GetObjectGuid()); } } diff --git a/src/game/Group.cpp b/src/game/Group.cpp index fbd57e530..d983d1cb4 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -750,7 +750,7 @@ void Group::StartLootRool(Creature* lootTarget, LootMethod method, Loot* loot, u LootItem const& lootItem = loot->items[itemSlot]; - Roll* r = new Roll(lootTarget->GetGUID(), method, lootItem); + Roll* r = new Roll(lootTarget->GetObjectGuid(), method, lootItem); //a vector is filled with only near party members for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) diff --git a/src/game/GroupHandler.cpp b/src/game/GroupHandler.cpp index add6d596e..33cad559b 100644 --- a/src/game/GroupHandler.cpp +++ b/src/game/GroupHandler.cpp @@ -622,7 +622,7 @@ void WorldSession::HandleRaidReadyCheckOpcode( WorldPacket & recv_data ) // everything is fine, do it WorldPacket data(MSG_RAID_READY_CHECK, 8); - data << GetPlayer()->GetGUID(); + data << ObjectGuid(GetPlayer()->GetObjectGuid()); group->BroadcastPacket(&data, false, -1); group->OfflineReadyCheck(); diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp index 26491d062..38c789cc5 100644 --- a/src/game/Guild.cpp +++ b/src/game/Guild.cpp @@ -554,7 +554,7 @@ void Guild::BroadcastToGuild(WorldSession *session, const std::string& msg, uint if (session && session->GetPlayer() && HasRankRight(session->GetPlayer()->GetRank(),GR_RIGHT_GCHATSPEAK)) { WorldPacket data; - ChatHandler(session).FillMessageData(&data, CHAT_MSG_GUILD, language, 0, msg.c_str()); + ChatHandler::FillMessageData(&data, session, CHAT_MSG_GUILD, language, msg.c_str()); for (MemberList::const_iterator itr = members.begin(); itr != members.end(); ++itr) { @@ -573,7 +573,7 @@ void Guild::BroadcastToOfficers(WorldSession *session, const std::string& msg, u for(MemberList::const_iterator itr = members.begin(); itr != members.end(); ++itr) { WorldPacket data; - ChatHandler::FillMessageData(&data, session, CHAT_MSG_OFFICER, language, NULL, 0, msg.c_str(), NULL); + ChatHandler::FillMessageData(&data, session, CHAT_MSG_OFFICER, language, msg.c_str()); Player *pl = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, itr->first)); diff --git a/src/game/GuildHandler.cpp b/src/game/GuildHandler.cpp index 174015b36..72b27243a 100644 --- a/src/game/GuildHandler.cpp +++ b/src/game/GuildHandler.cpp @@ -383,7 +383,7 @@ void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/) // Put record into guild log guild->LogGuildEvent(GUILD_EVENT_LOG_LEAVE_GUILD, _player->GetObjectGuid()); - guild->BroadcastEvent(GE_LEFT, _player->GetGUID(), _player->GetName()); + guild->BroadcastEvent(GE_LEFT, _player->GetObjectGuid(), _player->GetName()); SendGuildCommandResult(GUILD_QUIT_S, guild->GetName(), ERR_PLAYER_NO_MORE_IN_GUILD); } diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp index 5c17e6cfa..14db968e7 100644 --- a/src/game/ItemHandler.cpp +++ b/src/game/ItemHandler.cpp @@ -466,7 +466,7 @@ void WorldSession::HandleReadItemOpcode( WorldPacket & recv_data ) DETAIL_LOG("STORAGE: Unable to read item"); _player->SendEquipError( msg, pItem, NULL ); } - data << pItem->GetGUID(); + data << ObjectGuid(pItem->GetObjectGuid()); SendPacket(&data); } else diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index 0e850ced8..e677e80f8 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -3498,7 +3498,7 @@ bool ChatHandler::HandleWpShowCommand(char* args) // (0.001) - There is no other way to compare C++ floats with mySQL floats // See also: http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html const char* maxDIFF = "0.01"; - PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetGUID()); + PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetObjectGuid().GetRawValue()); result = WorldDatabase.PQuery("SELECT id, point, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5, model1, model2 FROM creature_movement WHERE (abs(position_x - %f) <= %s ) and (abs(position_y - %f) <= %s ) and (abs(position_z - %f) <= %s )", target->GetPositionX(), maxDIFF, target->GetPositionY(), maxDIFF, target->GetPositionZ(), maxDIFF); diff --git a/src/game/Map.cpp b/src/game/Map.cpp index d35f23055..a39022bda 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -999,7 +999,7 @@ void Map::RemoveAllObjectsInRemoveList() case TYPEID_CORPSE: { // ??? WTF - Corpse* corpse = GetCorpse(obj->GetGUID()); + Corpse* corpse = GetCorpse(obj->GetObjectGuid()); if (!corpse) sLog.outError("Try delete corpse/bones %u that not in map", obj->GetGUIDLow()); else diff --git a/src/game/Object.cpp b/src/game/Object.cpp index a2523be28..d3d96f998 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -213,7 +213,7 @@ void Object::BuildValuesUpdateBlockForPlayer(UpdateData *data, Player *target) c void Object::BuildOutOfRangeUpdateBlock(UpdateData * data) const { - data->AddOutOfRangeGUID(GetGUID()); + data->AddOutOfRangeGUID(GetObjectGuid()); } void Object::DestroyForPlayer( Player *target, bool anim ) const @@ -1605,17 +1605,17 @@ void WorldObject::SendMessageToSetExcept(WorldPacket *data, Player const* skippe } } -void WorldObject::SendObjectDeSpawnAnim(uint64 guid) +void WorldObject::SendObjectDeSpawnAnim(ObjectGuid guid) { WorldPacket data(SMSG_GAMEOBJECT_DESPAWN_ANIM, 8); - data << uint64(guid); + data << ObjectGuid(guid); SendMessageToSet(&data, true); } -void WorldObject::SendGameObjectCustomAnim(uint64 guid) +void WorldObject::SendGameObjectCustomAnim(ObjectGuid guid) { WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM, 8+4); - data << uint64(guid); + data << ObjectGuid(guid); data << uint32(0); // not known what this is SendMessageToSet(&data, true); } diff --git a/src/game/Object.h b/src/game/Object.h index a2f583bf5..4559fedfd 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -546,8 +546,8 @@ class MANGOS_DLL_SPEC WorldObject : public Object void PlayDistanceSound(uint32 sound_id, Player* target = NULL); void PlayDirectSound(uint32 sound_id, Player* target = NULL); - void SendObjectDeSpawnAnim(uint64 guid); - void SendGameObjectCustomAnim(uint64 guid); + void SendObjectDeSpawnAnim(ObjectGuid guid); + void SendGameObjectCustomAnim(ObjectGuid guid); virtual bool IsHostileTo(Unit const* unit) const =0; virtual bool IsFriendlyTo(Unit const* unit) const =0; diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index 3ce0afa4c..d3d10315e 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -1145,7 +1145,7 @@ void Pet::_LoadSpellCooldowns() time_t curTime = time(NULL); WorldPacket data(SMSG_SPELL_COOLDOWN, (8+1+size_t(result->GetRowCount())*8)); - data << GetGUID(); + data << ObjectGuid(GetObjectGuid()); data << uint8(0x0); // flags (0x1, 0x2) do diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp index 5692eaf0b..ddceb5762 100644 --- a/src/game/PetAI.cpp +++ b/src/game/PetAI.cpp @@ -335,14 +335,14 @@ void PetAI::UpdateAllies() { for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) { - Player* Target = itr->getSource(); - if (!Target || !pGroup->SameSubGroup((Player*)owner, Target)) + Player* target = itr->getSource(); + if (!target || !pGroup->SameSubGroup((Player*)owner, target)) continue; - if (Target->GetGUID() == owner->GetGUID()) + if (target->GetObjectGuid() == owner->GetObjectGuid()) continue; - m_AllySet.insert(Target->GetObjectGuid()); + m_AllySet.insert(target->GetObjectGuid()); } } else //remove group diff --git a/src/game/Player.cpp b/src/game/Player.cpp index e6f1e3ac4..5f164e8d1 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -4649,7 +4649,7 @@ void Player::SpawnCorpseBones() Corpse* Player::GetCorpse() const { - return sObjectAccessor.GetCorpseForPlayerGUID(GetGUID()); + return sObjectAccessor.GetCorpseForPlayerGUID(GetObjectGuid()); } void Player::DurabilityLossAll(double percent, bool inventory) @@ -8700,7 +8700,7 @@ void Player::SendPetSkillWipeConfirm() if(!pet) return; WorldPacket data(SMSG_PET_UNLEARN_CONFIRM, (8+4)); - data << pet->GetGUID(); + data << ObjectGuid(pet->GetObjectGuid()); data << uint32(pet->resetTalentsCost()); GetSession()->SendPacket( &data ); } @@ -13042,7 +13042,7 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId) if (canTalkToCredit) { if (pSource->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) - TalkedToCreature(pSource->GetEntry(), pSource->GetGUID()); + TalkedToCreature(pSource->GetEntry(), pSource->GetObjectGuid()); } // some gossips aren't handled in normal way ... so we need to do it this way .. TODO: handle it in normal way ;-) @@ -13094,7 +13094,7 @@ void Player::SendPreparedGossip(WorldObject *pSource) if (uint32 menuId = PlayerTalkClass->GetGossipMenu().GetMenuId()) textId = GetGossipTextId(menuId); - PlayerTalkClass->SendGossipMenu(textId, pSource->GetGUID()); + PlayerTalkClass->SendGossipMenu(textId, pSource->GetObjectGuid()); } void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 menuId) @@ -13150,7 +13150,7 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 me else if (pMenuData.m_gAction_menu < 0) { PlayerTalkClass->CloseGossip(); - TalkedToCreature(pSource->GetEntry(), pSource->GetGUID()); + TalkedToCreature(pSource->GetEntry(), pSource->GetObjectGuid()); } if (pMenuData.m_gAction_script) @@ -13165,7 +13165,7 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 me } case GOSSIP_OPTION_SPIRITHEALER: if (isDead()) - ((Creature*)pSource)->CastSpell(((Creature*)pSource),17251,true,NULL,NULL,GetGUID()); + ((Creature*)pSource)->CastSpell(((Creature*)pSource), 17251, true, NULL, NULL, GetObjectGuid()); break; case GOSSIP_OPTION_QUESTGIVER: PrepareQuestMenu(guid); @@ -16994,7 +16994,7 @@ void Player::ConvertInstancesToGroup(Player *player, Group *group, ObjectGuid pl if (player) { - player_guid = player->GetGUID(); + player_guid = player->GetObjectGuid(); if (!group) group = player->GetGroup(); } @@ -18681,7 +18681,7 @@ void Player::HandleStealthedUnitsDetection() { if(!hasAtClient) { - ObjectGuid i_guid = (*i)->GetGUID(); + ObjectGuid i_guid = (*i)->GetObjectGuid(); (*i)->SendCreateUpdateToPlayer(this); m_clientGUIDs.insert(i_guid); @@ -18698,7 +18698,7 @@ void Player::HandleStealthedUnitsDetection() if(hasAtClient) { (*i)->DestroyForPlayer(this); - m_clientGUIDs.erase((*i)->GetGUID()); + m_clientGUIDs.erase((*i)->GetObjectGuid()); } } } @@ -19914,7 +19914,7 @@ template<> inline void UpdateVisibilityOf_helper(ObjectGuidSet& s64, GameObject* target) { if(!target->IsTransport()) - s64.insert(target->GetGUID()); + s64.insert(target->GetObjectGuid()); } template @@ -20208,7 +20208,7 @@ void Player::ApplyEquipCooldown( Item * pItem ) AddSpellCooldown(spellData.SpellId, pItem->GetEntry(), time(NULL) + 30); WorldPacket data(SMSG_ITEM_COOLDOWN, 12); - data << pItem->GetGUID(); + data << ObjectGuid(pItem->GetObjectGuid()); data << uint32(spellData.SpellId); GetSession()->SendPacket(&data); } diff --git a/src/game/Player.h b/src/game/Player.h index b2193e2a6..0e0d38cb2 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -2220,7 +2220,7 @@ class MANGOS_DLL_SPEC Player : public Unit // currently visible objects at player client ObjectGuidSet m_clientGUIDs; - bool HaveAtClient(WorldObject const* u) { return u==this || m_clientGUIDs.find(u->GetGUID())!=m_clientGUIDs.end(); } + bool HaveAtClient(WorldObject const* u) { return u==this || m_clientGUIDs.find(u->GetObjectGuid())!=m_clientGUIDs.end(); } bool IsVisibleInGridForPlayer(Player* pl) const; bool IsVisibleGloballyFor(Player* pl) const; diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index b90911135..9fcdf1651 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -134,7 +134,7 @@ void SpellCastTargets::setUnitTarget(Unit *target) m_destY = target->GetPositionY(); m_destZ = target->GetPositionZ(); m_unitTarget = target; - m_unitTargetGUID = target->GetGUID(); + m_unitTargetGUID = target->GetObjectGuid(); m_targetMask |= TARGET_FLAG_UNIT; } @@ -157,7 +157,7 @@ void SpellCastTargets::setSource(float x, float y, float z) void SpellCastTargets::setGOTarget(GameObject *target) { m_GOTarget = target; - m_GOTargetGUID = target->GetGUID(); + m_GOTargetGUID = target->GetObjectGuid(); // m_targetMask |= TARGET_FLAG_OBJECT; } @@ -167,7 +167,7 @@ void SpellCastTargets::setItemTarget(Item* item) return; m_itemTarget = item; - m_itemTargetGUID = item->GetGUID(); + m_itemTargetGUID = item->GetObjectGuid(); m_itemTargetEntry = item->GetEntry(); m_targetMask |= TARGET_FLAG_ITEM; } @@ -183,7 +183,7 @@ void SpellCastTargets::setTradeItemTarget(Player* caster) void SpellCastTargets::setCorpseTarget(Corpse* corpse) { - m_CorpseTargetGUID = corpse->GetGUID(); + m_CorpseTargetGUID = corpse->GetObjectGuid(); } void SpellCastTargets::Update(Unit* caster) @@ -222,7 +222,7 @@ void SpellCastTargets::read( ByteBuffer& data, Unit *caster ) m_destY = caster->GetPositionY(); m_destZ = caster->GetPositionZ(); m_unitTarget = caster; - m_unitTargetGUID = caster->GetGUID(); + m_unitTargetGUID = caster->GetObjectGuid(); return; } @@ -5321,7 +5321,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->getClass() == CLASS_WARLOCK) { if (strict) //Summoning Disorientation, trigger pet stun (cast by pet so it doesn't attack player) - pet->CastSpell(pet, 32752, true, NULL, NULL, pet->GetGUID()); + pet->CastSpell(pet, 32752, true, NULL, NULL, pet->GetObjectGuid()); } else return SPELL_FAILED_ALREADY_HAVE_SUMMON; diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 6e3579d54..264de682f 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1839,7 +1839,7 @@ void Aura::TriggerSpell() } case 53563: // Beacon of Light // original caster must be target (beacon) - target->CastSpell(target, trigger_spell_id, true, NULL, this, target->GetGUID()); + target->CastSpell(target, trigger_spell_id, true, NULL, this, target->GetObjectGuid()); return; case 56654: // Rapid Recuperation (triggered energize have baspioints == 0) case 58882: diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 6fc83dd07..870e572c0 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -3097,10 +3097,10 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) default: return; } - totem->CastSpell(totem, triggered_spell_id, true, NULL, NULL, m_caster->GetGUID()); + totem->CastSpell(totem, triggered_spell_id, true, NULL, NULL, m_caster->GetObjectGuid()); // Fire Nova Visual - totem->CastSpell(totem, 19823, true, NULL, NULL, m_caster->GetGUID()); + totem->CastSpell(totem, 19823, true, NULL, NULL, m_caster->GetObjectGuid()); return; } break; @@ -3919,7 +3919,7 @@ void Spell::EffectHeal(SpellEffectIndex /*eff_idx*/) if (unitTarget == m_targets.getUnitTarget()) { // check for Riptide - Aura* riptide = unitTarget->GetAura(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, UI64LIT(0x0), 0x00000010, caster->GetGUID()); + Aura* riptide = unitTarget->GetAura(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, UI64LIT(0x0), 0x00000010, caster->GetObjectGuid()); if (riptide) { addhealth += addhealth/4; @@ -7483,7 +7483,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx) { if (roll_chance_i((*i)->GetModifier()->m_amount)) { - unitTarget->CastSpell(unitTarget, 53398, true, NULL, (*i), m_caster->GetGUID()); + unitTarget->CastSpell(unitTarget, 53398, true, NULL, (*i), m_caster->GetObjectGuid()); break; } } @@ -8765,7 +8765,7 @@ void Spell::EffectProspecting(SpellEffectIndex /*eff_idx*/) p_caster->UpdateGatherSkill(SKILL_JEWELCRAFTING, SkillValue, reqSkillValue); } - ((Player*)m_caster)->SendLoot(itemTarget->GetGUID(), LOOT_PROSPECTING); + ((Player*)m_caster)->SendLoot(itemTarget->GetObjectGuid(), LOOT_PROSPECTING); } void Spell::EffectMilling(SpellEffectIndex /*eff_idx*/) diff --git a/src/game/TaxiHandler.cpp b/src/game/TaxiHandler.cpp index a96f9f963..bfcd0d0c2 100644 --- a/src/game/TaxiHandler.cpp +++ b/src/game/TaxiHandler.cpp @@ -132,18 +132,18 @@ bool WorldSession::SendLearnNewTaxiNode( Creature* unit ) // find current node uint32 curloc = sObjectMgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam()); - if ( curloc == 0 ) + if (curloc == 0) return true; // `true` send to avoid WorldSession::SendTaxiMenu call with one more curlock seartch with same false result. - if( GetPlayer()->m_taxi.SetTaximaskNode(curloc) ) + if (GetPlayer()->m_taxi.SetTaximaskNode(curloc)) { WorldPacket msg(SMSG_NEW_TAXI_PATH, 0); - SendPacket( &msg ); + SendPacket(&msg); - WorldPacket update( SMSG_TAXINODE_STATUS, 9 ); - update << uint64( unit->GetGUID() ); - update << uint8( 1 ); - SendPacket( &update ); + WorldPacket update(SMSG_TAXINODE_STATUS, 9); + update << ObjectGuid(unit->GetObjectGuid()); + update << uint8(1); + SendPacket(&update); return true; } diff --git a/src/game/ThreatManager.cpp b/src/game/ThreatManager.cpp index a1950811e..71e1a56a8 100644 --- a/src/game/ThreatManager.cpp +++ b/src/game/ThreatManager.cpp @@ -61,7 +61,7 @@ HostileReference::HostileReference(Unit* pUnit, ThreatManager *pThreatManager, f iThreat = pThreat; iTempThreatModifyer = 0.0f; link(pUnit, pThreatManager); - iUnitGuid = pUnit->GetGUID(); + iUnitGuid = pUnit->GetObjectGuid(); iOnline = true; iAccessible = true; } @@ -128,10 +128,9 @@ void HostileReference::updateOnlineStatus() bool online = false; bool accessible = false; - if(!isValid()) + if (!isValid()) { - Unit* target = ObjectAccessor::GetUnit(*getSourceUnit(), getUnitGuid()); - if(target) + if (Unit* target = ObjectAccessor::GetUnit(*getSourceUnit(), getUnitGuid())) link(target, getSource()); } // only check for online status if @@ -224,10 +223,10 @@ void ThreatContainer::clearReferences() HostileReference* ThreatContainer::getReferenceByTarget(Unit* pVictim) { HostileReference* result = NULL; - uint64 guid = pVictim->GetGUID(); + ObjectGuid guid = pVictim->GetObjectGuid(); for(ThreatList::const_iterator i = iThreatList.begin(); i != iThreatList.end(); ++i) { - if((*i)->getUnitGuid() == guid) + if ((*i)->getUnitGuid() == guid) { result = (*i); break; diff --git a/src/game/ThreatManager.h b/src/game/ThreatManager.h index 09b1ed5f5..6159435b5 100644 --- a/src/game/ThreatManager.h +++ b/src/game/ThreatManager.h @@ -24,6 +24,7 @@ #include "Utilities/LinkedReference/Reference.h" #include "UnitEvents.h" #include "Timer.h" +#include "ObjectGuid.h" #include //============================================================== @@ -92,7 +93,7 @@ class MANGOS_DLL_SPEC HostileReference : public Reference //================================================= - uint64 getUnitGuid() const { return iUnitGuid; } + ObjectGuid const& getUnitGuid() const { return iUnitGuid; } //================================================= // reference is not needed anymore. realy delete it ! @@ -121,7 +122,7 @@ class MANGOS_DLL_SPEC HostileReference : public Reference private: float iThreat; float iTempThreatModifyer; // used for taunt - uint64 iUnitGuid; + ObjectGuid iUnitGuid; bool iOnline; bool iAccessible; }; diff --git a/src/game/TradeHandler.cpp b/src/game/TradeHandler.cpp index bad34e974..3bbe151ed 100644 --- a/src/game/TradeHandler.cpp +++ b/src/game/TradeHandler.cpp @@ -620,8 +620,8 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) pOther->m_trade = new TradeData(pOther, _player); WorldPacket data(SMSG_TRADE_STATUS, 12); - data << (uint32) TRADE_STATUS_BEGIN_TRADE; - data << (uint64)_player->GetGUID(); + data << uint32(TRADE_STATUS_BEGIN_TRADE); + data << ObjectGuid(_player->GetObjectGuid()); pOther->GetSession()->SendPacket(&data); } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index f87c972fb..f3e968ece 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3745,7 +3745,7 @@ void Unit::SetFacingToObject(WorldObject* pObject) // TODO: figure out under what conditions creature will move towards object instead of facing it where it currently is. SetOrientation(GetAngle(pObject)); - SendMonsterMove(GetPositionX(), GetPositionY(), GetPositionZ(), SPLINETYPE_FACINGTARGET, ((Creature*)this)->GetSplineFlags(), 0, NULL, pObject->GetGUID()); + SendMonsterMove(GetPositionX(), GetPositionY(), GetPositionZ(), SPLINETYPE_FACINGTARGET, ((Creature*)this)->GetSplineFlags(), 0, NULL, pObject->GetObjectGuid().GetRawValue()); } bool Unit::isInAccessablePlaceFor(Creature const* c) const @@ -4747,8 +4747,11 @@ void Unit::RemoveSpellAuraHolder(SpellAuraHolder *holder, AuraRemoveMode mode) else delete holder; - if (mode != AURA_REMOVE_BY_EXPIRE && IsChanneledSpell(AurSpellInfo) && !IsAreaOfEffectSpell(AurSpellInfo) && caster && caster->GetGUID() != GetGUID()) + if (mode != AURA_REMOVE_BY_EXPIRE && IsChanneledSpell(AurSpellInfo) && !IsAreaOfEffectSpell(AurSpellInfo) && + caster && caster->GetObjectGuid() != GetObjectGuid()) + { caster->InterruptSpell(CURRENT_CHANNELED_SPELL); + } } void Unit::RemoveSingleAuraFromSpellAuraHolder(SpellAuraHolder *holder, SpellEffectIndex index, AuraRemoveMode mode) @@ -4925,7 +4928,7 @@ bool Unit::HasAura(uint32 spellId, SpellEffectIndex effIndex) const void Unit::AddDynObject(DynamicObject* dynObj) { - m_dynObjGUIDs.push_back(dynObj->GetGUID()); + m_dynObjGUIDs.push_back(dynObj->GetObjectGuid()); } void Unit::RemoveDynObject(uint32 spellid) @@ -4953,8 +4956,7 @@ void Unit::RemoveAllDynObjects() { while(!m_dynObjGUIDs.empty()) { - DynamicObject* dynObj = GetMap()->GetDynamicObject(*m_dynObjGUIDs.begin()); - if(dynObj) + if (DynamicObject* dynObj = GetMap()->GetDynamicObject(*m_dynObjGUIDs.begin())) dynObj->Delete(); m_dynObjGUIDs.erase(m_dynObjGUIDs.begin()); } @@ -5325,15 +5327,12 @@ FactionTemplateEntry const* Unit::getFactionTemplateEntry() const FactionTemplateEntry const* entry = sFactionTemplateStore.LookupEntry(getFaction()); if(!entry) { - static uint64 guid = 0; // prevent repeating spam same faction problem + static ObjectGuid guid; // prevent repeating spam same faction problem - if(GetGUID() != guid) + if (GetObjectGuid() != guid) { - if(GetTypeId() == TYPEID_PLAYER) - sLog.outError("Player %s have invalid faction (faction template id) #%u", ((Player*)this)->GetName(), getFaction()); - else - sLog.outError("Creature (template id: %u) have invalid faction (faction template id) #%u", ((Creature*)this)->GetCreatureInfo()->Entry, getFaction()); - guid = GetGUID(); + sLog.outError("%s have invalid faction (faction template id) #%u", GetGuidStr().c_str(), getFaction()); + guid = GetObjectGuid(); } } return entry; @@ -5955,30 +5954,29 @@ void Unit::SetCharm(Unit* pet) void Unit::AddGuardian( Pet* pet ) { - m_guardianPets.insert(pet->GetGUID()); + m_guardianPets.insert(pet->GetObjectGuid()); } void Unit::RemoveGuardian( Pet* pet ) { - m_guardianPets.erase(pet->GetGUID()); + m_guardianPets.erase(pet->GetObjectGuid()); } void Unit::RemoveGuardians() { - while(!m_guardianPets.empty()) + while (!m_guardianPets.empty()) { - uint64 guid = *m_guardianPets.begin(); - if(Pet* pet = GetMap()->GetPet(guid)) + if (Pet* pet = GetMap()->GetPet(*m_guardianPets.begin())) pet->Unsummon(PET_SAVE_AS_DELETED, this); - m_guardianPets.erase(guid); + m_guardianPets.erase(m_guardianPets.begin()); } } Pet* Unit::FindGuardianWithEntry(uint32 entry) { - for(GuardianPetList::const_iterator itr = m_guardianPets.begin(); itr != m_guardianPets.end(); ++itr) - if(Pet* pet = GetMap()->GetPet(*itr)) + for (GuardianPetList::const_iterator itr = m_guardianPets.begin(); itr != m_guardianPets.end(); ++itr) + if (Pet* pet = GetMap()->GetPet(*itr)) if (pet->GetEntry() == entry) return pet; @@ -5987,8 +5985,8 @@ Pet* Unit::FindGuardianWithEntry(uint32 entry) Pet* Unit::GetProtectorPet() { - for(GuardianPetList::const_iterator itr = m_guardianPets.begin(); itr != m_guardianPets.end(); ++itr) - if(Pet* pet = GetMap()->GetPet(*itr)) + for (GuardianPetList::const_iterator itr = m_guardianPets.begin(); itr != m_guardianPets.end(); ++itr) + if (Pet* pet = GetMap()->GetPet(*itr)) if (pet->getPetType() == PROTECTOR_PET) return pet; @@ -6354,7 +6352,7 @@ uint32 Unit::SpellDamageBonusDone(Unit *pVictim, SpellEntry const *spellProto, u // Twisted Faith case 7377: { - if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, UI64LIT(0x0000000000008000), 0, GetGUID())) + if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, UI64LIT(0x0000000000008000), 0, GetObjectGuid())) DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; break; } @@ -6438,7 +6436,7 @@ uint32 Unit::SpellDamageBonusDone(Unit *pVictim, SpellEntry const *spellProto, u if (spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000001)) { // if Insect Swarm on target - if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, UI64LIT(0x000000000200000), 0, GetGUID())) + if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, UI64LIT(0x000000000200000), 0, GetObjectGuid())) { Unit::AuraList const& improvedSwarm = GetAurasByType(SPELL_AURA_DUMMY); for(Unit::AuraList::const_iterator iter = improvedSwarm.begin(); iter != improvedSwarm.end(); ++iter) @@ -6730,7 +6728,7 @@ bool Unit::IsSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM if (spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004)) { // search for Moonfire on target - if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, UI64LIT(0x000000000000002), 0, GetGUID())) + if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, UI64LIT(0x000000000000002), 0, GetObjectGuid())) { Unit::AuraList const& improvedSwarm = GetAurasByType(SPELL_AURA_DUMMY); for(Unit::AuraList::const_iterator iter = improvedSwarm.begin(); iter != improvedSwarm.end(); ++iter) @@ -6764,7 +6762,7 @@ bool Unit::IsSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM if (spellProto->SpellFamilyFlags & UI64LIT(0x0000100000000000)) { // Flame Shock - if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, UI64LIT(0x0000000010000000), 0, GetGUID())) + if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, UI64LIT(0x0000000010000000), 0, GetObjectGuid())) return true; } break; @@ -6947,7 +6945,7 @@ uint32 Unit::SpellHealingBonusDone(Unit *pVictim, SpellEntry const *spellProto, } case 7871: // Glyph of Lesser Healing Wave { - if (pVictim->GetAura(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, UI64LIT(0x0000040000000000), 0, GetGUID())) + if (pVictim->GetAura(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, UI64LIT(0x0000040000000000), 0, GetObjectGuid())) DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; break; } @@ -10608,7 +10606,7 @@ void Unit::SendThreatUpdate() data << uint32(count); for (ThreatList::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr) { - data.appendPackGUID((*itr)->getUnitGuid()); + data << (*itr)->getUnitGuid().WriteAsPacked(); data << uint32((*itr)->getThreat()); } SendMessageToSet(&data, false); @@ -10623,11 +10621,11 @@ void Unit::SendHighestThreatUpdate(HostileReference* pHostilReference) DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "WORLD: Send SMSG_HIGHEST_THREAT_UPDATE Message"); WorldPacket data(SMSG_HIGHEST_THREAT_UPDATE, 8 + 8 + count * 8); data << GetPackGUID(); - data.appendPackGUID(pHostilReference->getUnitGuid()); + data << pHostilReference->getUnitGuid().WriteAsPacked(); data << uint32(count); for (ThreatList::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr) { - data.appendPackGUID((*itr)->getUnitGuid()); + data << (*itr)->getUnitGuid().WriteAsPacked(); data << uint32((*itr)->getThreat()); } SendMessageToSet(&data, false); @@ -10647,7 +10645,7 @@ void Unit::SendThreatRemove(HostileReference* pHostileReference) DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "WORLD: Send SMSG_THREAT_REMOVE Message"); WorldPacket data(SMSG_THREAT_REMOVE, 8 + 8); data << GetPackGUID(); - data.appendPackGUID(pHostileReference->getUnitGuid()); + data << pHostileReference->getUnitGuid().WriteAsPacked(); SendMessageToSet(&data, false); } diff --git a/src/game/Unit.h b/src/game/Unit.h index 93e784a64..d7214c54e 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1106,7 +1106,7 @@ enum IgnoreUnitState IGNORE_UNIT_TARGET_NON_FROZEN = 126, // ignore absent of frozen state }; -typedef std::set GuardianPetList; +typedef std::set GuardianPetList; // delay time next attack to prevent client attack animation problems #define ATTACK_DISPLAY_DELAY 200 @@ -1801,7 +1801,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject DynamicObject* GetDynObject(uint32 spellId); void AddDynObject(DynamicObject* dynObj); void RemoveDynObject(uint32 spellid); - void RemoveDynObjectWithGUID(uint64 guid) { m_dynObjGUIDs.remove(guid); } + void RemoveDynObjectWithGUID(ObjectGuid guid) { m_dynObjGUIDs.remove(guid); } void RemoveAllDynObjects(); GameObject* GetGameObject(uint32 spellId) const; @@ -1982,7 +1982,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject SingleCastSpellTargetMap m_singleCastSpellTargets; // casted by unit single per-caster auras - typedef std::list DynObjectGUIDs; + typedef std::list DynObjectGUIDs; DynObjectGUIDs m_dynObjGUIDs; typedef std::list GameObjectList; diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp index 21117bd37..e2e38d9dd 100644 --- a/src/game/UnitAuraProcHandler.cpp +++ b/src/game/UnitAuraProcHandler.cpp @@ -1361,7 +1361,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura return SPELL_AURA_PROC_FAILED; // Renew - Aura* healingAura = pVictim->GetAura(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_PRIEST, UI64LIT(0x40), 0, GetGUID()); + Aura* healingAura = pVictim->GetAura(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_PRIEST, UI64LIT(0x40), 0, GetObjectGuid()); if (!healingAura) return SPELL_AURA_PROC_FAILED; @@ -1377,7 +1377,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura if (!procSpell) return SPELL_AURA_PROC_FAILED; - Aura* leachAura = pVictim->GetAura(SPELL_AURA_PERIODIC_LEECH, SPELLFAMILY_PRIEST, UI64LIT(0x02000000), 0, GetGUID()); + Aura* leachAura = pVictim->GetAura(SPELL_AURA_PERIODIC_LEECH, SPELLFAMILY_PRIEST, UI64LIT(0x02000000), 0, GetObjectGuid()); if (!leachAura) return SPELL_AURA_PROC_FAILED; @@ -1595,7 +1595,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura if (!second) return SPELL_AURA_PROC_FAILED; - pVictim->CastSpell(second, procSpell, true, NULL, triggeredByAura, GetGUID()); + pVictim->CastSpell(second, procSpell, true, NULL, triggeredByAura, GetObjectGuid()); return SPELL_AURA_PROC_OK; } } @@ -1790,7 +1790,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura // Glyph of Mend Pet if(dummySpell->Id == 57870) { - pVictim->CastSpell(pVictim, 57894, true, NULL, NULL, GetGUID()); + pVictim->CastSpell(pVictim, 57894, true, NULL, NULL, GetObjectGuid()); return SPELL_AURA_PROC_OK; } // Misdirection @@ -2027,7 +2027,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura basepoints[0] = triggeredByAura->GetModifier()->m_amount*damage/100; // cast with original caster set but beacon to beacon for apply caster mods and avoid LoS check - beacon->CastCustomSpell(beacon,triggered_spell_id,&basepoints[0],NULL,NULL,true,castItem,triggeredByAura,pVictim->GetGUID()); + beacon->CastCustomSpell(beacon,triggered_spell_id,&basepoints[0],NULL,NULL,true,castItem,triggeredByAura,pVictim->GetObjectGuid()); return SPELL_AURA_PROC_OK; } // Seal of Corruption (damage calc on apply aura) diff --git a/src/game/World.cpp b/src/game/World.cpp index 785c2607f..ca8750c78 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -1638,7 +1638,7 @@ void World::SendGlobalText(const char* text, WorldSession *self) while(char* line = ChatHandler::LineFromMessage(pos)) { - ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, 0, line, NULL); + ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, line); SendGlobalMessage(&data, self); } @@ -1667,7 +1667,7 @@ void World::SendZoneMessage(uint32 zone, WorldPacket *packet, WorldSession *self void World::SendZoneText(uint32 zone, const char* text, WorldSession *self, uint32 team) { WorldPacket data; - ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, 0, text, NULL); + ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, text); SendZoneMessage(zone, &data, self,team); } diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index cd730a462..b30e480cf 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -436,7 +436,7 @@ void WorldSession::LogoutPlayer(bool Save) slot->UpdateLogoutTime(); } - guild->BroadcastEvent(GE_SIGNED_OFF, _player->GetGUID(), _player->GetName()); + guild->BroadcastEvent(GE_SIGNED_OFF, _player->GetObjectGuid(), _player->GetName()); } ///- Remove pet diff --git a/src/game/debugcmds.cpp b/src/game/debugcmds.cpp index 13b62c600..6dc70dff5 100644 --- a/src/game/debugcmds.cpp +++ b/src/game/debugcmds.cpp @@ -306,7 +306,7 @@ bool ChatHandler::HandleDebugSendChatMsgCommand(char* args) return false; WorldPacket data; - ChatHandler::FillMessageData(&data, m_session, type, 0, "chan", m_session->GetPlayer()->GetGUID(), msg, m_session->GetPlayer()); + ChatHandler::FillMessageData(&data, m_session, type, 0, "chan", m_session->GetPlayer()->GetObjectGuid(), msg, m_session->GetPlayer()); m_session->SendPacket(&data); return true; } @@ -528,7 +528,7 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args) error = true; continue; } - if (item2->GetOwnerGuid() != player->GetGUID()) + if (item2->GetOwnerGuid() != player->GetObjectGuid()) { PSendSysMessage("%s in bag %u at slot %u owner (%s) and inventory owner (%s) don't match!", item2->GetGuidStr().c_str(), bag->GetSlot(), item2->GetSlot(), diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 4fa715c3b..b2ccb7a64 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11464" + #define REVISION_NR "11465" #endif // __REVISION_NR_H__