@@ -11621,29 +11621,29 @@ void Player::RemoveAmmo()
1162111621}
1162211622
1162311623// Return stored item (if stored to stack, it can diff. from pItem). And pItem ca be deleted in this case.
11624- Item* Player::StoreNewItem(ItemPosCountVec const& dest , uint32 item , bool update, int32 randomPropertyId, GuidSet const& allowedLooters)
11624+ Item* Player::StoreNewItem(ItemPosCountVec const& pos , uint32 itemId , bool update, int32 randomPropertyId /*= 0*/ , GuidSet const& allowedLooters /*= GuidSet()*/ )
1162511625{
1162611626 uint32 count = 0;
11627- for (ItemPosCountVec::const_iterator itr = dest .begin(); itr != dest .end(); ++itr)
11627+ for (ItemPosCountVec::const_iterator itr = pos .begin(); itr != pos .end(); ++itr)
1162811628 count += itr->count;
1162911629
11630- Item* pItem = Item::CreateItem(item , count, this);
11631- if (pItem )
11630+ Item* item = Item::CreateItem(itemId , count, this);
11631+ if (item )
1163211632 {
1163311633 if (randomPropertyId)
11634- pItem ->SetItemRandomProperties(randomPropertyId);
11634+ item ->SetItemRandomProperties(randomPropertyId);
1163511635
11636- pItem = StoreItem(dest, pItem , update);
11636+ item = StoreItem(pos, item , update);
1163711637
11638- ItemAddedQuestCheck(item , count);
11639- UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item , count);
11640- UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, item , count);
11638+ ItemAddedQuestCheck(itemId , count);
11639+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, itemId , count);
11640+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, itemId , count);
1164111641
11642- if (allowedLooters.size() > 1 && pItem ->GetTemplate()->GetMaxStackSize() == 1 && pItem ->IsSoulBound())
11642+ if (allowedLooters.size() > 1 && item ->GetTemplate()->GetMaxStackSize() == 1 && item ->IsSoulBound())
1164311643 {
11644- pItem ->SetSoulboundTradeable(allowedLooters);
11645- pItem ->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, GetTotalPlayedTime());
11646- AddTradeableItem(pItem );
11644+ item ->SetSoulboundTradeable(allowedLooters);
11645+ item ->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, GetTotalPlayedTime());
11646+ AddTradeableItem(item );
1164711647
1164811648 // save data
1164911649 std::ostringstream ss;
@@ -11653,12 +11653,12 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update
1165311653 ss << ' ' << itr->GetCounter();
1165411654
1165511655 CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_BOP_TRADE);
11656- stmt->setUInt32(0, pItem ->GetGUID().GetCounter());
11656+ stmt->setUInt32(0, item ->GetGUID().GetCounter());
1165711657 stmt->setString(1, ss.str());
1165811658 CharacterDatabase.Execute(stmt);
1165911659 }
1166011660 }
11661- return pItem ;
11661+ return item ;
1166211662}
1166311663
1166411664Item* Player::StoreItem(ItemPosCountVec const& dest, Item* pItem, bool update)
@@ -18533,7 +18533,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
1853318533 }
1853418534 else
1853518535 {
18536- MapDifficulty const* mapDiff = GetMapDifficultyData(mapId, Difficulty(difficulty));
18536+ MapDifficultyEntry const* mapDiff = GetMapDifficultyData(mapId, Difficulty(difficulty));
1853718537 if (!mapDiff)
1853818538 {
1853918539 TC_LOG_ERROR("entities.player", "Player::_LoadBoundInstances: player '{}' ({}) has bind to not existed difficulty {} instance for map {} ({})",
@@ -18571,7 +18571,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
1857118571InstancePlayerBind* Player::GetBoundInstance(uint32 mapid, Difficulty difficulty, bool withExpired)
1857218572{
1857318573 // some instances only have one difficulty
18574- MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(mapid, difficulty);
18574+ MapDifficultyEntry const* mapDiff = GetDownscaledMapDifficultyData(mapid, difficulty);
1857518575 if (!mapDiff)
1857618576 return nullptr;
1857718577
@@ -18842,14 +18842,14 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report
1884218842 missingAchievement = ar->achievement;
1884318843
1884418844 Difficulty target_difficulty = group ? group->GetDifficultyID(mapEntry) : GetDifficultyID(mapEntry);
18845- MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(target_map, target_difficulty);
18845+ MapDifficultyEntry const* mapDiff = GetDownscaledMapDifficultyData(target_map, target_difficulty);
1884618846 if (LevelMin || LevelMax || missingItem || missingQuest || missingAchievement)
1884718847 {
1884818848 if (report)
1884918849 {
1885018850 if (missingQuest && !ar->questFailedText.empty())
1885118851 ChatHandler(GetSession()).PSendSysMessage("%s", ar->questFailedText.c_str());
18852- else if (mapDiff->hasErrorMessage ) // if (missingAchievement) covered by this case
18852+ else if (mapDiff->Message[sWorld->GetDefaultDbcLocale()][0] != '\0' ) // if (missingAchievement) covered by this case
1885318853 SendTransferAborted(target_map, TRANSFER_ABORT_DIFFICULTY, target_difficulty);
1885418854 else if (missingItem)
1885518855 GetSession()->SendAreaTriggerMessage(GetSession()->GetTrinityString(LANG_LEVEL_MINREQUIRED_AND_ITEM), LevelMin, ASSERT_NOTNULL(sObjectMgr->GetItemTemplate(missingItem))->GetName(GetSession()->GetSessionDbLocaleIndex()).c_str());
0 commit comments