Core/Entities: Updated HighGuid values
This commit is contained in:
@@ -81,7 +81,7 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accountId)
|
||||
{
|
||||
do
|
||||
{
|
||||
ObjectGuid guid(HIGHGUID_PLAYER, (*result)[0].GetUInt64());
|
||||
ObjectGuid guid(HighGuid::Player, (*result)[0].GetUInt64());
|
||||
|
||||
// Kick if player is online
|
||||
if (Player* p = ObjectAccessor::FindConnectedPlayer(guid))
|
||||
|
||||
@@ -735,7 +735,7 @@ void AchievementMgr<Guild>::LoadFromDB(PreparedQueryResult achievementResult, Pr
|
||||
ca.date = time_t(fields[1].GetUInt32());
|
||||
Tokenizer guids(fields[2].GetString(), ' ');
|
||||
for (uint32 i = 0; i < guids.size(); ++i)
|
||||
ca.guids.insert(ObjectGuid(HIGHGUID_PLAYER, uint64(strtoull(guids[i], nullptr, 10))));
|
||||
ca.guids.insert(ObjectGuid(HighGuid::Player, uint64(strtoull(guids[i], nullptr, 10))));
|
||||
|
||||
ca.changed = false;
|
||||
|
||||
@@ -773,7 +773,7 @@ void AchievementMgr<Guild>::LoadFromDB(PreparedQueryResult achievementResult, Pr
|
||||
CriteriaProgress& progress = m_criteriaProgress[id];
|
||||
progress.counter = counter;
|
||||
progress.date = date;
|
||||
progress.CompletedGUID = ObjectGuid(HIGHGUID_PLAYER, guid);
|
||||
progress.CompletedGUID = ObjectGuid(HighGuid::Player, guid);
|
||||
progress.changed = false;
|
||||
} while (criteriaResult->NextRow());
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction&
|
||||
return;
|
||||
|
||||
uint32 bidderAccId = 0;
|
||||
ObjectGuid bidderGuid(HIGHGUID_PLAYER, auction->bidder);
|
||||
ObjectGuid bidderGuid(HighGuid::Player, auction->bidder);
|
||||
Player* bidder = ObjectAccessor::FindConnectedPlayer(bidderGuid);
|
||||
// data for gm.log
|
||||
std::string bidderName;
|
||||
@@ -115,7 +115,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction&
|
||||
|
||||
if (logGmTrade)
|
||||
{
|
||||
ObjectGuid ownerGuid = ObjectGuid(HIGHGUID_PLAYER, auction->owner);
|
||||
ObjectGuid ownerGuid = ObjectGuid(HighGuid::Player, auction->owner);
|
||||
std::string ownerName;
|
||||
if (!sObjectMgr->GetPlayerNameByGUID(ownerGuid, ownerName))
|
||||
ownerName = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN);
|
||||
@@ -156,7 +156,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction&
|
||||
|
||||
void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry* auction, SQLTransaction& trans)
|
||||
{
|
||||
ObjectGuid owner_guid(HIGHGUID_PLAYER, auction->owner);
|
||||
ObjectGuid owner_guid(HighGuid::Player, auction->owner);
|
||||
Player* owner = ObjectAccessor::FindConnectedPlayer(owner_guid);
|
||||
uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid);
|
||||
// owner exist (online or offline)
|
||||
@@ -168,7 +168,7 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry* auction, SQLTrans
|
||||
//call this method to send mail to auction owner, when auction is successful, it does not clear ram
|
||||
void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry* auction, SQLTransaction& trans)
|
||||
{
|
||||
ObjectGuid owner_guid(HIGHGUID_PLAYER, auction->owner);
|
||||
ObjectGuid owner_guid(HighGuid::Player, auction->owner);
|
||||
Player* owner = ObjectAccessor::FindConnectedPlayer(owner_guid);
|
||||
uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid);
|
||||
// owner exist
|
||||
@@ -199,7 +199,7 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry* auction, SQLTransacti
|
||||
if (!pItem)
|
||||
return;
|
||||
|
||||
ObjectGuid owner_guid(HIGHGUID_PLAYER, auction->owner);
|
||||
ObjectGuid owner_guid(HighGuid::Player, auction->owner);
|
||||
Player* owner = ObjectAccessor::FindConnectedPlayer(owner_guid);
|
||||
uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid);
|
||||
// owner exist
|
||||
@@ -222,7 +222,7 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry* auction, SQLTransacti
|
||||
//this function sends mail to old bidder
|
||||
void AuctionHouseMgr::SendAuctionOutbiddedMail(AuctionEntry* auction, uint32 newPrice, Player* newBidder, SQLTransaction& trans)
|
||||
{
|
||||
ObjectGuid oldBidder_guid(HIGHGUID_PLAYER, auction->bidder);
|
||||
ObjectGuid oldBidder_guid(HighGuid::Player, auction->bidder);
|
||||
Player* oldBidder = ObjectAccessor::FindConnectedPlayer(oldBidder_guid);
|
||||
|
||||
uint32 oldBidder_accId = 0;
|
||||
@@ -244,7 +244,7 @@ void AuctionHouseMgr::SendAuctionOutbiddedMail(AuctionEntry* auction, uint32 new
|
||||
//this function sends mail, when auction is cancelled to old bidder
|
||||
void AuctionHouseMgr::SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQLTransaction& trans, Item* item)
|
||||
{
|
||||
ObjectGuid bidder_guid = ObjectGuid(HIGHGUID_PLAYER, auction->bidder);
|
||||
ObjectGuid bidder_guid = ObjectGuid(HighGuid::Player, auction->bidder);
|
||||
Player* bidder = ObjectAccessor::FindConnectedPlayer(bidder_guid);
|
||||
|
||||
uint32 bidder_accId = 0;
|
||||
@@ -761,7 +761,7 @@ std::string AuctionEntry::BuildAuctionMailBody(uint64 lowGuid, uint32 bid, uint3
|
||||
{
|
||||
std::ostringstream strm;
|
||||
strm.width(16);
|
||||
strm << std::right << std::hex << ObjectGuid(HIGHGUID_PLAYER, lowGuid); // HIGHGUID_PLAYER always present, even for empty guids
|
||||
strm << std::right << std::hex << ObjectGuid(HighGuid::Player, lowGuid); // HIGHGUID_PLAYER always present, even for empty guids
|
||||
strm << std::dec << ':' << bid << ':' << buyout;
|
||||
strm << ':' << deposit << ':' << cut;
|
||||
return strm.str();
|
||||
|
||||
@@ -770,7 +770,7 @@ Creature* Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, fl
|
||||
}
|
||||
|
||||
Creature* creature = new Creature();
|
||||
if (!creature->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), map, PHASEMASK_NORMAL, entry, x, y, z, o))
|
||||
if (!creature->Create(sObjectMgr->GetGenerator<HighGuid::Creature>()->Generate(), map, PHASEMASK_NORMAL, entry, x, y, z, o))
|
||||
{
|
||||
TC_LOG_ERROR("bg.battlefield", "Battlefield::SpawnCreature: Can't create creature entry: %u", entry);
|
||||
delete creature;
|
||||
@@ -802,7 +802,7 @@ GameObject* Battlefield::SpawnGameObject(uint32 entry, float x, float y, float z
|
||||
|
||||
// Create gameobject
|
||||
GameObject* go = new GameObject;
|
||||
if (!go->Create(sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate(), entry, map, PHASEMASK_NORMAL, x, y, z, o, 0, 0, 0, 0, 100, GO_STATE_READY))
|
||||
if (!go->Create(sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate(), entry, map, PHASEMASK_NORMAL, x, y, z, o, 0, 0, 0, 0, 100, GO_STATE_READY))
|
||||
{
|
||||
TC_LOG_ERROR("bg.battlefield", "Battlefield::SpawnGameObject: Gameobject template %u not found in database! Battlefield not created!", entry);
|
||||
TC_LOG_ERROR("bg.battlefield", "Battlefield::SpawnGameObject: Cannot create gameobject template %u! Battlefield not created!", entry);
|
||||
|
||||
@@ -193,7 +193,7 @@ bool ArenaTeam::LoadArenaTeamFromDB(QueryResult result)
|
||||
|
||||
TeamId = fields[0].GetUInt32();
|
||||
TeamName = fields[1].GetString();
|
||||
CaptainGuid = ObjectGuid(HIGHGUID_PLAYER, fields[2].GetUInt64());
|
||||
CaptainGuid = ObjectGuid(HighGuid::Player, fields[2].GetUInt64());
|
||||
Type = fields[3].GetUInt8();
|
||||
BackgroundColor = fields[4].GetUInt32();
|
||||
EmblemStyle = fields[5].GetUInt8();
|
||||
@@ -232,7 +232,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult result)
|
||||
break;
|
||||
|
||||
ArenaTeamMember newMember;
|
||||
newMember.Guid = ObjectGuid(HIGHGUID_PLAYER, fields[1].GetUInt64());
|
||||
newMember.Guid = ObjectGuid(HighGuid::Player, fields[1].GetUInt64());
|
||||
newMember.WeekGames = fields[2].GetUInt16();
|
||||
newMember.WeekWins = fields[3].GetUInt16();
|
||||
newMember.SeasonGames = fields[4].GetUInt16();
|
||||
|
||||
@@ -1420,7 +1420,7 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float
|
||||
// and when loading it (in go::LoadFromDB()), a new guid would be assigned to the object, and a new object would be created
|
||||
// So we must create it specific for this instance
|
||||
GameObject* go = new GameObject;
|
||||
if (!go->Create(sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate(), entry, GetBgMap(),
|
||||
if (!go->Create(sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate(), entry, GetBgMap(),
|
||||
PHASEMASK_NORMAL, x, y, z, o, rotation0, rotation1, rotation2, rotation3, 100, goState))
|
||||
{
|
||||
TC_LOG_ERROR("bg.battleground", "Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!",
|
||||
@@ -1564,7 +1564,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, float x, float y,
|
||||
|
||||
Creature* creature = new Creature();
|
||||
|
||||
if (!creature->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), map, PHASEMASK_NORMAL, entry, x, y, z, o))
|
||||
if (!creature->Create(sObjectMgr->GetGenerator<HighGuid::Creature>()->Generate(), map, PHASEMASK_NORMAL, entry, x, y, z, o))
|
||||
{
|
||||
TC_LOG_ERROR("bg.battleground", "Battleground::AddCreature: cannot create creature (entry: %u) for BG (map: %u, instance id: %u)!",
|
||||
entry, m_MapId, m_InstanceID);
|
||||
|
||||
@@ -652,7 +652,7 @@ Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId original
|
||||
bg->SetRandomTypeID(bgTypeId);
|
||||
bg->SetRated(isRated);
|
||||
bg->SetRandom(isRandom);
|
||||
bg->SetGuid(ObjectGuid(HIGHGUID_BATTLEGROUND, uint64(bgTypeId)));
|
||||
bg->SetGuid(ObjectGuid(HighGuid::Null, uint64(bgTypeId) | UI64LIT(0x1F10000000000000)));
|
||||
|
||||
// Set up correct min/max player counts for scoreboards
|
||||
if (bg->isArena())
|
||||
@@ -755,7 +755,7 @@ bool BattlegroundMgr::CreateBattleground(BattlegroundTemplate const* bgTemplate)
|
||||
bg->SetStartMaxDist(bgTemplate->MaxStartDistSq);
|
||||
bg->SetLevelRange(bgTemplate->MinLevel, bgTemplate->MaxLevel);
|
||||
bg->SetScriptId(bgTemplate->ScriptId);
|
||||
bg->SetGuid(ObjectGuid(HIGHGUID_BATTLEGROUND, uint64(bgTemplate->Id)));
|
||||
bg->SetGuid(ObjectGuid(HighGuid::Null, uint64(bgTemplate->Id) | UI64LIT(0x1F10000000000000)));
|
||||
|
||||
AddBattleground(bg);
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ void CalendarMgr::LoadFromDB()
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint64 eventId = fields[0].GetUInt64();
|
||||
ObjectGuid creatorGUID = ObjectGuid(HIGHGUID_PLAYER, fields[1].GetUInt64());
|
||||
ObjectGuid creatorGUID = ObjectGuid(HighGuid::Player, fields[1].GetUInt64());
|
||||
std::string title = fields[2].GetString();
|
||||
std::string description = fields[3].GetString();
|
||||
CalendarEventType type = CalendarEventType(fields[4].GetUInt8());
|
||||
@@ -91,8 +91,8 @@ void CalendarMgr::LoadFromDB()
|
||||
|
||||
uint64 inviteId = fields[0].GetUInt64();
|
||||
uint64 eventId = fields[1].GetUInt64();
|
||||
ObjectGuid invitee = ObjectGuid(HIGHGUID_PLAYER, fields[2].GetUInt64());
|
||||
ObjectGuid senderGUID = ObjectGuid(HIGHGUID_PLAYER, fields[3].GetUInt64());
|
||||
ObjectGuid invitee = ObjectGuid(HighGuid::Player, fields[2].GetUInt64());
|
||||
ObjectGuid senderGUID = ObjectGuid(HighGuid::Player, fields[3].GetUInt64());
|
||||
CalendarInviteStatus status = CalendarInviteStatus(fields[4].GetUInt8());
|
||||
uint32 statusTime = fields[5].GetUInt32();
|
||||
CalendarModerationRank rank = CalendarModerationRank(fields[6].GetUInt8());
|
||||
|
||||
@@ -950,7 +950,7 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(ObjectGuid::Lo
|
||||
|
||||
Player* pl = m_session->GetPlayer();
|
||||
|
||||
GameObject* obj = pl->GetMap()->GetGameObject(ObjectGuid(HIGHGUID_GAMEOBJECT, entry, lowguid));
|
||||
GameObject* obj = pl->GetMap()->GetGameObject(ObjectGuid(HighGuid::GameObject, entry, lowguid));
|
||||
|
||||
if (!obj && sObjectMgr->GetGOData(lowguid)) // guid is DB guid of object
|
||||
{
|
||||
@@ -1100,7 +1100,7 @@ ObjectGuid ChatHandler::extractGuidFromLink(char* text)
|
||||
ObjectGuid::LowType lowguid = strtoull(idS, nullptr, 10);
|
||||
|
||||
if (CreatureData const* data = sObjectMgr->GetCreatureData(lowguid))
|
||||
return ObjectGuid(HIGHGUID_UNIT, data->id, lowguid);
|
||||
return ObjectGuid(HighGuid::Creature, data->id, lowguid);
|
||||
else
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
@@ -1109,7 +1109,7 @@ ObjectGuid ChatHandler::extractGuidFromLink(char* text)
|
||||
ObjectGuid::LowType lowguid = strtoull(idS, nullptr, 10);
|
||||
|
||||
if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid))
|
||||
return ObjectGuid(HIGHGUID_GAMEOBJECT, data->id, lowguid);
|
||||
return ObjectGuid(HighGuid::GameObject, data->id, lowguid);
|
||||
else
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
@@ -55,10 +55,10 @@ void LFGMgr::_LoadFromDB(Field* fields, ObjectGuid guid)
|
||||
if (!fields)
|
||||
return;
|
||||
|
||||
if (!guid.IsGroup())
|
||||
if (!guid.IsParty())
|
||||
return;
|
||||
|
||||
SetLeader(guid, ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt64()));
|
||||
SetLeader(guid, ObjectGuid(HighGuid::Player, fields[0].GetUInt64()));
|
||||
|
||||
uint32 dungeon = fields[17].GetUInt32();
|
||||
uint8 state = fields[18].GetUInt8();
|
||||
@@ -81,7 +81,7 @@ void LFGMgr::_LoadFromDB(Field* fields, ObjectGuid guid)
|
||||
|
||||
void LFGMgr::_SaveToDB(ObjectGuid guid, uint32 db_guid)
|
||||
{
|
||||
if (!guid.IsGroup())
|
||||
if (!guid.IsParty())
|
||||
return;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_LFG_DATA);
|
||||
@@ -582,7 +582,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
|
||||
*/
|
||||
void LFGMgr::LeaveLfg(ObjectGuid guid)
|
||||
{
|
||||
ObjectGuid gguid = guid.IsGroup() ? guid : GetGroup(guid);
|
||||
ObjectGuid gguid = guid.IsParty() ? guid : GetGroup(guid);
|
||||
|
||||
TC_LOG_DEBUG("lfg.leave", "%s left (%s)", guid.ToString().c_str(), guid == gguid ? "group" : "player");
|
||||
|
||||
@@ -1466,7 +1466,7 @@ LfgType LFGMgr::GetDungeonType(uint32 dungeonId)
|
||||
LfgState LFGMgr::GetState(ObjectGuid guid)
|
||||
{
|
||||
LfgState state;
|
||||
if (guid.IsGroup())
|
||||
if (guid.IsParty())
|
||||
{
|
||||
state = GroupsStore[guid].GetState();
|
||||
TC_LOG_TRACE("lfg.data.group.state.get", "Group: %s, State: %u", guid.ToString().c_str(), state);
|
||||
@@ -1483,7 +1483,7 @@ LfgState LFGMgr::GetState(ObjectGuid guid)
|
||||
LfgState LFGMgr::GetOldState(ObjectGuid guid)
|
||||
{
|
||||
LfgState state;
|
||||
if (guid.IsGroup())
|
||||
if (guid.IsParty())
|
||||
{
|
||||
state = GroupsStore[guid].GetOldState();
|
||||
TC_LOG_TRACE("lfg.data.group.oldstate.get", "Group: %s, Old state: %u", guid.ToString().c_str(), state);
|
||||
@@ -1615,7 +1615,7 @@ uint8 LFGMgr::GetKicksLeft(ObjectGuid guid)
|
||||
|
||||
void LFGMgr::RestoreState(ObjectGuid guid, char const* debugMsg)
|
||||
{
|
||||
if (guid.IsGroup())
|
||||
if (guid.IsParty())
|
||||
{
|
||||
LfgGroupData& data = GroupsStore[guid];
|
||||
TC_LOG_TRACE("lfg.data.group.state.restore", "Group: %s (%s), State: %s, Old state: %s",
|
||||
@@ -1637,7 +1637,7 @@ void LFGMgr::RestoreState(ObjectGuid guid, char const* debugMsg)
|
||||
|
||||
void LFGMgr::SetState(ObjectGuid guid, LfgState state)
|
||||
{
|
||||
if (guid.IsGroup())
|
||||
if (guid.IsParty())
|
||||
{
|
||||
LfgGroupData& data = GroupsStore[guid];
|
||||
TC_LOG_TRACE("lfg.data.group.state.set", "Group: %s, New state: %s, Previous: %s, Old state: %s",
|
||||
@@ -1823,12 +1823,12 @@ void LFGMgr::SendLfgQueueStatus(ObjectGuid guid, LfgQueueStatusData const& data)
|
||||
|
||||
bool LFGMgr::IsLfgGroup(ObjectGuid guid)
|
||||
{
|
||||
return !guid.IsEmpty() && guid.IsGroup() && GroupsStore[guid].IsLfgGroup();
|
||||
return !guid.IsEmpty() && guid.IsParty() && GroupsStore[guid].IsLfgGroup();
|
||||
}
|
||||
|
||||
uint8 LFGMgr::GetQueueId(ObjectGuid guid)
|
||||
{
|
||||
if (guid.IsGroup())
|
||||
if (guid.IsParty())
|
||||
{
|
||||
GuidSet const& players = GetPlayers(guid);
|
||||
ObjectGuid pguid = players.empty() ? ObjectGuid::Empty : (*players.begin());
|
||||
@@ -1953,7 +1953,7 @@ bool LFGMgr::selectedRandomLfgDungeon(ObjectGuid guid)
|
||||
|
||||
bool LFGMgr::inLfgDungeonMap(ObjectGuid guid, uint32 map, Difficulty difficulty)
|
||||
{
|
||||
if (!guid.IsGroup())
|
||||
if (!guid.IsParty())
|
||||
guid = GetGroup(guid);
|
||||
|
||||
if (uint32 dungeonId = GetDungeon(guid, true))
|
||||
|
||||
@@ -362,7 +362,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(GuidList check)
|
||||
|
||||
// Store group so we don't need to call Mgr to get it later (if it's player group will be 0 otherwise would have joined as group)
|
||||
for (LfgRolesMap::const_iterator it2 = itQueue->second.roles.begin(); it2 != itQueue->second.roles.end(); ++it2)
|
||||
proposalGroups[it2->first] = itQueue->first.IsGroup() ? itQueue->first : ObjectGuid::Empty;
|
||||
proposalGroups[it2->first] = itQueue->first.IsParty() ? itQueue->first : ObjectGuid::Empty;
|
||||
|
||||
numPlayers += itQueue->second.roles.size();
|
||||
|
||||
@@ -610,7 +610,7 @@ std::string LFGQueue::DumpQueueInfo() const
|
||||
for (GuidList::const_iterator it = queue.begin(); it != queue.end(); ++it)
|
||||
{
|
||||
ObjectGuid guid = *it;
|
||||
if (guid.IsGroup())
|
||||
if (guid.IsParty())
|
||||
{
|
||||
groups++;
|
||||
playersInGroup += sLFGMgr->GetPlayerCount(guid);
|
||||
|
||||
@@ -66,7 +66,7 @@ bool AreaTrigger::CreateAreaTrigger(ObjectGuid::LowType guidlow, uint32 triggerE
|
||||
return false;
|
||||
}
|
||||
|
||||
WorldObject::_Create(guidlow, HIGHGUID_AREATRIGGER, caster->GetPhaseMask());
|
||||
WorldObject::_Create(guidlow, HighGuid::AreaTrigger, caster->GetPhaseMask());
|
||||
|
||||
SetEntry(triggerEntry);
|
||||
SetDuration(spell->GetDuration());
|
||||
|
||||
@@ -65,7 +65,7 @@ void Corpse::RemoveFromWorld()
|
||||
bool Corpse::Create(ObjectGuid::LowType guidlow, Map* map)
|
||||
{
|
||||
SetMap(map);
|
||||
Object::_Create(guidlow, 0, HIGHGUID_CORPSE);
|
||||
Object::_Create(guidlow, 0, HighGuid::Corpse);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ bool Corpse::Create(ObjectGuid::LowType guidlow, Player* owner)
|
||||
//in other way we will get a crash in Corpse::SaveToDB()
|
||||
SetMap(owner->GetMap());
|
||||
|
||||
WorldObject::_Create(guidlow, HIGHGUID_CORPSE, owner->GetPhaseMask());
|
||||
WorldObject::_Create(guidlow, HighGuid::Corpse, owner->GetPhaseMask());
|
||||
|
||||
SetObjectScale(1);
|
||||
SetGuidValue(CORPSE_FIELD_OWNER, owner->GetGUID());
|
||||
@@ -169,7 +169,7 @@ bool Corpse::LoadCorpseFromDB(ObjectGuid::LowType guid, Field* fields)
|
||||
float o = fields[3].GetFloat();
|
||||
uint32 mapId = fields[4].GetUInt16();
|
||||
|
||||
Object::_Create(guid, 0, HIGHGUID_CORPSE);
|
||||
Object::_Create(guid, 0, HighGuid::Corpse);
|
||||
|
||||
SetUInt32Value(CORPSE_FIELD_DISPLAY_ID, fields[5].GetUInt32());
|
||||
_LoadIntoDataField(fields[6].GetCString(), CORPSE_FIELD_ITEM, EQUIPMENT_SLOT_END);
|
||||
@@ -177,7 +177,7 @@ bool Corpse::LoadCorpseFromDB(ObjectGuid::LowType guid, Field* fields)
|
||||
SetUInt32Value(CORPSE_FIELD_BYTES_2, fields[8].GetUInt32());
|
||||
SetUInt32Value(CORPSE_FIELD_FLAGS, fields[9].GetUInt8());
|
||||
SetUInt32Value(CORPSE_FIELD_DYNAMIC_FLAGS, fields[10].GetUInt8());
|
||||
SetGuidValue(CORPSE_FIELD_OWNER, ObjectGuid(HIGHGUID_PLAYER, fields[16].GetUInt64()));
|
||||
SetGuidValue(CORPSE_FIELD_OWNER, ObjectGuid(HighGuid::Player, fields[16].GetUInt64()));
|
||||
|
||||
m_time = time_t(fields[11].GetUInt32());
|
||||
|
||||
|
||||
@@ -472,7 +472,7 @@ void Creature::Update(uint32 diff)
|
||||
if (!allowed) // Will be rechecked on next Update call
|
||||
break;
|
||||
|
||||
ObjectGuid dbtableHighGuid(HIGHGUID_UNIT, GetEntry(), m_DBTableGuid);
|
||||
ObjectGuid dbtableHighGuid(HighGuid::Creature, GetEntry(), m_DBTableGuid);
|
||||
time_t linkedRespawntime = GetMap()->GetLinkedRespawnTime(dbtableHighGuid);
|
||||
if (!linkedRespawntime) // Can respawn
|
||||
Respawn();
|
||||
@@ -1194,7 +1194,7 @@ bool Creature::CreateFromProto(ObjectGuid::LowType guidlow, uint32 entry, Creatu
|
||||
|
||||
SetOriginalEntry(entry);
|
||||
|
||||
Object::_Create(guidlow, entry, (vehId || cinfo->VehicleId) ? HIGHGUID_VEHICLE : HIGHGUID_UNIT);
|
||||
Object::_Create(guidlow, entry, (vehId || cinfo->VehicleId) ? HighGuid::Vehicle : HighGuid::Creature);
|
||||
|
||||
if (!UpdateEntry(entry, data))
|
||||
return false;
|
||||
@@ -1229,11 +1229,11 @@ bool Creature::LoadCreatureFromDB(ObjectGuid::LowType guid, Map* map, bool addTo
|
||||
m_DBTableGuid = guid;
|
||||
if (map->GetInstanceId() == 0)
|
||||
{
|
||||
if (map->GetCreature(ObjectGuid(HIGHGUID_UNIT, data->id, guid)))
|
||||
if (map->GetCreature(ObjectGuid(HighGuid::Creature, data->id, guid)))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
guid = sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate();
|
||||
guid = sObjectMgr->GetGenerator<HighGuid::Creature>()->Generate();
|
||||
|
||||
if (!Create(guid, map, data->phaseMask, data->id, data->posX, data->posY, data->posZ, data->orientation, data))
|
||||
return false;
|
||||
|
||||
@@ -91,7 +91,7 @@ bool DynamicObject::CreateDynamicObject(ObjectGuid::LowType guidlow, Unit* caste
|
||||
return false;
|
||||
}
|
||||
|
||||
WorldObject::_Create(guidlow, HIGHGUID_DYNAMICOBJECT, caster->GetPhaseMask());
|
||||
WorldObject::_Create(guidlow, HighGuid::DynamicObject, caster->GetPhaseMask());
|
||||
|
||||
SetEntry(spell->Id);
|
||||
SetObjectScale(1);
|
||||
|
||||
@@ -194,7 +194,7 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u
|
||||
if (goinfo->type == GAMEOBJECT_TYPE_TRANSPORT)
|
||||
m_updateFlag |= UPDATEFLAG_TRANSPORT;
|
||||
|
||||
Object::_Create(guidlow, goinfo->entry, HIGHGUID_GAMEOBJECT);
|
||||
Object::_Create(guidlow, goinfo->entry, HighGuid::GameObject);
|
||||
|
||||
m_goInfo = goinfo;
|
||||
|
||||
@@ -404,7 +404,7 @@ void GameObject::Update(uint32 diff)
|
||||
time_t now = time(NULL);
|
||||
if (m_respawnTime <= now) // timer expired
|
||||
{
|
||||
ObjectGuid dbtableHighGuid(HIGHGUID_GAMEOBJECT, GetEntry(), m_DBTableGuid);
|
||||
ObjectGuid dbtableHighGuid(HighGuid::GameObject, GetEntry(), m_DBTableGuid);
|
||||
time_t linkedRespawntime = GetMap()->GetLinkedRespawnTime(dbtableHighGuid);
|
||||
if (linkedRespawntime) // Can't respawn, the master is dead
|
||||
{
|
||||
@@ -853,7 +853,7 @@ bool GameObject::LoadGameObjectFromDB(ObjectGuid::LowType guid, Map* map, bool a
|
||||
|
||||
m_DBTableGuid = guid;
|
||||
if (map->GetInstanceId() != 0)
|
||||
guid = sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate();
|
||||
guid = sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate();
|
||||
|
||||
if (!Create(guid, entry, map, phaseMask, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state, artKit))
|
||||
return false;
|
||||
|
||||
@@ -77,7 +77,7 @@ bool Bag::Create(ObjectGuid::LowType guidlow, uint32 itemid, Player const* owner
|
||||
if (!itemProto || itemProto->ContainerSlots > MAX_BAG_SIZE)
|
||||
return false;
|
||||
|
||||
Object::_Create(guidlow, 0, HIGHGUID_CONTAINER);
|
||||
Object::_Create(guidlow, 0, HighGuid::Item);
|
||||
|
||||
SetEntry(itemid);
|
||||
SetObjectScale(1.0f);
|
||||
|
||||
@@ -262,7 +262,7 @@ Item::Item()
|
||||
|
||||
bool Item::Create(ObjectGuid::LowType guidlow, uint32 itemid, Player const* owner)
|
||||
{
|
||||
Object::_Create(guidlow, 0, HIGHGUID_ITEM);
|
||||
Object::_Create(guidlow, 0, HighGuid::Item);
|
||||
|
||||
SetEntry(itemid);
|
||||
SetObjectScale(1.0f);
|
||||
@@ -409,7 +409,7 @@ bool Item::LoadFromDB(ObjectGuid::LowType guid, ObjectGuid owner_guid, Field* fi
|
||||
|
||||
// create item before any checks for store correct guid
|
||||
// and allow use "FSetState(ITEM_REMOVED); SaveToDB();" for deleting item from DB
|
||||
Object::_Create(guid, 0, HIGHGUID_ITEM);
|
||||
Object::_Create(guid, 0, HighGuid::Item);
|
||||
|
||||
// Set entry, MUST be before proto check
|
||||
SetEntry(entry);
|
||||
@@ -424,8 +424,8 @@ bool Item::LoadFromDB(ObjectGuid::LowType guid, ObjectGuid owner_guid, Field* fi
|
||||
SetOwnerGUID(owner_guid);
|
||||
|
||||
bool need_save = false; // need explicit save data at load fixes
|
||||
SetGuidValue(ITEM_FIELD_CREATOR, ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt64()));
|
||||
SetGuidValue(ITEM_FIELD_GIFTCREATOR, ObjectGuid(HIGHGUID_PLAYER, fields[1].GetUInt64()));
|
||||
SetGuidValue(ITEM_FIELD_CREATOR, ObjectGuid(HighGuid::Player, fields[0].GetUInt64()));
|
||||
SetGuidValue(ITEM_FIELD_GIFTCREATOR, ObjectGuid(HighGuid::Player, fields[1].GetUInt64()));
|
||||
SetCount(fields[2].GetUInt32());
|
||||
|
||||
uint32 duration = fields[3].GetUInt32();
|
||||
@@ -1041,7 +1041,7 @@ Item* Item::CreateItem(uint32 itemEntry, uint32 count, Player const* player)
|
||||
ASSERT(count != 0 && "pProto->Stackable == 0 but checked at loading already");
|
||||
|
||||
Item* item = NewItemOrBag(proto);
|
||||
if (item->Create(sObjectMgr->GetGenerator<HIGHGUID_ITEM>()->Generate(), itemEntry, player))
|
||||
if (item->Create(sObjectMgr->GetGenerator<HighGuid::Item>()->Generate(), itemEntry, player))
|
||||
{
|
||||
item->SetCount(count);
|
||||
return item;
|
||||
|
||||
@@ -186,15 +186,15 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
|
||||
|
||||
switch (GetGUID().GetHigh())
|
||||
{
|
||||
case HIGHGUID_PLAYER:
|
||||
case HIGHGUID_PET:
|
||||
case HIGHGUID_CORPSE:
|
||||
case HIGHGUID_DYNAMICOBJECT:
|
||||
case HIGHGUID_AREATRIGGER:
|
||||
case HighGuid::Player:
|
||||
case HighGuid::Pet:
|
||||
case HighGuid::Corpse:
|
||||
case HighGuid::DynamicObject:
|
||||
case HighGuid::AreaTrigger:
|
||||
updateType = UPDATETYPE_CREATE_OBJECT2;
|
||||
break;
|
||||
case HIGHGUID_UNIT:
|
||||
case HIGHGUID_VEHICLE:
|
||||
case HighGuid::Creature:
|
||||
case HighGuid::Vehicle:
|
||||
{
|
||||
if (TempSummon const* summon = ToUnit()->ToTempSummon())
|
||||
if (summon->GetSummonerGUID().IsPlayer())
|
||||
@@ -202,7 +202,7 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
|
||||
|
||||
break;
|
||||
}
|
||||
case HIGHGUID_GAMEOBJECT:
|
||||
case HighGuid::GameObject:
|
||||
{
|
||||
if (ToGameObject()->GetOwnerGUID().IsPlayer())
|
||||
updateType = UPDATETYPE_CREATE_OBJECT2;
|
||||
@@ -2401,7 +2401,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
|
||||
break;
|
||||
}
|
||||
|
||||
if (!summon->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), this, 0, entry, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), nullptr, vehId))
|
||||
if (!summon->Create(sObjectMgr->GetGenerator<HighGuid::Creature>()->Generate(), this, 0, entry, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), nullptr, vehId))
|
||||
{
|
||||
delete summon;
|
||||
return NULL;
|
||||
@@ -2499,7 +2499,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
|
||||
|
||||
Map* map = GetMap();
|
||||
GameObject* go = new GameObject();
|
||||
if (!go->Create(sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate(), entry, map, GetPhaseMask(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY))
|
||||
if (!go->Create(sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate(), entry, map, GetPhaseMask(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY))
|
||||
{
|
||||
delete go;
|
||||
return NULL;
|
||||
|
||||
@@ -28,21 +28,18 @@ char const* ObjectGuid::GetTypeName(HighGuid high)
|
||||
{
|
||||
switch (high)
|
||||
{
|
||||
case HIGHGUID_ITEM: return "Item";
|
||||
case HIGHGUID_PLAYER: return "Player";
|
||||
case HIGHGUID_GAMEOBJECT: return "Gameobject";
|
||||
case HIGHGUID_TRANSPORT: return "Transport";
|
||||
case HIGHGUID_UNIT: return "Creature";
|
||||
case HIGHGUID_PET: return "Pet";
|
||||
case HIGHGUID_VEHICLE: return "Vehicle";
|
||||
case HIGHGUID_DYNAMICOBJECT: return "DynObject";
|
||||
case HIGHGUID_CORPSE: return "Corpse";
|
||||
case HIGHGUID_AREATRIGGER: return "AreaTrigger";
|
||||
case HIGHGUID_BATTLEGROUND: return "Battleground";
|
||||
case HIGHGUID_MO_TRANSPORT: return "MoTransport";
|
||||
case HIGHGUID_INSTANCE: return "InstanceID";
|
||||
case HIGHGUID_GROUP: return "Group";
|
||||
case HIGHGUID_GUILD: return "Guild";
|
||||
case HighGuid::Item: return "Item";
|
||||
case HighGuid::Player: return "Player";
|
||||
case HighGuid::GameObject: return "Gameobject";
|
||||
case HighGuid::Creature: return "Creature";
|
||||
case HighGuid::Pet: return "Pet";
|
||||
case HighGuid::Vehicle: return "Vehicle";
|
||||
case HighGuid::DynamicObject: return "DynObject";
|
||||
case HighGuid::Corpse: return "Corpse";
|
||||
case HighGuid::AreaTrigger: return "AreaTrigger";
|
||||
case HighGuid::Transport: return "Transport";
|
||||
case HighGuid::Party: return "Party";
|
||||
case HighGuid::Guild: return "Guild";
|
||||
default:
|
||||
return "<unknown>";
|
||||
}
|
||||
@@ -136,13 +133,13 @@ std::ostream& operator<<(std::ostream& stream, ObjectGuid const& guid)
|
||||
return stream;
|
||||
}
|
||||
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HIGHGUID_PLAYER>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HIGHGUID_UNIT>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HIGHGUID_PET>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HIGHGUID_VEHICLE>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HIGHGUID_ITEM>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HIGHGUID_GAMEOBJECT>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HIGHGUID_DYNAMICOBJECT>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HIGHGUID_CORPSE>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HIGHGUID_AREATRIGGER>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HIGHGUID_MO_TRANSPORT>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HighGuid::Player>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HighGuid::Creature>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HighGuid::Pet>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HighGuid::Vehicle>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HighGuid::Item>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HighGuid::GameObject>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HighGuid::DynamicObject>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HighGuid::Corpse>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HighGuid::AreaTrigger>::Generate();
|
||||
template ObjectGuid::LowType ObjectGuidGenerator<HighGuid::Transport>::Generate();
|
||||
|
||||
@@ -35,10 +35,12 @@ enum TypeID
|
||||
TYPEID_GAMEOBJECT = 5,
|
||||
TYPEID_DYNAMICOBJECT = 6,
|
||||
TYPEID_CORPSE = 7,
|
||||
TYPEID_AREATRIGGER = 8
|
||||
TYPEID_AREATRIGGER = 8,
|
||||
TYPEID_SCENEOBJECT = 9,
|
||||
TYPEID_CONVERSATION = 10
|
||||
};
|
||||
|
||||
#define NUM_CLIENT_OBJECT_TYPES 9
|
||||
#define NUM_CLIENT_OBJECT_TYPES 11
|
||||
|
||||
enum TypeMask
|
||||
{
|
||||
@@ -54,24 +56,52 @@ enum TypeMask
|
||||
TYPEMASK_SEER = TYPEMASK_PLAYER | TYPEMASK_UNIT | TYPEMASK_DYNAMICOBJECT
|
||||
};
|
||||
|
||||
enum HighGuid
|
||||
enum class HighGuid
|
||||
{
|
||||
HIGHGUID_ITEM = 0x400, // blizz 4000
|
||||
HIGHGUID_CONTAINER = 0x400, // blizz 4000
|
||||
HIGHGUID_PLAYER = 0x000, // blizz 0000
|
||||
HIGHGUID_GAMEOBJECT = 0xF11, // blizz F110
|
||||
HIGHGUID_TRANSPORT = 0xF12, // blizz F120 (for GAMEOBJECT_TYPE_TRANSPORT)
|
||||
HIGHGUID_UNIT = 0xF13, // blizz F130
|
||||
HIGHGUID_PET = 0xF14, // blizz F140
|
||||
HIGHGUID_VEHICLE = 0xF15, // blizz F550
|
||||
HIGHGUID_DYNAMICOBJECT = 0xF10, // blizz F100
|
||||
HIGHGUID_CORPSE = 0xF101, // blizz F100
|
||||
HIGHGUID_AREATRIGGER = 0xF102,
|
||||
HIGHGUID_BATTLEGROUND = 0x1F1,
|
||||
HIGHGUID_MO_TRANSPORT = 0x1FC, // blizz 1FC0 (for GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT)
|
||||
HIGHGUID_INSTANCE = 0x1F4, // blizz 1F40
|
||||
HIGHGUID_GROUP = 0x1F5,
|
||||
HIGHGUID_GUILD = 0x1FF
|
||||
Null = 0,
|
||||
Uniq = 1,
|
||||
Player = 2,
|
||||
Item = 3,
|
||||
StaticDoor = 4,
|
||||
Transport = 5,
|
||||
Conversation = 6,
|
||||
Creature = 7,
|
||||
Vehicle = 8,
|
||||
Pet = 9,
|
||||
GameObject = 10,
|
||||
DynamicObject = 11,
|
||||
AreaTrigger = 12,
|
||||
Corpse = 13,
|
||||
LootObject = 14,
|
||||
SceneObject = 15,
|
||||
Scenario = 16,
|
||||
AIGroup = 17,
|
||||
DynamicDoor = 18,
|
||||
ClientActor = 19,
|
||||
Vignette = 20,
|
||||
CallForHelp = 21,
|
||||
AIResource = 22,
|
||||
AILock = 23,
|
||||
AILockTicket = 24,
|
||||
ChatChannel = 25,
|
||||
Party = 26,
|
||||
Guild = 27,
|
||||
WowAccount = 28,
|
||||
BNetAccount = 29,
|
||||
GMTask = 30,
|
||||
MobileSession = 31,
|
||||
RaidGroup = 32,
|
||||
Spell = 33,
|
||||
Mail = 34,
|
||||
WebObj = 35,
|
||||
LFGObject = 36,
|
||||
LFGList = 37,
|
||||
UserRouter = 38,
|
||||
PVPQueueGroup = 39,
|
||||
UserClient = 40,
|
||||
PetBattle = 41,
|
||||
UniqueUserClient = 42,
|
||||
BattlePet = 43
|
||||
};
|
||||
|
||||
class ObjectGuid;
|
||||
@@ -97,8 +127,8 @@ class ObjectGuid
|
||||
typedef uint64 LowType;
|
||||
|
||||
ObjectGuid() : _low(0), _high(0) { }
|
||||
ObjectGuid(HighGuid hi, uint32 entry, LowType counter) : _low(counter ? uint64(counter) | (uint64(entry) << 32) | (uint64(hi) << ((hi == HIGHGUID_CORPSE || hi == HIGHGUID_AREATRIGGER) ? 48 : 52)) : 0), _high(0) { }
|
||||
ObjectGuid(HighGuid hi, LowType counter) : _low(counter ? uint64(counter) | (uint64(hi) << ((hi == HIGHGUID_CORPSE || hi == HIGHGUID_AREATRIGGER) ? 48 : 52)) : 0), _high(0) { }
|
||||
ObjectGuid(HighGuid hi, uint32 entry, LowType counter) : _low(counter ? uint64(counter) | (uint64(entry) << 32) | (uint64(hi) << ((hi == HighGuid::Corpse || hi == HighGuid::AreaTrigger) ? 48 : 52)) : 0), _high(0) { }
|
||||
ObjectGuid(HighGuid hi, LowType counter) : _low(counter ? uint64(counter) | (uint64(hi) << ((hi == HighGuid::Corpse || hi == HighGuid::AreaTrigger) ? 48 : 52)) : 0), _high(0) { }
|
||||
ObjectGuid(ObjectGuid const&) = default;
|
||||
|
||||
PackedGuidReader ReadAsPacked() { return PackedGuidReader(*this); }
|
||||
@@ -113,7 +143,7 @@ class ObjectGuid
|
||||
HighGuid GetHigh() const
|
||||
{
|
||||
uint32 temp = ((uint64(_low) >> 48) & 0x0000FFFF);
|
||||
return HighGuid((temp == HIGHGUID_CORPSE || temp == HIGHGUID_AREATRIGGER) ? temp : ((temp >> 4) & 0x00000FFF));
|
||||
return HighGuid((temp == uint32(HighGuid::Corpse) || temp == uint32(HighGuid::AreaTrigger)) ? temp : ((temp >> 4) & 0x00000FFF));
|
||||
}
|
||||
uint32 GetEntry() const { return HasEntry() ? uint32((_low >> 32) & UI64LIT(0x00000000000FFFFF)) : 0; }
|
||||
LowType GetCounter() const
|
||||
@@ -141,47 +171,42 @@ class ObjectGuid
|
||||
}
|
||||
|
||||
bool IsEmpty() const { return _low == 0 && _high == 0; }
|
||||
bool IsCreature() const { return GetHigh() == HIGHGUID_UNIT; }
|
||||
bool IsPet() const { return GetHigh() == HIGHGUID_PET; }
|
||||
bool IsVehicle() const { return GetHigh() == HIGHGUID_VEHICLE; }
|
||||
bool IsCreature() const { return GetHigh() == HighGuid::Creature; }
|
||||
bool IsPet() const { return GetHigh() == HighGuid::Pet; }
|
||||
bool IsVehicle() const { return GetHigh() == HighGuid::Vehicle; }
|
||||
bool IsCreatureOrPet() const { return IsCreature() || IsPet(); }
|
||||
bool IsCreatureOrVehicle() const { return IsCreature() || IsVehicle(); }
|
||||
bool IsAnyTypeCreature() const { return IsCreature() || IsPet() || IsVehicle(); }
|
||||
bool IsPlayer() const { return !IsEmpty() && GetHigh() == HIGHGUID_PLAYER; }
|
||||
bool IsPlayer() const { return !IsEmpty() && GetHigh() == HighGuid::Player; }
|
||||
bool IsUnit() const { return IsAnyTypeCreature() || IsPlayer(); }
|
||||
bool IsItem() const { return GetHigh() == HIGHGUID_ITEM; }
|
||||
bool IsGameObject() const { return GetHigh() == HIGHGUID_GAMEOBJECT; }
|
||||
bool IsDynamicObject() const { return GetHigh() == HIGHGUID_DYNAMICOBJECT; }
|
||||
bool IsCorpse() const { return GetHigh() == HIGHGUID_CORPSE; }
|
||||
bool IsAreaTrigger() const { return GetHigh() == HIGHGUID_AREATRIGGER; }
|
||||
bool IsBattleground() const { return GetHigh() == HIGHGUID_BATTLEGROUND; }
|
||||
bool IsTransport() const { return GetHigh() == HIGHGUID_TRANSPORT; }
|
||||
bool IsMOTransport() const { return GetHigh() == HIGHGUID_MO_TRANSPORT; }
|
||||
bool IsAnyTypeGameObject() const { return IsGameObject() || IsTransport() || IsMOTransport(); }
|
||||
bool IsInstance() const { return GetHigh() == HIGHGUID_INSTANCE; }
|
||||
bool IsGroup() const { return GetHigh() == HIGHGUID_GROUP; }
|
||||
bool IsGuild() const { return GetHigh() == HIGHGUID_GUILD; }
|
||||
bool IsItem() const { return GetHigh() == HighGuid::Item; }
|
||||
bool IsGameObject() const { return GetHigh() == HighGuid::GameObject; }
|
||||
bool IsDynamicObject() const { return GetHigh() == HighGuid::DynamicObject; }
|
||||
bool IsCorpse() const { return GetHigh() == HighGuid::Corpse; }
|
||||
bool IsAreaTrigger() const { return GetHigh() == HighGuid::AreaTrigger; }
|
||||
bool IsMOTransport() const { return GetHigh() == HighGuid::Transport; }
|
||||
bool IsAnyTypeGameObject() const { return IsGameObject() || IsMOTransport(); }
|
||||
bool IsParty() const { return GetHigh() == HighGuid::Party; }
|
||||
bool IsGuild() const { return GetHigh() == HighGuid::Guild; }
|
||||
|
||||
static TypeID GetTypeId(HighGuid high)
|
||||
{
|
||||
switch (high)
|
||||
{
|
||||
case HIGHGUID_ITEM: return TYPEID_ITEM;
|
||||
case HighGuid::Item: return TYPEID_ITEM;
|
||||
//case HIGHGUID_CONTAINER: return TYPEID_CONTAINER; HIGHGUID_CONTAINER==HIGHGUID_ITEM currently
|
||||
case HIGHGUID_UNIT: return TYPEID_UNIT;
|
||||
case HIGHGUID_PET: return TYPEID_UNIT;
|
||||
case HIGHGUID_PLAYER: return TYPEID_PLAYER;
|
||||
case HIGHGUID_GAMEOBJECT: return TYPEID_GAMEOBJECT;
|
||||
case HIGHGUID_DYNAMICOBJECT: return TYPEID_DYNAMICOBJECT;
|
||||
case HIGHGUID_CORPSE: return TYPEID_CORPSE;
|
||||
case HIGHGUID_AREATRIGGER: return TYPEID_AREATRIGGER;
|
||||
case HIGHGUID_MO_TRANSPORT: return TYPEID_GAMEOBJECT;
|
||||
case HIGHGUID_VEHICLE: return TYPEID_UNIT;
|
||||
case HighGuid::Creature: return TYPEID_UNIT;
|
||||
case HighGuid::Pet: return TYPEID_UNIT;
|
||||
case HighGuid::Player: return TYPEID_PLAYER;
|
||||
case HighGuid::GameObject: return TYPEID_GAMEOBJECT;
|
||||
case HighGuid::DynamicObject: return TYPEID_DYNAMICOBJECT;
|
||||
case HighGuid::Corpse: return TYPEID_CORPSE;
|
||||
case HighGuid::AreaTrigger: return TYPEID_AREATRIGGER;
|
||||
case HighGuid::Transport: return TYPEID_GAMEOBJECT;
|
||||
case HighGuid::Vehicle: return TYPEID_UNIT;
|
||||
// unknown
|
||||
case HIGHGUID_INSTANCE:
|
||||
case HIGHGUID_BATTLEGROUND:
|
||||
case HIGHGUID_GROUP:
|
||||
case HIGHGUID_GUILD:
|
||||
case HighGuid::Party:
|
||||
case HighGuid::Guild:
|
||||
default: return TYPEID_OBJECT;
|
||||
}
|
||||
}
|
||||
@@ -210,19 +235,17 @@ class ObjectGuid
|
||||
{
|
||||
switch (high)
|
||||
{
|
||||
case HIGHGUID_ITEM:
|
||||
case HIGHGUID_PLAYER:
|
||||
case HIGHGUID_DYNAMICOBJECT:
|
||||
case HIGHGUID_CORPSE:
|
||||
case HIGHGUID_MO_TRANSPORT:
|
||||
case HIGHGUID_INSTANCE:
|
||||
case HIGHGUID_GROUP:
|
||||
case HighGuid::Item:
|
||||
case HighGuid::Player:
|
||||
case HighGuid::DynamicObject:
|
||||
case HighGuid::Corpse:
|
||||
case HighGuid::Transport:
|
||||
case HighGuid::Party:
|
||||
return false;
|
||||
case HIGHGUID_GAMEOBJECT:
|
||||
case HIGHGUID_TRANSPORT:
|
||||
case HIGHGUID_UNIT:
|
||||
case HIGHGUID_PET:
|
||||
case HIGHGUID_VEHICLE:
|
||||
case HighGuid::GameObject:
|
||||
case HighGuid::Creature:
|
||||
case HighGuid::Pet:
|
||||
case HighGuid::Vehicle:
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
|
||||
}
|
||||
|
||||
Map* map = owner->GetMap();
|
||||
if (!Create(sObjectMgr->GetGenerator<HIGHGUID_PET>()->Generate(), map, owner->GetPhaseMask(), petEntry, petId))
|
||||
if (!Create(sObjectMgr->GetGenerator<HighGuid::Pet>()->Generate(), map, owner->GetPhaseMask(), petEntry, petId))
|
||||
return false;
|
||||
|
||||
for (auto itr : owner->GetPhases())
|
||||
@@ -771,7 +771,7 @@ bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phas
|
||||
{
|
||||
TC_LOG_DEBUG("entities.pet", "Pet::CreateBaseForTamed");
|
||||
uint32 petId = sObjectMgr->GeneratePetNumber();
|
||||
if (!Create(sObjectMgr->GetGenerator<HIGHGUID_PET>()->Generate(), map, phaseMask, cinfo->Entry, petId))
|
||||
if (!Create(sObjectMgr->GetGenerator<HighGuid::Pet>()->Generate(), map, phaseMask, cinfo->Entry, petId))
|
||||
return false;
|
||||
|
||||
setPowerType(POWER_FOCUS);
|
||||
@@ -1871,7 +1871,7 @@ bool Pet::Create(ObjectGuid::LowType guidlow, Map* map, uint32 phaseMask, uint32
|
||||
SetMap(map);
|
||||
|
||||
SetPhaseMask(phaseMask, false);
|
||||
Object::_Create(guidlow, petId, HIGHGUID_PET);
|
||||
Object::_Create(guidlow, petId, HighGuid::Pet);
|
||||
|
||||
m_DBTableGuid = guidlow;
|
||||
m_originalEntry = Entry;
|
||||
|
||||
@@ -982,7 +982,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
|
||||
// should check that skin, face, hair* are valid via DBC per race/class
|
||||
// also do it in Player::BuildEnumData, Player::LoadFromDB
|
||||
|
||||
Object::_Create(guidlow, 0, HIGHGUID_PLAYER);
|
||||
Object::_Create(guidlow, 0, HighGuid::Player);
|
||||
|
||||
m_name = createInfo->Name;
|
||||
|
||||
@@ -1964,7 +1964,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* dataBuffer)
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
ObjectGuid guid(HIGHGUID_PLAYER, fields[0].GetUInt64());
|
||||
ObjectGuid guid(HighGuid::Player, fields[0].GetUInt64());
|
||||
std::string name = fields[1].GetString();
|
||||
uint8 playerRace = fields[2].GetUInt8();
|
||||
uint8 playerClass = fields[3].GetUInt8();
|
||||
@@ -1983,7 +1983,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* dataBuffer)
|
||||
uint64 guildId = fields[13].GetUInt64();
|
||||
ObjectGuid guildGuid;
|
||||
if (guildId)
|
||||
guildGuid = ObjectGuid(HIGHGUID_GUILD, guildId);
|
||||
guildGuid = ObjectGuid(HighGuid::Guild, guildId);
|
||||
uint32 playerFlags = fields[14].GetUInt32();
|
||||
uint32 atLoginFlags = fields[15].GetUInt16();
|
||||
Tokenizer equipment(fields[19].GetString(), ' ');
|
||||
@@ -4809,7 +4809,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe
|
||||
{
|
||||
do
|
||||
{
|
||||
if (Player* pFriend = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, (*resultFriends)[0].GetUInt64())))
|
||||
if (Player* pFriend = ObjectAccessor::FindPlayer(ObjectGuid(HighGuid::Player, (*resultFriends)[0].GetUInt64())))
|
||||
{
|
||||
pFriend->GetSocial()->RemoveFromSocialList(playerguid, false);
|
||||
sSocialMgr->SendFriendStatus(pFriend, FRIEND_REMOVED, playerguid, false);
|
||||
@@ -5017,7 +5017,7 @@ void Player::DeleteOldCharacters(uint32 keepDays)
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
Player::DeleteFromDB(ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt64()), fields[1].GetUInt32(), true, true);
|
||||
Player::DeleteFromDB(ObjectGuid(HighGuid::Player, fields[0].GetUInt64()), fields[1].GetUInt32(), true, true);
|
||||
}
|
||||
while (result->NextRow());
|
||||
}
|
||||
@@ -5205,7 +5205,7 @@ void Player::CreateCorpse()
|
||||
Corpse* corpse = new Corpse((m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH) ? CORPSE_RESURRECTABLE_PVP : CORPSE_RESURRECTABLE_PVE);
|
||||
SetPvPDeath(false);
|
||||
|
||||
if (!corpse->Create(sObjectMgr->GetGenerator<HIGHGUID_CORPSE>()->Generate(), this))
|
||||
if (!corpse->Create(sObjectMgr->GetGenerator<HighGuid::Corpse>()->Generate(), this))
|
||||
{
|
||||
delete corpse;
|
||||
return;
|
||||
@@ -7592,7 +7592,7 @@ void Player::UpdateConquestCurrencyCap(uint32 currency)
|
||||
void Player::SetInGuild(ObjectGuid::LowType guildId)
|
||||
{
|
||||
if (guildId)
|
||||
SetGuidValue(OBJECT_FIELD_DATA, ObjectGuid(HIGHGUID_GUILD, guildId));
|
||||
SetGuidValue(OBJECT_FIELD_DATA, ObjectGuid(HighGuid::Guild, guildId));
|
||||
else
|
||||
SetGuidValue(OBJECT_FIELD_DATA, ObjectGuid::Empty);
|
||||
|
||||
@@ -14868,12 +14868,12 @@ Quest const* Player::GetNextQuest(ObjectGuid guid, Quest const* quest)
|
||||
|
||||
switch (guid.GetHigh())
|
||||
{
|
||||
case HIGHGUID_PLAYER:
|
||||
case HighGuid::Player:
|
||||
ASSERT(quest->HasFlag(QUEST_FLAGS_AUTOCOMPLETE));
|
||||
return sObjectMgr->GetQuestTemplate(nextQuestID);
|
||||
case HIGHGUID_UNIT:
|
||||
case HIGHGUID_PET:
|
||||
case HIGHGUID_VEHICLE:
|
||||
case HighGuid::Creature:
|
||||
case HighGuid::Pet:
|
||||
case HighGuid::Vehicle:
|
||||
{
|
||||
if (Creature* creature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid))
|
||||
objectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry());
|
||||
@@ -14881,7 +14881,7 @@ Quest const* Player::GetNextQuest(ObjectGuid guid, Quest const* quest)
|
||||
return NULL;
|
||||
break;
|
||||
}
|
||||
case HIGHGUID_GAMEOBJECT:
|
||||
case HighGuid::GameObject:
|
||||
{
|
||||
//we should obtain map pointer from GetMap() in 99% of cases. Special case
|
||||
//only for quests which cast teleport spells on player
|
||||
@@ -17229,7 +17229,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
|
||||
return false;
|
||||
}
|
||||
|
||||
Object::_Create(guid.GetCounter(), 0, HIGHGUID_PLAYER);
|
||||
Object::_Create(guid.GetCounter(), 0, HighGuid::Player);
|
||||
|
||||
m_name = fields[2].GetString();
|
||||
|
||||
@@ -17431,7 +17431,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
|
||||
// currently we do not support transport in bg
|
||||
else if (transLowGUID)
|
||||
{
|
||||
ObjectGuid transGUID(HIGHGUID_MO_TRANSPORT, transLowGUID);
|
||||
ObjectGuid transGUID(HighGuid::Transport, transLowGUID);
|
||||
|
||||
Transport* transport = NULL;
|
||||
if (GameObject* go = HashMapHolder<GameObject>::Find(transGUID))
|
||||
@@ -18155,7 +18155,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
|
||||
Field* fields = result->Fetch();
|
||||
if (Item* item = _LoadItem(trans, zoneId, timeDiff, fields))
|
||||
{
|
||||
ObjectGuid bagGuid(HIGHGUID_ITEM, fields[11].GetUInt64());
|
||||
ObjectGuid bagGuid(HighGuid::Item, fields[11].GetUInt64());
|
||||
uint8 slot = fields[12].GetUInt8();
|
||||
|
||||
uint8 err = EQUIP_ERR_OK;
|
||||
@@ -18275,7 +18275,7 @@ void Player::_LoadVoidStorage(PreparedQueryResult result)
|
||||
uint64 itemId = fields[0].GetUInt64();
|
||||
uint32 itemEntry = fields[1].GetUInt32();
|
||||
uint8 slot = fields[2].GetUInt8();
|
||||
ObjectGuid creatorGuid(HIGHGUID_PLAYER, fields[3].GetUInt64());
|
||||
ObjectGuid creatorGuid(HighGuid::Player, fields[3].GetUInt64());
|
||||
uint32 randomProperty = fields[4].GetUInt32();
|
||||
uint32 suffixFactor = fields[5].GetUInt32();
|
||||
|
||||
@@ -18379,7 +18379,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
|
||||
Tokenizer GUIDlist(strGUID, ' ');
|
||||
GuidSet looters;
|
||||
for (Tokenizer::const_iterator itr = GUIDlist.begin(); itr != GUIDlist.end(); ++itr)
|
||||
looters.insert(ObjectGuid(HIGHGUID_PLAYER, uint64(strtoull(*itr, nullptr, 10))));
|
||||
looters.insert(ObjectGuid(HighGuid::Player, uint64(strtoull(*itr, nullptr, 10))));
|
||||
|
||||
if (looters.size() > 1 && item->GetTemplate()->GetMaxStackSize() == 1 && item->IsSoulBound())
|
||||
{
|
||||
@@ -18473,7 +18473,7 @@ void Player::_LoadMailedItems(Mail* mail)
|
||||
|
||||
Item* item = NewItemOrBag(proto);
|
||||
|
||||
if (!item->LoadFromDB(itemGuid, ObjectGuid(HIGHGUID_PLAYER, fields[13].GetUInt64()), fields, itemTemplate))
|
||||
if (!item->LoadFromDB(itemGuid, ObjectGuid(HighGuid::Player, fields[13].GetUInt64()), fields, itemTemplate))
|
||||
{
|
||||
TC_LOG_ERROR("entities.player", "Player::_LoadMailedItems - Item in mail (" UI64FMTD ") doesn't exist !!!! - item guid: %u, deleted from mail", mail->messageID, itemGuid);
|
||||
|
||||
@@ -21363,8 +21363,8 @@ void Player::RemovePetitionsAndSigns(ObjectGuid guid, uint32 type)
|
||||
do // this part effectively does nothing, since the deletion / modification only takes place _after_ the PetitionQuery. Though I don't know if the result remains intact if I execute the delete query beforehand.
|
||||
{ // and SendPetitionQueryOpcode reads data from the DB
|
||||
Field* fields = result->Fetch();
|
||||
ObjectGuid ownerguid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt64());
|
||||
ObjectGuid petitionguid = ObjectGuid(HIGHGUID_ITEM, fields[1].GetUInt64());
|
||||
ObjectGuid ownerguid = ObjectGuid(HighGuid::Player, fields[0].GetUInt64());
|
||||
ObjectGuid petitionguid = ObjectGuid(HighGuid::Item, fields[1].GetUInt64());
|
||||
|
||||
// send update if charter owner in game
|
||||
Player* owner = ObjectAccessor::FindConnectedPlayer(ownerguid);
|
||||
@@ -26393,7 +26393,7 @@ void Player::SendEquipmentSetList()
|
||||
if (itr->second.IgnoreMask & (1 << i))
|
||||
data << ignoredItemGuid;
|
||||
else
|
||||
data << ObjectGuid(HIGHGUID_ITEM, itr->second.Items[i]);
|
||||
data << ObjectGuid(HighGuid::Item, itr->second.Items[i]);
|
||||
}
|
||||
|
||||
++count; // client have limit but it checked at loading and set
|
||||
@@ -27543,7 +27543,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
|
||||
|
||||
Map* map = GetMap();
|
||||
uint32 pet_number = sObjectMgr->GeneratePetNumber();
|
||||
if (!pet->Create(sObjectMgr->GetGenerator<HIGHGUID_PET>()->Generate(), map, GetPhaseMask(), entry, pet_number))
|
||||
if (!pet->Create(sObjectMgr->GetGenerator<HighGuid::Pet>()->Generate(), map, GetPhaseMask(), entry, pet_number))
|
||||
{
|
||||
TC_LOG_ERROR("misc", "no such creature entry %u", entry);
|
||||
delete pet;
|
||||
|
||||
@@ -324,7 +324,7 @@ PlayerSocial* SocialMgr::LoadFromDB(PreparedQueryResult result, ObjectGuid const
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
friendGuid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt64());
|
||||
friendGuid = ObjectGuid(HighGuid::Player, fields[0].GetUInt64());
|
||||
flags = fields[1].GetUInt8();
|
||||
note = fields[2].GetString();
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ bool Transport::Create(ObjectGuid::LowType guidlow, uint32 entry, uint32 mapid,
|
||||
return false;
|
||||
}
|
||||
|
||||
Object::_Create(guidlow, 0, HIGHGUID_MO_TRANSPORT);
|
||||
Object::_Create(guidlow, 0, HighGuid::Transport);
|
||||
|
||||
GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(entry);
|
||||
|
||||
@@ -453,7 +453,7 @@ TempSummon* Transport::SummonPassenger(uint32 entry, Position const& pos, TempSu
|
||||
pos.GetPosition(x, y, z, o);
|
||||
CalculatePassengerPosition(x, y, z, &o);
|
||||
|
||||
if (!summon->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), map, 0, entry, x, y, z, o, nullptr, vehId))
|
||||
if (!summon->Create(sObjectMgr->GetGenerator<HighGuid::Creature>()->Generate(), map, 0, entry, x, y, z, o, nullptr, vehId))
|
||||
{
|
||||
delete summon;
|
||||
return NULL;
|
||||
|
||||
@@ -1123,7 +1123,7 @@ void GameEventMgr::UpdateEventNPCFlags(uint16 event_id)
|
||||
// get the creature data from the low guid to get the entry, to be able to find out the whole guid
|
||||
if (CreatureData const* data = sObjectMgr->GetCreatureData(itr->first))
|
||||
{
|
||||
Creature* cr = HashMapHolder<Creature>::Find(ObjectGuid(HIGHGUID_UNIT, data->id, itr->first));
|
||||
Creature* cr = HashMapHolder<Creature>::Find(ObjectGuid(HighGuid::Creature, data->id, itr->first));
|
||||
// if we found the creature, modify its npcflag
|
||||
if (cr)
|
||||
{
|
||||
@@ -1254,7 +1254,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
|
||||
{
|
||||
sObjectMgr->RemoveCreatureFromGrid(*itr, data);
|
||||
|
||||
if (Creature* creature = ObjectAccessor::GetObjectInWorld(ObjectGuid(HIGHGUID_UNIT, data->id, *itr), (Creature*)NULL))
|
||||
if (Creature* creature = ObjectAccessor::GetObjectInWorld(ObjectGuid(HighGuid::Creature, data->id, *itr), (Creature*)NULL))
|
||||
creature->AddObjectToRemoveList();
|
||||
}
|
||||
}
|
||||
@@ -1276,7 +1276,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
|
||||
{
|
||||
sObjectMgr->RemoveGameobjectFromGrid(*itr, data);
|
||||
|
||||
if (GameObject* pGameobject = ObjectAccessor::GetObjectInWorld(ObjectGuid(HIGHGUID_GAMEOBJECT, data->id, *itr), (GameObject*)NULL))
|
||||
if (GameObject* pGameobject = ObjectAccessor::GetObjectInWorld(ObjectGuid(HighGuid::GameObject, data->id, *itr), (GameObject*)NULL))
|
||||
pGameobject->AddObjectToRemoveList();
|
||||
}
|
||||
}
|
||||
@@ -1302,7 +1302,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
|
||||
continue;
|
||||
|
||||
// Update if spawned
|
||||
Creature* creature = ObjectAccessor::GetObjectInWorld(ObjectGuid(HIGHGUID_UNIT, data->id, itr->first), (Creature*)NULL);
|
||||
Creature* creature = ObjectAccessor::GetObjectInWorld(ObjectGuid(HighGuid::Creature, data->id, itr->first), (Creature*)NULL);
|
||||
if (creature)
|
||||
{
|
||||
if (activate)
|
||||
|
||||
@@ -85,16 +85,15 @@ WorldObject* ObjectAccessor::GetWorldObject(WorldObject const& p, ObjectGuid gui
|
||||
{
|
||||
switch (guid.GetHigh())
|
||||
{
|
||||
case HIGHGUID_PLAYER: return GetPlayer(p, guid);
|
||||
case HIGHGUID_TRANSPORT:
|
||||
case HIGHGUID_MO_TRANSPORT:
|
||||
case HIGHGUID_GAMEOBJECT: return GetGameObject(p, guid);
|
||||
case HIGHGUID_VEHICLE:
|
||||
case HIGHGUID_UNIT: return GetCreature(p, guid);
|
||||
case HIGHGUID_PET: return GetPet(p, guid);
|
||||
case HIGHGUID_DYNAMICOBJECT: return GetDynamicObject(p, guid);
|
||||
case HIGHGUID_AREATRIGGER: return GetAreaTrigger(p, guid);
|
||||
case HIGHGUID_CORPSE: return GetCorpse(p, guid);
|
||||
case HighGuid::Player: return GetPlayer(p, guid);
|
||||
case HighGuid::Transport:
|
||||
case HighGuid::GameObject: return GetGameObject(p, guid);
|
||||
case HighGuid::Vehicle:
|
||||
case HighGuid::Creature: return GetCreature(p, guid);
|
||||
case HighGuid::Pet: return GetPet(p, guid);
|
||||
case HighGuid::DynamicObject: return GetDynamicObject(p, guid);
|
||||
case HighGuid::AreaTrigger: return GetAreaTrigger(p, guid);
|
||||
case HighGuid::Corpse: return GetCorpse(p, guid);
|
||||
default: return NULL;
|
||||
}
|
||||
}
|
||||
@@ -103,37 +102,36 @@ Object* ObjectAccessor::GetObjectByTypeMask(WorldObject const& p, ObjectGuid gui
|
||||
{
|
||||
switch (guid.GetHigh())
|
||||
{
|
||||
case HIGHGUID_ITEM:
|
||||
case HighGuid::Item:
|
||||
if (typemask & TYPEMASK_ITEM && p.GetTypeId() == TYPEID_PLAYER)
|
||||
return ((Player const&)p).GetItemByGuid(guid);
|
||||
break;
|
||||
case HIGHGUID_PLAYER:
|
||||
case HighGuid::Player:
|
||||
if (typemask & TYPEMASK_PLAYER)
|
||||
return GetPlayer(p, guid);
|
||||
break;
|
||||
case HIGHGUID_TRANSPORT:
|
||||
case HIGHGUID_MO_TRANSPORT:
|
||||
case HIGHGUID_GAMEOBJECT:
|
||||
case HighGuid::Transport:
|
||||
case HighGuid::GameObject:
|
||||
if (typemask & TYPEMASK_GAMEOBJECT)
|
||||
return GetGameObject(p, guid);
|
||||
break;
|
||||
case HIGHGUID_UNIT:
|
||||
case HIGHGUID_VEHICLE:
|
||||
case HighGuid::Creature:
|
||||
case HighGuid::Vehicle:
|
||||
if (typemask & TYPEMASK_UNIT)
|
||||
return GetCreature(p, guid);
|
||||
break;
|
||||
case HIGHGUID_PET:
|
||||
case HighGuid::Pet:
|
||||
if (typemask & TYPEMASK_UNIT)
|
||||
return GetPet(p, guid);
|
||||
break;
|
||||
case HIGHGUID_DYNAMICOBJECT:
|
||||
case HighGuid::DynamicObject:
|
||||
if (typemask & TYPEMASK_DYNAMICOBJECT)
|
||||
return GetDynamicObject(p, guid);
|
||||
break;
|
||||
case HIGHGUID_AREATRIGGER:
|
||||
case HighGuid::AreaTrigger:
|
||||
if (typemask & TYPEMASK_AREATRIGGER)
|
||||
return GetAreaTrigger(p, guid);
|
||||
case HIGHGUID_CORPSE:
|
||||
case HighGuid::Corpse:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -226,16 +226,16 @@ bool SpellClickInfo::IsFitToRequirements(Unit const* clicker, Unit const* clicke
|
||||
return true;
|
||||
}
|
||||
|
||||
template<> ObjectGuidGenerator<HIGHGUID_PLAYER>* ObjectMgr::GetGenerator() { return &_playerGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HIGHGUID_UNIT>* ObjectMgr::GetGenerator() { return &_creatureGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HIGHGUID_PET>* ObjectMgr::GetGenerator() { return &_petGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HIGHGUID_VEHICLE>* ObjectMgr::GetGenerator() { return &_vehicleGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HIGHGUID_ITEM>* ObjectMgr::GetGenerator() { return &_itemGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HIGHGUID_GAMEOBJECT>* ObjectMgr::GetGenerator() { return &_gameObjectGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HIGHGUID_DYNAMICOBJECT>* ObjectMgr::GetGenerator() { return &_dynamicObjectGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HIGHGUID_CORPSE>* ObjectMgr::GetGenerator() { return &_corpseGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HIGHGUID_AREATRIGGER>* ObjectMgr::GetGenerator() { return &_areaTriggerGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HIGHGUID_MO_TRANSPORT>* ObjectMgr::GetGenerator() { return &_moTransportGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HighGuid::Player>* ObjectMgr::GetGenerator() { return &_playerGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HighGuid::Creature>* ObjectMgr::GetGenerator() { return &_creatureGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HighGuid::Pet>* ObjectMgr::GetGenerator() { return &_petGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HighGuid::Vehicle>* ObjectMgr::GetGenerator() { return &_vehicleGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HighGuid::Item>* ObjectMgr::GetGenerator() { return &_itemGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HighGuid::GameObject>* ObjectMgr::GetGenerator() { return &_gameObjectGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HighGuid::DynamicObject>* ObjectMgr::GetGenerator() { return &_dynamicObjectGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HighGuid::Corpse>* ObjectMgr::GetGenerator() { return &_corpseGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HighGuid::AreaTrigger>* ObjectMgr::GetGenerator() { return &_areaTriggerGuidGenerator; }
|
||||
template<> ObjectGuidGenerator<HighGuid::Transport>* ObjectMgr::GetGenerator() { return &_moTransportGuidGenerator; }
|
||||
|
||||
template<HighGuid type>
|
||||
ObjectGuidGenerator<type>* ObjectMgr::GetGenerator()
|
||||
@@ -1381,8 +1381,8 @@ void ObjectMgr::LoadLinkedRespawn()
|
||||
break;
|
||||
}
|
||||
|
||||
guid = ObjectGuid(HIGHGUID_UNIT, slave->id, guidLow);
|
||||
linkedGuid = ObjectGuid(HIGHGUID_UNIT, master->id, linkedGuidLow);
|
||||
guid = ObjectGuid(HighGuid::Creature, slave->id, guidLow);
|
||||
linkedGuid = ObjectGuid(HighGuid::Creature, master->id, linkedGuidLow);
|
||||
break;
|
||||
}
|
||||
case CREATURE_TO_GO:
|
||||
@@ -1418,8 +1418,8 @@ void ObjectMgr::LoadLinkedRespawn()
|
||||
break;
|
||||
}
|
||||
|
||||
guid = ObjectGuid(HIGHGUID_UNIT, slave->id, guidLow);
|
||||
linkedGuid = ObjectGuid(HIGHGUID_GAMEOBJECT, master->id, linkedGuidLow);
|
||||
guid = ObjectGuid(HighGuid::Creature, slave->id, guidLow);
|
||||
linkedGuid = ObjectGuid(HighGuid::GameObject, master->id, linkedGuidLow);
|
||||
break;
|
||||
}
|
||||
case GO_TO_GO:
|
||||
@@ -1455,8 +1455,8 @@ void ObjectMgr::LoadLinkedRespawn()
|
||||
break;
|
||||
}
|
||||
|
||||
guid = ObjectGuid(HIGHGUID_GAMEOBJECT, slave->id, guidLow);
|
||||
linkedGuid = ObjectGuid(HIGHGUID_GAMEOBJECT, master->id, linkedGuidLow);
|
||||
guid = ObjectGuid(HighGuid::GameObject, slave->id, guidLow);
|
||||
linkedGuid = ObjectGuid(HighGuid::GameObject, master->id, linkedGuidLow);
|
||||
break;
|
||||
}
|
||||
case GO_TO_CREATURE:
|
||||
@@ -1492,8 +1492,8 @@ void ObjectMgr::LoadLinkedRespawn()
|
||||
break;
|
||||
}
|
||||
|
||||
guid = ObjectGuid(HIGHGUID_GAMEOBJECT, slave->id, guidLow);
|
||||
linkedGuid = ObjectGuid(HIGHGUID_UNIT, master->id, linkedGuidLow);
|
||||
guid = ObjectGuid(HighGuid::GameObject, slave->id, guidLow);
|
||||
linkedGuid = ObjectGuid(HighGuid::Creature, master->id, linkedGuidLow);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1513,7 +1513,7 @@ bool ObjectMgr::SetCreatureLinkedRespawn(ObjectGuid::LowType guidLow, ObjectGuid
|
||||
|
||||
CreatureData const* master = GetCreatureData(guidLow);
|
||||
ASSERT(master);
|
||||
ObjectGuid guid(HIGHGUID_UNIT, master->id, guidLow);
|
||||
ObjectGuid guid(HighGuid::Creature, master->id, guidLow);
|
||||
|
||||
if (!linkedGuidLow) // we're removing the linking
|
||||
{
|
||||
@@ -1544,7 +1544,7 @@ bool ObjectMgr::SetCreatureLinkedRespawn(ObjectGuid::LowType guidLow, ObjectGuid
|
||||
return false;
|
||||
}
|
||||
|
||||
ObjectGuid linkedGuid(HIGHGUID_UNIT, slave->id, linkedGuidLow);
|
||||
ObjectGuid linkedGuid(HighGuid::Creature, slave->id, linkedGuidLow);
|
||||
|
||||
_linkedRespawnStore[guid] = linkedGuid;
|
||||
PreparedStatement *stmt = WorldDatabase.GetPreparedStatement(WORLD_REP_CREATURE_LINKED_RESPAWN);
|
||||
@@ -1851,7 +1851,7 @@ ObjectGuid::LowType ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, fl
|
||||
if (!map)
|
||||
return UI64LIT(0);
|
||||
|
||||
ObjectGuid::LowType guid = GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate();
|
||||
ObjectGuid::LowType guid = GetGenerator<HighGuid::GameObject>()->Generate();
|
||||
GameObjectData& data = NewGOData(guid);
|
||||
data.id = entry;
|
||||
data.mapid = mapId;
|
||||
@@ -1933,7 +1933,7 @@ ObjectGuid::LowType ObjectMgr::AddCreData(uint32 entry, uint32 mapId, float x, f
|
||||
uint32 level = cInfo->minlevel == cInfo->maxlevel ? cInfo->minlevel : urand(cInfo->minlevel, cInfo->maxlevel); // Only used for extracting creature base stats
|
||||
CreatureBaseStats const* stats = GetCreatureBaseStats(level, cInfo->unit_class);
|
||||
|
||||
ObjectGuid::LowType guid = GetGenerator<HIGHGUID_UNIT>()->Generate();
|
||||
ObjectGuid::LowType guid = GetGenerator<HighGuid::Creature>()->Generate();
|
||||
CreatureData& data = NewOrExistCreatureData(guid);
|
||||
data.id = entry;
|
||||
data.mapid = mapId;
|
||||
@@ -2177,7 +2177,7 @@ void ObjectMgr::RemoveGameobjectFromGrid(ObjectGuid::LowType guid, GameObjectDat
|
||||
|
||||
Player* ObjectMgr::GetPlayerByLowGUID(ObjectGuid::LowType lowguid) const
|
||||
{
|
||||
return ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, lowguid));
|
||||
return ObjectAccessor::FindPlayer(ObjectGuid(HighGuid::Player, lowguid));
|
||||
}
|
||||
|
||||
// name must be checked to correctness (if received) before call this function
|
||||
@@ -2190,7 +2190,7 @@ ObjectGuid ObjectMgr::GetPlayerGUIDByName(std::string const& name) const
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (result)
|
||||
return ObjectGuid(HIGHGUID_PLAYER, (*result)[0].GetUInt64());
|
||||
return ObjectGuid(HighGuid::Player, (*result)[0].GetUInt64());
|
||||
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
@@ -5584,7 +5584,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
|
||||
|
||||
Player* player = NULL;
|
||||
if (serverUp)
|
||||
player = ObjectAccessor::FindConnectedPlayer(ObjectGuid(HIGHGUID_PLAYER, m->receiver));
|
||||
player = ObjectAccessor::FindConnectedPlayer(ObjectGuid(HighGuid::Player, m->receiver));
|
||||
|
||||
if (player && player->m_mailsLoaded)
|
||||
{ // this code will run very improbably (the time is between 4 and 5 am, in game is online a player, who has old mail
|
||||
|
||||
@@ -1377,16 +1377,16 @@ class ObjectMgr
|
||||
uint64 _voidItemId;
|
||||
|
||||
// first free low guid for selected guid type
|
||||
ObjectGuidGenerator<HIGHGUID_PLAYER> _playerGuidGenerator;
|
||||
ObjectGuidGenerator<HIGHGUID_UNIT> _creatureGuidGenerator;
|
||||
ObjectGuidGenerator<HIGHGUID_PET> _petGuidGenerator;
|
||||
ObjectGuidGenerator<HIGHGUID_VEHICLE> _vehicleGuidGenerator;
|
||||
ObjectGuidGenerator<HIGHGUID_ITEM> _itemGuidGenerator;
|
||||
ObjectGuidGenerator<HIGHGUID_GAMEOBJECT> _gameObjectGuidGenerator;
|
||||
ObjectGuidGenerator<HIGHGUID_DYNAMICOBJECT> _dynamicObjectGuidGenerator;
|
||||
ObjectGuidGenerator<HIGHGUID_CORPSE> _corpseGuidGenerator;
|
||||
ObjectGuidGenerator<HIGHGUID_AREATRIGGER> _areaTriggerGuidGenerator;
|
||||
ObjectGuidGenerator<HIGHGUID_MO_TRANSPORT> _moTransportGuidGenerator;
|
||||
ObjectGuidGenerator<HighGuid::Player> _playerGuidGenerator;
|
||||
ObjectGuidGenerator<HighGuid::Creature> _creatureGuidGenerator;
|
||||
ObjectGuidGenerator<HighGuid::Pet> _petGuidGenerator;
|
||||
ObjectGuidGenerator<HighGuid::Vehicle> _vehicleGuidGenerator;
|
||||
ObjectGuidGenerator<HighGuid::Item> _itemGuidGenerator;
|
||||
ObjectGuidGenerator<HighGuid::GameObject> _gameObjectGuidGenerator;
|
||||
ObjectGuidGenerator<HighGuid::DynamicObject> _dynamicObjectGuidGenerator;
|
||||
ObjectGuidGenerator<HighGuid::Corpse> _corpseGuidGenerator;
|
||||
ObjectGuidGenerator<HighGuid::AreaTrigger> _areaTriggerGuidGenerator;
|
||||
ObjectGuidGenerator<HighGuid::Transport> _moTransportGuidGenerator;
|
||||
|
||||
QuestMap _questTemplates;
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ bool Group::Create(Player* leader)
|
||||
{
|
||||
ObjectGuid leaderGuid = leader->GetGUID();
|
||||
|
||||
m_guid = ObjectGuid(HIGHGUID_GROUP, sGroupMgr->GenerateGroupId());
|
||||
m_guid = ObjectGuid(HighGuid::Party, sGroupMgr->GenerateGroupId());
|
||||
m_leaderGuid = leaderGuid;
|
||||
m_leaderName = leader->GetName();
|
||||
leader->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GROUP_LEADER);
|
||||
@@ -162,15 +162,15 @@ bool Group::Create(Player* leader)
|
||||
void Group::LoadGroupFromDB(Field* fields)
|
||||
{
|
||||
m_dbStoreId = fields[16].GetUInt32();
|
||||
m_guid = ObjectGuid(HIGHGUID_GROUP, sGroupMgr->GenerateGroupId());
|
||||
m_leaderGuid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt64());
|
||||
m_guid = ObjectGuid(HighGuid::Party, sGroupMgr->GenerateGroupId());
|
||||
m_leaderGuid = ObjectGuid(HighGuid::Player, fields[0].GetUInt64());
|
||||
|
||||
// group leader not exist
|
||||
if (!sObjectMgr->GetPlayerNameByGUID(m_leaderGuid, m_leaderName))
|
||||
return;
|
||||
|
||||
m_lootMethod = LootMethod(fields[1].GetUInt8());
|
||||
m_looterGuid = ObjectGuid(HIGHGUID_PLAYER, fields[2].GetUInt64());
|
||||
m_looterGuid = ObjectGuid(HighGuid::Player, fields[2].GetUInt64());
|
||||
m_lootThreshold = ItemQualities(fields[3].GetUInt8());
|
||||
|
||||
for (uint8 i = 0; i < TARGETICONCOUNT; ++i)
|
||||
@@ -192,7 +192,7 @@ void Group::LoadGroupFromDB(Field* fields)
|
||||
else
|
||||
m_raidDifficulty = Difficulty(r_diff);
|
||||
|
||||
m_masterLooterGuid = ObjectGuid(HIGHGUID_PLAYER, fields[15].GetUInt64());
|
||||
m_masterLooterGuid = ObjectGuid(HighGuid::Player, fields[15].GetUInt64());
|
||||
|
||||
if (m_groupType & GROUPTYPE_LFG)
|
||||
sLFGMgr->_LoadFromDB(fields, GetGUID());
|
||||
@@ -201,7 +201,7 @@ void Group::LoadGroupFromDB(Field* fields)
|
||||
void Group::LoadMemberFromDB(ObjectGuid::LowType guidLow, uint8 memberFlags, uint8 subgroup, uint8 roles)
|
||||
{
|
||||
MemberSlot member;
|
||||
member.guid = ObjectGuid(HIGHGUID_PLAYER, guidLow);
|
||||
member.guid = ObjectGuid(HighGuid::Player, guidLow);
|
||||
|
||||
// skip non-existed member
|
||||
if (!sObjectMgr->GetPlayerNameByGUID(member.guid, member.name))
|
||||
@@ -958,7 +958,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
|
||||
//roll for over-threshold item if it's one-player loot
|
||||
if (item->Quality >= uint32(m_lootThreshold))
|
||||
{
|
||||
ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GetGenerator<HIGHGUID_ITEM>()->Generate());
|
||||
ObjectGuid newitemGUID = ObjectGuid(HighGuid::Item, sObjectMgr->GetGenerator<HighGuid::Item>()->Generate());
|
||||
Roll* r = new Roll(newitemGUID, *i);
|
||||
|
||||
//a vector is filled with only near party members
|
||||
@@ -1042,7 +1042,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
|
||||
continue;
|
||||
}
|
||||
|
||||
ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GetGenerator<HIGHGUID_ITEM>()->Generate());
|
||||
ObjectGuid newitemGUID = ObjectGuid(HighGuid::Item, sObjectMgr->GetGenerator<HighGuid::Item>()->Generate());
|
||||
Roll* r = new Roll(newitemGUID, *i);
|
||||
|
||||
//a vector is filled with only near party members
|
||||
@@ -1103,7 +1103,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject)
|
||||
//roll for over-threshold item if it's one-player loot
|
||||
if (item->Quality >= uint32(m_lootThreshold))
|
||||
{
|
||||
ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GetGenerator<HIGHGUID_ITEM>()->Generate());
|
||||
ObjectGuid newitemGUID = ObjectGuid(HighGuid::Item, sObjectMgr->GetGenerator<HighGuid::Item>()->Generate());
|
||||
Roll* r = new Roll(newitemGUID, *i);
|
||||
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
@@ -1178,7 +1178,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject)
|
||||
continue;
|
||||
|
||||
item = sObjectMgr->GetItemTemplate(i->itemid);
|
||||
ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GetGenerator<HIGHGUID_ITEM>()->Generate());
|
||||
ObjectGuid newitemGUID = ObjectGuid(HighGuid::Item, sObjectMgr->GetGenerator<HighGuid::Item>()->Generate());
|
||||
Roll* r = new Roll(newitemGUID, *i);
|
||||
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
|
||||
@@ -199,8 +199,8 @@ void Guild::EventLogEntry::SaveToDB(SQLTransaction& trans) const
|
||||
|
||||
void Guild::EventLogEntry::WritePacket(WorldPacket& data, ByteBuffer& content) const
|
||||
{
|
||||
ObjectGuid guid1 = ObjectGuid(HIGHGUID_PLAYER, m_playerGuid1);
|
||||
ObjectGuid guid2 = ObjectGuid(HIGHGUID_PLAYER, m_playerGuid2);
|
||||
ObjectGuid guid1 = ObjectGuid(HighGuid::Player, m_playerGuid1);
|
||||
ObjectGuid guid2 = ObjectGuid(HighGuid::Player, m_playerGuid2);
|
||||
|
||||
data.WriteBit(guid1[2]);
|
||||
data.WriteBit(guid1[4]);
|
||||
@@ -276,7 +276,7 @@ void Guild::BankEventLogEntry::SaveToDB(SQLTransaction& trans) const
|
||||
|
||||
void Guild::BankEventLogEntry::WritePacket(WorldPacket& data, ByteBuffer& content) const
|
||||
{
|
||||
ObjectGuid logGuid = ObjectGuid(HIGHGUID_PLAYER, m_playerGuid);
|
||||
ObjectGuid logGuid = ObjectGuid(HighGuid::Player, m_playerGuid);
|
||||
|
||||
bool hasItem = m_eventType == GUILD_BANK_LOG_DEPOSIT_ITEM || m_eventType == GUILD_BANK_LOG_WITHDRAW_ITEM ||
|
||||
m_eventType == GUILD_BANK_LOG_MOVE_ITEM || m_eventType == GUILD_BANK_LOG_MOVE_ITEM2;
|
||||
@@ -1815,7 +1815,7 @@ void Guild::HandleInviteMember(WorldSession* session, std::string const& name)
|
||||
|
||||
ObjectGuid oldGuildGuid;
|
||||
if (ObjectGuid::LowType oldId = pInvitee->GetGuildId())
|
||||
oldGuildGuid = ObjectGuid(HIGHGUID_GUILD, oldId);
|
||||
oldGuildGuid = ObjectGuid(HighGuid::Guild, oldId);
|
||||
|
||||
ObjectGuid newGuildGuid = GetGUID();
|
||||
|
||||
@@ -2390,7 +2390,7 @@ bool Guild::LoadFromDB(Field* fields)
|
||||
{
|
||||
m_id = fields[0].GetUInt64();
|
||||
m_name = fields[1].GetString();
|
||||
m_leaderGuid = ObjectGuid(HIGHGUID_PLAYER, fields[2].GetUInt64());
|
||||
m_leaderGuid = ObjectGuid(HighGuid::Player, fields[2].GetUInt64());
|
||||
m_emblemInfo.LoadFromDB(fields);
|
||||
m_info = fields[8].GetString();
|
||||
m_motd = fields[9].GetString();
|
||||
@@ -2424,7 +2424,7 @@ void Guild::LoadRankFromDB(Field* fields)
|
||||
bool Guild::LoadMemberFromDB(Field* fields)
|
||||
{
|
||||
ObjectGuid::LowType lowguid = fields[1].GetUInt64();
|
||||
Member *member = new Member(m_id, ObjectGuid(HIGHGUID_PLAYER, lowguid), fields[2].GetUInt8());
|
||||
Member *member = new Member(m_id, ObjectGuid(HighGuid::Player, lowguid), fields[2].GetUInt8());
|
||||
if (!member->LoadFromDB(fields))
|
||||
{
|
||||
_DeleteMemberFromDB(lowguid);
|
||||
@@ -2511,7 +2511,7 @@ void Guild::LoadGuildNewsLogFromDB(Field* fields)
|
||||
fields[1].GetUInt32(), // guid
|
||||
fields[6].GetUInt32(), // timestamp //64 bits?
|
||||
GuildNews(fields[2].GetUInt8()), // type
|
||||
ObjectGuid(HIGHGUID_PLAYER, fields[3].GetUInt64()), // player guid
|
||||
ObjectGuid(HighGuid::Player, fields[3].GetUInt64()), // player guid
|
||||
fields[4].GetUInt32(), // Flags
|
||||
fields[5].GetUInt32())); // value
|
||||
}
|
||||
|
||||
@@ -777,7 +777,7 @@ public:
|
||||
|
||||
// Getters
|
||||
ObjectGuid::LowType GetId() const { return m_id; }
|
||||
ObjectGuid GetGUID() const { return ObjectGuid(HIGHGUID_GUILD, m_id); }
|
||||
ObjectGuid GetGUID() const { return ObjectGuid(HighGuid::Guild, m_id); }
|
||||
ObjectGuid GetLeaderGUID() const { return m_leaderGuid; }
|
||||
std::string const& GetName() const { return m_name; }
|
||||
std::string const& GetMOTD() const { return m_motd; }
|
||||
|
||||
@@ -54,7 +54,7 @@ void GuildFinderMgr::LoadGuildSettings()
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
ObjectGuid guildId(HIGHGUID_GUILD, fields[0].GetUInt64());
|
||||
ObjectGuid guildId(HighGuid::Guild, fields[0].GetUInt64());
|
||||
uint8 availability = fields[1].GetUInt8();
|
||||
uint8 classRoles = fields[2].GetUInt8();
|
||||
uint8 interests = fields[3].GetUInt8();
|
||||
@@ -94,8 +94,8 @@ void GuildFinderMgr::LoadMembershipRequests()
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
ObjectGuid guildId(HIGHGUID_GUILD, fields[0].GetUInt64());
|
||||
ObjectGuid playerId(HIGHGUID_PLAYER, fields[1].GetUInt64());
|
||||
ObjectGuid guildId(HighGuid::Guild, fields[0].GetUInt64());
|
||||
ObjectGuid playerId(HighGuid::Player, fields[1].GetUInt64());
|
||||
uint8 availability = fields[2].GetUInt8();
|
||||
uint8 classRoles = fields[3].GetUInt8();
|
||||
uint8 interests = fields[4].GetUInt8();
|
||||
|
||||
@@ -445,7 +445,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData)
|
||||
}
|
||||
|
||||
// impossible have online own another character (use this for speedup check in case online owner)
|
||||
ObjectGuid ownerGuid(HIGHGUID_PLAYER, auction->owner);
|
||||
ObjectGuid ownerGuid(HighGuid::Player, auction->owner);
|
||||
Player* auction_owner = ObjectAccessor::FindPlayer(ownerGuid);
|
||||
if (!auction_owner && sObjectMgr->GetPlayerAccountIdByGUID(ownerGuid) == player->GetSession()->GetAccountId())
|
||||
{
|
||||
|
||||
@@ -451,7 +451,7 @@ void WorldSession::HandleCalendarEventInvite(WorldPacket& recvData)
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
inviteeGuid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt64());
|
||||
inviteeGuid = ObjectGuid(HighGuid::Player, fields[0].GetUInt64());
|
||||
inviteeTeam = Player::TeamForRace(fields[1].GetUInt8());
|
||||
inviteeGuildId = Player::GetGuildIdFromDB(inviteeGuid);
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result)
|
||||
|
||||
do
|
||||
{
|
||||
ObjectGuid guid(HIGHGUID_PLAYER, (*result)[0].GetUInt64());
|
||||
ObjectGuid guid(HighGuid::Player, (*result)[0].GetUInt64());
|
||||
|
||||
TC_LOG_INFO("network", "Loading char guid %s from account %u.", guid.ToString().c_str(), GetAccountId());
|
||||
|
||||
@@ -632,7 +632,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
|
||||
|
||||
Player newChar(this);
|
||||
newChar.GetMotionMaster()->Initialize();
|
||||
if (!newChar.Create(sObjectMgr->GetGenerator<HIGHGUID_PLAYER>()->Generate(), createInfo))
|
||||
if (!newChar.Create(sObjectMgr->GetGenerator<HighGuid::Player>()->Generate(), createInfo))
|
||||
{
|
||||
// Player not create (race/class/etc problem?)
|
||||
newChar.CleanupsBeforeDelete();
|
||||
|
||||
@@ -113,7 +113,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/)
|
||||
|
||||
switch (guid.GetHigh())
|
||||
{
|
||||
case HIGHGUID_GAMEOBJECT:
|
||||
case HighGuid::GameObject:
|
||||
{
|
||||
GameObject* go = GetPlayer()->GetMap()->GetGameObject(guid);
|
||||
|
||||
@@ -123,7 +123,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/)
|
||||
|
||||
break;
|
||||
}
|
||||
case HIGHGUID_CORPSE: // remove insignia ONLY in BG
|
||||
case HighGuid::Corpse: // remove insignia ONLY in BG
|
||||
{
|
||||
Corpse* bones = ObjectAccessor::GetCorpse(*player, guid);
|
||||
|
||||
@@ -135,7 +135,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/)
|
||||
|
||||
break;
|
||||
}
|
||||
case HIGHGUID_ITEM:
|
||||
case HighGuid::Item:
|
||||
{
|
||||
if (Item* item = player->GetItemByGuid(guid))
|
||||
{
|
||||
@@ -144,8 +144,8 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HIGHGUID_UNIT:
|
||||
case HIGHGUID_VEHICLE:
|
||||
case HighGuid::Creature:
|
||||
case HighGuid::Vehicle:
|
||||
{
|
||||
Creature* creature = player->GetMap()->GetCreature(guid);
|
||||
bool lootAllowed = creature && creature->IsAlive() == (player->getClass() == CLASS_ROGUE && creature->loot.loot_type == LOOT_PICKPOCKETING);
|
||||
|
||||
@@ -553,7 +553,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket& recvData)
|
||||
|
||||
if (m->COD > 0) //if there is COD, take COD money from player and send them to sender by mail
|
||||
{
|
||||
ObjectGuid sender_guid(HIGHGUID_PLAYER, m->sender);
|
||||
ObjectGuid sender_guid(HighGuid::Player, m->sender);
|
||||
Player* receiver = ObjectAccessor::FindConnectedPlayer(sender_guid);
|
||||
|
||||
uint32 sender_accId = 0;
|
||||
@@ -707,7 +707,7 @@ void WorldSession::HandleGetMailList(WorldPacket& recvData)
|
||||
switch ((*itr)->messageType)
|
||||
{
|
||||
case MAIL_NORMAL: // sender guid
|
||||
data << ObjectGuid(HIGHGUID_PLAYER, (*itr)->sender);
|
||||
data << ObjectGuid(HighGuid::Player, (*itr)->sender);
|
||||
break;
|
||||
case MAIL_CREATURE:
|
||||
case MAIL_GAMEOBJECT:
|
||||
@@ -794,7 +794,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket& recvData)
|
||||
}
|
||||
|
||||
Item* bodyItem = new Item; // This is not bag and then can be used new Item.
|
||||
if (!bodyItem->Create(sObjectMgr->GetGenerator<HIGHGUID_ITEM>()->Generate(), MAIL_BODY_ITEM_TEMPLATE, player))
|
||||
if (!bodyItem->Create(sObjectMgr->GetGenerator<HighGuid::Item>()->Generate(), MAIL_BODY_ITEM_TEMPLATE, player))
|
||||
{
|
||||
delete bodyItem;
|
||||
return;
|
||||
@@ -816,7 +816,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket& recvData)
|
||||
bodyItem->SetText(m->body);
|
||||
|
||||
if (m->messageType == MAIL_NORMAL)
|
||||
bodyItem->SetGuidValue(ITEM_FIELD_CREATOR, ObjectGuid(HIGHGUID_PLAYER, m->sender));
|
||||
bodyItem->SetGuidValue(ITEM_FIELD_CREATOR, ObjectGuid(HighGuid::Player, m->sender));
|
||||
|
||||
bodyItem->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_MAIL_TEXT_MASK);
|
||||
|
||||
@@ -871,7 +871,7 @@ void WorldSession::HandleQueryNextMailTime(WorldPacket& /*recvData*/)
|
||||
if (sentSenders.count(m->sender))
|
||||
continue;
|
||||
|
||||
data << (m->messageType == MAIL_NORMAL ? ObjectGuid(HIGHGUID_PLAYER, m->sender) : ObjectGuid::Empty); // player guid
|
||||
data << (m->messageType == MAIL_NORMAL ? ObjectGuid(HighGuid::Player, m->sender) : ObjectGuid::Empty); // player guid
|
||||
data << uint32(m->messageType != MAIL_NORMAL ? m->sender : 0); // non-player entries
|
||||
data << uint32(m->messageType);
|
||||
data << uint32(m->stationery);
|
||||
|
||||
@@ -606,7 +606,7 @@ void WorldSession::HandleAddFriendOpcodeCallBack(PreparedQueryResult result, std
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
friendGuid = ObjectGuid(HIGHGUID_PLAYER, 0, fields[0].GetUInt64());
|
||||
friendGuid = ObjectGuid(HighGuid::Player, 0, fields[0].GetUInt64());
|
||||
team = Player::TeamForRace(fields[1].GetUInt8());
|
||||
friendAccountId = fields[2].GetUInt32();
|
||||
|
||||
@@ -691,7 +691,7 @@ void WorldSession::HandleAddIgnoreOpcodeCallBack(PreparedQueryResult result)
|
||||
|
||||
if (result)
|
||||
{
|
||||
IgnoreGuid = ObjectGuid(HIGHGUID_PLAYER, (*result)[0].GetUInt64());
|
||||
IgnoreGuid = ObjectGuid(HighGuid::Player, (*result)[0].GetUInt64());
|
||||
|
||||
if (!IgnoreGuid.IsEmpty())
|
||||
{
|
||||
|
||||
@@ -292,7 +292,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData)
|
||||
for (uint8 i = 1; i <= signs; ++i)
|
||||
{
|
||||
Field* fields2 = result->Fetch();
|
||||
data << ObjectGuid(HIGHGUID_PLAYER, fields2[0].GetUInt64()); // Player GUID
|
||||
data << ObjectGuid(HighGuid::Player, fields2[0].GetUInt64()); // Player GUID
|
||||
data << uint32(0); // there 0 ...
|
||||
|
||||
result->NextRow();
|
||||
@@ -328,7 +328,7 @@ void WorldSession::SendPetitionQueryOpcode(ObjectGuid petitionguid)
|
||||
if (result)
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
ownerguid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt64());
|
||||
ownerguid = ObjectGuid(HighGuid::Player, fields[0].GetUInt64());
|
||||
name = fields[1].GetString();
|
||||
type = fields[2].GetUInt8();
|
||||
}
|
||||
@@ -472,7 +472,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData)
|
||||
}
|
||||
|
||||
fields = result->Fetch();
|
||||
ObjectGuid ownerGuid(HIGHGUID_PLAYER, fields[0].GetUInt64());
|
||||
ObjectGuid ownerGuid(HighGuid::Player, fields[0].GetUInt64());
|
||||
uint64 signs = fields[1].GetUInt64();
|
||||
uint8 type = fields[2].GetUInt8();
|
||||
|
||||
@@ -598,7 +598,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket& recvData)
|
||||
return;
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
ObjectGuid ownerguid(HIGHGUID_PLAYER, 0, fields[0].GetUInt64());
|
||||
ObjectGuid ownerguid(HighGuid::Player, 0, fields[0].GetUInt64());
|
||||
|
||||
Player* owner = ObjectAccessor::FindConnectedPlayer(ownerguid);
|
||||
if (owner) // petition owner online
|
||||
@@ -709,7 +709,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recvData)
|
||||
for (uint8 i = 1; i <= signs; ++i)
|
||||
{
|
||||
Field* fields2 = result->Fetch();
|
||||
data << ObjectGuid(HIGHGUID_PLAYER, fields2[0].GetUInt64()); // Player GUID
|
||||
data << ObjectGuid(HighGuid::Player, fields2[0].GetUInt64()); // Player GUID
|
||||
data << uint32(0); // there 0 ...
|
||||
|
||||
result->NextRow();
|
||||
@@ -747,7 +747,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
|
||||
if (result)
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
ownerguid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt64());
|
||||
ownerguid = ObjectGuid(HighGuid::Player, fields[0].GetUInt64());
|
||||
name = fields[1].GetString();
|
||||
type = fields[2].GetUInt8();
|
||||
}
|
||||
@@ -854,7 +854,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
|
||||
for (uint8 i = 0; i < signatures; ++i)
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
guild->AddMember(ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt64()));
|
||||
guild->AddMember(ObjectGuid(HighGuid::Player, fields[0].GetUInt64()));
|
||||
result->NextRow();
|
||||
}
|
||||
}
|
||||
@@ -881,7 +881,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
|
||||
for (uint8 i = 0; i < signatures; ++i)
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
ObjectGuid memberGUID(HIGHGUID_PLAYER, fields[0].GetUInt64());
|
||||
ObjectGuid memberGUID(HighGuid::Player, fields[0].GetUInt64());
|
||||
TC_LOG_DEBUG("network", "PetitionsHandler: Adding arena team (guid: %u) member %s", arenaTeam->GetId(), memberGUID.ToString().c_str());
|
||||
arenaTeam->AddMember(memberGUID);
|
||||
result->NextRow();
|
||||
|
||||
@@ -130,7 +130,7 @@ void WorldSession::HandleVoidStorageQuery(WorldPacket& recvData)
|
||||
if (!item)
|
||||
continue;
|
||||
|
||||
ObjectGuid itemId(HIGHGUID_ITEM, item->ItemId);
|
||||
ObjectGuid itemId(HighGuid::Item, item->ItemId);
|
||||
ObjectGuid creatorGuid = item->CreatorGuid;
|
||||
|
||||
data.WriteBit(creatorGuid[3]);
|
||||
@@ -387,7 +387,7 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData)
|
||||
|
||||
for (uint8 i = 0; i < depositCount; ++i)
|
||||
{
|
||||
ObjectGuid itemId(HIGHGUID_ITEM, depositItems[i].first.ItemId);
|
||||
ObjectGuid itemId(HighGuid::Item, depositItems[i].first.ItemId);
|
||||
ObjectGuid creatorGuid = depositItems[i].first.CreatorGuid;
|
||||
data.WriteBit(creatorGuid[7]);
|
||||
data.WriteBit(itemId[7]);
|
||||
@@ -409,7 +409,7 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData)
|
||||
|
||||
for (uint8 i = 0; i < withdrawCount; ++i)
|
||||
{
|
||||
ObjectGuid itemId(HIGHGUID_ITEM, withdrawItems[i].ItemId);
|
||||
ObjectGuid itemId(HighGuid::Item, withdrawItems[i].ItemId);
|
||||
data.WriteBit(itemId[1]);
|
||||
data.WriteBit(itemId[7]);
|
||||
data.WriteBit(itemId[3]);
|
||||
@@ -424,7 +424,7 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData)
|
||||
|
||||
for (uint8 i = 0; i < withdrawCount; ++i)
|
||||
{
|
||||
ObjectGuid itemId(HIGHGUID_ITEM, withdrawItems[i].ItemId);
|
||||
ObjectGuid itemId(HighGuid::Item, withdrawItems[i].ItemId);
|
||||
data.WriteByteSeq(itemId[3]);
|
||||
data.WriteByteSeq(itemId[1]);
|
||||
data.WriteByteSeq(itemId[0]);
|
||||
@@ -437,7 +437,7 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData)
|
||||
|
||||
for (uint8 i = 0; i < depositCount; ++i)
|
||||
{
|
||||
ObjectGuid itemId(HIGHGUID_ITEM, depositItems[i].first.ItemId);
|
||||
ObjectGuid itemId(HighGuid::Item, depositItems[i].first.ItemId);
|
||||
ObjectGuid creatorGuid = depositItems[i].first.CreatorGuid;
|
||||
|
||||
data << uint32(depositItems[i].first.ItemSuffixFactor);
|
||||
@@ -542,7 +542,7 @@ void WorldSession::HandleVoidSwapItem(WorldPacket& recvData)
|
||||
bool usedDestSlot = player->GetVoidStorageItem(newSlot) != NULL;
|
||||
ObjectGuid itemIdDest;
|
||||
if (usedDestSlot)
|
||||
itemIdDest = ObjectGuid(HIGHGUID_ITEM, player->GetVoidStorageItem(newSlot)->ItemId);
|
||||
itemIdDest = ObjectGuid(HighGuid::Item, player->GetVoidStorageItem(newSlot)->ItemId);
|
||||
|
||||
if (!player->SwapVoidStorageItem(oldSlot, newSlot))
|
||||
{
|
||||
|
||||
@@ -131,7 +131,7 @@ void MailDraft::deleteIncludedItems(SQLTransaction& trans, bool inDB /*= false*/
|
||||
|
||||
void MailDraft::SendReturnToSender(uint32 sender_acc, ObjectGuid::LowType sender_guid, ObjectGuid::LowType receiver_guid, SQLTransaction& trans)
|
||||
{
|
||||
ObjectGuid receiverGuid(HIGHGUID_PLAYER, receiver_guid);
|
||||
ObjectGuid receiverGuid(HighGuid::Player, receiver_guid);
|
||||
Player* receiver = ObjectAccessor::FindConnectedPlayer(receiverGuid);
|
||||
|
||||
uint32 rc_account = 0;
|
||||
|
||||
@@ -3446,9 +3446,9 @@ time_t Map::GetLinkedRespawnTime(ObjectGuid guid) const
|
||||
ObjectGuid linkedGuid = sObjectMgr->GetLinkedRespawnGuid(guid);
|
||||
switch (linkedGuid.GetHigh())
|
||||
{
|
||||
case HIGHGUID_UNIT:
|
||||
case HighGuid::Creature:
|
||||
return GetCreatureRespawnTime(linkedGuid.GetCounter());
|
||||
case HIGHGUID_GAMEOBJECT:
|
||||
case HighGuid::GameObject:
|
||||
return GetGORespawnTime(linkedGuid.GetCounter());
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -384,7 +384,7 @@ Transport* TransportMgr::CreateTransport(uint32 entry, ObjectGuid::LowType guid
|
||||
float o = tInfo->keyFrames.begin()->InitialOrientation;
|
||||
|
||||
// initialize the gameobject base
|
||||
ObjectGuid::LowType guidLow = guid ? guid : sObjectMgr->GetGenerator<HIGHGUID_MO_TRANSPORT>()->Generate();
|
||||
ObjectGuid::LowType guidLow = guid ? guid : sObjectMgr->GetGenerator<HighGuid::Transport>()->Generate();
|
||||
if (!trans->Create(guidLow, entry, mapId, x, y, z, o, 255))
|
||||
{
|
||||
delete trans;
|
||||
|
||||
@@ -95,7 +95,7 @@ void OPvPCapturePoint::AddGO(uint32 type, ObjectGuid::LowType guid, uint32 entry
|
||||
entry = data->id;
|
||||
}
|
||||
|
||||
m_Objects[type] = ObjectGuid(HIGHGUID_GAMEOBJECT, entry, guid);
|
||||
m_Objects[type] = ObjectGuid(HighGuid::GameObject, entry, guid);
|
||||
m_ObjectTypes[m_Objects[type]] = type;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ void OPvPCapturePoint::AddCre(uint32 type, ObjectGuid::LowType guid, uint32 entr
|
||||
entry = data->id;
|
||||
}
|
||||
|
||||
m_Creatures[type] = ObjectGuid(HIGHGUID_UNIT, entry, guid);
|
||||
m_Creatures[type] = ObjectGuid(HighGuid::Creature, entry, guid);
|
||||
m_CreatureTypes[m_Creatures[type]] = type;
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ bool OPvPCapturePoint::SetCapturePointData(uint32 entry, uint32 map, float x, fl
|
||||
return false;
|
||||
}
|
||||
|
||||
m_capturePointGUID = ObjectGuid(HIGHGUID_GAMEOBJECT, entry, sObjectMgr->AddGOData(entry, map, x, y, z, o, 0, rotation0, rotation1, rotation2, rotation3));
|
||||
m_capturePointGUID = ObjectGuid(HighGuid::GameObject, entry, sObjectMgr->AddGOData(entry, map, x, y, z, o, 0, rotation0, rotation1, rotation2, rotation3));
|
||||
if (!m_capturePointGUID)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ void PoolGroup<Creature>::Despawn1Object(uint64 guid)
|
||||
{
|
||||
sObjectMgr->RemoveCreatureFromGrid(guid, data);
|
||||
|
||||
if (Creature* creature = ObjectAccessor::GetObjectInWorld(ObjectGuid(HIGHGUID_UNIT, data->id, guid), (Creature*)NULL))
|
||||
if (Creature* creature = ObjectAccessor::GetObjectInWorld(ObjectGuid(HighGuid::Creature, data->id, guid), (Creature*)NULL))
|
||||
creature->AddObjectToRemoveList();
|
||||
}
|
||||
}
|
||||
@@ -234,7 +234,7 @@ void PoolGroup<GameObject>::Despawn1Object(uint64 guid)
|
||||
{
|
||||
sObjectMgr->RemoveGameobjectFromGrid(guid, data);
|
||||
|
||||
if (GameObject* pGameobject = ObjectAccessor::GetObjectInWorld(ObjectGuid(HIGHGUID_GAMEOBJECT, data->id, guid), (GameObject*)NULL))
|
||||
if (GameObject* pGameobject = ObjectAccessor::GetObjectInWorld(ObjectGuid(HighGuid::GameObject, data->id, guid), (GameObject*)NULL))
|
||||
pGameobject->AddObjectToRemoveList();
|
||||
}
|
||||
}
|
||||
@@ -510,7 +510,7 @@ template <>
|
||||
void PoolGroup<Creature>::ReSpawn1Object(PoolObject* obj)
|
||||
{
|
||||
if (CreatureData const* data = sObjectMgr->GetCreatureData(obj->guid))
|
||||
if (Creature* creature = ObjectAccessor::GetObjectInWorld(ObjectGuid(HIGHGUID_UNIT, data->id, obj->guid), (Creature*)NULL))
|
||||
if (Creature* creature = ObjectAccessor::GetObjectInWorld(ObjectGuid(HighGuid::Creature, data->id, obj->guid), (Creature*)NULL))
|
||||
creature->GetMap()->AddToMap(creature);
|
||||
}
|
||||
|
||||
@@ -519,7 +519,7 @@ template <>
|
||||
void PoolGroup<GameObject>::ReSpawn1Object(PoolObject* obj)
|
||||
{
|
||||
if (GameObjectData const* data = sObjectMgr->GetGOData(obj->guid))
|
||||
if (GameObject* pGameobject = ObjectAccessor::GetObjectInWorld(ObjectGuid(HIGHGUID_GAMEOBJECT, data->id, obj->guid), (GameObject*)NULL))
|
||||
if (GameObject* pGameobject = ObjectAccessor::GetObjectInWorld(ObjectGuid(HighGuid::GameObject, data->id, obj->guid), (GameObject*)NULL))
|
||||
pGameobject->GetMap()->AddToMap(pGameobject);
|
||||
}
|
||||
|
||||
|
||||
@@ -315,28 +315,27 @@ void Map::ScriptsProcess()
|
||||
{
|
||||
switch (step.sourceGUID.GetHigh())
|
||||
{
|
||||
case HIGHGUID_ITEM: // as well as HIGHGUID_CONTAINER
|
||||
case HighGuid::Item: // as well as HIGHGUID_CONTAINER
|
||||
if (Player* player = HashMapHolder<Player>::Find(step.ownerGUID))
|
||||
source = player->GetItemByGuid(step.sourceGUID);
|
||||
break;
|
||||
case HIGHGUID_UNIT:
|
||||
case HIGHGUID_VEHICLE:
|
||||
case HighGuid::Creature:
|
||||
case HighGuid::Vehicle:
|
||||
source = HashMapHolder<Creature>::Find(step.sourceGUID);
|
||||
break;
|
||||
case HIGHGUID_PET:
|
||||
case HighGuid::Pet:
|
||||
source = HashMapHolder<Pet>::Find(step.sourceGUID);
|
||||
break;
|
||||
case HIGHGUID_PLAYER:
|
||||
case HighGuid::Player:
|
||||
source = HashMapHolder<Player>::Find(step.sourceGUID);
|
||||
break;
|
||||
case HIGHGUID_TRANSPORT:
|
||||
case HIGHGUID_GAMEOBJECT:
|
||||
case HighGuid::GameObject:
|
||||
source = HashMapHolder<GameObject>::Find(step.sourceGUID);
|
||||
break;
|
||||
case HIGHGUID_CORPSE:
|
||||
case HighGuid::Corpse:
|
||||
source = HashMapHolder<Corpse>::Find(step.sourceGUID);
|
||||
break;
|
||||
case HIGHGUID_MO_TRANSPORT:
|
||||
case HighGuid::Transport:
|
||||
{
|
||||
GameObject* go = HashMapHolder<GameObject>::Find(step.sourceGUID);
|
||||
source = go ? go->ToTransport() : NULL;
|
||||
@@ -354,24 +353,23 @@ void Map::ScriptsProcess()
|
||||
{
|
||||
switch (step.targetGUID.GetHigh())
|
||||
{
|
||||
case HIGHGUID_UNIT:
|
||||
case HIGHGUID_VEHICLE:
|
||||
case HighGuid::Creature:
|
||||
case HighGuid::Vehicle:
|
||||
target = HashMapHolder<Creature>::Find(step.targetGUID);
|
||||
break;
|
||||
case HIGHGUID_PET:
|
||||
case HighGuid::Pet:
|
||||
target = HashMapHolder<Pet>::Find(step.targetGUID);
|
||||
break;
|
||||
case HIGHGUID_PLAYER: // empty GUID case also
|
||||
case HighGuid::Player:
|
||||
target = HashMapHolder<Player>::Find(step.targetGUID);
|
||||
break;
|
||||
case HIGHGUID_TRANSPORT:
|
||||
case HIGHGUID_GAMEOBJECT:
|
||||
case HighGuid::GameObject:
|
||||
target = HashMapHolder<GameObject>::Find(step.targetGUID);
|
||||
break;
|
||||
case HIGHGUID_CORPSE:
|
||||
case HighGuid::Corpse:
|
||||
target = HashMapHolder<Corpse>::Find(step.targetGUID);
|
||||
break;
|
||||
case HIGHGUID_MO_TRANSPORT:
|
||||
case HighGuid::Transport:
|
||||
{
|
||||
GameObject* go = HashMapHolder<GameObject>::Find(step.targetGUID);
|
||||
target = go ? go->ToTransport() : NULL;
|
||||
@@ -829,7 +827,7 @@ void Map::ScriptsProcess()
|
||||
else //check hashmap holders
|
||||
{
|
||||
if (CreatureData const* data = sObjectMgr->GetCreatureData(step.script->CallScript.CreatureEntry))
|
||||
cTarget = ObjectAccessor::GetObjectInWorld<Creature>(data->mapid, data->posX, data->posY, ObjectGuid(HIGHGUID_UNIT, data->id, uint64(step.script->CallScript.CreatureEntry)), cTarget);
|
||||
cTarget = ObjectAccessor::GetObjectInWorld<Creature>(data->mapid, data->posX, data->posY, ObjectGuid(HighGuid::Creature, data->id, uint64(step.script->CallScript.CreatureEntry)), cTarget);
|
||||
}
|
||||
|
||||
if (!cTarget)
|
||||
|
||||
@@ -214,10 +214,10 @@ ObjectGuid SpellCastTargets::GetOrigUnitTargetGUID() const
|
||||
{
|
||||
switch (m_origObjectTargetGUID.GetHigh())
|
||||
{
|
||||
case HIGHGUID_PLAYER:
|
||||
case HIGHGUID_VEHICLE:
|
||||
case HIGHGUID_UNIT:
|
||||
case HIGHGUID_PET:
|
||||
case HighGuid::Player:
|
||||
case HighGuid::Vehicle:
|
||||
case HighGuid::Creature:
|
||||
case HighGuid::Pet:
|
||||
return m_origObjectTargetGUID;
|
||||
default:
|
||||
return ObjectGuid();
|
||||
|
||||
@@ -1559,7 +1559,7 @@ void Spell::EffectPersistentAA(SpellEffIndex effIndex)
|
||||
if (!caster->IsInWorld())
|
||||
return;
|
||||
DynamicObject* dynObj = new DynamicObject(false);
|
||||
if (!dynObj->CreateDynamicObject(sObjectMgr->GetGenerator<HIGHGUID_DYNAMICOBJECT>()->Generate(), caster, m_spellInfo, *destTarget, radius, DYNAMIC_OBJECT_AREA_SPELL))
|
||||
if (!dynObj->CreateDynamicObject(sObjectMgr->GetGenerator<HighGuid::DynamicObject>()->Generate(), caster, m_spellInfo, *destTarget, radius, DYNAMIC_OBJECT_AREA_SPELL))
|
||||
{
|
||||
delete dynObj;
|
||||
return;
|
||||
@@ -2391,7 +2391,7 @@ void Spell::EffectAddFarsight(SpellEffIndex effIndex)
|
||||
return;
|
||||
|
||||
DynamicObject* dynObj = new DynamicObject(true);
|
||||
if (!dynObj->CreateDynamicObject(sObjectMgr->GetGenerator<HIGHGUID_DYNAMICOBJECT>()->Generate(), m_caster, m_spellInfo, *destTarget, radius, DYNAMIC_OBJECT_FARSIGHT_FOCUS))
|
||||
if (!dynObj->CreateDynamicObject(sObjectMgr->GetGenerator<HighGuid::DynamicObject>()->Generate(), m_caster, m_spellInfo, *destTarget, radius, DYNAMIC_OBJECT_FARSIGHT_FOCUS))
|
||||
{
|
||||
delete dynObj;
|
||||
return;
|
||||
@@ -3205,7 +3205,7 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
|
||||
|
||||
Map* map = target->GetMap();
|
||||
|
||||
if (!pGameObj->Create(sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate(), gameobject_id, map,
|
||||
if (!pGameObj->Create(sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate(), gameobject_id, map,
|
||||
m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
|
||||
{
|
||||
delete pGameObj;
|
||||
@@ -3233,7 +3233,7 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
|
||||
if (uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry())
|
||||
{
|
||||
GameObject* linkedGO = new GameObject;
|
||||
if (linkedGO->Create(sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate(), linkedEntry, map,
|
||||
if (linkedGO->Create(sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate(), linkedEntry, map,
|
||||
m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
|
||||
{
|
||||
for (auto phase : m_caster->GetPhases())
|
||||
@@ -3859,7 +3859,7 @@ void Spell::EffectDuel(SpellEffIndex effIndex)
|
||||
uint32 gameobject_id = m_spellInfo->Effects[effIndex].MiscValue;
|
||||
|
||||
Map* map = m_caster->GetMap();
|
||||
if (!pGameObj->Create(sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate(), gameobject_id,
|
||||
if (!pGameObj->Create(sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate(), gameobject_id,
|
||||
map, 0,
|
||||
m_caster->GetPositionX()+(unitTarget->GetPositionX()-m_caster->GetPositionX())/2,
|
||||
m_caster->GetPositionY()+(unitTarget->GetPositionY()-m_caster->GetPositionY())/2,
|
||||
@@ -4222,7 +4222,7 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex)
|
||||
m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE);
|
||||
|
||||
Map* map = m_caster->GetMap();
|
||||
if (!go->Create(sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate(), go_id, map,
|
||||
if (!go->Create(sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate(), go_id, map,
|
||||
0, x, y, z, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
|
||||
{
|
||||
delete go;
|
||||
@@ -4855,7 +4855,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
|
||||
|
||||
GameObject* pGameObj = new GameObject;
|
||||
|
||||
if (!pGameObj->Create(sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate(), name_id, cMap,
|
||||
if (!pGameObj->Create(sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate(), name_id, cMap,
|
||||
0, fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
|
||||
{
|
||||
delete pGameObj;
|
||||
@@ -4924,7 +4924,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
|
||||
if (uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry())
|
||||
{
|
||||
GameObject* linkedGO = new GameObject;
|
||||
if (linkedGO->Create(sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate(), linkedEntry, cMap,
|
||||
if (linkedGO->Create(sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate(), linkedEntry, cMap,
|
||||
0, fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
|
||||
{
|
||||
for (auto phase : m_caster->GetPhases())
|
||||
@@ -5757,6 +5757,6 @@ void Spell::EffectCreateAreaTrigger(SpellEffIndex effIndex)
|
||||
uint32 triggerEntry = GetSpellInfo()->Effects[effIndex].MiscValue;
|
||||
|
||||
AreaTrigger * areaTrigger = new AreaTrigger;
|
||||
if (!areaTrigger->CreateAreaTrigger(sObjectMgr->GetGenerator<HIGHGUID_AREATRIGGER>()->Generate(), triggerEntry, GetCaster(), GetSpellInfo(), pos))
|
||||
if (!areaTrigger->CreateAreaTrigger(sObjectMgr->GetGenerator<HighGuid::AreaTrigger>()->Generate(), triggerEntry, GetCaster(), GetSpellInfo(), pos))
|
||||
delete areaTrigger;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ bool GmTicket::LoadFromDB(Field* fields)
|
||||
// ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, response, completed, escalated, viewed, haveTicket
|
||||
uint8 index = 0;
|
||||
_id = fields[ index].GetUInt32();
|
||||
_playerGuid = ObjectGuid(HIGHGUID_PLAYER, fields[++index].GetUInt64());
|
||||
_playerGuid = ObjectGuid(HighGuid::Player, fields[++index].GetUInt64());
|
||||
_playerName = fields[++index].GetString();
|
||||
_message = fields[++index].GetString();
|
||||
_createTime = fields[++index].GetUInt32();
|
||||
@@ -66,9 +66,9 @@ bool GmTicket::LoadFromDB(Field* fields)
|
||||
if (closedBy < 0)
|
||||
_closedBy.SetRawValue(0, uint64(closedBy));
|
||||
else
|
||||
_closedBy = ObjectGuid(HIGHGUID_PLAYER, uint64(closedBy));
|
||||
_closedBy = ObjectGuid(HighGuid::Player, uint64(closedBy));
|
||||
|
||||
_assignedTo = ObjectGuid(HIGHGUID_PLAYER, fields[++index].GetUInt64());
|
||||
_assignedTo = ObjectGuid(HighGuid::Player, fields[++index].GetUInt64());
|
||||
_comment = fields[++index].GetString();
|
||||
_response = fields[++index].GetString();
|
||||
_completed = fields[++index].GetBool();
|
||||
|
||||
@@ -400,18 +400,18 @@ DumpReturn PlayerDumpReader::LoadDump(std::string const& file, uint32 account, s
|
||||
|
||||
// make sure the same guid doesn't already exist and is safe to use
|
||||
bool incHighest = true;
|
||||
if (guid && guid < sObjectMgr->GetGenerator<HIGHGUID_PLAYER>()->GetNextAfterMaxUsed())
|
||||
if (guid && guid < sObjectMgr->GetGenerator<HighGuid::Player>()->GetNextAfterMaxUsed())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_GUID);
|
||||
stmt->setUInt64(0, guid);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (result)
|
||||
guid = sObjectMgr->GetGenerator<HIGHGUID_PLAYER>()->GetNextAfterMaxUsed(); // use first free if exists
|
||||
guid = sObjectMgr->GetGenerator<HighGuid::Player>()->GetNextAfterMaxUsed(); // use first free if exists
|
||||
else incHighest = false;
|
||||
}
|
||||
else
|
||||
guid = sObjectMgr->GetGenerator<HIGHGUID_PLAYER>()->GetNextAfterMaxUsed();
|
||||
guid = sObjectMgr->GetGenerator<HighGuid::Player>()->GetNextAfterMaxUsed();
|
||||
|
||||
// normalize the name if specified and check if it exists
|
||||
if (!normalizePlayerName(name))
|
||||
@@ -570,9 +570,9 @@ DumpReturn PlayerDumpReader::LoadDump(std::string const& file, uint32 account, s
|
||||
if (!changenth(line, 1, newguid)) // character_inventory.guid update
|
||||
ROLLBACK(DUMP_FILE_BROKEN);
|
||||
|
||||
if (!changeGuid(line, 2, items, sObjectMgr->GetGenerator<HIGHGUID_ITEM>()->GetNextAfterMaxUsed(), true))
|
||||
if (!changeGuid(line, 2, items, sObjectMgr->GetGenerator<HighGuid::Item>()->GetNextAfterMaxUsed(), true))
|
||||
ROLLBACK(DUMP_FILE_BROKEN); // character_inventory.bag update
|
||||
if (!changeGuid(line, 4, items, sObjectMgr->GetGenerator<HIGHGUID_ITEM>()->GetNextAfterMaxUsed()))
|
||||
if (!changeGuid(line, 4, items, sObjectMgr->GetGenerator<HighGuid::Item>()->GetNextAfterMaxUsed()))
|
||||
ROLLBACK(DUMP_FILE_BROKEN); // character_inventory.item update
|
||||
break;
|
||||
}
|
||||
@@ -588,7 +588,7 @@ DumpReturn PlayerDumpReader::LoadDump(std::string const& file, uint32 account, s
|
||||
{
|
||||
if (!changeGuid(line, 1, mails, sObjectMgr->_mailId))
|
||||
ROLLBACK(DUMP_FILE_BROKEN); // mail_items.id
|
||||
if (!changeGuid(line, 2, items, sObjectMgr->GetGenerator<HIGHGUID_ITEM>()->GetNextAfterMaxUsed()))
|
||||
if (!changeGuid(line, 2, items, sObjectMgr->GetGenerator<HighGuid::Item>()->GetNextAfterMaxUsed()))
|
||||
ROLLBACK(DUMP_FILE_BROKEN); // mail_items.item_guid
|
||||
if (!changenth(line, 3, newguid)) // mail_items.receiver
|
||||
ROLLBACK(DUMP_FILE_BROKEN);
|
||||
@@ -597,7 +597,7 @@ DumpReturn PlayerDumpReader::LoadDump(std::string const& file, uint32 account, s
|
||||
case DTT_ITEM:
|
||||
{
|
||||
// item, owner, data field:item, owner guid
|
||||
if (!changeGuid(line, 1, items, sObjectMgr->GetGenerator<HIGHGUID_ITEM>()->GetNextAfterMaxUsed()))
|
||||
if (!changeGuid(line, 1, items, sObjectMgr->GetGenerator<HighGuid::Item>()->GetNextAfterMaxUsed()))
|
||||
ROLLBACK(DUMP_FILE_BROKEN); // item_instance.guid update
|
||||
if (!changenth(line, 3, newguid)) // item_instance.owner_guid update
|
||||
ROLLBACK(DUMP_FILE_BROKEN);
|
||||
@@ -607,7 +607,7 @@ DumpReturn PlayerDumpReader::LoadDump(std::string const& file, uint32 account, s
|
||||
{
|
||||
if (!changenth(line, 1, newguid)) // character_gifts.guid update
|
||||
ROLLBACK(DUMP_FILE_BROKEN);
|
||||
if (!changeGuid(line, 2, items, sObjectMgr->GetGenerator<HIGHGUID_ITEM>()->GetNextAfterMaxUsed()))
|
||||
if (!changeGuid(line, 2, items, sObjectMgr->GetGenerator<HighGuid::Item>()->GetNextAfterMaxUsed()))
|
||||
ROLLBACK(DUMP_FILE_BROKEN); // character_gifts.item_guid update
|
||||
break;
|
||||
}
|
||||
@@ -666,13 +666,13 @@ DumpReturn PlayerDumpReader::LoadDump(std::string const& file, uint32 account, s
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
|
||||
// in case of name conflict player has to rename at login anyway
|
||||
sWorld->AddCharacterNameData(ObjectGuid(HIGHGUID_PLAYER, guid), name, gender, race, playerClass, level);
|
||||
sWorld->AddCharacterNameData(ObjectGuid(HighGuid::Player, guid), name, gender, race, playerClass, level);
|
||||
|
||||
sObjectMgr->GetGenerator<HIGHGUID_ITEM>()->Set(sObjectMgr->GetGenerator<HIGHGUID_ITEM>()->GetNextAfterMaxUsed() + items.size());
|
||||
sObjectMgr->GetGenerator<HighGuid::Item>()->Set(sObjectMgr->GetGenerator<HighGuid::Item>()->GetNextAfterMaxUsed() + items.size());
|
||||
sObjectMgr->_mailId += mails.size();
|
||||
|
||||
if (incHighest)
|
||||
sObjectMgr->GetGenerator<HIGHGUID_PLAYER>()->Generate();
|
||||
sObjectMgr->GetGenerator<HighGuid::Player>()->Generate();
|
||||
|
||||
fclose(fin);
|
||||
|
||||
|
||||
@@ -3244,7 +3244,7 @@ void World::LoadCharacterNameData()
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
AddCharacterNameData(ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt64()), fields[1].GetString(),
|
||||
AddCharacterNameData(ObjectGuid(HighGuid::Player, fields[0].GetUInt64()), fields[1].GetString(),
|
||||
fields[3].GetUInt8() /*gender*/, fields[2].GetUInt8() /*race*/, fields[4].GetUInt8() /*class*/, fields[5].GetUInt8() /*level*/);
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
|
||||
DeletedInfo info;
|
||||
|
||||
info.guid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt64());
|
||||
info.guid = ObjectGuid(HighGuid::Player, fields[0].GetUInt64());
|
||||
info.name = fields[1].GetString();
|
||||
info.accountId = fields[2].GetUInt32();
|
||||
|
||||
@@ -921,7 +921,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sObjectMgr->GetPlayerAccountIdByGUID(ObjectGuid(HIGHGUID_PLAYER, guid)))
|
||||
if (sObjectMgr->GetPlayerAccountIdByGUID(ObjectGuid(HighGuid::Player, guid)))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_CHARACTER_GUID_IN_USE, guid);
|
||||
handler->SetSentErrorMessage(true);
|
||||
@@ -969,7 +969,7 @@ public:
|
||||
ObjectGuid guid;
|
||||
// character name can't start from number
|
||||
if (isNumeric(playerStr))
|
||||
guid = ObjectGuid(HIGHGUID_PLAYER, strtoull(playerStr, nullptr, 10));
|
||||
guid = ObjectGuid(HighGuid::Player, strtoull(playerStr, nullptr, 10));
|
||||
else
|
||||
{
|
||||
std::string name = handler->extractPlayerNameFromLink(playerStr);
|
||||
|
||||
@@ -928,7 +928,7 @@ public:
|
||||
|
||||
Map* map = handler->GetSession()->GetPlayer()->GetMap();
|
||||
|
||||
if (!v->Create(sObjectMgr->GetGenerator<HIGHGUID_VEHICLE>()->Generate(), map, handler->GetSession()->GetPlayer()->GetPhaseMask(), entry, x, y, z, o, nullptr, id))
|
||||
if (!v->Create(sObjectMgr->GetGenerator<HighGuid::Vehicle>()->Generate(), map, handler->GetSession()->GetPlayer()->GetPhaseMask(), entry, x, y, z, o, nullptr, id))
|
||||
{
|
||||
delete v;
|
||||
return false;
|
||||
@@ -990,7 +990,7 @@ public:
|
||||
ObjectGuid::LowType guid = strtoull(e, nullptr, 10);
|
||||
uint32 index = (uint32)atoi(f);
|
||||
|
||||
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, guid));
|
||||
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HighGuid::Item, guid));
|
||||
|
||||
if (!i)
|
||||
return false;
|
||||
@@ -1021,7 +1021,7 @@ public:
|
||||
uint32 index = (uint32)atoi(f);
|
||||
uint32 value = (uint32)atoi(g);
|
||||
|
||||
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, guid));
|
||||
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HighGuid::Item, guid));
|
||||
|
||||
if (!i)
|
||||
return false;
|
||||
@@ -1045,7 +1045,7 @@ public:
|
||||
|
||||
ObjectGuid::LowType guid = strtoull(e, nullptr, 10);
|
||||
|
||||
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, guid));
|
||||
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HighGuid::Item, guid));
|
||||
|
||||
if (!i)
|
||||
return false;
|
||||
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
|
||||
Transport* transport = NULL;
|
||||
|
||||
if (Creature* creature = ObjectAccessor::GetObjectInWorld(ObjectGuid(HIGHGUID_UNIT, id, guid), (Creature*)NULL))
|
||||
if (Creature* creature = ObjectAccessor::GetObjectInWorld(ObjectGuid(HighGuid::Creature, id, guid), (Creature*)NULL))
|
||||
{
|
||||
x = creature->GetPositionX();
|
||||
y = creature->GetPositionY();
|
||||
|
||||
@@ -150,7 +150,7 @@ public:
|
||||
Map* map = player->GetMap();
|
||||
|
||||
GameObject* object = new GameObject;
|
||||
ObjectGuid::LowType guidLow = sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate();
|
||||
ObjectGuid::LowType guidLow = sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate();
|
||||
|
||||
if (!object->Create(guidLow, objectInfo->entry, map, 0, x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
|
||||
{
|
||||
@@ -328,7 +328,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
GameObject* target = handler->GetSession()->GetPlayer()->GetMap()->GetGameObject(ObjectGuid(HIGHGUID_GAMEOBJECT, id, guidLow));
|
||||
GameObject* target = handler->GetSession()->GetPlayer()->GetMap()->GetGameObject(ObjectGuid(HighGuid::GameObject, id, guidLow));
|
||||
|
||||
handler->PSendSysMessage(LANG_GAMEOBJECT_DETAIL, guidLow, objectInfo->name.c_str(), guidLow, id, x, y, z, mapId, o, phase);
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ public:
|
||||
const char* onlineState = "";
|
||||
|
||||
// Parse the guid to uint32...
|
||||
ObjectGuid parseGUID(HIGHGUID_PLAYER, strtoull(args, nullptr, 10));
|
||||
ObjectGuid parseGUID(HighGuid::Player, strtoull(args, nullptr, 10));
|
||||
|
||||
// ... and try to extract a player out of it.
|
||||
if (sObjectMgr->GetPlayerNameByGUID(parseGUID, nameTarget))
|
||||
|
||||
@@ -181,10 +181,10 @@ public:
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
ObjectGuid itemGuid(HIGHGUID_ITEM, fields[0].GetUInt64());
|
||||
ObjectGuid itemGuid(HighGuid::Item, fields[0].GetUInt64());
|
||||
uint32 itemBag = fields[1].GetUInt32();
|
||||
uint8 itemSlot = fields[2].GetUInt8();
|
||||
ObjectGuid ownerGuid(HIGHGUID_PLAYER, fields[3].GetUInt64());
|
||||
ObjectGuid ownerGuid(HighGuid::Player, fields[3].GetUInt64());
|
||||
uint32 ownerAccountId = fields[4].GetUInt32();
|
||||
std::string ownerName = fields[5].GetString();
|
||||
|
||||
@@ -282,8 +282,8 @@ public:
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
ObjectGuid itemGuid(HIGHGUID_ITEM, fields[0].GetUInt64());
|
||||
ObjectGuid owner(HIGHGUID_PLAYER, fields[1].GetUInt64());
|
||||
ObjectGuid itemGuid(HighGuid::Item, fields[0].GetUInt64());
|
||||
ObjectGuid owner(HighGuid::Player, fields[1].GetUInt64());
|
||||
uint32 ownerAccountId = fields[2].GetUInt32();
|
||||
std::string ownerName = fields[3].GetString();
|
||||
|
||||
@@ -314,8 +314,8 @@ public:
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
ObjectGuid itemGuid(HIGHGUID_ITEM, fields[0].GetUInt64());
|
||||
ObjectGuid guildGuid(HIGHGUID_GUILD, fields[1].GetUInt64());
|
||||
ObjectGuid itemGuid(HighGuid::Item, fields[0].GetUInt64());
|
||||
ObjectGuid guildGuid(HighGuid::Guild, fields[1].GetUInt64());
|
||||
std::string guildName = fields[2].GetString();
|
||||
|
||||
char const* itemPos = "[in guild bank]";
|
||||
@@ -476,7 +476,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
ObjectGuid parseGUID(HIGHGUID_PLAYER, strtoull(args, nullptr, 10));
|
||||
ObjectGuid parseGUID(HighGuid::Player, strtoull(args, nullptr, 10));
|
||||
|
||||
if (sObjectMgr->GetPlayerNameByGUID(parseGUID, targetName))
|
||||
{
|
||||
|
||||
@@ -1280,7 +1280,7 @@ public:
|
||||
do
|
||||
{
|
||||
Field* characterFields = result2->Fetch();
|
||||
ObjectGuid guid(HIGHGUID_PLAYER, characterFields[0].GetUInt64());
|
||||
ObjectGuid guid(HighGuid::Player, characterFields[0].GetUInt64());
|
||||
std::string name = characterFields[1].GetString();
|
||||
|
||||
handler->PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER, name.c_str(), guid.ToString().c_str());
|
||||
|
||||
@@ -1390,7 +1390,7 @@ public:
|
||||
PreparedStatement* stmt = NULL;
|
||||
|
||||
// To make sure we get a target, we convert our guid to an omniversal...
|
||||
ObjectGuid parseGUID(HIGHGUID_PLAYER, strtoull(args, nullptr, 10));
|
||||
ObjectGuid parseGUID(HighGuid::Player, strtoull(args, nullptr, 10));
|
||||
|
||||
// ... and make sure we get a target, somehow.
|
||||
if (sObjectMgr->GetPlayerNameByGUID(parseGUID, targetName))
|
||||
|
||||
@@ -261,7 +261,7 @@ public:
|
||||
|
||||
if (Transport* trans = chr->GetTransport())
|
||||
{
|
||||
ObjectGuid::LowType guid = sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate();
|
||||
ObjectGuid::LowType guid = sObjectMgr->GetGenerator<HighGuid::Creature>()->Generate();
|
||||
CreatureData& data = sObjectMgr->NewOrExistCreatureData(guid);
|
||||
data.id = id;
|
||||
data.phaseMask = chr->GetPhaseMask();
|
||||
@@ -279,7 +279,7 @@ public:
|
||||
}
|
||||
|
||||
Creature* creature = new Creature();
|
||||
if (!creature->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
|
||||
if (!creature->Create(sObjectMgr->GetGenerator<HighGuid::Creature>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
|
||||
{
|
||||
delete creature;
|
||||
return false;
|
||||
@@ -527,7 +527,7 @@ public:
|
||||
return false;
|
||||
|
||||
if (CreatureData const* cr_data = sObjectMgr->GetCreatureData(lowguid))
|
||||
unit = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HIGHGUID_UNIT, cr_data->id, lowguid));
|
||||
unit = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HighGuid::Creature, cr_data->id, lowguid));
|
||||
}
|
||||
else
|
||||
unit = handler->getSelectedCreature();
|
||||
@@ -1323,7 +1323,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
ObjectGuid receiver_guid(HIGHGUID_PLAYER, strtoull(receiver_str, nullptr, 10));
|
||||
ObjectGuid receiver_guid(HighGuid::Player, strtoull(receiver_str, nullptr, 10));
|
||||
|
||||
// check online security
|
||||
Player* receiver = ObjectAccessor::FindPlayer(receiver_guid);
|
||||
|
||||
@@ -674,7 +674,7 @@ public:
|
||||
}
|
||||
// re-create
|
||||
Creature* wpCreature2 = new Creature();
|
||||
if (!wpCreature2->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), map, chr->GetPhaseMask(), VISUAL_WAYPOINT, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
|
||||
if (!wpCreature2->Create(sObjectMgr->GetGenerator<HighGuid::Creature>()->Generate(), map, chr->GetPhaseMask(), VISUAL_WAYPOINT, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
|
||||
delete wpCreature2;
|
||||
@@ -850,7 +850,7 @@ public:
|
||||
{
|
||||
Field* fields = result2->Fetch();
|
||||
ObjectGuid::LowType wpguid = fields[0].GetUInt64();
|
||||
Creature* creature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HIGHGUID_UNIT, VISUAL_WAYPOINT, wpguid));
|
||||
Creature* creature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HighGuid::Creature, VISUAL_WAYPOINT, wpguid));
|
||||
|
||||
if (!creature)
|
||||
{
|
||||
@@ -894,7 +894,7 @@ public:
|
||||
float o = chr->GetOrientation();
|
||||
|
||||
Creature* wpCreature = new Creature();
|
||||
if (!wpCreature->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
|
||||
if (!wpCreature->Create(sObjectMgr->GetGenerator<HighGuid::Creature>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
|
||||
delete wpCreature;
|
||||
@@ -959,7 +959,7 @@ public:
|
||||
Map* map = chr->GetMap();
|
||||
|
||||
Creature* creature = new Creature();
|
||||
if (!creature->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
|
||||
if (!creature->Create(sObjectMgr->GetGenerator<HighGuid::Creature>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
|
||||
delete creature;
|
||||
@@ -1011,7 +1011,7 @@ public:
|
||||
Map* map = chr->GetMap();
|
||||
|
||||
Creature* creature = new Creature();
|
||||
if (!creature->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
|
||||
if (!creature->Create(sObjectMgr->GetGenerator<HighGuid::Creature>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id);
|
||||
delete creature;
|
||||
@@ -1055,7 +1055,7 @@ public:
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
ObjectGuid::LowType guid = fields[0].GetUInt64();
|
||||
Creature* creature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HIGHGUID_UNIT, VISUAL_WAYPOINT, guid));
|
||||
Creature* creature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HighGuid::Creature, VISUAL_WAYPOINT, guid));
|
||||
if (!creature)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_WAYPOINT_NOTREMOVED, guid);
|
||||
|
||||
@@ -648,7 +648,7 @@ class npc_spinestalker : public CreatureScript
|
||||
// Increase add count
|
||||
if (!me->isDead())
|
||||
{
|
||||
_instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid(HIGHGUID_UNIT, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
|
||||
_instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid(HighGuid::Creature, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
|
||||
Reset();
|
||||
}
|
||||
}
|
||||
@@ -671,7 +671,7 @@ class npc_spinestalker : public CreatureScript
|
||||
void JustRespawned() override
|
||||
{
|
||||
ScriptedAI::JustRespawned();
|
||||
_instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid(HIGHGUID_UNIT, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
|
||||
_instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid(HighGuid::Creature, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
@@ -784,7 +784,7 @@ class npc_rimefang : public CreatureScript
|
||||
// Increase add count
|
||||
if (!me->isDead())
|
||||
{
|
||||
_instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid(HIGHGUID_UNIT, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
|
||||
_instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid(HighGuid::Creature, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
|
||||
Reset();
|
||||
}
|
||||
}
|
||||
@@ -807,7 +807,7 @@ class npc_rimefang : public CreatureScript
|
||||
void JustRespawned() override
|
||||
{
|
||||
ScriptedAI::JustRespawned();
|
||||
_instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid(HIGHGUID_UNIT, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
|
||||
_instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid(HighGuid::Creature, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
@@ -951,7 +951,7 @@ class npc_sindragosa_trash : public CreatureScript
|
||||
if (!me->isDead())
|
||||
{
|
||||
if (me->GetEntry() == NPC_FROSTWING_WHELP)
|
||||
_instance->SetGuidData(_frostwyrmId, ObjectGuid(HIGHGUID_UNIT, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
|
||||
_instance->SetGuidData(_frostwyrmId, ObjectGuid(HighGuid::Creature, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
|
||||
Reset();
|
||||
}
|
||||
}
|
||||
@@ -974,7 +974,7 @@ class npc_sindragosa_trash : public CreatureScript
|
||||
|
||||
// Increase add count
|
||||
if (me->GetEntry() == NPC_FROSTWING_WHELP)
|
||||
_instance->SetGuidData(_frostwyrmId, ObjectGuid(HIGHGUID_UNIT, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
|
||||
_instance->SetGuidData(_frostwyrmId, ObjectGuid(HighGuid::Creature, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data) override
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
void SpawnGameObject(uint32 entry, Position& pos)
|
||||
{
|
||||
GameObject* go = new GameObject;
|
||||
if (!go->Create(sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate(), entry, instance,
|
||||
if (!go->Create(sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate(), entry, instance,
|
||||
PHASEMASK_NORMAL, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(),
|
||||
0, 0, 0, 0, 120, GO_STATE_READY))
|
||||
{
|
||||
|
||||
@@ -166,7 +166,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!go->Create(sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate(), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), 0, 0, 0, 0, 100, GO_STATE_READY))
|
||||
if (!go->Create(sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate(), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), 0, 0, 0, 0, 100, GO_STATE_READY))
|
||||
{
|
||||
delete go;
|
||||
return true;
|
||||
@@ -203,7 +203,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!go->Create(sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate(), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), 0, 0, 0, 0, 100, GO_STATE_READY))
|
||||
if (!go->Create(sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate(), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), 0, 0, 0, 0, 100, GO_STATE_READY))
|
||||
{
|
||||
delete go;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user