aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.cpp54
1 files changed, 31 insertions, 23 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 940f3c5ad1a..16198d2c86c 100755
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -855,6 +855,12 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo const* cInfo)
const_cast<CreatureInfo*>(cInfo)->expansion = 0;
}
+ if (uint32 badFlags = (cInfo->flags_extra & ~CREATURE_FLAG_EXTRA_DB_ALLOWED))
+ {
+ sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with disallowed `flags_extra` %u, removing incorrect flag.", cInfo->Entry, badFlags);
+ const_cast<CreatureInfo*>(cInfo)->flags_extra &= CREATURE_FLAG_EXTRA_DB_ALLOWED;
+ }
+
const_cast<CreatureInfo*>(cInfo)->dmg_multiplier *= Creature::_GetDamageMod(cInfo->rank);
}
@@ -5571,6 +5577,9 @@ void ObjectMgr::LoadInstanceEncounters()
{
Field* fields = result->Fetch();
uint32 entry = fields[0].GetUInt32();
+ uint8 creditType = fields[1].GetUInt8();
+ uint32 creditEntry = fields[2].GetUInt32();
+ uint32 lastEncounterDungeon = fields[3].GetUInt32();
DungeonEncounterEntry const* dungeonEncounter = sDungeonEncounterStore.LookupEntry(entry);
if (!dungeonEncounter)
{
@@ -5578,18 +5587,37 @@ void ObjectMgr::LoadInstanceEncounters()
continue;
}
- uint8 creditType = fields[1].GetUInt8();
- uint32 creditEntry = fields[2].GetUInt32();
+ if (lastEncounterDungeon && !sLFGDungeonStore.LookupEntry(lastEncounterDungeon))
+ {
+ sLog->outErrorDb("Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->encounterName[0], lastEncounterDungeon);
+ continue;
+ }
+
+ std::map<uint32, DungeonEncounterEntry const*>::const_iterator itr = dungeonLastBosses.find(lastEncounterDungeon);
+ if (lastEncounterDungeon)
+ {
+ if (itr != dungeonLastBosses.end())
+ {
+ sLog->outErrorDb("Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->encounterName[0], itr->second->id, itr->second->encounterName[0]);
+ continue;
+ }
+
+ dungeonLastBosses[lastEncounterDungeon] = dungeonEncounter;
+ }
switch (creditType)
{
case ENCOUNTER_CREDIT_KILL_CREATURE:
- if (!GetCreatureInfo(creditEntry))
+ {
+ CreatureInfo const* creatureInfo = GetCreatureInfo(creditEntry);
+ if (!creatureInfo)
{
sLog->outErrorDb("Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName[0]);
continue;
}
break;
+ const_cast<CreatureInfo*>(creatureInfo)->flags_extra |= CREATURE_FLAG_EXTRA_DUNGEON_BOSS;
+ }
case ENCOUNTER_CREDIT_CAST_SPELL:
if (!sSpellStore.LookupEntry(creditEntry))
{
@@ -5602,26 +5630,6 @@ void ObjectMgr::LoadInstanceEncounters()
continue;
}
- uint32 lastEncounterDungeon = fields[3].GetUInt32();
-
- if (lastEncounterDungeon && !sLFGDungeonStore.LookupEntry(lastEncounterDungeon))
- {
- sLog->outErrorDb("Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->encounterName[0], lastEncounterDungeon);
- continue;
- }
-
- std::map<uint32, DungeonEncounterEntry const*>::const_iterator itr = dungeonLastBosses.find(lastEncounterDungeon);
- if (lastEncounterDungeon)
- {
- if (itr != dungeonLastBosses.end())
- {
- sLog->outErrorDb("Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->encounterName[0], itr->second->id, itr->second->encounterName[0]);
- continue;
- }
-
- dungeonLastBosses[lastEncounterDungeon] = dungeonEncounter;
- }
-
DungeonEncounterList& encounters = mDungeonEncounters[MAKE_PAIR32(dungeonEncounter->mapId, dungeonEncounter->difficulty)];
encounters.push_back(new DungeonEncounter(dungeonEncounter, EncounterCreditType(creditType), creditEntry, lastEncounterDungeon));
++count;