diff options
Diffstat (limited to 'src')
43 files changed, 123 insertions, 128 deletions
diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 77ce13d3a11..9354d8397a6 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -111,7 +111,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) case ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT: return true; case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_CREATURE: - if (!creature.id || !sObjectMgr.GetCreatureTemplate(creature.id)) + if (!creature.id || !ObjectMgr::GetCreatureTemplate(creature.id)) { sLog.outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) has non-existing creature id in value1 (%u), ignored.", criteria->ID, criteria->requiredType,dataType,creature.id); @@ -366,7 +366,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un } case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM: { - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(miscvalue1); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(miscvalue1); if (!pProto) return false; return pProto->ItemLevel >= equipped_item.item_level && pProto->Quality >= equipped_item.item_quality; @@ -1261,7 +1261,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (miscvalue2 != achievementCriteria->roll_greed_on_loot.rollValue) continue; - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(miscvalue1); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(miscvalue1); if (!pProto) continue; @@ -2395,7 +2395,7 @@ void AchievementGlobalMgr::LoadRewards() //check mail data before item for report including wrong item case if (reward.sender) { - if (!sObjectMgr.GetCreatureTemplate(reward.sender)) + if (!ObjectMgr::GetCreatureTemplate(reward.sender)) { sLog.outErrorDb("Table `achievement_reward` (Entry: %u) has invalid creature entry %u as sender, mail reward skipped.", entry, reward.sender); reward.sender = 0; @@ -2415,7 +2415,7 @@ void AchievementGlobalMgr::LoadRewards() if (reward.itemId) { - if (!sObjectMgr.GetItemPrototype(reward.itemId)) + if (!ObjectMgr::GetItemPrototype(reward.itemId)) { sLog.outErrorDb("Table `achievement_reward` (Entry: %u) has invalid item id %u, reward mail will not contain item.", entry, reward.itemId); reward.itemId = 0; diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 8a9100ebb44..c9686a2a2e7 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -330,7 +330,7 @@ void AuctionHouseMgr::LoadAuctionItems() uint32 item_guid = fields[11].GetUInt32(); uint32 item_template = fields[12].GetUInt32(); - ItemPrototype const *proto = sObjectMgr.GetItemPrototype(item_template); + ItemPrototype const *proto = ObjectMgr::GetItemPrototype(item_template); if (!proto) { sLog.outError("AuctionHouseMgr::LoadAuctionItems: Unknown item (GUID: %u id: #%u) in auction, skipped.", item_guid,item_template); @@ -750,7 +750,7 @@ bool AuctionEntry::LoadFromDB(Field* fields) return false; } - CreatureInfo const* auctioneerInfo = sObjectMgr.GetCreatureTemplate(auctioneerData->id); + CreatureInfo const* auctioneerInfo = ObjectMgr::GetCreatureTemplate(auctioneerData->id); if (!auctioneerInfo) { sLog.outError("Auction %u has not a existing auctioneer (GUID : %u Entry: %u)", Id, auctioneer, auctioneerData->id); diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index e6ec24f8922..df69efda631 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1545,7 +1545,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f pCreature->SetHomePosition(x, y, z, o); - CreatureInfo const *cinfo = sObjectMgr.GetCreatureTemplate(entry); + CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(entry); if (!cinfo) { sLog.outErrorDb("Battleground::AddCreature: entry %u does not exist.", entry); diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index d6408dd0ab9..32002068453 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -1011,7 +1011,7 @@ valid examples: // read item entry reader.getline(buffer, 256, ':'); - linkedItem= sObjectMgr.GetItemPrototype(atoi(buffer)); + linkedItem= ObjectMgr::GetItemPrototype(atoi(buffer)); if (!linkedItem) { #ifdef TRINITY_DEBUG diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index 4124b54a7e8..fccca696d0f 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -762,7 +762,7 @@ bool ChatHandler::HandleCreatePetCommand(const char* /*args*/) return false; } - CreatureInfo const* cInfo = sObjectMgr.GetCreatureTemplate(creatureTarget->GetEntry()); + CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(creatureTarget->GetEntry()); // Creatures with family 0 crashes the server if (cInfo->family == 0) { diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index d765b9e2a17..b3e37fb7332 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -261,7 +261,7 @@ bool ChatHandler::HandleAddItemCommand(const char *args) sLog.outDetail(GetTrinityString(LANG_ADDITEM), itemId, count); - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(itemId); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemId); if (!pProto) { PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId); @@ -400,7 +400,7 @@ bool ChatHandler::HandleListItemCommand(const char *args) return false; } - ItemPrototype const* itemProto = sObjectMgr.GetItemPrototype(item_id); + ItemPrototype const* itemProto = ObjectMgr::GetItemPrototype(item_id); if (!itemProto) { PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, item_id); @@ -615,7 +615,7 @@ bool ChatHandler::HandleListObjectCommand(const char *args) return false; } - GameObjectInfo const * gInfo = sObjectMgr.GetGameObjectInfo(go_id); + GameObjectInfo const * gInfo = ObjectMgr::GetGameObjectInfo(go_id); if (!gInfo) { PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, go_id); @@ -687,7 +687,7 @@ bool ChatHandler::HandleListCreatureCommand(const char *args) return false; } - CreatureInfo const* cInfo = sObjectMgr.GetCreatureTemplate(cr_id); + CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(cr_id); if (!cInfo) { PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, cr_id); @@ -4262,7 +4262,7 @@ bool ChatHandler::HandleSendItemsCommand(const char *args) if (!item_id) return false; - ItemPrototype const* item_proto = sObjectMgr.GetItemPrototype(item_id); + ItemPrototype const* item_proto = ObjectMgr::GetItemPrototype(item_id); if (!item_proto) { PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, item_id); diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index d37c5226189..9f1e5b15952 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -932,7 +932,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) return false; } - ItemPrototype const *pItemProto = sObjectMgr.GetItemPrototype(cond->mSourceEntry); + ItemPrototype const *pItemProto = ObjectMgr::GetItemPrototype(cond->mSourceEntry); if (!pItemProto) { sLog.outErrorDb("SourceEntry %u in `condition` table, does not exist in `item_tamplate`, ignoring.", cond->mSourceEntry); @@ -1048,7 +1048,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) } case CONDITION_ITEM: { - ItemPrototype const *proto = sObjectMgr.GetItemPrototype(cond->mConditionValue1); + ItemPrototype const *proto = ObjectMgr::GetItemPrototype(cond->mConditionValue1); if (!proto) { sLog.outErrorDb("Item condition has non existing item (%u), skipped", cond->mConditionValue1); @@ -1064,7 +1064,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) } case CONDITION_ITEM_EQUIPPED: { - ItemPrototype const *proto = sObjectMgr.GetItemPrototype(cond->mConditionValue1); + ItemPrototype const *proto = ObjectMgr::GetItemPrototype(cond->mConditionValue1); if (!proto) { sLog.outErrorDb("ItemEquipped condition has non existing item (%u), skipped", cond->mConditionValue1); @@ -1331,7 +1331,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) } case CONDITION_NOITEM: { - ItemPrototype const *proto = sObjectMgr.GetItemPrototype(cond->mConditionValue1); + ItemPrototype const *proto = ObjectMgr::GetItemPrototype(cond->mConditionValue1); if (!proto) { sLog.outErrorDb("NoItem condition has non existing item (%u), skipped", cond->mConditionValue1); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 73899602157..0b730f85b27 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -257,7 +257,7 @@ void Creature::RemoveCorpse(bool setSpawnTime) */ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data) { - CreatureInfo const *normalInfo = sObjectMgr.GetCreatureTemplate(Entry); + CreatureInfo const *normalInfo = ObjectMgr::GetCreatureTemplate(Entry); if (!normalInfo) { sLog.outErrorDb("Creature::InitEntry creature entry %u does not exist.", Entry); @@ -275,7 +275,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data // we already have valid Map pointer for current creature! if (GetMap()->GetSpawnMode() > diff) { - cinfo = sObjectMgr.GetCreatureTemplate(normalInfo->DifficultyEntry[diff]); + cinfo = ObjectMgr::GetCreatureTemplate(normalInfo->DifficultyEntry[diff]); if (!cinfo) { // maybe check such things already at startup @@ -745,7 +745,7 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, SetMap(map); SetPhaseMask(phaseMask,false); - CreatureInfo const *cinfo = sObjectMgr.GetCreatureTemplate(Entry); + CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(Entry); if (!cinfo) { sLog.outErrorDb("Creature entry %u does not exist.", Entry); @@ -1248,7 +1248,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint3 return false; } - CreatureInfo const *cinfo = sObjectMgr.GetCreatureTemplate(Entry); + CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(Entry); if (!cinfo) { sLog.outErrorDb("Creature entry %u does not exist.", Entry); @@ -2303,7 +2303,7 @@ uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem) if (time_t(vCount->lastIncrementTime + vItem->incrtime) <= ptime) { - ItemPrototype const* pProto = sObjectMgr.GetItemPrototype(vItem->item); + ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(vItem->item); uint32 diff = uint32((ptime - vCount->lastIncrementTime)/vItem->incrtime); if ((vCount->count + diff * pProto->BuyCount) >= vItem->maxcount) @@ -2342,7 +2342,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us if (time_t(vCount->lastIncrementTime + vItem->incrtime) <= ptime) { - ItemPrototype const* pProto = sObjectMgr.GetItemPrototype(vItem->item); + ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(vItem->item); uint32 diff = uint32((ptime - vCount->lastIncrementTime)/vItem->incrtime); if ((vCount->count + diff * pProto->BuyCount) < vItem->maxcount) diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index 4e7ea5fa6fe..ad9bbd2ad86 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -470,7 +470,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, uint64 npcGUID, data << uint32(pQuest->RewChoiceItemId[i]); data << uint32(pQuest->RewChoiceItemCount[i]); - IProto = sObjectMgr.GetItemPrototype(pQuest->RewChoiceItemId[i]); + IProto = ObjectMgr::GetItemPrototype(pQuest->RewChoiceItemId[i]); if (IProto) data << uint32(IProto->DisplayInfoID); @@ -488,7 +488,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, uint64 npcGUID, data << uint32(pQuest->RewItemId[i]); data << uint32(pQuest->RewItemCount[i]); - IProto = sObjectMgr.GetItemPrototype(pQuest->RewItemId[i]); + IProto = ObjectMgr::GetItemPrototype(pQuest->RewItemId[i]); if (IProto) data << uint32(IProto->DisplayInfoID); @@ -716,7 +716,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID, data << uint32(pQuest->GetRewChoiceItemsCount()); for (uint32 i=0; i < pQuest->GetRewChoiceItemsCount(); ++i) { - pItem = sObjectMgr.GetItemPrototype(pQuest->RewChoiceItemId[i]); + pItem = ObjectMgr::GetItemPrototype(pQuest->RewChoiceItemId[i]); data << uint32(pQuest->RewChoiceItemId[i]); data << uint32(pQuest->RewChoiceItemCount[i]); @@ -730,7 +730,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID, data << uint32(pQuest->GetRewItemsCount()); for (uint32 i = 0; i < pQuest->GetRewItemsCount(); ++i) { - pItem = sObjectMgr.GetItemPrototype(pQuest->RewItemId[i]); + pItem = ObjectMgr::GetItemPrototype(pQuest->RewItemId[i]); data << uint32(pQuest->RewItemId[i]); data << uint32(pQuest->RewItemCount[i]); @@ -823,7 +823,7 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const *pQuest, uint64 npcGUID, if (!pQuest->ReqItemId[i]) continue; - pItem = sObjectMgr.GetItemPrototype(pQuest->ReqItemId[i]); + pItem = ObjectMgr::GetItemPrototype(pQuest->ReqItemId[i]); data << uint32(pQuest->ReqItemId[i]); data << uint32(pQuest->ReqItemCount[i]); diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 9526b6a09b3..6ef7474f224 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -175,7 +175,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa return false; } - GameObjectInfo const* goinfo = sObjectMgr.GetGameObjectInfo(name_id); + GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(name_id); if (!goinfo) { sLog.outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f) ang: %f rotation0: %f rotation1: %f rotation2: %f rotation3: %f",guidlow, name_id, map->GetId(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3); diff --git a/src/server/game/Entities/Item/Container/Bag.cpp b/src/server/game/Entities/Item/Container/Bag.cpp index ae04c0e4504..635f6294c9f 100755 --- a/src/server/game/Entities/Item/Container/Bag.cpp +++ b/src/server/game/Entities/Item/Container/Bag.cpp @@ -70,7 +70,7 @@ void Bag::RemoveFromWorld() bool Bag::Create(uint32 guidlow, uint32 itemid, Player const* owner) { - ItemPrototype const * itemProto = sObjectMgr.GetItemPrototype(itemid); + ItemPrototype const * itemProto = ObjectMgr::GetItemPrototype(itemid); if (!itemProto || itemProto->ContainerSlots > MAX_BAG_SIZE) return false; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 9ca1d84f63c..3123e93ce68 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -265,7 +265,7 @@ bool Item::Create(uint32 guidlow, uint32 itemid, Player const* owner) SetUInt64Value(ITEM_FIELD_OWNER, owner ? owner->GetGUID() : 0); SetUInt64Value(ITEM_FIELD_CONTAINED, owner ? owner->GetGUID() : 0); - ItemPrototype const *itemProto = sObjectMgr.GetItemPrototype(itemid); + ItemPrototype const *itemProto = ObjectMgr::GetItemPrototype(itemid); if (!itemProto) return false; @@ -467,7 +467,7 @@ void Item::DeleteFromInventoryDB(SQLTransaction& trans) ItemPrototype const *Item::GetProto() const { - return sObjectMgr.GetItemPrototype(GetEntry()); + return ObjectMgr::GetItemPrototype(GetEntry()); } Player* Item::GetOwner()const @@ -1006,7 +1006,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player) if (count < 1) return NULL; //don't create item at zero count - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(item); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(item); if (pProto) { if (count > pProto->GetMaxStackSize()) diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp index 7e17f048a15..fb815e63f8a 100755 --- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp +++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp @@ -120,7 +120,7 @@ uint32 GetItemEnchantMod(int32 entry) uint32 GenerateEnchSuffixFactor(uint32 item_id) { - ItemPrototype const *itemProto = sObjectMgr.GetItemPrototype(item_id); + ItemPrototype const *itemProto = ObjectMgr::GetItemPrototype(item_id); if (!itemProto) return 0; diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 76c48050e13..e08e28b0b41 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2271,7 +2271,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float if (!IsInWorld()) return NULL; - GameObjectInfo const* goinfo = sObjectMgr.GetGameObjectInfo(entry); + GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(entry); if (!goinfo) { sLog.outErrorDb("Gameobject template %u not found in database!", entry); diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 99ff22a59bb..ae235c3e8d3 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -154,7 +154,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c PetType pet_type = PetType(fields[18].GetUInt8()); if (pet_type == HUNTER_PET) { - CreatureInfo const* creatureInfo = sObjectMgr.GetCreatureTemplate(petentry); + CreatureInfo const* creatureInfo = ObjectMgr::GetCreatureTemplate(petentry); if (!creatureInfo || !creatureInfo->isTameable(owner->CanTameExoticPets())) return false; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b3f9b351ad7..d58ed174ac1 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -869,7 +869,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c uint32 item_id = oEntry->ItemId[j]; // just skip, reported in ObjectMgr::LoadItemPrototypes - ItemPrototype const* iProto = sObjectMgr.GetItemPrototype(item_id); + ItemPrototype const* iProto = ObjectMgr::GetItemPrototype(item_id); if (!iProto) continue; @@ -1692,7 +1692,7 @@ bool Player::BuildEnumData(QueryResult result, WorldPacket * p_data) { uint32 visualbase = slot * 2; uint32 item_id = GetUInt32ValueFromArray(data, visualbase); - const ItemPrototype * proto = sObjectMgr.GetItemPrototype(item_id); + const ItemPrototype * proto = ObjectMgr::GetItemPrototype(item_id); if (!proto) { *p_data << uint32(0); @@ -4547,7 +4547,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC uint32 item_guidlow = fields[11].GetUInt32(); uint32 item_template = fields[12].GetUInt32(); - ItemPrototype const* itemProto = sObjectMgr.GetItemPrototype(item_template); + ItemPrototype const* itemProto = ObjectMgr::GetItemPrototype(item_template); if (!itemProto) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE); @@ -6364,7 +6364,7 @@ bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type) } break; case ACTION_BUTTON_ITEM: - if (!sObjectMgr.GetItemPrototype(action)) + if (!ObjectMgr::GetItemPrototype(action)) { sLog.outError( "Item action %u not added into button %u for player %s: item not exist", action, button, GetName() ); return false; @@ -6678,7 +6678,7 @@ void Player::RewardReputation(Unit *pVictim, float rate) Map const *pMap = GetMap(); if (pMap && pMap->IsDungeon()) { - InstanceTemplate const *pInstance = sObjectMgr.GetInstanceTemplate(pMap->GetId()); + InstanceTemplate const *pInstance = ObjectMgr::GetInstanceTemplate(pMap->GetId()); if (pInstance) { AccessRequirement const *pAccessRequirement = sObjectMgr.GetAccessRequirement(pMap->GetId(), ((InstanceMap*)pMap)->GetDifficulty()); @@ -8245,7 +8245,7 @@ void Player::_ApplyAmmoBonuses() float currentAmmoDPS; - ItemPrototype const *ammo_proto = sObjectMgr.GetItemPrototype(ammo_id); + ItemPrototype const *ammo_proto = ObjectMgr::GetItemPrototype(ammo_id); if (!ammo_proto || ammo_proto->Class != ITEM_CLASS_PROJECTILE || !CheckAmmoCompatibility(ammo_proto)) currentAmmoDPS = 0.0f; else @@ -9966,7 +9966,7 @@ bool Player::HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_ } } - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(item); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(item); if (pProto && pProto->GemProperties) { for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i) @@ -10023,7 +10023,7 @@ bool Player::HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 uint8 Player::_CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count) const { - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(entry); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(entry); if (!pProto) { if (no_space_count) @@ -10304,7 +10304,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 { sLog.outDebug("STORAGE: CanStoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, entry, count); - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(entry); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(entry); if (!pProto) { if (no_space_count) @@ -11479,7 +11479,7 @@ uint8 Player::CanUseAmmo(uint32 item) const return EQUIP_ERR_YOU_ARE_DEAD; //if (isStunned()) // return EQUIP_ERR_YOU_ARE_STUNNED; - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(item); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(item); if (pProto) { if (pProto->InventoryType!= INVTYPE_AMMO) @@ -12917,7 +12917,7 @@ void Player::SendEquipError(uint8 msg, Item* pItem, Item *pItem2, uint32 itemid) case EQUIP_ERR_CANT_EQUIP_LEVEL_I: case EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW: { - ItemPrototype const* proto = pItem ? pItem->GetProto() : sObjectMgr.GetItemPrototype(itemid); + ItemPrototype const* proto = pItem ? pItem->GetProto() : ObjectMgr::GetItemPrototype(itemid); data << uint32(proto ? proto->RequiredLevel : 0); break; } @@ -12932,7 +12932,7 @@ void Player::SendEquipError(uint8 msg, Item* pItem, Item *pItem2, uint32 itemid) case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED: case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED: { - ItemPrototype const* proto = pItem ? pItem->GetProto() : sObjectMgr.GetItemPrototype(itemid); + ItemPrototype const* proto = pItem ? pItem->GetProto() : ObjectMgr::GetItemPrototype(itemid); data << uint32(proto ? proto->ItemLimitCategory : 0); break; } @@ -15510,7 +15510,7 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id) reqTarget = qInfo->ReqCreatureOrGOId[j]; if (reqTarget != entry) // if entry doesn't match, check for killcredits referenced in template { - CreatureInfo const *cinfo = sObjectMgr.GetCreatureTemplate(entry); + CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(entry); for (uint8 i = 0; i < MAX_KILL_CREDIT; ++i) if (cinfo->KillCredit[i] == reqTarget) entry = cinfo->KillCredit[i]; @@ -15732,7 +15732,7 @@ bool Player::HasQuestForItem(uint32 itemid) const // examined item is a source item if (qinfo->ReqSourceId[j] == itemid) { - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(itemid); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemid); // 'unique' item if (pProto->MaxCount && int32(GetItemCount(itemid, true)) < pProto->MaxCount) @@ -16928,7 +16928,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timediff) uint32 item_guid = fields[13].GetUInt32(); uint32 item_id = fields[14].GetUInt32(); - ItemPrototype const * proto = sObjectMgr.GetItemPrototype(item_id); + ItemPrototype const * proto = ObjectMgr::GetItemPrototype(item_id); if (!proto) { @@ -17149,7 +17149,7 @@ void Player::_LoadMailedItems(Mail *mail) mail->AddItem(item_guid_low, item_template); - ItemPrototype const *proto = sObjectMgr.GetItemPrototype(item_template); + ItemPrototype const *proto = ObjectMgr::GetItemPrototype(item_template); if (!proto) { @@ -17778,7 +17778,7 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report else if (mapDiff->hasErrorMessage) // if (missingAchievement) covered by this case SendTransferAborted(target_map, TRANSFER_ABORT_DIFFICULTY, target_difficulty); else if (missingItem) - GetSession()->SendAreaTriggerMessage(GetSession()->GetTrinityString(LANG_LEVEL_MINREQUIRED_AND_ITEM), LevelMin, sObjectMgr.GetItemPrototype(missingItem)->Name1); + GetSession()->SendAreaTriggerMessage(GetSession()->GetTrinityString(LANG_LEVEL_MINREQUIRED_AND_ITEM), LevelMin, ObjectMgr::GetItemPrototype(missingItem)->Name1); else if (LevelMin) GetSession()->SendAreaTriggerMessage(GetSession()->GetTrinityString(LANG_LEVEL_MINREQUIRED), LevelMin); } @@ -19922,7 +19922,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 if (!isAlive()) return false; - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(item); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(item); if (!pProto) { SendBuyError(BUY_ERR_CANT_FIND_ITEM, NULL, item, 0); @@ -23090,7 +23090,7 @@ uint8 Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limit_count) c if (!enchantEntry) continue; - ItemPrototype const* pGem = sObjectMgr.GetItemPrototype(enchantEntry->GemID); + ItemPrototype const* pGem = ObjectMgr::GetItemPrototype(enchantEntry->GemID); if (!pGem) continue; diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 12b1f452e91..1e055d9da2f 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -54,7 +54,7 @@ void MapManager::LoadTransports() Transport *t = new Transport(period, scriptId); - const GameObjectInfo *goinfo = sObjectMgr.GetGameObjectInfo(entry); + const GameObjectInfo *goinfo = ObjectMgr::GetGameObjectInfo(entry); if (!goinfo) { @@ -203,7 +203,7 @@ bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, floa Object::_Create(guidlow, 0, HIGHGUID_MO_TRANSPORT); - GameObjectInfo const* goinfo = sObjectMgr.GetGameObjectInfo(entry); + GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(entry); if (!goinfo) { diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index bf786ba8620..88799c8f2dd 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -14892,7 +14892,7 @@ Pet* Unit::CreateTamedPetFrom(uint32 creatureEntry, uint32 spell_id) if (GetTypeId() != TYPEID_PLAYER) return NULL; - CreatureInfo const* creatureInfo = sObjectMgr.GetCreatureTemplate(creatureEntry); + CreatureInfo const* creatureInfo = ObjectMgr::GetCreatureTemplate(creatureEntry); if (!creatureInfo) return NULL; diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index fd6b4281ab9..6a7c8ecbbb2 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -1373,7 +1373,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate) CreatureData const* data2 = sObjectMgr.GetCreatureData(itr->first); if (data2 && activate) { - CreatureInfo const *cinfo = sObjectMgr.GetCreatureTemplate(data2->id); + CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(data2->id); uint32 display_id = sObjectMgr.ChooseDisplayId(0,cinfo,data2); CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id); if (minfo) diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 0ef35674270..dc6c733b692 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -414,11 +414,6 @@ void ObjectMgr::RemoveArenaTeam(uint32 Id) mArenaTeamMap.erase(Id); } -CreatureInfo const* ObjectMgr::GetCreatureTemplate(uint32 id) -{ - return sCreatureStorage.LookupEntry<CreatureInfo>(id); -} - void ObjectMgr::AddLocaleString(std::string& s, LocaleConstant locale, StringVector& data) { if (!s.empty()) @@ -2462,7 +2457,7 @@ void ObjectMgr::LoadItemPrototypes() uint32 item_id = entry->ItemId[j]; - if (!GetItemPrototype(item_id)) + if (!ObjectMgr::GetItemPrototype(item_id)) notFoundOutfit.insert(item_id); } } @@ -2570,7 +2565,7 @@ void ObjectMgr::LoadItemSetNames() { uint32 entry = *itr; // add data from item_template if available - pProto = GetItemPrototype(entry); + pProto = ObjectMgr::GetItemPrototype(entry); if (pProto) { sLog.outErrorDb("Item set part (Entry: %u) does not have entry in `item_set_names`, adding data from `item_template`.", entry); @@ -2951,7 +2946,7 @@ void ObjectMgr::LoadPlayerInfo() uint32 item_id = fields[2].GetUInt32(); - if (!GetItemPrototype(item_id)) + if (!ObjectMgr::GetItemPrototype(item_id)) { sLog.outErrorDb("Item id %u (race %u class %u) in `playercreateinfo_item` table but not listed in `item_template`, ignoring.",item_id,current_race,current_class); continue; @@ -5004,7 +4999,7 @@ void ObjectMgr::LoadScripts(ScriptsType type) case SCRIPT_COMMAND_CREATE_ITEM: { - if (!GetItemPrototype(tmp.CreateItem.ItemEntry)) + if (!ObjectMgr::GetItemPrototype(tmp.CreateItem.ItemEntry)) { sLog.outErrorDb("Table `%s` has nonexistent item (entry: %u) in SCRIPT_COMMAND_CREATE_ITEM for script id %u", tableName.c_str(), tmp.CreateItem.ItemEntry, tmp.id); @@ -5401,7 +5396,7 @@ void ObjectMgr::LoadInstanceTemplate() for (uint32 i = 0; i < sInstanceTemplate.MaxEntry; i++) { - InstanceTemplate* temp = const_cast<InstanceTemplate*>(GetInstanceTemplate(i)); + InstanceTemplate* temp = const_cast<InstanceTemplate*>(ObjectMgr::GetInstanceTemplate(i)); if (!temp) continue; @@ -6266,7 +6261,7 @@ void ObjectMgr::LoadAccessRequirements() if (ar.item) { - ItemPrototype const *pProto = GetItemPrototype(ar.item); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(ar.item); if (!pProto) { sLog.outError("Key item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item, mapid, difficulty); @@ -6276,7 +6271,7 @@ void ObjectMgr::LoadAccessRequirements() if (ar.item2) { - ItemPrototype const *pProto = GetItemPrototype(ar.item2); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(ar.item2); if (!pProto) { sLog.outError("Second item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item2, mapid, difficulty); @@ -6331,7 +6326,7 @@ AreaTrigger const* ObjectMgr::GetGoBackTrigger(uint32 Map) const if (mapEntry->IsDungeon()) { - const InstanceTemplate *iTemplate = sObjectMgr.GetInstanceTemplate(Map); + const InstanceTemplate *iTemplate = ObjectMgr::GetInstanceTemplate(Map); if (!iTemplate) return NULL; @@ -8762,7 +8757,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max return false; } - if (!GetItemPrototype(item_id)) + if (!ObjectMgr::GetItemPrototype(item_id)) { if (pl) ChatHandler(pl).PSendSysMessage(LANG_ITEM_NOT_FOUND, item_id); @@ -8959,12 +8954,12 @@ ObjectMgr::ScriptNameMap & GetScriptNames() GameObjectInfo const *GetGameObjectInfo(uint32 id) { - return sObjectMgr.GetGameObjectInfo(id); + return ObjectMgr::GetGameObjectInfo(id); } CreatureInfo const *GetCreatureInfo(uint32 id) { - return sObjectMgr.GetCreatureTemplate(id); + return ObjectMgr::GetCreatureTemplate(id); } CreatureInfo const* GetCreatureTemplateStore(uint32 entry) @@ -9122,9 +9117,9 @@ void ObjectMgr::LoadFactionChangeItems() uint32 alliance = fields[0].GetUInt32(); uint32 horde = fields[1].GetUInt32(); - if (!GetItemPrototype(alliance)) + if (!ObjectMgr::GetItemPrototype(alliance)) sLog.outErrorDb("Item %u referenced in `player_factionchange_items` does not exist, pair skipped!", alliance); - else if (!GetItemPrototype(horde)) + else if (!ObjectMgr::GetItemPrototype(horde)) sLog.outErrorDb("Item %u referenced in `player_factionchange_items` does not exist, pair skipped!", horde); else factionchange_items[alliance] = horde; diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 25497e71f43..66440abf841 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -624,7 +624,7 @@ class ObjectMgr ArenaTeamMap::iterator GetArenaTeamMapBegin() { return mArenaTeamMap.begin(); } ArenaTeamMap::iterator GetArenaTeamMapEnd() { return mArenaTeamMap.end(); } - static CreatureInfo const *GetCreatureTemplate(uint32 id); + static CreatureInfo const *GetCreatureTemplate(uint32 id) { return sCreatureStorage.LookupEntry<CreatureInfo>(id); } CreatureModelInfo const *GetCreatureModelInfo(uint32 modelid); CreatureModelInfo const* GetCreatureModelRandomGender(uint32 display_id); uint32 ChooseDisplayId(uint32 team, const CreatureInfo *cinfo, const CreatureData *data = NULL); diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 2641e9d6149..b2386479921 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -633,7 +633,7 @@ void Group::GroupLoot(Loot *loot, WorldObject* pLootedObject) if (i->freeforall) continue; - item = sObjectMgr.GetItemPrototype(i->itemid); + item = ObjectMgr::GetItemPrototype(i->itemid); if (!item) { //sLog.outDebug("Group::GroupLoot: missing item prototype for item with id: %d", i->itemid); @@ -726,7 +726,7 @@ void Group::NeedBeforeGreed(Loot *loot, WorldObject* pLootedObject) if (i->freeforall) continue; - item = sObjectMgr.GetItemPrototype(i->itemid); + item = ObjectMgr::GetItemPrototype(i->itemid); //roll for over-threshold item if it's one-player loot if (item->Quality >= uint32(m_lootThreshold)) diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 0b8afcc8e43..75bbe55347b 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -338,7 +338,7 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields) return false; } - ItemPrototype const* proto = sObjectMgr.GetItemPrototype(itemEntry); + ItemPrototype const* proto = ObjectMgr::GetItemPrototype(itemEntry); if (!proto) { sLog.outError("Unknown item (GUID: %u, id: %u) in guild bank, skipped.", itemGuid, itemEntry); diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index 36ccb363bb5..fe3b139e29b 100755 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -194,7 +194,7 @@ time_t InstanceSave::GetResetTimeForDB() // to cache or not to cache, that is the question InstanceTemplate const* InstanceSave::GetTemplate() { - return sObjectMgr.GetInstanceTemplate(m_mapid); + return ObjectMgr::GetInstanceTemplate(m_mapid); } MapEntry const* InstanceSave::GetMapEntry() diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 68eeb5ee624..abb569ea58f 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -248,7 +248,7 @@ bool LootStoreItem::Roll(bool rate) const if (mincountOrRef < 0) // reference case return roll_chance_f(chance* (rate ? sWorld.getRate(RATE_DROP_ITEM_REFERENCED) : 1.0f)); - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(itemid); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemid); float qualityModifier = pProto && rate ? sWorld.getRate(qualityToRate[pProto->Quality]) : 1.0f; @@ -272,7 +272,7 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const if (mincountOrRef > 0) // item (quest or non-quest) entry, maybe grouped { - ItemPrototype const *proto = sObjectMgr.GetItemPrototype(itemid); + ItemPrototype const *proto = ObjectMgr::GetItemPrototype(itemid); if (!proto) { sLog.outErrorDb("Table '%s' entry %d item %d: item entry not listed in `item_template` - skipped", store.GetName(), entry, itemid); @@ -322,7 +322,7 @@ LootItem::LootItem(LootStoreItem const& li) itemid = li.itemid; conditions = li.conditions; - ItemPrototype const* proto = sObjectMgr.GetItemPrototype(itemid); + ItemPrototype const* proto = ObjectMgr::GetItemPrototype(itemid); freeforall = proto && (proto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT); needs_quest = li.needs_quest; @@ -400,7 +400,7 @@ void Loot::AddItem(LootStoreItem const & item) // non-ffa conditionals are counted in FillNonQuestNonFFAConditionalLoot() if (item.conditions.empty()) { - ItemPrototype const* proto = sObjectMgr.GetItemPrototype(item.itemid); + ItemPrototype const* proto = ObjectMgr::GetItemPrototype(item.itemid); if (!proto || (proto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT) == 0) ++unlootedCount; } @@ -789,7 +789,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootItem const& li) { b << uint32(li.itemid); b << uint32(li.count); // nr of items of this type - b << uint32(sObjectMgr.GetItemPrototype(li.itemid)->DisplayInfoID); + b << uint32(ObjectMgr::GetItemPrototype(li.itemid)->DisplayInfoID); b << uint32(li.randomSuffix); b << uint32(li.randomPropertyId); //b << uint8(0); // slot type - will send after this function call diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 0ca4afd2277..b6367996320 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2402,7 +2402,7 @@ void InstanceMap::CreateInstanceData(bool load) if (i_data != NULL) return; - InstanceTemplate const* mInstance = sObjectMgr.GetInstanceTemplate(GetId()); + InstanceTemplate const* mInstance = ObjectMgr::GetInstanceTemplate(GetId()); if (mInstance) { i_script_id = mInstance->script_id; diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index 217448f2953..f097a1fd7ae 100755 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -179,7 +179,7 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave *save, sLog.outError("CreateInstance: no entry for map %d", GetId()); ASSERT(false); } - const InstanceTemplate * iTemplate = sObjectMgr.GetInstanceTemplate(GetId()); + const InstanceTemplate * iTemplate = ObjectMgr::GetInstanceTemplate(GetId()); if (!iTemplate) { sLog.outError("CreateInstance: no instance template for map %d", GetId()); diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index 2eca66f82d0..9462667daf2 100755 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -163,7 +163,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) if (!entry->IsDungeon()) return true; - InstanceTemplate const* instance = sObjectMgr.GetInstanceTemplate(mapid); + InstanceTemplate const* instance = ObjectMgr::GetInstanceTemplate(mapid); if (!instance) return false; @@ -213,7 +213,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) if (instance_map == mapid) break; - InstanceTemplate const* instance = sObjectMgr.GetInstanceTemplate(instance_map); + InstanceTemplate const* instance = ObjectMgr::GetInstanceTemplate(instance_map); instance_map = instance ? instance->parent : 0; } while (instance_map); @@ -299,7 +299,7 @@ bool MapManager::ExistMapAndVMap(uint32 mapid, float x,float y) bool MapManager::IsValidMAP(uint32 mapid) { MapEntry const* mEntry = sMapStore.LookupEntry(mapid); - return mEntry && (!mEntry->IsDungeon() || sObjectMgr.GetInstanceTemplate(mapid)); + return mEntry && (!mEntry->IsDungeon() || ObjectMgr::GetItemPrototype(mapid)); // TODO: add check for battleground template } diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp index 06d3e37f7c2..ad38adc0259 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp @@ -120,7 +120,7 @@ bool OPvPCapturePoint::SetCapturePointData(uint32 entry, uint32 map, float x, fl sLog.outDebug("Creating capture point %u", entry); // check info existence - GameObjectInfo const* goinfo = sObjectMgr.GetGameObjectInfo(entry); + GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(entry); if (!goinfo || goinfo->type != GAMEOBJECT_TYPE_CAPTURE_POINT) { sLog.outError("OutdoorPvP: GO %u is not capture point!", entry); diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index 603127e0852..334c1c9b33d 100755 --- a/src/server/game/Pools/PoolMgr.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -680,7 +680,7 @@ void PoolMgr::LoadFromDB() sLog.outErrorDb("`pool_gameobject` has a non existing gameobject spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id); continue; } - GameObjectInfo const* goinfo = sObjectMgr.GetGameObjectInfo(data->id); + GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(data->id); if (goinfo->type != GAMEOBJECT_TYPE_CHEST && goinfo->type != GAMEOBJECT_TYPE_GOOBER && goinfo->type != GAMEOBJECT_TYPE_FISHINGHOLE) diff --git a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp index b179ce5152e..8e0a2e11896 100755 --- a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp @@ -285,7 +285,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data) sLog.outDetail("STORAGE: Item Query = %u", item); - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(item); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(item); if (pProto) { std::string Name = pProto->Name1; @@ -758,7 +758,7 @@ void WorldSession::SendListInventory(uint64 vendorguid) { if (VendorItem const* crItem = vItems->GetItem(vendorslot)) { - if (ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(crItem->item)) + if (ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(crItem->item)) { if ((pProto->AllowableClass & _player->getClassMask()) == 0 && pProto->Bonding == BIND_WHEN_PICKED_UP && !_player->isGameMaster()) continue; diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp index 695fc3ea5bf..a2b6add0146 100755 --- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp @@ -56,7 +56,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() // get the destination map entry, not the current one, this will fix homebind and reset greeting MapEntry const* mEntry = sMapStore.LookupEntry(loc.GetMapId()); - InstanceTemplate const* mInstance = sObjectMgr.GetInstanceTemplate(loc.GetMapId()); + InstanceTemplate const* mInstance = ObjectMgr::GetInstanceTemplate(loc.GetMapId()); // reset instance validity, except if going to an instance inside an instance if (GetPlayer()->m_InstanceValid == false && !mInstance) diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp index c36745ffdf7..7adc5fced69 100755 --- a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp @@ -697,7 +697,7 @@ void WorldSession::HandleUnstablePetCallback(QueryResult result, uint32 petnumbe return; } - CreatureInfo const* creatureInfo = sObjectMgr.GetCreatureTemplate(creature_id); + CreatureInfo const* creatureInfo = ObjectMgr::GetCreatureTemplate(creature_id); if (!creatureInfo || !creatureInfo->isTameable(_player->CanTameExoticPets())) { // if problem in exotic pet @@ -825,7 +825,7 @@ void WorldSession::HandleStableSwapPetCallback(QueryResult result, uint32 petnum return; } - CreatureInfo const* creatureInfo = sObjectMgr.GetCreatureTemplate(creature_id); + CreatureInfo const* creatureInfo = ObjectMgr::GetCreatureTemplate(creature_id); if (!creatureInfo || !creatureInfo->isTameable(_player->CanTameExoticPets())) { // if problem in exotic pet diff --git a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp index 5385f35aa9c..a76fa218165 100755 --- a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp @@ -179,7 +179,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) } } - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(charterid); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(charterid); if (!pProto) { _player->SendBuyError(BUY_ERR_CANT_FIND_ITEM, NULL, charterid, 0); diff --git a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp index 3dfe02a18a7..df85f197d4c 100755 --- a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp @@ -155,7 +155,7 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data) uint64 guid; recv_data >> guid; - CreatureInfo const *ci = sObjectMgr.GetCreatureTemplate(entry); + CreatureInfo const *ci = ObjectMgr::GetCreatureTemplate(entry); if (ci) { @@ -218,7 +218,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recv_data) uint64 guid; recv_data >> guid; - const GameObjectInfo *info = sObjectMgr.GetGameObjectInfo(entryID); + const GameObjectInfo *info = ObjectMgr::GetGameObjectInfo(entryID); if (info) { std::string Name; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 65be8aafffd..d373c17e2ec 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -3260,7 +3260,7 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode, } else { - CreatureInfo const * ci = sObjectMgr.GetCreatureTemplate(GetMiscValue()); + CreatureInfo const * ci = ObjectMgr::GetCreatureTemplate(GetMiscValue()); if (!ci) { target->SetDisplayId(16358); // pig pink ^_^ @@ -3334,7 +3334,7 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode, if (!target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).empty()) { uint32 cr_id = target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).front()->GetMiscValue(); - if (CreatureInfo const* ci = sObjectMgr.GetCreatureTemplate(cr_id)) + if (CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(cr_id)) { uint32 team = 0; if (target->GetTypeId() == TYPEID_PLAYER) @@ -3778,7 +3778,7 @@ void AuraEffect::HandleAuraMounted(AuraApplication const * aurApp, uint8 mode, b creatureEntry = 15665; } - CreatureInfo const* ci = sObjectMgr.GetCreatureTemplate(creatureEntry); + CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(creatureEntry); if (!ci) { sLog.outErrorDb("AuraMounted: `creature_template`='%u' not found in database (only need its modelid)",GetMiscValue()); @@ -6092,7 +6092,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo else creatureEntry = target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).front()->GetMiscValue(); - if (CreatureInfo const* creatureInfo = sObjectMgr.GetCreatureTemplate(creatureEntry)) + if (CreatureInfo const* creatureInfo = ObjectMgr::GetCreatureTemplate(creatureEntry)) { uint32 team = 0; if (target->GetTypeId() == TYPEID_PLAYER) @@ -6332,7 +6332,7 @@ void AuraEffect::HandleAuraEmpathy(AuraApplication const * aurApp, uint8 mode, b return; } - CreatureInfo const * ci = sObjectMgr.GetCreatureTemplate(target->GetEntry()); + CreatureInfo const * ci = ObjectMgr::GetCreatureTemplate(target->GetEntry()); if (ci && ci->type == CREATURE_TYPE_BEAST) target->ApplyModUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_SPECIALINFO, apply); } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 5bafca4c376..48e6f071a40 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3885,7 +3885,7 @@ void Spell::SendCastResult(Player* caster, SpellEntry const* spellInfo, uint8 ca for (int8 x=0;x < 3;x++) if (spellInfo->EffectItemType[x]) item = spellInfo->EffectItemType[x]; - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(item); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(item); if (pProto && pProto->ItemLimitCategory) data << uint32(pProto->ItemLimitCategory); break; @@ -4065,7 +4065,7 @@ void Spell::WriteAmmoToPacket(WorldPacket * data) uint32 ammoID = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID); if (ammoID) { - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(ammoID); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(ammoID); if (pProto) { ammoDisplayID = pProto->DisplayInfoID; @@ -5570,7 +5570,7 @@ SpellCastResult Spell::CheckCast(bool strict) // Ignore map check if spell have AreaId. AreaId already checked and this prevent special mount spells bool AllowMount = !m_caster->GetMap()->IsDungeon() || m_caster->GetMap()->IsBattlegroundOrArena(); - InstanceTemplate const *it = sObjectMgr.GetInstanceTemplate(m_caster->GetMapId()); + InstanceTemplate const *it = ObjectMgr::GetInstanceTemplate(m_caster->GetMapId()); if (it) AllowMount = it->allowMount; if (m_caster->GetTypeId() == TYPEID_PLAYER && !AllowMount && !m_IsTriggeredSpell && !m_spellInfo->AreaGroupId) @@ -6140,7 +6140,7 @@ SpellCastResult Spell::CheckItems() uint8 msg = p_caster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, m_spellInfo->EffectItemType[i], 1); if (msg != EQUIP_ERR_OK) { - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(m_spellInfo->EffectItemType[i]); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(m_spellInfo->EffectItemType[i]); // TODO: Needs review if (pProto && !(pProto->ItemLimitCategory)) { @@ -6344,7 +6344,7 @@ SpellCastResult Spell::CheckItems() return SPELL_FAILED_NO_AMMO; } - ItemPrototype const *ammoProto = sObjectMgr.GetItemPrototype(ammo); + ItemPrototype const *ammoProto = ObjectMgr::GetItemPrototype(ammo); if (!ammoProto) return SPELL_FAILED_NO_AMMO; @@ -6383,7 +6383,7 @@ SpellCastResult Spell::CheckItems() case SPELL_EFFECT_CREATE_MANA_GEM: { uint32 item_id = m_spellInfo->EffectItemType[i]; - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(item_id); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(item_id); if (!pProto) return SPELL_FAILED_ITEM_AT_MAX_CHARGES; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index d2e079e9ef1..97def26e5c9 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2321,7 +2321,7 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype) Player* player = (Player*)unitTarget; uint32 newitemid = itemtype; - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(newitemid); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(newitemid); if (!pProto) { player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); @@ -6295,7 +6295,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex) { uint32 name_id = m_spellInfo->EffectMiscValue[effIndex]; - GameObjectInfo const* goinfo = sObjectMgr.GetGameObjectInfo(name_id); + GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(name_id); if (!goinfo) { @@ -7035,7 +7035,7 @@ void Spell::EffectRechargeManaGem(SpellEffIndex /*effIndex*/) uint32 item_id = m_spellInfo->EffectItemType[0]; - ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(item_id); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(item_id); if (!pProto) { player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index bbeaf5bbbc8..cc041f08ced 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -851,7 +851,7 @@ public: uint32 id = (uint32)atoi(i); - CreatureInfo const *ci = sObjectMgr.GetCreatureTemplate(entry); + CreatureInfo const *ci = ObjectMgr::GetCreatureTemplate(entry); if (!ci) return false; diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index b5c5ff0c1a3..866deba41e3 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -121,7 +121,7 @@ public: char* spawntimeSecs = strtok(NULL, " "); - const GameObjectInfo *gInfo = sObjectMgr.GetGameObjectInfo(id); + const GameObjectInfo *gInfo = ObjectMgr::GetGameObjectInfo(id); if (!gInfo) { @@ -304,7 +304,7 @@ public: return false; } - GameObjectInfo const* goI = sObjectMgr.GetGameObjectInfo(id); + GameObjectInfo const* goI = ObjectMgr::GetGameObjectInfo(id); if (!goI) { @@ -557,7 +557,7 @@ public: float z = fields[4].GetFloat(); uint16 mapid = fields[5].GetUInt16(); - GameObjectInfo const * gInfo = sObjectMgr.GetGameObjectInfo(entry); + GameObjectInfo const * gInfo = ObjectMgr::GetGameObjectInfo(entry); if (!gInfo) continue; @@ -589,7 +589,7 @@ public: entry = atoi((char*)args); } - GameObjectInfo const* goinfo = sObjectMgr.GetGameObjectInfo(entry); + GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(entry); if (!goinfo) return false; diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index c4f85adce2a..dff80798a99 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -201,7 +201,7 @@ public: sObjectMgr.AddVendorItem(vendor_entry,itemId,maxcount,incrtime,extendedcost); - ItemPrototype const* pProto = sObjectMgr.GetItemPrototype(itemId); + ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(itemId); handler->PSendSysMessage(LANG_ITEM_ADDED_TO_LIST,itemId,pProto->Name1,maxcount,incrtime,extendedcost); return true; @@ -419,7 +419,7 @@ public: return false; } - ItemPrototype const* pProto = sObjectMgr.GetItemPrototype(itemId); + ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(itemId); handler->PSendSysMessage(LANG_ITEM_DELETED_FROM_LIST,itemId,pProto->Name1); return true; @@ -1302,7 +1302,7 @@ public: uint32 ItemID = atoi(pItemID); uint32 SlotID = atoi(pSlotID); - ItemPrototype* tmpItem = sObjectMgr.GetItemPrototype(ItemID); + ItemPrototype* tmpItem = ObjectMgr::GetItemPrototype(ItemID); bool added = false; if (tmpItem) diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index 9cff431ef3e..62984862ff9 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -212,7 +212,7 @@ public: } else if (creature > 0) { - if (CreatureInfo const* cInfo = sObjectMgr.GetCreatureTemplate(creature)) + if (CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(creature)) for (uint16 z = 0; z < creaturecount; ++z) player->KilledMonster(cInfo,0); } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index e0ea676e764..e3a341fa0ec 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -66,7 +66,7 @@ public: { if (targetCreature->isPet()) { - CreatureInfo const * ci = sObjectMgr.GetCreatureTemplate(targetCreature->GetEntry()); + CreatureInfo const * ci = ObjectMgr::GetCreatureTemplate(targetCreature->GetEntry()); switch (ci->family) { case CREATURE_FAMILY_SUCCUBUS: |
