aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
authorSubv <s.v.h21@hotmail.com>2012-10-19 17:57:30 -0500
committerSubv <s.v.h21@hotmail.com>2012-10-19 17:57:30 -0500
commit9dc2b7ecd566eea4115cea19a4036cfa49cce055 (patch)
treef50c7015362ae2cad1dabb0bb6be83b63e56a0c7 /src/server/game/Globals/ObjectMgr.cpp
parent972b41810330b287fc7c4172cf33878240cd25ce (diff)
parent38ca1531d8738141c742d9b7f892a75af3283edd (diff)
Merge branch 'master' of https://github.com/TrinityCore/TrinityCore into mmaps
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.cpp24
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)