diff options
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rwxr-xr-x | src/server/game/Globals/ObjectMgr.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 95a27fd14e1..17982a58061 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -45,6 +45,7 @@ #include "ScriptMgr.h" #include "SpellScript.h" #include "PoolMgr.h" +#include "LFGMgr.h" ScriptMapMap sQuestEndScripts; ScriptMapMap sQuestStartScripts; @@ -5028,7 +5029,7 @@ void ObjectMgr::LoadInstanceEncounters() continue; } - if (lastEncounterDungeon && !sLFGDungeonStore.LookupEntry(lastEncounterDungeon)) + if (lastEncounterDungeon && !sLFGMgr->GetLFGDungeon(lastEncounterDungeon)) { sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->encounterName[0], lastEncounterDungeon); continue; @@ -7590,6 +7591,27 @@ SpellScriptsBounds ObjectMgr::GetSpellScriptsBounds(uint32 spell_id) return SpellScriptsBounds(_spellScriptsStore.lower_bound(spell_id), _spellScriptsStore.upper_bound(spell_id)); } +// this allows calculating base reputations to offline players, just by race and class +int32 ObjectMgr::GetBaseReputationOff(FactionEntry const* factionEntry, uint8 race, uint8 playerClass) +{ + if (!factionEntry) + return 0; + + uint32 raceMask = (1 << (race - 1)); + uint32 classMask = (1 << (playerClass-1)); + + for (int i = 0; i < 4; i++) + { + if ((!factionEntry->BaseRepClassMask[i] || + factionEntry->BaseRepClassMask[i] & classMask) && + (!factionEntry->BaseRepRaceMask[i] || + factionEntry->BaseRepRaceMask[i] & raceMask)) + return factionEntry->BaseRepValue[i]; + } + + return 0; +} + SkillRangeType GetSkillRangeType(SkillLineEntry const* pSkill, bool racial) { switch (pSkill->categoryId) |