diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp index 220b55ae7..1cc08ada4 100644 --- a/src/game/AchievementMgr.cpp +++ b/src/game/AchievementMgr.cpp @@ -104,7 +104,7 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri case ACHIEVEMENT_CRITERIA_REQUIRE_DISABLED: return true; case ACHIEVEMENT_CRITERIA_REQUIRE_T_CREATURE: - if (!creature.id || !objmgr.GetCreatureTemplate(creature.id)) + if (!creature.id || !ObjectMgr::GetCreatureTemplate(creature.id)) { sLog.outErrorDb( "Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_CREATURE (%u) have not existed creature id in value1 (%u), ignore.", criteria->ID, criteria->requiredType,requirementType,creature.id); @@ -1170,7 +1170,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; if(miscvalue2 != achievementCriteria->roll_greed_on_loot.rollValue) continue; - ItemPrototype const *pProto = objmgr.GetItemPrototype( miscvalue1 ); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype( miscvalue1 ); uint32 requiredItemLevel = 0; if (achievementCriteria->ID == 2412 || achievementCriteria->ID == 2358) @@ -2087,7 +2087,7 @@ void AchievementGlobalMgr::LoadRewards() //check mail data before item for report including wrong item case if (reward.sender) { - if (!objmgr.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; @@ -2107,7 +2107,7 @@ void AchievementGlobalMgr::LoadRewards() if (reward.itemId) { - if (!objmgr.GetItemPrototype(reward.itemId)) + if (!ObjectMgr::GetItemPrototype(reward.itemId)) { sLog.outErrorDb( "Table `achievement_reward` (Entry: %u) has invalid item id %u, reward mail will be without item.", entry, reward.itemId); reward.itemId = 0; diff --git a/src/game/ArenaTeamHandler.cpp b/src/game/ArenaTeamHandler.cpp index 0fdfdadfc..b30d5c937 100644 --- a/src/game/ArenaTeamHandler.cpp +++ b/src/game/ArenaTeamHandler.cpp @@ -88,7 +88,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data) if(!normalizePlayerName(Invitedname)) return; - player = ObjectAccessor::Instance().FindPlayerByName(Invitedname.c_str()); + player = ObjectAccessor::FindPlayerByName(Invitedname.c_str()); } if(!player) diff --git a/src/game/AuctionHouseHandler.cpp b/src/game/AuctionHouseHandler.cpp index 260b2931c..a0089c394 100644 --- a/src/game/AuctionHouseHandler.cpp +++ b/src/game/AuctionHouseHandler.cpp @@ -230,7 +230,7 @@ void WorldSession::HandleAuctionSellItem( WorldPacket & recv_data ) AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() ); //we have to take deposit : - uint32 deposit = auctionmgr.GetAuctionDeposit( auctionHouseEntry, etime, it ); + uint32 deposit = AuctionHouseMgr::GetAuctionDeposit( auctionHouseEntry, etime, it ); if ( pl->GetMoney() < deposit ) { SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_NOT_ENOUGHT_MONEY); diff --git a/src/game/AuctionHouseMgr.cpp b/src/game/AuctionHouseMgr.cpp index bcf9a8f5e..1d84ad4cc 100644 --- a/src/game/AuctionHouseMgr.cpp +++ b/src/game/AuctionHouseMgr.cpp @@ -304,7 +304,7 @@ void AuctionHouseMgr::LoadAuctionItems() uint32 item_guid = fields[1].GetUInt32(); uint32 item_template = fields[2].GetUInt32(); - ItemPrototype const *proto = objmgr.GetItemPrototype(item_template); + ItemPrototype const *proto = ObjectMgr::GetItemPrototype(item_template); if(!proto) { @@ -397,7 +397,7 @@ void AuctionHouseMgr::LoadAuctions() continue; } - CreatureInfo const* auctioneerInfo = objmgr.GetCreatureTemplate(auctioneerData->id); + CreatureInfo const* auctioneerInfo = ObjectMgr::GetCreatureTemplate(auctioneerData->id); if(!auctioneerInfo) { aItem->DeleteFromDB(); diff --git a/src/game/Bag.cpp b/src/game/Bag.cpp index 0feca6d14..7bbfd5d1f 100644 --- a/src/game/Bag.cpp +++ b/src/game/Bag.cpp @@ -60,7 +60,7 @@ void Bag::RemoveFromWorld() bool Bag::Create(uint32 guidlow, uint32 itemid, Player const* owner) { - ItemPrototype const * itemProto = objmgr.GetItemPrototype(itemid); + ItemPrototype const * itemProto = ObjectMgr::GetItemPrototype(itemid); if(!itemProto || itemProto->ContainerSlots > MAX_BAG_SIZE) return false; diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp index f6709b3d9..1480bc769 100644 --- a/src/game/BattleGround.cpp +++ b/src/game/BattleGround.cpp @@ -924,7 +924,7 @@ void BattleGround::SendRewardMarkByMail(Player *plr,uint32 mark, uint32 count) if (!bmEntry) return; - ItemPrototype const* markProto = objmgr.GetItemPrototype(mark); + ItemPrototype const* markProto = ObjectMgr::GetItemPrototype(mark); if (!markProto) return; diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index 2e738bd7f..781ef878e 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -1164,7 +1164,7 @@ valid examples: // read item entry reader.getline(buffer, 256, ':'); - linkedItem= objmgr.GetItemPrototype(atoi(buffer)); + linkedItem = ObjectMgr::GetItemPrototype(atoi(buffer)); if(!linkedItem) { #ifdef MANGOS_DEBUG diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 7ef4f89ae..09fbf236e 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -181,7 +181,7 @@ void Creature::RemoveCorpse() */ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data ) { - CreatureInfo const *normalInfo = objmgr.GetCreatureTemplate(Entry); + CreatureInfo const *normalInfo = ObjectMgr::GetCreatureTemplate(Entry); if(!normalInfo) { sLog.outErrorDb("Creature::UpdateEntry creature entry %u does not exist.", Entry); @@ -199,7 +199,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 = objmgr.GetCreatureTemplate(normalInfo->DifficultyEntry[diff]); + cinfo = ObjectMgr::GetCreatureTemplate(normalInfo->DifficultyEntry[diff]); if (!cinfo) { // maybe check such things already at startup @@ -1327,7 +1327,7 @@ float Creature::GetSpellDamageMod(int32 Rank) bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 team, const CreatureData *data) { - CreatureInfo const *cinfo = objmgr.GetCreatureTemplate(Entry); + CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(Entry); if(!cinfo) { sLog.outErrorDb("Creature entry %u does not exist.", Entry); @@ -2235,7 +2235,7 @@ uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem) if( vCount->lastIncrementTime + vItem->incrtime <= ptime ) { - ItemPrototype const* pProto = objmgr.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 ) @@ -2274,7 +2274,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us if( vCount->lastIncrementTime + vItem->incrtime <= ptime ) { - ItemPrototype const* pProto = objmgr.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/game/GameEventMgr.cpp b/src/game/GameEventMgr.cpp index 140aa7880..4f6627629 100644 --- a/src/game/GameEventMgr.cpp +++ b/src/game/GameEventMgr.cpp @@ -621,7 +621,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) { objmgr.RemoveGameobjectFromGrid(*itr, data); - if( GameObject* pGameobject = ObjectAccessor::Instance().GetGameObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_GAMEOBJECT)) ) + if( GameObject* pGameobject = ObjectAccessor::GetGameObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_GAMEOBJECT)) ) pGameobject->AddObjectToRemoveList(); } } @@ -688,7 +688,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate) CreatureData const* data2 = objmgr.GetCreatureData(itr->first); if (data2 && activate) { - CreatureInfo const *cinfo = objmgr.GetCreatureTemplate(data2->id); + CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(data2->id); uint32 display_id = objmgr.ChooseDisplayId(0,cinfo,data2); CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id); if (minfo) diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index b5fe2cf0a..92bd2af22 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -113,7 +113,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa return false; } - GameObjectInfo const* goinfo = objmgr.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/game/GossipDef.cpp b/src/game/GossipDef.cpp index 77e6ad05d..a046f0c12 100644 --- a/src/game/GossipDef.cpp +++ b/src/game/GossipDef.cpp @@ -470,7 +470,7 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID if ( !pQuest->RewChoiceItemId[i] ) continue; data << uint32(pQuest->RewChoiceItemId[i]); data << uint32(pQuest->RewChoiceItemCount[i]); - IProto = objmgr.GetItemPrototype(pQuest->RewChoiceItemId[i]); + IProto = ObjectMgr::GetItemPrototype(pQuest->RewChoiceItemId[i]); if ( IProto ) data << uint32(IProto->DisplayInfoID); else @@ -483,7 +483,7 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID if ( !pQuest->RewItemId[i] ) continue; data << uint32(pQuest->RewItemId[i]); data << uint32(pQuest->RewItemCount[i]); - IProto = objmgr.GetItemPrototype(pQuest->RewItemId[i]); + IProto = ObjectMgr::GetItemPrototype(pQuest->RewItemId[i]); if ( IProto ) data << uint32(IProto->DisplayInfoID); else @@ -687,7 +687,7 @@ void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID, data << uint32(pQuest->GetRewChoiceItemsCount()); for (uint32 i=0; i < pQuest->GetRewChoiceItemsCount(); ++i) { - pItem = objmgr.GetItemPrototype( pQuest->RewChoiceItemId[i] ); + pItem = ObjectMgr::GetItemPrototype( pQuest->RewChoiceItemId[i] ); data << uint32(pQuest->RewChoiceItemId[i]); data << uint32(pQuest->RewChoiceItemCount[i]); @@ -701,7 +701,7 @@ void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID, data << uint32(pQuest->GetRewItemsCount()); for (uint16 i=0; i < pQuest->GetRewItemsCount(); ++i) { - pItem = objmgr.GetItemPrototype(pQuest->RewItemId[i]); + pItem = ObjectMgr::GetItemPrototype(pQuest->RewItemId[i]); data << uint32(pQuest->RewItemId[i]); data << uint32(pQuest->RewItemCount[i]); @@ -781,7 +781,7 @@ void PlayerMenu::SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID { if ( !pQuest->ReqItemId[i] ) continue; - pItem = objmgr.GetItemPrototype(pQuest->ReqItemId[i]); + pItem = ObjectMgr::GetItemPrototype(pQuest->ReqItemId[i]); data << uint32(pQuest->ReqItemId[i]); data << uint32(pQuest->ReqItemCount[i]); diff --git a/src/game/Group.cpp b/src/game/Group.cpp index bf4d5d360..5750ac1c8 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -576,7 +576,7 @@ void Group::GroupLoot(const uint64& playerGUID, Loot *loot, Creature *creature) for (i = loot->items.begin(); i != loot->items.end(); ++i, ++itemSlot) { - item = objmgr.GetItemPrototype(i->itemid); + item = ObjectMgr::GetItemPrototype(i->itemid); if (!item) { //sLog.outDebug("Group::GroupLoot: missing item prototype for item with id: %d", i->itemid); @@ -630,7 +630,7 @@ void Group::NeedBeforeGreed(const uint64& playerGUID, Loot *loot, Creature *crea uint8 itemSlot = 0; for(std::vector::iterator i=loot->items.begin(); i != loot->items.end(); ++i, ++itemSlot) { - item = objmgr.GetItemPrototype(i->itemid); + item = ObjectMgr::GetItemPrototype(i->itemid); //only roll for one-player items, not for ones everyone can get if (item->Quality >= uint32(m_lootThreshold) && !i->freeforall) diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp index a2e527360..b7216fc29 100644 --- a/src/game/Guild.cpp +++ b/src/game/Guild.cpp @@ -1211,7 +1211,7 @@ void Guild::LoadGuildBankFromDB() continue; } - ItemPrototype const *proto = objmgr.GetItemPrototype(ItemEntry); + ItemPrototype const *proto = ObjectMgr::GetItemPrototype(ItemEntry); if (!proto) { diff --git a/src/game/GuildHandler.cpp b/src/game/GuildHandler.cpp index 723400ab9..4765a1e47 100644 --- a/src/game/GuildHandler.cpp +++ b/src/game/GuildHandler.cpp @@ -73,7 +73,7 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket) recvPacket >> Invitedname; if(normalizePlayerName(Invitedname)) - player = ObjectAccessor::Instance().FindPlayerByName(Invitedname.c_str()); + player = ObjectAccessor::FindPlayerByName(Invitedname.c_str()); if(!player) { diff --git a/src/game/InstanceSaveMgr.cpp b/src/game/InstanceSaveMgr.cpp index 2db0c49d4..bf2f9c233 100644 --- a/src/game/InstanceSaveMgr.cpp +++ b/src/game/InstanceSaveMgr.cpp @@ -196,7 +196,7 @@ time_t InstanceSave::GetResetTimeForDB() // to cache or not to cache, that is the question InstanceTemplate const* InstanceSave::GetTemplate() { - return objmgr.GetInstanceTemplate(m_mapid); + return ObjectMgr::GetInstanceTemplate(m_mapid); } MapEntry const* InstanceSave::GetMapEntry() @@ -431,7 +431,7 @@ void InstanceSaveManager::LoadResetTimes() { Field *fields = result->Fetch(); uint32 mapid = fields[0].GetUInt32(); - if(!objmgr.GetInstanceTemplate(mapid)) + if(!ObjectMgr::GetInstanceTemplate(mapid)) { sLog.outError("InstanceSaveManager::LoadResetTimes: invalid mapid %u in instance_reset!", mapid); CharacterDatabase.DirectPExecute("DELETE FROM instance_reset WHERE mapid = '%u'", mapid); @@ -457,7 +457,7 @@ void InstanceSaveManager::LoadResetTimes() // add the global reset times to the priority queue for(uint32 i = 0; i < sInstanceTemplate.MaxEntry; i++) { - InstanceTemplate const* temp = objmgr.GetInstanceTemplate(i); + InstanceTemplate const* temp = ObjectMgr::GetInstanceTemplate(i); if(!temp || temp->reset_delay == 0) continue; @@ -592,7 +592,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, bool warn, uint32 timeLe if(!warn) { // this is called one minute before the reset time - InstanceTemplate const* temp = objmgr.GetInstanceTemplate(mapid); + InstanceTemplate const* temp = ObjectMgr::GetInstanceTemplate(mapid); if(!temp || !temp->reset_delay) { sLog.outError("InstanceSaveManager::ResetOrWarnAll: no instance template or reset delay for map %d", mapid); diff --git a/src/game/Item.cpp b/src/game/Item.cpp index ba6381cb7..e5eaabea1 100644 --- a/src/game/Item.cpp +++ b/src/game/Item.cpp @@ -255,7 +255,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 = objmgr.GetItemPrototype(itemid); + ItemPrototype const *itemProto = ObjectMgr::GetItemPrototype(itemid); if(!itemProto) return false; @@ -441,7 +441,7 @@ void Item::DeleteFromInventoryDB() ItemPrototype const *Item::GetProto() const { - return objmgr.GetItemPrototype(GetEntry()); + return ObjectMgr::GetItemPrototype(GetEntry()); } Player* Item::GetOwner()const @@ -936,7 +936,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 = objmgr.GetItemPrototype( item ); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype( item ); if( pProto ) { if ( count > pProto->GetMaxStackSize()) diff --git a/src/game/ItemEnchantmentMgr.cpp b/src/game/ItemEnchantmentMgr.cpp index aa81d9189..66b98c0bf 100644 --- a/src/game/ItemEnchantmentMgr.cpp +++ b/src/game/ItemEnchantmentMgr.cpp @@ -124,7 +124,7 @@ uint32 GetItemEnchantMod(uint32 entry) uint32 GenerateEnchSuffixFactor(uint32 item_id) { - ItemPrototype const *itemProto = objmgr.GetItemPrototype(item_id); + ItemPrototype const *itemProto = ObjectMgr::GetItemPrototype(item_id); if(!itemProto) return 0; diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp index 3c1845fd4..ba80d0880 100644 --- a/src/game/ItemHandler.cpp +++ b/src/game/ItemHandler.cpp @@ -285,7 +285,7 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data ) sLog.outDetail("STORAGE: Item Query = %u", item); - ItemPrototype const *pProto = objmgr.GetItemPrototype( item ); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype( item ); if( pProto ) { std::string Name = pProto->Name1; @@ -739,7 +739,7 @@ void WorldSession::SendListInventory( uint64 vendorguid ) { if(VendorItem const* crItem = vItems->GetItem(i)) { - if(ItemPrototype const *pProto = objmgr.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; @@ -971,7 +971,7 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data) recv_data.read_skip(); // guid sLog.outDebug("WORLD: CMSG_ITEM_NAME_QUERY %u", itemid); - ItemPrototype const *pProto = objmgr.GetItemPrototype( itemid ); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype( itemid ); if( pProto ) { std::string Name; diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index cdd9508f7..9749bfc8d 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -483,7 +483,7 @@ bool ChatHandler::HandleGameObjectTargetCommand(const char* args) return false; } - GameObjectInfo const* goI = objmgr.GetGameObjectInfo(id); + GameObjectInfo const* goI = ObjectMgr::GetGameObjectInfo(id); if (!goI) { @@ -700,7 +700,7 @@ bool ChatHandler::HandleGameObjectAddCommand(const char* args) char* spawntimeSecs = strtok(NULL, " "); - const GameObjectInfo *gInfo = objmgr.GetGameObjectInfo(id); + const GameObjectInfo *gInfo = ObjectMgr::GetGameObjectInfo(id); if (!gInfo) { @@ -825,7 +825,7 @@ bool ChatHandler::HandleGameObjectNearCommand(const char* args) float z = fields[4].GetFloat(); int mapid = fields[5].GetUInt16(); - GameObjectInfo const * gInfo = objmgr.GetGameObjectInfo(entry); + GameObjectInfo const * gInfo = ObjectMgr::GetGameObjectInfo(entry); if(!gInfo) continue; @@ -1142,7 +1142,7 @@ bool ChatHandler::HandleNpcAddVendorItemCommand(const char* args) objmgr.AddVendorItem(vendor_entry,itemId,maxcount,incrtime,extendedcost); - ItemPrototype const* pProto = objmgr.GetItemPrototype(itemId); + ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(itemId); PSendSysMessage(LANG_ITEM_ADDED_TO_LIST,itemId,pProto->Name1,maxcount,incrtime,extendedcost); return true; @@ -1178,7 +1178,7 @@ bool ChatHandler::HandleNpcDelVendorItemCommand(const char* args) return false; } - ItemPrototype const* pProto = objmgr.GetItemPrototype(itemId); + ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(itemId); PSendSysMessage(LANG_ITEM_DELETED_FROM_LIST,itemId,pProto->Name1); return true; diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index c4d65f6bb..9c3761ae9 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -2098,7 +2098,7 @@ bool ChatHandler::HandleAddItemCommand(const char* args) sLog.outDetail(GetMangosString(LANG_ADDITEM), itemId, count); - ItemPrototype const *pProto = objmgr.GetItemPrototype(itemId); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemId); if(!pProto) { PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId); @@ -2237,7 +2237,7 @@ bool ChatHandler::HandleListItemCommand(const char* args) return false; } - ItemPrototype const* itemProto = objmgr.GetItemPrototype(item_id); + ItemPrototype const* itemProto = ObjectMgr::GetItemPrototype(item_id); if(!itemProto) { PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, item_id); @@ -2462,7 +2462,7 @@ bool ChatHandler::HandleListObjectCommand(const char* args) return false; } - GameObjectInfo const * gInfo = objmgr.GetGameObjectInfo(go_id); + GameObjectInfo const * gInfo = ObjectMgr::GetGameObjectInfo(go_id); if(!gInfo) { PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, go_id); @@ -2538,7 +2538,7 @@ bool ChatHandler::HandleListCreatureCommand(const char* args) return false; } - CreatureInfo const* cInfo = objmgr.GetCreatureTemplate(cr_id); + CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(cr_id); if(!cInfo) { PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, cr_id); @@ -3836,7 +3836,7 @@ bool ChatHandler::HandleNpcAddWeaponCommand(const char* /*args*/) uint32 ItemID = atoi(pItemID); uint32 SlotID = atoi(pSlotID); - ItemPrototype* tmpItem = objmgr.GetItemPrototype(ItemID); + ItemPrototype* tmpItem = ObjectMgr::GetItemPrototype(ItemID); bool added = false; if(tmpItem) @@ -4834,7 +4834,7 @@ bool ChatHandler::HandleQuestComplete(const char* args) } else if(creature > 0) { - if(CreatureInfo const* cInfo = objmgr.GetCreatureTemplate(creature)) + if(CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(creature)) for(uint16 z = 0; z < creaturecount; ++z) player->KilledMonster(cInfo,0); } @@ -6192,7 +6192,7 @@ bool ChatHandler::HandleSendItemsCommand(const char* args) if(!item_id) return false; - ItemPrototype const* item_proto = objmgr.GetItemPrototype(item_id); + ItemPrototype const* item_proto = ObjectMgr::GetItemPrototype(item_id); if(!item_proto) { PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, item_id); diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp index 504b55112..2efe2d619 100644 --- a/src/game/LootMgr.cpp +++ b/src/game/LootMgr.cpp @@ -245,7 +245,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 = objmgr.GetItemPrototype(itemid); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemid); float qualityModifier = pProto && rate ? sWorld.getRate(qualityToRate[pProto->Quality]) : 1.0f; @@ -269,7 +269,7 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const if( mincountOrRef > 0 ) // item (quest or non-quest) entry, maybe grouped { - ItemPrototype const *proto = objmgr.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); @@ -319,7 +319,7 @@ LootItem::LootItem(LootStoreItem const& li) itemid = li.itemid; conditionId = li.conditionId; - ItemPrototype const* proto = objmgr.GetItemPrototype(itemid); + ItemPrototype const* proto = ObjectMgr::GetItemPrototype(itemid); freeforall = proto && (proto->Flags & ITEM_FLAGS_PARTY_LOOT); needs_quest = li.needs_quest; @@ -349,7 +349,7 @@ bool LootItem::AllowedForPlayer(Player const * player) const else { // Not quest only drop (check quest starting items for already accepted non-repeatable quests) - ItemPrototype const *pProto = objmgr.GetItemPrototype(itemid); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemid); if (pProto && pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE && !player->HasQuestForItem(itemid)) return false; } @@ -378,7 +378,7 @@ void Loot::AddItem(LootStoreItem const & item) // non-ffa conditionals are counted in FillNonQuestNonFFAConditionalLoot() if( !item.conditionId ) { - ItemPrototype const* proto = objmgr.GetItemPrototype(item.itemid); + ItemPrototype const* proto = ObjectMgr::GetItemPrototype(item.itemid); if( !proto || (proto->Flags & ITEM_FLAGS_PARTY_LOOT)==0 ) ++unlootedCount; } @@ -676,7 +676,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootItem const& li) { b << uint32(li.itemid); b << uint32(li.count); // nr of items of this type - b << uint32(objmgr.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/game/Map.cpp b/src/game/Map.cpp index d6b21f7c0..0114f1ae2 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -223,7 +223,7 @@ Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode, Map* _par void Map::InitVisibilityDistance() { //init visibility for continents - m_VisibleDistance = sWorld.GetMaxVisibleDistanceOnContinents(); + m_VisibleDistance = World::GetMaxVisibleDistanceOnContinents(); } // Template specialization of utility methods @@ -2306,7 +2306,7 @@ InstanceMap::~InstanceMap() void InstanceMap::InitVisibilityDistance() { //init visibility distance for instances - m_VisibleDistance = sWorld.GetMaxVisibleDistanceInInstances(); + m_VisibleDistance = World::GetMaxVisibleDistanceInInstances(); } /* @@ -2473,7 +2473,7 @@ void InstanceMap::CreateInstanceData(bool load) if(i_data != NULL) return; - InstanceTemplate const* mInstance = objmgr.GetInstanceTemplate(GetId()); + InstanceTemplate const* mInstance = ObjectMgr::GetInstanceTemplate(GetId()); if (mInstance) { i_script_id = mInstance->script_id; @@ -2620,7 +2620,7 @@ void InstanceMap::SetResetSchedule(bool on) uint32 InstanceMap::GetMaxPlayers() const { - InstanceTemplate const* iTemplate = objmgr.GetInstanceTemplate(GetId()); + InstanceTemplate const* iTemplate = ObjectMgr::GetInstanceTemplate(GetId()); if(!iTemplate) return 0; return IsHeroic() ? iTemplate->maxPlayersHeroic : iTemplate->maxPlayers; @@ -2642,7 +2642,7 @@ BattleGroundMap::~BattleGroundMap() void BattleGroundMap::InitVisibilityDistance() { //init visibility distance for BG/Arenas - m_VisibleDistance = sWorld.GetMaxVisibleDistanceInBGArenas(); + m_VisibleDistance = World::GetMaxVisibleDistanceInBGArenas(); } bool BattleGroundMap::CanEnter(Player * player) diff --git a/src/game/MapInstanced.cpp b/src/game/MapInstanced.cpp index d59a0b3cc..2db10d3be 100644 --- a/src/game/MapInstanced.cpp +++ b/src/game/MapInstanced.cpp @@ -187,7 +187,7 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave *save, sLog.outError("CreateInstance: no entry for map %d", GetId()); assert(false); } - if (!objmgr.GetInstanceTemplate(GetId())) + if (!ObjectMgr::GetInstanceTemplate(GetId())) { sLog.outError("CreateInstance: no instance template for map %d", GetId()); assert(false); diff --git a/src/game/MapManager.cpp b/src/game/MapManager.cpp index 00924cad9..8059c59d4 100644 --- a/src/game/MapManager.cpp +++ b/src/game/MapManager.cpp @@ -205,7 +205,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player) if(instance_map==mapid) break; - InstanceTemplate const* instance = objmgr.GetInstanceTemplate(instance_map); + InstanceTemplate const* instance = ObjectMgr::GetInstanceTemplate(instance_map); instance_map = instance ? instance->parent : 0; } while (instance_map); @@ -292,7 +292,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() || objmgr.GetInstanceTemplate(mapid)); + return mEntry && (!mEntry->IsDungeon() || ObjectMgr::GetInstanceTemplate(mapid)); // TODO: add check for battleground template } diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 75b669654..6a63c6f4d 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -845,7 +845,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) { // TODO: all this is probably wrong if(missingItem) - SendAreaTriggerMessage(GetMangosString(LANG_LEVEL_MINREQUIRED_AND_ITEM), at->requiredLevel, objmgr.GetItemPrototype(missingItem)->Name1); + SendAreaTriggerMessage(GetMangosString(LANG_LEVEL_MINREQUIRED_AND_ITEM), at->requiredLevel, ObjectMgr::GetItemPrototype(missingItem)->Name1); else if(missingKey) GetPlayer()->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_DIFFICULTY, isNormalTargetMap ? DUNGEON_DIFFICULTY_NORMAL : DUNGEON_DIFFICULTY_HEROIC); else if(missingQuest) diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index 664c11d66..cca3c718c 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/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.mapid); - InstanceTemplate const* mInstance = objmgr.GetInstanceTemplate(loc.mapid); + InstanceTemplate const* mInstance = ObjectMgr::GetInstanceTemplate(loc.mapid); // reset instance validity, except if going to an instance inside an instance if(GetPlayer()->m_InstanceValid == false && !mInstance) diff --git a/src/game/NPCHandler.cpp b/src/game/NPCHandler.cpp index 33ba8538d..0d5aadf7f 100644 --- a/src/game/NPCHandler.cpp +++ b/src/game/NPCHandler.cpp @@ -633,7 +633,7 @@ void WorldSession::HandleUnstablePet( WorldPacket & recv_data ) return; } - CreatureInfo const* creatureInfo = objmgr.GetCreatureTemplate(creature_id); + CreatureInfo const* creatureInfo = ObjectMgr::GetCreatureTemplate(creature_id); if(!creatureInfo || !creatureInfo->isTameable(_player->CanTameExoticPets())) { WorldPacket data(SMSG_STABLE_RESULT, 1); @@ -760,7 +760,7 @@ void WorldSession::HandleStableSwapPet( WorldPacket & recv_data ) return; } - CreatureInfo const* creatureInfo = objmgr.GetCreatureTemplate(creature_id); + CreatureInfo const* creatureInfo = ObjectMgr::GetCreatureTemplate(creature_id); if(!creatureInfo || !creatureInfo->isTameable(_player->CanTameExoticPets())) { WorldPacket data(SMSG_STABLE_RESULT, 1); diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index cc1e07962..551e4b325 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -7279,7 +7279,7 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val } case CONDITION_ITEM: { - ItemPrototype const *proto = objmgr.GetItemPrototype(value1); + ItemPrototype const *proto = ObjectMgr::GetItemPrototype(value1); if(!proto) { sLog.outErrorDb("Item condition requires to have non existing item (%u), skipped", value1); @@ -7289,7 +7289,7 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val } case CONDITION_ITEM_EQUIPPED: { - ItemPrototype const *proto = objmgr.GetItemPrototype(value1); + ItemPrototype const *proto = ObjectMgr::GetItemPrototype(value1); if(!proto) { sLog.outErrorDb("ItemEquipped condition requires to have non existing item (%u) equipped, skipped", value1); diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index b888e39b8..1b34021c6 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -339,7 +339,7 @@ class ObjectMgr typedef std::vector ScriptNameMap; - Player* GetPlayer(const char* name) const { return ObjectAccessor::Instance().FindPlayerByName(name);} + Player* GetPlayer(const char* name) const { return ObjectAccessor::FindPlayerByName(name);} Player* GetPlayer(uint64 guid) const { return ObjectAccessor::FindPlayer(guid); } static GameObjectInfo const *GetGameObjectInfo(uint32 id) { return sGOStorage.LookupEntry(id); } diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index c8fa9cb0b..7c7a461da 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -138,7 +138,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool PetType pet_type = PetType(fields[18].GetUInt8()); if(pet_type==HUNTER_PET) { - CreatureInfo const* creatureInfo = objmgr.GetCreatureTemplate(petentry); + CreatureInfo const* creatureInfo = ObjectMgr::GetCreatureTemplate(petentry); if(!creatureInfo || !creatureInfo->isTameable(owner->CanTameExoticPets())) { delete result; diff --git a/src/game/PetitionsHandler.cpp b/src/game/PetitionsHandler.cpp index 4deaf34d6..2859af20a 100644 --- a/src/game/PetitionsHandler.cpp +++ b/src/game/PetitionsHandler.cpp @@ -170,7 +170,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) } } - ItemPrototype const *pProto = objmgr.GetItemPrototype(charterid); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(charterid); if(!pProto) { _player->SendBuyError(BUY_ERR_CANT_FIND_ITEM, NULL, charterid, 0); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index bdf6b53ce..6590cd1c2 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -678,7 +678,7 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8 if(item_id==40582) continue; - ItemPrototype const* iProto = objmgr.GetItemPrototype(item_id); + ItemPrototype const* iProto = ObjectMgr::GetItemPrototype(item_id); if(!iProto) { sLog.outErrorDb("Initial item id %u (race %u class %u) from CharStartOutfit.dbc not listed in `item_template`, ignoring.",item_id,getRace(),getClass()); @@ -1498,7 +1498,7 @@ bool Player::BuildEnumData( QueryResult * result, WorldPacket * p_data ) { uint32 visualbase = PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2); uint32 item_id = GetUInt32ValueFromArray(data, visualbase); - const ItemPrototype * proto = objmgr.GetItemPrototype(item_id); + const ItemPrototype * proto = ObjectMgr::GetItemPrototype(item_id); if(!proto) { *p_data << uint32(0); @@ -3963,7 +3963,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC uint32 item_guidlow = fields2[1].GetUInt32(); uint32 item_template = fields2[2].GetUInt32(); - ItemPrototype const* itemProto = objmgr.GetItemPrototype(item_template); + ItemPrototype const* itemProto = ObjectMgr::GetItemPrototype(item_template); if(!itemProto) { CharacterDatabase.PExecute("DELETE FROM item_instance WHERE guid = '%u'", item_guidlow); @@ -5575,7 +5575,7 @@ ActionButton* Player::addActionButton(uint8 button, uint32 action, uint8 type) } break; case ACTION_BUTTON_ITEM: - if(!objmgr.GetItemPrototype(action)) + if(!ObjectMgr::GetItemPrototype(action)) { sLog.outError( "Action %u not added into button %u for player %s: item not exist", action, button, GetName() ); return NULL; @@ -7278,7 +7278,7 @@ void Player::_ApplyAmmoBonuses() float currentAmmoDPS; - ItemPrototype const *ammo_proto = objmgr.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 @@ -8751,7 +8751,7 @@ bool Player::HasItemOrGemWithIdEquipped( uint32 item, uint32 count, uint8 except } } - ItemPrototype const *pProto = objmgr.GetItemPrototype(item); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(item); if (pProto && pProto->GemProperties) { for(int i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i) @@ -8808,7 +8808,7 @@ bool Player::HasItemOrGemWithLimitCategoryEquipped( uint32 limitCategory, uint32 uint8 Player::_CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count ) const { - ItemPrototype const *pProto = objmgr.GetItemPrototype(entry); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(entry); if( !pProto ) { if(no_space_count) @@ -9072,7 +9072,7 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3 { sLog.outDebug( "STORAGE: CanStoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, entry, count); - ItemPrototype const *pProto = objmgr.GetItemPrototype(entry); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(entry); if (!pProto) { if (no_space_count) @@ -10218,7 +10218,7 @@ uint8 Player::CanUseAmmo( uint32 item ) const return EQUIP_ERR_YOU_ARE_DEAD; //if( isStunned() ) // return EQUIP_ERR_YOU_ARE_STUNNED; - ItemPrototype const *pProto = objmgr.GetItemPrototype( item ); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype( item ); if( pProto ) { if( pProto->InventoryType!= INVTYPE_AMMO ) @@ -13728,7 +13728,7 @@ bool Player::HasQuestForItem( uint32 itemid ) const // examined item is a source item if (qinfo->ReqSourceId[j] == itemid) { - ItemPrototype const *pProto = objmgr.GetItemPrototype(itemid); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemid); // 'unique' item if (pProto->MaxCount && GetItemCount(itemid,true) < pProto->MaxCount) @@ -14227,7 +14227,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) if(currentBg && currentBg->IsPlayerInBattleGround(GetGUID())) { - BattleGroundQueueTypeId bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(currentBg->GetTypeID(), currentBg->GetArenaType()); + BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(currentBg->GetTypeID(), currentBg->GetArenaType()); AddBattleGroundQueueId(bgQueueTypeId); m_bgData.bgTypeID = currentBg->GetTypeID(); @@ -14849,7 +14849,7 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff) uint32 item_guid = fields[3].GetUInt32(); uint32 item_id = fields[4].GetUInt32(); - ItemPrototype const * proto = objmgr.GetItemPrototype(item_id); + ItemPrototype const * proto = ObjectMgr::GetItemPrototype(item_id); if(!proto) { @@ -14992,7 +14992,7 @@ void Player::_LoadMailedItems(Mail *mail) mail->AddItem(item_guid_low, item_template); - ItemPrototype const *proto = objmgr.GetItemPrototype(item_template); + ItemPrototype const *proto = ObjectMgr::GetItemPrototype(item_template); if(!proto) { @@ -17283,7 +17283,7 @@ bool Player::BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint if (!isAlive()) return false; - ItemPrototype const *pProto = objmgr.GetItemPrototype( item ); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype( item ); if (!pProto) { SendBuyError( BUY_ERR_CANT_FIND_ITEM, NULL, item, 0); @@ -19916,7 +19916,7 @@ uint8 Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limit_count) c if(!enchantEntry) continue; - ItemPrototype const* pGem = objmgr.GetItemPrototype(enchantEntry->GemID); + ItemPrototype const* pGem = ObjectMgr::GetItemPrototype(enchantEntry->GemID); if(!pGem) continue; diff --git a/src/game/PoolHandler.cpp b/src/game/PoolHandler.cpp index 44c6cabeb..64b42fa0d 100644 --- a/src/game/PoolHandler.cpp +++ b/src/game/PoolHandler.cpp @@ -495,7 +495,7 @@ void PoolHandler::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 = objmgr.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/game/QueryHandler.cpp b/src/game/QueryHandler.cpp index e7ae81462..bd48b94b2 100644 --- a/src/game/QueryHandler.cpp +++ b/src/game/QueryHandler.cpp @@ -153,7 +153,7 @@ void WorldSession::HandleCreatureQueryOpcode( WorldPacket & recv_data ) uint64 guid; recv_data >> guid; - CreatureInfo const *ci = objmgr.GetCreatureTemplate(entry); + CreatureInfo const *ci = ObjectMgr::GetCreatureTemplate(entry); if (ci) { @@ -219,7 +219,7 @@ void WorldSession::HandleGameObjectQueryOpcode( WorldPacket & recv_data ) uint64 guid; recv_data >> guid; - const GameObjectInfo *info = objmgr.GetGameObjectInfo(entryID); + const GameObjectInfo *info = ObjectMgr::GetGameObjectInfo(entryID); if(info) { std::string Name; diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 279816940..91243bc18 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -3192,7 +3192,7 @@ void Spell::WriteAmmoToPacket( WorldPacket * data ) uint32 ammoID = ((Player*)m_caster)->GetUInt32Value(PLAYER_AMMO_ID); if(ammoID) { - ItemPrototype const *pProto = objmgr.GetItemPrototype( ammoID ); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype( ammoID ); if(pProto) { ammoDisplayID = pProto->DisplayInfoID; @@ -5539,7 +5539,7 @@ SpellCastResult Spell::CheckItems() return SPELL_FAILED_NO_AMMO; } - ItemPrototype const *ammoProto = objmgr.GetItemPrototype( ammo ); + ItemPrototype const *ammoProto = ObjectMgr::GetItemPrototype( ammo ); if(!ammoProto) return SPELL_FAILED_NO_AMMO; diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 8af72353e..2fb4800a8 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2723,7 +2723,7 @@ void Aura::HandleAuraMounted(bool apply, bool Real) if(apply) { - CreatureInfo const* ci = objmgr.GetCreatureTemplate(m_modifier.m_miscvalue); + CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(m_modifier.m_miscvalue); if(!ci) { sLog.outErrorDb("AuraMounted: `creature_template`='%u' not found in database (only need it modelid)", m_modifier.m_miscvalue); @@ -3131,7 +3131,7 @@ void Aura::HandleAuraTransform(bool apply, bool Real) { uint32 model_id; - CreatureInfo const * ci = objmgr.GetCreatureTemplate(m_modifier.m_miscvalue); + CreatureInfo const * ci = ObjectMgr::GetCreatureTemplate(m_modifier.m_miscvalue); if (!ci) { model_id = 16358; // pig pink ^_^ @@ -3200,7 +3200,7 @@ void Aura::HandleAuraTransform(bool apply, bool Real) if (!m_target->GetAurasByType(SPELL_AURA_MOUNTED).empty()) { uint32 cr_id = m_target->GetAurasByType(SPELL_AURA_MOUNTED).front()->GetModifier()->m_miscvalue; - if (CreatureInfo const* ci = objmgr.GetCreatureTemplate(cr_id)) + if (CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(cr_id)) { uint32 team = 0; if (m_target->GetTypeId() == TYPEID_PLAYER) @@ -5905,7 +5905,7 @@ void Aura::HandleAuraEmpathy(bool apply, bool /*Real*/) if(m_target->GetTypeId() != TYPEID_UNIT) return; - CreatureInfo const * ci = objmgr.GetCreatureTemplate(m_target->GetEntry()); + CreatureInfo const * ci = ObjectMgr::GetCreatureTemplate(m_target->GetEntry()); if(ci && ci->type == CREATURE_TYPE_BEAST) m_target->ApplyModUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_SPECIALINFO, apply); } diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index c25d3946e..24ec8903a 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2713,7 +2713,7 @@ void Spell::DoCreateItem(uint32 i, uint32 itemtype) Player* player = (Player*)unitTarget; uint32 newitemid = itemtype; - ItemPrototype const *pProto = objmgr.GetItemPrototype( newitemid ); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype( newitemid ); if(!pProto) { player->SendEquipError( EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL ); @@ -6516,7 +6516,7 @@ void Spell::EffectTransmitted(uint32 effIndex) { uint32 name_id = m_spellInfo->EffectMiscValue[effIndex]; - GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(name_id); + GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(name_id); if (!goinfo) { diff --git a/src/game/Transports.cpp b/src/game/Transports.cpp index 43e854fd0..20170172e 100644 --- a/src/game/Transports.cpp +++ b/src/game/Transports.cpp @@ -57,7 +57,7 @@ void MapManager::LoadTransports() std::string name = fields[1].GetCppString(); t->m_period = fields[2].GetUInt32(); - const GameObjectInfo *goinfo = objmgr.GetGameObjectInfo(entry); + const GameObjectInfo *goinfo = ObjectMgr::GetGameObjectInfo(entry); if(!goinfo) { @@ -150,7 +150,7 @@ bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z, Object::_Create(guidlow, 0, HIGHGUID_MO_TRANSPORT); - GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(guidlow); + GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(guidlow); if (!goinfo) { diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index b475706f1..31cbad0af 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -464,7 +464,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa // some critters required for quests (need normal entry instead possible heroic in any cases) if(GetTypeId() == TYPEID_PLAYER) - if(CreatureInfo const* normalInfo = objmgr.GetCreatureTemplate(pVictim->GetEntry())) + if(CreatureInfo const* normalInfo = ObjectMgr::GetCreatureTemplate(pVictim->GetEntry())) ((Player*)this)->KilledMonster(normalInfo,pVictim->GetGUID()); return damage; diff --git a/src/game/debugcmds.cpp b/src/game/debugcmds.cpp index 75aa9c37f..d5a359a29 100644 --- a/src/game/debugcmds.cpp +++ b/src/game/debugcmds.cpp @@ -614,7 +614,7 @@ bool ChatHandler::HandleDebugSpawnVehicle(const char* args) uint32 entry = (uint32)atoi(e); uint32 id = (uint32)atoi(i); - CreatureInfo const *ci = objmgr.GetCreatureTemplate(entry); + CreatureInfo const *ci = ObjectMgr::GetCreatureTemplate(entry); if (!ci) return false;