aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp107
1 files changed, 0 insertions, 107 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 6e932aeeb8f..18dbc889c7a 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -6214,105 +6214,6 @@ InstanceTemplate const* ObjectMgr::GetInstanceTemplate(uint32 mapID) const
return nullptr;
}
-void ObjectMgr::LoadInstanceEncounters()
-{
- uint32 oldMSTime = getMSTime();
-
- // 0 1 2 3
- QueryResult result = WorldDatabase.Query("SELECT entry, creditType, creditEntry, lastEncounterDungeon FROM instance_encounters");
- if (!result)
- {
- TC_LOG_INFO("server.loading", ">> Loaded 0 instance encounters, table is empty!");
- return;
- }
-
- uint32 count = 0;
- std::map<uint32, std::pair<uint32, DungeonEncounterEntry const*>> dungeonLastBosses;
- do
- {
- Field* fields = result->Fetch();
- uint32 entry = fields[0].GetUInt32();
- uint8 creditType = fields[1].GetUInt8();
- uint32 creditEntry = fields[2].GetUInt32();
- uint32 lastEncounterDungeon = fields[3].GetUInt16();
- DungeonEncounterEntry const* dungeonEncounter = sDungeonEncounterStore.LookupEntry(entry);
- if (!dungeonEncounter)
- {
- TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid encounter id {}, skipped!", entry);
- continue;
- }
-
- if (lastEncounterDungeon && !sLFGMgr->GetLFGDungeonEntry(lastEncounterDungeon))
- {
- TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an encounter {} ({}) marked as final for invalid dungeon id {}, skipped!",
- entry, dungeonEncounter->Name[sWorld->GetDefaultDbcLocale()], lastEncounterDungeon);
- continue;
- }
-
- auto itr = dungeonLastBosses.find(lastEncounterDungeon);
- if (lastEncounterDungeon)
- {
- if (itr != dungeonLastBosses.end())
- {
- TC_LOG_ERROR("sql.sql", "Table `instance_encounters` specified encounter {} ({}) as last encounter but {} ({}) is already marked as one, skipped!",
- entry, dungeonEncounter->Name[sWorld->GetDefaultDbcLocale()], itr->second.first, itr->second.second->Name[sWorld->GetDefaultDbcLocale()]);
- continue;
- }
-
- dungeonLastBosses[lastEncounterDungeon] = std::make_pair(entry, dungeonEncounter);
- }
-
- switch (creditType)
- {
- case ENCOUNTER_CREDIT_KILL_CREATURE:
- {
- CreatureTemplate const* creatureInfo = GetCreatureTemplate(creditEntry);
- if (!creatureInfo)
- {
- TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid creature (entry {}) linked to the encounter {} ({}), skipped!",
- creditEntry, entry, dungeonEncounter->Name[sWorld->GetDefaultDbcLocale()]);
- continue;
- }
- const_cast<CreatureTemplate*>(creatureInfo)->flags_extra |= CREATURE_FLAG_EXTRA_DUNGEON_BOSS;
- break;
- }
- case ENCOUNTER_CREDIT_CAST_SPELL:
- if (!sSpellMgr->GetSpellInfo(creditEntry, DIFFICULTY_NONE))
- {
- TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid spell (entry {}) linked to the encounter {} ({}), skipped!",
- creditEntry, entry, dungeonEncounter->Name[sWorld->GetDefaultDbcLocale()]);
- continue;
- }
- break;
- default:
- TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid credit type ({}) for encounter {} ({}), skipped!",
- creditType, entry, dungeonEncounter->Name[sWorld->GetDefaultDbcLocale()]);
- continue;
- }
-
- if (!dungeonEncounter->DifficultyID)
- {
- for (DifficultyEntry const* difficulty : sDifficultyStore)
- {
- if (sDB2Manager.GetMapDifficultyData(dungeonEncounter->MapID, Difficulty(difficulty->ID)))
- {
- DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR64(dungeonEncounter->MapID, difficulty->ID)];
- encounters.emplace_back(dungeonEncounter, EncounterCreditType(creditType), creditEntry, lastEncounterDungeon);
- }
- }
- }
- else
- {
- DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR64(dungeonEncounter->MapID, dungeonEncounter->DifficultyID)];
- encounters.emplace_back(dungeonEncounter, EncounterCreditType(creditType), creditEntry, lastEncounterDungeon);
- }
-
- ++count;
- } while (result->NextRow());
-
- TC_LOG_INFO("server.loading", ">> Loaded {} instance encounters in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
-}
-
NpcText const* ObjectMgr::GetNpcText(uint32 Text_ID) const
{
NpcTextContainer::const_iterator itr = _npcTextStore.find(Text_ID);
@@ -10568,14 +10469,6 @@ VehicleAccessoryList const* ObjectMgr::GetVehicleAccessoryList(Vehicle* veh) con
return nullptr;
}
-DungeonEncounterList const* ObjectMgr::GetDungeonEncounterList(uint32 mapId, Difficulty difficulty) const
-{
- auto itr = _dungeonEncounterStore.find(MAKE_PAIR64(mapId, difficulty));
- if (itr != _dungeonEncounterStore.end())
- return &itr->second;
- return nullptr;
-}
-
PlayerInfo const* ObjectMgr::GetPlayerInfo(uint32 race, uint32 class_) const
{
if (race >= MAX_RACES)