diff options
-rw-r--r-- | src/server/game/DungeonFinding/LFGScripts.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Entities/GameObject/GameObject.cpp | 11 | ||||
-rw-r--r-- | src/server/game/Entities/Item/Item.cpp | 67 | ||||
-rw-r--r-- | src/server/game/Entities/Item/Item.h | 4 | ||||
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 11 | ||||
-rw-r--r-- | src/server/game/Entities/Player/Player.h | 2 | ||||
-rw-r--r-- | src/server/game/Groups/Group.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Guilds/Guild.cpp | 24 | ||||
-rw-r--r-- | src/server/game/Handlers/GroupHandler.cpp | 10 | ||||
-rw-r--r-- | src/server/game/Handlers/ItemHandler.cpp | 24 | ||||
-rw-r--r-- | src/server/game/Handlers/LootHandler.cpp | 7 | ||||
-rw-r--r-- | src/server/game/Loot/LootMgr.cpp | 36 | ||||
-rw-r--r-- | src/server/game/Loot/LootMgr.h | 12 | ||||
-rw-r--r-- | src/server/scripts/Northrend/isle_of_conquest.cpp | 8 |
14 files changed, 102 insertions, 120 deletions
diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp index bc2086afabe..ad54281adc5 100644 --- a/src/server/game/DungeonFinding/LFGScripts.cpp +++ b/src/server/game/DungeonFinding/LFGScripts.cpp @@ -86,8 +86,8 @@ void LFGPlayerScript::OnMapChanged(Player* player) sLFGMgr->LeaveLfg(player->GetGUID()); player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW); player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, 0.0f); - TC_LOG_ERROR("lfg", "LFGPlayerScript::OnMapChanged, Player %s (%u) is in LFG dungeon map but does not have a valid group! " - "Teleporting to homebind.", player->GetName().c_str(), player->GetGUIDLow()); + TC_LOG_ERROR("lfg", "LFGPlayerScript::OnMapChanged, Player %s (%s) is in LFG dungeon map but does not have a valid group! " + "Teleporting to homebind.", player->GetName().c_str(), player->GetGUID().ToString().c_str()); return; } diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 947b4e81b04..d179eb19c99 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -115,8 +115,8 @@ void GameObject::RemoveFromOwner() return; } - TC_LOG_FATAL("misc", "Removed GameObject (GUID: %u Entry: %u SpellId: %u LinkedGO: %u) that just lost any reference to the owner (%s) GO list", - GetGUIDLow(), GetGOInfo()->entry, m_spellId, GetGOInfo()->GetLinkedGameObjectEntry(), ownerGUID.ToString().c_str()); + TC_LOG_FATAL("misc", "Removed GameObject (%s SpellId: %u LinkedGO: %u) that just lost any reference to the owner (%s) GO list", + GetGUID().ToString().c_str(), m_spellId, GetGOInfo()->GetLinkedGameObjectEntry(), ownerGUID.ToString().c_str()); SetOwnerGUID(ObjectGuid::Empty); } @@ -769,7 +769,8 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) return; if (!m_DBTableGuid) - m_DBTableGuid = GetGUIDLow(); + m_DBTableGuid = GetGUID().GetCounter(); + // update in loaded data (changing data only in this place) GameObjectData& data = sObjectMgr->NewGOData(m_DBTableGuid); @@ -1764,8 +1765,8 @@ void GameObject::Use(Unit* user) } default: if (GetGoType() >= MAX_GAMEOBJECT_TYPE) - TC_LOG_ERROR("misc", "GameObject::Use(): unit (type: %u, guid: %u, name: %s) tries to use object (guid: %u, entry: %u, name: %s) of unknown type (%u)", - user->GetTypeId(), user->GetGUIDLow(), user->GetName().c_str(), GetGUIDLow(), GetEntry(), GetGOInfo()->name.c_str(), GetGoType()); + TC_LOG_ERROR("misc", "GameObject::Use(): unit (type: %u, %s, name: %s) tries to use object (%s, name: %s) of unknown type (%u)", + user->GetTypeId(), user->GetGUID().ToString().c_str(), user->GetName().c_str(), GetGUID().ToString().c_str(), GetGOInfo()->name.c_str(), GetGoType()); break; } diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index b9c0bf8deab..3fe62253b38 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -322,7 +322,6 @@ void Item::SaveToDB(SQLTransaction& trans) if (!isInTransaction) trans = CharacterDatabase.BeginTransaction(); - uint32 guid = GetGUIDLow(); switch (uState) { case ITEM_NEW: @@ -357,7 +356,7 @@ void Item::SaveToDB(SQLTransaction& trans) stmt->setUInt16(++index, GetUInt32Value(ITEM_FIELD_DURABILITY)); stmt->setUInt32(++index, GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME)); stmt->setString(++index, m_text); - stmt->setUInt32(++index, guid); + stmt->setUInt32(++index, GetGUID().GetCounter()); trans->Append(stmt); @@ -365,7 +364,7 @@ void Item::SaveToDB(SQLTransaction& trans) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GIFT_OWNER); stmt->setUInt32(0, GetOwnerGUID().GetCounter()); - stmt->setUInt32(1, guid); + stmt->setUInt32(1, GetGUID().GetCounter()); trans->Append(stmt); } break; @@ -373,13 +372,13 @@ void Item::SaveToDB(SQLTransaction& trans) case ITEM_REMOVED: { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE); - stmt->setUInt32(0, guid); + stmt->setUInt32(0, GetGUID().GetCounter()); trans->Append(stmt); if (HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT); - stmt->setUInt32(0, guid); + stmt->setUInt32(0, GetGUID().GetCounter()); trans->Append(stmt); } @@ -494,7 +493,7 @@ void Item::DeleteFromDB(SQLTransaction& trans, uint32 itemGuid) void Item::DeleteFromDB(SQLTransaction& trans) { - DeleteFromDB(trans, GetGUIDLow()); + DeleteFromDB(trans, GetGUID().GetCounter()); // Delete the items if this is a container if (!loot.isLooted()) @@ -511,7 +510,7 @@ void Item::DeleteFromInventoryDB(SQLTransaction& trans, uint32 itemGuid) void Item::DeleteFromInventoryDB(SQLTransaction& trans) { - DeleteFromInventoryDB(trans, GetGUIDLow()); + DeleteFromInventoryDB(trans, GetGUID().GetCounter()); } ItemTemplate const* Item::GetTemplate() const @@ -1082,7 +1081,7 @@ bool Item::IsBindedNotWith(Player const* player) const return false; if (HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE)) - if (allowedGUIDs.find(player->GetGUIDLow()) != allowedGUIDs.end()) + if (allowedGUIDs.find(player->GetGUID()) != allowedGUIDs.end()) return false; // BOA item case @@ -1104,11 +1103,11 @@ void Item::SaveRefundDataToDB() SQLTransaction trans = CharacterDatabase.BeginTransaction(); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_REFUND_INSTANCE); - stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(0, GetGUID().GetCounter()); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_REFUND_INSTANCE); - stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(0, GetGUID().GetCounter()); stmt->setUInt32(1, GetRefundRecipient()); stmt->setUInt32(2, GetPaidMoney()); stmt->setUInt16(3, uint16(GetPaidExtendedCost())); @@ -1122,7 +1121,7 @@ void Item::DeleteRefundDataFromDB(SQLTransaction* trans) if (trans) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_REFUND_INSTANCE); - stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(0, GetGUID().GetCounter()); (*trans)->Append(stmt); } @@ -1186,7 +1185,7 @@ bool Item::IsRefundExpired() return (GetPlayedTime() > 2*HOUR); } -void Item::SetSoulboundTradeable(AllowedLooterSet const& allowedLooters) +void Item::SetSoulboundTradeable(GuidSet const& allowedLooters) { SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE); allowedGUIDs = allowedLooters; @@ -1201,7 +1200,7 @@ void Item::ClearSoulboundTradeable(Player* currentOwner) allowedGUIDs.clear(); SetState(ITEM_CHANGED, currentOwner); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_BOP_TRADE); - stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(0, GetGUID().GetCounter()); CharacterDatabase.Execute(stmt); } @@ -1522,20 +1521,19 @@ void Item::ItemContainerSaveLootToDB() if (loot.isLooted()) // no money and no loot return; - uint32 container_id = GetGUIDLow(); SQLTransaction trans = CharacterDatabase.BeginTransaction(); - loot.containerID = container_id; // Save this for when a LootItem is removed + loot.containerID = GetGUID(); // Save this for when a LootItem is removed // Save money if (loot.gold > 0) { PreparedStatement* stmt_money = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY); - stmt_money->setUInt32(0, container_id); + stmt_money->setUInt32(0, loot.containerID.GetCounter()); trans->Append(stmt_money); stmt_money = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEMCONTAINER_MONEY); - stmt_money->setUInt32(0, container_id); + stmt_money->setUInt32(0, loot.containerID.GetCounter()); stmt_money->setUInt32(1, loot.gold); trans->Append(stmt_money); } @@ -1544,7 +1542,7 @@ void Item::ItemContainerSaveLootToDB() if (!loot.isLooted()) { PreparedStatement* stmt_items = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS); - stmt_items->setUInt32(0, container_id); + stmt_items->setUInt32(0, loot.containerID.GetCounter()); trans->Append(stmt_items); // Now insert the items @@ -1566,7 +1564,7 @@ void Item::ItemContainerSaveLootToDB() stmt_items = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEMCONTAINER_ITEMS); // container_id, item_id, item_count, follow_rules, ffa, blocked, counted, under_threshold, needs_quest, rnd_prop, rnd_suffix - stmt_items->setUInt32(0, container_id); + stmt_items->setUInt32(0, loot.containerID.GetCounter()); stmt_items->setUInt32(1, _li->itemid); stmt_items->setUInt32(2, _li->count); stmt_items->setBool(3, _li->follow_loot_rules); @@ -1590,14 +1588,12 @@ bool Item::ItemContainerLoadLootFromDB() // Default. If there are no records for this item then it will be rolled for in Player::SendLoot() m_lootGenerated = false; - uint32 container_id = GetGUIDLow(); - // Save this for later use - loot.containerID = container_id; + loot.containerID = GetGUID(); // First, see if there was any money loot. This gets added directly to the container. PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEMCONTAINER_MONEY); - stmt->setUInt32(0, container_id); + stmt->setUInt32(0, loot.containerID.GetCounter()); PreparedQueryResult money_result = CharacterDatabase.Query(stmt); if (money_result) @@ -1608,7 +1604,7 @@ bool Item::ItemContainerLoadLootFromDB() // Next, load any items that were saved stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEMCONTAINER_ITEMS); - stmt->setUInt32(0, container_id); + stmt->setUInt32(0, loot.containerID.GetCounter()); PreparedQueryResult item_result = CharacterDatabase.Query(stmt); if (item_result) @@ -1644,7 +1640,7 @@ bool Item::ItemContainerLoadLootFromDB() // If container item is in a bag, add that player as an allowed looter if (GetBagSlot()) - loot_item.allowedGUIDs.insert(GetOwner()->GetGUIDLow()); + loot_item.allowedGUIDs.insert(GetOwner()->GetGUID()); // Finally add the LootItem to the container loot.items.push_back(loot_item); @@ -1666,35 +1662,26 @@ bool Item::ItemContainerLoadLootFromDB() void Item::ItemContainerDeleteLootItemsFromDB() { // Deletes items associated with an openable item from the DB - uint32 containerId = GetGUIDLow(); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS); - stmt->setUInt32(0, containerId); - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->Append(stmt); - CharacterDatabase.CommitTransaction(trans); + stmt->setUInt32(0, GetGUID().GetCounter()); + CharacterDatabase.Execute(stmt); } void Item::ItemContainerDeleteLootItemFromDB(uint32 itemID) { // Deletes a single item associated with an openable item from the DB - uint32 containerId = GetGUIDLow(); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEM); - stmt->setUInt32(0, containerId); + stmt->setUInt32(0, GetGUID().GetCounter()); stmt->setUInt32(1, itemID); - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->Append(stmt); - CharacterDatabase.CommitTransaction(trans); + CharacterDatabase.Execute(stmt); } void Item::ItemContainerDeleteLootMoneyFromDB() { // Deletes the money loot associated with an openable item from the DB - uint32 containerId = GetGUIDLow(); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY); - stmt->setUInt32(0, containerId); - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->Append(stmt); - CharacterDatabase.CommitTransaction(trans); + stmt->setUInt32(0, GetGUID().GetCounter()); + CharacterDatabase.Execute(stmt); } void Item::ItemContainerDeleteLootMoneyAndLootItemsFromDB() diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index dbcf023b842..3e8280a450e 100644 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -354,7 +354,7 @@ class Item : public Object bool IsRefundExpired(); // Soulbound trade system - void SetSoulboundTradeable(AllowedLooterSet const& allowedLooters); + void SetSoulboundTradeable(GuidSet const& allowedLooters); void ClearSoulboundTradeable(Player* currentOwner); bool CheckSoulboundTradeExpire(); @@ -390,6 +390,6 @@ class Item : public Object uint32 m_refundRecipient; uint32 m_paidMoney; uint32 m_paidExtendedCost; - AllowedLooterSet allowedGUIDs; + GuidSet allowedGUIDs; }; #endif diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index d6aa7c19717..a7305063161 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -11950,7 +11950,7 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje } // Return stored item (if stored to stack, it can diff. from pItem). And pItem ca be deleted in this case. -Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update, int32 randomPropertyId, AllowedLooterSet const& allowedLooters) +Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update, int32 randomPropertyId, GuidSet const& allowedLooters) { uint32 count = 0; for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr) @@ -11974,13 +11974,13 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update // save data std::ostringstream ss; - AllowedLooterSet::const_iterator itr = allowedLooters.begin(); + GuidSet::const_iterator itr = allowedLooters.begin(); ss << *itr; for (++itr; itr != allowedLooters.end(); ++itr) ss << ' ' << *itr; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_BOP_TRADE); - stmt->setUInt32(0, pItem->GetGUIDLow()); + stmt->setUInt32(0, pItem->GetGUID().GetCounter()); stmt->setString(1, ss.str()); CharacterDatabase.Execute(stmt); } @@ -25485,8 +25485,7 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot) InventoryResult msg = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, item->itemid, item->count); if (msg == EQUIP_ERR_OK) { - AllowedLooterSet looters = item->GetAllowedLooters(); - Item* newitem = StoreNewItem(dest, item->itemid, true, item->randomPropertyId, looters); + Item* newitem = StoreNewItem(dest, item->itemid, true, item->randomPropertyId, item->GetAllowedLooters()); if (qitem) { @@ -25531,7 +25530,7 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot) UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, item->itemid, item->count); // LootItem is being removed (looted) from the container, delete it from the DB. - if (loot->containerID > 0) + if (!loot->containerID.IsEmpty()) loot->DeleteLootItemFromContainerItemDB(item->itemid); } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 6fbd8425ecf..d53ebf64eea 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1424,7 +1424,7 @@ class Player : public Unit, public GridObject<Player> InventoryResult CanUseItem(ItemTemplate const* pItem) const; InventoryResult CanUseAmmo(uint32 item) const; InventoryResult CanRollForItemInLFG(ItemTemplate const* item, WorldObject const* lootedObject) const; - Item* StoreNewItem(ItemPosCountVec const& pos, uint32 item, bool update, int32 randomPropertyId = 0, AllowedLooterSet const& allowedLooters = AllowedLooterSet()); + Item* StoreNewItem(ItemPosCountVec const& pos, uint32 item, bool update, int32 randomPropertyId = 0, GuidSet const& allowedLooters = GuidSet()); Item* StoreItem(ItemPosCountVec const& pos, Item* pItem, bool update); Item* EquipNewItem(uint16 pos, uint32 item, bool update); Item* EquipItem(uint16 pos, Item* pItem, bool update); diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 463b12379fa..50700f5126a 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -691,7 +691,7 @@ void Group::ChangeLeader(ObjectGuid newLeaderGuid) // Update the group leader PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_LEADER); - stmt->setUInt32(0, newLeader->GetGUIDLow()); + stmt->setUInt32(0, newLeader->GetGUID().GetCounter()); stmt->setUInt32(1, m_dbStoreId); trans->Append(stmt); diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 0d3fb635a40..bcd3560a845 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -598,7 +598,7 @@ bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* item) stmt->setUInt32(0, m_guildId); stmt->setUInt8 (1, m_tabId); stmt->setUInt8 (2, slotId); - stmt->setUInt32(3, item->GetGUIDLow()); + stmt->setUInt32(3, item->GetGUID().GetCounter()); CharacterDatabase.ExecuteOrAppend(trans, stmt); item->SetGuidValue(ITEM_FIELD_CONTAINED, ObjectGuid::Empty); @@ -928,7 +928,7 @@ void Guild::PlayerMoveItemData::LogBankEvent(SQLTransaction& trans, MoveItemData { ASSERT(pFrom); // Bank -> Char - m_pGuild->_LogBankEvent(trans, GUILD_BANK_LOG_WITHDRAW_ITEM, pFrom->GetContainer(), m_pPlayer->GetGUIDLow(), + m_pGuild->_LogBankEvent(trans, GUILD_BANK_LOG_WITHDRAW_ITEM, pFrom->GetContainer(), m_pPlayer->GetGUID().GetCounter(), pFrom->GetItem()->GetEntry(), count); } @@ -1013,11 +1013,11 @@ void Guild::BankMoveItemData::LogBankEvent(SQLTransaction& trans, MoveItemData* ASSERT(pFrom->GetItem()); if (pFrom->IsBank()) // Bank -> Bank - m_pGuild->_LogBankEvent(trans, GUILD_BANK_LOG_MOVE_ITEM, pFrom->GetContainer(), m_pPlayer->GetGUIDLow(), + m_pGuild->_LogBankEvent(trans, GUILD_BANK_LOG_MOVE_ITEM, pFrom->GetContainer(), m_pPlayer->GetGUID().GetCounter(), pFrom->GetItem()->GetEntry(), count, m_container); else // Char -> Bank - m_pGuild->_LogBankEvent(trans, GUILD_BANK_LOG_DEPOSIT_ITEM, m_container, m_pPlayer->GetGUIDLow(), + m_pGuild->_LogBankEvent(trans, GUILD_BANK_LOG_DEPOSIT_ITEM, m_container, m_pPlayer->GetGUID().GetCounter(), pFrom->GetItem()->GetEntry(), count); } @@ -1027,8 +1027,8 @@ void Guild::BankMoveItemData::LogAction(MoveItemData* pFrom) const if (!pFrom->IsBank() && m_pPlayer->GetSession()->HasPermission(rbac::RBAC_PERM_LOG_GM_TRADE)) /// @todo Move this to scripts { sLog->outCommand(m_pPlayer->GetSession()->GetAccountId(), - "GM %s (Guid: %u) (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank named: %s (Guild ID: %u)", - m_pPlayer->GetName().c_str(), m_pPlayer->GetGUIDLow(), m_pPlayer->GetSession()->GetAccountId(), + "GM %s (%s) (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank named: %s (Guild ID: %u)", + m_pPlayer->GetName().c_str(), m_pPlayer->GetGUID().ToString().c_str(), m_pPlayer->GetSession()->GetAccountId(), pFrom->GetItem()->GetTemplate()->Name1.c_str(), pFrom->GetItem()->GetEntry(), pFrom->GetItem()->GetCount(), m_pGuild->GetName().c_str(), m_pGuild->GetId()); } @@ -1803,7 +1803,7 @@ void Guild::HandleInviteMember(WorldSession* session, std::string const& name) TC_LOG_DEBUG("guild", "Player %s invited %s to join his Guild", player->GetName().c_str(), name.c_str()); pInvitee->SetGuildIdInvited(m_id); - _LogEvent(GUILD_EVENT_LOG_INVITE_PLAYER, player->GetGUIDLow(), pInvitee->GetGUIDLow()); + _LogEvent(GUILD_EVENT_LOG_INVITE_PLAYER, player->GetGUID().GetCounter(), pInvitee->GetGUID().GetCounter()); WorldPacket data(SMSG_GUILD_INVITE, 100); data << uint32(GetLevel()); @@ -1905,7 +1905,7 @@ void Guild::HandleLeaveMember(WorldSession* session) { DeleteMember(player->GetGUID(), false, false); - _LogEvent(GUILD_EVENT_LOG_LEAVE_GUILD, player->GetGUIDLow()); + _LogEvent(GUILD_EVENT_LOG_LEAVE_GUILD, player->GetGUID().GetCounter()); _BroadcastEvent(GE_LEFT, player->GetGUID(), player->GetName().c_str()); SendCommandResult(session, GUILD_COMMAND_QUIT, ERR_GUILD_COMMAND_SUCCESS, m_name); @@ -1941,7 +1941,7 @@ void Guild::HandleRemoveMember(WorldSession* session, ObjectGuid guid) { // After call to DeleteMember pointer to member becomes invalid DeleteMember(guid, false, true); - _LogEvent(GUILD_EVENT_LOG_UNINVITE_PLAYER, player->GetGUIDLow(), guid.GetCounter()); + _LogEvent(GUILD_EVENT_LOG_UNINVITE_PLAYER, player->GetGUID().GetCounter(), guid.GetCounter()); _BroadcastEvent(GE_REMOVED, ObjectGuid::Empty, name.c_str(), player->GetName().c_str()); SendCommandResult(session, GUILD_COMMAND_REMOVE, ERR_GUILD_COMMAND_SUCCESS, name); } @@ -1997,7 +1997,7 @@ void Guild::HandleUpdateMemberRank(WorldSession* session, ObjectGuid guid, bool uint32 newRankId = member->GetRankId() + (demote ? 1 : -1); member->ChangeRank(newRankId); - _LogEvent(demote ? GUILD_EVENT_LOG_DEMOTE_PLAYER : GUILD_EVENT_LOG_PROMOTE_PLAYER, player->GetGUIDLow(), member->GetGUID().GetCounter(), newRankId); + _LogEvent(demote ? GUILD_EVENT_LOG_DEMOTE_PLAYER : GUILD_EVENT_LOG_PROMOTE_PLAYER, player->GetGUID().GetCounter(), member->GetGUID().GetCounter(), newRankId); _BroadcastEvent(demote ? GE_DEMOTION : GE_PROMOTION, ObjectGuid::Empty, player->GetName().c_str(), name.c_str(), _GetRankName(newRankId).c_str()); } } @@ -2081,7 +2081,7 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint64 amount, bool player->SaveGoldToDB(trans); } - _LogBankEvent(trans, cashFlow ? GUILD_BANK_LOG_CASH_FLOW_DEPOSIT : GUILD_BANK_LOG_DEPOSIT_MONEY, uint8(0), player->GetGUIDLow(), amount); + _LogBankEvent(trans, cashFlow ? GUILD_BANK_LOG_CASH_FLOW_DEPOSIT : GUILD_BANK_LOG_DEPOSIT_MONEY, uint8(0), player->GetGUID().GetCounter(), amount); CharacterDatabase.CommitTransaction(trans); std::string aux = ByteArrayToHexStr(reinterpret_cast<uint8*>(&m_bankMoney), 8, true); @@ -2131,7 +2131,7 @@ bool Guild::HandleMemberWithdrawMoney(WorldSession* session, uint64 amount, bool _ModifyBankMoney(trans, amount, false); // Log guild bank event - _LogBankEvent(trans, repair ? GUILD_BANK_LOG_REPAIR_MONEY : GUILD_BANK_LOG_WITHDRAW_MONEY, uint8(0), player->GetGUIDLow(), amount); + _LogBankEvent(trans, repair ? GUILD_BANK_LOG_REPAIR_MONEY : GUILD_BANK_LOG_WITHDRAW_MONEY, uint8(0), player->GetGUID().GetCounter(), amount); CharacterDatabase.CommitTransaction(trans); std::string aux = ByteArrayToHexStr(reinterpret_cast<uint8*>(&m_bankMoney), 8, true); diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 590a939ae3f..32fb9bd1ee4 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -345,7 +345,7 @@ void WorldSession::HandleGroupInviteResponseOpcode(WorldPacket& recvData) if (group->GetLeaderGUID() == GetPlayer()->GetGUID()) { - TC_LOG_ERROR("network", "HandleGroupAcceptOpcode: player %s(%d) tried to accept an invite to his own group", GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow()); + TC_LOG_ERROR("network", "HandleGroupAcceptOpcode: player %s (%s) tried to accept an invite to his own group", GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str()); return; } @@ -411,8 +411,8 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket& recvData) //can't uninvite yourself if (guid == GetPlayer()->GetGUID()) { - TC_LOG_ERROR("network", "WorldSession::HandleGroupUninviteGuidOpcode: leader %s(%d) tried to uninvite himself from the group.", - GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow()); + TC_LOG_ERROR("network", "WorldSession::HandleGroupUninviteGuidOpcode: leader %s (%s) tried to uninvite himself from the group.", + GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str()); return; } @@ -462,8 +462,8 @@ void WorldSession::HandleGroupUninviteOpcode(WorldPacket& recvData) // can't uninvite yourself if (GetPlayer()->GetName() == membername) { - TC_LOG_ERROR("network", "WorldSession::HandleGroupUninviteOpcode: leader %s(%d) tried to uninvite himself from the group.", - GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow()); + TC_LOG_ERROR("network", "WorldSession::HandleGroupUninviteOpcode: leader %s (%s) tried to uninvite himself from the group.", + GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str()); return; } diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 1a07656df1d..6a303f870e5 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1031,7 +1031,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_GIFT); stmt->setUInt32(0, item->GetOwnerGUID().GetCounter()); - stmt->setUInt32(1, item->GetGUIDLow()); + stmt->setUInt32(1, item->GetGUID().GetCounter()); stmt->setUInt32(2, item->GetEntry()); stmt->setUInt32(3, item->GetUInt32Value(ITEM_FIELD_FLAGS)); trans->Append(stmt); @@ -1371,7 +1371,7 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) if (count >= EQUIPMENT_SLOT_END) { - TC_LOG_DEBUG("network", "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) sent a wrong count (%u) when transmogrifying items.", player->GetGUIDLow(), player->GetName().c_str(), count); + TC_LOG_DEBUG("network", "WORLD: HandleTransmogrifyItems - Player (%s, name: %s) sent a wrong count (%u) when transmogrifying items.", player->GetGUID().ToString().c_str(), player->GetName().c_str(), count); recvData.rfinish(); return; } @@ -1446,7 +1446,7 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) // slot of the transmogrified item if (slots[i] >= EQUIPMENT_SLOT_END) { - TC_LOG_DEBUG("network", "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) tried to transmogrify %s with a wrong slot (%u) when transmogrifying items.", player->GetGUIDLow(), player->GetName().c_str(), itemGuids[i].ToString().c_str(), slots[i]); + TC_LOG_DEBUG("network", "WORLD: HandleTransmogrifyItems - Player (%s, name: %s) tried to transmogrify %s with a wrong slot (%u) when transmogrifying items.", player->GetGUID().ToString().c_str(), player->GetName().c_str(), itemGuids[i].ToString().c_str(), slots[i]); return; } @@ -1454,7 +1454,7 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) Item* itemTransmogrified = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slots[i]); if (!itemTransmogrified) { - TC_LOG_DEBUG("network", "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) tried to transmogrify an invalid item in a valid slot (slot: %u).", player->GetGUIDLow(), player->GetName().c_str(), slots[i]); + TC_LOG_DEBUG("network", "WORLD: HandleTransmogrifyItems - Player (%s, name: %s) tried to transmogrify an invalid item in a valid slot (slot: %u).", player->GetGUID().ToString().c_str(), player->GetName().c_str(), slots[i]); return; } @@ -1466,7 +1466,7 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) ItemTemplate const* proto = sObjectMgr->GetItemTemplate(newEntries[i]); if (!proto) { - TC_LOG_DEBUG("network", "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) tried to transmogrify to an invalid item (entry: %u).", player->GetGUIDLow(), player->GetName().c_str(), newEntries[i]); + TC_LOG_DEBUG("network", "WORLD: HandleTransmogrifyItems - Player (%s, name: %s) tried to transmogrify to an invalid item (entry: %u).", player->GetGUID().ToString().c_str(), player->GetName().c_str(), newEntries[i]); return; } @@ -1474,21 +1474,21 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) itemTransmogrifier = player->GetItemByGuid(itemGuids[i]); if (!itemTransmogrifier) { - TC_LOG_DEBUG("network", "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) tried to transmogrify with an invalid item (%s).", player->GetGUIDLow(), player->GetName().c_str(), itemGuids[i].ToString().c_str()); + TC_LOG_DEBUG("network", "WORLD: HandleTransmogrifyItems - Player (%s, name: %s) tried to transmogrify with an invalid item (%s).", player->GetGUID().ToString().c_str(), player->GetName().c_str(), itemGuids[i].ToString().c_str()); return; } // entry of transmogrifier and from packet if (itemTransmogrifier->GetEntry() != newEntries[i]) { - TC_LOG_DEBUG("network", "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) tried to transmogrify with an invalid entry (entry: %u) for %s.", player->GetGUIDLow(), player->GetName().c_str(), newEntries[i], itemGuids[i].ToString().c_str()); + TC_LOG_DEBUG("network", "WORLD: HandleTransmogrifyItems - Player (%s, name: %s) tried to transmogrify with an invalid entry (entry: %u) for %s.", player->GetGUID().ToString().c_str(), player->GetName().c_str(), newEntries[i], itemGuids[i].ToString().c_str()); return; } // validity of the transmogrification items if (!Item::CanTransmogrifyItemWithItem(itemTransmogrified, itemTransmogrifier)) { - TC_LOG_DEBUG("network", "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) failed CanTransmogrifyItemWithItem (%u with %u).", player->GetGUIDLow(), player->GetName().c_str(), itemTransmogrified->GetEntry(), itemTransmogrifier->GetEntry()); + TC_LOG_DEBUG("network", "WORLD: HandleTransmogrifyItems - Player (%s, name: %s) failed CanTransmogrifyItemWithItem (%u with %u).", player->GetGUID().ToString().c_str(), player->GetName().c_str(), itemTransmogrified->GetEntry(), itemTransmogrifier->GetEntry()); return; } @@ -1585,7 +1585,7 @@ void WorldSession::HandleReforgeItemOpcode(WorldPacket& recvData) if (!item) { - TC_LOG_DEBUG("network", "WORLD: HandleReforgeItemOpcode - Player (Guid: %u Name: %s) tried to reforge an invalid/non-existant item.", player->GetGUIDLow(), player->GetName().c_str()); + TC_LOG_DEBUG("network", "WORLD: HandleReforgeItemOpcode - Player (%s Name: %s) tried to reforge an invalid/non-existant item.", player->GetGUID().ToString().c_str(), player->GetName().c_str()); SendReforgeResult(false); return; } @@ -1594,7 +1594,7 @@ void WorldSession::HandleReforgeItemOpcode(WorldPacket& recvData) { if (!item->GetEnchantmentId(REFORGE_ENCHANTMENT_SLOT)) { - TC_LOG_ERROR("network", "WORLD: HandleReforgeItemOpcode - Player (Guid: %u Name: %s) tried to remove reforge from non-reforged item (Entry: %u)", player->GetGUIDLow(), player->GetName().c_str(), item->GetEntry()); + TC_LOG_ERROR("network", "WORLD: HandleReforgeItemOpcode - Player (%s Name: %s) tried to remove reforge from non-reforged item (Entry: %u)", player->GetGUID().ToString().c_str(), player->GetName().c_str(), item->GetEntry()); SendReforgeResult(false); return; } @@ -1609,7 +1609,7 @@ void WorldSession::HandleReforgeItemOpcode(WorldPacket& recvData) if (item->GetEnchantmentId(REFORGE_ENCHANTMENT_SLOT)) { - TC_LOG_ERROR("network", "WORLD: HandleReforgeItemOpcode - Player (Guid: %u Name: %s) tried to reforge an already reforged item (Entry: %u)", player->GetGUIDLow(), player->GetName().c_str(), item->GetEntry()); + TC_LOG_ERROR("network", "WORLD: HandleReforgeItemOpcode - Player (%s Name: %s) tried to reforge an already reforged item (Entry: %u)", player->GetGUID().ToString().c_str(), player->GetName().c_str(), item->GetEntry()); SendReforgeResult(false); return; } @@ -1617,7 +1617,7 @@ void WorldSession::HandleReforgeItemOpcode(WorldPacket& recvData) ItemReforgeEntry const* stats = sItemReforgeStore.LookupEntry(reforgeEntry); if (!stats) { - TC_LOG_DEBUG("network", "WORLD: HandleReforgeItemOpcode - Player (Guid: %u Name: %s) tried to reforge an item with invalid reforge entry (%u).", player->GetGUIDLow(), player->GetName().c_str(), reforgeEntry); + TC_LOG_DEBUG("network", "WORLD: HandleReforgeItemOpcode - Player (%s Name: %s) tried to reforge an item with invalid reforge entry (%u).", player->GetGUID().ToString().c_str(), player->GetName().c_str(), reforgeEntry); SendReforgeResult(false); return; } diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 621704b1d0e..68cac2aa12d 100644 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -216,7 +216,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/) loot->gold = 0; // Delete the money loot record from the DB - if (loot->containerID > 0) + if (!loot->containerID.IsEmpty()) loot->DeleteLootMoneyFromContainerItemDB(); // Delete container if empty @@ -479,11 +479,8 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket& recvData) return; } - // list of players allowed to receive this item in trade - AllowedLooterSet looters = item.GetAllowedLooters(); - // now move item from loot to target inventory - Item* newitem = target->StoreNewItem(dest, item.itemid, true, item.randomPropertyId, looters); + Item* newitem = target->StoreNewItem(dest, item.itemid, true, item.randomPropertyId, item.GetAllowedLooters()); target->SendNewItem(newitem, uint32(item.count), false, false, true); target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item.itemid, item.count); target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, item.itemid, item.count, loot->loot_type); diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 35b62bd24c3..2fa3b253e6f 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -410,7 +410,7 @@ bool LootItem::AllowedForPlayer(Player const* player) const void LootItem::AddAllowedLooter(const Player* player) { - allowedGUIDs.insert(player->GetGUIDLow()); + allowedGUIDs.insert(player->GetGUID()); } // @@ -492,7 +492,7 @@ bool Loot::FillLoot(uint32 lootId, LootStore const& store, Player* lootOwner, bo void Loot::FillNotNormalLootFor(Player* player, bool presentAtLooting) { - uint32 plguid = player->GetGUIDLow(); + uint32 plguid = player->GetGUID().GetCounter(); QuestItemMap::const_iterator qmapitr = PlayerQuestItems.find(plguid); if (qmapitr == PlayerQuestItems.end()) @@ -547,7 +547,7 @@ QuestItemList* Loot::FillFFALoot(Player* player) return NULL; } - PlayerFFAItems[player->GetGUIDLow()] = ql; + PlayerFFAItems[player->GetGUID().GetCounter()] = ql; return ql; } @@ -585,7 +585,7 @@ QuestItemList* Loot::FillQuestLoot(Player* player) return NULL; } - PlayerQuestItems[player->GetGUIDLow()] = ql; + PlayerQuestItems[player->GetGUID().GetCounter()] = ql; return ql; } @@ -617,7 +617,7 @@ QuestItemList* Loot::FillNonQuestNonFFAConditionalLoot(Player* player, bool pres return NULL; } - PlayerNonQuestNonFFAConditionalItems[player->GetGUIDLow()] = ql; + PlayerNonQuestNonFFAConditionalItems[player->GetGUID().GetCounter()] = ql; return ql; } @@ -668,7 +668,7 @@ void Loot::NotifyQuestItemRemoved(uint8 questIndex) ++i_next; if (Player* player = ObjectAccessor::FindPlayer(*i)) { - QuestItemMap::const_iterator pq = PlayerQuestItems.find(player->GetGUIDLow()); + QuestItemMap::const_iterator pq = PlayerQuestItems.find(player->GetGUID().GetCounter()); if (pq != PlayerQuestItems.end() && pq->second) { // find where/if the player has the given item in it's vector @@ -705,7 +705,7 @@ void Loot::DeleteLootItemFromContainerItemDB(uint32 itemID) { // Deletes a single item associated with an openable item from the DB PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEM); - stmt->setUInt32(0, containerID); + stmt->setUInt32(0, containerID.GetCounter()); stmt->setUInt32(1, itemID); CharacterDatabase.Execute(stmt); @@ -724,7 +724,7 @@ void Loot::DeleteLootMoneyFromContainerItemDB() { // Deletes money loot associated with an openable item from the DB PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY); - stmt->setUInt32(0, containerID); + stmt->setUInt32(0, containerID.GetCounter()); CharacterDatabase.Execute(stmt); } @@ -735,7 +735,7 @@ LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem* *qite if (lootSlot >= items.size()) { uint32 questSlot = lootSlot - items.size(); - QuestItemMap::const_iterator itr = PlayerQuestItems.find(player->GetGUIDLow()); + QuestItemMap::const_iterator itr = PlayerQuestItems.find(player->GetGUID().GetCounter()); if (itr != PlayerQuestItems.end() && questSlot < itr->second->size()) { QuestItem* qitem2 = &itr->second->at(questSlot); @@ -751,7 +751,7 @@ LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem* *qite is_looted = item->is_looted; if (item->freeforall) { - QuestItemMap::const_iterator itr = PlayerFFAItems.find(player->GetGUIDLow()); + QuestItemMap::const_iterator itr = PlayerFFAItems.find(player->GetGUID().GetCounter()); if (itr != PlayerFFAItems.end()) { for (QuestItemList::const_iterator iter=itr->second->begin(); iter!= itr->second->end(); ++iter) @@ -767,7 +767,7 @@ LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem* *qite } else if (!item->conditions.empty()) { - QuestItemMap::const_iterator itr = PlayerNonQuestNonFFAConditionalItems.find(player->GetGUIDLow()); + QuestItemMap::const_iterator itr = PlayerNonQuestNonFFAConditionalItems.find(player->GetGUID().GetCounter()); if (itr != PlayerNonQuestNonFFAConditionalItems.end()) { for (QuestItemList::const_iterator iter=itr->second->begin(); iter!= itr->second->end(); ++iter) @@ -793,7 +793,7 @@ LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem* *qite uint32 Loot::GetMaxSlotInLootFor(Player* player) const { - QuestItemMap::const_iterator itr = PlayerQuestItems.find(player->GetGUIDLow()); + QuestItemMap::const_iterator itr = PlayerQuestItems.find(player->GetGUID().GetCounter()); return items.size() + (itr != PlayerQuestItems.end() ? itr->second->size() : 0); } @@ -801,7 +801,7 @@ uint32 Loot::GetMaxSlotInLootFor(Player* player) const bool Loot::hasItemFor(Player* player) const { QuestItemMap const& lootPlayerQuestItems = GetPlayerQuestItems(); - QuestItemMap::const_iterator q_itr = lootPlayerQuestItems.find(player->GetGUIDLow()); + QuestItemMap::const_iterator q_itr = lootPlayerQuestItems.find(player->GetGUID().GetCounter()); if (q_itr != lootPlayerQuestItems.end()) { QuestItemList* q_list = q_itr->second; @@ -814,7 +814,7 @@ bool Loot::hasItemFor(Player* player) const } QuestItemMap const& lootPlayerFFAItems = GetPlayerFFAItems(); - QuestItemMap::const_iterator ffa_itr = lootPlayerFFAItems.find(player->GetGUIDLow()); + QuestItemMap::const_iterator ffa_itr = lootPlayerFFAItems.find(player->GetGUID().GetCounter()); if (ffa_itr != lootPlayerFFAItems.end()) { QuestItemList* ffa_list = ffa_itr->second; @@ -827,7 +827,7 @@ bool Loot::hasItemFor(Player* player) const } QuestItemMap const& lootPlayerNonQuestNonFFAConditionalItems = GetPlayerNonQuestNonFFAConditionalItems(); - QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(player->GetGUIDLow()); + QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(player->GetGUID().GetCounter()); if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end()) { QuestItemList* conditional_list = nn_itr->second; @@ -979,7 +979,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) LootSlotType slotType = lv.permission == OWNER_PERMISSION ? LOOT_SLOT_TYPE_OWNER : LOOT_SLOT_TYPE_ALLOW_LOOT; QuestItemMap const& lootPlayerQuestItems = l.GetPlayerQuestItems(); - QuestItemMap::const_iterator q_itr = lootPlayerQuestItems.find(lv.viewer->GetGUIDLow()); + QuestItemMap::const_iterator q_itr = lootPlayerQuestItems.find(lv.viewer->GetGUID().GetCounter()); if (q_itr != lootPlayerQuestItems.end()) { QuestItemList* q_list = q_itr->second; @@ -1020,7 +1020,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) } QuestItemMap const& lootPlayerFFAItems = l.GetPlayerFFAItems(); - QuestItemMap::const_iterator ffa_itr = lootPlayerFFAItems.find(lv.viewer->GetGUIDLow()); + QuestItemMap::const_iterator ffa_itr = lootPlayerFFAItems.find(lv.viewer->GetGUID().GetCounter()); if (ffa_itr != lootPlayerFFAItems.end()) { QuestItemList* ffa_list = ffa_itr->second; @@ -1038,7 +1038,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) } QuestItemMap const& lootPlayerNonQuestNonFFAConditionalItems = l.GetPlayerNonQuestNonFFAConditionalItems(); - QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(lv.viewer->GetGUIDLow()); + QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(lv.viewer->GetGUID().GetCounter()); if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end()) { QuestItemList* conditional_list = nn_itr->second; diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h index 52632393ca1..fcfac13813a 100644 --- a/src/server/game/Loot/LootMgr.h +++ b/src/server/game/Loot/LootMgr.h @@ -146,15 +146,13 @@ struct LootStoreItem // Checks correctness of values }; -typedef std::set<uint32> AllowedLooterSet; - struct LootItem { uint32 itemid; uint32 randomSuffix; int32 randomPropertyId; ConditionList conditions; // additional loot condition - AllowedLooterSet allowedGUIDs; + GuidSet allowedGUIDs; uint8 count : 8; bool is_looted : 1; bool is_blocked : 1; @@ -177,7 +175,7 @@ struct LootItem // Basic checks for player/item compatibility - if false no chance to see the item in the loot bool AllowedForPlayer(Player const* player) const; void AddAllowedLooter(Player const* player); - const AllowedLooterSet & GetAllowedLooters() const { return allowedGUIDs; } + GuidSet const& GetAllowedLooters() const { return allowedGUIDs; } }; struct QuestItem @@ -324,11 +322,11 @@ struct Loot LootType loot_type; // required for achievement system uint8 maxDuplicates; // Max amount of items with the same entry that can drop (default is 1; on 25 man raid mode 3) - // GUIDLow of container that holds this loot (item_instance.entry) + // GUID of container that holds this loot (item_instance.entry) // Only set for inventory items that can be right-click looted - uint32 containerID; + ObjectGuid containerID; - Loot(uint32 _gold = 0) : gold(_gold), unlootedCount(0), roundRobinPlayer(), loot_type(LOOT_CORPSE), maxDuplicates(1), containerID(0) { } + Loot(uint32 _gold = 0) : gold(_gold), unlootedCount(0), roundRobinPlayer(), loot_type(LOOT_CORPSE), maxDuplicates(1) { } ~Loot() { clear(); } // For deleting items at loot removal since there is no backward interface to the Item() diff --git a/src/server/scripts/Northrend/isle_of_conquest.cpp b/src/server/scripts/Northrend/isle_of_conquest.cpp index 7d4c396f29e..6e325747f2c 100644 --- a/src/server/scripts/Northrend/isle_of_conquest.cpp +++ b/src/server/scripts/Northrend/isle_of_conquest.cpp @@ -219,13 +219,13 @@ class spell_ioc_parachute_ic : public SpellScriptLoader class StartLaunchEvent : public BasicEvent { public: - StartLaunchEvent(float x, float y, float z, uint32 lowGuid) : _x(x), _y(y), _z(z), _lowGuid(lowGuid) + StartLaunchEvent(float x, float y, float z, ObjectGuid const& guid) : _x(x), _y(y), _z(z), _guid(guid) { } bool Execute(uint64 /*time*/, uint32 /*diff*/) { - Player* player = sObjectMgr->GetPlayerByLowGUID(_lowGuid); + Player* player = ObjectAccessor::FindPlayer(_guid); if (!player || !player->GetVehicle()) return true; @@ -240,7 +240,7 @@ class StartLaunchEvent : public BasicEvent private: float _x, _y, _z; - uint32 _lowGuid; + ObjectGuid _guid; }; class spell_ioc_launch : public SpellScriptLoader @@ -261,7 +261,7 @@ class spell_ioc_launch : public SpellScriptLoader x = GetExplTargetDest()->GetPositionX(); y = GetExplTargetDest()->GetPositionY(); z = GetExplTargetDest()->GetPositionZ(); - GetCaster()->ToCreature()->m_Events.AddEvent(new StartLaunchEvent(x, y, z, GetHitPlayer()->GetGUIDLow()), GetCaster()->ToCreature()->m_Events.CalculateTime(2500)); + GetCaster()->ToCreature()->m_Events.AddEvent(new StartLaunchEvent(x, y, z, GetHitPlayer()->GetGUID()), GetCaster()->ToCreature()->m_Events.CalculateTime(2500)); } void Register() override |