diff options
159 files changed, 1944 insertions, 1940 deletions
diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp index a36aa000b01..0679fda5379 100755 --- a/src/server/game/AI/CoreAI/CombatAI.cpp +++ b/src/server/game/AI/CoreAI/CombatAI.cpp @@ -337,7 +337,7 @@ void VehicleAI::OnCharmed(bool apply) void VehicleAI::LoadConditions() { - conditions = sConditionMgr.GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE, me->GetEntry()); + conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE, me->GetEntry()); if (!conditions.empty()) { sLog.outDebug("VehicleAI::LoadConditions: loaded %u conditions", uint32(conditions.size())); @@ -355,7 +355,7 @@ void VehicleAI::CheckConditions(const uint32 diff) { if (Player* plr = passenger->ToPlayer()) { - if (!sConditionMgr.IsPlayerMeetToConditions(plr, conditions)) + if (!sConditionMgr->IsPlayerMeetToConditions(plr, conditions)) { plr->ExitVehicle(); return;//check other pessanger in next tick diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 52f3f592530..019f0b23ce4 100755 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -37,7 +37,7 @@ AISpellInfoType * UnitAI::AISpellInfo; void CreatureAI::Talk(uint8 id, uint64 WhisperGuid) { - sCreatureTextMgr.SendChat(me, id, WhisperGuid); + sCreatureTextMgr->SendChat(me, id, WhisperGuid); } void CreatureAI::DoZoneInCombat(Creature* creature) diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp index b0fcc98f622..ab6f4288b93 100755 --- a/src/server/game/AI/CreatureAISelector.cpp +++ b/src/server/game/AI/CreatureAISelector.cpp @@ -38,7 +38,7 @@ namespace FactorySelector //scriptname in db if (!ai_factory) - if (CreatureAI* scriptedAI = sScriptMgr.GetCreatureAI(creature)) + if (CreatureAI* scriptedAI = sScriptMgr->GetCreatureAI(creature)) return scriptedAI; // AIname in db diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp index c9960ee9545..d6bca8b87b6 100755 --- a/src/server/game/AI/EventAI/CreatureEventAI.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp @@ -58,8 +58,8 @@ int CreatureEventAI::Permissible(const Creature *creature) CreatureEventAI::CreatureEventAI(Creature *c) : CreatureAI(c) { // Need make copy for filter unneeded steps and safe in case table reload - CreatureEventAI_Event_Map::const_iterator CreatureEvents = sEventAIMgr.GetCreatureEventAIMap().find(me->GetEntry()); - if (CreatureEvents != sEventAIMgr.GetCreatureEventAIMap().end()) + CreatureEventAI_Event_Map::const_iterator CreatureEvents = sEventAIMgr->GetCreatureEventAIMap().find(me->GetEntry()); + if (CreatureEvents != sEventAIMgr->GetCreatureEventAIMap().end()) { std::vector<CreatureEventAI_Event>::const_iterator i; for (i = (*CreatureEvents).second.begin(); i != (*CreatureEvents).second.end(); ++i) @@ -410,7 +410,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 { if (CreatureInfo const* ci = GetCreatureTemplateStore(action.morph.creatureId)) { - uint32 display_id = sObjectMgr.ChooseDisplayId(0,ci); + uint32 display_id = sObjectMgr->ChooseDisplayId(0,ci); me->SetDisplayId(display_id); } } @@ -672,8 +672,8 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 { Unit* target = GetTargetByType(action.summon_id.target, pActionInvoker); - CreatureEventAI_Summon_Map::const_iterator i = sEventAIMgr.GetCreatureEventAISummonMap().find(action.summon_id.spawnId); - if (i == sEventAIMgr.GetCreatureEventAISummonMap().end()) + CreatureEventAI_Summon_Map::const_iterator i = sEventAIMgr->GetCreatureEventAISummonMap().find(action.summon_id.spawnId); + if (i == sEventAIMgr->GetCreatureEventAISummonMap().end()) { sLog.outErrorDb("CreatureEventAI: failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", action.summon_id.creatureId, action.summon_id.spawnId, EventId, me->GetEntry()); return; @@ -833,7 +833,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 { if (CreatureInfo const* cInfo = GetCreatureTemplateStore(action.mount.creatureId)) { - uint32 display_id = sObjectMgr.ChooseDisplayId(0, cInfo); + uint32 display_id = sObjectMgr->ChooseDisplayId(0, cInfo); me->Mount(display_id); } } @@ -1248,9 +1248,9 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit* return; } - CreatureEventAI_TextMap::const_iterator i = sEventAIMgr.GetCreatureEventAITextMap().find(textEntry); + CreatureEventAI_TextMap::const_iterator i = sEventAIMgr->GetCreatureEventAITextMap().find(textEntry); - if (i == sEventAIMgr.GetCreatureEventAITextMap().end()) + if (i == sEventAIMgr->GetCreatureEventAITextMap().end()) { sLog.outErrorDb("CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.",pSource->GetEntry(),pSource->GetTypeId(),pSource->GetGUIDLow(),textEntry); return; diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp index a835dace64a..b63ead9574a 100755 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp @@ -35,7 +35,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts() m_CreatureEventAI_TextMap.clear(); // Load EventAI Text - sObjectMgr.LoadTrinityStrings("creature_ai_texts",MIN_CREATURE_AI_TEXT_STRING_ID,MAX_CREATURE_AI_TEXT_STRING_ID); + sObjectMgr->LoadTrinityStrings("creature_ai_texts",MIN_CREATURE_AI_TEXT_STRING_ID,MAX_CREATURE_AI_TEXT_STRING_ID); // Gather Additional data from EventAI Texts QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM creature_ai_texts"); @@ -68,7 +68,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts() } // range negative (don't must be happen, loaded from same table) - if (!sObjectMgr.GetTrinityStringLocale(i)) + if (!sObjectMgr->GetTrinityStringLocale(i)) { sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` not found",i); continue; @@ -329,7 +329,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() break; case EVENT_T_QUEST_ACCEPT: case EVENT_T_QUEST_COMPLETE: - if (!sObjectMgr.GetQuestTemplate(temp.quest.questId)) + if (!sObjectMgr->GetQuestTemplate(temp.quest.questId)) sLog.outErrorDb("CreatureEventAI: Creature %u are using event(%u) with not existed qyest id (%u) in param1, skipped.", temp.creature_id, i, temp.quest.questId); sLog.outErrorDb("CreatureEventAI: Creature %u using not implemented event (%u) in event %u.", temp.creature_id, temp.event_id, i); continue; @@ -361,7 +361,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() cond.mConditionType = ConditionType(temp.receive_emote.condition); cond.mConditionValue1 = temp.receive_emote.conditionValue1; cond.mConditionValue2 = temp.receive_emote.conditionValue2; - if (!sConditionMgr.isConditionTypeValid(&cond)) + if (!sConditionMgr->isConditionTypeValid(&cond)) { sLog.outErrorDb("CreatureEventAI: Creature %u using event %u: param2 (Condition: %u) are not valid.",temp.creature_id, i, temp.receive_emote.condition); continue; @@ -541,7 +541,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j+1, action.threat_all_pct.percent); break; case ACTION_T_QUEST_EVENT: - if (Quest const* qid = sObjectMgr.GetQuestTemplate(action.quest_event.questId)) + if (Quest const* qid = sObjectMgr->GetQuestTemplate(action.quest_event.questId)) { if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) sLog.outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event.questId); @@ -583,7 +583,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() sLog.outErrorDb("CreatureEventAI: Event %u Action %u is change phase by too large for any use %i.", i, j+1, action.set_inc_phase.step); break; case ACTION_T_QUEST_EVENT_ALL: - if (Quest const* qid = sObjectMgr.GetQuestTemplate(action.quest_event_all.questId)) + if (Quest const* qid = sObjectMgr->GetQuestTemplate(action.quest_event_all.questId)) { if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) sLog.outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event_all.questId); diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.h b/src/server/game/AI/EventAI/CreatureEventAIMgr.h index 26f79cf0e52..90baa46c35c 100755 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.h +++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.h @@ -43,5 +43,5 @@ class CreatureEventAIMgr CreatureEventAI_TextMap m_CreatureEventAI_TextMap; }; -#define sEventAIMgr (*ACE_Singleton<CreatureEventAIMgr, ACE_Null_Mutex>::instance()) +#define sEventAIMgr ACE_Singleton<CreatureEventAIMgr, ACE_Null_Mutex>::instance() #endif diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 8ca697a1f46..948415c6fcd 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -395,7 +395,7 @@ void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 Wait void npc_escortAI::FillPointMovementListForCreature() { - std::vector<ScriptPointMove> const &pPointsEntries = sScriptSystemMgr.GetPointMoveList(me->GetEntry()); + std::vector<ScriptPointMove> const &pPointsEntries = sScriptSystemMgr->GetPointMoveList(me->GetEntry()); if (pPointsEntries.empty()) return; diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 2077ffc611f..b5e20902b7b 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -147,7 +147,7 @@ bool SmartAI::LoadPath(uint32 entry) { if (HasEscortState(SMART_ESCORT_ESCORTING)) return false; - mWayPoints = sSmartWaypointMgr.GetPath(entry); + mWayPoints = sSmartWaypointMgr->GetPath(entry); if (!mWayPoints) { GetScript()->SetPathId(0); diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 32498806588..543abcabf05 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -143,7 +143,7 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u mTextTimer = e.action.talk.duration; mTextGUID = IsPlayer(mLastInvoker)? mLastInvoker->GetGUID() : NULL;//invoker, used for $vars in texts mUseTextTimer = true; - sCreatureTextMgr.SendChat(talker, uint8(e.action.talk.textGroupID), mTextGUID); + sCreatureTextMgr->SendChat(talker, uint8(e.action.talk.textGroupID), mTextGUID); break; } case SMART_ACTION_SIMPLE_TALK: @@ -155,10 +155,10 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u { if (IsCreature((*itr))) { - sCreatureTextMgr.SendChat((*itr)->ToCreature(), uint8(e.action.talk.textGroupID), IsPlayer(mLastInvoker)? mLastInvoker->GetGUID() : NULL); + sCreatureTextMgr->SendChat((*itr)->ToCreature(), uint8(e.action.talk.textGroupID), IsPlayer(mLastInvoker)? mLastInvoker->GetGUID() : NULL); } else if (IsPlayer((*itr))) { - sCreatureTextMgr.SendChat(me, uint8(e.action.talk.textGroupID),IsPlayer(mLastInvoker)? mLastInvoker->GetGUID() : NULL,CHAT_TYPE_END,LANG_ADDON,TEXT_RANGE_NORMAL,NULL,TEAM_OTHER,false, (*itr)->ToPlayer()); + sCreatureTextMgr->SendChat(me, uint8(e.action.talk.textGroupID),IsPlayer(mLastInvoker)? mLastInvoker->GetGUID() : NULL,CHAT_TYPE_END,LANG_ADDON,TEXT_RANGE_NORMAL,NULL,TEAM_OTHER,false, (*itr)->ToPlayer()); } } } @@ -179,7 +179,7 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u if (targets) for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) if (IsCreature((*itr))) - sCreatureTextMgr.SendSound((*itr)->ToCreature(), e.action.sound.sound, CHAT_TYPE_SAY, 0, TextRange(e.action.sound.range), Team(NULL), false); + sCreatureTextMgr->SendSound((*itr)->ToCreature(), e.action.sound.sound, CHAT_TYPE_SAY, 0, TextRange(e.action.sound.range), Team(NULL), false); break; } case SMART_ACTION_SET_FACTION: @@ -222,7 +222,7 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u { if (CreatureInfo const* ci = GetCreatureTemplateStore(e.action.morphOrMount.creature)) { - uint32 display_id = sObjectMgr.ChooseDisplayId(0, ci); + uint32 display_id = sObjectMgr->ChooseDisplayId(0, ci); (*itr)->ToCreature()->SetDisplayId(display_id); } } @@ -253,7 +253,7 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) { if (IsPlayer((*itr))) - if (const Quest* q = sObjectMgr.GetQuestTemplate(e.action.quest.quest)) + if (const Quest* q = sObjectMgr->GetQuestTemplate(e.action.quest.quest)) (*itr)->ToPlayer()->AddQuest(q, NULL); } break; @@ -640,7 +640,7 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u { if (CreatureInfo const* cInfo = GetCreatureTemplateStore(e.action.morphOrMount.creature)) { - uint32 display_id = sObjectMgr.ChooseDisplayId(0, cInfo); + uint32 display_id = sObjectMgr->ChooseDisplayId(0, cInfo); (*itr)->ToUnit()->Mount(display_id); } } @@ -945,7 +945,7 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u uint32 slot[3]; if (e.action.equip.entry) { - EquipmentInfo const *einfo = sObjectMgr.GetEquipmentInfo(e.action.equip.entry); + EquipmentInfo const *einfo = sObjectMgr->GetEquipmentInfo(e.action.equip.entry); if (!einfo) { sLog.outErrorDb("SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info entry %u", e.action.equip.entry); @@ -1279,7 +1279,7 @@ void SmartScript::InstallTemplate(SmartScriptHolder e) //phase 1: despawn after time on movepoint reached AddEvent(SMART_EVENT_MOVEMENTINFORM,0, POINT_MOTION_TYPE,SMART_RANDOM_POINT,0,0,SMART_ACTION_FORCE_DESPAWN,e.action.installTtemplate.param2,0,0,0,0,0,SMART_TARGET_NONE,0,0,0,1); - if (sCreatureTextMgr.TextExist(me->GetEntry(), (uint8)e.action.installTtemplate.param5)) + if (sCreatureTextMgr->TextExist(me->GetEntry(), (uint8)e.action.installTtemplate.param5)) AddEvent(SMART_EVENT_MOVEMENTINFORM,0, POINT_MOTION_TYPE,SMART_RANDOM_POINT,0,0,SMART_ACTION_TALK,e.action.installTtemplate.param5,0,0,0,0,0,SMART_TARGET_NONE,0,0,0,1); break; } @@ -2154,21 +2154,21 @@ void SmartScript::GetScript() SmartAIEventList e; if (me) { - e = sSmartScriptMgr.GetScript(-((int32)me->GetDBTableGUIDLow()), mScriptType); + e = sSmartScriptMgr->GetScript(-((int32)me->GetDBTableGUIDLow()), mScriptType); if (e.empty()) - e = sSmartScriptMgr.GetScript((int32)me->GetEntry(), mScriptType); + e = sSmartScriptMgr->GetScript((int32)me->GetEntry(), mScriptType); FillScript(e, me, NULL); } else if (go) { - e = sSmartScriptMgr.GetScript(-((int32)go->GetDBTableGUIDLow()), mScriptType); + e = sSmartScriptMgr->GetScript(-((int32)go->GetDBTableGUIDLow()), mScriptType); if (e.empty()) - e = sSmartScriptMgr.GetScript((int32)go->GetEntry(), mScriptType); + e = sSmartScriptMgr->GetScript((int32)go->GetEntry(), mScriptType); FillScript(e, go, NULL); } else if (trigger) { - e = sSmartScriptMgr.GetScript((int32)trigger->id, mScriptType); + e = sSmartScriptMgr->GetScript((int32)trigger->id, mScriptType); FillScript(e, NULL, trigger); } } @@ -2328,7 +2328,7 @@ void SmartScript::DoFindFriendlyMissingBuff(std::list<Creature*>& _list, float r void SmartScript::SetScript9(SmartScriptHolder &e, uint32 entry) { mTimedActionList.clear(); - mTimedActionList = sSmartScriptMgr.GetScript(entry, SMART_SCRIPT_TYPE_TIMED_ACTIONLIST); + mTimedActionList = sSmartScriptMgr->GetScript(entry, SMART_SCRIPT_TYPE_TIMED_ACTIONLIST); if (mTimedActionList.empty()) return; for (SmartAIEventList::iterator i = mTimedActionList.begin(); i != mTimedActionList.end(); ++i) diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index f827948818c..5f518eced16 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -163,7 +163,7 @@ void SmartAIMgr::LoadSmartAIFromDB() } }else { - if (!sObjectMgr.GetCreatureData(uint32(abs(temp.entryOrGuid)))) + if (!sObjectMgr->GetCreatureData(uint32(abs(temp.entryOrGuid)))) { sLog.outErrorDb("SmartAIMgr::LoadSmartAIFromDB: Creature guid (%u) does not exist, skipped loading.", uint32(abs(temp.entryOrGuid))); continue; @@ -563,7 +563,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e) break; case SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS: case SMART_ACTION_CALL_GROUPEVENTHAPPENS: - if (Quest const* qid = sObjectMgr.GetQuestTemplate(e.action.quest.quest)) + if (Quest const* qid = sObjectMgr->GetQuestTemplate(e.action.quest.quest)) { if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) { @@ -692,7 +692,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e) break; case SMART_ACTION_WP_START: { - if (!sSmartWaypointMgr.GetPath(e.action.wpStart.pathID)) + if (!sSmartWaypointMgr->GetPath(e.action.wpStart.pathID)) { sLog.outErrorDb("SmartAIMgr: Creature %d Event %u Action %u uses non-existent WaypointPath id %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.pathID); return false; @@ -783,7 +783,7 @@ bool SmartAIMgr::IsTextValid(SmartScriptHolder e, uint32 id) entry = uint32(e.entryOrGuid); else { entry = uint32(abs(e.entryOrGuid)); - CreatureData const* data = sObjectMgr.GetCreatureData(entry); + CreatureData const* data = sObjectMgr->GetCreatureData(entry); if (!data) { sLog.outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u using non-existent Creature guid %d, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry); @@ -792,7 +792,7 @@ bool SmartAIMgr::IsTextValid(SmartScriptHolder e, uint32 id) else entry = data->id; } - if (!entry || !sCreatureTextMgr.TextExist(entry, uint8(id))) + if (!entry || !sCreatureTextMgr->TextExist(entry, uint8(id))) error = true; if (error) { diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 7f99a4a207c..7e17eb23b3c 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -1239,7 +1239,7 @@ class SmartAIMgr } inline bool IsQuestValid(SmartScriptHolder e, uint32 entry) { - if (!sObjectMgr.GetQuestTemplate(entry)) + if (!sObjectMgr->GetQuestTemplate(entry)) { sLog.outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Quest entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry); return false; @@ -1283,7 +1283,7 @@ class SmartAIMgr cond.mConditionValue1 = uint32(v1); cond.mConditionValue2 = uint32(v2); cond.mConditionValue3 = uint32(v3); - if (!sConditionMgr.isConditionTypeValid(&cond)) + if (!sConditionMgr->isConditionTypeValid(&cond)) error = true; } if (error) @@ -1323,6 +1323,6 @@ class SmartAIMgr bool IsTextValid(SmartScriptHolder e, uint32 id); }; -#define sSmartScriptMgr (*ACE_Singleton<SmartAIMgr, ACE_Null_Mutex>::instance()) -#define sSmartWaypointMgr (*ACE_Singleton<SmartWaypointMgr, ACE_Null_Mutex>::instance()) +#define sSmartScriptMgr ACE_Singleton<SmartAIMgr, ACE_Null_Mutex>::instance() +#define sSmartWaypointMgr ACE_Singleton<SmartWaypointMgr, ACE_Null_Mutex>::instance() #endif diff --git a/src/server/game/Accounts/AccountMgr.h b/src/server/game/Accounts/AccountMgr.h index 1b4b5ff4beb..8c0bf089dc4 100755 --- a/src/server/game/Accounts/AccountMgr.h +++ b/src/server/game/Accounts/AccountMgr.h @@ -57,6 +57,5 @@ class AccountMgr static bool normalizeString(std::string& utf8str); }; -#define sAccountMgr (*ACE_Singleton<AccountMgr, ACE_Null_Mutex>::instance()) +#define sAccountMgr ACE_Singleton<AccountMgr, ACE_Null_Mutex>::instance() #endif - diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 9354d8397a6..863ae15d6ce 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -49,7 +49,7 @@ namespace Trinity : i_player(pl), i_msgtype(msgtype), i_textId(textId), i_achievementId(ach_id) {} void operator()(WorldPacket& data, LocaleConstant loc_idx) { - char const* text = sObjectMgr.GetTrinityString(i_textId,loc_idx); + char const* text = sObjectMgr->GetTrinityString(i_textId,loc_idx); data << uint8(i_msgtype); data << uint32(LANG_UNIVERSAL); @@ -324,7 +324,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un return false; return target->getGender() == gender.gender; case ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT: - return sScriptMgr.OnCriteriaCheck(this, const_cast<Player*>(source), const_cast<Unit*>(target)); + return sScriptMgr->OnCriteriaCheck(this, const_cast<Player*>(source), const_cast<Unit*>(target)); case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY: return source->GetMap()->GetSpawnMode() == difficulty.difficulty; case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT: @@ -429,7 +429,7 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin if (!sWorld.getBoolConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER) return; - AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetAchievementCriteriaByType(type); + AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetAchievementCriteriaByType(type); for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i) { AchievementCriteriaEntry const *achievementCriteria = (*i); @@ -576,7 +576,7 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQ Field* fields = achievementResult->Fetch(); uint32 achievement_id = fields[0].GetUInt32(); - // don't must happen: cleanup at server startup in sAchievementMgr.LoadCompletedAchievements() + // don't must happen: cleanup at server startup in sAchievementMgr->LoadCompletedAchievements() if (!sAchievementStore.LookupEntry(achievement_id)) continue; @@ -631,7 +631,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) sLog.outDebug("AchievementMgr::SendAchievementEarned(%u)", achievement->ID); #endif - if (Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId())) + if (Guild* guild = sObjectMgr->GetGuildById(GetPlayer()->GetGuildId())) { Trinity::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED,achievement->ID); Trinity::LocalizedPacketDo<Trinity::AchievementChatBuilder> say_do(say_builder); @@ -724,11 +724,11 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!sWorld.getBoolConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER) return; - AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetAchievementCriteriaByType(type); + AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetAchievementCriteriaByType(type); for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i) { AchievementCriteriaEntry const *achievementCriteria = (*i); - if (sDisableMgr.IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, achievementCriteria->ID, NULL)) + if (sDisableMgr->IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, achievementCriteria->ID, NULL)) continue; AchievementEntry const *achievement = sAchievementStore.LookupEntry(achievementCriteria->referredAchievement); @@ -802,7 +802,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria); + AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); if (!data || !data->Meets(GetPlayer(),unit)) continue; @@ -818,7 +818,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria); + AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); if (!data || !data->Meets(GetPlayer(),unit)) continue; @@ -894,7 +894,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui uint32 counter =0; for (QuestStatusMap::const_iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr != GetPlayer()->getQuestStatusMap().end(); itr++) { - Quest const* quest = sObjectMgr.GetQuestTemplate(itr->first); + Quest const* quest = sObjectMgr->GetQuestTemplate(itr->first); if (itr->second.m_rewarded && quest && quest->GetZoneOrSort() >= 0 && uint32(quest->GetZoneOrSort()) == achievementCriteria->complete_quests_in_zone.zoneID) counter++; } @@ -947,7 +947,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscvalue1) continue; - Map const* map = GetPlayer()->IsInWorld() ? GetPlayer()->GetMap() : sMapMgr.FindMap(GetPlayer()->GetMapId(), GetPlayer()->GetInstanceId()); + Map const* map = GetPlayer()->IsInWorld() ? GetPlayer()->GetMap() : sMapMgr->FindMap(GetPlayer()->GetMapId(), GetPlayer()->GetInstanceId()); if (!map || !map->IsDungeon()) continue; @@ -1016,7 +1016,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria); + AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); if (!data || !data->Meets(GetPlayer(),unit)) continue; @@ -1058,7 +1058,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui case 1789: { // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria); + AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); if (!data || !data->Meets(GetPlayer(),unit)) continue; break; @@ -1077,7 +1077,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria); + AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); if (!data) continue; @@ -1094,7 +1094,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria); + AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); if (!data) continue; @@ -1124,7 +1124,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (achievementCriteria->loot_type.lootTypeCount == 1) { // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria); + AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); if (!data || !data->Meets(GetPlayer(),unit)) continue; } @@ -1147,7 +1147,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (achievementCriteria->additionalRequrements[0].additionalRequirement_type == ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE) { // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria); + AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); if (!data || !data->Meets(GetPlayer(),unit,miscvalue1)) { // reset the progress as we have a win without the requirement. @@ -1243,7 +1243,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; // check item level and quality via achievement_criteria_data - AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria); + AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); if (!data || !data->Meets(GetPlayer(), 0, miscvalue1)) continue; @@ -1266,7 +1266,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; // check item level via achievement_criteria_data - AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria); + AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); if (!data || !data->Meets(GetPlayer(), 0, pProto->ItemLevel)) continue; @@ -1283,7 +1283,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (achievementCriteria->do_emote.count) { // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria); + AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); if (!data || !data->Meets(GetPlayer(),unit)) continue; } @@ -1346,7 +1346,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui spellIter != GetPlayer()->GetSpellMap().end(); ++spellIter) { - SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spellIter->first); + SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter->first); for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) { if (skillIter->second->skillId == achievementCriteria->learn_skillline_spell.skillLine) @@ -1364,7 +1364,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (achievementCriteria->win_duel.duelCount) { // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria); + AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); if (!data) continue; @@ -1405,7 +1405,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui spellIter != GetPlayer()->GetSpellMap().end(); ++spellIter) { - SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spellIter->first); + SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter->first); for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) if (skillIter->second->skillId == achievementCriteria->learn_skill_line.skillLine) spellCount++; @@ -1451,7 +1451,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria); + AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); if (!data || !data->Meets(GetPlayer(), unit)) continue; @@ -1465,7 +1465,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscvalue1) continue; // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria); + AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); if (!data || !data->Meets(GetPlayer(), unit)) continue; @@ -1498,7 +1498,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui { for (uint32 arena_slot = 0; arena_slot < MAX_ARENA_SLOT; ++arena_slot) if (uint32 arena_team_id = GetPlayer()->GetArenaTeamId(arena_slot)) - if (ArenaTeam * at = sObjectMgr.GetArenaTeamById(arena_team_id)) + if (ArenaTeam * at = sObjectMgr->GetArenaTeamById(arena_team_id)) if (at->GetType() == reqTeamType) { SetCriteriaProgress(achievementCriteria, at->GetStats().rating, PROGRESS_HIGHEST); @@ -1539,15 +1539,15 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui CompletedAchievement(achievement); } - if (AchievementEntryList const* achRefList = sAchievementMgr.GetAchievementByReferencedId(achievement->ID)) + if (AchievementEntryList const* achRefList = sAchievementMgr->GetAchievementByReferencedId(achievement->ID)) { for (AchievementEntryList::const_iterator itr = achRefList->begin(); itr != achRefList->end(); ++itr) if (IsCompletedAchievement(*itr)) CompletedAchievement(*itr); } - if (const uint32 dungeonId = sLFGMgr.GetDungeonIdForAchievement(achievement->ID)) - sLFGMgr.RewardDungeonDoneFor(dungeonId, GetPlayer()); + if (const uint32 dungeonId = sLFGMgr->GetDungeonIdForAchievement(achievement->ID)) + sLFGMgr->RewardDungeonDoneFor(dungeonId, GetPlayer()); } } @@ -1563,7 +1563,7 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve if (achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL)) { // someone on this realm has already completed that achievement - if (sAchievementMgr.IsRealmCompleted(achievement)) + if (sAchievementMgr->IsRealmCompleted(achievement)) return false; } @@ -1748,7 +1748,7 @@ bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry) uint32 achievmentForTestId = entry->refAchievement ? entry->refAchievement : entry->ID; uint32 achievmentForTestCount = entry->count; - AchievementCriteriaEntryList const* cList = sAchievementMgr.GetAchievementCriteriaByAchievement(achievmentForTestId); + AchievementCriteriaEntryList const* cList = sAchievementMgr->GetAchievementCriteriaByAchievement(achievmentForTestId); if (!cList) return false; uint32 count = 0; @@ -1916,7 +1916,7 @@ void AchievementMgr::UpdateTimedAchievements(uint32 timeDiff) void AchievementMgr::StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry, uint32 timeLost /*= 0*/) { - AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetTimedAchievementCriteriaByType(type); + AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetTimedAchievementCriteriaByType(type); for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i) { if ((*i)->timerStartEvent != entry) @@ -1939,7 +1939,7 @@ void AchievementMgr::StartTimedAchievement(AchievementCriteriaTimedTypes type, u void AchievementMgr::RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry) { - AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetTimedAchievementCriteriaByType(type); + AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetTimedAchievementCriteriaByType(type); for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i) { if ((*i)->timerStartEvent != entry) @@ -1976,13 +1976,13 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement, b // don't insert for ACHIEVEMENT_FLAG_REALM_FIRST_KILL since otherwise only the first group member would reach that achievement // TODO: where do set this instead? if (!(achievement->flags & ACHIEVEMENT_FLAG_REALM_FIRST_KILL)) - sAchievementMgr.SetRealmCompleted(achievement); + sAchievementMgr->SetRealmCompleted(achievement); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->points); // reward items and titles if any - AchievementReward const* reward = sAchievementMgr.GetAchievementReward(achievement); + AchievementReward const* reward = sAchievementMgr->GetAchievementReward(achievement); // no rewards if (!reward) @@ -2005,10 +2005,10 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement, b std::string text = reward->text; if (loc_idx >= 0) { - if (AchievementRewardLocale const* loc = sAchievementMgr.GetAchievementRewardLocale(achievement)) + if (AchievementRewardLocale const* loc = sAchievementMgr->GetAchievementRewardLocale(achievement)) { - sObjectMgr.GetLocaleString(loc->subject, loc_idx, subject); - sObjectMgr.GetLocaleString(loc->text, loc_idx, text); + sObjectMgr->GetLocaleString(loc->subject, loc_idx, subject); + sObjectMgr->GetLocaleString(loc->text, loc_idx, text); } } @@ -2187,7 +2187,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() if (dataType != ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT) sLog.outErrorDb("Table `achievement_criteria_data` has ScriptName set for non-scripted data type (Entry: %u, type %u), useless data.", criteria_id, dataType); else - scriptId = sObjectMgr.GetScriptId(scriptName); + scriptId = sObjectMgr->GetScriptId(scriptName); } AchievementCriteriaData data(dataType, fields[2].GetUInt32(), fields[3].GetUInt32(), scriptId); @@ -2283,7 +2283,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() continue; } - if (!GetCriteriaDataSet(criteria) && !sDisableMgr.IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, entryId, NULL)) + if (!GetCriteriaDataSet(criteria) && !sDisableMgr->IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, entryId, NULL)) sLog.outErrorDb("Table `achievement_criteria_data` does not have expected data for criteria (Entry: %u Type: %u) for achievement %u.", criteria->ID, criteria->requiredType, criteria->referredAchievement); } @@ -2468,10 +2468,10 @@ void AchievementGlobalMgr::LoadRewardLocales() { LocaleConstant locale = (LocaleConstant) i; std::string str = fields[1 + 2 * (i - 1)].GetString(); - sObjectMgr.AddLocaleString(str, locale, data.subject); + sObjectMgr->AddLocaleString(str, locale, data.subject); str = fields[1 + 2 * (i - 1) + 1].GetString(); - sObjectMgr.AddLocaleString(str, locale, data.text); + sObjectMgr->AddLocaleString(str, locale, data.text); } } while (result->NextRow()); diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h index 556c7dc70e2..e90326e486d 100755 --- a/src/server/game/Achievements/AchievementMgr.h +++ b/src/server/game/Achievements/AchievementMgr.h @@ -285,6 +285,10 @@ class AchievementMgr class AchievementGlobalMgr { + friend class ACE_Singleton<AchievementGlobalMgr, ACE_Null_Mutex>; + AchievementGlobalMgr() {} + ~AchievementGlobalMgr() {} + public: AchievementCriteriaEntryList const& GetAchievementCriteriaByType(AchievementCriteriaTypes type); AchievementCriteriaEntryList const& GetTimedAchievementCriteriaByType(AchievementCriteriaTimedTypes type); @@ -352,6 +356,6 @@ class AchievementGlobalMgr AchievementRewardLocales m_achievementRewardLocales; }; -#define sAchievementMgr (*ACE_Singleton<AchievementGlobalMgr, ACE_Null_Mutex>::instance()) +#define sAchievementMgr ACE_Singleton<AchievementGlobalMgr, ACE_Null_Mutex>::instance() #endif diff --git a/src/server/game/Addons/AddonMgr.h b/src/server/game/Addons/AddonMgr.h index 4d74efcfc21..5011c3394ff 100755 --- a/src/server/game/Addons/AddonMgr.h +++ b/src/server/game/Addons/AddonMgr.h @@ -82,7 +82,7 @@ class AddonMgr SavedAddonsList m_knownAddons; // Known addons. }; -#define sAddonMgr (*ACE_Singleton<AddonMgr, ACE_Null_Mutex>::instance()) +#define sAddonMgr ACE_Singleton<AddonMgr, ACE_Null_Mutex>::instance() #endif diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index c9686a2a2e7..01cf94089af 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -96,7 +96,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction& uint32 bidder_accId = 0; uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER); - Player *bidder = sObjectMgr.GetPlayer(bidder_guid); + Player *bidder = sObjectMgr->GetPlayer(bidder_guid); // data for gm.log if (sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) { @@ -110,22 +110,22 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction& } else { - bidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(bidder_guid); - bidder_security = sAccountMgr.GetSecurity(bidder_accId); + bidder_accId = sObjectMgr->GetPlayerAccountIdByGUID(bidder_guid); + bidder_security = sAccountMgr->GetSecurity(bidder_accId); if (bidder_security > SEC_PLAYER) // not do redundant DB requests { - if (!sObjectMgr.GetPlayerNameByGUID(bidder_guid,bidder_name)) - bidder_name = sObjectMgr.GetTrinityStringForDBCLocale(LANG_UNKNOWN); + if (!sObjectMgr->GetPlayerNameByGUID(bidder_guid,bidder_name)) + bidder_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN); } } if (bidder_security > SEC_PLAYER) { std::string owner_name; - if (!sObjectMgr.GetPlayerNameByGUID(auction->owner,owner_name)) - owner_name = sObjectMgr.GetTrinityStringForDBCLocale(LANG_UNKNOWN); + if (!sObjectMgr->GetPlayerNameByGUID(auction->owner,owner_name)) + owner_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN); - uint32 owner_accid = sObjectMgr.GetPlayerAccountIdByGUID(auction->owner); + uint32 owner_accid = sObjectMgr->GetPlayerAccountIdByGUID(auction->owner); sLog.outCommand(bidder_accId,"GM %s (Account: %u) won item in auction: %s (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)", bidder_name.c_str(),bidder_accId,pItem->GetProto()->Name1,pItem->GetEntry(),pItem->GetCount(),auction->bid,owner_name.c_str(),owner_accid); @@ -167,8 +167,8 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction& void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction, SQLTransaction& trans) { uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER); - Player *owner = sObjectMgr.GetPlayer(owner_guid); - uint32 owner_accId = sObjectMgr.GetPlayerAccountIdByGUID(owner_guid); + Player *owner = sObjectMgr->GetPlayer(owner_guid); + uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid); // owner exist (online or offline) if (owner || owner_accId) { @@ -197,8 +197,8 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction, SQLTran void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry * auction, SQLTransaction& trans) { uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER); - Player *owner = sObjectMgr.GetPlayer(owner_guid); - uint32 owner_accId = sObjectMgr.GetPlayerAccountIdByGUID(owner_guid); + Player *owner = sObjectMgr->GetPlayer(owner_guid); + uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid); // owner exist if (owner || owner_accId) { @@ -240,8 +240,8 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry * auction, SQLTransact return; uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER); - Player *owner = sObjectMgr.GetPlayer(owner_guid); - uint32 owner_accId = sObjectMgr.GetPlayerAccountIdByGUID(owner_guid); + Player *owner = sObjectMgr->GetPlayer(owner_guid); + uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid); // owner exist if (owner || owner_accId) { @@ -261,11 +261,11 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry * auction, SQLTransact void AuctionHouseMgr::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 newPrice, Player* newBidder, SQLTransaction& trans) { uint64 oldBidder_guid = MAKE_NEW_GUID(auction->bidder,0, HIGHGUID_PLAYER); - Player *oldBidder = sObjectMgr.GetPlayer(oldBidder_guid); + Player *oldBidder = sObjectMgr->GetPlayer(oldBidder_guid); uint32 oldBidder_accId = 0; if (!oldBidder) - oldBidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(oldBidder_guid); + oldBidder_accId = sObjectMgr->GetPlayerAccountIdByGUID(oldBidder_guid); // old bidder exist if (oldBidder || oldBidder_accId) @@ -286,11 +286,11 @@ void AuctionHouseMgr::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 new void AuctionHouseMgr::SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQLTransaction& trans) { uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER); - Player *bidder = sObjectMgr.GetPlayer(bidder_guid); + Player *bidder = sObjectMgr->GetPlayer(bidder_guid); uint32 bidder_accId = 0; if (!bidder) - bidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(bidder_guid); + bidder_accId = sObjectMgr->GetPlayerAccountIdByGUID(bidder_guid); // bidder exist if (bidder || bidder_accId) @@ -462,14 +462,14 @@ void AuctionHouseObject::AddAuction(AuctionEntry *auction) ASSERT(auction); AuctionsMap[auction->Id] = auction; - sScriptMgr.OnAuctionAdd(this, auction); + sScriptMgr->OnAuctionAdd(this, auction); } bool AuctionHouseObject::RemoveAuction(AuctionEntry *auction, uint32 /*item_template*/) { bool wasInMap = AuctionsMap.erase(auction->Id) ? true : false; - sScriptMgr.OnAuctionRemove(this, auction); + sScriptMgr->OnAuctionRemove(this, auction); // we need to delete the entry, it is not referenced any more delete auction; @@ -503,8 +503,8 @@ void AuctionHouseObject::Update() ///- Either cancel the auction if there was no bidder if (auction->bidder == 0) { - sAuctionMgr.SendAuctionExpiredMail(auction, trans); - sScriptMgr.OnAuctionExpire(this, auction); + sAuctionMgr->SendAuctionExpiredMail(auction, trans); + sScriptMgr->OnAuctionExpire(this, auction); } ///- Or perform the transaction else @@ -512,9 +512,9 @@ void AuctionHouseObject::Update() //we should send an "item sold" message if the seller is online //we send the item to the winner //we send the money to the seller - sAuctionMgr.SendAuctionSuccessfulMail(auction, trans); - sAuctionMgr.SendAuctionWonMail(auction, trans); - sScriptMgr.OnAuctionSuccessful(this, auction); + sAuctionMgr->SendAuctionSuccessfulMail(auction, trans); + sAuctionMgr->SendAuctionWonMail(auction, trans); + sScriptMgr->OnAuctionSuccessful(this, auction); } uint32 item_template = auction->item_template; @@ -524,7 +524,7 @@ void AuctionHouseObject::Update() CharacterDatabase.CommitTransaction(trans); RemoveAuction(auction, item_template); - sAuctionMgr.RemoveAItem(auction->item_guidlow); + sAuctionMgr->RemoveAItem(auction->item_guidlow); } while (result->NextRow()); } @@ -570,7 +570,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); ++itr) { AuctionEntry *Aentry = itr->second; - Item *item = sAuctionMgr.GetAItem(Aentry->item_guidlow); + Item *item = sAuctionMgr->GetAItem(Aentry->item_guidlow); if (!item) continue; @@ -604,8 +604,8 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player // local name if (loc_idx >= 0) - if (ItemLocale const *il = sObjectMgr.GetItemLocale(proto->ItemId)) - sObjectMgr.GetLocaleString(il->Name, loc_idx, name); + if (ItemLocale const *il = sObjectMgr->GetItemLocale(proto->ItemId)) + sObjectMgr->GetLocaleString(il->Name, loc_idx, name); // DO NOT use GetItemEnchantMod(proto->RandomProperty) as it may return a result // that matches the search but it may not equal item->GetItemRandomPropertyId() @@ -661,7 +661,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player //this function inserts to WorldPacket auction's data bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const { - Item *pItem = sAuctionMgr.GetAItem(item_guidlow); + Item *pItem = sAuctionMgr->GetAItem(item_guidlow); if (!pItem) { sLog.outError("auction to item, that doesn't exist !!!!"); @@ -743,7 +743,7 @@ bool AuctionEntry::LoadFromDB(Field* fields) startbid = fields[9].GetUInt32(); deposit = fields[10].GetUInt32(); - CreatureData const* auctioneerData = sObjectMgr.GetCreatureData(auctioneer); + CreatureData const* auctioneerData = sObjectMgr->GetCreatureData(auctioneer); if (!auctioneerData) { sLog.outError("Auction %u has not a existing auctioneer (GUID : %u)", Id, auctioneer); @@ -767,7 +767,7 @@ bool AuctionEntry::LoadFromDB(Field* fields) // check if sold item exists for guid // and item_template in fact (GetAItem will fail if problematic in result check in AuctionHouseMgr::LoadAuctionItems) - if (!sAuctionMgr.GetAItem(item_guidlow)) + if (!sAuctionMgr->GetAItem(item_guidlow)) { sLog.outError("Auction %u has not a existing item : %u", Id, item_guidlow); return false; diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.h b/src/server/game/AuctionHouse/AuctionHouseMgr.h index d9692a631ed..27ed7175d5b 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.h +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.h @@ -172,6 +172,6 @@ class AuctionHouseMgr ItemMap mAitems; }; -#define sAuctionMgr (*ACE_Singleton<AuctionHouseMgr, ACE_Null_Mutex>::instance()) +#define sAuctionMgr ACE_Singleton<AuctionHouseMgr, ACE_Null_Mutex>::instance() #endif diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index fb84bd155ed..01c03793061 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -66,9 +66,9 @@ ArenaTeam::~ArenaTeam() bool ArenaTeam::Create(uint64 captainGuid, uint32 type, std::string ArenaTeamName) { - if (!sObjectMgr.GetPlayer(captainGuid)) // player not exist + if (!sObjectMgr->GetPlayer(captainGuid)) // player not exist return false; - if (sObjectMgr.GetArenaTeamByName(ArenaTeamName)) // arena team with this name already exist + if (sObjectMgr->GetArenaTeamByName(ArenaTeamName)) // arena team with this name already exist return false; uint32 captainLowGuid = GUID_LOPART(captainGuid); @@ -78,7 +78,7 @@ bool ArenaTeam::Create(uint64 captainGuid, uint32 type, std::string ArenaTeamNam m_Name = ArenaTeamName; m_Type = type; - m_TeamId = sObjectMgr.GenerateArenaTeamId(); + m_TeamId = sObjectMgr->GenerateArenaTeamId(); // ArenaTeamName already assigned to ArenaTeam::name, use it to encode string for DB CharacterDatabase.escape_string(ArenaTeamName); @@ -110,7 +110,7 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid) if (GetMembersSize() >= GetType() * 2) return false; - Player *pl = sObjectMgr.GetPlayer(PlayerGuid); + Player *pl = sObjectMgr->GetPlayer(PlayerGuid); if (pl) { if (pl->GetArenaTeamId(GetSlot())) @@ -291,7 +291,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult arenaTeamMembersResult) void ArenaTeam::SetCaptain(const uint64& guid) { // disable remove/promote buttons - Player *oldcaptain = sObjectMgr.GetPlayer(GetCaptain()); + Player *oldcaptain = sObjectMgr->GetPlayer(GetCaptain()); if (oldcaptain) oldcaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 1); @@ -302,7 +302,7 @@ void ArenaTeam::SetCaptain(const uint64& guid) CharacterDatabase.PExecute("UPDATE arena_team SET captainguid = '%u' WHERE arenateamid = '%u'", GUID_LOPART(guid), GetId()); // enable remove/promote buttons - Player *newcaptain = sObjectMgr.GetPlayer(guid); + Player *newcaptain = sObjectMgr->GetPlayer(guid); if (newcaptain) { newcaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 0); @@ -319,7 +319,7 @@ void ArenaTeam::DelMember(uint64 guid) break; } - if (Player *player = sObjectMgr.GetPlayer(guid)) + if (Player *player = sObjectMgr->GetPlayer(guid)) { player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0); // delete all info regarding this team @@ -350,7 +350,7 @@ void ArenaTeam::Disband(WorldSession *session) trans->PAppend("DELETE FROM arena_team_member WHERE arenateamid = '%u'", m_TeamId); //< this should be alredy done by calling DelMember(memberGuids[j]); for each member trans->PAppend("DELETE FROM arena_team_stats WHERE arenateamid = '%u'", m_TeamId); CharacterDatabase.CommitTransaction(trans); - sObjectMgr.RemoveArenaTeam(m_TeamId); + sObjectMgr->RemoveArenaTeam(m_TeamId); } void ArenaTeam::Roster(WorldSession *session) @@ -367,7 +367,7 @@ void ArenaTeam::Roster(WorldSession *session) for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) { - pl = sObjectMgr.GetPlayer(itr->guid); + pl = sObjectMgr->GetPlayer(itr->guid); data << uint64(itr->guid); // guid data << uint8((pl ? 1 : 0)); // online flag @@ -425,7 +425,7 @@ void ArenaTeam::NotifyStatsChanged() // updates arena team stats for every member of the team (not only the ones who participated!) for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) { - Player * plr = sObjectMgr.GetPlayer(itr->guid); + Player * plr = sObjectMgr->GetPlayer(itr->guid); if (plr) Stats(plr->GetSession()); } @@ -498,7 +498,7 @@ void ArenaTeam::BroadcastPacket(WorldPacket *packet) { for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) { - Player *player = sObjectMgr.GetPlayer(itr->guid); + Player *player = sObjectMgr->GetPlayer(itr->guid); if (player) player->GetSession()->SendPacket(packet); } @@ -677,8 +677,8 @@ void ArenaTeam::FinishGame(int32 mod) m_stats.games_season += 1; // update team's rank m_stats.rank = 1; - ObjectMgr::ArenaTeamMap::const_iterator i = sObjectMgr.GetArenaTeamMapBegin(); - for (; i != sObjectMgr.GetArenaTeamMapEnd(); ++i) + ObjectMgr::ArenaTeamMap::const_iterator i = sObjectMgr->GetArenaTeamMapBegin(); + for (; i != sObjectMgr->GetArenaTeamMapEnd(); ++i) { if (i->second->GetType() == m_Type && i->second->GetStats().rating > m_stats.rating) ++m_stats.rank; @@ -847,7 +847,7 @@ void ArenaTeam::FinishWeek() bool ArenaTeam::IsFighting() const { for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) - if (Player *p = sObjectMgr.GetPlayer(itr->guid)) + if (Player *p = sObjectMgr->GetPlayer(itr->guid)) if (p->GetMap()->IsBattleArena()) return true; return false; diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index df69efda631..3ff9d38e0ee 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -44,7 +44,7 @@ namespace Trinity : i_msgtype(msgtype), i_textId(textId), i_source(source), i_args(args) {} void operator()(WorldPacket& data, LocaleConstant loc_idx) { - char const* text = sObjectMgr.GetTrinityString(i_textId,loc_idx); + char const* text = sObjectMgr->GetTrinityString(i_textId,loc_idx); if (i_args) { @@ -89,9 +89,9 @@ namespace Trinity : i_msgtype(msgtype), i_textId(textId), i_source(source), i_arg1(arg1), i_arg2(arg2) {} void operator()(WorldPacket& data, LocaleConstant loc_idx) { - char const* text = sObjectMgr.GetTrinityString(i_textId,loc_idx); - char const* arg1str = i_arg1 ? sObjectMgr.GetTrinityString(i_arg1,loc_idx) : ""; - char const* arg2str = i_arg2 ? sObjectMgr.GetTrinityString(i_arg2,loc_idx) : ""; + char const* text = sObjectMgr->GetTrinityString(i_textId,loc_idx); + char const* arg1str = i_arg1 ? sObjectMgr->GetTrinityString(i_arg1,loc_idx) : ""; + char const* arg2str = i_arg2 ? sObjectMgr->GetTrinityString(i_arg2,loc_idx) : ""; char str [2048]; snprintf(str,2048,text, arg1str, arg2str); @@ -224,7 +224,7 @@ Battleground::~Battleground() // remove from battlegrounds } - sBattlegroundMgr.RemoveBattleground(GetInstanceID(), GetTypeID()); + sBattlegroundMgr->RemoveBattleground(GetInstanceID(), GetTypeID()); // unload map if (m_Map) m_Map->SetUnload(); @@ -284,7 +284,7 @@ void Battleground::Update(uint32 diff) Creature *sh = NULL; for (std::vector<uint64>::const_iterator itr2 = (itr->second).begin(); itr2 != (itr->second).end(); ++itr2) { - Player *plr = sObjectMgr.GetPlayer(*itr2); + Player *plr = sObjectMgr->GetPlayer(*itr2); if (!plr) continue; @@ -315,7 +315,7 @@ void Battleground::Update(uint32 diff) { for (std::vector<uint64>::const_iterator itr = m_ResurrectQueue.begin(); itr != m_ResurrectQueue.end(); ++itr) { - Player *plr = sObjectMgr.GetPlayer(*itr); + Player *plr = sObjectMgr->GetPlayer(*itr); if (!plr) continue; plr->ResurrectPlayer(1.0f); @@ -331,12 +331,12 @@ void Battleground::Update(uint32 diff) /*********************************************************/ // if less then minimum players are in on one side, then start premature finish timer - if (GetStatus() == STATUS_IN_PROGRESS && !isArena() && sBattlegroundMgr.GetPrematureFinishTime() && (GetPlayersCountByTeam(ALLIANCE) < GetMinPlayersPerTeam() || GetPlayersCountByTeam(HORDE) < GetMinPlayersPerTeam())) + if (GetStatus() == STATUS_IN_PROGRESS && !isArena() && sBattlegroundMgr->GetPrematureFinishTime() && (GetPlayersCountByTeam(ALLIANCE) < GetMinPlayersPerTeam() || GetPlayersCountByTeam(HORDE) < GetMinPlayersPerTeam())) { if (!m_PrematureCountDown) { m_PrematureCountDown = true; - m_PrematureCountDownTimer = sBattlegroundMgr.GetPrematureFinishTime(); + m_PrematureCountDownTimer = sBattlegroundMgr->GetPrematureFinishTime(); } else if (m_PrematureCountDownTimer < diff) { @@ -350,7 +350,7 @@ void Battleground::Update(uint32 diff) EndBattleground(winner); m_PrematureCountDown = false; } - else if (!sBattlegroundMgr.isTesting()) + else if (!sBattlegroundMgr->isTesting()) { uint32 newtime = m_PrematureCountDownTimer - diff; // announce every minute @@ -383,7 +383,7 @@ void Battleground::Update(uint32 diff) { m_ResetStatTimer = 0; for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) - if (Player *plr = sObjectMgr.GetPlayer(itr->first)) + if (Player *plr = sObjectMgr->GetPlayer(itr->first)) plr->ResetAllPowers(); } @@ -432,13 +432,13 @@ void Battleground::Update(uint32 diff) //TODO : add arena sound PlaySoundToAll(SOUND_ARENA_START); for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) - if (Player *plr = sObjectMgr.GetPlayer(itr->first)) + if (Player *plr = sObjectMgr->GetPlayer(itr->first)) { // BG Status packet WorldPacket status; - BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr.BGQueueTypeId(m_TypeID, GetArenaType()); + BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(m_TypeID, GetArenaType()); uint32 queueSlot = plr->GetBattlegroundQueueIndex(bgQueueTypeId); - sBattlegroundMgr.BuildBattlegroundStatusPacket(&status, this, queueSlot, STATUS_IN_PROGRESS, 0, GetStartTime(), GetArenaType()); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, queueSlot, STATUS_IN_PROGRESS, 0, GetStartTime(), GetArenaType()); plr->GetSession()->SendPacket(&status); plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION); @@ -467,7 +467,7 @@ void Battleground::Update(uint32 diff) PlaySoundToAll(SOUND_BG_START); for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) - if (Player* plr = sObjectMgr.GetPlayer(itr->first)) + if (Player* plr = sObjectMgr->GetPlayer(itr->first)) { plr->RemoveAurasDueToSpell(SPELL_PREPARATION); plr->ResetAllPowers(); @@ -524,7 +524,7 @@ void Battleground::SendPacketToAll(WorldPacket *packet) { if (itr->second.OfflineRemoveTime) continue; - Player *plr = sObjectMgr.GetPlayer(itr->first); + Player *plr = sObjectMgr->GetPlayer(itr->first); if (plr) plr->GetSession()->SendPacket(packet); else @@ -538,7 +538,7 @@ void Battleground::SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player * { if (itr->second.OfflineRemoveTime) continue; - Player *plr = sObjectMgr.GetPlayer(itr->first); + Player *plr = sObjectMgr->GetPlayer(itr->first); if (!plr) { sLog.outError("Battleground:SendPacketToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); @@ -559,7 +559,7 @@ void Battleground::SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player * void Battleground::PlaySoundToAll(uint32 SoundID) { WorldPacket data; - sBattlegroundMgr.BuildPlaySoundPacket(&data, SoundID); + sBattlegroundMgr->BuildPlaySoundPacket(&data, SoundID); SendPacketToAll(&data); } @@ -571,7 +571,7 @@ void Battleground::PlaySoundToTeam(uint32 SoundID, uint32 TeamID) { if (itr->second.OfflineRemoveTime) continue; - Player *plr = sObjectMgr.GetPlayer(itr->first); + Player *plr = sObjectMgr->GetPlayer(itr->first); if (!plr) { @@ -584,7 +584,7 @@ void Battleground::PlaySoundToTeam(uint32 SoundID, uint32 TeamID) if (team == TeamID) { - sBattlegroundMgr.BuildPlaySoundPacket(&data, SoundID); + sBattlegroundMgr->BuildPlaySoundPacket(&data, SoundID); plr->GetSession()->SendPacket(&data); } } @@ -596,7 +596,7 @@ void Battleground::CastSpellOnTeam(uint32 SpellID, uint32 TeamID) { if (itr->second.OfflineRemoveTime) continue; - Player *plr = sObjectMgr.GetPlayer(itr->first); + Player *plr = sObjectMgr->GetPlayer(itr->first); if (!plr) { @@ -617,7 +617,7 @@ void Battleground::YellToAll(Creature* creature, const char* text, uint32 langua for (std::map<uint64, BattlegroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) { WorldPacket data(SMSG_MESSAGECHAT, 200); - Player *plr = sObjectMgr.GetPlayer(itr->first); + Player *plr = sObjectMgr->GetPlayer(itr->first); if (!plr) { sLog.outError("Battleground: Player " UI64FMTD " not found!", itr->first); @@ -634,7 +634,7 @@ void Battleground::RewardHonorToTeam(uint32 Honor, uint32 TeamID) { if (itr->second.OfflineRemoveTime) continue; - Player *plr = sObjectMgr.GetPlayer(itr->first); + Player *plr = sObjectMgr->GetPlayer(itr->first); if (!plr) { @@ -661,7 +661,7 @@ void Battleground::RewardReputationToTeam(uint32 faction_id, uint32 Reputation, { if (itr->second.OfflineRemoveTime) continue; - Player *plr = sObjectMgr.GetPlayer(itr->first); + Player *plr = sObjectMgr->GetPlayer(itr->first); if (!plr) { @@ -680,14 +680,14 @@ void Battleground::RewardReputationToTeam(uint32 faction_id, uint32 Reputation, void Battleground::UpdateWorldState(uint32 Field, uint32 Value) { WorldPacket data; - sBattlegroundMgr.BuildUpdateWorldStatePacket(&data, Field, Value); + sBattlegroundMgr->BuildUpdateWorldStatePacket(&data, Field, Value); SendPacketToAll(&data); } void Battleground::UpdateWorldStateForPlayer(uint32 Field, uint32 Value, Player *Source) { WorldPacket data; - sBattlegroundMgr.BuildUpdateWorldStatePacket(&data, Field, Value); + sBattlegroundMgr->BuildUpdateWorldStatePacket(&data, Field, Value); Source->GetSession()->SendPacket(&data); } @@ -734,8 +734,8 @@ void Battleground::EndBattleground(uint32 winner) // arena rating calculation if (isArena() && isRated()) { - winner_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(winner)); - loser_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(winner))); + winner_arena_team = sObjectMgr->GetArenaTeamById(GetArenaTeamIdForTeam(winner)); + loser_arena_team = sObjectMgr->GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(winner))); if (winner_arena_team && loser_arena_team && winner_arena_team != loser_arena_team) { if (winner != WINNER_NONE) @@ -753,7 +753,7 @@ void Battleground::EndBattleground(uint32 winner) sLog.outArena("Arena match Type: %u for Team1Id: %u - Team2Id: %u ended. WinnerTeamId: %u. Winner rating: +%d, Loser rating: %d", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE], winner_arena_team->GetId(), winner_change, loser_change); if (sWorld.getBoolConfig(CONFIG_ARENA_LOG_EXTENDED_INFO)) for (Battleground::BattlegroundScoreMap::const_iterator itr = GetPlayerScoresBegin(); itr != GetPlayerScoresEnd(); itr++) - if (Player* player = sObjectMgr.GetPlayer(itr->first)) + if (Player* player = sObjectMgr->GetPlayer(itr->first)) sLog.outArena("Statistics for %s (GUID: " UI64FMTD ", Team: %d, IP: %s): %u damage, %u healing, %u killing blows", player->GetName(), itr->first, player->GetArenaTeamId(m_ArenaType == 5 ? 2 : m_ArenaType == 3), player->GetSession()->GetRemoteAddress().c_str(), itr->second->DamageDone, itr->second->HealingDone, itr->second->KillingBlows); } // Deduct 16 points from each teams arena-rating if there are no winners after 45+2 minutes @@ -788,7 +788,7 @@ void Battleground::EndBattleground(uint32 winner) } continue; } - Player *plr = sObjectMgr.GetPlayer(itr->first); + Player *plr = sObjectMgr->GetPlayer(itr->first); if (!plr) { sLog.outError("Battleground:EndBattleground Player (GUID: %u) not found!", GUID_LOPART(itr->first)); @@ -865,11 +865,11 @@ void Battleground::EndBattleground(uint32 winner) BlockMovement(plr); - sBattlegroundMgr.BuildPvpLogDataPacket(&data, this); + sBattlegroundMgr->BuildPvpLogDataPacket(&data, this); plr->GetSession()->SendPacket(&data); BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(GetTypeID(), GetArenaType()); - sBattlegroundMgr.BuildBattlegroundStatusPacket(&data, this, plr->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, TIME_TO_AUTOREMOVE, GetStartTime(), GetArenaType()); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, plr->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, TIME_TO_AUTOREMOVE, GetStartTime(), GetArenaType()); plr->GetSession()->SendPacket(&data); plr->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND, 1); } @@ -940,7 +940,7 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac RemovePlayerFromResurrectQueue(guid); - Player *plr = sObjectMgr.GetPlayer(guid); + Player *plr = sObjectMgr->GetPlayer(guid); // should remove spirit of redemption if (plr && plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION)) @@ -977,8 +977,8 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac if (isRated() && GetStatus() == STATUS_IN_PROGRESS) { //left a rated match while the encounter was in progress, consider as loser - ArenaTeam * winner_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team))); - ArenaTeam * loser_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(team)); + ArenaTeam * winner_arena_team = sObjectMgr->GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team))); + ArenaTeam * loser_arena_team = sObjectMgr->GetArenaTeamById(GetArenaTeamIdForTeam(team)); if (winner_arena_team && loser_arena_team && winner_arena_team != loser_arena_team) loser_arena_team->MemberLost(plr, GetArenaMatchmakerRating(GetOtherTeam(team))); } @@ -986,7 +986,7 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac if (SendPacket) { WorldPacket data; - sBattlegroundMgr.BuildBattlegroundStatusPacket(&data, this, plr->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_NONE, 0, 0, 0); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, plr->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_NONE, 0, 0, 0); plr->GetSession()->SendPacket(&data); } @@ -999,8 +999,8 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac if (isRated() && GetStatus() == STATUS_IN_PROGRESS) { //left a rated match while the encounter was in progress, consider as loser - ArenaTeam * others_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team))); - ArenaTeam * players_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(team)); + ArenaTeam * others_arena_team = sObjectMgr->GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team))); + ArenaTeam * players_arena_team = sObjectMgr->GetArenaTeamById(GetArenaTeamIdForTeam(team)); if (others_arena_team && players_arena_team) players_arena_team->OfflineMemberLost(guid, GetArenaMatchmakerRating(GetOtherTeam(team))); } @@ -1021,11 +1021,11 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac { // a player has left the battleground, so there are free slots -> add to queue AddToBGFreeSlotQueue(); - sBattlegroundMgr.ScheduleQueueUpdate(0, 0, bgQueueTypeId, bgTypeId, GetBracketId()); + sBattlegroundMgr->ScheduleQueueUpdate(0, 0, bgQueueTypeId, bgTypeId, GetBracketId()); } // Let others know WorldPacket data; - sBattlegroundMgr.BuildPlayerLeftBattlegroundPacket(&data, guid); + sBattlegroundMgr->BuildPlayerLeftBattlegroundPacket(&data, guid); SendPacketToTeam(team, &data, plr, false); } @@ -1085,7 +1085,7 @@ void Battleground::StartBattleground() // add bg to update list // This must be done here, because we need to have already invited some players when first BG::Update() method is executed // and it doesn't matter if we call StartBattleground() more times, because m_Battlegrounds is a map and instance id never changes - sBattlegroundMgr.AddBattleground(GetInstanceID(), GetTypeID(), this); + sBattlegroundMgr->AddBattleground(GetInstanceID(), GetTypeID(), this); if (m_IsRated) sLog.outArena("Arena match type: %u for Team1Id: %u - Team2Id: %u started.", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE]); } @@ -1111,14 +1111,14 @@ void Battleground::AddPlayer(Player *plr) UpdatePlayersCountByTeam(team, false); // +1 player WorldPacket data; - sBattlegroundMgr.BuildPlayerJoinedBattlegroundPacket(&data, plr); + sBattlegroundMgr->BuildPlayerJoinedBattlegroundPacket(&data, plr); SendPacketToTeam(team, &data, plr, false); // BG Status packet WorldPacket status; - BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr.BGQueueTypeId(m_TypeID, GetArenaType()); + BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(m_TypeID, GetArenaType()); uint32 queueSlot = plr->GetBattlegroundQueueIndex(bgQueueTypeId); - sBattlegroundMgr.BuildBattlegroundStatusPacket(&status, this, queueSlot, STATUS_IN_PROGRESS, 0, GetStartTime(), GetArenaType(), isArena() ? 0 : 1); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, queueSlot, STATUS_IN_PROGRESS, 0, GetStartTime(), GetArenaType(), isArena() ? 0 : 1); plr->GetSession()->SendPacket(&status); plr->RemoveAurasByType(SPELL_AURA_MOUNTED); @@ -1243,7 +1243,7 @@ void Battleground::AddToBGFreeSlotQueue() // make sure to add only once if (!m_InBGFreeSlotQueue && isBattleground()) { - sBattlegroundMgr.BGFreeSlotQueue[m_TypeID].push_front(this); + sBattlegroundMgr->BGFreeSlotQueue[m_TypeID].push_front(this); m_InBGFreeSlotQueue = true; } } @@ -1254,11 +1254,11 @@ void Battleground::RemoveFromBGFreeSlotQueue() // set to be able to re-add if needed m_InBGFreeSlotQueue = false; // uncomment this code when battlegrounds will work like instances - for (BGFreeSlotQueueType::iterator itr = sBattlegroundMgr.BGFreeSlotQueue[m_TypeID].begin(); itr != sBattlegroundMgr.BGFreeSlotQueue[m_TypeID].end(); ++itr) + for (BGFreeSlotQueueType::iterator itr = sBattlegroundMgr->BGFreeSlotQueue[m_TypeID].begin(); itr != sBattlegroundMgr->BGFreeSlotQueue[m_TypeID].end(); ++itr) { if ((*itr)->GetInstanceID() == m_InstanceID) { - sBattlegroundMgr.BGFreeSlotQueue[m_TypeID].erase(itr); + sBattlegroundMgr->BGFreeSlotQueue[m_TypeID].erase(itr); return; } } @@ -1374,7 +1374,7 @@ void Battleground::AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid { m_ReviveQueue[npc_guid].push_back(player_guid); - Player *plr = sObjectMgr.GetPlayer(player_guid); + Player *plr = sObjectMgr->GetPlayer(player_guid); if (!plr) return; @@ -1391,7 +1391,7 @@ void Battleground::RemovePlayerFromResurrectQueue(uint64 player_guid) { (itr->second).erase(itr2); - Player *plr = sObjectMgr.GetPlayer(player_guid); + Player *plr = sObjectMgr->GetPlayer(player_guid); if (!plr) return; @@ -1412,7 +1412,7 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float // and when loading it (in go::LoadFromDB()), a new guid would be assigned to the object, and a new object would be created // so we must create it specific for this instance GameObject * go = new GameObject; - if (!go->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),entry, GetBgMap(), + if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT),entry, GetBgMap(), PHASEMASK_NORMAL, x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,GO_STATE_READY)) { sLog.outErrorDb("Gameobject template %u not found in database! Battleground not created!", entry); @@ -1425,7 +1425,7 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float // without this, UseButtonOrDoor caused the crash, since it tried to get go info from godata // iirc that was changed, so adding to go data map is no longer required if that was the only function using godata from GameObject without checking if it existed - GameObjectData& data = sObjectMgr.NewGOData(guid); + GameObjectData& data = sObjectMgr->NewGOData(guid); data.id = entry; data.mapid = GetMapId(); @@ -1536,7 +1536,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f return NULL; Creature* pCreature = new Creature; - if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, teamval, x, y, z, o)) + if (!pCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, teamval, x, y, z, o)) { sLog.outError("Can't create creature entry: %u",entry); delete pCreature; @@ -1566,7 +1566,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f /* void Battleground::SpawnBGCreature(uint32 type, uint32 respawntime) { - Map * map = sMapMgr.FindMap(GetMapId(),GetInstanceId()); + Map * map = sMapMgr->FindMap(GetMapId(),GetInstanceId()); if (!map) return false; @@ -1577,7 +1577,7 @@ void Battleground::SpawnBGCreature(uint32 type, uint32 respawntime) { //obj->Respawn(); // bugged obj->SetRespawnTime(0); - sObjectMgr.SaveCreatureRespawnTime(obj->GetGUIDLow(), GetInstanceID(), 0); + sObjectMgr->SaveCreatureRespawnTime(obj->GetGUIDLow(), GetInstanceID(), 0); map->Add(obj); } } @@ -1680,7 +1680,7 @@ void Battleground::PSendMessageToAll(int32 entry, ChatMsg type, Player const* so void Battleground::SendWarningToAll(int32 entry, ...) { - const char *format = sObjectMgr.GetTrinityStringForDBCLocale(entry); + const char *format = sObjectMgr->GetTrinityStringForDBCLocale(entry); va_list ap; char str [1024]; va_start(ap, entry); @@ -1724,7 +1724,7 @@ void Battleground::EndNow() const char *Battleground::GetTrinityString(int32 entry) { // FIXME: now we have different DBC locales and need localized message for each target client - return sObjectMgr.GetTrinityStringForDBCLocale(entry); + return sObjectMgr->GetTrinityStringForDBCLocale(entry); } /* @@ -1781,7 +1781,7 @@ void Battleground::HandleKillPlayer(Player *player, Player *killer) for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) { - Player *plr = sObjectMgr.GetPlayer(itr->first); + Player *plr = sObjectMgr->GetPlayer(itr->first); if (!plr || plr == killer) continue; @@ -1833,10 +1833,10 @@ void Battleground::PlayerAddedToBGCheckIfBGIsRunning(Player* plr) BlockMovement(plr); - sBattlegroundMgr.BuildPvpLogDataPacket(&data, this); + sBattlegroundMgr->BuildPvpLogDataPacket(&data, this); plr->GetSession()->SendPacket(&data); - sBattlegroundMgr.BuildBattlegroundStatusPacket(&data, this, plr->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, GetEndTime(), GetStartTime(), GetArenaType()); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, plr->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, GetEndTime(), GetStartTime(), GetArenaType()); plr->GetSession()->SendPacket(&data); } @@ -1847,7 +1847,7 @@ uint32 Battleground::GetAlivePlayersCountByTeam(uint32 Team) const { if (itr->second.Team == Team) { - Player * pl = sObjectMgr.GetPlayer(itr->first); + Player * pl = sObjectMgr->GetPlayer(itr->first); if (pl && pl->isAlive() && !pl->HasByteFlag(UNIT_FIELD_BYTES_2, 3, FORM_SPIRITOFREDEMPTION)) ++count; } @@ -1905,7 +1905,7 @@ void Battleground::SetBgRaid(uint32 TeamID, Group *bg_raid) WorldSafeLocsEntry const* Battleground::GetClosestGraveYard(Player* player) { - return sObjectMgr.GetClosestGraveYard(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), player->GetTeam()); + return sObjectMgr->GetClosestGraveYard(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), player->GetTeam()); } bool Battleground::IsTeamScoreInRange(uint32 team, uint32 minScore, uint32 maxScore) const @@ -1918,7 +1918,7 @@ bool Battleground::IsTeamScoreInRange(uint32 team, uint32 minScore, uint32 maxSc void Battleground::StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry) { for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) - if (Player* pPlayer = sObjectMgr.GetPlayer(itr->first)) + if (Player* pPlayer = sObjectMgr->GetPlayer(itr->first)) pPlayer->GetAchievementMgr().StartTimedAchievement(type, entry); } diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 2a2f5af4b8e..e3fb4c42f79 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -250,7 +250,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket *data, Battleground *bg) for (int8 i = 1; i >= 0; --i) { uint32 at_id = bg->m_ArenaTeamIds[i]; - ArenaTeam* at = sObjectMgr.GetArenaTeamById(at_id); + ArenaTeam* at = sObjectMgr->GetArenaTeamById(at_id); if (at) *data << at->GetName(); else @@ -290,7 +290,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket *data, Battleground *bg) } else { - Player *plr = sObjectMgr.GetPlayer(itr2->first); + Player *plr = sObjectMgr->GetPlayer(itr2->first); uint32 team = bg->GetPlayerTeam(itr2->first); if (!team && plr) team = plr->GetBGTeam(); @@ -595,7 +595,7 @@ Battleground * BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId bgTypeI bg->SetBracket(bracketEntry); // generate a new instance id - bg->SetInstanceID(sMapMgr.GenerateInstanceId()); // set instance id + bg->SetInstanceID(sMapMgr->GenerateInstanceId()); // set instance id bg->SetClientInstanceID(CreateClientVisibleInstanceId(isRandom ? BATTLEGROUND_RB : bgTypeId, bracketEntry->GetBracketId())); // reset the new bg (set status to status_wait_queue from status_none) @@ -688,7 +688,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds() Field *fields = result->Fetch(); uint32 bgTypeID_ = fields[0].GetUInt32(); - if (sDisableMgr.IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, bgTypeID_, NULL)) + if (sDisableMgr->IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, bgTypeID_, NULL)) continue; // can be overwrite by values from DB @@ -766,7 +766,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds() } selectionWeight = fields[9].GetUInt8(); - scriptId = sObjectMgr.GetScriptId(fields[10].GetCString()); + scriptId = sObjectMgr->GetScriptId(fields[10].GetCString()); //sLog.outDetail("Creating battleground %s, %u-%u", bl->name[sWorld.GetDBClang()], MinLvl, MaxLvl); if (!CreateBattleground(bgTypeID, IsArena, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl, bl->name[sWorld.GetDefaultDbcLocale()], bl->mapid[0], AStartLoc[0], AStartLoc[1], AStartLoc[2], AStartLoc[3], HStartLoc[0], HStartLoc[1], HStartLoc[2], HStartLoc[3], scriptId)) continue; @@ -815,7 +815,7 @@ void BattlegroundMgr::DistributeArenaPoints() std::map<uint32, uint32> PlayerPoints; //at first update all points for all team members - for (ObjectMgr::ArenaTeamMap::iterator team_itr = sObjectMgr.GetArenaTeamMapBegin(); team_itr != sObjectMgr.GetArenaTeamMapEnd(); ++team_itr) + for (ObjectMgr::ArenaTeamMap::iterator team_itr = sObjectMgr->GetArenaTeamMapBegin(); team_itr != sObjectMgr->GetArenaTeamMapEnd(); ++team_itr) if (ArenaTeam * at = team_itr->second) at->UpdateArenaPointsHelper(PlayerPoints); @@ -826,7 +826,7 @@ void BattlegroundMgr::DistributeArenaPoints() CharacterDatabase.PExecute("UPDATE characters SET arenaPoints = arenaPoints + '%u' WHERE guid = '%u'", plr_itr->second, plr_itr->first); //add points to player if online - Player* pl = sObjectMgr.GetPlayer(plr_itr->first); + Player* pl = sObjectMgr->GetPlayer(plr_itr->first); if (pl) pl->ModifyArenaPoints(plr_itr->second); } @@ -836,7 +836,7 @@ void BattlegroundMgr::DistributeArenaPoints() sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_END); sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_START); - for (ObjectMgr::ArenaTeamMap::iterator titr = sObjectMgr.GetArenaTeamMapBegin(); titr != sObjectMgr.GetArenaTeamMapEnd(); ++titr) + for (ObjectMgr::ArenaTeamMap::iterator titr = sObjectMgr->GetArenaTeamMapBegin(); titr != sObjectMgr->GetArenaTeamMapEnd(); ++titr) { if (ArenaTeam * at = titr->second) { @@ -897,7 +897,7 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket *data, const uint6 size_t count_pos = data->wpos(); *data << uint32(0); // number of bg instances - if (Battleground* bgTemplate = sBattlegroundMgr.GetBattlegroundTemplate(bgTypeId)) + if (Battleground* bgTemplate = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId)) { // expected bracket entry if (PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgTemplate->GetMapId(),plr->getLevel())) diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h index 5db508f7bb3..d42f428a7e6 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.h +++ b/src/server/game/Battlegrounds/BattlegroundMgr.h @@ -128,6 +128,6 @@ class BattlegroundMgr bool m_Testing; }; -#define sBattlegroundMgr (*ACE_Singleton<BattlegroundMgr, ACE_Null_Mutex>::instance()) +#define sBattlegroundMgr ACE_Singleton<BattlegroundMgr, ACE_Null_Mutex>::instance() #endif diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index 8078db8956b..4e93eb45637 100755 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -158,7 +158,7 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg //announce world (this don't need mutex) if (isRated && sWorld.getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE)) { - ArenaTeam *Team = sObjectMgr.GetArenaTeamById(arenateamid); + ArenaTeam *Team = sObjectMgr->GetArenaTeamById(arenateamid); if (Team) sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, Team->GetName().c_str(), ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating); } @@ -194,7 +194,7 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg //announce to world, this code needs mutex if (!isRated && !isPremade && sWorld.getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE)) { - if (Battleground* bg = sBattlegroundMgr.GetBattlegroundTemplate(ginfo->BgTypeId)) + if (Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(ginfo->BgTypeId)) { char const* bgName = bg->GetName(); uint32 MinPlayers = bg->GetMinPlayersPerTeam(); @@ -282,7 +282,7 @@ uint32 BattlegroundQueue::GetAverageQueueWaitTime(GroupQueueInfo* ginfo, Battleg //remove player from queue and from group info, if group info is empty then remove it too void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCount) { - //Player *plr = sObjectMgr.GetPlayer(guid); + //Player *plr = sObjectMgr->GetPlayer(guid); int32 bracket_id = -1; // signed for proper for-loop finish QueuedPlayersMap::iterator itr; @@ -342,7 +342,7 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou // if invited to bg, and should decrease invited count, then do it if (decreaseInvitedCount && group->IsInvitedToBGInstanceGUID) { - Battleground* bg = sBattlegroundMgr.GetBattleground(group->IsInvitedToBGInstanceGUID, group->BgTypeId); + Battleground* bg = sBattlegroundMgr->GetBattleground(group->IsInvitedToBGInstanceGUID, group->BgTypeId); if (bg) bg->DecreaseInvitedCount(group->Team); } @@ -353,7 +353,7 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou // announce to world if arena team left queue for rated match, show only once if (group->ArenaType && group->IsRated && group->Players.empty() && sWorld.getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE)) { - ArenaTeam *Team = sObjectMgr.GetArenaTeamById(group->ArenaTeamId); + ArenaTeam *Team = sObjectMgr->GetArenaTeamById(group->ArenaTeamId); if (Team) sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, Team->GetName().c_str(), group->ArenaType, group->ArenaType, group->ArenaTeamRating); } @@ -361,11 +361,11 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou //if player leaves queue and he is invited to rated arena match, then he have to lose if (group->IsInvitedToBGInstanceGUID && group->IsRated && decreaseInvitedCount) { - ArenaTeam * at = sObjectMgr.GetArenaTeamById(group->ArenaTeamId); + ArenaTeam * at = sObjectMgr->GetArenaTeamById(group->ArenaTeamId); if (at) { sLog.outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u", GUID_LOPART(guid), group->OpponentsTeamRating); - Player *plr = sObjectMgr.GetPlayer(guid); + Player *plr = sObjectMgr->GetPlayer(guid); if (plr) at->MemberLost(plr, group->OpponentsMatchmakerRating); else @@ -387,15 +387,15 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou { // remove next player, this is recursive // first send removal information - if (Player *plr2 = sObjectMgr.GetPlayer(group->Players.begin()->first)) + if (Player *plr2 = sObjectMgr->GetPlayer(group->Players.begin()->first)) { - Battleground * bg = sBattlegroundMgr.GetBattlegroundTemplate(group->BgTypeId); + Battleground * bg = sBattlegroundMgr->GetBattlegroundTemplate(group->BgTypeId); BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(group->BgTypeId, group->ArenaType); uint32 queueSlot = plr2->GetBattlegroundQueueIndex(bgQueueTypeId); plr2->RemoveBattlegroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to // queue->removeplayer, it causes bugs WorldPacket data; - sBattlegroundMgr.BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0, 0); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0, 0); plr2->GetSession()->SendPacket(&data); } // then actually delete, this may delete the group as well! @@ -446,14 +446,14 @@ bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, Battleground * b for (std::map<uint64,PlayerQueueInfo*>::iterator itr = ginfo->Players.begin(); itr != ginfo->Players.end(); ++itr) { // get the player - Player* plr = sObjectMgr.GetPlayer(itr->first); + Player* plr = sObjectMgr->GetPlayer(itr->first); // if offline, skip him, this should not happen - player is removed from queue when he logs out if (!plr) continue; // invite the player PlayerInvitedToBGUpdateAverageWaitTime(ginfo, bracket_id); - //sBattlegroundMgr.InvitePlayer(plr, bg, ginfo->Team); + //sBattlegroundMgr->InvitePlayer(plr, bg, ginfo->Team); // set invited player counters bg->IncreaseInvitedCount(ginfo->Team); @@ -474,7 +474,7 @@ bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, Battleground * b sLog.outDebug("Battleground: invited plr %s (%u) to BG instance %u queueindex %u bgtype %u, I can't help it if they don't press the enter battle button.",plr->GetName(),plr->GetGUIDLow(),bg->GetInstanceID(),queueSlot,bg->GetTypeID()); // send status packet - sBattlegroundMgr.BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME, 0, ginfo->ArenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME, 0, ginfo->ArenaType); plr->GetSession()->SendPacket(&data); } return true; @@ -660,7 +660,7 @@ bool BattlegroundQueue::CheckNormalMatch(Battleground* bg_template, Battleground return false; } //allow 1v0 if debug bg - if (sBattlegroundMgr.isTesting() && bg_template->isBattleground() && (m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() || m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount())) + if (sBattlegroundMgr->isTesting() && bg_template->isBattleground() && (m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() || m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount())) return true; //return true if there are enough players in selection pools - enable to work .debug bg command correctly return m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() >= minPlayers && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() >= minPlayers; @@ -742,7 +742,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI //battleground with free slot for player should be always in the beggining of the queue // maybe it would be better to create bgfreeslotqueue for each bracket_id BGFreeSlotQueueType::iterator itr, next; - for (itr = sBattlegroundMgr.BGFreeSlotQueue[bgTypeId].begin(); itr != sBattlegroundMgr.BGFreeSlotQueue[bgTypeId].end(); itr = next) + for (itr = sBattlegroundMgr->BGFreeSlotQueue[bgTypeId].begin(); itr != sBattlegroundMgr->BGFreeSlotQueue[bgTypeId].end(); itr = next) { next = itr; ++next; @@ -776,7 +776,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI // finished iterating through the bgs with free slots, maybe we need to create a new bg - Battleground * bg_template = sBattlegroundMgr.GetBattlegroundTemplate(bgTypeId); + Battleground * bg_template = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId); if (!bg_template) { sLog.outError("Battleground: Update: bg template not found for %u", bgTypeId); @@ -793,11 +793,11 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI // get the min. players per team, properly for larger arenas as well. (must have full teams for arena matches!) uint32 MinPlayersPerTeam = bg_template->GetMinPlayersPerTeam(); uint32 MaxPlayersPerTeam = bg_template->GetMaxPlayersPerTeam(); - if (sBattlegroundMgr.isTesting()) + if (sBattlegroundMgr->isTesting()) MinPlayersPerTeam = 1; if (bg_template->isArena()) { - if (sBattlegroundMgr.isArenaTesting()) + if (sBattlegroundMgr->isArenaTesting()) { MaxPlayersPerTeam = 1; MinPlayersPerTeam = 1; @@ -834,7 +834,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI if (CheckPremadeMatch(bracket_id, MinPlayersPerTeam, MaxPlayersPerTeam)) { //create new battleground - Battleground * bg2 = sBattlegroundMgr.CreateNewBattleground(bgTypeId, bracketEntry, 0, false); + Battleground * bg2 = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, 0, false); if (!bg2) { sLog.outError("BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId); @@ -860,7 +860,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI || (bg_template->isArena() && CheckSkirmishForSameFaction(bracket_id, MinPlayersPerTeam))) { // we successfully created a pool - Battleground * bg2 = sBattlegroundMgr.CreateNewBattleground(bgTypeId, bracketEntry, arenaType, false); + Battleground * bg2 = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, arenaType, false); if (!bg2) { sLog.outError("BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId); @@ -904,13 +904,13 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI } //set rating range - uint32 arenaMinRating = (arenaRating <= sBattlegroundMgr.GetMaxRatingDifference()) ? 0 : arenaRating - sBattlegroundMgr.GetMaxRatingDifference(); - uint32 arenaMaxRating = arenaRating + sBattlegroundMgr.GetMaxRatingDifference(); + uint32 arenaMinRating = (arenaRating <= sBattlegroundMgr->GetMaxRatingDifference()) ? 0 : arenaRating - sBattlegroundMgr->GetMaxRatingDifference(); + uint32 arenaMaxRating = arenaRating + sBattlegroundMgr->GetMaxRatingDifference(); // if max rating difference is set and the time past since server startup is greater than the rating discard time // (after what time the ratings aren't taken into account when making teams) then // the discard time is current_time - time_to_discard, teams that joined after that, will have their ratings taken into account // else leave the discard time on 0, this way all ratings will be discarded - uint32 discardTime = getMSTime() - sBattlegroundMgr.GetRatingDiscardTimer(); + uint32 discardTime = getMSTime() - sBattlegroundMgr->GetRatingDiscardTimer(); // we need to find 2 teams which will play next game @@ -974,7 +974,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI //if we have 2 teams, then start new arena and invite players! if (m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount()) { - Battleground* arena = sBattlegroundMgr.CreateNewBattleground(bgTypeId, bracketEntry, arenaType, true); + Battleground* arena = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, arenaType, true); if (!arena) { sLog.outError("BattlegroundQueue::Update couldn't create arena instance for rated arena match!"); @@ -1021,12 +1021,12 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) { - Player* plr = sObjectMgr.GetPlayer(m_PlayerGuid); + Player* plr = sObjectMgr->GetPlayer(m_PlayerGuid); // player logged off (we should do nothing, he is correctly removed from queue in another procedure) if (!plr) return true; - Battleground* bg = sBattlegroundMgr.GetBattleground(m_BgInstanceGUID, m_BgTypeId); + Battleground* bg = sBattlegroundMgr->GetBattleground(m_BgInstanceGUID, m_BgTypeId); //if battleground ended and its instance deleted - do nothing if (!bg) return true; @@ -1036,12 +1036,12 @@ bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) if (queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES) // player is in queue or in battleground { // check if player is invited to this bg - BattlegroundQueue &bgQueue = sBattlegroundMgr.m_BattlegroundQueues[bgQueueTypeId]; + BattlegroundQueue &bgQueue = sBattlegroundMgr->m_BattlegroundQueues[bgQueueTypeId]; if (bgQueue.IsPlayerInvited(m_PlayerGuid, m_BgInstanceGUID, m_RemoveTime)) { WorldPacket data; //we must send remaining time in queue - sBattlegroundMgr.BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME - INVITATION_REMIND_TIME, 0, m_ArenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME - INVITATION_REMIND_TIME, 0, m_ArenaType); plr->GetSession()->SendPacket(&data); } } @@ -1064,12 +1064,12 @@ void BGQueueInviteEvent::Abort(uint64 /*e_time*/) */ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) { - Player* plr = sObjectMgr.GetPlayer(m_PlayerGuid); + Player* plr = sObjectMgr->GetPlayer(m_PlayerGuid); if (!plr) // player logged off (we should do nothing, he is correctly removed from queue in another procedure) return true; - Battleground* bg = sBattlegroundMgr.GetBattleground(m_BgInstanceGUID, m_BgTypeId); + Battleground* bg = sBattlegroundMgr->GetBattleground(m_BgInstanceGUID, m_BgTypeId); //battleground can be deleted already when we are removing queue info //bg pointer can be NULL! so use it carefully! @@ -1077,7 +1077,7 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) if (queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES) // player is in queue, or in Battleground { // check if player is in queue for this BG and if we are removing his invite event - BattlegroundQueue &bgQueue = sBattlegroundMgr.m_BattlegroundQueues[m_BgQueueTypeId]; + BattlegroundQueue &bgQueue = sBattlegroundMgr->m_BattlegroundQueues[m_BgQueueTypeId]; if (bgQueue.IsPlayerInvited(m_PlayerGuid, m_BgInstanceGUID, m_RemoveTime)) { sLog.outDebug("Battleground: removing player %u from bg queue for instance %u because of not pressing enter battle in time.",plr->GetGUIDLow(),m_BgInstanceGUID); @@ -1086,10 +1086,10 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) bgQueue.RemovePlayer(m_PlayerGuid, true); //update queues if battleground isn't ended if (bg && bg->isBattleground() && bg->GetStatus() != STATUS_WAIT_LEAVE) - sBattlegroundMgr.ScheduleQueueUpdate(0, 0, m_BgQueueTypeId, m_BgTypeId, bg->GetBracketId()); + sBattlegroundMgr->ScheduleQueueUpdate(0, 0, m_BgQueueTypeId, m_BgTypeId, bg->GetBracketId()); WorldPacket data; - sBattlegroundMgr.BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0, 0); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0, 0); plr->GetSession()->SendPacket(&data); } } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index 16dd2a8bbe0..e0bf2dd502f 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -411,7 +411,7 @@ void BattlegroundAB::_NodeDeOccupied(uint8 node) WorldSafeLocsEntry const *ClosestGrave = NULL; for (std::vector<uint64>::const_iterator itr = ghost_list.begin(); itr != ghost_list.end(); ++itr) { - Player* plr = sObjectMgr.GetPlayer(*itr); + Player* plr = sObjectMgr->GetPlayer(*itr); if (!plr) continue; @@ -609,7 +609,7 @@ void BattlegroundAB::Reset() m_ReputationScoreTics[BG_TEAM_ALLIANCE] = 0; m_ReputationScoreTics[BG_TEAM_HORDE] = 0; m_IsInformedNearVictory = false; - bool isBGWeekend = sBattlegroundMgr.IsBGWeekend(GetTypeID()); + bool isBGWeekend = sBattlegroundMgr->IsBGWeekend(GetTypeID()); m_HonorTics = (isBGWeekend) ? BG_AB_ABBGWeekendHonorTicks : BG_AB_NotABBGWeekendHonorTicks; m_ReputationTics = (isBGWeekend) ? BG_AB_ABBGWeekendReputationTicks : BG_AB_NotABBGWeekendReputationTicks; m_TeamScores500Disadvantage[BG_TEAM_ALLIANCE] = false; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index 6c8774afb15..4c33c14d570 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -289,7 +289,7 @@ Creature* BattlegroundAV::AddAVCreature(uint16 cinfoid, uint16 type) if (!isStatic && ((cinfoid >= AV_NPC_A_GRAVEDEFENSE0 && cinfoid <= AV_NPC_A_GRAVEDEFENSE3) || (cinfoid >= AV_NPC_H_GRAVEDEFENSE0 && cinfoid <= AV_NPC_H_GRAVEDEFENSE3))) { - CreatureData &data = sObjectMgr.NewOrExistCreatureData(creature->GetDBTableGUIDLow()); + CreatureData &data = sObjectMgr->NewOrExistCreatureData(creature->GetDBTableGUIDLow()); data.spawndist = 5; } //else spawndist will be 15, so creatures move maximum=10 @@ -1031,7 +1031,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object) WorldSafeLocsEntry const *ClosestGrave = NULL; for (std::vector<uint64>::iterator itr = ghost_list.begin(); itr != ghost_list.end(); ++itr) { - plr = sObjectMgr.GetPlayer(*ghost_list.begin()); + plr = sObjectMgr->GetPlayer(*ghost_list.begin()); if (!plr) continue; if (!ClosestGrave) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index 807225e0643..c9fb508773b 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -148,7 +148,7 @@ void BattlegroundEY::CheckSomeoneJoinedPoint() uint8 j = 0; while (j < m_PlayersNearPoint[EY_POINTS_MAX].size()) { - Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[EY_POINTS_MAX][j]); + Player *plr = sObjectMgr->GetPlayer(m_PlayersNearPoint[EY_POINTS_MAX][j]); if (!plr) { sLog.outError("BattlegroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[EY_POINTS_MAX][j])); @@ -188,7 +188,7 @@ void BattlegroundEY::CheckSomeoneLeftPoint() uint8 j = 0; while (j < m_PlayersNearPoint[i].size()) { - Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[i][j]); + Player *plr = sObjectMgr->GetPlayer(m_PlayersNearPoint[i][j]); if (!plr) { sLog.outError("BattlegroundEY:CheckSomeoneLeftPoint Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j])); @@ -243,7 +243,7 @@ void BattlegroundEY::UpdatePointStatuses() for (uint8 i = 0; i < m_PlayersNearPoint[point].size(); ++i) { - Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[point][i]); + Player *plr = sObjectMgr->GetPlayer(m_PlayersNearPoint[point][i]); if (plr) { this->UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[point], plr); @@ -528,7 +528,7 @@ void BattlegroundEY::Reset() m_DroppedFlagGUID = 0; m_PointAddingTimer = 0; m_TowerCapCheckTimer = 0; - bool isBGWeekend = sBattlegroundMgr.IsBGWeekend(GetTypeID()); + bool isBGWeekend = sBattlegroundMgr->IsBGWeekend(GetTypeID()); m_HonorTics = (isBGWeekend) ? BG_EY_EYWeekendHonorTicks : BG_EY_NotEYWeekendHonorTicks; for (uint8 i = 0; i < EY_POINTS_MAX; ++i) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index 5fb8ac46580..909205b1d1a 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -232,7 +232,7 @@ void BattlegroundSA::StartShips() { for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end();itr++) { - if (Player* p = sObjectMgr.GetPlayer(itr->first)) + if (Player* p = sObjectMgr->GetPlayer(itr->first)) { if (p->GetTeamId() != attackers) continue; @@ -462,7 +462,7 @@ void BattlegroundSA::TeleportPlayers() { for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) { - if (Player *plr = sObjectMgr.GetPlayer(itr->first)) + if (Player *plr = sObjectMgr->GetPlayer(itr->first)) { // should remove spirit of redemption if (plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION)) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index 5ea34ad935a..0bd7d9f731b 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -142,20 +142,20 @@ void BattlegroundWS::Update(uint32 diff) m_FlagSpellForceTimer += diff; if (m_FlagDebuffState == 0 && m_FlagSpellForceTimer >= 600000) //10 minutes { - if (Player * plr = sObjectMgr.GetPlayer(m_FlagKeepers[0])) + if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[0])) plr->CastSpell(plr,WS_SPELL_FOCUSED_ASSAULT,true); - if (Player * plr = sObjectMgr.GetPlayer(m_FlagKeepers[1])) + if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[1])) plr->CastSpell(plr,WS_SPELL_FOCUSED_ASSAULT,true); m_FlagDebuffState = 1; } else if (m_FlagDebuffState == 1 && m_FlagSpellForceTimer >= 900000) //15 minutes { - if (Player * plr = sObjectMgr.GetPlayer(m_FlagKeepers[0])) + if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[0])) { plr->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); plr->CastSpell(plr,WS_SPELL_BRUTAL_ASSAULT,true); } - if (Player * plr = sObjectMgr.GetPlayer(m_FlagKeepers[1])) + if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[1])) { plr->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); plr->CastSpell(plr,WS_SPELL_BRUTAL_ASSAULT,true); @@ -717,7 +717,7 @@ void BattlegroundWS::Reset() m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE; m_TeamScores[BG_TEAM_ALLIANCE] = 0; m_TeamScores[BG_TEAM_HORDE] = 0; - bool isBGWeekend = sBattlegroundMgr.IsBGWeekend(GetTypeID()); + bool isBGWeekend = sBattlegroundMgr->IsBGWeekend(GetTypeID()); m_ReputationCapture = (isBGWeekend) ? 45 : 35; m_HonorWinKills = (isBGWeekend) ? 3 : 1; m_HonorEndKills = (isBGWeekend) ? 4 : 2; diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 0f9fdc30e21..35541e82642 100755 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -169,7 +169,7 @@ void Channel::Join(uint64 p, const char *pass) return; } - Player *plr = sObjectMgr.GetPlayer(p); + Player *plr = sObjectMgr->GetPlayer(p); if (plr) { @@ -231,7 +231,7 @@ void Channel::Leave(uint64 p, bool send) } else { - Player *plr = sObjectMgr.GetPlayer(p); + Player *plr = sObjectMgr->GetPlayer(p); if (send) { @@ -274,7 +274,7 @@ void Channel::Leave(uint64 p, bool send) void Channel::KickOrBan(uint64 good, const char *badname, bool ban) { AccountTypes sec = SEC_PLAYER; - Player *gplr = sObjectMgr.GetPlayer(good); + Player *gplr = sObjectMgr->GetPlayer(good); if (gplr) sec = gplr->GetSession()->GetSecurity(); @@ -292,7 +292,7 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban) } else { - Player *bad = sObjectMgr.GetPlayer(badname); + Player *bad = sObjectMgr->GetPlayer(badname); if (bad == NULL || !IsOn(bad->GetGUID())) { WorldPacket data; @@ -338,7 +338,7 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban) void Channel::UnBan(uint64 good, const char *badname) { uint32 sec = 0; - Player *gplr = sObjectMgr.GetPlayer(good); + Player *gplr = sObjectMgr->GetPlayer(good); if (gplr) sec = gplr->GetSession()->GetSecurity(); @@ -356,7 +356,7 @@ void Channel::UnBan(uint64 good, const char *badname) } else { - Player *bad = sObjectMgr.GetPlayer(badname); + Player *bad = sObjectMgr->GetPlayer(badname); if (bad == NULL || !IsBanned(bad->GetGUID())) { WorldPacket data; @@ -380,7 +380,7 @@ void Channel::Password(uint64 p, const char *pass) { std::string plName; uint32 sec = 0; - Player *plr = sObjectMgr.GetPlayer(p); + Player *plr = sObjectMgr->GetPlayer(p); if (plr) sec = plr->GetSession()->GetSecurity(); @@ -412,7 +412,7 @@ void Channel::Password(uint64 p, const char *pass) void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set) { - Player *plr = sObjectMgr.GetPlayer(p); + Player *plr = sObjectMgr->GetPlayer(p); if (!plr) return; @@ -432,7 +432,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set) } else { - Player *newp = sObjectMgr.GetPlayer(p2n); + Player *newp = sObjectMgr->GetPlayer(p2n); if (!newp) { WorldPacket data; @@ -480,7 +480,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set) void Channel::SetOwner(uint64 p, const char *newname) { - Player *plr = sObjectMgr.GetPlayer(p); + Player *plr = sObjectMgr->GetPlayer(p); if (!plr) return; @@ -502,7 +502,7 @@ void Channel::SetOwner(uint64 p, const char *newname) return; } - Player *newp = sObjectMgr.GetPlayer(newname); + Player *newp = sObjectMgr->GetPlayer(newname); if (newp == NULL || !IsOn(newp->GetGUID())) { WorldPacket data; @@ -564,7 +564,7 @@ void Channel::List(Player* player) uint32 count = 0; for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i) { - Player *plr = sObjectMgr.GetPlayer(i->first); + Player *plr = sObjectMgr->GetPlayer(i->first); // PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters // MODERATOR, GAME MASTER, ADMINISTRATOR can see all @@ -586,7 +586,7 @@ void Channel::List(Player* player) void Channel::Announce(uint64 p) { uint32 sec = 0; - Player *plr = sObjectMgr.GetPlayer(p); + Player *plr = sObjectMgr->GetPlayer(p); if (plr) sec = plr->GetSession()->GetSecurity(); @@ -624,7 +624,7 @@ void Channel::Say(uint64 p, const char *what, uint32 lang) if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) lang = LANG_UNIVERSAL; - Player *plr = sObjectMgr.GetPlayer(p); + Player *plr = sObjectMgr->GetPlayer(p); if (!IsOn(p)) { @@ -667,7 +667,7 @@ void Channel::Invite(uint64 p, const char *newname) return; } - Player *newp = sObjectMgr.GetPlayer(newname); + Player *newp = sObjectMgr->GetPlayer(newname); if (!newp) { WorldPacket data; @@ -684,7 +684,7 @@ void Channel::Invite(uint64 p, const char *newname) return; } - Player *plr = sObjectMgr.GetPlayer(p); + Player *plr = sObjectMgr->GetPlayer(p); if (!plr) return; @@ -750,7 +750,7 @@ void Channel::SendToAll(WorldPacket *data, uint64 p) { for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i) { - Player *plr = sObjectMgr.GetPlayer(i->first); + Player *plr = sObjectMgr->GetPlayer(i->first); if (plr) { if (!p || !plr->GetSocial()->HasIgnore(GUID_LOPART(p))) @@ -765,7 +765,7 @@ void Channel::SendToAllButOne(WorldPacket *data, uint64 who) { if (i->first != who) { - Player *plr = sObjectMgr.GetPlayer(i->first); + Player *plr = sObjectMgr->GetPlayer(i->first); if (plr) plr->GetSession()->SendPacket(data); } @@ -774,7 +774,7 @@ void Channel::SendToAllButOne(WorldPacket *data, uint64 who) void Channel::SendToOne(WorldPacket *data, uint64 who) { - Player *plr = sObjectMgr.GetPlayer(who); + Player *plr = sObjectMgr->GetPlayer(who); if (plr) plr->GetSession()->SendPacket(data); } @@ -878,7 +878,7 @@ void Channel::MakeChannelOwner(WorldPacket *data) { std::string name = ""; - if (!sObjectMgr.GetPlayerNameByGUID(m_ownerGUID, name) || name.empty()) + if (!sObjectMgr->GetPlayerNameByGUID(m_ownerGUID, name) || name.empty()) name = "PLAYER_NOT_FOUND"; MakeNotifyPacket(data, CHAT_CHANNEL_OWNER_NOTICE); diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 32002068453..6d6d282ebe2 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -452,7 +452,7 @@ ChatCommand * ChatHandler::getCommandTable() { // count total number of top-level commands size_t total = getCommandTableSize(commandTable); - std::vector<ChatCommand*> const& dynamic = sScriptMgr.GetChatCommands(); + std::vector<ChatCommand*> const& dynamic = sScriptMgr->GetChatCommands(); for (std::vector<ChatCommand*>::const_iterator it = dynamic.begin(); it != dynamic.end(); ++it) total += getCommandTableSize(*it); total += 1; // ending zero @@ -502,7 +502,7 @@ bool ChatHandler::HasLowerSecurity(Player* target, uint64 guid, bool strong) if (target) target_session = target->GetSession(); else if (guid) - target_account = sObjectMgr.GetPlayerAccountIdByGUID(guid); + target_account = sObjectMgr->GetPlayerAccountIdByGUID(guid); if (!target_session && !target_account) { @@ -529,7 +529,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac if (target) target_sec = target->GetSecurity(); else if (target_account) - target_sec = sAccountMgr.GetSecurity(target_account); + target_sec = sAccountMgr->GetSecurity(target_account); else return true; // caller must report error for (target == NULL && target_account == 0) @@ -1091,7 +1091,7 @@ valid examples: c = reader.peek(); } - linkedQuest = sObjectMgr.GetQuestTemplate(questid); + linkedQuest = sObjectMgr->GetQuestTemplate(questid); if (!linkedQuest) { @@ -1262,7 +1262,7 @@ valid examples: if (linkedSpell->Attributes & SPELL_ATTR0_TRADESPELL) { // lookup skillid - SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(linkedSpell->Id); + SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(linkedSpell->Id); if (bounds.first == bounds.second) { return false; @@ -1309,7 +1309,7 @@ valid examples: { if (linkedQuest->GetTitle() != buffer) { - QuestLocale const *ql = sObjectMgr.GetQuestLocale(linkedQuest->GetQuestId()); + QuestLocale const *ql = sObjectMgr->GetQuestLocale(linkedQuest->GetQuestId()); if (!ql) { @@ -1350,7 +1350,7 @@ valid examples: if (expectedName != buffer) { - ItemLocale const *il = sObjectMgr.GetItemLocale(linkedItem->ItemId); + ItemLocale const *il = sObjectMgr->GetItemLocale(linkedItem->ItemId); bool foundName = false; for (uint8 dbIndex = LOCALE_koKR; dbIndex < TOTAL_LOCALES; ++dbIndex) @@ -1606,7 +1606,7 @@ Player * ChatHandler::getSelectedPlayer() if (guid == 0) return m_session->GetPlayer(); - return sObjectMgr.GetPlayer(guid); + return sObjectMgr->GetPlayer(guid); } Unit* ChatHandler::getSelectedUnit() @@ -1809,7 +1809,7 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid GameObject* obj = pl->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, entry, HIGHGUID_GAMEOBJECT)); - if (!obj && sObjectMgr.GetGOData(lowguid)) // guid is DB guid of object + if (!obj && sObjectMgr->GetGOData(lowguid)) // guid is DB guid of object { // search near player then CellPair p(Trinity::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY())); @@ -1909,9 +1909,9 @@ GameTele const* ChatHandler::extractGameTeleFromLink(char* text) // id case (explicit or from shift link) if (cId[0] >= '0' || cId[0] >= '9') if (uint32 id = atoi(cId)) - return sObjectMgr.GetGameTele(id); + return sObjectMgr->GetGameTele(id); - return sObjectMgr.GetGameTele(cId); + return sObjectMgr->GetGameTele(cId); } enum GuidLinkType @@ -1948,10 +1948,10 @@ uint64 ChatHandler::extractGuidFromLink(char* text) if (!normalizePlayerName(name)) return 0; - if (Player* player = sObjectMgr.GetPlayer(name.c_str())) + if (Player* player = sObjectMgr->GetPlayer(name.c_str())) return player->GetGUID(); - if (uint64 guid = sObjectMgr.GetPlayerGUIDByName(name)) + if (uint64 guid = sObjectMgr->GetPlayerGUIDByName(name)) return guid; return 0; @@ -1960,7 +1960,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text) { uint32 lowguid = (uint32)atol(idS); - if (CreatureData const* data = sObjectMgr.GetCreatureData(lowguid)) + if (CreatureData const* data = sObjectMgr->GetCreatureData(lowguid)) return MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_UNIT); else return 0; @@ -1969,7 +1969,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text) { uint32 lowguid = (uint32)atol(idS); - if (GameObjectData const* data = sObjectMgr.GetGOData(lowguid)) + if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid)) return MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_GAMEOBJECT); else return 0; @@ -2006,14 +2006,14 @@ bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* playe return false; } - Player* pl = sObjectMgr.GetPlayer(name.c_str()); + Player* pl = sObjectMgr->GetPlayer(name.c_str()); // if allowed player pointer if (player) *player = pl; // if need guid value from DB (in name case for check player existence) - uint64 guid = !pl && (player_guid || player_name) ? sObjectMgr.GetPlayerGUIDByName(name) : 0; + uint64 guid = !pl && (player_guid || player_name) ? sObjectMgr->GetPlayerGUIDByName(name) : 0; // if allowed player guid (if no then only online players allowed) if (player_guid) @@ -2099,7 +2099,7 @@ int ChatHandler::GetSessionDbLocaleIndex() const const char *CliHandler::GetTrinityString(int32 entry) const { - return sObjectMgr.GetTrinityStringForDBCLocale(entry); + return sObjectMgr->GetTrinityStringForDBCLocale(entry); } bool CliHandler::isAvailable(ChatCommand const& cmd) const @@ -2141,9 +2141,9 @@ bool ChatHandler::GetPlayerGroupAndGUIDByName(const char* cname, Player* &plr, G return false; } - plr = sObjectMgr.GetPlayer(name.c_str()); + plr = sObjectMgr->GetPlayer(name.c_str()); if (offline) - guid = sObjectMgr.GetPlayerGUIDByName(name.c_str()); + guid = sObjectMgr->GetPlayerGUIDByName(name.c_str()); } } @@ -2175,5 +2175,5 @@ LocaleConstant CliHandler::GetSessionDbcLocale() const int CliHandler::GetSessionDbLocaleIndex() const { - return sObjectMgr.GetDBCLocaleIndex(); + return sObjectMgr->GetDBCLocaleIndex(); } diff --git a/src/server/game/Chat/Commands/Level1.cpp b/src/server/game/Chat/Commands/Level1.cpp index 52c67c7c756..3036644ae0e 100755 --- a/src/server/game/Chat/Commands/Level1.cpp +++ b/src/server/game/Chat/Commands/Level1.cpp @@ -405,7 +405,7 @@ bool ChatHandler::HandleAppearCommand(const char* args) // if no bind exists, create a solo bind InstanceGroupBind *gBind = group ? group->GetBoundInstance(target) : NULL; // if no bind exists, create a solo bind if (!gBind) - if (InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(target->GetInstanceId())) + if (InstanceSave *save = sInstanceSaveMgr->GetInstanceSave(target->GetInstanceId())) _player->BindToInstance(save, !save->CanReset()); } @@ -645,7 +645,7 @@ bool ChatHandler::HandleLookupTeleCommand(const char * args) uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); bool limitReached = false; - GameTeleMap const & teleMap = sObjectMgr.GetGameTeleMap(); + GameTeleMap const & teleMap = sObjectMgr->GetGameTeleMap(); for (GameTeleMap::const_iterator itr = teleMap.begin(); itr != teleMap.end(); ++itr) { GameTele const* tele = &itr->second; diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index fccca696d0f..7fe635dcc61 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -63,7 +63,7 @@ bool ChatHandler::HandleMuteCommand(const char* args) if (!extractPlayerTarget(nameStr,&target,&target_guid,&target_name)) return false; - uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr.GetPlayerAccountIdByGUID(target_guid); + uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(target_guid); // find only player from same account if any if (!target) @@ -102,7 +102,7 @@ bool ChatHandler::HandleUnmuteCommand(const char* args) if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name)) return false; - uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr.GetPlayerAccountIdByGUID(target_guid); + uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(target_guid); // find only player from same account if any if (!target) @@ -530,8 +530,8 @@ bool ChatHandler::HandleLookupEventCommand(const char* args) uint32 count = 0; uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); - GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap(); - GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr.GetActiveEventList(); + GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap(); + GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList(); for (uint32 id = 0; id < events.size(); ++id) { @@ -809,7 +809,7 @@ bool ChatHandler::HandleCreatePetCommand(const char* /*args*/) // prepare visual effect for levelup pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel()-1); - pet->GetCharmInfo()->SetPetNumber(sObjectMgr.GeneratePetNumber(), true); + pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true); // this enables pet details window (Shift+P) pet->InitPetCreateSpells(); pet->SetFullHealth(); diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index b3e37fb7332..82745fa0cc8 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -159,7 +159,7 @@ bool ChatHandler::HandleUnLearnCommand(const char *args) } if (allRanks) - spell_id = sSpellMgr.GetFirstSpellInChain (spell_id); + spell_id = sSpellMgr->GetFirstSpellInChain (spell_id); if (target->HasSpell(spell_id)) target->removeSpell(spell_id,false,!allRanks); @@ -769,7 +769,7 @@ bool ChatHandler::HandleLookupItemCommand(const char *args) if (loc_idx >= 0) { uint8 uloc_idx = uint8(loc_idx); - if (ItemLocale const *il = sObjectMgr.GetItemLocale(pProto->ItemId)) + if (ItemLocale const *il = sObjectMgr->GetItemLocale(pProto->ItemId)) { if (il->Name.size() > uloc_idx && !il->Name[uloc_idx].empty()) { @@ -1050,7 +1050,7 @@ bool ChatHandler::HandleLookupSpellCommand(const char *args) // unit32 used to prevent interpreting uint8 as char at output // find rank of learned spell for learning spell, or talent rank - uint32 rank = talentCost ? talentCost : sSpellMgr.GetSpellRank(learn ? spellInfo->EffectTriggerSpell[0] : id); + uint32 rank = talentCost ? talentCost : sSpellMgr->GetSpellRank(learn ? spellInfo->EffectTriggerSpell[0] : id); // send spell in "id - [name, rank N] [talent] [passive] [learn] [known]" format std::ostringstream ss; @@ -1112,7 +1112,7 @@ bool ChatHandler::HandleLookupQuestCommand(const char *args) uint32 count = 0; uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); - ObjectMgr::QuestMap const& qTemplates = sObjectMgr.GetQuestTemplates(); + ObjectMgr::QuestMap const& qTemplates = sObjectMgr->GetQuestTemplates(); for (ObjectMgr::QuestMap::const_iterator iter = qTemplates.begin(); iter != qTemplates.end(); ++iter) { Quest * qinfo = iter->second; @@ -1121,7 +1121,7 @@ bool ChatHandler::HandleLookupQuestCommand(const char *args) if (loc_idx >= 0) { uint8 uloc_idx = uint8(loc_idx); - if (QuestLocale const *il = sObjectMgr.GetQuestLocale(qinfo->GetQuestId())) + if (QuestLocale const *il = sObjectMgr->GetQuestLocale(qinfo->GetQuestId())) { if (il->Title.size() > uloc_idx && !il->Title[uloc_idx].empty()) { @@ -1239,7 +1239,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args) if (loc_idx >= 0) { uint8 uloc_idx = uint8(loc_idx); - if (CreatureLocale const *cl = sObjectMgr.GetCreatureLocale (id)) + if (CreatureLocale const *cl = sObjectMgr->GetCreatureLocale (id)) { if (cl->Name.size() > uloc_idx && !cl->Name[uloc_idx].empty ()) { @@ -1323,7 +1323,7 @@ bool ChatHandler::HandleLookupObjectCommand(const char *args) if (loc_idx >= 0) { uint8 uloc_idx = uint8(loc_idx); - if (GameObjectLocale const *gl = sObjectMgr.GetGameObjectLocale(id)) + if (GameObjectLocale const *gl = sObjectMgr->GetGameObjectLocale(id)) { if (gl->Name.size() > uloc_idx && !gl->Name[uloc_idx].empty()) { @@ -1702,7 +1702,7 @@ bool ChatHandler::HandleGuildCreateCommand(const char *args) return false; } - sObjectMgr.AddGuild (guild); + sObjectMgr->AddGuild (guild); return true; } @@ -1725,7 +1725,7 @@ bool ChatHandler::HandleGuildInviteCommand(const char *args) return false; std::string glName = guildStr; - Guild* targetGuild = sObjectMgr.GetGuildByName (glName); + Guild* targetGuild = sObjectMgr->GetGuildByName (glName); if (!targetGuild) return false; @@ -1745,7 +1745,7 @@ bool ChatHandler::HandleGuildUninviteCommand(const char *args) if (!glId) return false; - Guild* targetGuild = sObjectMgr.GetGuildById (glId); + Guild* targetGuild = sObjectMgr->GetGuildById (glId); if (!targetGuild) return false; @@ -1771,7 +1771,7 @@ bool ChatHandler::HandleGuildRankCommand(const char *args) if (!glId) return false; - Guild* targetGuild = sObjectMgr.GetGuildById (glId); + Guild* targetGuild = sObjectMgr->GetGuildById (glId); if (!targetGuild) return false; @@ -1790,7 +1790,7 @@ bool ChatHandler::HandleGuildDeleteCommand(const char *args) std::string gld = guildStr; - Guild* targetGuild = sObjectMgr.GetGuildByName (gld); + Guild* targetGuild = sObjectMgr->GetGuildByName (gld); if (!targetGuild) return false; @@ -2050,7 +2050,7 @@ bool ChatHandler::HandleLinkGraveCommand(const char *args) return false; } - if (sObjectMgr.AddGraveYardLink(g_id,zoneId,g_team)) + if (sObjectMgr->AddGraveYardLink(g_id,zoneId,g_team)) PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, g_id,zoneId); else PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, g_id,zoneId); @@ -2076,14 +2076,14 @@ bool ChatHandler::HandleNearGraveCommand(const char *args) Player* player = m_session->GetPlayer(); uint32 zone_id = player->GetZoneId(); - WorldSafeLocsEntry const* graveyard = sObjectMgr.GetClosestGraveYard( + WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveYard( player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(),player->GetMapId(),g_team); if (graveyard) { uint32 g_id = graveyard->ID; - GraveYardData const* data = sObjectMgr.FindGraveYardData(g_id,zone_id); + GraveYardData const* data = sObjectMgr->FindGraveYardData(g_id,zone_id); if (!data) { PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR,g_id); @@ -2387,10 +2387,10 @@ bool ChatHandler::HandleChangeWeather(const char *args) Player *player = m_session->GetPlayer(); uint32 zoneid = player->GetZoneId(); - Weather* wth = sWeatherMgr.FindWeather(zoneid); + Weather* wth = sWeatherMgr->FindWeather(zoneid); if (!wth) - wth = sWeatherMgr.AddWeather(zoneid); + wth = sWeatherMgr->AddWeather(zoneid); if (!wth) { SendSysMessage(LANG_NO_WEATHER); @@ -2551,7 +2551,7 @@ bool ChatHandler::HandleResetLevelCommand(const char * args) ? sWorld.getIntConfig(CONFIG_START_PLAYER_LEVEL) : sWorld.getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL); - sScriptMgr.OnPlayerLevelChanged(target, start_level); + sScriptMgr->OnPlayerLevelChanged(target, start_level); target->_ApplyAllLevelScaleItemMods(false); target->SetLevel(start_level); @@ -3098,7 +3098,7 @@ bool ChatHandler::HandleBanInfoAccountCommand(const char *args) return false; } - uint32 accountid = sAccountMgr.GetId(account_name); + uint32 accountid = sAccountMgr->GetId(account_name); if (!accountid) { PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str()); @@ -3113,7 +3113,7 @@ bool ChatHandler::HandleBanInfoCharacterCommand(const char *args) if (!*args) return false; - Player* target = sObjectMgr.GetPlayer(args); + Player* target = sObjectMgr->GetPlayer(args); uint32 target_guid = 0; std::string name(args); @@ -3372,7 +3372,7 @@ bool ChatHandler::HandleBanListHelper(QueryResult result) account_name = fields[1].GetString(); // "character" case, name need extract from another DB else - sAccountMgr.GetName (account_id,account_name); + sAccountMgr->GetName (account_id,account_name); // No SQL injection. id is uint32. QueryResult banInfo = LoginDatabase.PQuery("SELECT bandate,unbandate,bannedby,banreason FROM account_banned WHERE id = %u ORDER BY unbandate", account_id); @@ -3535,7 +3535,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args) return false; } - uint32 account_id = sAccountMgr.GetId(account_name); + uint32 account_id = sAccountMgr->GetId(account_name); if (!account_id) { account_id = atoi(account); // use original string @@ -3547,7 +3547,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args) } } - if (!sAccountMgr.GetName(account_id,account_name)) + if (!sAccountMgr->GetName(account_id,account_name)) { PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str()); SetSentErrorMessage(true); @@ -3591,7 +3591,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args) return false; } - if (sObjectMgr.GetPlayerAccountIdByGUID(guid)) + if (sObjectMgr->GetPlayerAccountIdByGUID(guid)) { PSendSysMessage(LANG_CHARACTER_GUID_IN_USE,guid); SetSentErrorMessage(true); @@ -3650,10 +3650,10 @@ bool ChatHandler::HandlePDumpWriteCommand(const char *args) return false; } - guid = sObjectMgr.GetPlayerGUIDByName(name); + guid = sObjectMgr->GetPlayerGUIDByName(name); } - if (!sObjectMgr.GetPlayerAccountIdByGUID(guid)) + if (!sObjectMgr->GetPlayerAccountIdByGUID(guid)) { PSendSysMessage(LANG_PLAYER_NOT_FOUND); SetSentErrorMessage(true); @@ -4148,11 +4148,11 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char *args) bool ChatHandler::HandleInstanceStatsCommand(const char* /*args*/) { - PSendSysMessage("instances loaded: %d", sMapMgr.GetNumInstances()); - PSendSysMessage("players in instances: %d", sMapMgr.GetNumPlayersInInstances()); - PSendSysMessage("instance saves: %d", sInstanceSaveMgr.GetNumInstanceSaves()); - PSendSysMessage("players bound: %d", sInstanceSaveMgr.GetNumBoundPlayersTotal()); - PSendSysMessage("groups bound: %d", sInstanceSaveMgr.GetNumBoundGroupsTotal()); + PSendSysMessage("instances loaded: %d", sMapMgr->GetNumInstances()); + PSendSysMessage("players in instances: %d", sMapMgr->GetNumPlayersInInstances()); + PSendSysMessage("instance saves: %d", sInstanceSaveMgr->GetNumInstanceSaves()); + PSendSysMessage("players bound: %d", sInstanceSaveMgr->GetNumBoundPlayersTotal()); + PSendSysMessage("groups bound: %d", sInstanceSaveMgr->GetNumBoundGroupsTotal()); return true; } @@ -4404,7 +4404,7 @@ bool ChatHandler::HandleSendMessageCommand(const char *args) bool ChatHandler::HandleFlushArenaPointsCommand(const char * /*args*/) { - sBattlegroundMgr.DistributeArenaPoints(); + sBattlegroundMgr->DistributeArenaPoints(); return true; } @@ -4489,7 +4489,7 @@ bool ChatHandler::HandleFreezeCommand(const char *args) { name = TargetName; normalizePlayerName(name); - player = sObjectMgr.GetPlayer(name.c_str()); //get player by name + player = sObjectMgr->GetPlayer(name.c_str()); //get player by name } if (!player) @@ -4554,7 +4554,7 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args) { name = TargetName; normalizePlayerName(name); - player = sObjectMgr.GetPlayer(name.c_str()); //get player by name + player = sObjectMgr->GetPlayer(name.c_str()); //get player by name } //effect diff --git a/src/server/game/Chat/Commands/TicketCommands.cpp b/src/server/game/Chat/Commands/TicketCommands.cpp index 34f04041bc4..e30639040f3 100755 --- a/src/server/game/Chat/Commands/TicketCommands.cpp +++ b/src/server/game/Chat/Commands/TicketCommands.cpp @@ -39,7 +39,7 @@ std::string ChatHandler::PGetParseString(int32 entry, ...) bool ChatHandler::HandleGMTicketListCommand(const char* /*args*/) { SendSysMessage(LANG_COMMAND_TICKETSHOWLIST); - for (GmTicketList::iterator itr = sTicketMgr.m_GMTicketList.begin(); itr != sTicketMgr.m_GMTicketList.end(); ++itr) + for (GmTicketList::iterator itr = sTicketMgr->m_GMTicketList.begin(); itr != sTicketMgr->m_GMTicketList.end(); ++itr) { if ((*itr)->closed != 0 || (*itr)->completed) continue; @@ -50,7 +50,7 @@ bool ChatHandler::HandleGMTicketListCommand(const char* /*args*/) ss << PGetParseString(LANG_COMMAND_TICKETLISTAGECREATE, (secsToTimeString(time(NULL) - (*itr)->createtime, true, false)).c_str()); ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - (*itr)->timestamp, true, false)).c_str()); - if (sObjectMgr.GetPlayerNameByGUID((*itr)->assignedToGM, gmname)) + if (sObjectMgr->GetPlayerNameByGUID((*itr)->assignedToGM, gmname)) ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str()); SendSysMessage(ss.str().c_str()); @@ -61,9 +61,9 @@ bool ChatHandler::HandleGMTicketListCommand(const char* /*args*/) bool ChatHandler::HandleGMTicketListOnlineCommand(const char* /*args*/) { SendSysMessage(LANG_COMMAND_TICKETSHOWONLINELIST); - for (GmTicketList::iterator itr = sTicketMgr.m_GMTicketList.begin(); itr != sTicketMgr.m_GMTicketList.end(); ++itr) + for (GmTicketList::iterator itr = sTicketMgr->m_GMTicketList.begin(); itr != sTicketMgr->m_GMTicketList.end(); ++itr) { - if ((*itr)->closed != 0 || (*itr)->completed || !sObjectMgr.GetPlayer((*itr)->playerGuid)) + if ((*itr)->closed != 0 || (*itr)->completed || !sObjectMgr->GetPlayer((*itr)->playerGuid)) continue; std::string gmname; @@ -72,7 +72,7 @@ bool ChatHandler::HandleGMTicketListOnlineCommand(const char* /*args*/) ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, (*itr)->name.c_str()); ss << PGetParseString(LANG_COMMAND_TICKETLISTAGECREATE, (secsToTimeString(time(NULL) - (*itr)->createtime, true, false)).c_str()); ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - (*itr)->timestamp, true, false)).c_str()); - if (sObjectMgr.GetPlayerNameByGUID((*itr)->assignedToGM, gmname)) + if (sObjectMgr->GetPlayerNameByGUID((*itr)->assignedToGM, gmname)) ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str()); SendSysMessage(ss.str().c_str()); } @@ -82,7 +82,7 @@ bool ChatHandler::HandleGMTicketListOnlineCommand(const char* /*args*/) bool ChatHandler::HandleGMTicketListClosedCommand(const char* /*args*/) { SendSysMessage(LANG_COMMAND_TICKETSHOWCLOSEDLIST); - for (GmTicketList::iterator itr = sTicketMgr.m_GMTicketList.begin(); itr != sTicketMgr.m_GMTicketList.end(); ++itr) + for (GmTicketList::iterator itr = sTicketMgr->m_GMTicketList.begin(); itr != sTicketMgr->m_GMTicketList.end(); ++itr) { if ((*itr)->closed == 0) continue; @@ -93,7 +93,7 @@ bool ChatHandler::HandleGMTicketListClosedCommand(const char* /*args*/) ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, (*itr)->name.c_str()); ss << PGetParseString(LANG_COMMAND_TICKETLISTAGECREATE, (secsToTimeString(time(NULL) - (*itr)->createtime, true, false)).c_str()); ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - (*itr)->timestamp, true, false)).c_str()); - if (sObjectMgr.GetPlayerNameByGUID((*itr)->assignedToGM, gmname)) + if (sObjectMgr->GetPlayerNameByGUID((*itr)->assignedToGM, gmname)) ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str()); SendSysMessage(ss.str().c_str()); @@ -104,7 +104,7 @@ bool ChatHandler::HandleGMTicketListClosedCommand(const char* /*args*/) bool ChatHandler::HandleGMTicketListEscalatedCommand(const char* /*args*/) { SendSysMessage(LANG_COMMAND_TICKETSHOWESCALATEDLIST); - for (GmTicketList::iterator itr = sTicketMgr.m_GMTicketList.begin(); itr != sTicketMgr.m_GMTicketList.end(); ++itr) + for (GmTicketList::iterator itr = sTicketMgr->m_GMTicketList.begin(); itr != sTicketMgr->m_GMTicketList.end(); ++itr) { if (!((*itr)->escalated == TICKET_IN_ESCALATION_QUEUE) || (*itr)->closed != 0) continue; @@ -126,7 +126,7 @@ bool ChatHandler::HandleGMTicketGetByIdCommand(const char* args) return false; uint64 tguid = atoi(args); - GM_Ticket *ticket = sTicketMgr.GetGMTicket(tguid); + GM_Ticket *ticket = sTicketMgr->GetGMTicket(tguid); if (!ticket || ticket->closed != 0 || ticket->completed) { SendSysMessage(LANG_COMMAND_TICKETNOTEXIST); @@ -141,7 +141,7 @@ bool ChatHandler::HandleGMTicketGetByIdCommand(const char* args) ss << PGetParseString(LANG_COMMAND_TICKETLISTAGECREATE, (secsToTimeString(time(NULL) - ticket->createtime, true, false)).c_str()); ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - ticket->timestamp, true, false)).c_str()); - if (sObjectMgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname)) + if (sObjectMgr->GetPlayerNameByGUID(ticket->assignedToGM, gmname)) ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str()); ss << PGetParseString(LANG_COMMAND_TICKETLISTMESSAGE, ticket->message.c_str()); @@ -161,14 +161,14 @@ bool ChatHandler::HandleGMTicketGetByNameCommand(const char* args) std::string name = (char*)args; normalizePlayerName(name); - Player *plr = sObjectMgr.GetPlayer(name.c_str()); + Player *plr = sObjectMgr->GetPlayer(name.c_str()); if (!plr) { SendSysMessage(LANG_NO_PLAYERS_FOUND); return true; } - GM_Ticket *ticket = sTicketMgr.GetGMTicketByPlayer(plr->GetGUID()); + GM_Ticket *ticket = sTicketMgr->GetGMTicketByPlayer(plr->GetGUID()); if (!ticket) { SendSysMessage(LANG_COMMAND_TICKETNOTEXIST); @@ -183,7 +183,7 @@ bool ChatHandler::HandleGMTicketGetByNameCommand(const char* args) ss << PGetParseString(LANG_COMMAND_TICKETLISTAGECREATE, (secsToTimeString(time(NULL) - ticket->createtime, true, false)).c_str()); ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - ticket->timestamp, true, false)).c_str()); - if (sObjectMgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname)) + if (sObjectMgr->GetPlayerNameByGUID(ticket->assignedToGM, gmname)) ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str()); ss << PGetParseString(LANG_COMMAND_TICKETLISTMESSAGE, ticket->message.c_str()); @@ -202,7 +202,7 @@ bool ChatHandler::HandleGMTicketCloseByIdCommand(const char* args) return false; uint64 tguid = atoi(args); - GM_Ticket *ticket = sTicketMgr.GetGMTicket(tguid); + GM_Ticket *ticket = sTicketMgr->GetGMTicket(tguid); if (!ticket || ticket->closed != 0 || ticket->completed) { SendSysMessage(LANG_COMMAND_TICKETNOTEXIST); @@ -220,8 +220,8 @@ bool ChatHandler::HandleGMTicketCloseByIdCommand(const char* args) ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str()); ss << PGetParseString(LANG_COMMAND_TICKETCLOSED, m_session->GetPlayer()->GetName()); SendGlobalGMSysMessage(ss.str().c_str()); - Player *plr = sObjectMgr.GetPlayer(ticket->playerGuid); - sTicketMgr.RemoveGMTicket(ticket, m_session->GetPlayer()->GetGUID()); + Player *plr = sObjectMgr->GetPlayer(ticket->playerGuid); + sTicketMgr->RemoveGMTicket(ticket, m_session->GetPlayer()->GetGUID()); if (!plr || !plr->IsInWorld()) return true; @@ -231,7 +231,7 @@ bool ChatHandler::HandleGMTicketCloseByIdCommand(const char* args) deleteTicket << uint32(GMTICKET_RESPONSE_TICKET_DELETED); plr->GetSession()->SendPacket(&deleteTicket); - sTicketMgr.UpdateLastChange(); + sTicketMgr->UpdateLastChange(); return true; } @@ -252,7 +252,7 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args) return false; Player *cplr = m_session->GetPlayer(); - GM_Ticket *ticket = sTicketMgr.GetGMTicket(ticketGuid); + GM_Ticket *ticket = sTicketMgr->GetGMTicket(ticketGuid); if (!ticket || ticket->closed != 0) { @@ -260,9 +260,9 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args) return true; } - uint64 tarGUID = sObjectMgr.GetPlayerGUIDByName(targm.c_str()); - uint64 accid = sObjectMgr.GetPlayerAccountIdByGUID(tarGUID); - uint32 gmlevel = sAccountMgr.GetSecurity(accid, realmID); + uint64 tarGUID = sObjectMgr->GetPlayerGUIDByName(targm.c_str()); + uint64 accid = sObjectMgr->GetPlayerAccountIdByGUID(tarGUID); + uint32 gmlevel = sAccountMgr->GetSecurity(accid, realmID); if (!tarGUID || gmlevel == SEC_PLAYER) { @@ -277,7 +277,7 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args) } std::string gmname; - sObjectMgr.GetPlayerNameByGUID(tarGUID, gmname); + sObjectMgr->GetPlayerNameByGUID(tarGUID, gmname); if (ticket->assignedToGM != 0 && ticket->assignedToGM != cplr->GetGUID()) { PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->guid, gmname.c_str()); @@ -291,7 +291,7 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args) else if (ticket->escalated == TICKET_UNASSIGNED) ticket->escalated = TICKET_ASSIGNED; - sTicketMgr.AddOrUpdateGMTicket(*ticket); + sTicketMgr->AddOrUpdateGMTicket(*ticket); std::stringstream ss; ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, ticket->guid); @@ -299,7 +299,7 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args) ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str()); SendGlobalGMSysMessage(ss.str().c_str()); - sTicketMgr.UpdateLastChange(); + sTicketMgr->UpdateLastChange(); return true; } @@ -310,7 +310,7 @@ bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args) uint64 ticketGuid = atoi(args); Player *cplr = m_session->GetPlayer(); - GM_Ticket *ticket = sTicketMgr.GetGMTicket(ticketGuid); + GM_Ticket *ticket = sTicketMgr->GetGMTicket(ticketGuid); if (!ticket|| ticket->closed != 0) { @@ -324,8 +324,8 @@ bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args) } std::string gmname; - sObjectMgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname); - Player *plr = sObjectMgr.GetPlayer(ticket->assignedToGM); + sObjectMgr->GetPlayerNameByGUID(ticket->assignedToGM, gmname); + Player *plr = sObjectMgr->GetPlayer(ticket->assignedToGM); if (plr && plr->IsInWorld() && plr->GetSession()->GetSecurity() > cplr->GetSession()->GetSecurity()) { SendSysMessage(LANG_COMMAND_TICKETUNASSIGNSECURITY); @@ -341,8 +341,8 @@ bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args) ticket->assignedToGM = 0; if (ticket->escalated != TICKET_UNASSIGNED && ticket->escalated != TICKET_IN_ESCALATION_QUEUE) ticket->escalated--; - sTicketMgr.AddOrUpdateGMTicket(*ticket); - sTicketMgr.UpdateLastChange(); + sTicketMgr->AddOrUpdateGMTicket(*ticket); + sTicketMgr->UpdateLastChange(); return true; } @@ -359,7 +359,7 @@ bool ChatHandler::HandleGMTicketCommentCommand(const char* args) return false; Player *cplr = m_session->GetPlayer(); - GM_Ticket *ticket = sTicketMgr.GetGMTicket(ticketGuid); + GM_Ticket *ticket = sTicketMgr->GetGMTicket(ticketGuid); if (!ticket || ticket->closed != 0) { @@ -373,19 +373,19 @@ bool ChatHandler::HandleGMTicketCommentCommand(const char* args) } std::string gmname; - sObjectMgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname); + sObjectMgr->GetPlayerNameByGUID(ticket->assignedToGM, gmname); ticket->comment = comment; - sTicketMgr.AddOrUpdateGMTicket(*ticket); + sTicketMgr->AddOrUpdateGMTicket(*ticket); std::stringstream ss; ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, ticket->guid); ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str()); - if (sObjectMgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname)) + if (sObjectMgr->GetPlayerNameByGUID(ticket->assignedToGM, gmname)) ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str()); ss << PGetParseString(LANG_COMMAND_TICKETLISTADDCOMMENT, cplr->GetName(), ticket->comment.c_str()); SendGlobalGMSysMessage(ss.str().c_str()); - sTicketMgr.UpdateLastChange(); + sTicketMgr->UpdateLastChange(); return true; } @@ -394,7 +394,7 @@ bool ChatHandler::HandleGMTicketDeleteByIdCommand(const char* args) if (!*args) return false; uint64 ticketGuid = atoi(args); - GM_Ticket *ticket = sTicketMgr.GetGMTicket(ticketGuid); + GM_Ticket *ticket = sTicketMgr->GetGMTicket(ticketGuid); if (!ticket) { @@ -412,8 +412,8 @@ bool ChatHandler::HandleGMTicketDeleteByIdCommand(const char* args) ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str()); ss << PGetParseString(LANG_COMMAND_TICKETDELETED, m_session->GetPlayer()->GetName()); SendGlobalGMSysMessage(ss.str().c_str()); - Player *plr = sObjectMgr.GetPlayer(ticket->playerGuid); - sTicketMgr.RemoveGMTicket(ticket, -1, true); // we don't need to care about who deleted it... + Player *plr = sObjectMgr->GetPlayer(ticket->playerGuid); + sTicketMgr->RemoveGMTicket(ticket, -1, true); // we don't need to care about who deleted it... if (plr && plr->IsInWorld()) { // Force abandon ticket @@ -423,14 +423,14 @@ bool ChatHandler::HandleGMTicketDeleteByIdCommand(const char* args) } ticket = NULL; - sTicketMgr.UpdateLastChange(); + sTicketMgr->UpdateLastChange(); return true; } bool ChatHandler::HandleToggleGMTicketSystem(const char* /* args */) { - sTicketMgr.SetStatus(!sTicketMgr.GetStatus()); - if(sTicketMgr.GetStatus()) + sTicketMgr->SetStatus(!sTicketMgr->GetStatus()); + if (sTicketMgr->GetStatus()) PSendSysMessage(LANG_ALLOW_TICKETS); else PSendSysMessage(LANG_DISALLOW_TICKETS); @@ -444,7 +444,7 @@ bool ChatHandler::HandleGMTicketEscalateCommand(const char *args) return false; uint64 tguid = atoi(args); - GM_Ticket *ticket = sTicketMgr.GetGMTicket(tguid); + GM_Ticket *ticket = sTicketMgr->GetGMTicket(tguid); if (!ticket || ticket->closed != 0 || ticket->completed || ticket->escalated != TICKET_UNASSIGNED) { SendSysMessage(LANG_COMMAND_TICKETNOTEXIST); @@ -453,10 +453,10 @@ bool ChatHandler::HandleGMTicketEscalateCommand(const char *args) ticket->escalated = TICKET_IN_ESCALATION_QUEUE; - Player *plr = sObjectMgr.GetPlayer(ticket->playerGuid); + Player *plr = sObjectMgr->GetPlayer(ticket->playerGuid); if (plr && plr->IsInWorld()) plr->GetSession()->SendGMTicketGetTicket(GMTICKET_STATUS_HASTEXT, ticket->message.c_str(), ticket); - sTicketMgr.UpdateLastChange(); + sTicketMgr->UpdateLastChange(); return true; } @@ -466,17 +466,17 @@ bool ChatHandler::HandleGMTicketCompleteCommand(const char* args) return false; uint64 tguid = atoi(args); - GM_Ticket *ticket = sTicketMgr.GetGMTicket(tguid); + GM_Ticket *ticket = sTicketMgr->GetGMTicket(tguid); if (!ticket || ticket->closed != 0 || ticket->completed) { SendSysMessage(LANG_COMMAND_TICKETNOTEXIST); return true; } - Player *plr = sObjectMgr.GetPlayer(ticket->playerGuid); + Player *plr = sObjectMgr->GetPlayer(ticket->playerGuid); if (plr && plr->IsInWorld()) plr->GetSession()->SendGMTicketResponse(ticket); - sTicketMgr.UpdateLastChange(); + sTicketMgr->UpdateLastChange(); return true; } @@ -492,7 +492,7 @@ bool ChatHandler::HandleGMTicketResponseAppendCommand(const char* args) if (!response) return false; - GM_Ticket *ticket = sTicketMgr.GetGMTicket(ticketGuid); + GM_Ticket *ticket = sTicketMgr->GetGMTicket(ticketGuid); Player *cplr = m_session->GetPlayer(); if (!ticket || ticket->closed != 0) @@ -511,7 +511,7 @@ bool ChatHandler::HandleGMTicketResponseAppendCommand(const char* args) ss << ticket->response; ss << response; ticket->response = ss.str(); - sTicketMgr.AddOrUpdateGMTicket(*ticket); + sTicketMgr->AddOrUpdateGMTicket(*ticket); return true; } @@ -527,7 +527,7 @@ bool ChatHandler::HandleGMTicketResponseAppendLnCommand(const char* args) if (!response) return false; - GM_Ticket *ticket = sTicketMgr.GetGMTicket(ticketGuid); + GM_Ticket *ticket = sTicketMgr->GetGMTicket(ticketGuid); Player *cplr = m_session->GetPlayer(); if (!ticket || ticket->closed != 0) @@ -547,6 +547,6 @@ bool ChatHandler::HandleGMTicketResponseAppendLnCommand(const char* args) ss << response; ss << "\n"; ticket->response = ss.str(); - sTicketMgr.AddOrUpdateGMTicket(*ticket); + sTicketMgr->AddOrUpdateGMTicket(*ticket); return true; } diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 9f1e5b15952..2b4a19f0a1a 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -110,7 +110,7 @@ bool Condition::Meets(Player * player, Unit* invoker) condMeets = !player->HasAuraEffect(mConditionValue1, mConditionValue2); break; case CONDITION_ACTIVE_EVENT: - condMeets = sGameEventMgr.IsActiveEvent(mConditionValue1); + condMeets = sGameEventMgr->IsActiveEvent(mConditionValue1); break; case CONDITION_INSTANCE_DATA: { @@ -219,8 +219,8 @@ bool Condition::Meets(Player * player, Unit* invoker) bool refMeets = false; if (condMeets && refId)//only have to check references if 'this' is met { - ConditionList ref = sConditionMgr.GetConditionReferences(refId); - refMeets = sConditionMgr.IsPlayerMeetToConditions(player, ref); + ConditionList ref = sConditionMgr->GetConditionReferences(refId); + refMeets = sConditionMgr->IsPlayerMeetToConditions(player, ref); } else refMeets = true; @@ -228,7 +228,7 @@ bool Condition::Meets(Player * player, Unit* invoker) if (sendErrorMsg && ErrorTextd && (!condMeets || !refMeets))//send special error from DB player->m_ConditionErrorMsgId = ErrorTextd; - bool script = sScriptMgr.OnConditionCheck(this, player, invoker); // Returns true by default. + bool script = sScriptMgr->OnConditionCheck(this, player, invoker); // Returns true by default. return condMeets && refMeets && script; } @@ -369,10 +369,10 @@ void ConditionMgr::LoadConditions(bool isReload) LootTemplates_Spell.ResetConditions(); sLog.outString("Re-Loading `gossip_menu` Table for Conditions!"); - sObjectMgr.LoadGossipMenu(); + sObjectMgr->LoadGossipMenu(); sLog.outString("Re-Loading `gossip_menu_option` Table for Conditions!"); - sObjectMgr.LoadGossipMenuItems(); + sObjectMgr->LoadGossipMenuItems(); } @@ -403,7 +403,7 @@ void ConditionMgr::LoadConditions(bool isReload) cond->mConditionValue2 = fields[6].GetUInt32(); cond->mConditionValue3 = fields[7].GetUInt32(); cond->ErrorTextd = fields[8].GetUInt32(); - cond->mScriptId = sObjectMgr.GetScriptId(fields[9].GetCString()); + cond->mScriptId = sObjectMgr->GetScriptId(fields[9].GetCString()); if (iConditionTypeOrReference >= 0) cond->mConditionType = ConditionType(iConditionTypeOrReference); @@ -594,7 +594,7 @@ bool ConditionMgr::addToLootTemplate(Condition* cond, LootTemplate* loot) bool ConditionMgr::addToGossipMenus(Condition* cond) { - GossipMenusMapBoundsNonConst pMenuBounds = sObjectMgr.GetGossipMenusMapBoundsNonConst(cond->mSourceGroup); + GossipMenusMapBoundsNonConst pMenuBounds = sObjectMgr->GetGossipMenusMapBoundsNonConst(cond->mSourceGroup); if (pMenuBounds.first != pMenuBounds.second) { @@ -614,7 +614,7 @@ bool ConditionMgr::addToGossipMenus(Condition* cond) bool ConditionMgr::addToGossipMenuItems(Condition* cond) { - GossipMenuItemsMapBoundsNonConst pMenuItemBounds = sObjectMgr.GetGossipMenuItemsMapBoundsNonConst(cond->mSourceGroup); + GossipMenuItemsMapBoundsNonConst pMenuItemBounds = sObjectMgr->GetGossipMenuItemsMapBoundsNonConst(cond->mSourceGroup); if (pMenuItemBounds.first != pMenuItemBounds.second) { for (GossipMenuItemsMap::iterator itr = pMenuItemBounds.first; itr != pMenuItemBounds.second; ++itr) @@ -947,7 +947,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) if (pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE || pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE) { - ConditionList conditions = sConditionMgr.GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, pSpellInfo->Id);//script loading is done before item target loading + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, pSpellInfo->Id);//script loading is done before item target loading if (!conditions.empty()) break; @@ -979,7 +979,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) } case CONDITION_SOURCE_TYPE_QUEST_ACCEPT: { - Quest const *Quest = sObjectMgr.GetQuestTemplate(cond->mSourceEntry); + Quest const *Quest = sObjectMgr->GetQuestTemplate(cond->mSourceEntry); if (!Quest) { sLog.outErrorDb("CONDITION_SOURCE_TYPE_QUEST_ACCEPT specifies non-existing quest (%u), skipped", cond->mSourceEntry); @@ -989,7 +989,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) break; case CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK: { - Quest const *Quest = sObjectMgr.GetQuestTemplate(cond->mSourceEntry); + Quest const *Quest = sObjectMgr->GetQuestTemplate(cond->mSourceEntry); if (!Quest) { sLog.outErrorDb("CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK specifies non-existing quest (%u), skipped", cond->mSourceEntry); @@ -1137,7 +1137,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) case CONDITION_QUEST_NONE: case CONDITION_QUEST_COMPLETE: { - Quest const *Quest = sObjectMgr.GetQuestTemplate(cond->mConditionValue1); + Quest const *Quest = sObjectMgr->GetQuestTemplate(cond->mConditionValue1); if (!Quest) { sLog.outErrorDb("Quest condition specifies non-existing quest (%u), skipped", cond->mConditionValue1); @@ -1165,7 +1165,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) } case CONDITION_ACTIVE_EVENT: { - GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap(); + GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap(); if (cond->mConditionValue1 >=events.size() || !events[cond->mConditionValue1].isValid()) { sLog.outErrorDb("Active event condition has non existing event id (%u), skipped", cond->mConditionValue1); diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 538b4e92f1b..5afc6906d11 100755 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -191,6 +191,6 @@ class ConditionMgr std::list<Condition*> m_AllocatedMemory; // some garbage collection :) }; -#define sConditionMgr (*ACE_Singleton<ConditionMgr, ACE_Null_Mutex>::instance()) +#define sConditionMgr ACE_Singleton<ConditionMgr, ACE_Null_Mutex>::instance() #endif diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp index 8c2a14cd159..77b8ad85050 100755 --- a/src/server/game/Conditions/DisableMgr.cpp +++ b/src/server/game/Conditions/DisableMgr.cpp @@ -198,7 +198,7 @@ void DisableMgr::CheckQuestDisables() for (DisableTypeMap::iterator itr = m_DisableMap[DISABLE_TYPE_QUEST].begin(); itr != m_DisableMap[DISABLE_TYPE_QUEST].end();) { const uint32 entry = itr->first; - if (!sObjectMgr.GetQuestTemplate(entry)) + if (!sObjectMgr->GetQuestTemplate(entry)) { sLog.outErrorDb("Quest entry %u from `disables` doesn't exist, skipped.", entry); m_DisableMap[DISABLE_TYPE_QUEST].erase(itr++); diff --git a/src/server/game/Conditions/DisableMgr.h b/src/server/game/Conditions/DisableMgr.h index f0d81766b00..26c3f187030 100755 --- a/src/server/game/Conditions/DisableMgr.h +++ b/src/server/game/Conditions/DisableMgr.h @@ -73,6 +73,6 @@ class DisableMgr DisableMap m_DisableMap; }; -#define sDisableMgr (*ACE_Singleton<DisableMgr, ACE_Null_Mutex>::instance()) +#define sDisableMgr ACE_Singleton<DisableMgr, ACE_Null_Mutex>::instance() #endif //TRINITY_DISABLEMGR_H diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 00c070ca6f5..fa6f37f9201 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -449,7 +449,7 @@ void LoadDBCStores(const std::string& dataPath) continue; for (int x = 0; x < MAX_DIFFICULTY; ++x) - sSpellMgr.SetSpellDifficultyId(uint32(newEntry.SpellID[x]), spellDiff->ID); + sSpellMgr->SetSpellDifficultyId(uint32(newEntry.SpellID[x]), spellDiff->ID); } // create talent spells set diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index c7fe7249b28..ec4a18075ca 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -172,13 +172,13 @@ void LFGMgr::LoadRewards() maxLevel = sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL); } - if (firstQuestId && !sObjectMgr.GetQuestTemplate(firstQuestId)) + if (firstQuestId && !sObjectMgr->GetQuestTemplate(firstQuestId)) { sLog.outErrorDb("First quest %u specified for dungeon %u in table `lfg_dungeon_rewards` does not exist!", firstQuestId, dungeonId); firstQuestId = 0; } - if (otherQuestId && !sObjectMgr.GetQuestTemplate(otherQuestId)) + if (otherQuestId && !sObjectMgr->GetQuestTemplate(otherQuestId)) { sLog.outErrorDb("Other quest %u specified for dungeon %u in table `lfg_dungeon_rewards` does not exist!", otherQuestId, dungeonId); otherQuestId = 0; @@ -217,7 +217,7 @@ void LFGMgr::Update(uint32 diff) { uint64 guid = itRoles->first; ClearState(guid); - if (Player* plr = sObjectMgr.GetPlayer(guid)) + if (Player* plr = sObjectMgr->GetPlayer(guid)) { plr->GetSession()->SendLfgRoleCheckUpdate(pRoleCheck); @@ -246,7 +246,7 @@ void LFGMgr::Update(uint32 diff) { pBoot->inProgress = false; for (LfgAnswerMap::const_iterator itVotes = pBoot->votes.begin(); itVotes != pBoot->votes.end(); ++itVotes) - if (Player* plrg = sObjectMgr.GetPlayer(itVotes->first)) + if (Player* plrg = sObjectMgr->GetPlayer(itVotes->first)) if (plrg->GetGUID() != pBoot->victim) plrg->GetSession()->SendLfgBootPlayer(pBoot); delete pBoot; @@ -280,7 +280,7 @@ void LFGMgr::Update(uint32 diff) { guid = itPlayers->first; SetState(guid, LFG_STATE_PROPOSAL); - if (Player* plr = sObjectMgr.GetPlayer(itPlayers->first)) + if (Player* plr = sObjectMgr->GetPlayer(itPlayers->first)) { Group *grp = plr->GetGroup(); LfgDungeonSet dungeons = GetSelectedDungeons(guid); @@ -350,7 +350,7 @@ void LFGMgr::Update(uint32 diff) } for (LfgRolesMap::const_iterator itPlayer = queue->roles.begin(); itPlayer != queue->roles.end(); ++itPlayer) - if (Player* plr = sObjectMgr.GetPlayer(itPlayer->first)) + if (Player* plr = sObjectMgr->GetPlayer(itPlayer->first)) plr->GetSession()->SendLfgQueueStatus(dungeonId, waitTime, m_WaitTimeAvg, m_WaitTimeTank, m_WaitTimeHealer, m_WaitTimeDps, queuedTime, queue->tanks, queue->healers, queue->dps); } } @@ -437,12 +437,12 @@ void LFGMgr::InitializeLockedDungeons(Player* plr) if (!dungeon) // should never happen - We provide a list from sLFGDungeonStore continue; - AccessRequirement const* ar = sObjectMgr.GetAccessRequirement(dungeon->map, Difficulty(dungeon->difficulty)); + AccessRequirement const* ar = sObjectMgr->GetAccessRequirement(dungeon->map, Difficulty(dungeon->difficulty)); LfgLockStatusType locktype = LFG_LOCKSTATUS_OK; if (dungeon->expansion > expansion) locktype = LFG_LOCKSTATUS_INSUFFICIENT_EXPANSION; - else if (sDisableMgr.IsDisabledFor(DISABLE_TYPE_MAP, dungeon->map, plr)) + else if (sDisableMgr->IsDisabledFor(DISABLE_TYPE_MAP, dungeon->map, plr)) locktype = LFG_LOCKSTATUS_RAID_LOCKED; else if (dungeon->difficulty > DUNGEON_DIFFICULTY_NORMAL && plr->GetBoundInstance(dungeon->map, Difficulty(dungeon->difficulty))) locktype = LFG_LOCKSTATUS_RAID_LOCKED; @@ -789,7 +789,7 @@ void LFGMgr::OfferContinue(Group* grp) if (grp) { uint64 gguid = grp->GetGUID(); - if (Player* leader = sObjectMgr.GetPlayer(grp->GetLeaderGUID())) + if (Player* leader = sObjectMgr->GetPlayer(grp->GetLeaderGUID())) leader->GetSession()->SendLfgOfferContinue(GetDungeon(gguid, false)); } } @@ -888,7 +888,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) if (IS_GROUP(guid)) { uint32 lowGuid = GUID_LOPART(guid); - if (Group* grp = sObjectMgr.GetGroupByGUID(lowGuid)) + if (Group* grp = sObjectMgr->GetGroupByGUID(lowGuid)) if (grp->isLFGGroup()) { if (!numLfgGroups) @@ -933,7 +933,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) PlayerSet players; for (LfgRolesMap::const_iterator it = rolesMap.begin(); it != rolesMap.end(); ++it) { - Player* plr = sObjectMgr.GetPlayer(it->first); + Player* plr = sObjectMgr->GetPlayer(it->first); if (!plr) sLog.outDebug("LFGMgr::CheckCompatibility: (%s) Warning! [" UI64FMTD "] offline! Marking as not compatibles!", strGuids.c_str(), it->first); else @@ -1344,7 +1344,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, const uint64& guid, bool accept) bool allAnswered = true; for (LfgProposalPlayerMap::const_iterator itPlayers = pProposal->players.begin(); itPlayers != pProposal->players.end(); ++itPlayers) { - if (Player* plr = sObjectMgr.GetPlayer(itPlayers->first)) + if (Player* plr = sObjectMgr->GetPlayer(itPlayers->first)) { if (itPlayers->first == pProposal->leader) players.push_front(plr); @@ -1394,7 +1394,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, const uint64& guid, bool accept) // Create a new group (if needed) LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_GROUP_FOUND); - Group* grp = pProposal->groupLowGuid ? sObjectMgr.GetGroupByGUID(pProposal->groupLowGuid) : NULL; + Group* grp = pProposal->groupLowGuid ? sObjectMgr->GetGroupByGUID(pProposal->groupLowGuid) : NULL; for (LfgPlayerList::const_iterator it = players.begin(); it != players.end(); ++it) { Player* plr = (*it); @@ -1418,7 +1418,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, const uint64& guid, bool accept) grp->ConvertToLFG(); uint64 gguid = grp->GetGUID(); SetState(gguid, LFG_STATE_PROPOSAL); - sObjectMgr.AddGroup(grp); + sObjectMgr->AddGroup(grp); } else if (group != grp) grp->AddMember(pguid, plr->GetName()); @@ -1510,7 +1510,7 @@ void LFGMgr::RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType t // Notify players for (LfgProposalPlayerMap::const_iterator it = pProposal->players.begin(); it != pProposal->players.end(); ++it) { - Player* plr = sObjectMgr.GetPlayer(it->first); + Player* plr = sObjectMgr->GetPlayer(it->first); if (!plr) continue; @@ -1679,7 +1679,7 @@ void LFGMgr::UpdateBoot(Player* plr, bool accept) if (pguid != pBoot->victim) { SetState(pguid, LFG_STATE_DUNGEON); - if (Player* plrg = sObjectMgr.GetPlayer(pguid)) + if (Player* plrg = sObjectMgr->GetPlayer(pguid)) plrg->GetSession()->SendLfgBootPlayer(pBoot); } } @@ -1689,7 +1689,7 @@ void LFGMgr::UpdateBoot(Player* plr, bool accept) if (agreeNum == pBoot->votedNeeded) // Vote passed - Kick player { Player::RemoveFromGroup(grp, pBoot->victim); - if (Player* victim = sObjectMgr.GetPlayer(pBoot->victim)) + if (Player* victim = sObjectMgr->GetPlayer(pBoot->victim)) { TeleportPlayer(victim, true, false); SetState(pBoot->victim, LFG_STATE_NONE); @@ -1764,7 +1764,7 @@ void LFGMgr::TeleportPlayer(Player* plr, bool out, bool fromOpcode /*= false*/) if (!mapid) { - AreaTrigger const* at = sObjectMgr.GetMapEntranceTrigger(dungeon->map); + AreaTrigger const* at = sObjectMgr->GetMapEntranceTrigger(dungeon->map); if (!at) { sLog.outError("LfgMgr::TeleportPlayer: Failed to teleport [" UI64FMTD "]: No areatrigger found for map: %u difficulty: %u", plr->GetGUID(), dungeon->map, dungeon->difficulty); @@ -1856,7 +1856,7 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 /*dungeonId*/, Player* player) return; uint8 index = 0; - Quest const* qReward = sObjectMgr.GetQuestTemplate(reward->reward[index].questId); + Quest const* qReward = sObjectMgr->GetQuestTemplate(reward->reward[index].questId); if (!qReward) return; @@ -1866,7 +1866,7 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 /*dungeonId*/, Player* player) else { index = 1; - qReward = sObjectMgr.GetQuestTemplate(reward->reward[index].questId); + qReward = sObjectMgr->GetQuestTemplate(reward->reward[index].questId); if (!qReward) return; // we give reward without informing client (retail does this) diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index 82748e3da29..99bad5a6f73 100755 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -361,5 +361,5 @@ class LFGMgr LfgGroupDataMap m_Groups; ///< Group data }; -#define sLFGMgr (*ACE_Singleton<LFGMgr, ACE_Null_Mutex>::instance()) +#define sLFGMgr ACE_Singleton<LFGMgr, ACE_Null_Mutex>::instance() #endif diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp index f7f597767be..bedf2e7c43e 100644 --- a/src/server/game/DungeonFinding/LFGScripts.cpp +++ b/src/server/game/DungeonFinding/LFGScripts.cpp @@ -47,12 +47,12 @@ void LFGScripts::OnAddMember(Group* group, uint64 guid) } // TODO - if group is queued and new player is added convert to rolecheck without notify the current players queued - if (sLFGMgr.GetState(gguid) == LFG_STATE_QUEUED) - sLFGMgr.Leave(NULL, group); + if (sLFGMgr->GetState(gguid) == LFG_STATE_QUEUED) + sLFGMgr->Leave(NULL, group); - if (sLFGMgr.GetState(guid) == LFG_STATE_QUEUED) - if (Player *plr = sObjectMgr.GetPlayer(guid)) - sLFGMgr.Leave(plr); + if (sLFGMgr->GetState(guid) == LFG_STATE_QUEUED) + if (Player *plr = sObjectMgr->GetPlayer(guid)) + sLFGMgr->Leave(plr); } void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod& method, uint64 kicker, const char* reason) @@ -62,10 +62,10 @@ void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod& method, return; sLog.outDebug("LFGScripts::OnRemoveMember [" UI64FMTD "]: remove [" UI64FMTD "] Method: %d Kicker: [" UI64FMTD "] Reason: %s", gguid, guid, method, kicker, (reason ? reason : "")); - if (sLFGMgr.GetState(gguid) == LFG_STATE_QUEUED) + if (sLFGMgr->GetState(gguid) == LFG_STATE_QUEUED) { // TODO - Do not remove, just remove the one leaving and rejoin queue with all other data - sLFGMgr.Leave(NULL, group); + sLFGMgr->Leave(NULL, group); } if (!group->isLFGGroup()) @@ -77,12 +77,12 @@ void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod& method, std::string str_reason = ""; if (reason) str_reason = std::string(reason); - sLFGMgr.InitBoot(group, kicker, guid, str_reason); + sLFGMgr->InitBoot(group, kicker, guid, str_reason); return; } - sLFGMgr.ClearState(guid); - if (Player *plr = sObjectMgr.GetPlayer(guid)) + sLFGMgr->ClearState(guid); + if (Player *plr = sObjectMgr->GetPlayer(guid)) { /* if (method == GROUP_REMOVEMETHOD_LEAVE) @@ -94,11 +94,11 @@ void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod& method, LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_LEADER); plr->GetSession()->SendLfgUpdateParty(updateData); if (plr->GetMap()->IsDungeon()) // Teleport player out the dungeon - sLFGMgr.TeleportPlayer(plr, true); + sLFGMgr->TeleportPlayer(plr, true); } - if (sLFGMgr.GetState(gguid) != LFG_STATE_FINISHED_DUNGEON)// Need more players to finish the dungeon - sLFGMgr.OfferContinue(group); + if (sLFGMgr->GetState(gguid) != LFG_STATE_FINISHED_DUNGEON)// Need more players to finish the dungeon + sLFGMgr->OfferContinue(group); } void LFGScripts::OnDisband(Group* group) @@ -106,7 +106,7 @@ void LFGScripts::OnDisband(Group* group) uint64 gguid = group->GetGUID(); sLog.outDebug("LFGScripts::OnDisband [" UI64FMTD "]", gguid); - sLFGMgr.RemoveGroupData(gguid); + sLFGMgr->RemoveGroupData(gguid); } void LFGScripts::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid) @@ -116,14 +116,14 @@ void LFGScripts::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLe return; sLog.outDebug("LFGScripts::OnChangeLeader [" UI64FMTD "]: old [" UI64FMTD "] new [" UI64FMTD "]", gguid, newLeaderGuid, oldLeaderGuid); - Player *plr = sObjectMgr.GetPlayer(newLeaderGuid); + Player *plr = sObjectMgr->GetPlayer(newLeaderGuid); LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_LEADER); if (plr) plr->GetSession()->SendLfgUpdateParty(updateData); - plr = sObjectMgr.GetPlayer(oldLeaderGuid); + plr = sObjectMgr->GetPlayer(oldLeaderGuid); if (plr) { updateData.updateType = LFG_UPDATETYPE_GROUP_DISBAND; @@ -138,7 +138,7 @@ void LFGScripts::OnInviteMember(Group* group, uint64 guid) return; sLog.outDebug("LFGScripts::OnInviteMember [" UI64FMTD "]: invite [" UI64FMTD "] leader [" UI64FMTD "]", gguid, guid, group->GetLeaderGUID()); - sLFGMgr.Leave(NULL, group); + sLFGMgr->Leave(NULL, group); } void LFGScripts::OnLevelChanged(Player* /*player*/, uint8 /*newLevel*/) @@ -148,18 +148,18 @@ void LFGScripts::OnLevelChanged(Player* /*player*/, uint8 /*newLevel*/) void LFGScripts::OnLogout(Player* player) { - sLFGMgr.Leave(player); + sLFGMgr->Leave(player); LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_REMOVED_FROM_QUEUE); player->GetSession()->SendLfgUpdateParty(updateData); player->GetSession()->SendLfgUpdatePlayer(updateData); player->GetSession()->SendLfgUpdateSearch(false); uint64 guid = player->GetGUID(); // TODO - Do not remove, add timer before deleting - sLFGMgr.RemovePlayerData(guid); + sLFGMgr->RemovePlayerData(guid); } void LFGScripts::OnLogin(Player* player) { - sLFGMgr.InitializeLockedDungeons(player); + sLFGMgr->InitializeLockedDungeons(player); // TODO - Restore LfgPlayerData and send proper status to player if it was in a group } diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 0b730f85b27..3cf4d08e841 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -128,7 +128,7 @@ bool AssistDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) CreatureBaseStats const* CreatureBaseStats::GetBaseStats(uint8 level, uint8 unitClass) { - return sObjectMgr.GetCreatureBaseStats(level, unitClass); + return sObjectMgr->GetCreatureBaseStats(level, unitClass); } bool ForcedDespawnDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) @@ -302,8 +302,8 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data return false; } - uint32 display_id = sObjectMgr.ChooseDisplayId(0, GetCreatureInfo(), data); - CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id); + uint32 display_id = sObjectMgr->ChooseDisplayId(0, GetCreatureInfo(), data); + CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(display_id); if (!minfo) // Cancel load if no model defined { sLog.outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ",Entry); @@ -373,7 +373,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data) ObjectMgr::ChooseCreatureFlags(cInfo, npcflag, unit_flags, dynamicflags, data); if (cInfo->flags_extra & CREATURE_FLAG_EXTRA_WORLDEVENT) - SetUInt32Value(UNIT_NPC_FLAGS, npcflag | sGameEventMgr.GetNPCFlag(this)); + SetUInt32Value(UNIT_NPC_FLAGS, npcflag | sGameEventMgr->GetNPCFlag(this)); else SetUInt32Value(UNIT_NPC_FLAGS, npcflag); @@ -388,7 +388,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data) RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); SetMeleeDamageSchool(SpellSchools(cInfo->dmgschool)); - CreatureBaseStats const* stats = sObjectMgr.GetCreatureBaseStats(getLevel(), cInfo->unit_class); + CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(getLevel(), cInfo->unit_class); float armor = (float)stats->GenerateArmor(cInfo); // TODO: Why is this treated as uint32 when it's a float? SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, armor); SetModifierValue(UNIT_MOD_RESISTANCE_HOLY, BASE_VALUE, float(cInfo->resistance1)); @@ -463,7 +463,7 @@ void Creature::Update(uint32 diff) Respawn(); else // the master is dead { - if (uint32 targetGuid = sObjectMgr.GetLinkedRespawnGuid(m_DBTableGuid)) + if (uint32 targetGuid = sObjectMgr->GetLinkedRespawnGuid(m_DBTableGuid)) { if (targetGuid == m_DBTableGuid) // if linking self, never respawn (check delayed to next day) SetRespawnTime(DAY); @@ -489,7 +489,7 @@ void Creature::Update(uint32 diff) if (m_groupLootTimer <= diff) { - Group* group = sObjectMgr.GetGroupByGUID(lootingGroupLowGUID); + Group* group = sObjectMgr->GetGroupByGUID(lootingGroupLowGUID); if (group) group->EndRoll(&loot); m_groupLootTimer = 0; @@ -593,7 +593,7 @@ void Creature::Update(uint32 diff) break; } - sScriptMgr.OnCreatureUpdate(this, diff); + sScriptMgr->OnCreatureUpdate(this, diff); } void Creature::RegenerateMana() @@ -784,7 +784,7 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, break; } LoadCreaturesAddon(); - CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(GetNativeDisplayId()); + CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(GetNativeDisplayId()); if (minfo && !isTotem()) // Cancel load if no model defined or if totem { uint32 display_id = minfo->modelid; // it can be different (for another gender) @@ -918,7 +918,7 @@ bool Creature::isCanInteractWithBattleMaster(Player* pPlayer, bool msg) const if (!isBattleMaster()) return false; - BattlegroundTypeId bgTypeId = sBattlegroundMgr.GetBattleMasterBG(GetEntry()); + BattlegroundTypeId bgTypeId = sBattlegroundMgr->GetBattleMasterBG(GetEntry()); if (!msg) return pPlayer->GetBGAccessByLevel(bgTypeId); @@ -986,7 +986,7 @@ Group *Creature::GetLootRecipientGroup() const { if (!m_lootRecipientGroup) return NULL; - return sObjectMgr.GetGroupByGUID(m_lootRecipientGroup); + return sObjectMgr->GetGroupByGUID(m_lootRecipientGroup); } void Creature::SetLootRecipient(Unit *unit) @@ -1034,7 +1034,7 @@ void Creature::SaveToDB() { // this should only be used when the creature has already been loaded // preferably after adding to map, because mapid may not be valid otherwise - CreatureData const *data = sObjectMgr.GetCreatureData(m_DBTableGuid); + CreatureData const *data = sObjectMgr->GetCreatureData(m_DBTableGuid); if (!data) { sLog.outError("Creature::SaveToDB failed, cannot get creature data!"); @@ -1049,7 +1049,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) // update in loaded data if (!m_DBTableGuid) m_DBTableGuid = GetGUIDLow(); - CreatureData& data = sObjectMgr.NewOrExistCreatureData(m_DBTableGuid); + CreatureData& data = sObjectMgr->NewOrExistCreatureData(m_DBTableGuid); uint32 displayId = GetNativeDisplayId(); uint32 npcflag = GetUInt32Value(UNIT_NPC_FLAGS); @@ -1143,7 +1143,7 @@ void Creature::SelectLevel(const CreatureInfo *cinfo) uint8 level = minlevel == maxlevel ? minlevel : urand(minlevel, maxlevel); SetLevel(level); - CreatureBaseStats const* stats = sObjectMgr.GetCreatureBaseStats(level, cinfo->unit_class); + CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(level, cinfo->unit_class); // health float healthmod = _GetHealthMod(rank); @@ -1273,7 +1273,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint3 bool Creature::LoadFromDB(uint32 guid, Map *map) { - CreatureData const* data = sObjectMgr.GetCreatureData(guid); + CreatureData const* data = sObjectMgr->GetCreatureData(guid); if (!data) { @@ -1288,7 +1288,7 @@ bool Creature::LoadFromDB(uint32 guid, Map *map) return false; } else - guid = sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT); + guid = sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT); uint16 team = 0; if (!Create(guid,map,data->phaseMask,data->id,0,team,data->posX,data->posY,data->posZ,data->orientation,data)) @@ -1303,7 +1303,7 @@ bool Creature::LoadFromDB(uint32 guid, Map *map) m_isDeadByDefault = data->is_dead; m_deathState = m_isDeadByDefault ? DEAD : ALIVE; - m_respawnTime = sObjectMgr.GetCreatureRespawnTime(m_DBTableGuid,GetInstanceId()); + m_respawnTime = sObjectMgr->GetCreatureRespawnTime(m_DBTableGuid,GetInstanceId()); if (m_respawnTime) // respawn on Update { m_deathState = DEAD; @@ -1357,7 +1357,7 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force) return; } - EquipmentInfo const *einfo = sObjectMgr.GetEquipmentInfo(equip_entry); + EquipmentInfo const *einfo = sObjectMgr->GetEquipmentInfo(equip_entry); if (!einfo) return; @@ -1368,7 +1368,7 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force) bool Creature::hasQuest(uint32 quest_id) const { - QuestRelationBounds qr = sObjectMgr.GetCreatureQuestRelationBounds(GetEntry()); + QuestRelationBounds qr = sObjectMgr->GetCreatureQuestRelationBounds(GetEntry()); for (QuestRelations::const_iterator itr = qr.first; itr != qr.second; ++itr) { if (itr->second == quest_id) @@ -1379,7 +1379,7 @@ bool Creature::hasQuest(uint32 quest_id) const bool Creature::hasInvolvedQuest(uint32 quest_id) const { - QuestRelationBounds qir = sObjectMgr.GetCreatureQuestInvolvedRelationBounds(GetEntry()); + QuestRelationBounds qir = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(GetEntry()); for (QuestRelations::const_iterator itr = qir.first; itr != qir.second; ++itr) { if (itr->second == quest_id) @@ -1396,8 +1396,8 @@ void Creature::DeleteFromDB() return; } - sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0); - sObjectMgr.DeleteCreatureData(m_DBTableGuid); + sObjectMgr->SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0); + sObjectMgr->DeleteCreatureData(m_DBTableGuid); SQLTransaction trans = WorldDatabase.BeginTransaction(); trans->PAppend("DELETE FROM creature WHERE guid = '%u'", m_DBTableGuid); @@ -1587,7 +1587,7 @@ void Creature::Respawn(bool force) if (getDeathState() == DEAD) { if (m_DBTableGuid) - sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0); + sObjectMgr->SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0); sLog.outStaticDebug("Respawning..."); m_respawnTime = 0; @@ -1610,7 +1610,7 @@ void Creature::Respawn(bool force) else setDeathState(JUST_ALIVED); - CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(GetNativeDisplayId()); + CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(GetNativeDisplayId()); if (minfo) // Cancel load if no model defined { uint32 display_id = minfo->modelid; // it can be different (for another gender) @@ -1626,9 +1626,9 @@ void Creature::Respawn(bool force) if (IsAIEnabled) TriggerJustRespawned = true;//delay event to next tick so all creatures are created on the map before processing - uint32 poolid = GetDBTableGUIDLow() ? sPoolMgr.IsPartOfAPool<Creature>(GetDBTableGUIDLow()) : 0; + uint32 poolid = GetDBTableGUIDLow() ? sPoolMgr->IsPartOfAPool<Creature>(GetDBTableGUIDLow()) : 0; if (poolid) - sPoolMgr.UpdatePool<Creature>(poolid, GetDBTableGUIDLow()); + sPoolMgr->UpdatePool<Creature>(poolid, GetDBTableGUIDLow()); //Re-initialize reactstate that could be altered by movementgenerators InitializeReactState(); @@ -1970,7 +1970,7 @@ void Creature::SaveRespawnTime() if (isSummon() || !m_DBTableGuid || (m_creatureData && !m_creatureData->dbData)) return; - sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime); + sObjectMgr->SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime); } // this should not be called by petAI or @@ -2204,7 +2204,7 @@ void Creature::GetRespawnCoord(float &x, float &y, float &z, float* ori, float* { if (m_DBTableGuid) { - if (CreatureData const* data = sObjectMgr.GetCreatureData(GetDBTableGUIDLow())) + if (CreatureData const* data = sObjectMgr->GetCreatureData(GetDBTableGUIDLow())) { x = data->posX; y = data->posY; @@ -2271,7 +2271,7 @@ std::string Creature::GetAIName() const std::string Creature::GetScriptName() const { - return sObjectMgr.GetScriptName(GetScriptId()); + return sObjectMgr->GetScriptName(GetScriptId()); } uint32 Creature::GetScriptId() const @@ -2281,7 +2281,7 @@ uint32 Creature::GetScriptId() const VendorItemData const* Creature::GetVendorItems() const { - return sObjectMgr.GetNpcVendorItemList(GetEntry()); + return sObjectMgr->GetNpcVendorItemList(GetEntry()); } uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem) @@ -2358,7 +2358,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us TrainerSpellData const* Creature::GetTrainerSpells() const { - return sObjectMgr.GetNpcTrainerSpells(GetEntry()); + return sObjectMgr->GetNpcTrainerSpells(GetEntry()); } // overwrite WorldObject function for proper name localization @@ -2367,7 +2367,7 @@ const char* Creature::GetNameForLocaleIdx(LocaleConstant loc_idx) const if (loc_idx != DEFAULT_LOCALE) { uint8 uloc_idx = uint8(loc_idx); - CreatureLocale const *cl = sObjectMgr.GetCreatureLocale(GetEntry()); + CreatureLocale const *cl = sObjectMgr->GetCreatureLocale(GetEntry()); if (cl) { if (cl->Name.size() > uloc_idx && !cl->Name[uloc_idx].empty()) @@ -2383,8 +2383,8 @@ const CreatureData* Creature::GetLinkedRespawnCreatureData() const if (!m_DBTableGuid) // only hard-spawned creatures from DB can have a linked master return NULL; - if (uint32 targetGuid = sObjectMgr.GetLinkedRespawnGuid(m_DBTableGuid)) - return sObjectMgr.GetCreatureData(targetGuid); + if (uint32 targetGuid = sObjectMgr->GetLinkedRespawnGuid(m_DBTableGuid)) + return sObjectMgr->GetCreatureData(targetGuid); return NULL; } @@ -2395,18 +2395,18 @@ time_t Creature::GetLinkedCreatureRespawnTime() const if (!m_DBTableGuid) // only hard-spawned creatures from DB can have a linked master return 0; - if (uint32 targetGuid = sObjectMgr.GetLinkedRespawnGuid(m_DBTableGuid)) + if (uint32 targetGuid = sObjectMgr->GetLinkedRespawnGuid(m_DBTableGuid)) { Map* targetMap = NULL; - if (const CreatureData* data = sObjectMgr.GetCreatureData(targetGuid)) + if (const CreatureData* data = sObjectMgr->GetCreatureData(targetGuid)) { if (data->mapid == GetMapId()) // look up on the same map targetMap = GetMap(); else // it shouldn't be instanceable map here - targetMap = sMapMgr.FindMap(data->mapid); + targetMap = sMapMgr->FindMap(data->mapid); } if (targetMap) - return sObjectMgr.GetCreatureRespawnTime(targetGuid,targetMap->GetInstanceId()); + return sObjectMgr->GetCreatureRespawnTime(targetGuid,targetMap->GetInstanceId()); } return 0; diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index d0e2003895c..2fdf1f7e640 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -718,7 +718,7 @@ class Creature : public Unit, public GridObject<Creature> bool DisableReputationGain; - CreatureInfo const* m_creatureInfo; // in difficulty mode > 0 can different from sObjectMgr.::GetCreatureTemplate(GetEntry()) + CreatureInfo const* m_creatureInfo; // in difficulty mode > 0 can different from sObjectMgr->::GetCreatureTemplate(GetEntry()) CreatureData const* m_creatureData; uint16 m_LootMode; // bitmask, default LOOT_MODE_DEFAULT, determines what loot will be lootable diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index ad9bbd2ad86..e1463580495 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -160,7 +160,7 @@ void PlayerMenu::SendGossipMenu(uint32 TitleTextId, uint64 objectGUID) { QuestMenuItem const& qItem = mQuestMenu.GetItem(iI); uint32 questID = qItem.m_qId; - Quest const* pQuest = sObjectMgr.GetQuestTemplate(questID); + Quest const* pQuest = sObjectMgr->GetQuestTemplate(questID); data << uint32(questID); data << uint32(qItem.m_qIcon); @@ -171,8 +171,8 @@ void PlayerMenu::SendGossipMenu(uint32 TitleTextId, uint64 objectGUID) int loc_idx = pSession->GetSessionDbLocaleIndex(); if (loc_idx >= 0) - if (QuestLocale const *ql = sObjectMgr.GetQuestLocale(questID)) - sObjectMgr.GetLocaleString(ql->Title, loc_idx, Title); + if (QuestLocale const *ql = sObjectMgr->GetQuestLocale(questID)) + sObjectMgr->GetLocaleString(ql->Title, loc_idx, Title); data << Title; // max 0x200 } @@ -203,7 +203,7 @@ void PlayerMenu::SendPointOfInterest(float X, float Y, uint32 Icon, uint32 Flags void PlayerMenu::SendPointOfInterest(uint32 poi_id) { - PointOfInterest const* poi = sObjectMgr.GetPointOfInterest(poi_id); + PointOfInterest const* poi = sObjectMgr->GetPointOfInterest(poi_id); if (!poi) { sLog.outErrorDb("Request to send non-existing POI (Id: %u), ignored.",poi_id); @@ -214,8 +214,8 @@ void PlayerMenu::SendPointOfInterest(uint32 poi_id) int loc_idx = pSession->GetSessionDbLocaleIndex(); if (loc_idx >= 0) - if (PointOfInterestLocale const *pl = sObjectMgr.GetPointOfInterestLocale(poi_id)) - sObjectMgr.GetLocaleString(pl->IconName, loc_idx, icon_name); + if (PointOfInterestLocale const *pl = sObjectMgr->GetPointOfInterestLocale(poi_id)) + sObjectMgr->GetLocaleString(pl->IconName, loc_idx, icon_name); WorldPacket data(SMSG_GOSSIP_POI, (4+4+4+4+4+10)); // guess size data << uint32(poi->flags); @@ -231,7 +231,7 @@ void PlayerMenu::SendPointOfInterest(uint32 poi_id) void PlayerMenu::SendTalking(uint32 textID) { - GossipText const* pGossip = sObjectMgr.GetGossipText(textID); + GossipText const* pGossip = sObjectMgr->GetGossipText(textID); WorldPacket data(SMSG_NPC_TEXT_UPDATE, 100); // guess size data << textID; // can be < 0 @@ -263,12 +263,12 @@ void PlayerMenu::SendTalking(uint32 textID) int loc_idx = pSession->GetSessionDbLocaleIndex(); if (loc_idx >= 0) { - if (NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textID)) + if (NpcTextLocale const *nl = sObjectMgr->GetNpcTextLocale(textID)) { for (int i = 0; i < MAX_LOCALES; ++i) { - sObjectMgr.GetLocaleString(nl->Text_0[i], loc_idx, Text_0[i]); - sObjectMgr.GetLocaleString(nl->Text_1[i], loc_idx, Text_1[i]); + sObjectMgr->GetLocaleString(nl->Text_0[i], loc_idx, Text_0[i]); + sObjectMgr->GetLocaleString(nl->Text_1[i], loc_idx, Text_1[i]); } } } @@ -339,7 +339,7 @@ QuestMenu::~QuestMenu() void QuestMenu::AddMenuItem(uint32 QuestId, uint8 Icon) { - Quest const* qinfo = sObjectMgr.GetQuestTemplate(QuestId); + Quest const* qinfo = sObjectMgr->GetQuestTemplate(QuestId); if (!qinfo) return; ASSERT(m_qItems.size() <= GOSSIP_MAX_MENU_ITEMS); @@ -386,14 +386,14 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title uint32 questID = qmi.m_qId; - if (Quest const *pQuest = sObjectMgr.GetQuestTemplate(questID)) + if (Quest const *pQuest = sObjectMgr->GetQuestTemplate(questID)) { std::string title = pQuest->GetTitle(); int loc_idx = pSession->GetSessionDbLocaleIndex(); if (loc_idx >= 0) - if (QuestLocale const *ql = sObjectMgr.GetQuestLocale(questID)) - sObjectMgr.GetLocaleString(ql->Title, loc_idx, title); + if (QuestLocale const *ql = sObjectMgr->GetQuestLocale(questID)) + sObjectMgr->GetLocaleString(ql->Title, loc_idx, title); data << uint32(questID); data << uint32(qmi.m_qIcon); @@ -429,12 +429,12 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, uint64 npcGUID, int loc_idx = pSession->GetSessionDbLocaleIndex(); if (loc_idx >= 0) { - if (QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId())) + if (QuestLocale const *ql = sObjectMgr->GetQuestLocale(pQuest->GetQuestId())) { - sObjectMgr.GetLocaleString(ql->Title, loc_idx, Title); - sObjectMgr.GetLocaleString(ql->Details, loc_idx, Details); - sObjectMgr.GetLocaleString(ql->Objectives, loc_idx, Objectives); - sObjectMgr.GetLocaleString(ql->EndText, loc_idx, EndText); + sObjectMgr->GetLocaleString(ql->Title, loc_idx, Title); + sObjectMgr->GetLocaleString(ql->Details, loc_idx, Details); + sObjectMgr->GetLocaleString(ql->Objectives, loc_idx, Objectives); + sObjectMgr->GetLocaleString(ql->EndText, loc_idx, EndText); } } @@ -545,16 +545,16 @@ void PlayerMenu::SendQuestQueryResponse(Quest const *pQuest) int loc_idx = pSession->GetSessionDbLocaleIndex(); if (loc_idx >= 0) { - if (QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId())) + if (QuestLocale const *ql = sObjectMgr->GetQuestLocale(pQuest->GetQuestId())) { - sObjectMgr.GetLocaleString(ql->Title, loc_idx, Title); - sObjectMgr.GetLocaleString(ql->Details, loc_idx, Details); - sObjectMgr.GetLocaleString(ql->Objectives, loc_idx, Objectives); - sObjectMgr.GetLocaleString(ql->EndText, loc_idx, EndText); - sObjectMgr.GetLocaleString(ql->CompletedText, loc_idx, CompletedText); + sObjectMgr->GetLocaleString(ql->Title, loc_idx, Title); + sObjectMgr->GetLocaleString(ql->Details, loc_idx, Details); + sObjectMgr->GetLocaleString(ql->Objectives, loc_idx, Objectives); + sObjectMgr->GetLocaleString(ql->EndText, loc_idx, EndText); + sObjectMgr->GetLocaleString(ql->CompletedText, loc_idx, CompletedText); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - sObjectMgr.GetLocaleString(ql->ObjectiveText[i], loc_idx, ObjectiveText[i]); + sObjectMgr->GetLocaleString(ql->ObjectiveText[i], loc_idx, ObjectiveText[i]); } } @@ -678,10 +678,10 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID, int loc_idx = pSession->GetSessionDbLocaleIndex(); if (loc_idx >= 0) { - if (QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId())) + if (QuestLocale const *ql = sObjectMgr->GetQuestLocale(pQuest->GetQuestId())) { - sObjectMgr.GetLocaleString(ql->Title, loc_idx, Title); - sObjectMgr.GetLocaleString(ql->OfferRewardText, loc_idx, OfferRewardText); + sObjectMgr->GetLocaleString(ql->Title, loc_idx, Title); + sObjectMgr->GetLocaleString(ql->OfferRewardText, loc_idx, OfferRewardText); } } @@ -778,10 +778,10 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const *pQuest, uint64 npcGUID, int loc_idx = pSession->GetSessionDbLocaleIndex(); if (loc_idx >= 0) { - if (QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId())) + if (QuestLocale const *ql = sObjectMgr->GetQuestLocale(pQuest->GetQuestId())) { - sObjectMgr.GetLocaleString(ql->Title, loc_idx, Title); - sObjectMgr.GetLocaleString(ql->RequestItemsText, loc_idx, RequestItemsText); + sObjectMgr->GetLocaleString(ql->Title, loc_idx, Title); + sObjectMgr->GetLocaleString(ql->RequestItemsText, loc_idx, RequestItemsText); } } diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp index 4f10b410b7a..f0e3f191bfe 100755 --- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp +++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp @@ -143,7 +143,7 @@ void DynamicObject::Update(uint32 p_time) Delete(); } else - sScriptMgr.OnDynamicObjectUpdate(this, p_time); + sScriptMgr->OnDynamicObjectUpdate(this, p_time); } void DynamicObject::Delete() diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 6ef7474f224..5dad68c2ab7 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -359,9 +359,9 @@ void GameObject::Update(uint32 diff) return; } // respawn timer - uint32 poolid = GetDBTableGUIDLow() ? sPoolMgr.IsPartOfAPool<GameObject>(GetDBTableGUIDLow()) : 0; + uint32 poolid = GetDBTableGUIDLow() ? sPoolMgr->IsPartOfAPool<GameObject>(GetDBTableGUIDLow()) : 0; if (poolid) - sPoolMgr.UpdatePool<GameObject>(poolid, GetDBTableGUIDLow()); + sPoolMgr->UpdatePool<GameObject>(poolid, GetDBTableGUIDLow()); else GetMap()->Add(this); break; @@ -486,7 +486,7 @@ void GameObject::Update(uint32 diff) { if (m_groupLootTimer <= diff) { - Group* group = sObjectMgr.GetGroupByGUID(lootingGroupLowGUID); + Group* group = sObjectMgr->GetGroupByGUID(lootingGroupLowGUID); if (group) group->EndRoll(&loot); m_groupLootTimer = 0; @@ -568,7 +568,7 @@ void GameObject::Update(uint32 diff) break; } } - sScriptMgr.OnGameObjectUpdate(this, diff); + sScriptMgr->OnGameObjectUpdate(this, diff); } void GameObject::Refresh() @@ -600,9 +600,9 @@ void GameObject::Delete() SetGoState(GO_STATE_READY); SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags); - uint32 poolid = GetDBTableGUIDLow() ? sPoolMgr.IsPartOfAPool<GameObject>(GetDBTableGUIDLow()) : 0; + uint32 poolid = GetDBTableGUIDLow() ? sPoolMgr->IsPartOfAPool<GameObject>(GetDBTableGUIDLow()) : 0; if (poolid) - sPoolMgr.UpdatePool<GameObject>(poolid, GetDBTableGUIDLow()); + sPoolMgr->UpdatePool<GameObject>(poolid, GetDBTableGUIDLow()); else AddObjectToRemoveList(); } @@ -624,7 +624,7 @@ void GameObject::SaveToDB() { // this should only be used when the gameobject has already been loaded // preferably after adding to map, because mapid may not be valid otherwise - GameObjectData const *data = sObjectMgr.GetGOData(m_DBTableGuid); + GameObjectData const *data = sObjectMgr->GetGOData(m_DBTableGuid); if (!data) { sLog.outError("GameObject::SaveToDB failed, cannot get gameobject data!"); @@ -644,7 +644,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) if (!m_DBTableGuid) m_DBTableGuid = GetGUIDLow(); // update in loaded data (changing data only in this place) - GameObjectData& data = sObjectMgr.NewGOData(m_DBTableGuid); + GameObjectData& data = sObjectMgr->NewGOData(m_DBTableGuid); // data->guid = guid don't must be update at save data.id = GetEntry(); @@ -692,7 +692,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) bool GameObject::LoadFromDB(uint32 guid, Map *map) { - GameObjectData const* data = sObjectMgr.GetGOData(guid); + GameObjectData const* data = sObjectMgr->GetGOData(guid); if (!data) { @@ -718,7 +718,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map) uint32 artKit = data->artKit; m_DBTableGuid = guid; - if (map->GetInstanceId() != 0) guid = sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT); + if (map->GetInstanceId() != 0) guid = sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT); if (!Create(guid,entry, map, phaseMask, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state, artKit)) return false; @@ -736,13 +736,13 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map) else { m_respawnDelayTime = data->spawntimesecs; - m_respawnTime = sObjectMgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId()); + m_respawnTime = sObjectMgr->GetGORespawnTime(m_DBTableGuid, map->GetInstanceId()); // ready to respawn if (m_respawnTime && m_respawnTime <= time(NULL)) { m_respawnTime = 0; - sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0); + sObjectMgr->SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0); } } } @@ -760,8 +760,8 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map) void GameObject::DeleteFromDB() { - sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0); - sObjectMgr.DeleteGOData(m_DBTableGuid); + sObjectMgr->SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0); + sObjectMgr->DeleteGOData(m_DBTableGuid); WorldDatabase.PExecute("DELETE FROM gameobject WHERE guid = '%u'", m_DBTableGuid); WorldDatabase.PExecute("DELETE FROM game_event_gameobject WHERE guid = '%u'", m_DBTableGuid); } @@ -776,7 +776,7 @@ GameObject* GameObject::GetGameObject(WorldObject& object, uint64 guid) /*********************************************************/ bool GameObject::hasQuest(uint32 quest_id) const { - QuestRelationBounds qr = sObjectMgr.GetGOQuestRelationBounds(GetEntry()); + QuestRelationBounds qr = sObjectMgr->GetGOQuestRelationBounds(GetEntry()); for (QuestRelations::const_iterator itr = qr.first; itr != qr.second; ++itr) { if (itr->second == quest_id) @@ -787,7 +787,7 @@ bool GameObject::hasQuest(uint32 quest_id) const bool GameObject::hasInvolvedQuest(uint32 quest_id) const { - QuestRelationBounds qir = sObjectMgr.GetGOQuestInvolvedRelationBounds(GetEntry()); + QuestRelationBounds qir = sObjectMgr->GetGOQuestInvolvedRelationBounds(GetEntry()); for (QuestRelations::const_iterator itr = qir.first; itr != qir.second; ++itr) { if (itr->second == quest_id) @@ -822,7 +822,7 @@ Unit* GameObject::GetOwner() const void GameObject::SaveRespawnTime() { if (m_goData && m_goData->dbData && m_respawnTime > time(NULL) && m_spawnedByDefault) - sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime); + sObjectMgr->SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime); } bool GameObject::isAlwaysVisibleFor(WorldObject const* seer) const @@ -853,7 +853,7 @@ void GameObject::Respawn() if (m_spawnedByDefault && m_respawnTime > 0) { m_respawnTime = time(NULL); - sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0); + sObjectMgr->SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0); } } @@ -862,7 +862,7 @@ bool GameObject::ActivateToQuest(Player *pTarget) const if (pTarget->HasQuestForGO(GetEntry())) return true; - if (!sObjectMgr.IsGameObjectForQuests(GetEntry())) + if (!sObjectMgr->IsGameObjectForQuests(GetEntry())) return false; switch (GetGoType()) @@ -986,7 +986,7 @@ void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = f void GameObject::SetGoArtKit(uint8 kit) { SetByteValue(GAMEOBJECT_BYTES_1, 2, kit); - GameObjectData *data = const_cast<GameObjectData*>(sObjectMgr.GetGOData(m_DBTableGuid)); + GameObjectData *data = const_cast<GameObjectData*>(sObjectMgr->GetGOData(m_DBTableGuid)); if (data) data->artKit = kit; } @@ -1000,7 +1000,7 @@ void GameObject::SetGoArtKit(uint8 artkit, GameObject *go, uint32 lowguid) data = go->GetGOData(); } else if (lowguid) - data = sObjectMgr.GetGOData(lowguid); + data = sObjectMgr->GetGOData(lowguid); if (data) const_cast<GameObjectData*>(data)->artKit = artkit; @@ -1092,7 +1092,7 @@ void GameObject::Use(Unit* user) if (itr->second) { - if (Player* ChairUser = sObjectMgr.GetPlayer(itr->second)) + if (Player* ChairUser = sObjectMgr->GetPlayer(itr->second)) if (ChairUser->IsSitState() && ChairUser->getStandState() != UNIT_STAND_STATE_SIT && ChairUser->GetExactDist2d(x_i, y_i) < 0.1f) continue; // This seat is already occupied by ChairUser. NOTE: Not sure if the ChairUser->getStandState() != UNIT_STAND_STATE_SIT check is required. else @@ -1167,7 +1167,7 @@ void GameObject::Use(Unit* user) } // possible quest objective for active quests - if (info->goober.questId && sObjectMgr.GetQuestTemplate(info->goober.questId)) + if (info->goober.questId && sObjectMgr->GetQuestTemplate(info->goober.questId)) { //Quest require to be active for GO using if (player->GetQuestStatus(info->goober.questId) != QUEST_STATUS_INCOMPLETE) @@ -1239,9 +1239,9 @@ void GameObject::Use(Unit* user) uint32 zone, subzone; GetZoneAndAreaId(zone,subzone); - int32 zone_skill = sObjectMgr.GetFishingBaseSkillLevel(subzone); + int32 zone_skill = sObjectMgr->GetFishingBaseSkillLevel(subzone); if (!zone_skill) - zone_skill = sObjectMgr.GetFishingBaseSkillLevel(zone); + zone_skill = sObjectMgr->GetFishingBaseSkillLevel(zone); //provide error, no fishable zone or area should be 0 if (!zone_skill) @@ -1558,7 +1558,7 @@ void GameObject::Use(Unit* user) SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId); if (!spellInfo) { - if (user->GetTypeId() != TYPEID_PLAYER || !sOutdoorPvPMgr.HandleCustomSpell((Player*)user,spellId,this)) + if (user->GetTypeId() != TYPEID_PLAYER || !sOutdoorPvPMgr->HandleCustomSpell((Player*)user,spellId,this)) sLog.outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId,GetEntry(),GetGoType()); else sLog.outDebug("WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId); @@ -1677,7 +1677,7 @@ void GameObject::TakenDamage(uint32 damage, Unit *who) if (Battleground* bg = pwho->GetBattleground()) bg->DestroyGate(pwho, this, m_goInfo->building.destroyedEvent); hitType = BG_OBJECT_DMG_HIT_TYPE_JUST_DESTROYED; - sScriptMgr.OnGameObjectDestroyed(pwho, this, m_goInfo->building.destroyedEvent); + sScriptMgr->OnGameObjectDestroyed(pwho, this, m_goInfo->building.destroyedEvent); } if (pwho) if (Battleground* bg = pwho->GetBattleground()) @@ -1728,7 +1728,7 @@ const char* GameObject::GetNameForLocaleIdx(LocaleConstant loc_idx) const if (loc_idx != DEFAULT_LOCALE) { uint8 uloc_idx = uint8(loc_idx); - if (GameObjectLocale const *cl = sObjectMgr.GetGameObjectLocale(GetEntry())) + if (GameObjectLocale const *cl = sObjectMgr->GetGameObjectLocale(GetEntry())) if (cl->Name.size() > uloc_idx && !cl->Name[uloc_idx].empty()) return cl->Name[uloc_idx].c_str(); } diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 3123e93ce68..ee4b8a7885e 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -290,7 +290,7 @@ void Item::UpdateDuration(Player* owner, uint32 diff) if (GetUInt32Value(ITEM_FIELD_DURATION) <= diff) { - sScriptMgr.OnItemExpire(owner, GetProto()); + sScriptMgr->OnItemExpire(owner, GetProto()); owner->DestroyItem(GetBagSlot(), GetSlot(), true); return; } @@ -472,7 +472,7 @@ ItemPrototype const *Item::GetProto() const Player* Item::GetOwner()const { - return sObjectMgr.GetPlayer(GetOwnerGUID()); + return sObjectMgr->GetPlayer(GetOwnerGUID()); } uint32 Item::GetSkill() @@ -813,7 +813,7 @@ bool Item::IsFitToSpellRequirements(SpellEntry const* spellInfo) const // Special case - accept vellum for armor/weapon requirements if ((spellInfo->EquippedItemClass == ITEM_CLASS_ARMOR && proto->IsArmorVellum()) ||(spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON && proto->IsWeaponVellum())) - if (sSpellMgr.IsSkillTypeSpell(spellInfo->Id, SKILL_ENCHANTING)) // only for enchanting spells + if (sSpellMgr->IsSkillTypeSpell(spellInfo->Id, SKILL_ENCHANTING)) // only for enchanting spells return true; if (spellInfo->EquippedItemClass != int32(proto->Class)) @@ -842,7 +842,7 @@ bool Item::IsFitToSpellRequirements(SpellEntry const* spellInfo) const bool Item::IsTargetValidForItemUse(Unit* pUnitTarget) { - ConditionList conditions = sConditionMgr.GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET, GetProto()->ItemId); + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET, GetProto()->ItemId); if (conditions.empty()) return true; @@ -1015,7 +1015,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player) ASSERT(count !=0 && "pProto->Stackable == 0 but checked at loading already"); Item *pItem = NewItemOrBag(pProto); - if (pItem->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM), item, player)) + if (pItem->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), item, player)) { pItem->SetCount(count); return pItem; diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index e08e28b0b41..6e75114b003 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1601,7 +1601,7 @@ void WorldObject::MonsterTextEmote(const char* text, uint64 TargetGuid, bool IsB void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossWhisper) { - Player *player = sObjectMgr.GetPlayer(receiver); + Player *player = sObjectMgr->GetPlayer(receiver); if (!player || !player->GetSession()) return; @@ -1876,7 +1876,7 @@ namespace Trinity : i_object(obj), i_msgtype(msgtype), i_textId(textId), i_language(language), i_targetGUID(targetGUID) {} void operator()(WorldPacket& data, LocaleConstant loc_idx) { - char const* text = sObjectMgr.GetTrinityString(i_textId,loc_idx); + char const* text = sObjectMgr->GetTrinityString(i_textId,loc_idx); // TODO: i_object.GetName() also must be localized? i_object.BuildMonsterChat(&data,i_msgtype,text,i_language,i_object.GetNameForLocaleIdx(loc_idx),i_targetGUID); @@ -1951,12 +1951,12 @@ void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossE void WorldObject::MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper) { - Player *player = sObjectMgr.GetPlayer(receiver); + Player *player = sObjectMgr->GetPlayer(receiver); if (!player || !player->GetSession()) return; LocaleConstant loc_idx = player->GetSession()->GetSessionDbLocaleIndex(); - char const* text = sObjectMgr.GetTrinityString(textId, loc_idx); + char const* text = sObjectMgr->GetTrinityString(textId, loc_idx); WorldPacket data(SMSG_MESSAGECHAT, 200); BuildMonsterChat(&data,IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER,text,LANG_UNIVERSAL,GetNameForLocaleIdx(loc_idx),receiver); @@ -2111,7 +2111,7 @@ TempSummon *Map::SummonCreature(uint32 entry, const Position &pos, SummonPropert default: return NULL; } - if (!summon->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), this, phase, entry, vehId, team, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation())) + if (!summon->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), this, phase, entry, vehId, team, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation())) { delete summon; return NULL; @@ -2135,7 +2135,7 @@ void WorldObject::SetZoneScript() if (map->IsDungeon()) m_zoneScript = (ZoneScript*)((InstanceMap*)map)->GetInstanceScript(); else if (!map->IsBattlegroundOrArena()) - m_zoneScript = sOutdoorPvPMgr.GetZoneScript(GetZoneId()); + m_zoneScript = sOutdoorPvPMgr->GetZoneScript(GetZoneId()); } } @@ -2194,8 +2194,8 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy } Map *map = GetMap(); - uint32 pet_number = sObjectMgr.GeneratePetNumber(); - if (!pet->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_PET), map, GetPhaseMask(), entry, pet_number)) + uint32 pet_number = sObjectMgr->GeneratePetNumber(); + if (!pet->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_PET), map, GetPhaseMask(), entry, pet_number)) { sLog.outError("no such creature entry %u", entry); delete pet; @@ -2279,7 +2279,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float } Map *map = GetMap(); GameObject *go = new GameObject(); - if (!go->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, map, GetPhaseMask(), x,y,z,ang,rotation0,rotation1,rotation2,rotation3,100,GO_STATE_READY)) + if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, map, GetPhaseMask(), x,y,z,ang,rotation0,rotation1,rotation2,rotation3,100,GO_STATE_READY)) { delete go; return NULL; diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index ae235c3e8d3..aafe705f284 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -168,7 +168,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c } Map *map = owner->GetMap(); - uint32 guid = sObjectMgr.GenerateLowGuid(HIGHGUID_PET); + uint32 guid = sObjectMgr->GenerateLowGuid(HIGHGUID_PET); if (!Create(guid, map, owner->GetPhaseMask(), petentry, pet_number)) return false; @@ -649,7 +649,7 @@ bool Pet::CanTakeMoreActiveSpells(uint32 spellid) if (IsPassiveSpell(spellid)) return true; - chainstartstore[0] = sSpellMgr.GetFirstSpellInChain(spellid); + chainstartstore[0] = sSpellMgr->GetFirstSpellInChain(spellid); for (PetSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr) { @@ -659,7 +659,7 @@ bool Pet::CanTakeMoreActiveSpells(uint32 spellid) if (IsPassiveSpell(itr->first)) continue; - uint32 chainstart = sSpellMgr.GetFirstSpellInChain(itr->first); + uint32 chainstart = sSpellMgr->GetFirstSpellInChain(itr->first); uint8 x; @@ -730,7 +730,7 @@ void Pet::GivePetLevel(uint8 level) if (getPetType()==HUNTER_PET) { SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0); - SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr.GetXPForLevel(level)*PET_XP_FACTOR)); + SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr->GetXPForLevel(level)*PET_XP_FACTOR)); } InitStatsForLevel(level); @@ -766,7 +766,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature) if (CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family)) SetName(cFamily->Name[sWorld.GetDefaultDbcLocale()]); else - SetName(creature->GetNameForLocaleIdx(sObjectMgr.GetDBCLocaleIndex())); + SetName(creature->GetNameForLocaleIdx(sObjectMgr->GetDBCLocaleIndex())); return true; } @@ -787,8 +787,8 @@ bool Pet::CreateBaseAtCreatureInfo(CreatureInfo const* cinfo, Unit * owner) bool Pet::CreateBaseAtTamed(CreatureInfo const * cinfo, Map * map, uint32 phaseMask) { sLog.outDebug("Pet::CreateBaseForTamed"); - uint32 guid=sObjectMgr.GenerateLowGuid(HIGHGUID_PET); - uint32 pet_number = sObjectMgr.GeneratePetNumber(); + uint32 guid=sObjectMgr->GenerateLowGuid(HIGHGUID_PET); + uint32 pet_number = sObjectMgr->GeneratePetNumber(); if (!Create(guid, map, phaseMask, cinfo->Entry, pet_number)) return false; @@ -797,7 +797,7 @@ bool Pet::CreateBaseAtTamed(CreatureInfo const * cinfo, Map * map, uint32 phaseM setPowerType(POWER_FOCUS); SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0); SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0); - SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr.GetXPForLevel(getLevel()+1)*PET_XP_FACTOR)); + SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr->GetXPForLevel(getLevel()+1)*PET_XP_FACTOR)); SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); if (cinfo->type == CREATURE_TYPE_BEAST) @@ -877,7 +877,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) SetModifierValue(UnitMods(UNIT_MOD_RESISTANCE_START + i), BASE_VALUE, float(createResistance[i])); //health, mana, armor and resistance - PetLevelInfo const* pInfo = sObjectMgr.GetPetLevelInfo(creature_ID, petlevel); + PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(creature_ID, petlevel); if (pInfo) // exist in DB { SetCreateHealth(pInfo->health); @@ -923,7 +923,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) } case HUNTER_PET: { - SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr.GetXPForLevel(petlevel)*PET_XP_FACTOR)); + SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr->GetXPForLevel(petlevel)*PET_XP_FACTOR)); //these formula may not be correct; however, it is designed to be close to what it should be //this makes dps 0.5 of pets level SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4))); @@ -1383,16 +1383,16 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel } } } - else if (sSpellMgr.GetSpellRank(spell_id) != 0) + else if (sSpellMgr->GetSpellRank(spell_id) != 0) { for (PetSpellMap::const_iterator itr2 = m_spells.begin(); itr2 != m_spells.end(); ++itr2) { if (itr2->second.state == PETSPELL_REMOVED) continue; - if (sSpellMgr.IsRankSpellDueToSpell(spellInfo,itr2->first)) + if (sSpellMgr->IsRankSpellDueToSpell(spellInfo,itr2->first)) { // replace by new high rank - if (sSpellMgr.IsHighRankOfSpell(spell_id,itr2->first)) + if (sSpellMgr->IsHighRankOfSpell(spell_id,itr2->first)) { newspell.active = itr2->second.active; @@ -1403,7 +1403,7 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel break; } // ignore new lesser rank - else if (sSpellMgr.IsHighRankOfSpell(itr2->first,spell_id)) + else if (sSpellMgr->IsHighRankOfSpell(itr2->first,spell_id)) return false; } } @@ -1451,7 +1451,7 @@ void Pet::InitLevelupSpellsForLevel() { uint8 level = getLevel(); - if (PetLevelupSpellSet const *levelupSpells = GetCreatureInfo()->family ? sSpellMgr.GetPetLevelupSpellList(GetCreatureInfo()->family) : NULL) + if (PetLevelupSpellSet const *levelupSpells = GetCreatureInfo()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureInfo()->family) : NULL) { // PetLevelupSpellSet ordered by levels, process in reversed order for (PetLevelupSpellSet::const_reverse_iterator itr = levelupSpells->rbegin(); itr != levelupSpells->rend(); ++itr) @@ -1468,7 +1468,7 @@ void Pet::InitLevelupSpellsForLevel() int32 petSpellsId = GetCreatureInfo()->PetSpellDataId ? -(int32)GetCreatureInfo()->PetSpellDataId : GetEntry(); // default spells (can be not learned if pet level (as owner level decrease result for example) less first possible in normal game) - if (PetDefaultSpellsEntry const *defSpells = sSpellMgr.GetPetDefaultSpellsEntry(petSpellsId)) + if (PetDefaultSpellsEntry const *defSpells = sSpellMgr->GetPetDefaultSpellsEntry(petSpellsId)) { for (uint8 i = 0; i < MAX_CREATURE_SPELL_DATA_SLOT; ++i) { @@ -1531,7 +1531,7 @@ bool Pet::removeSpell(uint32 spell_id, bool learn_prev, bool clear_ab) if (learn_prev) { - if (uint32 prev_id = sSpellMgr.GetPrevSpellInChain (spell_id)) + if (uint32 prev_id = sSpellMgr->GetPrevSpellInChain (spell_id)) learnSpell(prev_id); else learn_prev = false; @@ -1644,10 +1644,10 @@ bool Pet::resetTalents(bool no_cost) continue; } // remove learned spells (all ranks) - uint32 itrFirstId = sSpellMgr.GetFirstSpellInChain(itr->first); + uint32 itrFirstId = sSpellMgr->GetFirstSpellInChain(itr->first); // unlearn if first rank is talent or learned by talent - if (itrFirstId == talentInfo->RankID[j] || sSpellMgr.IsSpellLearnToSpell(talentInfo->RankID[j],itrFirstId)) + if (itrFirstId == talentInfo->RankID[j] || sSpellMgr->IsSpellLearnToSpell(talentInfo->RankID[j],itrFirstId)) { unlearnSpell(itr->first,false); itr = m_spells.begin(); @@ -1966,7 +1966,7 @@ void Pet::learnSpellHighRank(uint32 spellid) { learnSpell(spellid); - if (uint32 next = sSpellMgr.GetNextSpellInChain(spellid)) + if (uint32 next = sSpellMgr->GetNextSpellInChain(spellid)) learnSpellHighRank(next); } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index d58ed174ac1..7e3831f4b5c 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -233,13 +233,13 @@ bool PlayerTaxi::LoadTaxiDestinationsFromString(const std::string& values, uint3 { uint32 cost; uint32 path; - sObjectMgr.GetTaxiPath(m_TaxiDestinations[i-1],m_TaxiDestinations[i],path,cost); + sObjectMgr->GetTaxiPath(m_TaxiDestinations[i-1],m_TaxiDestinations[i],path,cost); if (!path) return false; } // can't load taxi path without mount set (quest taxi path?) - if (!sObjectMgr.GetTaxiMountDisplayId(GetTaxiSource(),team,true)) + if (!sObjectMgr->GetTaxiMountDisplayId(GetTaxiSource(),team,true)) return false; return true; @@ -266,7 +266,7 @@ uint32 PlayerTaxi::GetCurrentTaxiPath() const uint32 path; uint32 cost; - sObjectMgr.GetTaxiPath(m_TaxiDestinations[0],m_TaxiDestinations[1],path,cost); + sObjectMgr->GetTaxiPath(m_TaxiDestinations[0],m_TaxiDestinations[1],path,cost); return path; } @@ -677,7 +677,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c m_name = name; - PlayerInfo const* info = sObjectMgr.GetPlayerInfo(race, class_); + PlayerInfo const* info = sObjectMgr->GetPlayerInfo(race, class_); if (!info) { sLog.outError("Player have incorrect race/class pair. Can't be loaded."); @@ -696,7 +696,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c return false; } - SetMap(sMapMgr.CreateMap(info->mapId, this, 0)); + SetMap(sMapMgr->CreateMap(info->mapId, this, 0)); uint8 powertype = cEntry->powerType; @@ -1595,7 +1595,7 @@ bool Player::BuildEnumData(QueryResult result, WorldPacket * p_data) uint8 pRace = fields[2].GetUInt8(); uint8 pClass = fields[3].GetUInt8(); - PlayerInfo const *info = sObjectMgr.GetPlayerInfo(pRace, pClass); + PlayerInfo const *info = sObjectMgr->GetPlayerInfo(pRace, pClass); if (!info) { sLog.outError("Player %u has incorrect race/class pair. Don't build enum.", guid); @@ -1822,7 +1822,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati return false; } - if ((GetSession()->GetSecurity() < SEC_GAMEMASTER) && sDisableMgr.IsDisabledFor(DISABLE_TYPE_MAP, mapid, this)) + if ((GetSession()->GetSecurity() < SEC_GAMEMASTER) && sDisableMgr->IsDisabledFor(DISABLE_TYPE_MAP, mapid, this)) { sLog.outError("Player %s tried to enter a forbidden map %u", GetName(), mapid); SendTransferAborted(mapid, TRANSFER_ABORT_MAP_NOT_ALLOWED); @@ -1939,12 +1939,12 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati // Check enter rights before map getting to avoid creating instance copy for player // this check not dependent from map instance copy and same for all instance copies of selected map - if (!sMapMgr.CanPlayerEnter(mapid, this, false)) + if (!sMapMgr->CanPlayerEnter(mapid, this, false)) return false; // If the map is not created, assume it is possible to enter it. // It will be created in the WorldPortAck. - Map *map = sMapMgr.FindMap(mapid); + Map *map = sMapMgr->FindMap(mapid); if (!map || map->CanEnter(this)) { //lets reset near teleport flag if it wasn't reset during chained teleports @@ -2141,7 +2141,7 @@ void Player::RemoveFromWorld() StopCastingCharm(); StopCastingBindSight(); UnsummonPetTemporaryIfAny(); - sOutdoorPvPMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId); + sOutdoorPvPMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId); } ///- Do not add/remove the player from the object storage @@ -2618,7 +2618,7 @@ void Player::UninviteFromGroup() if (group->IsCreated()) { group->Disband(true); - sObjectMgr.RemoveGroup(group); + sObjectMgr->RemoveGroup(group); } else group->RemoveAllInvites(); @@ -2634,7 +2634,7 @@ void Player::RemoveFromGroup(Group* group, uint64 guid, RemoveMethod method /* = if (group->RemoveMember(guid, method, kicker, reason) <= 1) { // group->Disband(); already disbanded in RemoveMember - sObjectMgr.RemoveGroup(group); + sObjectMgr->RemoveGroup(group); delete group; group = NULL; // removemember sets the player's group pointer to NULL @@ -2677,7 +2677,7 @@ void Player::GiveXP(uint32 xp, Unit *victim, float group_rate) uint8 level = getLevel(); - sScriptMgr.OnGivePlayerXP(this, xp, victim); + sScriptMgr->OnGivePlayerXP(this, xp, victim); // Favored experience increase START uint32 zone = GetZoneId(); @@ -2727,13 +2727,13 @@ void Player::GiveLevel(uint8 level) if (level == getLevel()) return; - sScriptMgr.OnPlayerLevelChanged(this, level); + sScriptMgr->OnPlayerLevelChanged(this, level); PlayerLevelInfo info; - sObjectMgr.GetPlayerLevelInfo(getRace(),getClass(),level,&info); + sObjectMgr->GetPlayerLevelInfo(getRace(),getClass(),level,&info); PlayerClassLevelInfo classInfo; - sObjectMgr.GetPlayerClassLevelInfo(getClass(),level,&classInfo); + sObjectMgr->GetPlayerClassLevelInfo(getClass(),level,&classInfo); // send levelup info to client WorldPacket data(SMSG_LEVELUP_INFO, (4+4+MAX_POWERS*4+MAX_STATS*4)); @@ -2753,7 +2753,7 @@ void Player::GiveLevel(uint8 level) GetSession()->SendPacket(&data); - SetUInt32Value(PLAYER_NEXT_LEVEL_XP, sObjectMgr.GetXPForLevel(level)); + SetUInt32Value(PLAYER_NEXT_LEVEL_XP, sObjectMgr->GetXPForLevel(level)); //update level, max level of skills m_Played_time[PLAYED_TIME_LEVEL] = 0; // Level Played Time reset @@ -2795,7 +2795,7 @@ void Player::GiveLevel(uint8 level) if (Pet* pet = GetPet()) pet->SynchronizeLevelWithOwner(); - if (MailLevelReward const* mailReward = sObjectMgr.GetMailLevelReward(level,getRaceMask())) + if (MailLevelReward const* mailReward = sObjectMgr->GetMailLevelReward(level,getRaceMask())) { //- TODO: Poor design of mail system SQLTransaction trans = CharacterDatabase.BeginTransaction(); @@ -2852,13 +2852,13 @@ void Player::InitStatsForLevel(bool reapplyMods) _RemoveAllStatBonuses(); PlayerClassLevelInfo classInfo; - sObjectMgr.GetPlayerClassLevelInfo(getClass(),getLevel(),&classInfo); + sObjectMgr->GetPlayerClassLevelInfo(getClass(),getLevel(),&classInfo); PlayerLevelInfo info; - sObjectMgr.GetPlayerLevelInfo(getRace(),getClass(),getLevel(),&info); + sObjectMgr->GetPlayerLevelInfo(getRace(),getClass(),getLevel(),&info); SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)); - SetUInt32Value(PLAYER_NEXT_LEVEL_XP, sObjectMgr.GetXPForLevel(getLevel())); + SetUInt32Value(PLAYER_NEXT_LEVEL_XP, sObjectMgr->GetXPForLevel(getLevel())); // reset before any aura state sources (health set/aura apply) SetUInt32Value(UNIT_FIELD_AURASTATE, 0); @@ -3254,9 +3254,9 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen { uint32 next_active_spell_id = 0; // fix activate state for non-stackable low rank (and find next spell for !active case) - if (!SpellMgr::canStackSpellRanks(spellInfo) && sSpellMgr.GetSpellRank(spellInfo->Id) != 0) + if (!SpellMgr::canStackSpellRanks(spellInfo) && sSpellMgr->GetSpellRank(spellInfo->Id) != 0) { - if (uint32 next = sSpellMgr.GetNextSpellInChain(spell_id)) + if (uint32 next = sSpellMgr->GetNextSpellInChain(spell_id)) { if (HasSpell(next)) { @@ -3374,7 +3374,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen } } // non talent spell: learn low ranks (recursive call) - else if (uint32 prev_spell = sSpellMgr.GetPrevSpellInChain(spell_id)) + else if (uint32 prev_spell = sSpellMgr->GetPrevSpellInChain(spell_id)) { if (!IsInWorld() || disabled) // at spells loading, no output, but allow save addSpell(prev_spell,active,true,true,disabled); @@ -3389,7 +3389,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen newspell->disabled = disabled; // replace spells in action bars and spellbook to bigger rank if only one spell rank must be accessible - if (newspell->active && !newspell->disabled && !SpellMgr::canStackSpellRanks(spellInfo) && sSpellMgr.GetSpellRank(spellInfo->Id) != 0) + if (newspell->active && !newspell->disabled && !SpellMgr::canStackSpellRanks(spellInfo) && sSpellMgr->GetSpellRank(spellInfo->Id) != 0) { for (PlayerSpellMap::iterator itr2 = m_spells.begin(); itr2 != m_spells.end(); ++itr2) { @@ -3397,11 +3397,11 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen SpellEntry const *i_spellInfo = sSpellStore.LookupEntry(itr2->first); if (!i_spellInfo) continue; - if (sSpellMgr.IsRankSpellDueToSpell(spellInfo,itr2->first)) + if (sSpellMgr->IsRankSpellDueToSpell(spellInfo,itr2->first)) { if (itr2->second->active) { - if (sSpellMgr.IsHighRankOfSpell(spell_id,itr2->first)) + if (sSpellMgr->IsHighRankOfSpell(spell_id,itr2->first)) { if (IsInWorld()) // not send spell (re-/over-)learn packets at loading { @@ -3417,7 +3417,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen itr2->second->state = PLAYERSPELL_CHANGED; superceded_old = true; // new spell replace old in action bars and spell book. } - else if (sSpellMgr.IsHighRankOfSpell(itr2->first,spell_id)) + else if (sSpellMgr->IsHighRankOfSpell(itr2->first,spell_id)) { if (IsInWorld()) // not send spell (re-/over-)learn packets at loading { @@ -3471,16 +3471,16 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen // update free primary prof.points (if any, can be none in case GM .learn prof. learning) if (uint32 freeProfs = GetFreePrimaryProfessionPoints()) { - if (sSpellMgr.IsPrimaryProfessionFirstRankSpell(spell_id)) + if (sSpellMgr->IsPrimaryProfessionFirstRankSpell(spell_id)) SetFreePrimaryProfessions(freeProfs-1); } // add dependent skills uint16 maxskill = GetMaxSkillValueForLevel(); - SpellLearnSkillNode const* spellLearnSkill = sSpellMgr.GetSpellLearnSkill(spell_id); + SpellLearnSkillNode const* spellLearnSkill = sSpellMgr->GetSpellLearnSkill(spell_id); - SkillLineAbilityMapBounds skill_bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spell_id); + SkillLineAbilityMapBounds skill_bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spell_id); if (spellLearnSkill) { @@ -3539,7 +3539,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen } // learn dependent spells - SpellLearnSpellMapBounds spell_bounds = sSpellMgr.GetSpellLearnSpellMapBounds(spell_id); + SpellLearnSpellMapBounds spell_bounds = sSpellMgr->GetSpellLearnSpellMapBounds(spell_id); for (SpellLearnSpellMap::const_iterator itr2 = spell_bounds.first; itr2 != spell_bounds.second; ++itr2) { @@ -3628,7 +3628,7 @@ void Player::learnSpell(uint32 spell_id, bool dependent) // learn all disabled higher ranks and required spells (recursive) if (disabled) { - SpellChainNode const* node = sSpellMgr.GetSpellChainNode(spell_id); + SpellChainNode const* node = sSpellMgr->GetSpellChainNode(spell_id); if (node) { PlayerSpellMap::iterator iter = m_spells.find(node->next); @@ -3636,7 +3636,7 @@ void Player::learnSpell(uint32 spell_id, bool dependent) learnSpell(node->next, false); } - SpellsRequiringSpellMapBounds spellsRequiringSpell = sSpellMgr.GetSpellsRequiringSpellBounds(spell_id); + SpellsRequiringSpellMapBounds spellsRequiringSpell = sSpellMgr->GetSpellsRequiringSpellBounds(spell_id); for (SpellsRequiringSpellMap::const_iterator itr2 = spellsRequiringSpell.first; itr2 != spellsRequiringSpell.second; ++itr2) { PlayerSpellMap::iterator iter2 = m_spells.find(itr2->second); @@ -3656,13 +3656,13 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) return; // unlearn non talent higher ranks (recursive) - if (SpellChainNode const* node = sSpellMgr.GetSpellChainNode(spell_id)) + if (SpellChainNode const* node = sSpellMgr->GetSpellChainNode(spell_id)) { if (HasSpell(node->next) && !GetTalentSpellPos(node->next)) removeSpell(node->next,disabled, false); } //unlearn spells dependent from recently removed spells - SpellsRequiringSpellMapBounds spellsRequiringSpell = sSpellMgr.GetSpellsRequiringSpellBounds(spell_id); + SpellsRequiringSpellMapBounds spellsRequiringSpell = sSpellMgr->GetSpellsRequiringSpellBounds(spell_id); for (SpellsRequiringSpellMap::const_iterator itr2 = spellsRequiringSpell.first; itr2 != spellsRequiringSpell.second; ++itr2) removeSpell(itr2->second,disabled); @@ -3697,7 +3697,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) // remove pet auras for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (PetAura const *petSpell = sSpellMgr.GetPetAura(spell_id, i)) + if (PetAura const *petSpell = sSpellMgr->GetPetAura(spell_id, i)) RemovePetAura(petSpell); // free talent points @@ -3711,7 +3711,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) } // update free primary prof.points (if not overflow setting, can be in case GM use before .learn prof. learning) - if (sSpellMgr.IsPrimaryProfessionFirstRankSpell(spell_id)) + if (sSpellMgr->IsPrimaryProfessionFirstRankSpell(spell_id)) { uint32 freeProfs = GetFreePrimaryProfessionPoints()+1; if (freeProfs <= sWorld.getIntConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL)) @@ -3719,20 +3719,20 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) } // remove dependent skill - SpellLearnSkillNode const *spellLearnSkill = sSpellMgr.GetSpellLearnSkill(spell_id); + SpellLearnSkillNode const *spellLearnSkill = sSpellMgr->GetSpellLearnSkill(spell_id); if (spellLearnSkill) { - uint32 prev_spell = sSpellMgr.GetPrevSpellInChain(spell_id); + uint32 prev_spell = sSpellMgr->GetPrevSpellInChain(spell_id); if (!prev_spell) // first rank, remove skill SetSkill(spellLearnSkill->skill, 0, 0, 0); else { // search prev. skill setting by spell ranks chain - SpellLearnSkillNode const *prevSkill = sSpellMgr.GetSpellLearnSkill(prev_spell); + SpellLearnSkillNode const *prevSkill = sSpellMgr->GetSpellLearnSkill(prev_spell); while (!prevSkill && prev_spell) { - prev_spell = sSpellMgr.GetPrevSpellInChain(prev_spell); - prevSkill = sSpellMgr.GetSpellLearnSkill(sSpellMgr.GetFirstSpellInChain(prev_spell)); + prev_spell = sSpellMgr->GetPrevSpellInChain(prev_spell); + prevSkill = sSpellMgr->GetSpellLearnSkill(sSpellMgr->GetFirstSpellInChain(prev_spell)); } if (!prevSkill) // not found prev skill setting, remove skill @@ -3758,7 +3758,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) else { // not ranked skills - SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spell_id); + SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spell_id); for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) { @@ -3792,7 +3792,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) } // remove dependent spells - SpellLearnSpellMapBounds spell_bounds = sSpellMgr.GetSpellLearnSpellMapBounds(spell_id); + SpellLearnSpellMapBounds spell_bounds = sSpellMgr->GetSpellLearnSpellMapBounds(spell_id); for (SpellLearnSpellMap::const_iterator itr2 = spell_bounds.first; itr2 != spell_bounds.second; ++itr2) removeSpell(itr2->second.spell, disabled); @@ -3800,7 +3800,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) // activate lesser rank in spellbook/action bar, and cast it if need bool prev_activate = false; - if (uint32 prev_id = sSpellMgr.GetPrevSpellInChain (spell_id)) + if (uint32 prev_id = sSpellMgr->GetPrevSpellInChain (spell_id)) { SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id); @@ -3812,7 +3812,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) // learnSpell(prev_id, false); } // if ranked non-stackable spell: need activate lesser rank and update dendence state - else if (cur_active && !SpellMgr::canStackSpellRanks(spellInfo) && sSpellMgr.GetSpellRank(spellInfo->Id) != 0) + else if (cur_active && !SpellMgr::canStackSpellRanks(spellInfo) && sSpellMgr->GetSpellRank(spellInfo->Id) != 0) { // need manually update dependence state (learn spell ignore like attempts) PlayerSpellMap::iterator prev_itr = m_spells.find(prev_id); @@ -3872,7 +3872,7 @@ bool Player::Has310Flyer(bool checkAllSpells, uint32 excludeSpellId) if (itr->first == excludeSpellId) continue; - SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(itr->first); + SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(itr->first); for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) { if (_spell_idx->second->skillId != SKILL_MOUNTS) @@ -4077,7 +4077,7 @@ uint32 Player::resetTalentsCost() const bool Player::resetTalents(bool no_cost) { - sScriptMgr.OnPlayerTalentsReset(this, no_cost); + sScriptMgr->OnPlayerTalentsReset(this, no_cost); // not need after this call if (HasAtLoginFlag(AT_LOGIN_RESET_TALENTS)) @@ -4171,7 +4171,7 @@ bool Player::resetTalents(bool no_cost) void Player::SetFreeTalentPoints(uint32 points) { - sScriptMgr.OnPlayerFreeTalentPointsChanged(this, points); + sScriptMgr->OnPlayerFreeTalentPointsChanged(this, points); SetUInt32Value(PLAYER_CHARACTER_POINTS1,points); } @@ -4417,14 +4417,14 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell if (!IsSpellFitByClassAndRace(trainer_spell->learnedSpell[i])) return TRAINER_SPELL_RED; - if (SpellChainNode const* spell_chain = sSpellMgr.GetSpellChainNode(trainer_spell->learnedSpell[i])) + if (SpellChainNode const* spell_chain = sSpellMgr->GetSpellChainNode(trainer_spell->learnedSpell[i])) { // check prev.rank requirement if (spell_chain->prev && !HasSpell(spell_chain->prev)) return TRAINER_SPELL_RED; } - SpellsRequiringSpellMapBounds spellsRequired = sSpellMgr.GetSpellsRequiredForSpellBounds(trainer_spell->learnedSpell[i]); + SpellsRequiringSpellMapBounds spellsRequired = sSpellMgr->GetSpellsRequiredForSpellBounds(trainer_spell->learnedSpell[i]); for (SpellsRequiringSpellMap::const_iterator itr = spellsRequired.first; itr != spellsRequired.second; ++itr) { // check additional spell requirement @@ -4439,7 +4439,7 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell { if (!trainer_spell->learnedSpell[i]) continue; - if ((sSpellMgr.IsPrimaryProfessionFirstRankSpell(trainer_spell->learnedSpell[i])) && (GetFreePrimaryProfessionPoints() == 0)) + if ((sSpellMgr->IsPrimaryProfessionFirstRankSpell(trainer_spell->learnedSpell[i])) && (GetFreePrimaryProfessionPoints() == 0)) return TRAINER_SPELL_GREEN_DISABLED; } @@ -4479,7 +4479,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC sObjectAccessor.ConvertCorpseForPlayer(playerguid); if (uint32 guildId = GetGuildIdFromDB(playerguid)) - if (Guild* pGuild = sObjectMgr.GetGuildById(guildId)) + if (Guild* pGuild = sObjectMgr->GetGuildById(guildId)) pGuild->DeleteMember(guid); // remove from arena teams @@ -4488,7 +4488,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC // the player was uninvited already on logout so just remove from group QueryResult resultGroup = CharacterDatabase.PQuery("SELECT guid FROM group_member WHERE memberGuid=%u", guid); if (resultGroup) - if (Group* group = sObjectMgr.GetGroupByGUID((*resultGroup)[0].GetUInt32())) + if (Group* group = sObjectMgr->GetGroupByGUID((*resultGroup)[0].GetUInt32())) RemoveFromGroup(group, playerguid); // Remove signs from petitions (also remove petitions if owner); @@ -4572,7 +4572,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC trans->PAppend("DELETE FROM mail_items WHERE mail_id = '%u'", mail_id); - uint32 pl_account = sObjectMgr.GetPlayerAccountIdByGUID(MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER)); + uint32 pl_account = sObjectMgr->GetPlayerAccountIdByGUID(MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER)); draft.AddMoney(money).SendReturnToSender(pl_account, guid, sender); } @@ -4600,7 +4600,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC if (pFriend->IsInWorld()) { pFriend->GetSocial()->RemoveFromSocialList(guid, false); - sSocialMgr.SendFriendStatus(pFriend, FRIEND_REMOVED, guid, false); + sSocialMgr->SendFriendStatus(pFriend, FRIEND_REMOVED, guid, false); } } } while (resultFriends->NextRow()); @@ -4805,7 +4805,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness) uint32 newzone, newarea; GetZoneAndAreaId(newzone,newarea); UpdateZone(newzone,newarea); - sOutdoorPvPMgr.HandlePlayerResurrects(this, newzone); + sOutdoorPvPMgr->HandlePlayerResurrects(this, newzone); // update visibility UpdateObjectVisibility(); @@ -4905,7 +4905,7 @@ void Player::CreateCorpse() Corpse *corpse = new Corpse((m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH) ? CORPSE_RESURRECTABLE_PVP : CORPSE_RESURRECTABLE_PVE); SetPvPDeath(false); - if (!corpse->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_CORPSE), this)) + if (!corpse->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_CORPSE), this)) { delete corpse; return; @@ -5147,7 +5147,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g return TotalCost; } - Guild *pGuild = sObjectMgr.GetGuildById(GetGuildId()); + Guild *pGuild = sObjectMgr->GetGuildById(GetGuildId()); if (!pGuild) return TotalCost; @@ -5195,7 +5195,7 @@ void Player::RepopAtGraveyard() if (Battleground *bg = GetBattleground()) ClosestGrave = bg->GetClosestGraveYard(this); else - ClosestGrave = sObjectMgr.GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam()); + ClosestGrave = sObjectMgr->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam()); // stop countdown until repop m_deathTimer = 0; @@ -5308,7 +5308,7 @@ void Player::UpdateLocalChannels(uint32 newZone) char const* currentNameExt; if (channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY) - currentNameExt = sObjectMgr.GetTrinityStringForDBCLocale(LANG_CHANNEL_CITY); + currentNameExt = sObjectMgr->GetTrinityStringForDBCLocale(LANG_CHANNEL_CITY); else currentNameExt = current_zone_name.c_str(); @@ -5788,7 +5788,7 @@ bool Player::UpdateCraftSkill(uint32 spellid) { sLog.outDebug("UpdateCraftSkill spellid %d", spellid); - SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spellid); + SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellid); for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) { @@ -6136,7 +6136,7 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal) for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) if (SkillLineAbilityEntry const *pAbility = sSkillLineAbilityStore.LookupEntry(j)) if (pAbility->skillId == id) - removeSpell(sSpellMgr.GetFirstSpellInChain(pAbility->spellId)); + removeSpell(sSpellMgr->GetFirstSpellInChain(pAbility->spellId)); } } else if (newVal) //add @@ -6557,7 +6557,7 @@ void Player::CheckAreaExploreAndOutdoor() uint32 XP = 0; if (diff < -5) { - XP = uint32(sObjectMgr.GetBaseXP(getLevel()+5)*sWorld.getRate(RATE_XP_EXPLORE)); + XP = uint32(sObjectMgr->GetBaseXP(getLevel()+5)*sWorld.getRate(RATE_XP_EXPLORE)); } else if (diff > 5) { @@ -6567,11 +6567,11 @@ void Player::CheckAreaExploreAndOutdoor() else if (exploration_percent < 0) exploration_percent = 0; - XP = uint32(sObjectMgr.GetBaseXP(p->area_level)*exploration_percent/100*sWorld.getRate(RATE_XP_EXPLORE)); + XP = uint32(sObjectMgr->GetBaseXP(p->area_level)*exploration_percent/100*sWorld.getRate(RATE_XP_EXPLORE)); } else { - XP = uint32(sObjectMgr.GetBaseXP(p->area_level)*sWorld.getRate(RATE_XP_EXPLORE)); + XP = uint32(sObjectMgr->GetBaseXP(p->area_level)*sWorld.getRate(RATE_XP_EXPLORE)); } GiveXP(XP, NULL); @@ -6631,7 +6631,7 @@ int32 Player::CalculateReputationGain(uint32 creatureOrQuestLevel, int32 rep, in float percent = 100.0f; // Get the generic rate first - if (RepRewardRate const * repData = sObjectMgr.GetRepRewardRate(faction)) + if (RepRewardRate const * repData = sObjectMgr->GetRepRewardRate(faction)) { float repRate = for_quest ? repData->quest_rate : repData->creature_rate; percent *= repRate; @@ -6664,7 +6664,7 @@ void Player::RewardReputation(Unit *pVictim, float rate) if (pVictim->ToCreature()->IsReputationGainDisabled()) return; - ReputationOnKillEntry const* Rep = sObjectMgr.GetReputationOnKilEntry(pVictim->ToCreature()->GetCreatureInfo()->Entry); + ReputationOnKillEntry const* Rep = sObjectMgr->GetReputationOnKilEntry(pVictim->ToCreature()->GetCreatureInfo()->Entry); if (!Rep) return; @@ -6681,7 +6681,7 @@ void Player::RewardReputation(Unit *pVictim, float rate) InstanceTemplate const *pInstance = ObjectMgr::GetInstanceTemplate(pMap->GetId()); if (pInstance) { - AccessRequirement const *pAccessRequirement = sObjectMgr.GetAccessRequirement(pMap->GetId(), ((InstanceMap*)pMap)->GetDifficulty()); + AccessRequirement const *pAccessRequirement = sObjectMgr->GetAccessRequirement(pMap->GetId(), ((InstanceMap*)pMap)->GetDifficulty()); if (pAccessRequirement) { if (!pMap->IsRaid() && pAccessRequirement->levelMin == 80) @@ -7048,7 +7048,7 @@ uint32 Player::GetZoneIdFromDB(uint64 guid) float posy = fields[2].GetFloat(); float posz = fields[3].GetFloat(); - zone = sMapMgr.GetZoneId(map,posx,posy,posz); + zone = sMapMgr->GetZoneId(map,posx,posy,posz); if (zone > 0) CharacterDatabase.PExecute("UPDATE characters SET zone='%u' WHERE guid='%u'", zone, guidLow); @@ -7086,8 +7086,8 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) { if (m_zoneUpdateId != newZone) { - sOutdoorPvPMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId); - sOutdoorPvPMgr.HandlePlayerEnterZone(this, newZone); + sOutdoorPvPMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId); + sOutdoorPvPMgr->HandlePlayerEnterZone(this, newZone); SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange... } @@ -7103,12 +7103,12 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) if (sWorld.getBoolConfig(CONFIG_WEATHER)) { - Weather *wth = sWeatherMgr.FindWeather(zone->ID); + Weather *wth = sWeatherMgr->FindWeather(zone->ID); if (wth) wth->SendWeatherUpdateToPlayer(this); else { - if (!sWeatherMgr.AddWeather(zone->ID)) + if (!sWeatherMgr->AddWeather(zone->ID)) { // send fine weather packet to remove old zone's weather Weather::SendFineWeatherUpdateToPlayer(this); @@ -7259,7 +7259,7 @@ void Player::DuelComplete(DuelCompleteType type) SendMessageToSet(&data,true); } - sScriptMgr.OnPlayerDuelEnd(duel->opponent, this, type); + sScriptMgr->OnPlayerDuelEnd(duel->opponent, this, type); switch (type) { @@ -7983,7 +7983,7 @@ void Player::CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) continue; - SpellEnchantProcEntry const* entry = sSpellMgr.GetSpellEnchantProcEvent(enchant_id); + SpellEnchantProcEntry const* entry = sSpellMgr->GetSpellEnchantProcEvent(enchant_id); if (entry && entry->procEx) { @@ -8670,7 +8670,7 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) Battleground* bg = GetBattleground(); uint16 NumberOfFields = 0; uint32 mapid = GetMapId(); - OutdoorPvP * pvp = sOutdoorPvPMgr.GetOutdoorPvPToZoneId(zoneid); + OutdoorPvP * pvp = sOutdoorPvPMgr->GetOutdoorPvPToZoneId(zoneid); sLog.outDebug("Sending SMSG_INIT_WORLD_STATES to Map: %u, Zone: %u", mapid, zoneid); @@ -13106,7 +13106,7 @@ void Player::RemoveArenaEnchantments(EnchantmentSlot slot) if (itr->item && itr->item->GetEnchantmentId(slot)) { // Poisons and DK runes are enchants which are allowed on arenas - if (sSpellMgr.IsArenaAllowedEnchancment(itr->item->GetEnchantmentId(slot))) + if (sSpellMgr->IsArenaAllowedEnchancment(itr->item->GetEnchantmentId(slot))) { ++next; continue; @@ -13644,11 +13644,11 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId, bool showQue pMenu->GetGossipMenu().SetMenuId(menuId); - GossipMenuItemsMapBounds pMenuItemBounds = sObjectMgr.GetGossipMenuItemsMapBounds(menuId); + GossipMenuItemsMapBounds pMenuItemBounds = sObjectMgr->GetGossipMenuItemsMapBounds(menuId); // if default menuId and no menu options exist for this, use options from default options if (pMenuItemBounds.first == pMenuItemBounds.second && menuId == GetDefaultGossipMenuForSource(pSource)) - pMenuItemBounds = sObjectMgr.GetGossipMenuItemsMapBounds(0); + pMenuItemBounds = sObjectMgr->GetGossipMenuItemsMapBounds(0); uint32 npcflags = 0; Creature *pCreature = NULL; @@ -13664,7 +13664,7 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId, bool showQue for (GossipMenuItemsMap::const_iterator itr = pMenuItemBounds.first; itr != pMenuItemBounds.second; ++itr) { bool bCanTalk = true; - if (!sConditionMgr.IsPlayerMeetToConditions(this, itr->second.conditions)) + if (!sConditionMgr->IsPlayerMeetToConditions(this, itr->second.conditions)) continue; if (pSource->GetTypeId() == TYPEID_UNIT) @@ -13731,7 +13731,7 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId, bool showQue case GOSSIP_OPTION_AUCTIONEER: break; // no checks case GOSSIP_OPTION_OUTDOORPVP: - if (!sOutdoorPvPMgr.CanTalkTo(this, pCreature, itr->second)) + if (!sOutdoorPvPMgr->CanTalkTo(this, pCreature, itr->second)) bCanTalk = false; break; default: @@ -13770,10 +13770,10 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId, bool showQue if (loc_idx >= 0) { uint32 idxEntry = MAKE_PAIR32(menuId, itr->second.id); - if (GossipMenuItemsLocale const *no = sObjectMgr.GetGossipMenuItemsLocale(idxEntry)) + if (GossipMenuItemsLocale const *no = sObjectMgr->GetGossipMenuItemsLocale(idxEntry)) { - sObjectMgr.GetLocaleString(no->OptionText, loc_idx, strOptionText); - sObjectMgr.GetLocaleString(no->BoxText, loc_idx, strBoxText); + sObjectMgr->GetLocaleString(no->OptionText, loc_idx, strOptionText); + sObjectMgr->GetLocaleString(no->BoxText, loc_idx, strBoxText); } } @@ -13866,7 +13866,7 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 me break; } case GOSSIP_OPTION_OUTDOORPVP: - sOutdoorPvPMgr.HandleGossipOption(this, pSource->GetGUID(), gossipListId); + sOutdoorPvPMgr->HandleGossipOption(this, pSource->GetGUID(), gossipListId); break; case GOSSIP_OPTION_SPIRITHEALER: if (isDead()) @@ -13944,7 +13944,7 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 me break; case GOSSIP_OPTION_BATTLEFIELD: { - BattlegroundTypeId bgTypeId = sBattlegroundMgr.GetBattleMasterBG(pSource->GetEntry()); + BattlegroundTypeId bgTypeId = sBattlegroundMgr->GetBattleMasterBG(pSource->GetEntry()); if (bgTypeId == BATTLEGROUND_TYPE_NONE) { @@ -13963,7 +13963,7 @@ uint32 Player::GetGossipTextId(WorldObject *pSource) if (!pSource || pSource->GetTypeId() != TYPEID_UNIT || !pSource->ToCreature()->GetDBTableGUIDLow()) return DEFAULT_GOSSIP_MESSAGE; - if (uint32 pos = sObjectMgr.GetNpcGossip(pSource->ToCreature()->GetDBTableGUIDLow())) + if (uint32 pos = sObjectMgr->GetNpcGossip(pSource->ToCreature()->GetDBTableGUIDLow())) return pos; return DEFAULT_GOSSIP_MESSAGE; @@ -13976,11 +13976,11 @@ uint32 Player::GetGossipTextId(uint32 menuId) if (!menuId) return textId; - GossipMenusMapBounds pMenuBounds = sObjectMgr.GetGossipMenusMapBounds(menuId); + GossipMenusMapBounds pMenuBounds = sObjectMgr->GetGossipMenusMapBounds(menuId); for (GossipMenusMap::const_iterator itr = pMenuBounds.first; itr != pMenuBounds.second; ++itr) { - if (sConditionMgr.IsPlayerMeetToConditions(this, itr->second.conditions)) + if (sConditionMgr->IsPlayerMeetToConditions(this, itr->second.conditions)) textId = itr->second.text_id; } @@ -14010,20 +14010,20 @@ void Player::PrepareQuestMenu(uint64 guid) Creature *pCreature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid); if (pCreature) { - pObjectQR = sObjectMgr.GetCreatureQuestRelationBounds(pCreature->GetEntry()); - pObjectQIR = sObjectMgr.GetCreatureQuestInvolvedRelationBounds(pCreature->GetEntry()); + pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(pCreature->GetEntry()); + pObjectQIR = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(pCreature->GetEntry()); } else { //we should obtain map pointer from GetMap() in 99% of cases. Special case //only for quests which cast teleport spells on player - Map * _map = IsInWorld() ? GetMap() : sMapMgr.FindMap(GetMapId(), GetInstanceId()); + Map * _map = IsInWorld() ? GetMap() : sMapMgr->FindMap(GetMapId(), GetInstanceId()); ASSERT(_map); GameObject *pGameObject = _map->GetGameObject(guid); if (pGameObject) { - pObjectQR = sObjectMgr.GetGOQuestRelationBounds(pGameObject->GetEntry()); - pObjectQIR = sObjectMgr.GetGOQuestInvolvedRelationBounds(pGameObject->GetEntry()); + pObjectQR = sObjectMgr->GetGOQuestRelationBounds(pGameObject->GetEntry()); + pObjectQIR = sObjectMgr->GetGOQuestInvolvedRelationBounds(pGameObject->GetEntry()); } else return; @@ -14047,7 +14047,7 @@ void Player::PrepareQuestMenu(uint64 guid) for (QuestRelations::const_iterator i = pObjectQR.first; i != pObjectQR.second; ++i) { uint32 quest_id = i->second; - Quest const* pQuest = sObjectMgr.GetQuestTemplate(quest_id); + Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id); if (!pQuest) continue; QuestStatus status = GetQuestStatus(quest_id); @@ -14074,7 +14074,7 @@ void Player::SendPreparedQuest(uint64 guid) { // Auto open -- maybe also should verify there is no greeting uint32 quest_id = qmi0.m_qId; - Quest const* pQuest = sObjectMgr.GetQuestTemplate(quest_id); + Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id); if (pQuest) { @@ -14120,7 +14120,7 @@ void Player::SendPreparedQuest(uint64 guid) if (pCreature) { uint32 textid = GetGossipTextId(pCreature); - GossipText const* gossiptext = sObjectMgr.GetGossipText(textid); + GossipText const* gossiptext = sObjectMgr->GetGossipText(textid); if (!gossiptext) { qe._Delay = 0; //TEXTEMOTE_MESSAGE; //zyg: player emote @@ -14137,8 +14137,8 @@ void Player::SendPreparedQuest(uint64 guid) int loc_idx = GetSession()->GetSessionDbLocaleIndex(); if (loc_idx >= 0) - if (NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textid)) - sObjectMgr.GetLocaleString(nl->Text_0[0], loc_idx, title); + if (NpcTextLocale const *nl = sObjectMgr->GetNpcTextLocale(textid)) + sObjectMgr->GetLocaleString(nl->Text_0[0], loc_idx, title); } else { @@ -14146,8 +14146,8 @@ void Player::SendPreparedQuest(uint64 guid) int loc_idx = GetSession()->GetSessionDbLocaleIndex(); if (loc_idx >= 0) - if (NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textid)) - sObjectMgr.GetLocaleString(nl->Text_1[0], loc_idx, title); + if (NpcTextLocale const *nl = sObjectMgr->GetNpcTextLocale(textid)) + sObjectMgr->GetLocaleString(nl->Text_1[0], loc_idx, title); } } } @@ -14168,16 +14168,16 @@ Quest const * Player::GetNextQuest(uint64 guid, Quest const *pQuest) Creature *pCreature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this,guid); if (pCreature) - pObjectQR = sObjectMgr.GetCreatureQuestRelationBounds(pCreature->GetEntry()); + pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(pCreature->GetEntry()); else { //we should obtain map pointer from GetMap() in 99% of cases. Special case //only for quests which cast teleport spells on player - Map * _map = IsInWorld() ? GetMap() : sMapMgr.FindMap(GetMapId(), GetInstanceId()); + Map * _map = IsInWorld() ? GetMap() : sMapMgr->FindMap(GetMapId(), GetInstanceId()); ASSERT(_map); GameObject *pGameObject = _map->GetGameObject(guid); if (pGameObject) - pObjectQR = sObjectMgr.GetGOQuestRelationBounds(pGameObject->GetEntry()); + pObjectQR = sObjectMgr->GetGOQuestRelationBounds(pGameObject->GetEntry()); else return NULL; } @@ -14186,7 +14186,7 @@ Quest const * Player::GetNextQuest(uint64 guid, Quest const *pQuest) for (QuestRelations::const_iterator itr = pObjectQR.first; itr != pObjectQR.second; ++itr) { if (itr->second == nextQuestID) - return sObjectMgr.GetQuestTemplate(nextQuestID); + return sObjectMgr->GetQuestTemplate(nextQuestID); } return NULL; @@ -14198,7 +14198,7 @@ bool Player::CanSeeStartQuest(Quest const *pQuest) SatisfyQuestExclusiveGroup(pQuest, false) && SatisfyQuestReputation(pQuest, false) && SatisfyQuestPreviousQuest(pQuest, false) && SatisfyQuestNextChain(pQuest, false) && SatisfyQuestPrevChain(pQuest, false) && SatisfyQuestDay(pQuest, false) && SatisfyQuestWeek(pQuest, false) && - !sDisableMgr.IsDisabledFor(DISABLE_TYPE_QUEST, pQuest->GetQuestId(), this)) + !sDisableMgr->IsDisabledFor(DISABLE_TYPE_QUEST, pQuest->GetQuestId(), this)) { return getLevel() + sWorld.getIntConfig(CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF) >= pQuest->GetMinLevel(); } @@ -14214,7 +14214,7 @@ bool Player::CanTakeQuest(Quest const *pQuest, bool msg) && SatisfyQuestPreviousQuest(pQuest, msg) && SatisfyQuestTimed(pQuest, msg) && SatisfyQuestNextChain(pQuest, msg) && SatisfyQuestPrevChain(pQuest, msg) && SatisfyQuestDay(pQuest, msg) && SatisfyQuestWeek(pQuest, msg) - && !sDisableMgr.IsDisabledFor(DISABLE_TYPE_QUEST, pQuest->GetQuestId(), this) + && !sDisableMgr->IsDisabledFor(DISABLE_TYPE_QUEST, pQuest->GetQuestId(), this) && SatisfyQuestConditions(pQuest, msg); } @@ -14250,7 +14250,7 @@ bool Player::CanCompleteQuest(uint32 quest_id) if (q_status.m_status == QUEST_STATUS_COMPLETE) return false; // not allow re-complete quest - Quest const* qInfo = sObjectMgr.GetQuestTemplate(quest_id); + Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest_id); if (!qInfo) return false; @@ -14469,7 +14469,7 @@ void Player::AddQuest(Quest const *pQuest, Object *questGiver) GetMap()->ScriptsStart(sQuestStartScripts, pQuest->GetQuestStartScript(), questGiver, this); // Some spells applied at quest activation - SpellAreaForQuestMapBounds saBounds = sSpellMgr.GetSpellAreaForQuestMapBounds(quest_id,true); + SpellAreaForQuestMapBounds saBounds = sSpellMgr->GetSpellAreaForQuestMapBounds(quest_id,true); if (saBounds.first != saBounds.second) { uint32 zone, area; @@ -14494,7 +14494,7 @@ void Player::CompleteQuest(uint32 quest_id) if (log_slot < MAX_QUEST_LOG_SIZE) SetQuestSlotState(log_slot,QUEST_STATE_COMPLETE); - if (Quest const* qInfo = sObjectMgr.GetQuestTemplate(quest_id)) + if (Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest_id)) { if (qInfo->HasFlag(QUEST_FLAGS_AUTO_REWARDED)) RewardQuest(qInfo,0,this,false); @@ -14671,7 +14671,7 @@ void Player::RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver, uint32 area = 0; // remove auras from spells with quest reward state limitations - SpellAreaForQuestMapBounds saEndBounds = sSpellMgr.GetSpellAreaForQuestEndMapBounds(quest_id); + SpellAreaForQuestMapBounds saEndBounds = sSpellMgr->GetSpellAreaForQuestEndMapBounds(quest_id); if (saEndBounds.first != saEndBounds.second) { GetZoneAndAreaId(zone,area); @@ -14682,7 +14682,7 @@ void Player::RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver, } // Some spells applied at quest reward - SpellAreaForQuestMapBounds saBounds = sSpellMgr.GetSpellAreaForQuestMapBounds(quest_id,false); + SpellAreaForQuestMapBounds saBounds = sSpellMgr->GetSpellAreaForQuestMapBounds(quest_id,false); if (saBounds.first != saBounds.second) { if (!zone || !area) @@ -14700,7 +14700,7 @@ void Player::RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver, void Player::FailQuest(uint32 questId) { - if (Quest const* pQuest = sObjectMgr.GetQuestTemplate(questId)) + if (Quest const* pQuest = sObjectMgr->GetQuestTemplate(questId)) { SetQuestStatus(questId, QUEST_STATUS_FAILED); @@ -14825,7 +14825,7 @@ bool Player::SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg) uint32 prevId = abs(*iter); QuestStatusMap::iterator i_prevstatus = mQuestStatus.find(prevId); - Quest const* qPrevInfo = sObjectMgr.GetQuestTemplate(prevId); + Quest const* qPrevInfo = sObjectMgr->GetQuestTemplate(prevId); if (qPrevInfo && i_prevstatus != mQuestStatus.end()) { @@ -14838,8 +14838,8 @@ bool Player::SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg) // each-from-all exclusive group (< 0) // can be start if only all quests in prev quest exclusive group completed and rewarded - ObjectMgr::ExclusiveQuestGroups::iterator iter2 = sObjectMgr.mExclusiveQuestGroups.lower_bound(qPrevInfo->GetExclusiveGroup()); - ObjectMgr::ExclusiveQuestGroups::iterator end = sObjectMgr.mExclusiveQuestGroups.upper_bound(qPrevInfo->GetExclusiveGroup()); + ObjectMgr::ExclusiveQuestGroups::iterator iter2 = sObjectMgr->mExclusiveQuestGroups.lower_bound(qPrevInfo->GetExclusiveGroup()); + ObjectMgr::ExclusiveQuestGroups::iterator end = sObjectMgr->mExclusiveQuestGroups.upper_bound(qPrevInfo->GetExclusiveGroup()); ASSERT(iter2 != end); // always must be found if qPrevInfo->ExclusiveGroup != 0 @@ -14873,8 +14873,8 @@ bool Player::SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg) // each-from-all exclusive group (< 0) // can be start if only all quests in prev quest exclusive group active - ObjectMgr::ExclusiveQuestGroups::iterator iter2 = sObjectMgr.mExclusiveQuestGroups.lower_bound(qPrevInfo->GetExclusiveGroup()); - ObjectMgr::ExclusiveQuestGroups::iterator end = sObjectMgr.mExclusiveQuestGroups.upper_bound(qPrevInfo->GetExclusiveGroup()); + ObjectMgr::ExclusiveQuestGroups::iterator iter2 = sObjectMgr->mExclusiveQuestGroups.lower_bound(qPrevInfo->GetExclusiveGroup()); + ObjectMgr::ExclusiveQuestGroups::iterator end = sObjectMgr->mExclusiveQuestGroups.upper_bound(qPrevInfo->GetExclusiveGroup()); ASSERT(iter2 != end); // always must be found if qPrevInfo->ExclusiveGroup != 0 @@ -14960,8 +14960,8 @@ bool Player::SatisfyQuestStatus(Quest const* qInfo, bool msg) bool Player::SatisfyQuestConditions(Quest const* qInfo, bool msg) { - ConditionList conditions = sConditionMgr.GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_ACCEPT, qInfo->GetQuestId()); - if (!sConditionMgr.IsPlayerMeetToConditions(this, conditions)) + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_ACCEPT, qInfo->GetQuestId()); + if (!sConditionMgr->IsPlayerMeetToConditions(this, conditions)) { if (msg) SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ); @@ -14988,8 +14988,8 @@ bool Player::SatisfyQuestExclusiveGroup(Quest const* qInfo, bool msg) if (qInfo->GetExclusiveGroup() <= 0) return true; - ObjectMgr::ExclusiveQuestGroups::iterator iter = sObjectMgr.mExclusiveQuestGroups.lower_bound(qInfo->GetExclusiveGroup()); - ObjectMgr::ExclusiveQuestGroups::iterator end = sObjectMgr.mExclusiveQuestGroups.upper_bound(qInfo->GetExclusiveGroup()); + ObjectMgr::ExclusiveQuestGroups::iterator iter = sObjectMgr->mExclusiveQuestGroups.lower_bound(qInfo->GetExclusiveGroup()); + ObjectMgr::ExclusiveQuestGroups::iterator end = sObjectMgr->mExclusiveQuestGroups.upper_bound(qInfo->GetExclusiveGroup()); ASSERT(iter != end); // always must be found if qInfo->ExclusiveGroup != 0 @@ -15002,7 +15002,7 @@ bool Player::SatisfyQuestExclusiveGroup(Quest const* qInfo, bool msg) continue; // not allow have daily quest if daily quest from exclusive group already recently completed - Quest const* Nquest = sObjectMgr.GetQuestTemplate(exclude_Id); + Quest const* Nquest = sObjectMgr->GetQuestTemplate(exclude_Id); if (!SatisfyQuestDay(Nquest, false) || !SatisfyQuestWeek(Nquest, false)) { if (msg) @@ -15153,7 +15153,7 @@ bool Player::GiveQuestSourceItem(Quest const *pQuest) bool Player::TakeQuestSourceItem(uint32 quest_id, bool msg) { - Quest const* qInfo = sObjectMgr.GetQuestTemplate(quest_id); + Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest_id); if (qInfo) { uint32 srcitem = qInfo->GetSrcItemId(); @@ -15181,7 +15181,7 @@ bool Player::TakeQuestSourceItem(uint32 quest_id, bool msg) bool Player::GetQuestRewardStatus(uint32 quest_id) const { - Quest const* qInfo = sObjectMgr.GetQuestTemplate(quest_id); + Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest_id); if (qInfo) { // for repeatable quests: rewarded field is set after first reward only to prevent getting XP more than once @@ -15208,7 +15208,7 @@ QuestStatus Player::GetQuestStatus(uint32 quest_id) const bool Player::CanShareQuest(uint32 quest_id) const { - Quest const* qInfo = sObjectMgr.GetQuestTemplate(quest_id); + Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest_id); if (qInfo && qInfo->HasFlag(QUEST_FLAGS_SHARABLE)) { QuestStatusMap::const_iterator itr = mQuestStatus.find(quest_id); @@ -15220,7 +15220,7 @@ bool Player::CanShareQuest(uint32 quest_id) const void Player::SetQuestStatus(uint32 quest_id, QuestStatus status) { - if (sObjectMgr.GetQuestTemplate(quest_id)) + if (sObjectMgr->GetQuestTemplate(quest_id)) { QuestStatusData& q_status = mQuestStatus[quest_id]; @@ -15236,7 +15236,7 @@ void Player::SetQuestStatus(uint32 quest_id, QuestStatus status) // not used in Trinity, but used in scripting code uint16 Player::GetReqKillOrCastCurrentCount(uint32 quest_id, int32 entry) { - Quest const* qInfo = sObjectMgr.GetQuestTemplate(quest_id); + Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest_id); if (!qInfo) return 0; @@ -15327,7 +15327,7 @@ void Player::ItemAddedQuestCheck(uint32 entry, uint32 count) if (q_status.m_status != QUEST_STATUS_INCOMPLETE) continue; - Quest const* qInfo = sObjectMgr.GetQuestTemplate(questid); + Quest const* qInfo = sObjectMgr->GetQuestTemplate(questid); if (!qInfo || !qInfo->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) continue; @@ -15362,7 +15362,7 @@ void Player::ItemRemovedQuestCheck(uint32 entry, uint32 count) uint32 questid = GetQuestSlotQuestId(i); if (!questid) continue; - Quest const* qInfo = sObjectMgr.GetQuestTemplate(questid); + Quest const* qInfo = sObjectMgr->GetQuestTemplate(questid); if (!qInfo) continue; if (!qInfo->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) @@ -15427,7 +15427,7 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid) if (!questid) continue; - Quest const* qInfo = sObjectMgr.GetQuestTemplate(questid); + Quest const* qInfo = sObjectMgr->GetQuestTemplate(questid); if (!qInfo) continue; // just if !ingroup || !noraidgroup || raidgroup @@ -15483,7 +15483,7 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id) if (!questid) continue; - Quest const* qInfo = sObjectMgr.GetQuestTemplate(questid); + Quest const* qInfo = sObjectMgr->GetQuestTemplate(questid); if (!qInfo) continue; @@ -15560,7 +15560,7 @@ void Player::TalkedToCreature(uint32 entry, uint64 guid) if (!questid) continue; - Quest const* qInfo = sObjectMgr.GetQuestTemplate(questid); + Quest const* qInfo = sObjectMgr->GetQuestTemplate(questid); if (!qInfo) continue; @@ -15616,7 +15616,7 @@ void Player::MoneyChanged(uint32 count) if (!questid) continue; - Quest const* qInfo = sObjectMgr.GetQuestTemplate(questid); + Quest const* qInfo = sObjectMgr->GetQuestTemplate(questid); if (qInfo && qInfo->GetRewOrReqMoney() < 0) { QuestStatusData& q_status = mQuestStatus[questid]; @@ -15644,7 +15644,7 @@ void Player::ReputationChanged(FactionEntry const* factionEntry) { if (uint32 questid = GetQuestSlotQuestId(i)) { - if (Quest const* qInfo = sObjectMgr.GetQuestTemplate(questid)) + if (Quest const* qInfo = sObjectMgr->GetQuestTemplate(questid)) { if (qInfo->GetRepObjectiveFaction() == factionEntry->ID) { @@ -15672,7 +15672,7 @@ void Player::ReputationChanged2(FactionEntry const* factionEntry) { if (uint32 questid = GetQuestSlotQuestId(i)) { - if (Quest const* qInfo = sObjectMgr.GetQuestTemplate(questid)) + if (Quest const* qInfo = sObjectMgr->GetQuestTemplate(questid)) { if (qInfo->GetRepObjectiveFaction2() == factionEntry->ID) { @@ -15710,7 +15710,7 @@ bool Player::HasQuestForItem(uint32 itemid) const if (q_status.m_status == QUEST_STATUS_INCOMPLETE) { - Quest const* qinfo = sObjectMgr.GetQuestTemplate(questid); + Quest const* qinfo = sObjectMgr->GetQuestTemplate(questid); if (!qinfo) continue; @@ -15767,7 +15767,7 @@ void Player::SendQuestReward(Quest const *pQuest, uint32 XP, Object * questGiver { uint32 questid = pQuest->GetQuestId(); sLog.outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questid); - sGameEventMgr.HandleQuestComplete(questid); + sGameEventMgr->HandleQuestComplete(questid); WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4)); data << uint32(questid); @@ -15830,8 +15830,8 @@ void Player::SendQuestConfirmAccept(const Quest* pQuest, Player* pReceiver) int loc_idx = pReceiver->GetSession()->GetSessionDbLocaleIndex(); if (loc_idx >= 0) - if (const QuestLocale* pLocale = sObjectMgr.GetQuestLocale(pQuest->GetQuestId())) - sObjectMgr.GetLocaleString(pLocale->Title, loc_idx, strTitle); + if (const QuestLocale* pLocale = sObjectMgr->GetQuestLocale(pQuest->GetQuestId())) + sObjectMgr->GetLocaleString(pLocale->Title, loc_idx, strTitle); WorldPacket data(SMSG_QUEST_CONFIRM_ACCEPT, (4 + strTitle.size() + 8)); data << uint32(pQuest->GetQuestId()); @@ -15923,7 +15923,7 @@ void Player::_LoadArenaTeamInfo(PreparedQueryResult result) uint32 played_season = fields[2].GetUInt32(); uint32 wons_season = fields[3].GetUInt32(); - ArenaTeam* aTeam = sObjectMgr.GetArenaTeamById(arenateamid); + ArenaTeam* aTeam = sObjectMgr->GetArenaTeamById(arenateamid); if (!aTeam) { sLog.outError("Player::_LoadArenaTeamInfo: couldn't load arenateam %u", arenateamid); @@ -16120,7 +16120,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) // check name limitations if (ObjectMgr::CheckPlayerName(m_name) != CHAR_NAME_SUCCESS || - (GetSession()->GetSecurity() == SEC_PLAYER && sObjectMgr.IsReservedName(m_name))) + (GetSession()->GetSecurity() == SEC_PLAYER && sObjectMgr->IsReservedName(m_name))) { CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid ='%u'", uint32(AT_LOGIN_RENAME),guid); return false; @@ -16226,7 +16226,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) if (!arena_team_id) continue; - if (ArenaTeam * at = sObjectMgr.GetArenaTeamById(arena_team_id)) + if (ArenaTeam * at = sObjectMgr->GetArenaTeamById(arena_team_id)) if (at->HaveMember(GetGUID())) continue; @@ -16256,13 +16256,13 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) { Battleground *currentBg = NULL; if (m_bgData.bgInstanceID) //saved in Battleground - currentBg = sBattlegroundMgr.GetBattleground(m_bgData.bgInstanceID, BATTLEGROUND_TYPE_NONE); + currentBg = sBattlegroundMgr->GetBattleground(m_bgData.bgInstanceID, BATTLEGROUND_TYPE_NONE); bool player_at_bg = currentBg && currentBg->IsPlayerInBattleground(GetGUID()); if (player_at_bg && currentBg->GetStatus() != STATUS_WAIT_LEAVE) { - BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr.BGQueueTypeId(currentBg->GetTypeID(true), currentBg->GetArenaType()); + BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(currentBg->GetTypeID(true), currentBg->GetArenaType()); AddBattlegroundQueueId(bgQueueTypeId); m_bgData.bgTypeID = currentBg->GetTypeID(true); @@ -16316,7 +16316,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) } else { - for (MapManager::TransportSet::iterator iter = sMapMgr.m_Transports.begin(); iter != sMapMgr.m_Transports.end(); ++iter) + for (MapManager::TransportSet::iterator iter = sMapMgr->m_Transports.begin(); iter != sMapMgr->m_Transports.end(); ++iter) { if ((*iter)->GetGUIDLow() == transGUID) { @@ -16402,12 +16402,12 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) // NOW player must have valid map // load the player's map here if it's not already loaded - Map *map = sMapMgr.CreateMap(mapId, this, instanceId); + Map *map = sMapMgr->CreateMap(mapId, this, instanceId); if (!map) { instanceId = 0; - AreaTrigger const* at = sObjectMgr.GetGoBackTrigger(mapId); + AreaTrigger const* at = sObjectMgr->GetGoBackTrigger(mapId); if (at) { sLog.outError("Player (guidlow %d) is teleported to gobacktrigger (Map: %u X: %f Y: %f Z: %f O: %f).",guid,mapId,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation()); @@ -16420,14 +16420,14 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) RelocateToHomebind(); } - map = sMapMgr.CreateMap(mapId, this, 0); + map = sMapMgr->CreateMap(mapId, this, 0); if (!map) { - PlayerInfo const *info = sObjectMgr.GetPlayerInfo(getRace(), getClass()); + PlayerInfo const *info = sObjectMgr->GetPlayerInfo(getRace(), getClass()); mapId = info->mapId; Relocate(info->positionX,info->positionY,info->positionZ,0.0f); sLog.outError("Player (guidlow %d) have invalid coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.",guid,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation()); - map = sMapMgr.CreateMap(mapId, this, 0); + map = sMapMgr->CreateMap(mapId, this, 0); if (!map) { sLog.outError("Player (guidlow %d) has invalid default map coordinates (X: %f Y: %f Z: %f O: %f). or instance couldn't be created",guid,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation()); @@ -16437,9 +16437,9 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) } // if the player is in an instance and it has been reset in the meantime teleport him to the entrance - if (instanceId && !sInstanceSaveMgr.GetInstanceSave(instanceId)) + if (instanceId && !sInstanceSaveMgr->GetInstanceSave(instanceId)) { - AreaTrigger const* at = sObjectMgr.GetMapEntranceTrigger(mapId); + AreaTrigger const* at = sObjectMgr->GetMapEntranceTrigger(mapId); if (at) Relocate(at->target_X, at->target_Y, at->target_Z, at->target_Orientation); else @@ -16608,7 +16608,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) // unread mails and next delivery time, actual mails not loaded _LoadMailInit(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADMAILCOUNT), holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADMAILDATE)); - m_social = sSocialMgr.LoadFromDB(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADSOCIALLIST), GetGUIDLow()); + m_social = sSocialMgr->LoadFromDB(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADSOCIALLIST), GetGUIDLow()); // check PLAYER_CHOSEN_TITLE compatibility with PLAYER__FIELD_KNOWN_TITLES // note: PLAYER__FIELD_KNOWN_TITLES updated at quest status loaded @@ -17264,7 +17264,7 @@ void Player::_LoadQuestStatus(PreparedQueryResult result) uint32 quest_id = fields[0].GetUInt32(); // used to be new, no delete? - Quest const* pQuest = sObjectMgr.GetQuestTemplate(quest_id); + Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id); if (pQuest) { // find or create @@ -17372,7 +17372,7 @@ void Player::_LoadDailyQuestStatus(PreparedQueryResult result) do { Field* fields = result->Fetch(); - if (Quest const* qQuest = sObjectMgr.GetQuestTemplate(fields[0].GetUInt32())) + if (Quest const* qQuest = sObjectMgr->GetQuestTemplate(fields[0].GetUInt32())) { if (qQuest->IsDFQuest()) { @@ -17393,7 +17393,7 @@ void Player::_LoadDailyQuestStatus(PreparedQueryResult result) // save _any_ from daily quest times (it must be after last reset anyway) m_lastDailyQuestTime = (time_t)fields[1].GetUInt64(); - Quest const* pQuest = sObjectMgr.GetQuestTemplate(quest_id); + Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id); if (!pQuest) continue; @@ -17417,7 +17417,7 @@ void Player::_LoadWeeklyQuestStatus(PreparedQueryResult result) do { uint32 quest_id = (*result)[0].GetUInt32(); - Quest const* pQuest = sObjectMgr.GetQuestTemplate(quest_id); + Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id); if (!pQuest) continue; @@ -17447,7 +17447,7 @@ void Player::_LoadGroup(PreparedQueryResult result) //QueryResult *result = CharacterDatabase.PQuery("SELECT guid FROM group_member WHERE memberGuid=%u", GetGUIDLow()); if (result) { - if (Group* group = sObjectMgr.GetGroupByGUID((*result)[0].GetUInt32())) + if (Group* group = sObjectMgr->GetGroupByGUID((*result)[0].GetUInt32())) { uint8 subgroup = group->GetMemberGroup(GetGUID()); SetGroup(group, subgroup); @@ -17516,7 +17516,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result) } // since non permanent binds are always solo bind, they can always be reset - if (InstanceSave *save = sInstanceSaveMgr.AddInstanceSave(mapId, instanceId, Difficulty(difficulty), resetTime, !perm, true)) + if (InstanceSave *save = sInstanceSaveMgr->AddInstanceSave(mapId, instanceId, Difficulty(difficulty), resetTime, !perm, true)) BindToInstance(save, perm, true); } while (result->NextRow()); @@ -17751,7 +17751,7 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report else if (ar->item2 && !HasItemCount(ar->item2, 1)) missingItem = ar->item2; - if (sDisableMgr.IsDisabledFor(DISABLE_TYPE_MAP, target_map, this)) + if (sDisableMgr->IsDisabledFor(DISABLE_TYPE_MAP, target_map, this)) { GetSession()->SendAreaTriggerMessage("%s", GetSession()->GetTrinityString(LANG_INSTANCE_CLOSED)); return false; @@ -17810,12 +17810,12 @@ bool Player::CheckInstanceLoginValid() } // do checks for satisfy accessreqs, instance full, encounter in progress (raid), perm bind group != perm bind player - return sMapMgr.CanPlayerEnter(GetMap()->GetId(), this, true); + return sMapMgr->CanPlayerEnter(GetMap()->GetId(), this, true); } bool Player::_LoadHomeBind(PreparedQueryResult result) { - PlayerInfo const *info = sObjectMgr.GetPlayerInfo(getRace(), getClass()); + PlayerInfo const *info = sObjectMgr->GetPlayerInfo(getRace(), getClass()); if (!info) { sLog.outError("Player have incorrect race/class pair. Can't be loaded."); @@ -18689,7 +18689,7 @@ void Player::ResetInstances(uint8 method, bool isRaid) } // if the map is loaded, reset it - Map *map = sMapMgr.FindMap(p->GetMapId(), p->GetInstanceId()); + Map *map = sMapMgr->FindMap(p->GetMapId(), p->GetInstanceId()); if (map && map->IsDungeon()) if (!((InstanceMap*)map)->Reset(method)) { @@ -18766,7 +18766,7 @@ void Player::UpdateDuelFlag(time_t currTime) if (!duel || duel->startTimer == 0 ||currTime < duel->startTimer + 3) return; - sScriptMgr.OnPlayerDuelStart(this, duel->opponent); + sScriptMgr->OnPlayerDuelStart(this, duel->opponent); SetUInt32Value(PLAYER_DUEL_TEAM, 1); duel->opponent->SetUInt32Value(PLAYER_DUEL_TEAM, 2); @@ -18921,7 +18921,7 @@ inline void Player::BuildPlayerChat(WorldPacket *data, uint8 msgtype, const std: void Player::Say(const std::string& text, const uint32 language) { std::string _text(text); - sScriptMgr.OnPlayerChat(this, CHAT_MSG_SAY, language, _text); + sScriptMgr->OnPlayerChat(this, CHAT_MSG_SAY, language, _text); WorldPacket data(SMSG_MESSAGECHAT, 200); BuildPlayerChat(&data, CHAT_MSG_SAY, _text, language); @@ -18931,7 +18931,7 @@ void Player::Say(const std::string& text, const uint32 language) void Player::Yell(const std::string& text, const uint32 language) { std::string _text(text); - sScriptMgr.OnPlayerChat(this, CHAT_MSG_YELL, language, _text); + sScriptMgr->OnPlayerChat(this, CHAT_MSG_YELL, language, _text); WorldPacket data(SMSG_MESSAGECHAT, 200); BuildPlayerChat(&data, CHAT_MSG_YELL, _text, language); @@ -18941,7 +18941,7 @@ void Player::Yell(const std::string& text, const uint32 language) void Player::TextEmote(const std::string& text) { std::string _text(text); - sScriptMgr.OnPlayerChat(this, CHAT_MSG_EMOTE, LANG_UNIVERSAL, _text); + sScriptMgr->OnPlayerChat(this, CHAT_MSG_EMOTE, LANG_UNIVERSAL, _text); WorldPacket data(SMSG_MESSAGECHAT, 200); BuildPlayerChat(&data, CHAT_MSG_EMOTE, _text, LANG_UNIVERSAL); @@ -18953,10 +18953,10 @@ void Player::Whisper(const std::string& text, uint32 language, uint64 receiver) if (language != LANG_ADDON) // if not addon data language = LANG_UNIVERSAL; // whispers should always be readable - Player *rPlayer = sObjectMgr.GetPlayer(receiver); + Player *rPlayer = sObjectMgr->GetPlayer(receiver); std::string _text(text); - sScriptMgr.OnPlayerChat(this, CHAT_MSG_WHISPER, language, _text, rPlayer); + sScriptMgr->OnPlayerChat(this, CHAT_MSG_WHISPER, language, _text, rPlayer); // when player you are whispering to is dnd, he cannot receive your message, unless you are in gm mode if (!rPlayer->isDND() || isGameMaster()) @@ -19117,8 +19117,8 @@ void Player::VehicleSpellInitialize() if (!spellInfo) continue; - ConditionList conditions = sConditionMgr.GetConditionsForVehicleSpell(veh->ToCreature()->GetEntry(), spellId); - if (!sConditionMgr.IsPlayerMeetToConditions(this, conditions)) + ConditionList conditions = sConditionMgr->GetConditionsForVehicleSpell(veh->ToCreature()->GetEntry(), spellId); + if (!sConditionMgr->IsPlayerMeetToConditions(this, conditions)) { sLog.outDebug("VehicleSpellInitialize: conditions not met for Vehicle entry %u spell %u", veh->ToCreature()->GetEntry(), spellId); continue; @@ -19214,7 +19214,7 @@ bool Player::IsAffectedBySpellmod(SpellEntry const *spellInfo, SpellModifier *mo if (mod->op == SPELLMOD_DURATION && GetSpellDuration(spellInfo) == -1) return false; - return sSpellMgr.IsAffectedByMod(spellInfo, mod); + return sSpellMgr->IsAffectedByMod(spellInfo, mod); } void Player::AddSpellMod(SpellModifier* mod, bool apply) @@ -19384,7 +19384,7 @@ void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type) uint64 petitionguid = MAKE_NEW_GUID(fields[1].GetUInt32(), 0, HIGHGUID_ITEM); // send update if charter owner in game - Player* owner = sObjectMgr.GetPlayer(ownerguid); + Player* owner = sObjectMgr->GetPlayer(ownerguid); if (owner) owner->GetSession()->SendPetitionQueryOpcode(petitionguid); @@ -19422,7 +19422,7 @@ void Player::LeaveAllArenaTeams(uint64 guid) uint32 at_id = fields[0].GetUInt32(); if (at_id != 0) { - ArenaTeam * at = sObjectMgr.GetArenaTeamById(at_id); + ArenaTeam * at = sObjectMgr->GetArenaTeamById(at_id); if (at) at->DelMember(guid); } @@ -19586,7 +19586,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc uint32 path, cost; lastnode = nodes[i]; - sObjectMgr.GetTaxiPath(prevnode, lastnode, path, cost); + sObjectMgr->GetTaxiPath(prevnode, lastnode, path, cost); if (!path) { @@ -19610,7 +19610,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc // only one mount ID for both sides. Probably not good to use 315 in case DBC nodes // change but I couldn't find a suitable alternative. OK to use class because only DK // can use this taxi. - uint32 mount_display_id = sObjectMgr.GetTaxiMountDisplayId(sourcenode, GetTeam(), npc == NULL || (sourcenode == 315 && getClass() == CLASS_DEATH_KNIGHT)); + uint32 mount_display_id = sObjectMgr->GetTaxiMountDisplayId(sourcenode, GetTeam(), npc == NULL || (sourcenode == 315 && getClass() == CLASS_DEATH_KNIGHT)); // in spell case allow 0 model if ((mount_display_id == 0 && spellid == 0) || sourcepath == 0) @@ -19693,7 +19693,7 @@ void Player::ContinueTaxiFlight() sLog.outDebug("WORLD: Restart character %u taxi flight", GetGUIDLow()); - uint32 mountDisplayId = sObjectMgr.GetTaxiMountDisplayId(sourceNode, GetTeam(),true); + uint32 mountDisplayId = sObjectMgr->GetTaxiMountDisplayId(sourceNode, GetTeam(),true); uint32 path = m_taxi.GetCurrentTaxiPath(); // search appropriate start path node @@ -19823,7 +19823,7 @@ void Player::InitDataForForm(bool reapplyMods) void Player::InitDisplayIds() { - PlayerInfo const *info = sObjectMgr.GetPlayerInfo(getRace(), getClass()); + PlayerInfo const *info = sObjectMgr->GetPlayerInfo(getRace(), getClass()); if (!info) { sLog.outError("Player %u has incorrect race/class pair. Can't init display ids.", GetGUIDLow()); @@ -20060,7 +20060,7 @@ uint32 Player::GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot) uint32 max_personal_rating = 0; for (uint8 i = minarenaslot; i < MAX_ARENA_SLOT; ++i) { - if (ArenaTeam * at = sObjectMgr.GetArenaTeamById(GetArenaTeamId(i))) + if (ArenaTeam * at = sObjectMgr->GetArenaTeamById(GetArenaTeamId(i))) { uint32 p_rating = GetArenaPersonalRating(i); uint32 t_rating = at->GetRating(); @@ -20489,7 +20489,7 @@ void Player::SetBattlegroundEntryPoint() // If map is dungeon find linked graveyard if (GetMap()->IsDungeon()) { - if (const WorldSafeLocsEntry* entry = sObjectMgr.GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam())) + if (const WorldSafeLocsEntry* entry = sObjectMgr->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam())) { m_bgData.joinPos = WorldLocation(entry->map_id, entry->x, entry->y, entry->z, 0.0f); return; @@ -20574,7 +20574,7 @@ void Player::ReportedAfkBy(Player* reporter) WorldLocation Player::GetStartPosition() const { - PlayerInfo const *info = sObjectMgr.GetPlayerInfo(getRace(), getClass()); + PlayerInfo const *info = sObjectMgr->GetPlayerInfo(getRace(), getClass()); uint32 mapId = info->mapId; if (getClass() == CLASS_DEATH_KNIGHT && HasSpell(50977)) mapId = 0; @@ -20827,7 +20827,7 @@ void Player::InitPrimaryProfessions() void Player::ModifyMoney(int32 d) { - sScriptMgr.OnPlayerMoneyChanged(this, d); + sScriptMgr->OnPlayerMoneyChanged(this, d); if (d < 0) SetMoney (GetMoney() > uint32(-d) ? GetMoney() + d : 0); @@ -21197,7 +21197,7 @@ void Player::resetSpells(bool myClassOnly) continue; // skip spells with first rank learned as talent (and all talents then also) - uint32 first_rank = sSpellMgr.GetFirstSpellInChain(spellInfo->Id); + uint32 first_rank = sSpellMgr->GetFirstSpellInChain(spellInfo->Id); if (GetTalentSpellCost(first_rank) > 0) continue; @@ -21217,7 +21217,7 @@ void Player::resetSpells(bool myClassOnly) void Player::learnDefaultSpells() { // learn default race/class spells - PlayerInfo const *info = sObjectMgr.GetPlayerInfo(getRace(),getClass()); + PlayerInfo const *info = sObjectMgr->GetPlayerInfo(getRace(),getClass()); for (PlayerCreateInfoSpells::const_iterator itr = info->spell.begin(); itr != info->spell.end(); ++itr) { uint32 tspell = *itr; @@ -21266,10 +21266,10 @@ void Player::learnQuestRewardedSpells(Quest const* quest) // prevent learn non first rank unknown profession and second specialization for same profession) uint32 learned_0 = spellInfo->EffectTriggerSpell[0]; - if (sSpellMgr.GetSpellRank(learned_0) > 1 && !HasSpell(learned_0)) + if (sSpellMgr->GetSpellRank(learned_0) > 1 && !HasSpell(learned_0)) { // not have first rank learned (unlearned prof?) - uint32 first_spell = sSpellMgr.GetFirstSpellInChain(learned_0); + uint32 first_spell = sSpellMgr->GetFirstSpellInChain(learned_0); if (!HasSpell(first_spell)) return; @@ -21277,7 +21277,7 @@ void Player::learnQuestRewardedSpells(Quest const* quest) if (!learnedInfo) return; - SpellsRequiringSpellMapBounds spellsRequired = sSpellMgr.GetSpellsRequiredForSpellBounds(learned_0); + SpellsRequiringSpellMapBounds spellsRequired = sSpellMgr->GetSpellsRequiredForSpellBounds(learned_0); for (SpellsRequiringSpellMap::const_iterator itr2 = spellsRequired.first; itr2 != spellsRequired.second; ++itr2) { uint32 profSpell = itr2->second; @@ -21300,7 +21300,7 @@ void Player::learnQuestRewardedSpells(Quest const* quest) continue; // compare same chain spells - if (sSpellMgr.IsSpellRequiringSpell(itr->first, profSpell)) + if (sSpellMgr->IsSpellRequiringSpell(itr->first, profSpell)) return; } } @@ -21319,7 +21319,7 @@ void Player::learnQuestRewardedSpells() if (!itr->second.m_rewarded) continue; - Quest const* quest = sObjectMgr.GetQuestTemplate(itr->first); + Quest const* quest = sObjectMgr->GetQuestTemplate(itr->first); if (!quest) continue; @@ -21398,7 +21398,7 @@ void Player::SendAurasForTarget(Unit *target) void Player::SetDailyQuestStatus(uint32 quest_id) { - if (Quest const* qQuest = sObjectMgr.GetQuestTemplate(quest_id)) + if (Quest const* qQuest = sObjectMgr->GetQuestTemplate(quest_id)) { if (!qQuest->IsDFQuest()) { @@ -21456,7 +21456,7 @@ Battleground* Player::GetBattleground() const if (GetBattlegroundId() == 0) return NULL; - return sBattlegroundMgr.GetBattleground(GetBattlegroundId(), m_bgData.bgTypeID); + return sBattlegroundMgr->GetBattleground(GetBattlegroundId(), m_bgData.bgTypeID); } bool Player::InArena() const @@ -21471,7 +21471,7 @@ bool Player::InArena() const bool Player::GetBGAccessByLevel(BattlegroundTypeId bgTypeId) const { // get a template bg instead of running one - Battleground *bg = sBattlegroundMgr.GetBattlegroundTemplate(bgTypeId); + Battleground *bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId); if (!bg) return false; @@ -21504,7 +21504,7 @@ bool Player::IsSpellFitByClassAndRace(uint32 spell_id) const uint32 racemask = getRaceMask(); uint32 classmask = getClassMask(); - SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spell_id); + SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spell_id); if (bounds.first == bounds.second) return true; @@ -21540,7 +21540,7 @@ bool Player::HasQuestForGO(int32 GOId) const if (qs.m_status == QUEST_STATUS_INCOMPLETE) { - Quest const* qinfo = sObjectMgr.GetQuestTemplate(questid); + Quest const* qinfo = sObjectMgr->GetQuestTemplate(questid); if (!qinfo) continue; @@ -21584,7 +21584,7 @@ void Player::UpdateForQuestWorldObjects() if (!obj->HasFlag(UNIT_NPC_FLAGS,UNIT_NPC_FLAG_SPELLCLICK)) continue; - SpellClickInfoMapBounds clickPair = sObjectMgr.GetSpellClickInfoMapBounds(obj->GetEntry()); + SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(obj->GetEntry()); for (SpellClickInfoMap::const_iterator _itr = clickPair.first; _itr != clickPair.second; ++_itr) if (_itr->second.questStart || _itr->second.questEnd) { @@ -21686,7 +21686,7 @@ void Player::AutoUnequipOffhandIfNeed(bool force /*= false*/) OutdoorPvP * Player::GetOutdoorPvP() const { - return sOutdoorPvPMgr.GetOutdoorPvPToZoneId(GetZoneId()); + return sOutdoorPvPMgr->GetOutdoorPvPToZoneId(GetZoneId()); } bool Player::HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item const* ignoreItem) @@ -22109,7 +22109,7 @@ void Player::SetClientControl(Unit* target, uint8 allowMove) void Player::UpdateZoneDependentAuras(uint32 newZone) { // Some spells applied at enter into zone (with subzones), aura removed in UpdateAreaDependentAuras that called always at zone->area update - SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAreaMapBounds(newZone); + SpellAreaForAreaMapBounds saBounds = sSpellMgr->GetSpellAreaForAreaMapBounds(newZone); for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) if (itr->second->autocast && itr->second->IsFitToRequirements(this,newZone,0)) if (!HasAura(itr->second->spellId)) @@ -22122,14 +22122,14 @@ void Player::UpdateAreaDependentAuras(uint32 newArea) for (AuraMap::iterator iter = m_ownedAuras.begin(); iter != m_ownedAuras.end();) { // use m_zoneUpdateId for speed: UpdateArea called from UpdateZone or instead UpdateZone in both cases m_zoneUpdateId up-to-date - if (sSpellMgr.GetSpellAllowedInLocationError(iter->second->GetSpellProto(),GetMapId(),m_zoneUpdateId,newArea,this) != SPELL_CAST_OK) + if (sSpellMgr->GetSpellAllowedInLocationError(iter->second->GetSpellProto(),GetMapId(),m_zoneUpdateId,newArea,this) != SPELL_CAST_OK) RemoveOwnedAura(iter); else ++iter; } // some auras applied at subzone enter - SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAreaMapBounds(newArea); + SpellAreaForAreaMapBounds saBounds = sSpellMgr->GetSpellAreaForAreaMapBounds(newArea); for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) if (itr->second->autocast && itr->second->IsFitToRequirements(this,m_zoneUpdateId,newArea)) if (!HasAura(itr->second->spellId)) @@ -22270,14 +22270,14 @@ PartyResult Player::CanUninviteFromGroup() const if (grp->isLFGGroup()) { uint64 gguid = grp->GetGUID(); - if (!sLFGMgr.GetKicksLeft(gguid)) + if (!sLFGMgr->GetKicksLeft(gguid)) return ERR_PARTY_LFG_BOOT_LIMIT; - LfgState state = sLFGMgr.GetState(gguid); + LfgState state = sLFGMgr->GetState(gguid); if (state == LFG_STATE_BOOT) return ERR_PARTY_LFG_BOOT_IN_PROGRESS; - if (grp->GetMembersCount() <= sLFGMgr.GetVotesNeeded(gguid)) + if (grp->GetMembersCount() <= sLFGMgr->GetVotesNeeded(gguid)) return ERR_PARTY_LFG_BOOT_TOO_FEW_PLAYERS; if (state == LFG_STATE_FINISHED_DUNGEON) @@ -22307,7 +22307,7 @@ PartyResult Player::CanUninviteFromGroup() const bool Player::isUsingLfg() { uint64 guid = GetGUID(); - return sLFGMgr.GetState(guid) != LFG_STATE_NONE; + return sLFGMgr->GetState(guid) != LFG_STATE_NONE; } void Player::SetBattlegroundRaid(Group* group, int8 subgroup) @@ -22948,7 +22948,7 @@ void Player::learnSpellHighRank(uint32 spellid) { learnSpell(spellid, false); - if (uint32 next = sSpellMgr.GetNextSpellInChain(spellid)) + if (uint32 next = sSpellMgr->GetNextSpellInChain(spellid)) learnSpellHighRank(next); } @@ -23496,7 +23496,7 @@ bool Player::canSeeSpellClickOn(Creature const *c) const if (!c->HasFlag(UNIT_NPC_FLAGS,UNIT_NPC_FLAG_SPELLCLICK)) return false; - SpellClickInfoMapBounds clickPair = sObjectMgr.GetSpellClickInfoMapBounds(c->GetEntry()); + SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(c->GetEntry()); if (clickPair.first == clickPair.second) return true; @@ -23753,7 +23753,7 @@ void Player::SetEquipmentSet(uint32 index, EquipmentSet eqset) if (eqset.Guid == 0) { - eqslot.Guid = sObjectMgr.GenerateEquipmentSetGuid(); + eqslot.Guid = sObjectMgr->GenerateEquipmentSetGuid(); WorldPacket data(SMSG_EQUIPMENT_SET_SAVED, 4 + 1); data << uint32(index); @@ -24150,9 +24150,10 @@ uint32 Player::GetReputation(uint32 factionentry) { return GetReputationMgr().GetReputation(sFactionStore.LookupEntry(factionentry)); } + std::string Player::GetGuildName() { - return sObjectMgr.GetGuildById(GetGuildId())->GetName(); + return sObjectMgr->GetGuildById(GetGuildId())->GetName(); } void Player::SendDuelCountdown(uint32 counter) diff --git a/src/server/game/Entities/Player/SocialMgr.cpp b/src/server/game/Entities/Player/SocialMgr.cpp index b31f655fe21..5bd02968759 100755 --- a/src/server/game/Entities/Player/SocialMgr.cpp +++ b/src/server/game/Entities/Player/SocialMgr.cpp @@ -126,7 +126,7 @@ void PlayerSocial::SendSocialList(Player* plr) for (PlayerSocialMap::iterator itr = m_playerSocialMap.begin(); itr != m_playerSocialMap.end(); ++itr) { - sSocialMgr.GetFriendInfo(plr, itr->first, itr->second); + sSocialMgr->GetFriendInfo(plr, itr->first, itr->second); data << uint64(itr->first); // player guid data << uint32(itr->second.Flags); // player flag (0x1-friend?, 0x2-ignored?, 0x4-muted?) diff --git a/src/server/game/Entities/Player/SocialMgr.h b/src/server/game/Entities/Player/SocialMgr.h index e64b82fdfa2..69d4eba9bf5 100755 --- a/src/server/game/Entities/Player/SocialMgr.h +++ b/src/server/game/Entities/Player/SocialMgr.h @@ -156,6 +156,6 @@ class SocialMgr SocialMap m_socialMap; }; -#define sSocialMgr (*ACE_Singleton<SocialMgr, ACE_Null_Mutex>::instance()) +#define sSocialMgr ACE_Singleton<SocialMgr, ACE_Null_Mutex>::instance() #endif diff --git a/src/server/game/Entities/Totem/Totem.cpp b/src/server/game/Entities/Totem/Totem.cpp index 5455644bd7f..842199dc84c 100755 --- a/src/server/game/Entities/Totem/Totem.cpp +++ b/src/server/game/Entities/Totem/Totem.cpp @@ -57,8 +57,8 @@ void Totem::InitStats(uint32 duration) CreatureInfo const *cinfo = GetCreatureInfo(); if (m_owner->GetTypeId() == TYPEID_PLAYER && cinfo) { - uint32 display_id = sObjectMgr.ChooseDisplayId(m_owner->ToPlayer()->GetTeam(), cinfo); - CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id); + uint32 display_id = sObjectMgr->ChooseDisplayId(m_owner->ToPlayer()->GetTeam(), cinfo); + CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(display_id); if (minfo) display_id = minfo->modelid; switch (m_owner->ToPlayer()->GetTeam()) diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 1e055d9da2f..421a931005f 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -50,7 +50,7 @@ void MapManager::LoadTransports() uint32 entry = fields[1].GetUInt32(); std::string name = fields[2].GetString(); uint32 period = fields[3].GetUInt32(); - uint32 scriptId = sObjectMgr.GetScriptId(fields[4].GetCString()); + uint32 scriptId = sObjectMgr->GetScriptId(fields[4].GetCString()); Transport *t = new Transport(period, scriptId); @@ -101,7 +101,7 @@ void MapManager::LoadTransports() m_TransportsByMap[*i].insert(t); //If we someday decide to use the grid to track transports, here: - t->SetMap(sMapMgr.CreateMap(mapid, t, 0)); + t->SetMap(sMapMgr->CreateMap(mapid, t, 0)); t->AddToWorld(); ++count; @@ -502,7 +502,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z) RemoveFromWorld(); ResetMap(); - Map * newMap = sMapMgr.CreateMap(newMapid, this, 0); + Map * newMap = sMapMgr->CreateMap(newMapid, this, 0); SetMap(newMap); ASSERT (GetMap()); AddToWorld(); @@ -522,7 +522,7 @@ bool Transport::AddPassenger(Player* passenger) if (m_passengers.insert(passenger).second) sLog.outDetail("Player %s boarded transport %s.", passenger->GetName(), GetName()); - sScriptMgr.OnAddPassenger(this, passenger); + sScriptMgr->OnAddPassenger(this, passenger); return true; } @@ -531,7 +531,7 @@ bool Transport::RemovePassenger(Player* passenger) if (m_passengers.erase(passenger)) sLog.outDetail("Player %s removed from transport %s.", passenger->GetName(), GetName()); - sScriptMgr.OnRemovePassenger(this, passenger); + sScriptMgr->OnRemovePassenger(this, passenger); return true; } @@ -568,7 +568,7 @@ void Transport::Update(uint32 p_diff) UpdateNPCPositions(); // COME BACK MARKER } - sScriptMgr.OnRelocate(this, m_curr->first, m_curr->second.mapid, m_curr->second.x, m_curr->second.y, m_curr->second.z); + sScriptMgr->OnRelocate(this, m_curr->first, m_curr->second.mapid, m_curr->second.x, m_curr->second.y, m_curr->second.z); m_nextNodeTime = m_curr->first; @@ -579,7 +579,7 @@ void Transport::Update(uint32 p_diff) sLog.outDetail("%s moved to %d %f %f %f %d", m_name.c_str(), m_curr->second.id, m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid); } - sScriptMgr.OnTransportUpdate(this, p_diff); + sScriptMgr->OnTransportUpdate(this, p_diff); } void Transport::UpdateForMap(Map const* targetMap) @@ -644,7 +644,7 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y, Map* map = GetMap(); Creature* pCreature = new Creature; - if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, GetPhaseMask(), entry, 0, GetGOInfo()->faction, 0, 0, 0, 0)) + if (!pCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, GetPhaseMask(), entry, 0, GetGOInfo()->faction, 0, 0, 0, 0)) { delete pCreature; return 0; @@ -685,7 +685,7 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y, currenttguid = std::max(tguid, currenttguid); pCreature->SetGUIDTransport(tguid); - sScriptMgr.OnAddCreaturePassenger(this, pCreature); + sScriptMgr->OnAddCreaturePassenger(this, pCreature); return tguid; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 88799c8f2dd..8da94c2d403 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1438,7 +1438,7 @@ bool Unit::IsDamageReducedByArmor(SpellSchoolMask schoolMask, SpellEntry const * if (spellInfo) { // there are spells with no specific attribute but they have "ignores armor" in tooltip - if (sSpellMgr.GetSpellCustomAttr(spellInfo->Id) & SPELL_ATTR0_CU_IGNORE_ARMOR) + if (sSpellMgr->GetSpellCustomAttr(spellInfo->Id) & SPELL_ATTR0_CU_IGNORE_ARMOR) return false; // bleeding effects are not reduced by armor @@ -1887,8 +1887,8 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff int32 remainingHp = int32(pVictim->GetHealth() - RemainingDamage); // min pct of hp is stored in effect 0 of talent spell - uint32 rank = sSpellMgr.GetSpellRank(spellProto->Id); - SpellEntry const * talentProto = sSpellStore.LookupEntry(sSpellMgr.GetSpellWithRank(49189, rank)); + uint32 rank = sSpellMgr->GetSpellRank(spellProto->Id); + SpellEntry const * talentProto = sSpellStore.LookupEntry(sSpellMgr->GetSpellWithRank(49189, rank)); int32 minHp = int32(pVictim->CountPctFromMaxHealth(SpellMgr::CalculateSpellEffectAmount(talentProto, EFFECT_0, (*itr)->GetCaster()))); // Damage that would take you below [effect0] health or taken while you are at [effect0] @@ -3743,7 +3743,7 @@ bool Unit::_IsNoStackAuraDueToAura(Aura * appliedAura, Aura * existingAura) cons return false; // passive non-stackable spells not stackable only with another rank of same spell - if (!sSpellMgr.IsRankSpellDueToSpell(spellProto, i_spellId)) + if (!sSpellMgr->IsRankSpellDueToSpell(spellProto, i_spellId)) return false; } @@ -3763,7 +3763,7 @@ bool Unit::_IsNoStackAuraDueToAura(Aura * appliedAura, Aura * existingAura) cons if (is_triggered_by_spell) return false; - if (sSpellMgr.CanAurasStack(appliedAura, existingAura, sameCaster)) + if (sSpellMgr->CanAurasStack(appliedAura, existingAura, sameCaster)) return false; return true; } @@ -4362,12 +4362,12 @@ AuraEffect * Unit::GetAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster) AuraEffect * Unit::GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, uint64 caster) const { - uint32 rankSpell = sSpellMgr.GetFirstSpellInChain(spellId); + uint32 rankSpell = sSpellMgr->GetFirstSpellInChain(spellId); while (true) { if (AuraEffect * aurEff = GetAuraEffect(rankSpell, effIndex, caster)) return aurEff; - SpellChainNode const * chainNode = sSpellMgr.GetSpellChainNode(rankSpell); + SpellChainNode const * chainNode = sSpellMgr->GetSpellChainNode(rankSpell); if (!chainNode) break; else @@ -4425,12 +4425,12 @@ Aura * Unit::GetAura(uint32 spellId, uint64 casterGUID, uint64 itemCasterGUID, u AuraApplication * Unit::GetAuraApplicationOfRankedSpell(uint32 spellId, uint64 casterGUID, uint64 itemCasterGUID, uint8 reqEffMask, AuraApplication* except) const { - uint32 rankSpell = sSpellMgr.GetFirstSpellInChain(spellId); + uint32 rankSpell = sSpellMgr->GetFirstSpellInChain(spellId); while (true) { if (AuraApplication * aurApp = GetAuraApplication(rankSpell, casterGUID, itemCasterGUID, reqEffMask, except)) return aurApp; - SpellChainNode const * chainNode = sSpellMgr.GetSpellChainNode(rankSpell); + SpellChainNode const * chainNode = sSpellMgr->GetSpellChainNode(rankSpell); if (!chainNode) break; else @@ -5207,7 +5207,7 @@ bool Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger } // default case - if ((!target && !sSpellMgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) + if ((!target && !sSpellMgr->IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) return false; if (cooldown && GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->HasSpellCooldown(triggered_spell_id)) @@ -7574,7 +7574,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger // Lightning Shield if (AuraEffect const * aurEff = GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0x400, 0, 0)) { - uint32 spell = sSpellMgr.GetSpellWithRank(26364, sSpellMgr.GetSpellRank(aurEff->GetId())); + uint32 spell = sSpellMgr->GetSpellWithRank(26364, sSpellMgr->GetSpellRank(aurEff->GetId())); // custom cooldown processing case if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->HasSpellCooldown(spell)) @@ -7779,7 +7779,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger if (spellProto->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && spellProto->SpellFamilyFlags[0] & 0x2000) { - SpellChainNode const* newChain = sSpellMgr.GetSpellChainNode(itr->first); + SpellChainNode const* newChain = sSpellMgr->GetSpellChainNode(itr->first); // No chain entry or entry lower than found entry if (!chain || !newChain || (chain->rank < newChain->rank)) @@ -7877,7 +7877,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger } // default case - if ((!target && !sSpellMgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) + if ((!target && !sSpellMgr->IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) return false; if (cooldown_spell_id == 0) @@ -7939,7 +7939,7 @@ bool Unit::HandleObsModEnergyAuraProc(Unit *pVictim, uint32 /*damage*/, AuraEffe } // default case - if ((!target && !sSpellMgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) + if ((!target && !sSpellMgr->IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) return false; if (cooldown && GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->HasSpellCooldown(triggered_spell_id)) @@ -7996,7 +7996,7 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 /*damage*/, Aur } // default case - if ((!target && !sSpellMgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) + if ((!target && !sSpellMgr->IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) return false; if (cooldown && GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->HasSpellCooldown(triggered_spell_id)) @@ -8578,7 +8578,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig // Lightning Shield (overwrite non existing triggered spell call in spell.dbc if (auraSpellInfo->SpellFamilyFlags[0] & 0x400) { - trigger_spell_id = sSpellMgr.GetSpellWithRank(26364, sSpellMgr.GetSpellRank(auraSpellInfo->Id)); + trigger_spell_id = sSpellMgr->GetSpellWithRank(26364, sSpellMgr->GetSpellRank(auraSpellInfo->Id)); } // Nature's Guardian else if (auraSpellInfo->SpellIconID == 2013) @@ -8891,7 +8891,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig { // have rank dependent proc chance, ignore too often cases // PPM = 2.5 * (rank of talent), - uint32 rank = sSpellMgr.GetSpellRank(auraSpellInfo->Id); + uint32 rank = sSpellMgr->GetSpellRank(auraSpellInfo->Id); // 5 rank -> 100% 4 rank -> 80% and etc from full rate if (!roll_chance_i(20*rank)) return false; @@ -9014,7 +9014,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig target = !(procFlags & (PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS)) && IsPositiveSpell(trigger_spell_id) ? this : pVictim; // default case - if ((!target && !sSpellMgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) + if ((!target && !sSpellMgr->IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) return false; if (basepoints0) @@ -10439,7 +10439,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 { if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0,0x02000000,0)) { - if (SpellChainNode const *chain = sSpellMgr.GetSpellChainNode((*i)->GetId())) + if (SpellChainNode const *chain = sSpellMgr->GetSpellChainNode((*i)->GetId())) AddPctF(DoneTotalMod, chain->rank * 2.0f); } break; @@ -10657,7 +10657,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 // Check for table values float coeff = 0; - SpellBonusEntry const *bonus = sSpellMgr.GetSpellBonusData(spellProto->Id); + SpellBonusEntry const *bonus = sSpellMgr->GetSpellBonusData(spellProto->Id); if (bonus) { if (damagetype == DOT) @@ -11169,7 +11169,7 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint } // Check for table values - SpellBonusEntry const* bonus = !scripted ? sSpellMgr.GetSpellBonusData(spellProto->Id) : NULL; + SpellBonusEntry const* bonus = !scripted ? sSpellMgr->GetSpellBonusData(spellProto->Id) : NULL; float coeff = 0; float factorMod = 1.0f; if (bonus) @@ -11669,7 +11669,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att case 7293: { if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0,0x02000000,0)) - if (SpellChainNode const *chain = sSpellMgr.GetSpellChainNode((*i)->GetId())) + if (SpellChainNode const *chain = sSpellMgr->GetSpellChainNode((*i)->GetId())) AddPctF(DoneTotalMod, chain->rank * 2.0f); break; } @@ -12946,8 +12946,8 @@ int32 Unit::ModSpellDuration(SpellEntry const* spellProto, Unit const* target, i if (target->GetTypeId() == TYPEID_PLAYER) { if (spellProto->SpellFamilyName == SPELLFAMILY_POTION && ( - sSpellMgr.IsSpellMemberOfSpellGroup(spellProto->Id, SPELL_GROUP_ELIXIR_BATTLE) || - sSpellMgr.IsSpellMemberOfSpellGroup(spellProto->Id, SPELL_GROUP_ELIXIR_GUARDIAN))) + sSpellMgr->IsSpellMemberOfSpellGroup(spellProto->Id, SPELL_GROUP_ELIXIR_BATTLE) || + sSpellMgr->IsSpellMemberOfSpellGroup(spellProto->Id, SPELL_GROUP_ELIXIR_GUARDIAN))) { if (target->HasAura(53042) && target->HasSpell(spellProto->EffectTriggerSpell[0])) duration *= 2; @@ -13835,14 +13835,14 @@ void CharmInfo::InitCharmCreateSpells() bool CharmInfo::AddSpellToActionBar(uint32 spell_id, ActiveStates newstate) { - uint32 first_id = sSpellMgr.GetFirstSpellInChain(spell_id); + uint32 first_id = sSpellMgr->GetFirstSpellInChain(spell_id); // new spell rank can be already listed for (uint8 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i) { if (uint32 action = PetActionBar[i].GetAction()) { - if (PetActionBar[i].IsActionBarForSpell() && sSpellMgr.GetFirstSpellInChain(action) == first_id) + if (PetActionBar[i].IsActionBarForSpell() && sSpellMgr->GetFirstSpellInChain(action) == first_id) { PetActionBar[i].SetAction(spell_id); return true; @@ -13864,13 +13864,13 @@ bool CharmInfo::AddSpellToActionBar(uint32 spell_id, ActiveStates newstate) bool CharmInfo::RemoveSpellFromActionBar(uint32 spell_id) { - uint32 first_id = sSpellMgr.GetFirstSpellInChain(spell_id); + uint32 first_id = sSpellMgr->GetFirstSpellInChain(spell_id); for (uint8 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i) { if (uint32 action = PetActionBar[i].GetAction()) { - if (PetActionBar[i].IsActionBarForSpell() && sSpellMgr.GetFirstSpellInChain(action) == first_id) + if (PetActionBar[i].IsActionBarForSpell() && sSpellMgr->GetFirstSpellInChain(action) == first_id) { SetActionBar(i,0,ACT_PASSIVE); return true; @@ -14477,7 +14477,7 @@ void Unit::StopMoving() // send explicit stop packet // rely on vmaps here because for example stormwind is in air - //float z = sMapMgr.GetBaseMap(GetMapId())->GetHeight(GetPositionX(), GetPositionY(), GetPositionZ(), true); + //float z = sMapMgr->GetBaseMap(GetMapId())->GetHeight(GetPositionX(), GetPositionY(), GetPositionZ(), true); //if (fabs(GetPositionZ() - z) < 2.0f) // Relocate(GetPositionX(), GetPositionY(), z); //Relocate(GetPositionX(), GetPositionY(),GetPositionZ()); @@ -14556,7 +14556,7 @@ void Unit::ClearComboPointHolders() { uint32 lowguid = *m_ComboPointHolders.begin(); - Player* plr = sObjectMgr.GetPlayer(MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER)); + Player* plr = sObjectMgr->GetPlayer(MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER)); if (plr && plr->GetComboTarget() == GetGUID()) // recheck for safe plr->ClearComboPoints(); // remove also guid from m_ComboPointHolders; else @@ -14922,7 +14922,7 @@ bool Unit::InitTamedPet(Pet * pet, uint8 level, uint32 spell_id) return false; } - pet->GetCharmInfo()->SetPetNumber(sObjectMgr.GeneratePetNumber(), true); + pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true); // this enables pet details window (Shift+P) pet->InitPetCreateSpells(); //pet->InitLevelupSpellsForLevel(); @@ -14935,7 +14935,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co SpellEntry const *spellProto = aura->GetSpellProto(); // Get proc Event Entry - spellProcEvent = sSpellMgr.GetSpellProcEvent(spellProto->Id); + spellProcEvent = sSpellMgr->GetSpellProcEvent(spellProto->Id); // Get EventProcFlag uint32 EventProcFlag; @@ -14955,7 +14955,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co } // Check spellProcEvent data requirements - if (!sSpellMgr.IsSpellProcEventCanTriggeredBy(spellProcEvent, EventProcFlag, procSpell, procFlag, procExtra, active)) + if (!sSpellMgr->IsSpellProcEventCanTriggeredBy(spellProcEvent, EventProcFlag, procSpell, procFlag, procExtra, active)) return false; // In most cases req get honor or XP from kill if (EventProcFlag & PROC_FLAG_KILL && GetTypeId() == TYPEID_PLAYER) @@ -15188,7 +15188,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) group->UpdateLooterGuid(creature, true); if (group->GetLooterGuid()) { - pLooter = sObjectMgr.GetPlayer(group->GetLooterGuid()); + pLooter = sObjectMgr->GetPlayer(group->GetLooterGuid()); if (pLooter) { creature->SetLootRecipient(pLooter); // update creature loot recipient to the allowed looter. @@ -15353,7 +15353,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) // the reset time is set but not added to the scheduler // until the players leave the instance time_t resettime = creature->GetRespawnTimeEx() + 2 * HOUR; - if (InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(creature->GetInstanceId())) + if (InstanceSave *save = sInstanceSaveMgr->GetInstanceSave(creature->GetInstanceId())) if (save->GetResetTime() < resettime) save->SetResetTime(resettime); } } @@ -15398,13 +15398,13 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) { Player *killer = this->ToPlayer(); Player *killed = pVictim->ToPlayer(); - sScriptMgr.OnPVPKill(killer, killed); + sScriptMgr->OnPVPKill(killer, killed); } else if (pVictim->GetTypeId() == TYPEID_UNIT) { Player *killer = this->ToPlayer(); Creature *killed = pVictim->ToCreature(); - sScriptMgr.OnCreatureKill(killer, killed); + sScriptMgr->OnCreatureKill(killer, killed); } } else if (this->GetTypeId() == TYPEID_UNIT) @@ -15413,7 +15413,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) { Creature *killer = this->ToCreature(); Player *killed = pVictim->ToPlayer(); - sScriptMgr.OnPlayerKilledByCreature(killer, killed); + sScriptMgr->OnPlayerKilledByCreature(killer, killed); } } } @@ -15731,7 +15731,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type) //just to enable stat window if (GetCharmInfo()) - GetCharmInfo()->SetPetNumber(sObjectMgr.GeneratePetNumber(), true); + GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true); //if charmed two demons the same session, the 2nd gets the 1st one's name SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index f6be128a239..06e9ca5cbf5 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -114,12 +114,12 @@ void Vehicle::Install() Reset(); if (GetBase()->GetTypeId() == TYPEID_UNIT) - sScriptMgr.OnInstall(this); + sScriptMgr->OnInstall(this); } void Vehicle::InstallAllAccessories(uint32 entry) { - VehicleAccessoryList const* mVehicleList = sObjectMgr.GetVehicleAccessoryList(entry); + VehicleAccessoryList const* mVehicleList = sObjectMgr->GetVehicleAccessoryList(entry); if (!mVehicleList) return; @@ -138,7 +138,7 @@ void Vehicle::Uninstall() RemoveAllPassengers(); if (GetBase()->GetTypeId() == TYPEID_UNIT) - sScriptMgr.OnUninstall(this); + sScriptMgr->OnUninstall(this); } void Vehicle::Die() @@ -152,7 +152,7 @@ void Vehicle::Die() RemoveAllPassengers(); if (GetBase()->GetTypeId() == TYPEID_UNIT) - sScriptMgr.OnDie(this); + sScriptMgr->OnDie(this); } void Vehicle::Reset() @@ -171,7 +171,7 @@ void Vehicle::Reset() } if (GetBase()->GetTypeId() == TYPEID_UNIT) - sScriptMgr.OnReset(this); + sScriptMgr->OnReset(this); } void Vehicle::RemoveAllPassengers() @@ -263,7 +263,7 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion) accessory->SendMovementFlagUpdate(); if (GetBase()->GetTypeId() == TYPEID_UNIT) - sScriptMgr.OnInstallAccessory(this, accessory); + sScriptMgr->OnInstallAccessory(this, accessory); } } @@ -329,7 +329,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId) if (!me->SetCharmedBy(unit, CHARM_TYPE_VEHICLE)) ASSERT(false); - if (VehicleScalingInfo const *scalingInfo = sObjectMgr.GetVehicleScalingInfo(m_vehicleInfo->m_ID)) + if (VehicleScalingInfo const *scalingInfo = sObjectMgr->GetVehicleScalingInfo(m_vehicleInfo->m_ID)) { Player *plr = unit->ToPlayer(); float averageItemLevel = plr->GetAverageItemLevel(); @@ -360,7 +360,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId) unit->UpdateObjectVisibility(false); if (GetBase()->GetTypeId() == TYPEID_UNIT) - sScriptMgr.OnAddPassenger(this, unit, seatId); + sScriptMgr->OnAddPassenger(this, unit, seatId); return true; } @@ -416,7 +416,7 @@ void Vehicle::RemovePassenger(Unit *unit) me->CastSpell(unit, VEHICLE_SPELL_PARACHUTE, true); if (GetBase()->GetTypeId() == TYPEID_UNIT) - sScriptMgr.OnRemovePassenger(this, unit); + sScriptMgr->OnRemovePassenger(this, unit); } void Vehicle::RelocatePassengers(float x, float y, float z, float ang) diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 6a7c8ecbbb2..407e816f7e2 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -496,7 +496,7 @@ void GameEventMgr::LoadFromDB() if (newModelEquipSet.equipment_id > 0) { - if (!sObjectMgr.GetEquipmentInfo(newModelEquipSet.equipment_id)) + if (!sObjectMgr->GetEquipmentInfo(newModelEquipSet.equipment_id)) { sLog.outErrorDb("Table `game_event_model_equip` have creature (Guid: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", guid, newModelEquipSet.equipment_id); continue; @@ -818,11 +818,11 @@ void GameEventMgr::LoadFromDB() // get creature entry newEntry.entry = 0; - if (CreatureData const* data = sObjectMgr.GetCreatureData(guid)) + if (CreatureData const* data = sObjectMgr->GetCreatureData(guid)) newEntry.entry = data->id; // check validity with event's npcflag - if (!sObjectMgr.IsVendorItemValid(newEntry.entry, newEntry.item, newEntry.maxcount, newEntry.incrtime, newEntry.ExtendedCost, NULL, NULL, event_npc_flag)) + if (!sObjectMgr->IsVendorItemValid(newEntry.entry, newEntry.item, newEntry.maxcount, newEntry.incrtime, newEntry.ExtendedCost, NULL, NULL, event_npc_flag)) continue; ++count; vendors.push_back(newEntry); @@ -952,7 +952,7 @@ void GameEventMgr::LoadFromDB() continue; } - if (!sPoolMgr.CheckPool(entry)) + if (!sPoolMgr->CheckPool(entry)) { sLog.outErrorDb("Pool Id (%u) has all creatures or gameobjects with explicit chance sum <>100 and no equal chance defined. The pool system cannot pick one to spawn.", entry); continue; @@ -1150,7 +1150,7 @@ void GameEventMgr::UpdateEventNPCFlags(uint16 event_id) for (NPCFlagList::iterator itr = mGameEventNPCFlags[event_id].begin(); itr != mGameEventNPCFlags[event_id].end(); ++itr) { // get the creature data from the low guid to get the entry, to be able to find out the whole guid - if (CreatureData const* data = sObjectMgr.GetCreatureData(itr->first)) + if (CreatureData const* data = sObjectMgr->GetCreatureData(itr->first)) { Creature * cr = HashMapHolder<Creature>::Find(MAKE_NEW_GUID(itr->first,data->id,HIGHGUID_UNIT)); // if we found the creature, modify its npcflag @@ -1173,7 +1173,7 @@ void GameEventMgr::UpdateBattlegroundSettings() uint32 mask = 0; for (ActiveEvents::const_iterator itr = m_ActiveEvents.begin(); itr != m_ActiveEvents.end(); ++itr) mask |= mGameEventBattlegroundHolidays[*itr]; - sBattlegroundMgr.SetHolidayWeekends(mask); + sBattlegroundMgr->SetHolidayWeekends(mask); } void GameEventMgr::UpdateEventNPCVendor(uint16 event_id, bool activate) @@ -1181,9 +1181,9 @@ void GameEventMgr::UpdateEventNPCVendor(uint16 event_id, bool activate) for (NPCVendorList::iterator itr = mGameEventVendors[event_id].begin(); itr != mGameEventVendors[event_id].end(); ++itr) { if (activate) - sObjectMgr.AddVendorItem(itr->entry, itr->item, itr->maxcount, itr->incrtime, itr->ExtendedCost, false); + sObjectMgr->AddVendorItem(itr->entry, itr->item, itr->maxcount, itr->incrtime, itr->ExtendedCost, false); else - sObjectMgr.RemoveVendorItem(itr->entry, itr->item, false); + sObjectMgr->RemoveVendorItem(itr->entry, itr->item, false); } } @@ -1201,12 +1201,12 @@ void GameEventMgr::GameEventSpawn(int16 event_id) for (GuidList::iterator itr = mGameEventCreatureGuids[internal_event_id].begin(); itr != mGameEventCreatureGuids[internal_event_id].end(); ++itr) { // Add to correct cell - if (CreatureData const* data = sObjectMgr.GetCreatureData(*itr)) + if (CreatureData const* data = sObjectMgr->GetCreatureData(*itr)) { - sObjectMgr.AddCreatureToGrid(*itr, data); + sObjectMgr->AddCreatureToGrid(*itr, data); // Spawn if necessary (loaded grids only) - Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(data->mapid)); + Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(data->mapid)); // We use spawn coords to spawn if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { @@ -1230,12 +1230,12 @@ void GameEventMgr::GameEventSpawn(int16 event_id) for (GuidList::iterator itr = mGameEventGameobjectGuids[internal_event_id].begin(); itr != mGameEventGameobjectGuids[internal_event_id].end(); ++itr) { // Add to correct cell - if (GameObjectData const* data = sObjectMgr.GetGOData(*itr)) + if (GameObjectData const* data = sObjectMgr->GetGOData(*itr)) { - sObjectMgr.AddGameobjectToGrid(*itr, data); + sObjectMgr->AddGameobjectToGrid(*itr, data); // Spawn if necessary (loaded grids only) // this base map checked as non-instanced and then only existed - Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(data->mapid)); + Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(data->mapid)); // We use current coords to unspawn, not spawn coords since creature can have changed grid if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { @@ -1260,7 +1260,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) } for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin(); itr != mGameEventPoolIds[internal_event_id].end(); ++itr) - sPoolMgr.SpawnPool(*itr); + sPoolMgr->SpawnPool(*itr); } void GameEventMgr::GameEventUnspawn(int16 event_id) @@ -1280,9 +1280,9 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) if (event_id > 0 && hasCreatureActiveEventExcept(*itr,event_id)) continue; // Remove the creature from grid - if (CreatureData const* data = sObjectMgr.GetCreatureData(*itr)) + if (CreatureData const* data = sObjectMgr->GetCreatureData(*itr)) { - sObjectMgr.RemoveCreatureFromGrid(*itr, data); + sObjectMgr->RemoveCreatureFromGrid(*itr, data); if (Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_UNIT), (Creature*)NULL)) pCreature->AddObjectToRemoveList(); @@ -1302,9 +1302,9 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) if (event_id >0 && hasGameObjectActiveEventExcept(*itr,event_id)) continue; // Remove the gameobject from grid - if (GameObjectData const* data = sObjectMgr.GetGOData(*itr)) + if (GameObjectData const* data = sObjectMgr->GetGOData(*itr)) { - sObjectMgr.RemoveGameobjectFromGrid(*itr, data); + sObjectMgr->RemoveGameobjectFromGrid(*itr, data); if (GameObject* pGameobject = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL)) pGameobject->AddObjectToRemoveList(); @@ -1318,7 +1318,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin(); itr != mGameEventPoolIds[internal_event_id].end(); ++itr) { - sPoolMgr.DespawnPool(*itr); + sPoolMgr->DespawnPool(*itr); } } @@ -1327,7 +1327,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate) for (ModelEquipList::iterator itr = mGameEventModelEquip[event_id].begin(); itr != mGameEventModelEquip[event_id].end(); ++itr) { // Remove the creature from grid - CreatureData const* data = sObjectMgr.GetCreatureData(itr->first); + CreatureData const* data = sObjectMgr->GetCreatureData(itr->first); if (!data) continue; @@ -1342,7 +1342,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate) pCreature->LoadEquipment(itr->second.equipment_id, true); if (itr->second.modelid >0 && itr->second.modelid_prev != itr->second.modelid) { - CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(itr->second.modelid); + CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelInfo(itr->second.modelid); if (minfo) { pCreature->SetDisplayId(itr->second.modelid); @@ -1357,7 +1357,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate) pCreature->LoadEquipment(itr->second.equipement_id_prev, true); if (itr->second.modelid_prev >0 && itr->second.modelid_prev != itr->second.modelid) { - CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(itr->second.modelid_prev); + CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelInfo(itr->second.modelid_prev); if (minfo) { pCreature->SetDisplayId(itr->second.modelid_prev); @@ -1370,12 +1370,12 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate) } else // If not spawned { - CreatureData const* data2 = sObjectMgr.GetCreatureData(itr->first); + CreatureData const* data2 = sObjectMgr->GetCreatureData(itr->first); if (data2 && activate) { CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(data2->id); - uint32 display_id = sObjectMgr.ChooseDisplayId(0,cinfo,data2); - CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id); + uint32 display_id = sObjectMgr->ChooseDisplayId(0,cinfo,data2); + CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(display_id); if (minfo) display_id = minfo->modelid; @@ -1388,7 +1388,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate) } // now last step: put in data // just to have write access to it - CreatureData& data2 = sObjectMgr.NewOrExistCreatureData(itr->first); + CreatureData& data2 = sObjectMgr->NewOrExistCreatureData(itr->first); if (activate) { data2.displayid = itr->second.modelid; @@ -1467,7 +1467,7 @@ void GameEventMgr::UpdateEventQuests(uint16 event_id, bool activate) QuestRelList::iterator itr; for (itr = mGameEventCreatureQuests[event_id].begin(); itr != mGameEventCreatureQuests[event_id].end(); ++itr) { - QuestRelations* CreatureQuestMap = sObjectMgr.GetCreatureQuestRelationMap(); + QuestRelations* CreatureQuestMap = sObjectMgr->GetCreatureQuestRelationMap(); if (activate) // Add the pair(id,quest) to the multimap CreatureQuestMap->insert(QuestRelations::value_type(itr->first, itr->second)); else @@ -1492,7 +1492,7 @@ void GameEventMgr::UpdateEventQuests(uint16 event_id, bool activate) } for (itr = mGameEventGameObjectQuests[event_id].begin(); itr != mGameEventGameObjectQuests[event_id].end(); ++itr) { - QuestRelations* GameObjectQuestMap = sObjectMgr.GetGOQuestRelationMap(); + QuestRelations* GameObjectQuestMap = sObjectMgr->GetGOQuestRelationMap(); if (activate) // Add the pair(id,quest) to the multimap GameObjectQuestMap->insert(QuestRelations::value_type(itr->first, itr->second)); else @@ -1529,7 +1529,7 @@ void GameEventMgr::UpdateWorldStates(uint16 event_id, bool Activate) if (bl && bl->HolidayWorldStateId) { WorldPacket data; - sBattlegroundMgr.BuildUpdateWorldStatePacket(&data, bl->HolidayWorldStateId, Activate ? 1 : 0); + sBattlegroundMgr->BuildUpdateWorldStatePacket(&data, bl->HolidayWorldStateId, Activate ? 1 : 0); sWorld.SendGlobalMessage(&data); } } @@ -1644,8 +1644,8 @@ bool IsHolidayActive(HolidayIds id) if (id == HOLIDAY_NONE) return false; - GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap(); - GameEventMgr::ActiveEvents const& ae = sGameEventMgr.GetActiveEventList(); + GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap(); + GameEventMgr::ActiveEvents const& ae = sGameEventMgr->GetActiveEventList(); for (GameEventMgr::ActiveEvents::const_iterator itr = ae.begin(); itr != ae.end(); ++itr) if (events[*itr].holiday_id == id) @@ -1656,6 +1656,6 @@ bool IsHolidayActive(HolidayIds id) bool IsEventActive(uint16 event_id) { - GameEventMgr::ActiveEvents const& ae = sGameEventMgr.GetActiveEventList(); + GameEventMgr::ActiveEvents const& ae = sGameEventMgr->GetActiveEventList(); return ae.find(event_id) != ae.end(); } diff --git a/src/server/game/Events/GameEventMgr.h b/src/server/game/Events/GameEventMgr.h index a1c10d1552a..bb0ff18a122 100755 --- a/src/server/game/Events/GameEventMgr.h +++ b/src/server/game/Events/GameEventMgr.h @@ -172,7 +172,7 @@ class GameEventMgr GameEventGuidMap mGameEventGameobjectGuids; }; -#define sGameEventMgr (*ACE_Singleton<GameEventMgr, ACE_Null_Mutex>::instance()) +#define sGameEventMgr ACE_Singleton<GameEventMgr, ACE_Null_Mutex>::instance() bool IsHolidayActive(HolidayIds id); bool IsEventActive(uint16 event_id); diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp index a664d797897..2ef43497f9b 100755 --- a/src/server/game/Globals/ObjectAccessor.cpp +++ b/src/server/game/Globals/ObjectAccessor.cpp @@ -221,7 +221,7 @@ void ObjectAccessor::RemoveCorpse(Corpse* corpse) CellPair cell_pair = Trinity::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY()); uint32 cell_id = (cell_pair.y_coord * TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; - sObjectMgr.DeleteCorpseCellData(corpse->GetMapId(), cell_id, GUID_LOPART(corpse->GetOwnerGUID())); + sObjectMgr->DeleteCorpseCellData(corpse->GetMapId(), cell_id, GUID_LOPART(corpse->GetOwnerGUID())); i_player2corpse.erase(iter); } @@ -242,7 +242,7 @@ void ObjectAccessor::AddCorpse(Corpse* corpse) CellPair cell_pair = Trinity::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY()); uint32 cell_id = (cell_pair.y_coord * TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; - sObjectMgr.AddCorpseCellData(corpse->GetMapId(), cell_id, GUID_LOPART(corpse->GetOwnerGUID()), corpse->GetInstanceId()); + sObjectMgr->AddCorpseCellData(corpse->GetMapId(), cell_id, GUID_LOPART(corpse->GetOwnerGUID()), corpse->GetInstanceId()); } } @@ -288,7 +288,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool /*insign // done in removecorpse // remove resurrectable corpse from grid object registry (loaded state checked into call) // do not load the map if it's not loaded - //Map *map = sMapMgr.FindMap(corpse->GetMapId(), corpse->GetInstanceId()); + //Map *map = sMapMgr->FindMap(corpse->GetMapId(), corpse->GetInstanceId()); //if (map) // map->Remove(corpse, false); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index dc6c733b692..4b3b319dff9 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -537,7 +537,7 @@ struct SQLCreatureLoader : public SQLStorageLoaderBase<SQLCreatureLoader> template<class D> void convert_from_str(uint32 /*field_pos*/, char *src, D &dst) { - dst = D(sObjectMgr.GetScriptId(src)); + dst = D(sObjectMgr->GetScriptId(src)); } }; @@ -1307,7 +1307,7 @@ void ObjectMgr::LoadCreatures() spawnMasks[i] |= (1 << k); //TODO: remove this - //sGameEventMgr.mGameEventCreatureGuids.resize(52*2-1); + //sGameEventMgr->mGameEventCreatureGuids.resize(52*2-1); do @@ -1437,14 +1437,14 @@ void ObjectMgr::LoadCreatures() /*if (entry == 30739 || entry == 30740) { gameEvent = 51; - uint32 guid2 = sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT); + uint32 guid2 = sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT); CreatureData& data2 = mCreatureDataMap[guid2]; data2 = data; // data2.id = (entry == 32307 ? 32308 : 32307); data2.id = (entry == 30739 ? 30740 : 30739); data2.displayid = 0; - sGameEventMgr.mGameEventCreatureGuids[51+51].push_back(guid); - sGameEventMgr.mGameEventCreatureGuids[51+50].push_back(guid2); + sGameEventMgr->mGameEventCreatureGuids[51+51].push_back(guid); + sGameEventMgr->mGameEventCreatureGuids[51+50].push_back(guid2); }*/ if (gameEvent == 0 && PoolId == 0) // if not this is to be managed by GameEvent System or Pool system @@ -1496,7 +1496,7 @@ uint32 ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, float y, float if (!goinfo) return 0; - Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(mapId)); + Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(mapId)); if (!map) return 0; @@ -1557,7 +1557,7 @@ bool ObjectMgr::MoveCreData(uint32 guid, uint32 mapId, Position pos) AddCreatureToGrid(guid, &data); // Spawn if necessary (loaded grids only) - if (Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(mapId))) + if (Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(mapId))) { // We use spawn coords to spawn if (!map->Instanceable() && map->IsLoaded(data.posX, data.posY)) @@ -1582,7 +1582,7 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float return 0; uint32 level = cInfo->minlevel == cInfo->maxlevel ? cInfo->minlevel : urand(cInfo->minlevel, cInfo->maxlevel); // Only used for extracting creature base stats - CreatureBaseStats const* stats = sObjectMgr.GetCreatureBaseStats(level, cInfo->unit_class); + CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(level, cInfo->unit_class); uint32 guid = GenerateLowGuid(HIGHGUID_UNIT); CreatureData& data = NewOrExistCreatureData(guid); @@ -1612,7 +1612,7 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float AddCreatureToGrid(guid, &data); // Spawn if necessary (loaded grids only) - if (Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(mapId))) + if (Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(mapId))) { // We use spawn coords to spawn if (!map->Instanceable() && !map->IsRemovalGrid(x, y)) @@ -2005,7 +2005,7 @@ struct SQLItemLoader : public SQLStorageLoaderBase<SQLItemLoader> template<class D> void convert_from_str(uint32 /*field_pos*/, char *src, D &dst) { - dst = D(sObjectMgr.GetScriptId(src)); + dst = D(sObjectMgr->GetScriptId(src)); } }; @@ -2270,7 +2270,7 @@ void ObjectMgr::LoadItemPrototypes() else if (proto->Spells[1].SpellId != -1) { SpellEntry const* spellInfo = sSpellStore.LookupEntry(proto->Spells[1].SpellId); - if (!spellInfo && !sDisableMgr.IsDisabledFor(DISABLE_TYPE_SPELL, proto->Spells[1].SpellId, NULL)) + if (!spellInfo && !sDisableMgr->IsDisabledFor(DISABLE_TYPE_SPELL, proto->Spells[1].SpellId, NULL)) { sLog.outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)",i,1+1,proto->Spells[1].SpellId); const_cast<ItemPrototype*>(proto)->Spells[0].SpellId = 0; @@ -2318,7 +2318,7 @@ void ObjectMgr::LoadItemPrototypes() if (proto->Spells[j].SpellId && proto->Spells[j].SpellId != -1) { SpellEntry const* spellInfo = sSpellStore.LookupEntry(proto->Spells[j].SpellId); - if (!spellInfo && !sDisableMgr.IsDisabledFor(DISABLE_TYPE_SPELL, proto->Spells[j].SpellId, NULL)) + if (!spellInfo && !sDisableMgr->IsDisabledFor(DISABLE_TYPE_SPELL, proto->Spells[j].SpellId, NULL)) { sLog.outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)",i,j+1,proto->Spells[j].SpellId); const_cast<ItemPrototype*>(proto)->Spells[j].SpellId = 0; @@ -3938,7 +3938,7 @@ void ObjectMgr::LoadGroups() diff = 0; // default for both difficaly types } - InstanceSave *save = sInstanceSaveMgr.AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt64()), fields[6].GetBool(), true); + InstanceSave *save = sInstanceSaveMgr->AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt64()), fields[6].GetBool(), true); group->BindToInstance(save, fields[3].GetBool(), true); ++count; } @@ -4021,7 +4021,7 @@ void ObjectMgr::LoadQuests() for (QuestMap::iterator iter = mQuestTemplates.begin(); iter != mQuestTemplates.end(); ++iter) { // skip post-loading checks for disabled quests - if (sDisableMgr.IsDisabledFor(DISABLE_TYPE_QUEST, iter->first, NULL)) + if (sDisableMgr->IsDisabledFor(DISABLE_TYPE_QUEST, iter->first, NULL)) continue; Quest * qinfo = iter->second; @@ -5212,7 +5212,7 @@ void ObjectMgr::LoadSpellScriptNames() if (allRanks) { - if (sSpellMgr.GetFirstSpellInChain(spellId) != uint32(spellId)) + if (sSpellMgr->GetFirstSpellInChain(spellId) != uint32(spellId)) { sLog.outErrorDb("Scriptname:`%s` spell (spell_id:%d) is not first rank of spell.",scriptName,fields[0].GetInt32()); continue; @@ -5220,7 +5220,7 @@ void ObjectMgr::LoadSpellScriptNames() while(spellId) { mSpellScripts.insert(SpellScriptsMap::value_type(spellId, GetScriptId(scriptName))); - spellId = sSpellMgr.GetNextSpellInChain(spellId); + spellId = sSpellMgr->GetNextSpellInChain(spellId); } } else @@ -5250,7 +5250,7 @@ void ObjectMgr::ValidateSpellScripts() { SpellEntry const * spellEntry = sSpellStore.LookupEntry(itr->first); std::vector<std::pair<SpellScriptLoader *, SpellScriptsMap::iterator> > SpellScriptLoaders; - sScriptMgr.CreateSpellScriptLoaders(itr->first, SpellScriptLoaders); + sScriptMgr->CreateSpellScriptLoaders(itr->first, SpellScriptLoaders); itr = mSpellScripts.upper_bound(itr->first); @@ -5383,7 +5383,7 @@ struct SQLInstanceLoader : public SQLStorageLoaderBase<SQLInstanceLoader> template<class D> void convert_from_str(uint32 /*field_pos*/, char *src, D &dst) { - dst = D(sObjectMgr.GetScriptId(src)); + dst = D(sObjectMgr->GetScriptId(src)); } }; @@ -5883,7 +5883,7 @@ uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt } } - CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(mount_id); + CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(mount_id); if (minfo) mount_id = minfo->modelid; @@ -5954,7 +5954,7 @@ void ObjectMgr::LoadGraveyardZones() WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team) { // search for zone associated closest graveyard - uint32 zoneId = sMapMgr.GetZoneId(MapId,x,y,z); + uint32 zoneId = sMapMgr->GetZoneId(MapId,x,y,z); if (!zoneId) { @@ -6598,7 +6598,7 @@ struct SQLGameObjectLoader : public SQLStorageLoaderBase<SQLGameObjectLoader> template<class D> void convert_from_str(uint32 /*field_pos*/, char *src, D &dst) { - dst = D(sObjectMgr.GetScriptId(src)); + dst = D(sObjectMgr->GetScriptId(src)); } }; @@ -7580,7 +7580,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table, } - PooledQuestRelation* poolRelationMap = go ? &sPoolMgr.mQuestGORelation : &sPoolMgr.mQuestCreatureRelation; + PooledQuestRelation* poolRelationMap = go ? &sPoolMgr->mQuestGORelation : &sPoolMgr->mQuestCreatureRelation; if (starter) poolRelationMap->clear(); @@ -8926,7 +8926,7 @@ void ObjectMgr::LoadDbScriptStrings() // Functions for scripting access uint32 GetAreaTriggerScriptId(uint32 trigger_id) { - return sObjectMgr.GetAreaTriggerScriptId(trigger_id); + return sObjectMgr->GetAreaTriggerScriptId(trigger_id); } bool LoadTrinityStrings(char const* table, int32 start_value, int32 end_value) @@ -8939,17 +8939,17 @@ bool LoadTrinityStrings(char const* table, int32 start_value, int32 end_value) return false; } - return sObjectMgr.LoadTrinityStrings(table, start_value, end_value); + return sObjectMgr->LoadTrinityStrings(table, start_value, end_value); } uint32 GetScriptId(const char *name) { - return sObjectMgr.GetScriptId(name); + return sObjectMgr->GetScriptId(name); } ObjectMgr::ScriptNameMap & GetScriptNames() { - return sObjectMgr.GetScriptNames(); + return sObjectMgr->GetScriptNames(); } GameObjectInfo const *GetGameObjectInfo(uint32 id) @@ -8969,7 +8969,7 @@ CreatureInfo const* GetCreatureTemplateStore(uint32 entry) Quest const* GetQuestTemplateStore(uint32 entry) { - return sObjectMgr.GetQuestTemplate(entry); + return sObjectMgr->GetQuestTemplate(entry); } CreatureBaseStats const* ObjectMgr::GetCreatureBaseStats(uint8 level, uint8 unitClass) diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 66440abf841..1c2bbc98e72 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -1343,7 +1343,7 @@ class ObjectMgr }; -#define sObjectMgr (*ACE_Singleton<ObjectMgr, ACE_Null_Mutex>::instance()) +#define sObjectMgr ACE_Singleton<ObjectMgr, ACE_Null_Mutex>::instance() // scripting access functions bool LoadTrinityStrings(char const* table,int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min()); diff --git a/src/server/game/Grids/ObjectGridLoader.cpp b/src/server/game/Grids/ObjectGridLoader.cpp index 41b48f23c08..4c0d2b0383c 100755 --- a/src/server/game/Grids/ObjectGridLoader.cpp +++ b/src/server/game/Grids/ObjectGridLoader.cpp @@ -169,7 +169,7 @@ ObjectGridLoader::Visit(GameObjectMapType &m) CellPair cell_pair(x,y); uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; - CellObjectGuids const& cell_guids = sObjectMgr.GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cell_id); + CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cell_id); LoadHelper(cell_guids.gameobjects, cell_pair, m, i_gameObjects, i_map); } @@ -182,7 +182,7 @@ ObjectGridLoader::Visit(CreatureMapType &m) CellPair cell_pair(x,y); uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; - CellObjectGuids const& cell_guids = sObjectMgr.GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cell_id); + CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cell_id); LoadHelper(cell_guids.creatures, cell_pair, m, i_creatures, i_map); } @@ -196,7 +196,7 @@ ObjectWorldLoader::Visit(CorpseMapType &m) uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; // corpses are always added to spawn mode 0 and they are spawned by their instance id - CellObjectGuids const& cell_guids = sObjectMgr.GetCellObjectGuids(i_map->GetId(), 0, cell_id); + CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), 0, cell_id); LoadHelper(cell_guids.corpses, cell_pair, m, i_corpses, i_map); } diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index b2386479921..836b4a98b5b 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -94,7 +94,7 @@ Group::~Group() bool Group::Create(const uint64 &guid, const char * name) { - uint32 lowguid = sObjectMgr.GenerateLowGuid(HIGHGUID_GROUP); + uint32 lowguid = sObjectMgr->GenerateLowGuid(HIGHGUID_GROUP); m_guid = MAKE_NEW_GUID(lowguid, 0, HIGHGUID_GROUP); m_leaderGuid = guid; m_leaderName = name; @@ -112,7 +112,7 @@ bool Group::Create(const uint64 &guid, const char * name) m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL; if (!isBGGroup()) { - Player *leader = sObjectMgr.GetPlayer(guid); + Player *leader = sObjectMgr->GetPlayer(guid); if (leader) { m_dungeonDifficulty = leader->GetDungeonDifficulty(); @@ -152,7 +152,7 @@ bool Group::LoadGroupFromDB(const uint32 &groupGuid, QueryResult result, bool lo m_leaderGuid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER); // group leader not exist - if (!sObjectMgr.GetPlayerNameByGUID(fields[0].GetUInt32(), m_leaderName)) + if (!sObjectMgr->GetPlayerNameByGUID(fields[0].GetUInt32(), m_leaderName)) return false; m_lootMethod = LootMethod(fields[1].GetUInt8()); @@ -204,7 +204,7 @@ bool Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup, member.guid = MAKE_NEW_GUID(guidLow, 0, HIGHGUID_PLAYER); // skip non-existed member - if (!sObjectMgr.GetPlayerNameByGUID(member.guid, member.name)) + if (!sObjectMgr->GetPlayerNameByGUID(member.guid, member.name)) { CharacterDatabase.PQuery("DELETE FROM group_member WHERE memberGuid=%u", guidLow); return false; @@ -242,7 +242,7 @@ void Group::ConvertToRaid() // update quest related GO states (quest activity dependent from raid membership) for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr) - if (Player* player = sObjectMgr.GetPlayer(citr->guid)) + if (Player* player = sObjectMgr->GetPlayer(citr->guid)) player->UpdateForQuestWorldObjects(); } @@ -262,7 +262,7 @@ bool Group::AddInvite(Player *player) player->SetGroupInvite(this); - sScriptMgr.OnGroupInviteMember(this, player->GetGUID()); + sScriptMgr->OnGroupInviteMember(this, player->GetGUID()); return true; } @@ -321,9 +321,9 @@ bool Group::AddMember(const uint64 &guid, const char* name) return false; SendUpdate(); - sScriptMgr.OnGroupAddMember(this, guid); + sScriptMgr->OnGroupAddMember(this, guid); - Player *player = sObjectMgr.GetPlayer(guid); + Player *player = sObjectMgr->GetPlayer(guid); if (player) { if (!IsLeader(player->GetGUID()) && !isBGGroup()) @@ -365,7 +365,7 @@ uint32 Group::RemoveMember(const uint64 &guid, const RemoveMethod &method /* = G { BroadcastGroupUpdate(); - sScriptMgr.OnGroupRemoveMember(this, guid, method, kicker, reason); + sScriptMgr->OnGroupRemoveMember(this, guid, method, kicker, reason); // Lfg group vote kick handled in scripts if (isLFGGroup() && method == GROUP_REMOVEMETHOD_KICK) @@ -376,7 +376,7 @@ uint32 Group::RemoveMember(const uint64 &guid, const RemoveMethod &method /* = G { bool leaderChanged = _removeMember(guid); - if (Player *player = sObjectMgr.GetPlayer(guid)) + if (Player *player = sObjectMgr->GetPlayer(guid)) { // quest related GO state dependent from raid membership if (isRaidGroup()) @@ -438,12 +438,12 @@ void Group::ChangeLeader(const uint64 &guid) void Group::Disband(bool hideDestroy /* = false */) { - sScriptMgr.OnGroupDisband(this); + sScriptMgr->OnGroupDisband(this); Player *player; for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr) { - player = sObjectMgr.GetPlayer(citr->guid); + player = sObjectMgr->GetPlayer(citr->guid); if (!player) continue; @@ -529,7 +529,7 @@ void Group::SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll &r) for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr) { - Player *p = sObjectMgr.GetPlayer(itr->first); + Player *p = sObjectMgr->GetPlayer(itr->first); if (!p || !p->GetSession()) continue; @@ -553,7 +553,7 @@ void Group::SendLootRoll(const uint64& SourceGuid, const uint64& TargetGuid, uin for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr) { - Player *p = sObjectMgr.GetPlayer(itr->first); + Player *p = sObjectMgr->GetPlayer(itr->first); if (!p || !p->GetSession()) continue; @@ -576,7 +576,7 @@ void Group::SendLootRollWon(const uint64& SourceGuid, const uint64& TargetGuid, for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr) { - Player *p = sObjectMgr.GetPlayer(itr->first); + Player *p = sObjectMgr->GetPlayer(itr->first); if (!p || !p->GetSession()) continue; @@ -596,7 +596,7 @@ void Group::SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r) for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr) { - Player *p = sObjectMgr.GetPlayer(itr->first); + Player *p = sObjectMgr->GetPlayer(itr->first); if (!p || !p->GetSession()) continue; @@ -643,7 +643,7 @@ void Group::GroupLoot(Loot *loot, WorldObject* pLootedObject) //roll for over-threshold item if it's one-player loot if (item->Quality >= uint32(m_lootThreshold)) { - uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM),0,HIGHGUID_ITEM); + uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM),0,HIGHGUID_ITEM); Roll* r = new Roll(newitemGUID,*i); //a vector is filled with only near party members @@ -685,7 +685,7 @@ void Group::GroupLoot(Loot *loot, WorldObject* pLootedObject) { for (Roll::PlayerVote::const_iterator itr=r->playerVote.begin(); itr != r->playerVote.end(); ++itr) { - Player *p = sObjectMgr.GetPlayer(itr->first); + Player *p = sObjectMgr->GetPlayer(itr->first); if (!p || !p->GetSession()) continue; @@ -731,7 +731,7 @@ void Group::NeedBeforeGreed(Loot *loot, WorldObject* pLootedObject) //roll for over-threshold item if it's one-player loot if (item->Quality >= uint32(m_lootThreshold)) { - uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM),0,HIGHGUID_ITEM); + uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM),0,HIGHGUID_ITEM); Roll* r=new Roll(newitemGUID,*i); for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) @@ -776,7 +776,7 @@ void Group::NeedBeforeGreed(Loot *loot, WorldObject* pLootedObject) { for (Roll::PlayerVote::const_iterator itr=r->playerVote.begin(); itr != r->playerVote.end(); ++itr) { - Player *p = sObjectMgr.GetPlayer(itr->first); + Player *p = sObjectMgr->GetPlayer(itr->first); if (!p || !p->GetSession()) continue; @@ -926,7 +926,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers) } } SendLootRollWon(0, maxguid, maxresul, ROLL_NEED, *roll); - player = sObjectMgr.GetPlayer(maxguid); + player = sObjectMgr->GetPlayer(maxguid); if (player && player->GetSession()) { @@ -976,7 +976,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers) } } SendLootRollWon(0, maxguid, maxresul, rollvote, *roll); - player = sObjectMgr.GetPlayer(maxguid); + player = sObjectMgr->GetPlayer(maxguid); if (player && player->GetSession()) { @@ -1095,7 +1095,7 @@ void Group::SendUpdate() Player *player; for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr) { - player = sObjectMgr.GetPlayer(citr->guid); + player = sObjectMgr->GetPlayer(citr->guid); if (!player || !player->GetSession() || player->GetGroup() != this) continue; @@ -1106,8 +1106,8 @@ void Group::SendUpdate() data << uint8(citr->roles); if (isLFGGroup()) { - data << uint8(sLFGMgr.GetState(m_guid) == LFG_STATE_FINISHED_DUNGEON ? 2 : 0); // FIXME - Dungeon save status? 2 = done - data << uint32(sLFGMgr.GetDungeon(m_guid)); + data << uint8(sLFGMgr->GetState(m_guid) == LFG_STATE_FINISHED_DUNGEON ? 2 : 0); // FIXME - Dungeon save status? 2 = done + data << uint32(sLFGMgr->GetDungeon(m_guid)); } data << uint64(m_guid); @@ -1118,7 +1118,7 @@ void Group::SendUpdate() if (citr->guid == citr2->guid) continue; - Player* member = sObjectMgr.GetPlayer(citr2->guid); + Player* member = sObjectMgr->GetPlayer(citr2->guid); uint8 onlineState = (member) ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE; onlineState = onlineState | ((isBGGroup()) ? MEMBER_STATUS_PVP : 0); @@ -1192,7 +1192,7 @@ void Group::OfflineReadyCheck() { for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr) { - Player *pl = sObjectMgr.GetPlayer(citr->guid); + Player *pl = sObjectMgr->GetPlayer(citr->guid); if (!pl || !pl->GetSession()) { WorldPacket data(MSG_RAID_READY_CHECK_CONFIRM, 9); @@ -1234,7 +1234,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, uint8 group) if (!guid) return false; - Player *player = sObjectMgr.GetPlayer(guid); + Player *player = sObjectMgr->GetPlayer(guid); MemberSlot member; member.guid = guid; @@ -1277,7 +1277,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, uint8 group) bool Group::_removeMember(const uint64 &guid) { - Player *player = sObjectMgr.GetPlayer(guid); + Player *player = sObjectMgr->GetPlayer(guid); if (player) { //if we are removing player from battleground raid @@ -1321,7 +1321,7 @@ void Group::_setLeader(const uint64 &guid) if (slot == m_memberSlots.end()) return; - sScriptMgr.OnGroupChangeLeader(this, m_leaderGuid, guid); + sScriptMgr->OnGroupChangeLeader(this, m_leaderGuid, guid); if (!isBGGroup()) { @@ -1338,7 +1338,7 @@ void Group::_setLeader(const uint64 &guid) ")", GUID_LOPART(m_guid), GUID_LOPART(slot->guid) ); - Player *player = sObjectMgr.GetPlayer(slot->guid); + Player *player = sObjectMgr->GetPlayer(slot->guid); if (player) { for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) @@ -1472,7 +1472,7 @@ void Group::ChangeMembersGroup(const uint64 &guid, const uint8 &group) if (!isRaidGroup()) return; - Player *player = sObjectMgr.GetPlayer(guid); + Player *player = sObjectMgr->GetPlayer(guid); if (!player) { @@ -1761,7 +1761,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo) bool isEmpty = true; // if the map is loaded, reset it - Map *map = sMapMgr.FindMap(p->GetMapId(), p->GetInstanceId()); + Map *map = sMapMgr->FindMap(p->GetMapId(), p->GetInstanceId()); if (map && map->IsDungeon() && !(method == INSTANCE_RESET_GROUP_DISBAND && !p->CanReset())) { if (p->CanReset()) @@ -1886,7 +1886,7 @@ void Group::BroadcastGroupUpdate(void) for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr) { - Player *pp = sObjectMgr.GetPlayer(citr->guid); + Player *pp = sObjectMgr->GetPlayer(citr->guid); if (pp && pp->IsInWorld()) { pp->ForceValuesUpdateAtIndex(UNIT_FIELD_BYTES_2); @@ -1902,7 +1902,7 @@ void Group::ResetMaxEnchantingLevel() Player *pMember = NULL; for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr) { - pMember = sObjectMgr.GetPlayer(citr->guid); + pMember = sObjectMgr->GetPlayer(citr->guid); if (pMember && m_maxEnchantingLevel < pMember->GetSkillValue(SKILL_ENCHANTING)) m_maxEnchantingLevel = pMember->GetSkillValue(SKILL_ENCHANTING); } diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 75bbe55347b..9b4c8672dc2 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -781,7 +781,7 @@ void Guild::MoveItemData::LogAction(MoveItemData* pFrom) const { ASSERT(pFrom->GetItem()); - sScriptMgr.OnGuildItemMove(m_pGuild, m_pPlayer, pFrom->GetItem(), + sScriptMgr->OnGuildItemMove(m_pGuild, m_pPlayer, pFrom->GetItem(), pFrom->IsBank(), pFrom->GetContainer(), pFrom->GetSlotId(), IsBank(), GetContainer(), GetSlotId()); } @@ -1091,14 +1091,14 @@ Guild::~Guild() bool Guild::Create(Player* pLeader, const std::string& name) { // Check if guild with such name already exists - if (sObjectMgr.GetGuildByName(name)) + if (sObjectMgr->GetGuildByName(name)) return false; WorldSession* pLeaderSession = pLeader->GetSession(); if (!pLeaderSession) return false; - m_id = sObjectMgr.GenerateGuildId(); + m_id = sObjectMgr->GenerateGuildId(); m_leaderGuid = pLeader->GetGUID(); m_name = name; m_info = ""; @@ -1140,7 +1140,7 @@ bool Guild::Create(Player* pLeader, const std::string& name) bool ret = AddMember(m_leaderGuid, GR_GUILDMASTER); if (ret) // Call scripts on successful create - sScriptMgr.OnGuildCreate(this, pLeader, name); + sScriptMgr->OnGuildCreate(this, pLeader, name); return ret; } @@ -1149,7 +1149,7 @@ bool Guild::Create(Player* pLeader, const std::string& name) void Guild::Disband() { // Call scripts before guild data removed from database - sScriptMgr.OnGuildDisband(this); + sScriptMgr->OnGuildDisband(this); _BroadcastEvent(GE_DISBANDED, 0); // Remove all members @@ -1193,7 +1193,7 @@ void Guild::Disband() trans->Append(stmt); CharacterDatabase.CommitTransaction(trans); - sObjectMgr.RemoveGuild(m_id); + sObjectMgr->RemoveGuild(m_id); } /////////////////////////////////////////////////////////////////////////////// @@ -1254,7 +1254,7 @@ void Guild::HandleSetMOTD(WorldSession* session, const std::string& motd) { m_motd = motd; - sScriptMgr.OnGuildMOTDChanged(this, motd); + sScriptMgr->OnGuildMOTDChanged(this, motd); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_MOTD); stmt->setString(0, motd); @@ -1277,7 +1277,7 @@ void Guild::HandleSetInfo(WorldSession* session, const std::string& info) { m_info = info; - sScriptMgr.OnGuildInfoChanged(this, info); + sScriptMgr->OnGuildInfoChanged(this, info); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_INFO); stmt->setString(0, info); @@ -1455,7 +1455,7 @@ void Guild::HandleAcceptMember(WorldSession* session) { Player* player = session->GetPlayer(); if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && - player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(GetLeaderGUID())) + player->GetTeam() != sObjectMgr->GetPlayerTeamByGUID(GetLeaderGUID())) return; if (AddMember(player->GetGUID())) @@ -1619,7 +1619,7 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount) Player* player = session->GetPlayer(); // Call script after validation and before money transfer. - sScriptMgr.OnGuildMemberDepositMoney(this, player, amount); + sScriptMgr->OnGuildMemberDepositMoney(this, player, amount); SQLTransaction trans = CharacterDatabase.BeginTransaction(); // Add money to bank @@ -1664,7 +1664,7 @@ bool Guild::HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool return false; // Call script after validation and before money transfer. - sScriptMgr.OnGuildMemberWitdrawMoney(this, player, amount, repair); + sScriptMgr->OnGuildMemberWitdrawMoney(this, player, amount, repair); SQLTransaction trans = CharacterDatabase.BeginTransaction(); // Update remaining money amount @@ -2064,7 +2064,7 @@ void Guild::BroadcastPacket(WorldPacket *packet) const // Members handling bool Guild::AddMember(const uint64& guid, uint8 rankId) { - Player* player = sObjectMgr.GetPlayer(guid); + Player* player = sObjectMgr->GetPlayer(guid); // Player cannot be in guild if (player) { @@ -2126,7 +2126,7 @@ bool Guild::AddMember(const uint64& guid, uint8 rankId) _UpdateAccountsNumber(); // Call scripts if member was succesfully added (and stored to database) - sScriptMgr.OnGuildAddMember(this, player, rankId); + sScriptMgr->OnGuildAddMember(this, player, rankId); return true; } @@ -2134,7 +2134,7 @@ bool Guild::AddMember(const uint64& guid, uint8 rankId) void Guild::DeleteMember(const uint64& guid, bool isDisbanding, bool isKicked) { uint32 lowguid = GUID_LOPART(guid); - Player *player = sObjectMgr.GetPlayer(guid); + Player *player = sObjectMgr->GetPlayer(guid); // Guild master can be deleted when loading guild and guid doesn't exist in characters table // or when he is removed from guild by gm command @@ -2169,7 +2169,7 @@ void Guild::DeleteMember(const uint64& guid, bool isDisbanding, bool isKicked) } } // Call script on remove before member is acutally removed from guild (and database) - sScriptMgr.OnGuildRemoveMember(this, player, isDisbanding, isKicked); + sScriptMgr->OnGuildRemoveMember(this, player, isDisbanding, isKicked); if (Member* pMember = GetMember(guid)) delete pMember; @@ -2284,11 +2284,11 @@ void Guild::_CreateDefaultGuildRanks(LocaleConstant loc) stmt->setUInt32(0, m_id); CharacterDatabase.Execute(stmt); - _CreateRank(sObjectMgr.GetTrinityString(LANG_GUILD_MASTER, loc), GR_RIGHT_ALL); - _CreateRank(sObjectMgr.GetTrinityString(LANG_GUILD_OFFICER, loc), GR_RIGHT_ALL); - _CreateRank(sObjectMgr.GetTrinityString(LANG_GUILD_VETERAN, loc), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK); - _CreateRank(sObjectMgr.GetTrinityString(LANG_GUILD_MEMBER, loc), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK); - _CreateRank(sObjectMgr.GetTrinityString(LANG_GUILD_INITIATE, loc), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK); + _CreateRank(sObjectMgr->GetTrinityString(LANG_GUILD_MASTER, loc), GR_RIGHT_ALL); + _CreateRank(sObjectMgr->GetTrinityString(LANG_GUILD_OFFICER, loc), GR_RIGHT_ALL); + _CreateRank(sObjectMgr->GetTrinityString(LANG_GUILD_VETERAN, loc), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK); + _CreateRank(sObjectMgr->GetTrinityString(LANG_GUILD_MEMBER, loc), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK); + _CreateRank(sObjectMgr->GetTrinityString(LANG_GUILD_INITIATE, loc), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK); } void Guild::_CreateRank(const std::string& name, uint32 rights) @@ -2490,7 +2490,7 @@ inline void Guild::_LogEvent(GuildEventLogTypes eventType, uint32 playerGuid1, u m_eventLog->AddEvent(trans, new EventLogEntry(m_id, m_eventLog->GetNextGUID(), eventType, playerGuid1, playerGuid2, newRank)); CharacterDatabase.CommitTransaction(trans); - sScriptMgr.OnGuildEvent(this, uint8(eventType), playerGuid1, playerGuid2, newRank); + sScriptMgr->OnGuildEvent(this, uint8(eventType), playerGuid1, playerGuid2, newRank); } // Add new bank event log record @@ -2508,7 +2508,7 @@ void Guild::_LogBankEvent(SQLTransaction& trans, GuildBankEventLogTypes eventTyp LogHolder* pLog = m_bankEventLog[tabId]; pLog->AddEvent(trans, new BankEventLogEntry(m_id, pLog->GetNextGUID(), eventType, dbTabId, lowguid, itemOrMoney, itemStackCount, destTabId)); - sScriptMgr.OnGuildBankEvent(this, uint8(eventType), tabId, lowguid, itemOrMoney, itemStackCount, destTabId); + sScriptMgr->OnGuildBankEvent(this, uint8(eventType), tabId, lowguid, itemOrMoney, itemStackCount, destTabId); } inline Item* Guild::_GetItem(uint8 tabId, uint8 slotId) const diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 1c8a2c9f5d0..b459d2aef49 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -288,7 +288,7 @@ private: void ResetTabTimes(); void ResetMoneyTime(); - inline Player* FindPlayer() const { return sObjectMgr.GetPlayer(m_guid); } + inline Player* FindPlayer() const { return sObjectMgr->GetPlayer(m_guid); } private: uint32 m_guildId; diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index fe3b139e29b..4822d425d54 100755 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -166,7 +166,7 @@ void InstanceSave::SaveToDB() // save instance data too std::string data; - Map *map = sMapMgr.FindMap(GetMapId(),m_instanceid); + Map *map = sMapMgr->FindMap(GetMapId(),m_instanceid); if (map) { ASSERT(map->IsDungeon()); @@ -212,8 +212,8 @@ bool InstanceSave::UnloadIfEmpty() { if (m_playerList.empty() && m_groupList.empty()) { - if (!sInstanceSaveMgr.lock_instLists) - sInstanceSaveMgr.RemoveInstanceSave(GetInstanceId()); + if (!sInstanceSaveMgr->lock_instLists) + sInstanceSaveMgr->RemoveInstanceSave(GetInstanceId()); return false; } @@ -255,7 +255,7 @@ void InstanceSaveManager::CleanupAndPackInstances() uint32 oldMSTime = getMSTime(); // load reset times and clean expired instances - sInstanceSaveMgr.LoadResetTimes(); + sInstanceSaveMgr->LoadResetTimes(); // Delete invalid character_instance and group_instance references CharacterDatabase.DirectExecute("DELETE ci.* FROM character_instance AS ci LEFT JOIN characters AS c ON ci.guid = c.guid WHERE c.guid IS NULL"); @@ -540,7 +540,7 @@ void InstanceSaveManager::_ResetSave(InstanceSaveHashMap::iterator &itr) void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId) { sLog.outDebug("InstanceSaveMgr::_ResetInstance %u, %u", mapid, instanceId); - Map *map = (MapInstanced*)sMapMgr.CreateBaseMap(mapid); + Map *map = (MapInstanced*)sMapMgr->CreateBaseMap(mapid); if (!map->Instanceable()) return; @@ -555,7 +555,7 @@ void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId) if (iMap && iMap->IsDungeon()) ((InstanceMap*)iMap)->Reset(INSTANCE_RESET_RESPAWN_DELAY); else - sObjectMgr.DeleteRespawnTimeForInstance(instanceId); // even if map is not loaded + sObjectMgr->DeleteRespawnTimeForInstance(instanceId); // even if map is not loaded } void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, bool warn, time_t resetTime) @@ -609,7 +609,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b } // note: this isn't fast but it's meant to be executed very rarely - Map const *map = sMapMgr.CreateBaseMap(mapid); // _not_ include difficulty + Map const *map = sMapMgr->CreateBaseMap(mapid); // _not_ include difficulty MapInstanced::InstancedMaps &instMaps = ((MapInstanced*)map)->GetInstancedMaps(); MapInstanced::InstancedMaps::iterator mitr; uint32 timeLeft; diff --git a/src/server/game/Instances/InstanceSaveMgr.h b/src/server/game/Instances/InstanceSaveMgr.h index f273715fe44..d884f3d0522 100755 --- a/src/server/game/Instances/InstanceSaveMgr.h +++ b/src/server/game/Instances/InstanceSaveMgr.h @@ -190,5 +190,5 @@ class InstanceSaveManager ResetTimeQueue m_resetTimeQueue; }; -#define sInstanceSaveMgr (*ACE_Singleton<InstanceSaveManager, ACE_Thread_Mutex>::instance()) +#define sInstanceSaveMgr ACE_Singleton<InstanceSaveManager, ACE_Thread_Mutex>::instance() #endif diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index abb569ea58f..083368d7e04 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -340,7 +340,7 @@ LootItem::LootItem(LootStoreItem const& li) bool LootItem::AllowedForPlayer(Player const * player) const { // DB conditions check - if (!sConditionMgr.IsPlayerMeetToConditions(const_cast<Player*>(player), conditions)) + if (!sConditionMgr->IsPlayerMeetToConditions(const_cast<Player*>(player), conditions)) return false; ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemid); @@ -1512,7 +1512,7 @@ void LoadLootTemplates_Gameobject() { if (uint32 lootid = gInfo->GetLootId()) { - if (sObjectMgr.IsGoOfSpecificEntrySpawned(gInfo->id) && ids_set.find(lootid) == ids_set.end()) + if (sObjectMgr->IsGoOfSpecificEntrySpawned(gInfo->id) && ids_set.find(lootid) == ids_set.end()) LootTemplates_Gameobject.ReportNotExistedId(lootid); else ids_setUsed.insert(lootid); diff --git a/src/server/game/Mails/Mail.cpp b/src/server/game/Mails/Mail.cpp index d35b3af467f..0a92b5df6bc 100755 --- a/src/server/game/Mails/Mail.cpp +++ b/src/server/game/Mails/Mail.cpp @@ -122,11 +122,11 @@ void MailDraft::deleteIncludedItems(SQLTransaction& trans, bool inDB /*= false*/ void MailDraft::SendReturnToSender(uint32 sender_acc, uint32 sender_guid, uint32 receiver_guid) { - Player *receiver = sObjectMgr.GetPlayer(MAKE_NEW_GUID(receiver_guid, 0, HIGHGUID_PLAYER)); + Player *receiver = sObjectMgr->GetPlayer(MAKE_NEW_GUID(receiver_guid, 0, HIGHGUID_PLAYER)); uint32 rc_account = 0; if (!receiver) - rc_account = sObjectMgr.GetPlayerAccountIdByGUID(MAKE_NEW_GUID(receiver_guid, 0, HIGHGUID_PLAYER)); + rc_account = sObjectMgr->GetPlayerAccountIdByGUID(MAKE_NEW_GUID(receiver_guid, 0, HIGHGUID_PLAYER)); SQLTransaction trans = CharacterDatabase.BeginTransaction(); @@ -172,7 +172,7 @@ void MailDraft::SendMailTo(SQLTransaction& trans, MailReceiver const& receiver, if (pReceiver) prepareItems(pReceiver, trans); // generate mail template items - uint32 mailId = sObjectMgr.GenerateMailID(); + uint32 mailId = sObjectMgr->GenerateMailID(); time_t deliver_time = time(NULL) + deliver_delay; @@ -183,7 +183,7 @@ void MailDraft::SendMailTo(SQLTransaction& trans, MailReceiver const& receiver, if (sender.GetMailMessageType() == MAIL_AUCTION && m_items.empty() && !m_money) expire_delay = sWorld.getIntConfig(CONFIG_MAIL_DELIVERY_DELAY); // mail from battlemaster (rewardmarks) should last only one day - else if (sender.GetMailMessageType() == MAIL_CREATURE && sBattlegroundMgr.GetBattleMasterBG(sender.GetSenderId()) != BATTLEGROUND_TYPE_NONE) + else if (sender.GetMailMessageType() == MAIL_CREATURE && sBattlegroundMgr->GetBattleMasterBG(sender.GetSenderId()) != BATTLEGROUND_TYPE_NONE) expire_delay = DAY; // default case: expire time if COD 3 days, if no COD 30 days else diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index b6367996320..36bc959c280 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -39,7 +39,7 @@ GridState* si_GridStates[MAX_GRID_STATE]; Map::~Map() { - sScriptMgr.OnDestroyMap(this); + sScriptMgr->OnDestroyMap(this); UnloadAll(); @@ -143,7 +143,7 @@ void Map::LoadMap(int gx,int gy, bool reload) if (GridMaps[gx][gy]) { sLog.outDetail("Unloading previously loaded map %u before reloading.",GetId()); - sScriptMgr.OnUnloadGridMap(this, GridMaps[gx][gy], gx, gy); + sScriptMgr->OnUnloadGridMap(this, GridMaps[gx][gy], gx, gy); delete (GridMaps[gx][gy]); GridMaps[gx][gy]=NULL; @@ -163,7 +163,7 @@ void Map::LoadMap(int gx,int gy, bool reload) } delete [] tmp; - sScriptMgr.OnLoadGridMap(this, GridMaps[gx][gy], gx, gy); + sScriptMgr->OnLoadGridMap(this, GridMaps[gx][gy], gx, gy); } void Map::LoadMapAndVMap(int gx,int gy) @@ -209,7 +209,7 @@ m_activeNonPlayersIter(m_activeNonPlayers.end()), i_gridExpiry(expiry), i_script //lets initialize visibility distance for map Map::InitVisibilityDistance(); - sScriptMgr.OnCreateMap(this); + sScriptMgr->OnCreateMap(this); } void Map::InitVisibilityDistance() @@ -418,7 +418,7 @@ bool Map::Add(Player *player) player->m_clientGUIDs.clear(); player->UpdateObjectVisibility(false); - sScriptMgr.OnPlayerEnterMap(this, player); + sScriptMgr->OnPlayerEnterMap(this, player); return true; } @@ -565,7 +565,7 @@ void Map::Update(const uint32 &t_diff) if (!m_mapRefManager.isEmpty() || !m_activeNonPlayers.empty()) ProcessRelocationNotifies(t_diff); - sScriptMgr.OnMapUpdate(this, t_diff); + sScriptMgr->OnMapUpdate(this, t_diff); } struct ResetNotifier @@ -684,7 +684,7 @@ void Map::Remove(Player *player, bool remove) if (remove) DeleteFromWorld(player); - sScriptMgr.OnPlayerLeaveMap(this, player); + sScriptMgr->OnPlayerLeaveMap(this, player); } template<class T> @@ -1909,7 +1909,7 @@ void Map::SendInitSelf(Player * player) void Map::SendInitTransports(Player * player) { // Hack to send out transports - MapManager::TransportMap& tmap = sMapMgr.m_TransportsByMap; + MapManager::TransportMap& tmap = sMapMgr->m_TransportsByMap; // no transports at map if (tmap.find(player->GetMapId()) == tmap.end()) @@ -1936,7 +1936,7 @@ void Map::SendInitTransports(Player * player) void Map::SendRemoveTransports(Player * player) { // Hack to send out transports - MapManager::TransportMap& tmap = sMapMgr.m_TransportsByMap; + MapManager::TransportMap& tmap = sMapMgr->m_TransportsByMap; // no transports at map if (tmap.find(player->GetMapId()) == tmap.end()) @@ -2284,11 +2284,11 @@ bool InstanceMap::Add(Player *player) if (IsDungeon()) { // get or create an instance save for the map - InstanceSave *mapSave = sInstanceSaveMgr.GetInstanceSave(GetInstanceId()); + InstanceSave *mapSave = sInstanceSaveMgr->GetInstanceSave(GetInstanceId()); if (!mapSave) { sLog.outDetail("InstanceMap::Add: creating instance save for map %d spawnmode %d with instance id %d", GetId(), GetSpawnMode(), GetInstanceId()); - mapSave = sInstanceSaveMgr.AddInstanceSave(GetId(), GetInstanceId(), Difficulty(GetSpawnMode()), 0, true); + mapSave = sInstanceSaveMgr->AddInstanceSave(GetId(), GetInstanceId(), Difficulty(GetSpawnMode()), 0, true); } // check for existing instance binds @@ -2406,7 +2406,7 @@ void InstanceMap::CreateInstanceData(bool load) if (mInstance) { i_script_id = mInstance->script_id; - i_data = sScriptMgr.CreateInstanceData(this); + i_data = sScriptMgr->CreateInstanceData(this); } if (!i_data) @@ -2424,7 +2424,7 @@ void InstanceMap::CreateInstanceData(bool load) std::string data = fields[0].GetString(); if (data != "") { - sLog.outDebug("Loading instance data for `%s` with id %u", sObjectMgr.GetScriptName(i_script_id), i_InstanceId); + sLog.outDebug("Loading instance data for `%s` with id %u", sObjectMgr->GetScriptName(i_script_id), i_InstanceId); i_data->Load(data.c_str()); } } @@ -2475,7 +2475,7 @@ void InstanceMap::PermBindAllPlayers(Player *player) if (!IsDungeon()) return; - InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(GetInstanceId()); + InstanceSave *save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId()); if (!save) { sLog.outError("Cannot bind players, no instance save available for map!"); @@ -2509,7 +2509,7 @@ void InstanceMap::UnloadAll() ASSERT(!HavePlayers()); if (m_resetAfterUnload == true) - sObjectMgr.DeleteRespawnTimeForInstance(GetInstanceId()); + sObjectMgr->DeleteRespawnTimeForInstance(GetInstanceId()); Map::UnloadAll(); } @@ -2527,9 +2527,9 @@ void InstanceMap::SetResetSchedule(bool on) // it is assumed that the reset time will rarely (if ever) change while the reset is scheduled if (IsDungeon() && !HavePlayers() && !IsRaidOrHeroicDungeon()) { - InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(GetInstanceId()); + InstanceSave *save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId()); if (!save) sLog.outError("InstanceMap::SetResetSchedule: cannot turn schedule %s, no save available for instance %d of %d", on ? "on" : "off", GetInstanceId(), GetId()); - else sInstanceSaveMgr.ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), Difficulty(GetSpawnMode()), GetInstanceId())); + else sInstanceSaveMgr->ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), Difficulty(GetSpawnMode()), GetInstanceId())); } } diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index f097a1fd7ae..5d216f0b1d9 100755 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -157,7 +157,7 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player * player) { // if no instanceId via group members or instance saves is found // the instance will be created for the first time - NewInstanceId = sMapMgr.GenerateInstanceId(); + NewInstanceId = sMapMgr->GenerateInstanceId(); Difficulty diff = player->GetGroup() ? player->GetGroup()->GetDifficulty(IsRaid()) : player->GetDifficulty(IsRaid()); map = CreateInstance(NewInstanceId, NULL, diff); diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index 9462667daf2..1ebc0aec031 100755 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -236,7 +236,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) { InstanceGroupBind* boundedInstance = pGroup->GetBoundInstance(entry); if (boundedInstance && boundedInstance->save) - if (Map *boundedMap = sMapMgr.FindMap(mapid,boundedInstance->save->GetInstanceId())) + if (Map *boundedMap = sMapMgr->FindMap(mapid,boundedInstance->save->GetInstanceId())) if (!loginCheck && !boundedMap->CanEnter(player)) return false; /* @@ -252,7 +252,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) } //Other requirements - return player->Satisfy(sObjectMgr.GetAccessRequirement(mapid, targetDifficulty), mapid, true); + return player->Satisfy(sObjectMgr->GetAccessRequirement(mapid, targetDifficulty), mapid, true); } void MapManager::Update(uint32 diff) diff --git a/src/server/game/Maps/MapManager.h b/src/server/game/Maps/MapManager.h index d34a04f1d00..aeb0808d0ac 100755 --- a/src/server/game/Maps/MapManager.h +++ b/src/server/game/Maps/MapManager.h @@ -168,5 +168,5 @@ class MapManager uint32 i_MaxInstanceId; MapUpdater m_updater; }; -#define sMapMgr (*ACE_Singleton<MapManager, ACE_Thread_Mutex>::instance()) +#define sMapMgr ACE_Singleton<MapManager, ACE_Thread_Mutex>::instance() #endif diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index d03356fac9f..05c92e2c4cd 100755 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -30,7 +30,7 @@ namespace Trinity inline float hk_honor_at_level_f(uint8 level, float multiplier = 1.0f) { float honor = multiplier * level * 1.55f; - sScriptMgr.OnHonorCalculation(honor, level, multiplier); + sScriptMgr->OnHonorCalculation(honor, level, multiplier); return honor; } @@ -54,7 +54,7 @@ namespace Trinity else level = pl_level - 9; - sScriptMgr.OnGrayLevelCalculation(level, pl_level); + sScriptMgr->OnGrayLevelCalculation(level, pl_level); return level; } @@ -73,7 +73,7 @@ namespace Trinity else color = XP_GRAY; - sScriptMgr.OnColorCodeCalculation(color, pl_level, mob_level); + sScriptMgr->OnColorCodeCalculation(color, pl_level, mob_level); return color; } @@ -106,7 +106,7 @@ namespace Trinity else diff = 17; - sScriptMgr.OnZeroDifferenceCalculation(diff, pl_level); + sScriptMgr->OnZeroDifferenceCalculation(diff, pl_level); return diff; } @@ -152,7 +152,7 @@ namespace Trinity baseGain = 0; } - sScriptMgr.OnBaseGainCalculation(baseGain, pl_level, mob_level, content); + sScriptMgr->OnBaseGainCalculation(baseGain, pl_level, mob_level, content); return baseGain; } @@ -181,7 +181,7 @@ namespace Trinity gain = uint32(gain * sWorld.getRate(RATE_XP_KILL)); } - sScriptMgr.OnGainCalculation(gain, pl, u); + sScriptMgr->OnGainCalculation(gain, pl, u); return gain; } @@ -215,7 +215,7 @@ namespace Trinity } } - sScriptMgr.OnGroupRateCalculation(rate, count, isRaid); + sScriptMgr->OnGroupRateCalculation(rate, count, isRaid); return rate; } } diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index e574352a6a5..38d03af39c0 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -345,7 +345,7 @@ void FlightPathMovementGenerator::InitEndGridInfo() void FlightPathMovementGenerator::PreloadEndGrid() { // used to preload the final grid where the flightmaster is - Map *endMap = sMapMgr.FindMap(m_endMapId); + Map *endMap = sMapMgr->FindMap(m_endMapId); // Load the grid if (endMap) diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp index ad38adc0259..9c6ff1f3f69 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp @@ -71,7 +71,7 @@ void OPvPCapturePoint::AddGO(uint32 type, uint32 guid, uint32 entry) { if (!entry) { - const GameObjectData *data = sObjectMgr.GetGOData(guid); + const GameObjectData *data = sObjectMgr->GetGOData(guid); if (!data) return; entry = data->id; @@ -84,7 +84,7 @@ void OPvPCapturePoint::AddCre(uint32 type, uint32 guid, uint32 entry) { if (!entry) { - const CreatureData *data = sObjectMgr.GetCreatureData(guid); + const CreatureData *data = sObjectMgr->GetCreatureData(guid); if (!data) return; entry = data->id; @@ -95,7 +95,7 @@ void OPvPCapturePoint::AddCre(uint32 type, uint32 guid, uint32 entry) bool OPvPCapturePoint::AddObject(uint32 type, uint32 entry, uint32 map, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3) { - if (uint32 guid = sObjectMgr.AddGOData(entry, map, x, y, z, o, 0, rotation0, rotation1, rotation2, rotation3)) + if (uint32 guid = sObjectMgr->AddGOData(entry, map, x, y, z, o, 0, rotation0, rotation1, rotation2, rotation3)) { AddGO(type, guid, entry); return true; @@ -106,7 +106,7 @@ bool OPvPCapturePoint::AddObject(uint32 type, uint32 entry, uint32 map, float x, bool OPvPCapturePoint::AddCreature(uint32 type, uint32 entry, uint32 team, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay) { - if (uint32 guid = sObjectMgr.AddCreData(entry, team, map, x, y, z, o, spawntimedelay)) + if (uint32 guid = sObjectMgr->AddCreData(entry, team, map, x, y, z, o, spawntimedelay)) { AddCre(type, guid, entry); return true; @@ -127,7 +127,7 @@ bool OPvPCapturePoint::SetCapturePointData(uint32 entry, uint32 map, float x, fl return false; } - m_capturePointGUID = sObjectMgr.AddGOData(entry, map, x, y, z, o, 0, rotation0, rotation1, rotation2, rotation3); + m_capturePointGUID = sObjectMgr->AddGOData(entry, map, x, y, z, o, 0, rotation0, rotation1, rotation2, rotation3); if (!m_capturePointGUID) return false; @@ -163,12 +163,12 @@ bool OPvPCapturePoint::DelCreature(uint32 type) // explicit removal from map // beats me why this is needed, but with the recent removal "cleanup" some creatures stay in the map if "properly" deleted // so this is a big fat workaround, if AddObjectToRemoveList and DoDelayedMovesAndRemoves worked correctly, this wouldn't be needed - //if (Map * map = sMapMgr.FindMap(cr->GetMapId())) + //if (Map * map = sMapMgr->FindMap(cr->GetMapId())) // map->Remove(cr,false); // delete respawn time for this creature CharacterDatabase.PExecute("DELETE FROM creature_respawn WHERE guid = '%u'", guid); cr->AddObjectToRemoveList(); - sObjectMgr.DeleteCreatureData(guid); + sObjectMgr->DeleteCreatureData(guid); m_CreatureTypes[m_Creatures[type]] = 0; m_Creatures[type] = 0; return true; @@ -188,7 +188,7 @@ bool OPvPCapturePoint::DelObject(uint32 type) uint32 guid = obj->GetDBTableGUIDLow(); obj->SetRespawnTime(0); // not save respawn time obj->Delete(); - sObjectMgr.DeleteGOData(guid); + sObjectMgr->DeleteGOData(guid); m_ObjectTypes[m_Objects[type]] = 0; m_Objects[type] = 0; return true; @@ -196,7 +196,7 @@ bool OPvPCapturePoint::DelObject(uint32 type) bool OPvPCapturePoint::DelCapturePoint() { - sObjectMgr.DeleteGOData(m_capturePointGUID); + sObjectMgr->DeleteGOData(m_capturePointGUID); m_capturePointGUID = 0; if (m_capturePoint) @@ -566,7 +566,7 @@ void OutdoorPvP::BroadcastPacket(WorldPacket &data) const void OutdoorPvP::RegisterZone(uint32 zoneId) { - sOutdoorPvPMgr.AddZone(zoneId, this); + sOutdoorPvPMgr->AddZone(zoneId, this); } bool OutdoorPvP::HasPlayer(Player *plr) const diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp index f7fe80e18e0..509ac86da6a 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp @@ -60,7 +60,7 @@ void OutdoorPvPMgr::InitOutdoorPvP() typeId = fields[0].GetUInt32(); - if (sDisableMgr.IsDisabledFor(DISABLE_TYPE_OUTDOORPVP, typeId, NULL)) + if (sDisableMgr->IsDisabledFor(DISABLE_TYPE_OUTDOORPVP, typeId, NULL)) continue; if (typeId >= MAX_OUTDOORPVP_TYPES) @@ -72,7 +72,7 @@ void OutdoorPvPMgr::InitOutdoorPvP() OutdoorPvPData* data = new OutdoorPvPData(); OutdoorPvPTypes realTypeId = OutdoorPvPTypes(typeId); data->TypeId = realTypeId; - data->ScriptId = sObjectMgr.GetScriptId(fields[1].GetCString()); + data->ScriptId = sObjectMgr->GetScriptId(fields[1].GetCString()); m_OutdoorPvPDatas[realTypeId] = data; ++count; @@ -89,7 +89,7 @@ void OutdoorPvPMgr::InitOutdoorPvP() continue; } - pvp = sScriptMgr.CreateOutdoorPvP(iter->second); + pvp = sScriptMgr->CreateOutdoorPvP(iter->second); if (!pvp) { sLog.outError("Could not initialize OutdoorPvP object for type ID %u; got NULL pointer from script.", uint32(i)); diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h index a7ee2ac602e..dac77dc7f24 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h @@ -100,6 +100,6 @@ class OutdoorPvPMgr uint32 m_UpdateTimer; }; -#define sOutdoorPvPMgr (*ACE_Singleton<OutdoorPvPMgr, ACE_Null_Mutex>::instance()) +#define sOutdoorPvPMgr ACE_Singleton<OutdoorPvPMgr, ACE_Null_Mutex>::instance() #endif /*OUTDOOR_PVP_MGR_H_*/ diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index 334c1c9b33d..d79f7fc591e 100755 --- a/src/server/game/Pools/PoolMgr.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -216,9 +216,9 @@ void PoolGroup<T>::DespawnObject(ActivePoolData& spawns, uint32 guid) template<> void PoolGroup<Creature>::Despawn1Object(uint32 guid) { - if (CreatureData const* data = sObjectMgr.GetCreatureData(guid)) + if (CreatureData const* data = sObjectMgr->GetCreatureData(guid)) { - sObjectMgr.RemoveCreatureFromGrid(guid, data); + sObjectMgr->RemoveCreatureFromGrid(guid, data); if (Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT), (Creature*)NULL)) pCreature->AddObjectToRemoveList(); @@ -229,9 +229,9 @@ void PoolGroup<Creature>::Despawn1Object(uint32 guid) template<> void PoolGroup<GameObject>::Despawn1Object(uint32 guid) { - if (GameObjectData const* data = sObjectMgr.GetGOData(guid)) + if (GameObjectData const* data = sObjectMgr->GetGOData(guid)) { - sObjectMgr.RemoveGameobjectFromGrid(guid, data); + sObjectMgr->RemoveGameobjectFromGrid(guid, data); if (GameObject* pGameobject = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL)) pGameobject->AddObjectToRemoveList(); @@ -242,7 +242,7 @@ void PoolGroup<GameObject>::Despawn1Object(uint32 guid) template<> void PoolGroup<Pool>::Despawn1Object(uint32 child_pool_id) { - sPoolMgr.DespawnPool(child_pool_id); + sPoolMgr->DespawnPool(child_pool_id); } // Same on one quest @@ -250,8 +250,8 @@ template<> void PoolGroup<Quest>::Despawn1Object(uint32 quest_id) { // Creatures - QuestRelations* questMap = sObjectMgr.GetCreatureQuestRelationMap(); - PooledQuestRelationBoundsNC qr = sPoolMgr.mQuestCreatureRelation.equal_range(quest_id); + QuestRelations* questMap = sObjectMgr->GetCreatureQuestRelationMap(); + PooledQuestRelationBoundsNC qr = sPoolMgr->mQuestCreatureRelation.equal_range(quest_id); for (PooledQuestRelation::iterator itr = qr.first; itr != qr.second; ++itr) { QuestRelations::iterator qitr = questMap->find(itr->second); @@ -269,8 +269,8 @@ void PoolGroup<Quest>::Despawn1Object(uint32 quest_id) } // Gameobjects - questMap = sObjectMgr.GetGOQuestRelationMap(); - qr = sPoolMgr.mQuestGORelation.equal_range(quest_id); + questMap = sObjectMgr->GetGOQuestRelationMap(); + qr = sPoolMgr->mQuestGORelation.equal_range(quest_id); for (PooledQuestRelation::iterator itr = qr.first; itr != qr.second; ++itr) { QuestRelations::iterator qitr = questMap->find(itr->second); @@ -354,12 +354,12 @@ void PoolGroup<T>::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 trig template <> void PoolGroup<Creature>::Spawn1Object(PoolObject* obj) { - if (CreatureData const* data = sObjectMgr.GetCreatureData(obj->guid)) + if (CreatureData const* data = sObjectMgr->GetCreatureData(obj->guid)) { - sObjectMgr.AddCreatureToGrid(obj->guid, data); + sObjectMgr->AddCreatureToGrid(obj->guid, data); // Spawn if necessary (loaded grids only) - Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(data->mapid)); + Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(data->mapid)); // We use spawn coords to spawn if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { @@ -380,12 +380,12 @@ void PoolGroup<Creature>::Spawn1Object(PoolObject* obj) template <> void PoolGroup<GameObject>::Spawn1Object(PoolObject* obj) { - if (GameObjectData const* data = sObjectMgr.GetGOData(obj->guid)) + if (GameObjectData const* data = sObjectMgr->GetGOData(obj->guid)) { - sObjectMgr.AddGameobjectToGrid(obj->guid, data); + sObjectMgr->AddGameobjectToGrid(obj->guid, data); // Spawn if necessary (loaded grids only) // this base map checked as non-instanced and then only existed - Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(data->mapid)); + Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(data->mapid)); // We use current coords to unspawn, not spawn coords since creature can have changed grid if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { @@ -409,7 +409,7 @@ void PoolGroup<GameObject>::Spawn1Object(PoolObject* obj) template <> void PoolGroup<Pool>::Spawn1Object(PoolObject* obj) { - sPoolMgr.SpawnPool(obj->guid); + sPoolMgr->SpawnPool(obj->guid); } // Same for 1 quest @@ -417,8 +417,8 @@ template<> void PoolGroup<Quest>::Spawn1Object(PoolObject* obj) { // Creatures - QuestRelations* questMap = sObjectMgr.GetCreatureQuestRelationMap(); - PooledQuestRelationBoundsNC qr = sPoolMgr.mQuestCreatureRelation.equal_range(obj->guid); + QuestRelations* questMap = sObjectMgr->GetCreatureQuestRelationMap(); + PooledQuestRelationBoundsNC qr = sPoolMgr->mQuestCreatureRelation.equal_range(obj->guid); for (PooledQuestRelation::iterator itr = qr.first; itr != qr.second; ++itr) { sLog.outDebug("PoolGroup<Quest>: Adding quest %u to creature %u", itr->first, itr->second); @@ -426,8 +426,8 @@ void PoolGroup<Quest>::Spawn1Object(PoolObject* obj) } // Gameobjects - questMap = sObjectMgr.GetGOQuestRelationMap(); - qr = sPoolMgr.mQuestGORelation.equal_range(obj->guid); + questMap = sObjectMgr->GetGOQuestRelationMap(); + qr = sPoolMgr->mQuestGORelation.equal_range(obj->guid); for (PooledQuestRelation::iterator itr = qr.first; itr != qr.second; ++itr) { sLog.outDebug("PoolGroup<Quest>: Adding quest %u to GO %u", itr->first, itr->second); @@ -500,14 +500,14 @@ void PoolGroup<Quest>::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 // if we are here it means the pool is initialized at startup and did not have previous saved state if (!triggerFrom) - sPoolMgr.SaveQuestsToDB(); + sPoolMgr->SaveQuestsToDB(); } // Method that does the respawn job on the specified creature template <> void PoolGroup<Creature>::ReSpawn1Object(PoolObject* obj) { - if (CreatureData const* data = sObjectMgr.GetCreatureData(obj->guid)) + if (CreatureData const* data = sObjectMgr->GetCreatureData(obj->guid)) if (Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_UNIT), (Creature*)NULL)) pCreature->GetMap()->Add(pCreature); } @@ -516,7 +516,7 @@ void PoolGroup<Creature>::ReSpawn1Object(PoolObject* obj) template <> void PoolGroup<GameObject>::ReSpawn1Object(PoolObject* obj) { - if (GameObjectData const* data = sObjectMgr.GetGOData(obj->guid)) + if (GameObjectData const* data = sObjectMgr->GetGOData(obj->guid)) if (GameObject* pGameobject = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL)) pGameobject->GetMap()->Add(pGameobject); } @@ -614,7 +614,7 @@ void PoolMgr::LoadFromDB() uint32 pool_id = fields[1].GetUInt32(); float chance = fields[2].GetFloat(); - CreatureData const* data = sObjectMgr.GetCreatureData(guid); + CreatureData const* data = sObjectMgr->GetCreatureData(guid); if (!data) { sLog.outErrorDb("`pool_creature` has a non existing creature spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id); @@ -674,7 +674,7 @@ void PoolMgr::LoadFromDB() uint32 pool_id = fields[1].GetUInt32(); float chance = fields[2].GetFloat(); - GameObjectData const* data = sObjectMgr.GetGOData(guid); + GameObjectData const* data = sObjectMgr->GetGOData(guid); if (!data) { sLog.outErrorDb("`pool_gameobject` has a non existing gameobject spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id); @@ -842,7 +842,7 @@ void PoolMgr::LoadQuestPools() uint32 entry = fields[0].GetUInt32(); uint32 pool_id = fields[1].GetUInt32(); - Quest const* pQuest = sObjectMgr.GetQuestTemplate(entry); + Quest const* pQuest = sObjectMgr->GetQuestTemplate(entry); if (!pQuest) { sLog.outErrorDb("`pool_quest` has a non existing quest template (Entry: %u) defined for pool id (%u), skipped.", entry, pool_id); @@ -966,7 +966,7 @@ void PoolMgr::ChangeDailyQuests() { for (PoolGroupQuestMap::iterator itr = mPoolQuestGroups.begin(); itr != mPoolQuestGroups.end(); ++itr) { - if (Quest const* pQuest = sObjectMgr.GetQuestTemplate(itr->GetFirstEqualChancedObjectId())) + if (Quest const* pQuest = sObjectMgr->GetQuestTemplate(itr->GetFirstEqualChancedObjectId())) { if (pQuest->IsWeekly()) continue; @@ -982,7 +982,7 @@ void PoolMgr::ChangeWeeklyQuests() { for (PoolGroupQuestMap::iterator itr = mPoolQuestGroups.begin(); itr != mPoolQuestGroups.end(); ++itr) { - if (Quest const* pQuest = sObjectMgr.GetQuestTemplate(itr->GetFirstEqualChancedObjectId())) + if (Quest const* pQuest = sObjectMgr->GetQuestTemplate(itr->GetFirstEqualChancedObjectId())) { if (pQuest->IsDaily()) continue; diff --git a/src/server/game/Pools/PoolMgr.h b/src/server/game/Pools/PoolMgr.h index 369de80e90f..46d6c4f837d 100755 --- a/src/server/game/Pools/PoolMgr.h +++ b/src/server/game/Pools/PoolMgr.h @@ -161,7 +161,7 @@ class PoolMgr ActivePoolData mSpawnedData; }; -#define sPoolMgr (*ACE_Singleton<PoolMgr, ACE_Null_Mutex>::instance()) +#define sPoolMgr ACE_Singleton<PoolMgr, ACE_Null_Mutex>::instance() // Method that tell if the creature is part of a pool and return the pool id if yes template<> diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index cbd469edb69..a827f1262ce 100755 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -255,10 +255,10 @@ void ReputationMgr::Initialize() bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standing, bool incremental) { - sScriptMgr.OnPlayerReputationChange(m_player, factionEntry->ID, standing, incremental); + sScriptMgr->OnPlayerReputationChange(m_player, factionEntry->ID, standing, incremental); bool res = false; // if spillover definition exists in DB, override DBC - if (const RepSpilloverTemplate *repTemplate = sObjectMgr.GetRepSpilloverTemplate(factionEntry->ID)) + if (const RepSpilloverTemplate *repTemplate = sObjectMgr->GetRepSpilloverTemplate(factionEntry->ID)) { for (uint32 i = 0; i < MAX_SPILLOVER_FACTIONS; ++i) { diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index 88eb795c554..758275eeddc 100755 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -325,7 +325,7 @@ void Map::ScriptsProcess() source = HashMapHolder<Corpse>::Find(step.sourceGUID); break; case HIGHGUID_MO_TRANSPORT: - for (MapManager::TransportSet::iterator iter = sMapMgr.m_Transports.begin(); iter != sMapMgr.m_Transports.end(); ++iter) + for (MapManager::TransportSet::iterator iter = sMapMgr->m_Transports.begin(); iter != sMapMgr->m_Transports.end(); ++iter) { if ((*iter)->GetGUID() == step.sourceGUID) { @@ -390,7 +390,7 @@ void Map::ScriptsProcess() { uint64 targetGUID = target ? target->GetGUID() : 0; LocaleConstant loc_idx = pSource->GetSession()->GetSessionDbLocaleIndex(); - std::string text(sObjectMgr.GetTrinityString(step.script->Talk.TextID, loc_idx)); + std::string text(sObjectMgr->GetTrinityString(step.script->Talk.TextID, loc_idx)); switch (step.script->Talk.ChatType) { @@ -845,7 +845,7 @@ void Map::ScriptsProcess() } else //check hashmap holders { - if (CreatureData const* data = sObjectMgr.GetCreatureData(step.script->CallScript.CreatureEntry)) + if (CreatureData const* data = sObjectMgr->GetCreatureData(step.script->CallScript.CreatureEntry)) cTarget = ObjectAccessor::GetObjectInWorld<Creature>(data->mapid, data->posX, data->posY, MAKE_NEW_GUID(step.script->CallScript.CreatureEntry, data->id, HIGHGUID_UNIT), cTarget); } diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index aa075a8f836..d1761910e96 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -70,7 +70,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) return; } - const StringTextData* pData = sScriptSystemMgr.GetTextData(iTextEntry); + const StringTextData* pData = sScriptSystemMgr->GetTextData(iTextEntry); if (!pData) { @@ -192,10 +192,10 @@ void ScriptMgr::Initialize() void ScriptMgr::LoadDatabase() { - sScriptSystemMgr.LoadVersion(); - sScriptSystemMgr.LoadScriptTexts(); - sScriptSystemMgr.LoadScriptTextsCustom(); - sScriptSystemMgr.LoadScriptWaypoints(); + sScriptSystemMgr->LoadVersion(); + sScriptSystemMgr->LoadScriptTexts(); + sScriptSystemMgr->LoadScriptTextsCustom(); + sScriptSystemMgr->LoadScriptWaypoints(); } struct TSpellSummary @@ -291,7 +291,7 @@ void ScriptMgr::FillSpellSummary() void ScriptMgr::CreateSpellScripts(uint32 spell_id, std::list<SpellScript *> & script_vector) { - SpellScriptsBounds bounds = sObjectMgr.GetSpellScriptsBounds(spell_id); + SpellScriptsBounds bounds = sObjectMgr->GetSpellScriptsBounds(spell_id); for (SpellScriptsMap::iterator itr = bounds.first; itr != bounds.second; ++itr) { @@ -312,7 +312,7 @@ void ScriptMgr::CreateSpellScripts(uint32 spell_id, std::list<SpellScript *> & s void ScriptMgr::CreateAuraScripts(uint32 spell_id, std::list<AuraScript *> & script_vector) { - SpellScriptsBounds bounds = sObjectMgr.GetSpellScriptsBounds(spell_id); + SpellScriptsBounds bounds = sObjectMgr->GetSpellScriptsBounds(spell_id); for (SpellScriptsMap::iterator itr = bounds.first; itr != bounds.second; ++itr) { @@ -333,7 +333,7 @@ void ScriptMgr::CreateAuraScripts(uint32 spell_id, std::list<AuraScript *> & scr void ScriptMgr::CreateSpellScriptLoaders(uint32 spell_id, std::vector<std::pair<SpellScriptLoader *, SpellScriptsMap::iterator> > & script_vector) { - SpellScriptsBounds bounds = sObjectMgr.GetSpellScriptsBounds(spell_id); + SpellScriptsBounds bounds = sObjectMgr->GetSpellScriptsBounds(spell_id); script_vector.reserve(std::distance(bounds.first, bounds.second)); for (SpellScriptsMap::iterator itr = bounds.first; itr != bounds.second; ++itr) diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 674b587bff8..ad70afbcf70 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -751,7 +751,7 @@ public: }; // Placed here due to ScriptRegistry::AddScript dependency. -#define sScriptMgr (*ACE_Singleton<ScriptMgr, ACE_Null_Mutex>::instance()) +#define sScriptMgr ACE_Singleton<ScriptMgr, ACE_Null_Mutex>::instance() // Manages registration, loading, and execution of scripts. class ScriptMgr @@ -1024,7 +1024,7 @@ class ScriptMgr if (!existing) { ScriptPointerList[id] = script; - sScriptMgr.IncrementScriptCount(); + sScriptMgr->IncrementScriptCount(); } else { @@ -1047,7 +1047,7 @@ class ScriptMgr { // We're dealing with a code-only script; just add it. ScriptPointerList[_scriptIdCounter++] = script; - sScriptMgr.IncrementScriptCount(); + sScriptMgr->IncrementScriptCount(); } } diff --git a/src/server/game/Scripting/ScriptSystem.h b/src/server/game/Scripting/ScriptSystem.h index 27a20f009a6..c353bcb7120 100644 --- a/src/server/game/Scripting/ScriptSystem.h +++ b/src/server/game/Scripting/ScriptSystem.h @@ -95,6 +95,6 @@ class SystemMgr PointMoveMap m_mPointMoveMap; //coordinates for waypoints }; -#define sScriptSystemMgr (*ACE_Singleton<SystemMgr, ACE_Null_Mutex>::instance()) +#define sScriptSystemMgr ACE_Singleton<SystemMgr, ACE_Null_Mutex>::instance() #endif diff --git a/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp b/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp index e80f771c768..9a211d49acf 100755 --- a/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp @@ -35,13 +35,13 @@ void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket & recv_data) recv_data >> guid; sLog.outDebug("Inspect Arena stats (GUID: %u TypeId: %u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid))); - if (Player *plr = sObjectMgr.GetPlayer(guid)) + if (Player *plr = sObjectMgr->GetPlayer(guid)) { for (uint8 i = 0; i < MAX_ARENA_SLOT; ++i) { if (uint32 a_id = plr->GetArenaTeamId(i)) { - if (ArenaTeam *at = sObjectMgr.GetArenaTeamById(a_id)) + if (ArenaTeam *at = sObjectMgr->GetArenaTeamById(a_id)) at->InspectStats(this, plr->GetGUID()); } } @@ -55,7 +55,7 @@ void WorldSession::HandleArenaTeamQueryOpcode(WorldPacket & recv_data) uint32 ArenaTeamId; recv_data >> ArenaTeamId; - if (ArenaTeam *arenateam = sObjectMgr.GetArenaTeamById(ArenaTeamId)) + if (ArenaTeam *arenateam = sObjectMgr->GetArenaTeamById(ArenaTeamId)) { arenateam->Query(this); arenateam->Stats(this); @@ -69,7 +69,7 @@ void WorldSession::HandleArenaTeamRosterOpcode(WorldPacket & recv_data) uint32 ArenaTeamId; // arena team id recv_data >> ArenaTeamId; - if (ArenaTeam *arenateam = sObjectMgr.GetArenaTeamById(ArenaTeamId)) + if (ArenaTeam *arenateam = sObjectMgr->GetArenaTeamById(ArenaTeamId)) arenateam->Roster(this); } @@ -104,7 +104,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data) return; } - ArenaTeam *arenateam = sObjectMgr.GetArenaTeamById(ArenaTeamId); + ArenaTeam *arenateam = sObjectMgr->GetArenaTeamById(ArenaTeamId); if (!arenateam) { SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", "", ERR_ARENA_TEAM_PLAYER_NOT_IN_TEAM); @@ -155,7 +155,7 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/) { sLog.outDebug("CMSG_ARENA_TEAM_ACCEPT"); // empty opcode - ArenaTeam *at = sObjectMgr.GetArenaTeamById(_player->GetArenaTeamIdInvited()); + ArenaTeam *at = sObjectMgr->GetArenaTeamById(_player->GetArenaTeamIdInvited()); if (!at) return; @@ -166,7 +166,7 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/) return; } - if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && _player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(at->GetCaptain())) + if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && _player->GetTeam() != sObjectMgr->GetPlayerTeamByGUID(at->GetCaptain())) { // not let enemies sign petition SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", "", ERR_ARENA_TEAM_NOT_ALLIED); @@ -198,7 +198,7 @@ void WorldSession::HandleArenaTeamLeaveOpcode(WorldPacket & recv_data) uint32 ArenaTeamId; // arena team id recv_data >> ArenaTeamId; - ArenaTeam *at = sObjectMgr.GetArenaTeamById(ArenaTeamId); + ArenaTeam *at = sObjectMgr->GetArenaTeamById(ArenaTeamId); if (!at) return; @@ -233,7 +233,7 @@ void WorldSession::HandleArenaTeamDisbandOpcode(WorldPacket & recv_data) uint32 ArenaTeamId; // arena team id recv_data >> ArenaTeamId; - if (ArenaTeam *at = sObjectMgr.GetArenaTeamById(ArenaTeamId)) + if (ArenaTeam *at = sObjectMgr->GetArenaTeamById(ArenaTeamId)) { if (at->GetCaptain() != _player->GetGUID()) return; @@ -256,7 +256,7 @@ void WorldSession::HandleArenaTeamRemoveOpcode(WorldPacket & recv_data) recv_data >> ArenaTeamId; recv_data >> name; - ArenaTeam *at = sObjectMgr.GetArenaTeamById(ArenaTeamId); + ArenaTeam *at = sObjectMgr->GetArenaTeamById(ArenaTeamId); if (!at) // arena team not found return; @@ -298,7 +298,7 @@ void WorldSession::HandleArenaTeamLeaderOpcode(WorldPacket & recv_data) recv_data >> ArenaTeamId; recv_data >> name; - ArenaTeam *at = sObjectMgr.GetArenaTeamById(ArenaTeamId); + ArenaTeam *at = sObjectMgr->GetArenaTeamById(ArenaTeamId); if (!at) // arena team not found return; diff --git a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp index 1ecb0a001c5..dbb55094de3 100755 --- a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp @@ -167,7 +167,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) Item *it = pl->GetItemByGuid(item); //do not allow to sell already auctioned items - if (sAuctionMgr.GetAItem(GUID_LOPART(item))) + if (sAuctionMgr->GetAItem(GUID_LOPART(item))) { sLog.outError("AuctionError, player %s is sending item id: %u, but item is already in another auction", pl->GetName(), GUID_LOPART(item)); SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR); @@ -198,10 +198,10 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) return; } - AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction()); //we have to take deposit : - uint32 deposit = sAuctionMgr.GetAuctionDeposit(auctionHouseEntry, etime, it, count); + uint32 deposit = sAuctionMgr->GetAuctionDeposit(auctionHouseEntry, etime, it, count); if (!pl->HasEnoughMoney(deposit)) { SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_NOT_ENOUGHT_MONEY); @@ -219,7 +219,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) uint32 auction_time = uint32(etime * sWorld.getRate(RATE_AUCTION_TIME)); AuctionEntry *AH = new AuctionEntry; - AH->Id = sObjectMgr.GenerateAuctionID(); + AH->Id = sObjectMgr->GenerateAuctionID(); if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) AH->auctioneer = 23442; else @@ -236,7 +236,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) AH->auctionHouseEntry = auctionHouseEntry; sLog.outDetail("selling item %u to auctioneer %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", GUID_LOPART(item), AH->auctioneer, bid, buyout, auction_time, AH->GetHouseId()); - sAuctionMgr.AddAItem(it); + sAuctionMgr->AddAItem(it); auctionHouse->AddAuction(AH); pl->MoveItemFromInventory(it->GetBagSlot(), it->GetSlot(), true); @@ -276,7 +276,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data) if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject *auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction()); + AuctionHouseObject *auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction()); AuctionEntry *auction = auctionHouse->GetAuction(auctionId); Player *pl = GetPlayer(); @@ -289,8 +289,8 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data) } // impossible have online own another character (use this for speedup check in case online owner) - Player* auction_owner = sObjectMgr.GetPlayer(MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER)); - if (!auction_owner && sObjectMgr.GetPlayerAccountIdByGUID(MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER)) == pl->GetSession()->GetAccountId()) + Player* auction_owner = sObjectMgr->GetPlayer(MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER)); + if (!auction_owner && sObjectMgr->GetPlayerAccountIdByGUID(MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER)) == pl->GetSession()->GetAccountId()) { //you cannot bid your another character auction: SendAuctionCommandResult(0, AUCTION_PLACE_BID, CANNOT_BID_YOUR_AUCTION_ERROR); @@ -327,7 +327,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data) else { // mail to last bidder and return money - sAuctionMgr.SendAuctionOutbiddedMail(auction, price, GetPlayer(), trans); + sAuctionMgr->SendAuctionOutbiddedMail(auction, price, GetPlayer(), trans); pl->ModifyMoney(-int32(price)); } } @@ -351,23 +351,23 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data) { pl->ModifyMoney(-int32(auction->buyout)); if (auction->bidder) //buyout for bidded auction .. - sAuctionMgr.SendAuctionOutbiddedMail(auction, auction->buyout, GetPlayer(), trans); + sAuctionMgr->SendAuctionOutbiddedMail(auction, auction->buyout, GetPlayer(), trans); } auction->bidder = pl->GetGUIDLow(); auction->bid = auction->buyout; GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, auction->buyout); //- Mails must be under transaction control too to prevent data loss - sAuctionMgr.SendAuctionSalePendingMail(auction, trans); - sAuctionMgr.SendAuctionSuccessfulMail(auction, trans); - sAuctionMgr.SendAuctionWonMail(auction, trans); + sAuctionMgr->SendAuctionSalePendingMail(auction, trans); + sAuctionMgr->SendAuctionSuccessfulMail(auction, trans); + sAuctionMgr->SendAuctionWonMail(auction, trans); SendAuctionCommandResult(auction->Id, AUCTION_PLACE_BID, AUCTION_OK); auction->DeleteFromDB(trans); uint32 item_template = auction->item_template; - sAuctionMgr.RemoveAItem(auction->item_guidlow); + sAuctionMgr->RemoveAItem(auction->item_guidlow); auctionHouse->RemoveAuction(auction, item_template); } pl->SaveInventoryAndGoldToDB(trans); @@ -394,7 +394,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction()); AuctionEntry *auction = auctionHouse->GetAuction(auctionId); Player *pl = GetPlayer(); @@ -402,7 +402,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) SQLTransaction trans = CharacterDatabase.BeginTransaction(); if (auction && auction->owner == pl->GetGUIDLow()) { - Item *pItem = sAuctionMgr.GetAItem(auction->item_guidlow); + Item *pItem = sAuctionMgr->GetAItem(auction->item_guidlow); if (pItem) { if (auction->bidder > 0) // If we have a bidder, we have to send him the money he paid @@ -411,7 +411,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) if (!pl->HasEnoughMoney(auctionCut)) //player doesn't have enough money, maybe message needed return; //some auctionBidderNotification would be needed, but don't know that parts.. - sAuctionMgr.SendAuctionCancelledToBidderMail(auction, trans); + sAuctionMgr->SendAuctionCancelledToBidderMail(auction, trans); pl->ModifyMoney(-int32(auctionCut)); } // Return the item by mail @@ -448,7 +448,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) CharacterDatabase.CommitTransaction(trans); uint32 item_template = auction->item_template; - sAuctionMgr.RemoveAItem(auction->item_guidlow); + sAuctionMgr->RemoveAItem(auction->item_guidlow); auctionHouse->RemoveAuction(auction, item_template); } @@ -479,7 +479,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data) if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction()); WorldPacket data(SMSG_AUCTION_BIDDER_LIST_RESULT, (4+4+4)); Player *pl = GetPlayer(); @@ -526,7 +526,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data) if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction()); WorldPacket data(SMSG_AUCTION_OWNER_LIST_RESULT, (4+4+4)); data << (uint32) 0; // amount place holder @@ -579,7 +579,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data) if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction()); //sLog.outDebug("Auctionhouse search (GUID: %u TypeId: %u)", , list from: %u, searchedname: %s, levelmin: %u, levelmax: %u, auctionSlotID: %u, auctionMainCategory: %u, auctionSubCategory: %u, quality: %u, usable: %u", // GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid)), listfrom, searchedname.c_str(), levelmin, levelmax, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, usable); diff --git a/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp b/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp index 3d9face508d..700053d430d 100755 --- a/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp @@ -51,7 +51,7 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recv_data) // Stop the npc if moving unit->StopMoving(); - BattlegroundTypeId bgTypeId = sBattlegroundMgr.GetBattleMasterBG(unit->GetEntry()); + BattlegroundTypeId bgTypeId = sBattlegroundMgr->GetBattleMasterBG(unit->GetEntry()); if (!_player->GetBGAccessByLevel(bgTypeId)) { @@ -66,7 +66,7 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recv_data) void WorldSession::SendBattlegGroundList(uint64 guid, BattlegroundTypeId bgTypeId) { WorldPacket data; - sBattlegroundMgr.BuildBattlegroundListPacket(&data, guid, _player, bgTypeId, 0); + sBattlegroundMgr->BuildBattlegroundListPacket(&data, guid, _player, bgTypeId, 0); SendPacket(&data); } @@ -90,7 +90,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) return; } - if (sDisableMgr.IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, bgTypeId_, NULL)) + if (sDisableMgr->IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, bgTypeId_, NULL)) { ChatHandler(this).PSendSysMessage(LANG_BG_DISABLED); return; @@ -111,10 +111,10 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) // get bg instance or bg template if instance not found Battleground *bg = NULL; if (instanceId) - bg = sBattlegroundMgr.GetBattlegroundThroughClientInstance(instanceId, bgTypeId); + bg = sBattlegroundMgr->GetBattlegroundThroughClientInstance(instanceId, bgTypeId); if (!bg) - bg = sBattlegroundMgr.GetBattlegroundTemplate(bgTypeId); + bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId); if (!bg) return; @@ -132,7 +132,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) { // player is using dungeon finder or raid finder WorldPacket data; - sBattlegroundMgr.BuildGroupJoinedBattlegroundPacket(&data, ERR_LFG_CANT_USE_BATTLEGROUND); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, ERR_LFG_CANT_USE_BATTLEGROUND); GetPlayer()->GetSession()->SendPacket(&data); return; } @@ -141,7 +141,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) if (!_player->CanJoinToBattleground()) { WorldPacket data; - sBattlegroundMgr.BuildGroupJoinedBattlegroundPacket(&data, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS); _player->GetSession()->SendPacket(&data); return; } @@ -150,7 +150,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) { //player is already in random queue WorldPacket data; - sBattlegroundMgr.BuildGroupJoinedBattlegroundPacket(&data, ERR_IN_RANDOM_BG); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, ERR_IN_RANDOM_BG); _player->GetSession()->SendPacket(&data); return; } @@ -159,7 +159,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) { //player is already in queue, can't start random queue WorldPacket data; - sBattlegroundMgr.BuildGroupJoinedBattlegroundPacket(&data, ERR_IN_NON_RANDOM_BG); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, ERR_IN_NON_RANDOM_BG); _player->GetSession()->SendPacket(&data); return; } @@ -173,12 +173,12 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) if (!_player->HasFreeBattlegroundQueueId()) { WorldPacket data; - sBattlegroundMgr.BuildGroupJoinedBattlegroundPacket(&data, ERR_BATTLEGROUND_TOO_MANY_QUEUES); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, ERR_BATTLEGROUND_TOO_MANY_QUEUES); _player->GetSession()->SendPacket(&data); return; } - BattlegroundQueue& bgQueue = sBattlegroundMgr.m_BattlegroundQueues[bgQueueTypeId]; + BattlegroundQueue& bgQueue = sBattlegroundMgr->m_BattlegroundQueues[bgQueueTypeId]; GroupQueueInfo * ginfo = bgQueue.AddGroup(_player, NULL, bgTypeId, bracketEntry, 0, false, isPremade, 0, 0); uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); @@ -187,7 +187,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) WorldPacket data; // send status packet (in queue) - sBattlegroundMgr.BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType); SendPacket(&data); sLog.outDebug("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName()); } @@ -202,7 +202,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) err = grp->CanJoinBattlegroundQueue(bg, bgQueueTypeId, 0, bg->GetMaxPlayersPerTeam(), false, 0); isPremade = (grp->GetMembersCount() >= bg->GetMinPlayersPerTeam()); - BattlegroundQueue& bgQueue = sBattlegroundMgr.m_BattlegroundQueues[bgQueueTypeId]; + BattlegroundQueue& bgQueue = sBattlegroundMgr->m_BattlegroundQueues[bgQueueTypeId]; GroupQueueInfo * ginfo = NULL; uint32 avgTime = 0; @@ -222,7 +222,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) if (err <= 0) { - sBattlegroundMgr.BuildGroupJoinedBattlegroundPacket(&data, err); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err); member->GetSession()->SendPacket(&data); continue; } @@ -231,16 +231,16 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) uint32 queueSlot = member->AddBattlegroundQueueId(bgQueueTypeId); // send status packet (in queue) - sBattlegroundMgr.BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType); member->GetSession()->SendPacket(&data); - sBattlegroundMgr.BuildGroupJoinedBattlegroundPacket(&data, err); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err); member->GetSession()->SendPacket(&data); sLog.outDebug("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,member->GetGUIDLow(), member->GetName()); } sLog.outDebug("Battleground: group end"); } - sBattlegroundMgr.ScheduleQueueUpdate(0, 0, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); + sBattlegroundMgr->ScheduleQueueUpdate(0, 0, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); } void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & /*recv_data*/) @@ -259,11 +259,11 @@ void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & /*recv_ uint32 count1 = 0; //always constant zero? uint32 count2 = 0; //count of next fields - Player *ali_plr = sObjectMgr.GetPlayer(((BattlegroundWS*)bg)->GetAllianceFlagPickerGUID()); + Player *ali_plr = sObjectMgr->GetPlayer(((BattlegroundWS*)bg)->GetAllianceFlagPickerGUID()); if (ali_plr) ++count2; - Player *horde_plr = sObjectMgr.GetPlayer(((BattlegroundWS*)bg)->GetHordeFlagPickerGUID()); + Player *horde_plr = sObjectMgr->GetPlayer(((BattlegroundWS*)bg)->GetHordeFlagPickerGUID()); if (horde_plr) ++count2; @@ -320,7 +320,7 @@ void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recv_data*/) return; WorldPacket data; - sBattlegroundMgr.BuildPvpLogDataPacket(&data, bg); + sBattlegroundMgr->BuildPvpLogDataPacket(&data, bg); SendPacket(&data); sLog.outDebug("WORLD: Sent MSG_PVP_LOG_DATA Message"); @@ -347,7 +347,7 @@ void WorldSession::HandleBattlefieldListOpcode(WorldPacket &recv_data) } WorldPacket data; - sBattlegroundMgr.BuildBattlegroundListPacket(&data, 0, _player, BattlegroundTypeId(bgTypeId), fromWhere); + sBattlegroundMgr->BuildBattlegroundListPacket(&data, 0, _player, BattlegroundTypeId(bgTypeId), fromWhere); SendPacket(&data); } @@ -377,7 +377,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) //get GroupQueueInfo from BattlegroundQueue BattlegroundTypeId bgTypeId = BattlegroundTypeId(bgTypeId_); BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(bgTypeId, type); - BattlegroundQueue& bgQueue = sBattlegroundMgr.m_BattlegroundQueues[bgQueueTypeId]; + BattlegroundQueue& bgQueue = sBattlegroundMgr->m_BattlegroundQueues[bgQueueTypeId]; //we must use temporary variable, because GroupQueueInfo pointer can be deleted in BattlegroundQueue::RemovePlayer() function GroupQueueInfo ginfo; if (!bgQueue.GetPlayerGroupInfoData(_player->GetGUID(), &ginfo)) @@ -392,11 +392,11 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) return; } - Battleground *bg = sBattlegroundMgr.GetBattleground(ginfo.IsInvitedToBGInstanceGUID, bgTypeId); + Battleground *bg = sBattlegroundMgr->GetBattleground(ginfo.IsInvitedToBGInstanceGUID, bgTypeId); // bg template might and must be used in case of leaving queue, when instance is not created yet if (!bg && action == 0) - bg = sBattlegroundMgr.GetBattlegroundTemplate(bgTypeId); + bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId); if (!bg) { sLog.outError("BattlegroundHandler: bg_template not found for type id %u.", bgTypeId); @@ -416,7 +416,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) { //send bg command result to show nice message WorldPacket data2; - sBattlegroundMgr.BuildGroupJoinedBattlegroundPacket(&data2, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data2, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS); _player->GetSession()->SendPacket(&data2); action = 0; sLog.outDebug("Battleground: player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName(), _player->GetGUIDLow()); @@ -453,7 +453,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) _player->CleanupAfterTaxiFlight(); } - sBattlegroundMgr.BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime(), bg->GetArenaType()); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime(), bg->GetArenaType()); _player->GetSession()->SendPacket(&data); // remove battleground queue status from BGmgr bgQueue.RemovePlayer(_player->GetGUID(), false); @@ -467,7 +467,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) // set the destination team _player->SetBGTeam(ginfo.Team); // bg->HandleBeforeTeleportToBattleground(_player); - sBattlegroundMgr.SendToBattleground(_player, ginfo.IsInvitedToBGInstanceGUID, bgTypeId); + sBattlegroundMgr->SendToBattleground(_player, ginfo.IsInvitedToBGInstanceGUID, bgTypeId); // add only in HandleMoveWorldPortAck() // bg->AddPlayer(_player,team); sLog.outDebug("Battleground: player %s (%u) joined battle for bg %u, bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetInstanceID(), bg->GetTypeID(), bgQueueTypeId); @@ -476,7 +476,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) // if player leaves rated arena match before match start, it is counted as he played but he lost if (ginfo.IsRated && ginfo.IsInvitedToBGInstanceGUID) { - ArenaTeam * at = sObjectMgr.GetArenaTeamById(ginfo.Team); + ArenaTeam * at = sObjectMgr->GetArenaTeamById(ginfo.Team); if (at) { sLog.outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u, because he has left queue!", GUID_LOPART(_player->GetGUID()), ginfo.OpponentsTeamRating); @@ -485,11 +485,11 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) } } _player->RemoveBattlegroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to queue->removeplayer, it causes bugs - sBattlegroundMgr.BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0, 0); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0, 0); bgQueue.RemovePlayer(_player->GetGUID(), true); // player left queue, we should update it - do not update Arena Queue if (!ginfo.ArenaType) - sBattlegroundMgr.ScheduleQueueUpdate(ginfo.ArenaMatchmakerRating, ginfo.ArenaType, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); + sBattlegroundMgr->ScheduleQueueUpdate(ginfo.ArenaMatchmakerRating, ginfo.ArenaType, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); SendPacket(&data); sLog.outDebug("Battleground: player %s (%u) left queue for bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetTypeID(), bgQueueTypeId); break; @@ -541,30 +541,30 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recv_data*/) { // this line is checked, i only don't know if GetStartTime is changing itself after bg end! // send status in Battleground - sBattlegroundMgr.BuildBattlegroundStatusPacket(&data, bg, i, STATUS_IN_PROGRESS, bg->GetEndTime(), bg->GetStartTime(), arenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, i, STATUS_IN_PROGRESS, bg->GetEndTime(), bg->GetStartTime(), arenaType); SendPacket(&data); continue; } } //we are sending update to player about queue - he can be invited there! //get GroupQueueInfo for queue status - BattlegroundQueue& bgQueue = sBattlegroundMgr.m_BattlegroundQueues[bgQueueTypeId]; + BattlegroundQueue& bgQueue = sBattlegroundMgr->m_BattlegroundQueues[bgQueueTypeId]; GroupQueueInfo ginfo; if (!bgQueue.GetPlayerGroupInfoData(_player->GetGUID(), &ginfo)) continue; if (ginfo.IsInvitedToBGInstanceGUID) { - bg = sBattlegroundMgr.GetBattleground(ginfo.IsInvitedToBGInstanceGUID, bgTypeId); + bg = sBattlegroundMgr->GetBattleground(ginfo.IsInvitedToBGInstanceGUID, bgTypeId); if (!bg) continue; uint32 remainingTime = getMSTimeDiff(getMSTime(), ginfo.RemoveInviteTime); // send status invited to Battleground - sBattlegroundMgr.BuildBattlegroundStatusPacket(&data, bg, i, STATUS_WAIT_JOIN, remainingTime, 0, arenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, i, STATUS_WAIT_JOIN, remainingTime, 0, arenaType); SendPacket(&data); } else { - bg = sBattlegroundMgr.GetBattlegroundTemplate(bgTypeId); + bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId); if (!bg) continue; @@ -575,7 +575,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recv_data*/) uint32 avgTime = bgQueue.GetAverageQueueWaitTime(&ginfo, bracketEntry->GetBracketId()); // send status in Battleground Queue - sBattlegroundMgr.BuildBattlegroundStatusPacket(&data, bg, i, STATUS_WAIT_QUEUE, avgTime, getMSTimeDiff(ginfo.JoinTime, getMSTime()), arenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, i, STATUS_WAIT_QUEUE, avgTime, getMSTimeDiff(ginfo.JoinTime, getMSTime()), arenaType); SendPacket(&data); } } @@ -598,7 +598,7 @@ void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data) return; if (bg) - sBattlegroundMgr.SendAreaSpiritHealerQueryOpcode(_player, bg, guid); + sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, guid); } @@ -668,14 +668,14 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) } //check existance - Battleground* bg = sBattlegroundMgr.GetBattlegroundTemplate(BATTLEGROUND_AA); + Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(BATTLEGROUND_AA); if (!bg) { sLog.outError("Battleground: template bg (all arenas) not found"); return; } - if (sDisableMgr.IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, BATTLEGROUND_AA, NULL)) + if (sDisableMgr->IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, BATTLEGROUND_AA, NULL)) { ChatHandler(this).PSendSysMessage(LANG_ARENA_DISABLED); return; @@ -716,7 +716,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) { ateamId = _player->GetArenaTeamId(arenaslot); // check real arenateam existence only here (if it was moved to group->CanJoin .. () then we would ahve to get it twice) - ArenaTeam * at = sObjectMgr.GetArenaTeamById(ateamId); + ArenaTeam * at = sObjectMgr->GetArenaTeamById(ateamId); if (!at) { _player->GetSession()->SendNotInArenaTeamPacket(arenatype); @@ -731,7 +731,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) arenaRating = 1; } - BattlegroundQueue &bgQueue = sBattlegroundMgr.m_BattlegroundQueues[bgQueueTypeId]; + BattlegroundQueue &bgQueue = sBattlegroundMgr->m_BattlegroundQueues[bgQueueTypeId]; if (asGroup) { uint32 avgTime = 0; @@ -761,7 +761,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) if (err <= 0) { - sBattlegroundMgr.BuildGroupJoinedBattlegroundPacket(&data, err); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err); member->GetSession()->SendPacket(&data); continue; } @@ -770,9 +770,9 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) uint32 queueSlot = member->AddBattlegroundQueueId(bgQueueTypeId); // send status packet (in queue) - sBattlegroundMgr.BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype); member->GetSession()->SendPacket(&data); - sBattlegroundMgr.BuildGroupJoinedBattlegroundPacket(&data, err); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err); member->GetSession()->SendPacket(&data); sLog.outDebug("Battleground: player joined queue for arena as group bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,member->GetGUIDLow(), member->GetName()); } @@ -785,18 +785,18 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) WorldPacket data; // send status packet (in queue) - sBattlegroundMgr.BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype); SendPacket(&data); sLog.outDebug("Battleground: player joined queue for arena, skirmish, bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName()); } - sBattlegroundMgr.ScheduleQueueUpdate(matchmakerRating, arenatype, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); + sBattlegroundMgr->ScheduleQueueUpdate(matchmakerRating, arenatype, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); } void WorldSession::HandleReportPvPAFK(WorldPacket & recv_data) { uint64 playerGuid; recv_data >> playerGuid; - Player *reportedPlayer = sObjectMgr.GetPlayer(playerGuid); + Player *reportedPlayer = sObjectMgr->GetPlayer(playerGuid); if (!reportedPlayer) { diff --git a/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp b/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp index 0f5ca51ffa5..9c13aba4109 100755 --- a/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp @@ -89,7 +89,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket & /*recv_data*/) p_counter = data.wpos(); data << uint32(counter); // raid reset count - ResetTimeByMapDifficultyMap const& resets = sInstanceSaveMgr.GetResetTimeMap(); + ResetTimeByMapDifficultyMap const& resets = sInstanceSaveMgr->GetResetTimeMap(); for (ResetTimeByMapDifficultyMap::const_iterator itr = resets.begin(); itr != resets.end(); ++itr) { uint32 mapid = PAIR32_LOPART(itr->first); diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index d7c07af8109..0c9452da0f2 100755 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -352,14 +352,14 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) return; } - if (GetSecurity() == SEC_PLAYER && sObjectMgr.IsReservedName(name)) + if (GetSecurity() == SEC_PLAYER && sObjectMgr->IsReservedName(name)) { data << (uint8)CHAR_NAME_RESERVED; SendPacket(&data); return; } - if (sObjectMgr.GetPlayerGUIDByName(name)) + if (sObjectMgr->GetPlayerGUIDByName(name)) { data << (uint8)CHAR_CREATE_NAME_IN_USE; SendPacket(&data); @@ -532,7 +532,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) } Player * pNewChar = new Player(this); - if (!pNewChar->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_PLAYER), name, race_, class_, gender, skin, face, hairStyle, hairColor, facialHair, outfitId)) + if (!pNewChar->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_PLAYER), name, race_, class_, gender, skin, face, hairStyle, hairColor, facialHair, outfitId)) { // Player not create (race/class problem?) pNewChar->CleanupsBeforeDelete(); @@ -564,7 +564,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) std::string IP_str = GetRemoteAddress(); sLog.outDetail("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), pNewChar->GetGUIDLow()); sLog.outChar("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), pNewChar->GetGUIDLow()); - sScriptMgr.OnPlayerCreate(pNewChar); + sScriptMgr->OnPlayerCreate(pNewChar); delete pNewChar; // created only to call SaveToDB() } @@ -575,14 +575,14 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data) recv_data >> guid; // can't delete loaded character - if (sObjectMgr.GetPlayer(guid)) + if (sObjectMgr->GetPlayer(guid)) return; uint32 accountId = 0; std::string name; // is guild leader - if (sObjectMgr.GetGuildByLeader(guid)) + if (sObjectMgr->GetGuildByLeader(guid)) { WorldPacket data(SMSG_CHAR_DELETE, 1); data << (uint8)CHAR_DELETE_FAILED_GUILD_LEADER; @@ -591,7 +591,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data) } // is arena team captain - if (sObjectMgr.GetArenaTeamByCaptain(guid)) + if (sObjectMgr->GetArenaTeamByCaptain(guid)) { WorldPacket data(SMSG_CHAR_DELETE, 1); data << (uint8)CHAR_DELETE_FAILED_ARENA_CAPTAIN; @@ -614,7 +614,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data) std::string IP_str = GetRemoteAddress(); sLog.outDetail("Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)",GetAccountId(),IP_str.c_str(),name.c_str(),GUID_LOPART(guid)); sLog.outChar("Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)",GetAccountId(),IP_str.c_str(),name.c_str(),GUID_LOPART(guid)); - sScriptMgr.OnPlayerDelete(guid); + sScriptMgr->OnPlayerDelete(guid); if (sLog.IsOutCharDump()) // optimize GetPlayerDump call { @@ -750,7 +750,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) if (pCurrChar->GetGuildId() != 0) { - if (Guild* pGuild = sObjectMgr.GetGuildById(pCurrChar->GetGuildId())) + if (Guild* pGuild = sObjectMgr->GetGuildById(pCurrChar->GetGuildId())) pGuild->SendLoginInfo(this); else { @@ -787,7 +787,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) if (!pCurrChar->GetMap()->Add(pCurrChar) || !pCurrChar->CheckInstanceLoginValid()) { - AreaTrigger const* at = sObjectMgr.GetGoBackTrigger(pCurrChar->GetMapId()); + AreaTrigger const* at = sObjectMgr->GetGoBackTrigger(pCurrChar->GetMapId()); if (at) pCurrChar->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, pCurrChar->GetOrientation()); else @@ -812,7 +812,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) } // friend status - sSocialMgr.SendFriendStatus(pCurrChar, FRIEND_ONLINE, pCurrChar->GetGUIDLow(), true); + sSocialMgr->SendFriendStatus(pCurrChar, FRIEND_ONLINE, pCurrChar->GetGUIDLow(), true); // Place character in world (and load zone) before some object loading pCurrChar->LoadCorpse(); @@ -880,7 +880,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) m_playerLoading = false; - sScriptMgr.OnPlayerLogin(pCurrChar); + sScriptMgr->OnPlayerLogin(pCurrChar); delete holder; } @@ -1019,7 +1019,7 @@ void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data) } // check name limitations - if (GetSecurity() == SEC_PLAYER && sObjectMgr.IsReservedName(newname)) + if (GetSecurity() == SEC_PLAYER && sObjectMgr->IsReservedName(newname)) { WorldPacket data(SMSG_CHAR_RENAME, 1); data << uint8(CHAR_NAME_RESERVED); @@ -1075,7 +1075,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data) // not accept declined names for unsupported languages std::string name; - if (!sObjectMgr.GetPlayerNameByGUID(guid, name)) + if (!sObjectMgr->GetPlayerNameByGUID(guid, name)) { WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4+8); data << uint32(1); @@ -1281,7 +1281,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data) } // check name limitations - if (GetSecurity() == SEC_PLAYER && sObjectMgr.IsReservedName(newname)) + if (GetSecurity() == SEC_PLAYER && sObjectMgr->IsReservedName(newname)) { WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1); data << uint8(CHAR_NAME_RESERVED); @@ -1290,7 +1290,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data) } // character with this name already exist - if (uint64 newguid = sObjectMgr.GetPlayerGUIDByName(newname)) + if (uint64 newguid = sObjectMgr->GetPlayerGUIDByName(newname)) { if (newguid != guid) { @@ -1453,7 +1453,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) uint32 at_loginFlags = fields[2].GetUInt32(); uint32 used_loginFlag = ((recv_data.GetOpcode() == CMSG_CHAR_RACE_CHANGE) ? AT_LOGIN_CHANGE_RACE : AT_LOGIN_CHANGE_FACTION); - if (!sObjectMgr.GetPlayerInfo(race, playerClass)) + if (!sObjectMgr->GetPlayerInfo(race, playerClass)) { WorldPacket data(SMSG_CHAR_FACTION_CHANGE, 1); data << uint8(CHAR_CREATE_ERROR); @@ -1500,7 +1500,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) } // check name limitations - if (GetSecurity() == SEC_PLAYER && sObjectMgr.IsReservedName(newname)) + if (GetSecurity() == SEC_PLAYER && sObjectMgr->IsReservedName(newname)) { WorldPacket data(SMSG_CHAR_FACTION_CHANGE, 1); data << uint8(CHAR_NAME_RESERVED); @@ -1509,7 +1509,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) } // character with this name already exist - if (uint64 newguid = sObjectMgr.GetPlayerGUIDByName(newname)) + if (uint64 newguid = sObjectMgr->GetPlayerGUIDByName(newname)) { if (newguid != guid) { @@ -1641,7 +1641,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) // Delete record of the faction old completed quests { std::ostringstream quests; - ObjectMgr::QuestMap const& qTemplates = sObjectMgr.GetQuestTemplates(); + ObjectMgr::QuestMap const& qTemplates = sObjectMgr->GetQuestTemplates(); for (ObjectMgr::QuestMap::const_iterator iter = qTemplates.begin(); iter != qTemplates.end(); ++iter) { Quest *qinfo = iter->second; @@ -1700,7 +1700,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) } // Achievement conversion - for (std::map<uint32, uint32>::const_iterator it = sObjectMgr.factionchange_achievements.begin(); it != sObjectMgr.factionchange_achievements.end(); ++it) + for (std::map<uint32, uint32>::const_iterator it = sObjectMgr->factionchange_achievements.begin(); it != sObjectMgr->factionchange_achievements.end(); ++it) { uint32 achiev_alliance = it->first; uint32 achiev_horde = it->second; @@ -1711,7 +1711,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) } // Item conversion - for (std::map<uint32, uint32>::const_iterator it = sObjectMgr.factionchange_items.begin(); it != sObjectMgr.factionchange_items.end(); ++it) + for (std::map<uint32, uint32>::const_iterator it = sObjectMgr->factionchange_items.begin(); it != sObjectMgr->factionchange_items.end(); ++it) { uint32 item_alliance = it->first; uint32 item_horde = it->second; @@ -1720,7 +1720,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) } // Spell conversion - for (std::map<uint32, uint32>::const_iterator it = sObjectMgr.factionchange_spells.begin(); it != sObjectMgr.factionchange_spells.end(); ++it) + for (std::map<uint32, uint32>::const_iterator it = sObjectMgr->factionchange_spells.begin(); it != sObjectMgr->factionchange_spells.end(); ++it) { uint32 spell_alliance = it->first; uint32 spell_horde = it->second; @@ -1731,7 +1731,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) } // Reputation conversion - for (std::map<uint32, uint32>::const_iterator it = sObjectMgr.factionchange_reputations.begin(); it != sObjectMgr.factionchange_reputations.end(); ++it) + for (std::map<uint32, uint32>::const_iterator it = sObjectMgr->factionchange_reputations.begin(); it != sObjectMgr->factionchange_reputations.end(); ++it) { uint32 reputation_alliance = it->first; uint32 reputation_horde = it->second; diff --git a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp index 1f0c1788646..d236c7f0196 100755 --- a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp @@ -117,7 +117,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) return; } - sScriptMgr.OnPlayerChat(GetPlayer(), CHAT_MSG_ADDON, lang, msg); + sScriptMgr->OnPlayerChat(GetPlayer(), CHAT_MSG_ADDON, lang, msg); } // Disabled addon channel? @@ -264,7 +264,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) break; } - Player *player = sObjectMgr.GetPlayer(to.c_str()); + Player *player = sObjectMgr->GetPlayer(to.c_str()); uint32 tSecurity = GetSecurity(); uint32 pSecurity = player ? player->GetSession()->GetSecurity() : SEC_PLAYER; if (!player || (tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers())) @@ -307,7 +307,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) if ((type == CHAT_MSG_PARTY_LEADER) && !group->IsLeader(_player->GetGUID())) return; - sScriptMgr.OnPlayerChat(GetPlayer(), type, lang, msg, group); + sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group); WorldPacket data; ChatHandler::FillMessageData(&data, this, type, lang, NULL, 0, msg.c_str(), NULL); @@ -317,9 +317,9 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) { if (GetPlayer()->GetGuildId()) { - if (Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId())) + if (Guild *guild = sObjectMgr->GetGuildById(GetPlayer()->GetGuildId())) { - sScriptMgr.OnPlayerChat(GetPlayer(), type, lang, msg, guild); + sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, guild); guild->BroadcastToGuild(this, false, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL); } @@ -329,9 +329,9 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) { if (GetPlayer()->GetGuildId()) { - if (Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId())) + if (Guild *guild = sObjectMgr->GetGuildById(GetPlayer()->GetGuildId())) { - sScriptMgr.OnPlayerChat(GetPlayer(), type, lang, msg, guild); + sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, guild); guild->BroadcastToGuild(this, true, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL); } @@ -348,7 +348,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) return; } - sScriptMgr.OnPlayerChat(GetPlayer(), type, lang, msg, group); + sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group); WorldPacket data; ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID, lang, "", 0, msg.c_str(), NULL); @@ -365,7 +365,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) return; } - sScriptMgr.OnPlayerChat(GetPlayer(), type, lang, msg, group); + sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group); WorldPacket data; ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_LEADER, lang, "", 0, msg.c_str(), NULL); @@ -377,7 +377,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) if (!group || !group->isRaidGroup() || !(group->IsLeader(GetPlayer()->GetGUID()) || group->IsAssistant(GetPlayer()->GetGUID())) || group->isBGGroup()) return; - sScriptMgr.OnPlayerChat(GetPlayer(), type, lang, msg, group); + sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group); WorldPacket data; //in battleground, raid warning is sent only to players in battleground - code is ok @@ -391,7 +391,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) if (!group || !group->isBGGroup()) return; - sScriptMgr.OnPlayerChat(GetPlayer(), type, lang, msg, group); + sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group); WorldPacket data; ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND, lang, "", 0, msg.c_str(), NULL); @@ -404,7 +404,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) if (!group || !group->isBGGroup() || !group->IsLeader(GetPlayer()->GetGUID())) return; - sScriptMgr.OnPlayerChat(GetPlayer(), type, lang, msg, group); + sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group); WorldPacket data; ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND_LEADER, lang, "", 0, msg.c_str(), NULL); @@ -423,7 +423,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) if (Channel *chn = cMgr->GetChannel(channel, _player)) { - sScriptMgr.OnPlayerChat(_player, type, lang, msg, chn); + sScriptMgr->OnPlayerChat(_player, type, lang, msg, chn); chn->Say(_player->GetGUID(), msg.c_str(), lang); } @@ -440,7 +440,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) _player->afkMsg = msg; } - sScriptMgr.OnPlayerChat(_player, type, lang, msg); + sScriptMgr->OnPlayerChat(_player, type, lang, msg); _player->ToggleAFK(); if (_player->isAFK() && _player->isDND()) @@ -458,7 +458,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) _player->dndMsg = msg; } - sScriptMgr.OnPlayerChat(_player, type, lang, msg); + sScriptMgr->OnPlayerChat(_player, type, lang, msg); _player->ToggleDND(); if (_player->isDND() && _player->isAFK()) @@ -478,7 +478,7 @@ void WorldSession::HandleEmoteOpcode(WorldPacket & recv_data) uint32 emote; recv_data >> emote; - sScriptMgr.OnPlayerEmote(GetPlayer(), emote); + sScriptMgr->OnPlayerEmote(GetPlayer(), emote); GetPlayer()->HandleEmoteCommand(emote); } @@ -533,7 +533,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recv_data) recv_data >> emoteNum; recv_data >> guid; - sScriptMgr.OnPlayerTextEmote(GetPlayer(), text_emote, emoteNum, guid); + sScriptMgr->OnPlayerTextEmote(GetPlayer(), text_emote, emoteNum, guid); EmotesTextEntry const *em = sEmotesTextStore.LookupEntry(text_emote); if (!em) @@ -586,7 +586,7 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data) recv_data >> iguid; recv_data >> unk; // probably related to spam reporting - Player *player = sObjectMgr.GetPlayer(iguid); + Player *player = sObjectMgr->GetPlayer(iguid); if (!player || !player->GetSession()) return; diff --git a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp index 9d6de7ed542..cc395d4e5b7 100755 --- a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp @@ -70,7 +70,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data) return; } - Player *player = sObjectMgr.GetPlayer(membername.c_str()); + Player *player = sObjectMgr->GetPlayer(membername.c_str()); // no player if (!player) @@ -214,7 +214,7 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recv_data) return; } - Player* leader = sObjectMgr.GetPlayer(group->GetLeaderGUID()); + Player* leader = sObjectMgr->GetPlayer(group->GetLeaderGUID()); // forming a new group, create it if (!group->IsCreated()) @@ -222,7 +222,7 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recv_data) if (leader) group->RemoveInvite(leader); group->Create(group->GetLeaderGUID(), group->GetLeaderName()); - sObjectMgr.AddGroup(group); + sObjectMgr->AddGroup(group); } // everything's fine, do it, PLAYER'S GROUP IS SET IN ADDMEMBER!!! @@ -241,7 +241,7 @@ void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recv_data*/) GetPlayer()->UninviteFromGroup(); // remember leader if online - Player *leader = sObjectMgr.GetPlayer(group->GetLeaderGUID()); + Player *leader = sObjectMgr->GetPlayer(group->GetLeaderGUID()); if (!leader || !leader->GetSession()) return; @@ -343,7 +343,7 @@ void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket & recv_data) uint64 guid; recv_data >> guid; - Player *player = sObjectMgr.GetPlayer(guid); + Player *player = sObjectMgr->GetPlayer(guid); /** error handling **/ if (!player || !group->IsLeader(GetPlayer()->GetGUID()) || player->GetGroup() != group) @@ -550,7 +550,7 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data) return; /********************/ - Player *movedPlayer = sObjectMgr.GetPlayer(name.c_str()); + Player *movedPlayer = sObjectMgr->GetPlayer(name.c_str()); if (movedPlayer) { //Do not allow leader to change group of player in combat @@ -561,7 +561,7 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data) group->ChangeMembersGroup(movedPlayer, groupNr); } else - group->ChangeMembersGroup(sObjectMgr.GetPlayerGUIDByName(name.c_str()), groupNr); + group->ChangeMembersGroup(sObjectMgr->GetPlayerGUIDByName(name.c_str()), groupNr); } void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket & recv_data) @@ -832,7 +832,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recv_data) uint64 Guid; recv_data >> Guid; - Player *player = sObjectMgr.GetPlayer(Guid); + Player *player = sObjectMgr->GetPlayer(Guid); if (!player) { WorldPacket data(SMSG_PARTY_MEMBER_STATS_FULL, 3+4+2); diff --git a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp index d66bab0ad5f..cbd443ec4fe 100755 --- a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp @@ -32,7 +32,7 @@ inline Guild* _GetPlayerGuild(WorldSession* session, bool sendError = false) { if (uint32 guildId = session->GetPlayer()->GetGuildId()) // If guild id = 0, player is not in guild - if (Guild* pGuild = sObjectMgr.GetGuildById(guildId)) // Find guild by id + if (Guild* pGuild = sObjectMgr->GetGuildById(guildId)) // Find guild by id return pGuild; if (sendError) Guild::SendCommandResult(session, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD); @@ -46,7 +46,7 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket) uint32 guildId; recvPacket >> guildId; // Use received guild id to access guild method (not player's guild id) - if (Guild* pGuild = sObjectMgr.GetGuildById(guildId)) + if (Guild* pGuild = sObjectMgr->GetGuildById(guildId)) pGuild->HandleQuery(this); else Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD); @@ -63,7 +63,7 @@ void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket) { Guild* pGuild = new Guild(); if (pGuild->Create(GetPlayer(), name)) - sObjectMgr.AddGuild(pGuild); + sObjectMgr->AddGuild(pGuild); else delete pGuild; } @@ -99,7 +99,7 @@ void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/) // Player cannot be in guild if (!GetPlayer()->GetGuildId()) // Guild where player was invited must exist - if (Guild* pGuild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildIdInvited())) + if (Guild* pGuild = sObjectMgr->GetGuildById(GetPlayer()->GetGuildIdInvited())) pGuild->HandleAcceptMember(this); } diff --git a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp index 8e0a2e11896..c3a1f66012c 100755 --- a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp @@ -294,10 +294,10 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data) int loc_idx = GetSessionDbLocaleIndex(); if (loc_idx >= 0) { - if (ItemLocale const *il = sObjectMgr.GetItemLocale(pProto->ItemId)) + if (ItemLocale const *il = sObjectMgr->GetItemLocale(pProto->ItemId)) { - sObjectMgr.GetLocaleString(il->Name, loc_idx, Name); - sObjectMgr.GetLocaleString(il->Description, loc_idx, Description); + sObjectMgr->GetLocaleString(il->Name, loc_idx, Name); + sObjectMgr->GetLocaleString(il->Description, loc_idx, Description); } } // guess size @@ -1016,14 +1016,14 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data) recv_data.read_skip<uint64>(); // guid sLog.outDebug("WORLD: CMSG_ITEM_NAME_QUERY %u", itemid); - ItemSetNameEntry const *pName = sObjectMgr.GetItemSetNameEntry(itemid); + ItemSetNameEntry const *pName = sObjectMgr->GetItemSetNameEntry(itemid); if (pName) { std::string Name = pName->name; int loc_idx = GetSessionDbLocaleIndex(); if (loc_idx >= 0) - if (ItemSetNameLocale const *isnl = sObjectMgr.GetItemSetNameLocale(itemid)) - sObjectMgr.GetLocaleString(isnl->Name, loc_idx, Name); + if (ItemSetNameLocale const *isnl = sObjectMgr->GetItemSetNameLocale(itemid)) + sObjectMgr->GetLocaleString(isnl->Name, loc_idx, Name); WorldPacket data(SMSG_ITEM_NAME_QUERY_RESPONSE, (4+Name.size()+1+4)); data << uint32(itemid); diff --git a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp index f3c463dcdc4..5ad12742f61 100755 --- a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp @@ -79,7 +79,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recv_data) std::string comment; recv_data >> comment; sLog.outDebug("CMSG_LFG_JOIN [" UI64FMTD "] roles: %u, Dungeons: %u, Comment: %s", GetPlayer()->GetGUID(), roles, uint8(newDungeons.size()), comment.c_str()); - sLFGMgr.Join(GetPlayer(), uint8(roles), newDungeons, comment); + sLFGMgr->Join(GetPlayer(), uint8(roles), newDungeons, comment); } void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recv_data*/) @@ -90,7 +90,7 @@ void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recv_data*/) // Check cheating - only leader can leave the queue if (!grp || grp->GetLeaderGUID() == GetPlayer()->GetGUID()) - sLFGMgr.Leave(GetPlayer(), grp); + sLFGMgr->Leave(GetPlayer(), grp); } void WorldSession::HandleLfgProposalResultOpcode(WorldPacket& recv_data) @@ -101,7 +101,7 @@ void WorldSession::HandleLfgProposalResultOpcode(WorldPacket& recv_data) recv_data >> accept; sLog.outDebug("CMSG_LFG_PROPOSAL_RESULT [" UI64FMTD "] proposal: %u accept: %u", GetPlayer()->GetGUID(), lfgGroupID, accept ? 1 : 0); - sLFGMgr.UpdateProposal(lfgGroupID, GetPlayer()->GetGUID(), accept); + sLFGMgr->UpdateProposal(lfgGroupID, GetPlayer()->GetGUID(), accept); } void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recv_data) @@ -116,8 +116,8 @@ void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recv_data) return; } sLog.outDebug("CMSG_LFG_SET_ROLES [" UI64FMTD "] Roles: %u", guid, roles); - sLFGMgr.SetRoles(guid, roles); - sLFGMgr.UpdateRoleCheck(grp, GetPlayer()); + sLFGMgr->SetRoles(guid, roles); + sLFGMgr->UpdateRoleCheck(grp, GetPlayer()); } void WorldSession::HandleLfgSetCommentOpcode(WorldPacket& recv_data) @@ -127,7 +127,7 @@ void WorldSession::HandleLfgSetCommentOpcode(WorldPacket& recv_data) uint64 guid = GetPlayer()->GetGUID(); sLog.outDebug("CMSG_SET_LFG_COMMENT [" UI64FMTD "] comment: %s", guid, comment.c_str()); - sLFGMgr.SetComment(guid, comment); + sLFGMgr->SetComment(guid, comment); } void WorldSession::HandleLfgSetBootVoteOpcode(WorldPacket& recv_data) @@ -136,7 +136,7 @@ void WorldSession::HandleLfgSetBootVoteOpcode(WorldPacket& recv_data) recv_data >> agree; sLog.outDebug("CMSG_LFG_SET_BOOT_VOTE [" UI64FMTD "] agree: %u", GetPlayer()->GetGUID(), agree ? 1 : 0); - sLFGMgr.UpdateBoot(GetPlayer(), agree); + sLFGMgr->UpdateBoot(GetPlayer(), agree); } void WorldSession::HandleLfgTeleportOpcode(WorldPacket& recv_data) @@ -145,7 +145,7 @@ void WorldSession::HandleLfgTeleportOpcode(WorldPacket& recv_data) recv_data >> out; sLog.outDebug("CMSG_LFG_TELEPORT [" UI64FMTD "] out: %u", GetPlayer()->GetGUID(), out ? 1 : 0); - sLFGMgr.TeleportPlayer(GetPlayer(), out, true); + sLFGMgr->TeleportPlayer(GetPlayer(), out, true); } void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recv_data*/) @@ -167,7 +167,7 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recv_data } // Get player locked Dungeons - LfgLockMap lock = sLFGMgr.GetLockedDungeons(guid); + LfgLockMap lock = sLFGMgr->GetLockedDungeons(guid); uint32 rsize = uint32(randomDungeons.size()); uint32 lsize = uint32(lock.size()); @@ -178,17 +178,17 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recv_data for (LfgDungeonSet::const_iterator it = randomDungeons.begin(); it != randomDungeons.end(); ++it) { data << uint32(*it); // Dungeon Entry (id + type) - LfgReward const* reward = sLFGMgr.GetRandomDungeonReward(*it, level); + LfgReward const* reward = sLFGMgr->GetRandomDungeonReward(*it, level); Quest const* qRew = NULL; uint8 done = 0; if (reward) { - qRew = sObjectMgr.GetQuestTemplate(reward->reward[0].questId); + qRew = sObjectMgr->GetQuestTemplate(reward->reward[0].questId); if (qRew) { done = !GetPlayer()->CanRewardQuest(qRew, false); if (done) - qRew = sObjectMgr.GetQuestTemplate(reward->reward[1].questId); + qRew = sObjectMgr->GetQuestTemplate(reward->reward[1].questId); } } if (qRew) @@ -250,7 +250,7 @@ void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recv_data if (pguid == guid) continue; - lockMap[pguid] = sLFGMgr.GetLockedDungeons(pguid); + lockMap[pguid] = sLFGMgr->GetLockedDungeons(pguid); } uint32 size = 0; @@ -276,7 +276,7 @@ void WorldSession::HandleLfrLeaveOpcode(WorldPacket& recv_data) uint32 dungeonId; // Raid id queue to leave recv_data >> dungeonId; sLog.outDebug("CMSG_SEARCH_LFG_LEAVE [" UI64FMTD "] dungeonId: %u", GetPlayer()->GetGUID(), dungeonId); - //sLFGMgr.LeaveLfr(GetPlayer(), dungeonId); + //sLFGMgr->LeaveLfr(GetPlayer(), dungeonId); } void WorldSession::SendLfgUpdatePlayer(const LfgUpdateData& updateData) @@ -418,7 +418,7 @@ void WorldSession::SendLfgRoleCheckUpdate(const LfgRoleCheck* pRoleCheck) data << uint64(guid); // Guid data << uint8(roles > 0); // Ready data << uint32(roles); // Roles - Player* plr = sObjectMgr.GetPlayer(guid); + Player* plr = sObjectMgr->GetPlayer(guid); data << uint8(plr ? plr->getLevel() : 0); // Level for (LfgRolesMap::const_iterator it = pRoleCheck->roles.begin(); it != pRoleCheck->roles.end(); ++it) @@ -431,7 +431,7 @@ void WorldSession::SendLfgRoleCheckUpdate(const LfgRoleCheck* pRoleCheck) data << uint64(guid); // Guid data << uint8(roles > 0); // Ready data << uint32(roles); // Roles - plr = sObjectMgr.GetPlayer(guid); + plr = sObjectMgr->GetPlayer(guid); data << uint8(plr ? plr->getLevel() : 0); // Level } } @@ -554,11 +554,11 @@ void WorldSession::SendLfgUpdateProposal(uint32 proposalId, const LfgProposal* p uint32 dungeonId = pProp->dungeonId; bool isSameDungeon = false; bool isContinue = false; - Group* grp = dLowGuid ? sObjectMgr.GetGroupByGUID(dLowGuid) : NULL; + Group* grp = dLowGuid ? sObjectMgr->GetGroupByGUID(dLowGuid) : NULL; if (grp) { uint64 gguid = grp->GetGUID(); - isContinue = grp->isLFGGroup() && sLFGMgr.GetState(gguid) != LFG_STATE_FINISHED_DUNGEON; + isContinue = grp->isLFGGroup() && sLFGMgr->GetState(gguid) != LFG_STATE_FINISHED_DUNGEON; isSameDungeon = GetPlayer()->GetGroup() == grp && isContinue; } @@ -567,7 +567,7 @@ void WorldSession::SendLfgUpdateProposal(uint32 proposalId, const LfgProposal* p if (!isContinue) // Only show proposal dungeon if it's continue { - LfgDungeonSet playerDungeons = sLFGMgr.GetSelectedDungeons(guid); + LfgDungeonSet playerDungeons = sLFGMgr->GetSelectedDungeons(guid); if (playerDungeons.size()) dungeonId = (*playerDungeons.begin()); } diff --git a/src/server/game/Server/Protocol/Handlers/MailHandler.cpp b/src/server/game/Server/Protocol/Handlers/MailHandler.cpp index 23948c174dc..f9718b8a4d4 100755 --- a/src/server/game/Server/Protocol/Handlers/MailHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MailHandler.cpp @@ -84,7 +84,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) uint64 rc = 0; if (normalizePlayerName(receiver)) - rc = sObjectMgr.GetPlayerGUIDByName(receiver); + rc = sObjectMgr->GetPlayerGUIDByName(receiver); if (!rc) { @@ -112,7 +112,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) return; } - Player *receive = sObjectMgr.GetPlayer(rc); + Player *receive = sObjectMgr->GetPlayer(rc); uint32 rc_team = 0; uint8 mails_count = 0; //do not allow to send to one player more than 100 mails @@ -126,7 +126,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) } else { - rc_team = sObjectMgr.GetPlayerTeamByGUID(rc); + rc_team = sObjectMgr->GetPlayerTeamByGUID(rc); if (QueryResult result = CharacterDatabase.PQuery("SELECT COUNT(*) FROM mail WHERE receiver = '%u'", GUID_LOPART(rc))) { Field *fields = result->Fetch(); @@ -174,7 +174,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) uint32 rc_account = receive ? receive->GetSession()->GetAccountId() - : sObjectMgr.GetPlayerAccountIdByGUID(rc); + : sObjectMgr->GetPlayerAccountIdByGUID(rc); Item* items[MAX_MAIL_ITEMS]; @@ -439,7 +439,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data) if (m->COD > 0) //if there is COD, take COD money from player and send them to sender by mail { uint64 sender_guid = MAKE_NEW_GUID(m->sender, 0, HIGHGUID_PLAYER); - Player *receive = sObjectMgr.GetPlayer(sender_guid); + Player *receive = sObjectMgr->GetPlayer(sender_guid); uint32 sender_accId = 0; @@ -454,16 +454,16 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data) else { // can be calculated early - sender_accId = sObjectMgr.GetPlayerAccountIdByGUID(sender_guid); + sender_accId = sObjectMgr->GetPlayerAccountIdByGUID(sender_guid); - if (!sObjectMgr.GetPlayerNameByGUID(sender_guid,sender_name)) - sender_name = sObjectMgr.GetTrinityStringForDBCLocale(LANG_UNKNOWN); + if (!sObjectMgr->GetPlayerNameByGUID(sender_guid,sender_name)) + sender_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN); } sLog.outCommand(GetAccountId(),"GM %s (Account: %u) receive mail item: %s (Entry: %u Count: %u) and send COD money: %u to player: %s (Account: %u)", GetPlayerName(),GetAccountId(),it->GetProto()->Name1,it->GetEntry(),it->GetCount(),m->COD,sender_name.c_str(),sender_accId); } else if (!receive) - sender_accId = sObjectMgr.GetPlayerAccountIdByGUID(sender_guid); + sender_accId = sObjectMgr->GetPlayerAccountIdByGUID(sender_guid); // check player existence if (receive || sender_accId) @@ -670,7 +670,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data) } Item *bodyItem = new Item; // This is not bag and then can be used new Item. - if (!bodyItem->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM), MAIL_BODY_ITEM_TEMPLATE, pl)) + if (!bodyItem->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), MAIL_BODY_ITEM_TEMPLATE, pl)) { delete bodyItem; return; diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index 9d420683c0f..1b53e009346 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -140,13 +140,13 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) if (unit) { unit->AI()->sGossipSelectCode(_player, menuId, gossipListId, code.c_str()); - if (!sScriptMgr.OnGossipSelectCode(_player, unit, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId), code.c_str())) + if (!sScriptMgr->OnGossipSelectCode(_player, unit, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId), code.c_str())) _player->OnGossipSelect(unit, gossipListId, menuId); } else { go->AI()->GossipSelectCode(_player, menuId, gossipListId, code.c_str()); - sScriptMgr.OnGossipSelectCode(_player, go, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId), code.c_str()); + sScriptMgr->OnGossipSelectCode(_player, go, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId), code.c_str()); } } else @@ -154,13 +154,13 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) if (unit) { unit->AI()->sGossipSelect(_player, menuId, gossipListId); - if (!sScriptMgr.OnGossipSelect(_player, unit, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId))) + if (!sScriptMgr->OnGossipSelect(_player, unit, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId))) _player->OnGossipSelect(unit, gossipListId, menuId); } else { go->AI()->GossipSelect(_player, menuId, gossipListId); - sScriptMgr.OnGossipSelect(_player, go, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId)); + sScriptMgr->OnGossipSelect(_player, go, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId)); } } } @@ -304,7 +304,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) if (!(wplayer_name.empty() || wpname.find(wplayer_name) != std::wstring::npos)) continue; - std::string gname = sObjectMgr.GetGuildNameById(itr->second->GetGuildId()); + std::string gname = sObjectMgr->GetGuildNameById(itr->second->GetGuildId()); std::wstring wgname; if (!Utf8toWStr(gname,wgname)) continue; @@ -587,7 +587,7 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult result, std::string team = Player::TeamForRace((*result)[1].GetUInt8()); friendAcctid = (*result)[2].GetUInt32(); - if (GetSecurity() >= SEC_MODERATOR || sWorld.getBoolConfig(CONFIG_ALLOW_GM_FRIEND) || sAccountMgr.GetSecurity(friendAcctid) < SEC_MODERATOR) + if (GetSecurity() >= SEC_MODERATOR || sWorld.getBoolConfig(CONFIG_ALLOW_GM_FRIEND) || sAccountMgr->GetSecurity(friendAcctid) < SEC_MODERATOR) { if (friendGuid) { @@ -615,7 +615,7 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult result, std::string } } - sSocialMgr.SendFriendStatus(GetPlayer(), friendResult, GUID_LOPART(friendGuid), false); + sSocialMgr->SendFriendStatus(GetPlayer(), friendResult, GUID_LOPART(friendGuid), false); sLog.outDebug("WORLD: Sent (SMSG_FRIEND_STATUS)"); } @@ -630,7 +630,7 @@ void WorldSession::HandleDelFriendOpcode(WorldPacket & recv_data) _player->GetSocial()->RemoveFromSocialList(GUID_LOPART(FriendGUID), false); - sSocialMgr.SendFriendStatus(GetPlayer(), FRIEND_REMOVED, GUID_LOPART(FriendGUID), false); + sSocialMgr->SendFriendStatus(GetPlayer(), FRIEND_REMOVED, GUID_LOPART(FriendGUID), false); sLog.outDebug("WORLD: Sent motd (SMSG_FRIEND_STATUS)"); } @@ -686,7 +686,7 @@ void WorldSession::HandleAddIgnoreOpcodeCallBack(QueryResult result) } } - sSocialMgr.SendFriendStatus(GetPlayer(), ignoreResult, GUID_LOPART(IgnoreGuid), false); + sSocialMgr->SendFriendStatus(GetPlayer(), ignoreResult, GUID_LOPART(IgnoreGuid), false); sLog.outDebug("WORLD: Sent (SMSG_FRIEND_STATUS)"); } @@ -701,7 +701,7 @@ void WorldSession::HandleDelIgnoreOpcode(WorldPacket & recv_data) _player->GetSocial()->RemoveFromSocialList(GUID_LOPART(IgnoreGUID), true); - sSocialMgr.SendFriendStatus(GetPlayer(), FRIEND_IGNORE_REMOVED, GUID_LOPART(IgnoreGUID), false); + sSocialMgr->SendFriendStatus(GetPlayer(), FRIEND_IGNORE_REMOVED, GUID_LOPART(IgnoreGUID), false); sLog.outDebug("WORLD: Sent motd (SMSG_FRIEND_STATUS)"); } @@ -894,13 +894,13 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) if (GetPlayer()->isDebugAreaTriggers) ChatHandler(GetPlayer()).PSendSysMessage(LANG_DEBUG_AREATRIGGER_REACHED, Trigger_ID); - if (sScriptMgr.OnAreaTrigger(GetPlayer(), atEntry)) + if (sScriptMgr->OnAreaTrigger(GetPlayer(), atEntry)) return; - uint32 quest_id = sObjectMgr.GetQuestForAreaTrigger(Trigger_ID); + uint32 quest_id = sObjectMgr->GetQuestForAreaTrigger(Trigger_ID); if (quest_id && GetPlayer()->isAlive() && GetPlayer()->IsActiveQuest(quest_id)) { - Quest const* pQuest = sObjectMgr.GetQuestTemplate(quest_id); + Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id); if (pQuest) { if (GetPlayer()->GetQuestStatus(quest_id) == QUEST_STATUS_INCOMPLETE) @@ -908,7 +908,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) } } - if (sObjectMgr.IsTavernAreaTrigger(Trigger_ID)) + if (sObjectMgr->IsTavernAreaTrigger(Trigger_ID)) { // set resting flag we are in the inn GetPlayer()->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING); @@ -938,13 +938,13 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) } // NULL if all values default (non teleport trigger) - AreaTrigger const* at = sObjectMgr.GetAreaTrigger(Trigger_ID); + AreaTrigger const* at = sObjectMgr->GetAreaTrigger(Trigger_ID); if (!at) return; // Check only if target map != current player's map // check if player can enter instance : instance not full, and raid instance not in encounter fight - if (GetPlayer()->GetMapId() != at->target_mapId && !sMapMgr.CanPlayerEnter(at->target_mapId, GetPlayer(), false)) + if (GetPlayer()->GetMapId() != at->target_mapId && !sMapMgr->CanPlayerEnter(at->target_mapId, GetPlayer(), false)) return; // Check if we are in LfgGroup and trying to get out the dungeon @@ -1225,7 +1225,7 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data) _player->SetSelection(guid); - Player *plr = sObjectMgr.GetPlayer(guid); + Player *plr = sObjectMgr->GetPlayer(guid); if (!plr) // wrong player return; @@ -1254,7 +1254,7 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data) uint64 guid; recv_data >> guid; - Player *player = sObjectMgr.GetPlayer(guid); + Player *player = sObjectMgr->GetPlayer(guid); if (!player) { @@ -1326,7 +1326,7 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) return; } - Player *plr = sObjectMgr.GetPlayer(charname.c_str()); + Player *plr = sObjectMgr->GetPlayer(charname.c_str()); if (!plr) { @@ -1696,7 +1696,7 @@ void WorldSession::HandleQueryInspectAchievements(WorldPacket & recv_data) uint64 guid; recv_data.readPackGUID(guid); - Player *player = sObjectMgr.GetPlayer(guid); + Player *player = sObjectMgr->GetPlayer(guid); if (!player) return; diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp index a2b6add0146..dc66f0399d8 100755 --- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp @@ -73,7 +73,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() } // relocate the player to the teleport destination - Map * newMap = sMapMgr.CreateMap(loc.GetMapId(), GetPlayer(), 0); + Map * newMap = sMapMgr->CreateMap(loc.GetMapId(), GetPlayer(), 0); // the CanEnter checks are done in TeleporTo but conditions may change // while the player is in transit, for example the map may get full if (!newMap || !newMap->CanEnter(GetPlayer())) @@ -155,7 +155,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() { if (mapDiff->resetTime) { - if (time_t timeReset = sInstanceSaveMgr.GetResetTimeFor(mEntry->MapID,diff)) + if (time_t timeReset = sInstanceSaveMgr->GetResetTimeFor(mEntry->MapID,diff)) { uint32 timeleft = uint32(timeReset - time(NULL)); GetPlayer()->SendInstanceResetWarning(mEntry->MapID, diff, timeleft); @@ -302,7 +302,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) if (plMover && !plMover->GetTransport()) { // elevators also cause the client to send MOVEMENTFLAG_ONTRANSPORT - just unmount if the guid can be found in the transport list - for (MapManager::TransportSet::const_iterator iter = sMapMgr.m_Transports.begin(); iter != sMapMgr.m_Transports.end(); ++iter) + for (MapManager::TransportSet::const_iterator iter = sMapMgr->m_Transports.begin(); iter != sMapMgr->m_Transports.end(); ++iter) { if ((*iter)->GetGUID() == movementInfo.t_guid) { diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp index 7adc5fced69..cc1f1ea6d78 100755 --- a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp @@ -177,7 +177,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) valid = false; break; } - if (sSpellMgr.IsPrimaryProfessionFirstRankSpell(tSpell->learnedSpell[i])) + if (sSpellMgr->IsPrimaryProfessionFirstRankSpell(tSpell->learnedSpell[i])) primary_prof_first_rank = true; } if (!valid) @@ -201,7 +201,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) { if (!tSpell->learnedSpell[i]) continue; - if (SpellChainNode const* chain_node = sSpellMgr.GetSpellChainNode(tSpell->learnedSpell[i])) + if (SpellChainNode const* chain_node = sSpellMgr->GetSpellChainNode(tSpell->learnedSpell[i])) { if (chain_node->prev) { @@ -211,7 +211,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) } if (maxReq == 3) break; - SpellsRequiringSpellMapBounds spellsRequired = sSpellMgr.GetSpellsRequiredForSpellBounds(tSpell->learnedSpell[i]); + SpellsRequiringSpellMapBounds spellsRequired = sSpellMgr->GetSpellsRequiredForSpellBounds(tSpell->learnedSpell[i]); for (SpellsRequiringSpellMap::const_iterator itr2 = spellsRequired.first; itr2 != spellsRequired.second && maxReq < 3; ++itr2) { data << uint32(itr2->second); @@ -333,12 +333,12 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) if (bg) { bg->AddPlayerToResurrectQueue(unit->GetGUID(), _player->GetGUID()); - sBattlegroundMgr.SendAreaSpiritHealerQueryOpcode(_player, bg, unit->GetGUID()); + sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, unit->GetGUID()); return; } } - if (!sScriptMgr.OnGossipHello(_player, unit)) + if (!sScriptMgr->OnGossipHello(_player, unit)) { // _player->TalkedToCreature(unit->GetEntry(), unit->GetGUID()); _player->PrepareGossipMenu(unit, unit->GetCreatureInfo()->GossipMenuId, true); @@ -420,7 +420,7 @@ void WorldSession::SendSpiritResurrect() WorldSafeLocsEntry const *corpseGrave = NULL; Corpse *corpse = _player->GetCorpse(); if (corpse) - corpseGrave = sObjectMgr.GetClosestGraveYard( + corpseGrave = sObjectMgr->GetClosestGraveYard( corpse->GetPositionX(), corpse->GetPositionY(), corpse->GetPositionZ(), corpse->GetMapId(), _player->GetTeam()); // now can spawn bones @@ -429,7 +429,7 @@ void WorldSession::SendSpiritResurrect() // teleport to nearest from corpse graveyard, if different from nearest to player ghost if (corpseGrave) { - WorldSafeLocsEntry const *ghostGrave = sObjectMgr.GetClosestGraveYard( + WorldSafeLocsEntry const *ghostGrave = sObjectMgr->GetClosestGraveYard( _player->GetPositionX(), _player->GetPositionY(), _player->GetPositionZ(), _player->GetMapId(), _player->GetTeam()); if (corpseGrave != ghostGrave) diff --git a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp index 4d54bb6981a..f099cd9c51d 100755 --- a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp @@ -602,7 +602,7 @@ void WorldSession::HandlePetRename(WorldPacket & recv_data) return; } - if (sObjectMgr.IsReservedName(name)) + if (sObjectMgr->IsReservedName(name)) { SendPetNameInvalid(PET_NAME_RESERVED, name, NULL); return; diff --git a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp index a76fa218165..01421e34a66 100755 --- a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp @@ -154,12 +154,12 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) if (type == GUILD_CHARTER_TYPE) { - if (sObjectMgr.GetGuildByName(name)) + if (sObjectMgr->GetGuildByName(name)) { Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_EXISTS_S, name); return; } - if (sObjectMgr.IsReservedName(name) || !ObjectMgr::IsValidCharterName(name)) + if (sObjectMgr->IsReservedName(name) || !ObjectMgr::IsValidCharterName(name)) { Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_INVALID, name); return; @@ -167,12 +167,12 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) } else { - if (sObjectMgr.GetArenaTeamByName(name)) + if (sObjectMgr->GetArenaTeamByName(name)) { SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_EXISTS_S); return; } - if (sObjectMgr.IsReservedName(name) || !ObjectMgr::IsValidCharterName(name)) + if (sObjectMgr->IsReservedName(name) || !ObjectMgr::IsValidCharterName(name)) { SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_INVALID); return; @@ -404,12 +404,12 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) if (type == GUILD_CHARTER_TYPE) { - if (sObjectMgr.GetGuildByName(newname)) + if (sObjectMgr->GetGuildByName(newname)) { Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_EXISTS_S, newname); return; } - if (sObjectMgr.IsReservedName(newname) || !ObjectMgr::IsValidCharterName(newname)) + if (sObjectMgr->IsReservedName(newname) || !ObjectMgr::IsValidCharterName(newname)) { Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_INVALID, newname); return; @@ -417,12 +417,12 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) } else { - if (sObjectMgr.GetArenaTeamByName(newname)) + if (sObjectMgr->GetArenaTeamByName(newname)) { SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, newname, "", ERR_ARENA_TEAM_NAME_EXISTS_S); return; } - if (sObjectMgr.IsReservedName(newname) || !ObjectMgr::IsValidCharterName(newname)) + if (sObjectMgr->IsReservedName(newname) || !ObjectMgr::IsValidCharterName(newname)) { SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, newname, "", ERR_ARENA_TEAM_NAME_INVALID); return; @@ -474,7 +474,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) return; // not let enemies sign guild charter - if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(ownerguid)) + if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != sObjectMgr->GetPlayerTeamByGUID(ownerguid)) { if (type != GUILD_CHARTER_TYPE) SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED); @@ -539,7 +539,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) SendPacket(&data); // update for owner if online - if (Player *owner = sObjectMgr.GetPlayer(ownerguid)) + if (Player *owner = sObjectMgr->GetPlayer(ownerguid)) owner->GetSession()->SendPacket(&data); return; } @@ -562,7 +562,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) // item->SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1+1, signs); // update for owner if online - if (Player *owner = sObjectMgr.GetPlayer(ownerguid)) + if (Player *owner = sObjectMgr->GetPlayer(ownerguid)) owner->GetSession()->SendPacket(&data); } @@ -583,7 +583,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recv_data) Field *fields = result->Fetch(); ownerguid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER); - Player *owner = sObjectMgr.GetPlayer(ownerguid); + Player *owner = sObjectMgr->GetPlayer(ownerguid); if (owner) // petition owner online { WorldPacket data(MSG_PETITION_DECLINE, 8); @@ -777,7 +777,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) if (type == GUILD_CHARTER_TYPE) { - if (sObjectMgr.GetGuildByName(name)) + if (sObjectMgr->GetGuildByName(name)) { Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_EXISTS_S, name); return; @@ -785,7 +785,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) } else { - if (sObjectMgr.GetArenaTeamByName(name)) + if (sObjectMgr->GetArenaTeamByName(name)) { SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_EXISTS_S); return; @@ -812,7 +812,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) } // register guild and add guildmaster - sObjectMgr.AddGuild(guild); + sObjectMgr->AddGuild(guild); // add members for (uint8 i = 0; i < signs; ++i) @@ -838,7 +838,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) at->SetEmblem(backgroud, icon, iconcolor, border, bordercolor); // register team and add captain - sObjectMgr.AddArenaTeam(at); + sObjectMgr->AddArenaTeam(at); sLog.outDebug("PetitonsHandler: arena team added to objmrg"); // add members diff --git a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp index df85f197d4c..5e2ac1e0ccc 100755 --- a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp @@ -126,7 +126,7 @@ void WorldSession::HandleNameQueryOpcode(WorldPacket & recv_data) recv_data >> guid; - Player *pChar = sObjectMgr.GetPlayer(guid); + Player *pChar = sObjectMgr->GetPlayer(guid); if (pChar) SendNameQueryOpcode(pChar); @@ -166,10 +166,10 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data) int loc_idx = GetSessionDbLocaleIndex(); if (loc_idx >= 0) { - if (CreatureLocale const *cl = sObjectMgr.GetCreatureLocale(entry)) + if (CreatureLocale const *cl = sObjectMgr->GetCreatureLocale(entry)) { - sObjectMgr.GetLocaleString(cl->Name, loc_idx, Name); - sObjectMgr.GetLocaleString(cl->SubName, loc_idx, SubName); + sObjectMgr->GetLocaleString(cl->Name, loc_idx, Name); + sObjectMgr->GetLocaleString(cl->SubName, loc_idx, SubName); } } sLog.outDetail("WORLD: CMSG_CREATURE_QUERY '%s' - Entry: %u.", ci->Name, entry); @@ -232,10 +232,10 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recv_data) int loc_idx = GetSessionDbLocaleIndex(); if (loc_idx >= 0) { - if (GameObjectLocale const *gl = sObjectMgr.GetGameObjectLocale(entryID)) + if (GameObjectLocale const *gl = sObjectMgr->GetGameObjectLocale(entryID)) { - sObjectMgr.GetLocaleString(gl->Name, loc_idx, Name); - sObjectMgr.GetLocaleString(gl->CastBarCaption, loc_idx, CastBarCaption); + sObjectMgr->GetLocaleString(gl->Name, loc_idx, Name); + sObjectMgr->GetLocaleString(gl->CastBarCaption, loc_idx, CastBarCaption); } } sLog.outDetail("WORLD: CMSG_GAMEOBJECT_QUERY '%s' - Entry: %u. ", info->name, entryID); @@ -295,7 +295,7 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/) if (corpseMapEntry->IsDungeon() && corpseMapEntry->entrance_map >= 0) { // if corpse map have entrance - if (Map const* entranceMap = sMapMgr.CreateBaseMap(corpseMapEntry->entrance_map)) + if (Map const* entranceMap = sMapMgr->CreateBaseMap(corpseMapEntry->entrance_map)) { mapid = corpseMapEntry->entrance_map; x = corpseMapEntry->entrance_x; @@ -328,7 +328,7 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recv_data) recv_data >> guid; GetPlayer()->SetUInt64Value(UNIT_FIELD_TARGET, guid); - GossipText const* pGossip = sObjectMgr.GetGossipText(textID); + GossipText const* pGossip = sObjectMgr->GetGossipText(textID); WorldPacket data(SMSG_NPC_TEXT_UPDATE, 100); // guess size data << textID; @@ -361,12 +361,12 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recv_data) int loc_idx = GetSessionDbLocaleIndex(); if (loc_idx >= 0) { - if (NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textID)) + if (NpcTextLocale const *nl = sObjectMgr->GetNpcTextLocale(textID)) { for (int i = 0; i < MAX_LOCALES; ++i) { - sObjectMgr.GetLocaleString(nl->Text_0[i], loc_idx, Text_0[i]); - sObjectMgr.GetLocaleString(nl->Text_1[i], loc_idx, Text_1[i]); + sObjectMgr->GetLocaleString(nl->Text_0[i], loc_idx, Text_0[i]); + sObjectMgr->GetLocaleString(nl->Text_1[i], loc_idx, Text_1[i]); } } } @@ -428,8 +428,8 @@ void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recv_data) int loc_idx = GetSessionDbLocaleIndex(); if (loc_idx >= 0) - if (PageTextLocale const *pl = sObjectMgr.GetPageTextLocale(pageID)) - sObjectMgr.GetLocaleString(pl->Text, loc_idx, Text); + if (PageTextLocale const *pl = sObjectMgr->GetPageTextLocale(pageID)) + sObjectMgr->GetLocaleString(pl->Text, loc_idx, Text); data << Text; data << uint32(pPage->Next_Page); @@ -481,7 +481,7 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) if (questOk) { - QuestPOIVector const *POI = sObjectMgr.GetQuestPOIVector(questId); + QuestPOIVector const *POI = sObjectMgr->GetQuestPOIVector(questId); if (POI) { diff --git a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp index 9ce3b4b3a25..be73fd32003 100755 --- a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp @@ -58,7 +58,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data) Creature* cr_questgiver=questgiver->ToCreature(); if (!cr_questgiver->IsHostileTo(_player)) // not show quest status to enemies { - questStatus = sScriptMgr.GetDialogStatus(_player, cr_questgiver); + questStatus = sScriptMgr->GetDialogStatus(_player, cr_questgiver); if (questStatus > 6) questStatus = getDialogStatus(_player, cr_questgiver, defstatus); } @@ -68,7 +68,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data) { sLog.outDebug("WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject guid = %u",uint32(GUID_LOPART(guid))); GameObject* go_questgiver=(GameObject*)questgiver; - questStatus = sScriptMgr.GetDialogStatus(_player, go_questgiver); + questStatus = sScriptMgr->GetDialogStatus(_player, go_questgiver); if (questStatus > 6) questStatus = getDialogStatus(_player, go_questgiver, defstatus); break; @@ -103,7 +103,7 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data) // Stop the npc if moving pCreature->StopMoving(); - if (sScriptMgr.OnGossipHello(_player, pCreature)) + if (sScriptMgr->OnGossipHello(_player, pCreature)) return; _player->PrepareGossipMenu(pCreature, pCreature->GetCreatureInfo()->GossipMenuId, true); @@ -135,7 +135,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) return; } - Quest const* qInfo = sObjectMgr.GetQuestTemplate(quest); + Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest); if (qInfo) { // prevent cheating @@ -190,13 +190,13 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) switch(pObject->GetTypeId()) { case TYPEID_UNIT: - sScriptMgr.OnQuestAccept(_player, (pObject->ToCreature()), qInfo); + sScriptMgr->OnQuestAccept(_player, (pObject->ToCreature()), qInfo); (pObject->ToCreature())->AI()->sQuestAccept(_player, qInfo); break; case TYPEID_ITEM: case TYPEID_CONTAINER: { - sScriptMgr.OnQuestAccept(_player, ((Item*)pObject), qInfo); + sScriptMgr->OnQuestAccept(_player, ((Item*)pObject), qInfo); // destroy not required for quest finish quest starting item bool destroyItem = true; @@ -215,7 +215,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) break; } case TYPEID_GAMEOBJECT: - sScriptMgr.OnQuestAccept(_player, ((GameObject*)pObject), qInfo); + sScriptMgr->OnQuestAccept(_player, ((GameObject*)pObject), qInfo); (pObject->ToGameObject())->AI()->QuestAccept(_player, qInfo); break; default: @@ -249,7 +249,7 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket & recv_data) return; } - Quest const* pQuest = sObjectMgr.GetQuestTemplate(quest); + Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest); if (pQuest) { if (pQuest->IsAutoAccept() && _player->CanAddQuest(pQuest, true)) @@ -275,7 +275,7 @@ void WorldSession::HandleQuestQueryOpcode(WorldPacket & recv_data) recv_data >> quest; sLog.outDebug("WORLD: Received CMSG_QUEST_QUERY quest = %u",quest); - Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest); + Quest const *pQuest = sObjectMgr->GetQuestTemplate(quest); if (pQuest) { _player->PlayerTalkClass->SendQuestQueryResponse(pQuest); @@ -306,7 +306,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data) if (!pObject->hasInvolvedQuest(quest)) return; - Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest); + Quest const *pQuest = sObjectMgr->GetQuestTemplate(quest); if (pQuest) { if (_player->CanRewardQuest(pQuest, reward, true)) @@ -316,7 +316,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data) switch(pObject->GetTypeId()) { case TYPEID_UNIT: - if (!(sScriptMgr.OnQuestReward(_player, (pObject->ToCreature()), pQuest, reward))) + if (!(sScriptMgr->OnQuestReward(_player, (pObject->ToCreature()), pQuest, reward))) { // Send next quest if (Quest const* nextquest = _player->GetNextQuest(guid ,pQuest)) @@ -326,7 +326,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data) } break; case TYPEID_GAMEOBJECT: - if (!sScriptMgr.OnQuestReward(_player, ((GameObject*)pObject), pQuest, reward)) + if (!sScriptMgr->OnQuestReward(_player, ((GameObject*)pObject), pQuest, reward)) { // Send next quest if (Quest const* nextquest = _player->GetNextQuest(guid ,pQuest)) @@ -364,7 +364,7 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recv_data) if (_player->GetQuestStatus(quest) != QUEST_STATUS_COMPLETE) return; - if (Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest)) + if (Quest const *pQuest = sObjectMgr->GetQuestTemplate(quest)) _player->PlayerTalkClass->SendQuestGiverOfferReward(pQuest, guid, true); } @@ -402,7 +402,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data) if (!_player->TakeQuestSourceItem(quest, true)) return; // can't un-equip some items, reject quest cancel - if (const Quest *pQuest = sObjectMgr.GetQuestTemplate(quest)) + if (const Quest *pQuest = sObjectMgr->GetQuestTemplate(quest)) { if (pQuest->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) _player->RemoveTimedQuest(quest); @@ -426,7 +426,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data) sLog.outDebug("WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = %u", quest); - if (const Quest* pQuest = sObjectMgr.GetQuestTemplate(quest)) + if (const Quest* pQuest = sObjectMgr->GetQuestTemplate(quest)) { if (!pQuest->HasFlag(QUEST_FLAGS_PARTY_ACCEPT)) return; @@ -465,7 +465,7 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recv_data) sLog.outDebug("WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u",uint32(GUID_LOPART(guid)),quest); - Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest); + Quest const *pQuest = sObjectMgr->GetQuestTemplate(quest); if (pQuest) { if (!_player->CanSeeStartQuest(pQuest) && _player->GetQuestStatus(quest)==QUEST_STATUS_NONE) @@ -509,7 +509,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) sLog.outDebug("WORLD: Received CMSG_PUSHQUESTTOPARTY quest = %u", questId); - if (Quest const *pQuest = sObjectMgr.GetQuestTemplate(questId)) + if (Quest const *pQuest = sObjectMgr->GetQuestTemplate(questId)) { if (Group* pGroup = _player->GetGroup()) { @@ -592,14 +592,14 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32 { case TYPEID_GAMEOBJECT: { - qr = sObjectMgr.GetGOQuestRelationBounds(questgiver->GetEntry()); - qir = sObjectMgr.GetGOQuestInvolvedRelationBounds(questgiver->GetEntry()); + qr = sObjectMgr->GetGOQuestRelationBounds(questgiver->GetEntry()); + qir = sObjectMgr->GetGOQuestInvolvedRelationBounds(questgiver->GetEntry()); break; } case TYPEID_UNIT: { - qr = sObjectMgr.GetCreatureQuestRelationBounds(questgiver->GetEntry()); - qir = sObjectMgr.GetCreatureQuestInvolvedRelationBounds(questgiver->GetEntry()); + qr = sObjectMgr->GetCreatureQuestRelationBounds(questgiver->GetEntry()); + qir = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(questgiver->GetEntry()); break; } default: @@ -612,11 +612,11 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32 { uint32 result2 = 0; uint32 quest_id = i->second; - Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest_id); + Quest const *pQuest = sObjectMgr->GetQuestTemplate(quest_id); if (!pQuest) continue; - ConditionList conditions = sConditionMgr.GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, pQuest->GetQuestId()); - if (!sConditionMgr.IsPlayerMeetToConditions(pPlayer, conditions)) + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, pQuest->GetQuestId()); + if (!sConditionMgr->IsPlayerMeetToConditions(pPlayer, conditions)) continue; QuestStatus status = pPlayer->GetQuestStatus(quest_id); @@ -639,12 +639,12 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32 { uint32 result2 = 0; uint32 quest_id = i->second; - Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest_id); + Quest const *pQuest = sObjectMgr->GetQuestTemplate(quest_id); if (!pQuest) continue; - ConditionList conditions = sConditionMgr.GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, pQuest->GetQuestId()); - if (!sConditionMgr.IsPlayerMeetToConditions(pPlayer, conditions)) + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, pQuest->GetQuestId()); + if (!sConditionMgr->IsPlayerMeetToConditions(pPlayer, conditions)) continue; QuestStatus status = pPlayer->GetQuestStatus(quest_id); @@ -700,7 +700,7 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket continue; if (!questgiver->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER)) continue; - questStatus = sScriptMgr.GetDialogStatus(_player, questgiver); + questStatus = sScriptMgr->GetDialogStatus(_player, questgiver); if (questStatus > 6) questStatus = getDialogStatus(_player, questgiver, defstatus); @@ -715,7 +715,7 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket continue; if (questgiver->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER) continue; - questStatus = sScriptMgr.GetDialogStatus(_player, questgiver); + questStatus = sScriptMgr->GetDialogStatus(_player, questgiver); if (questStatus > 6) questStatus = getDialogStatus(_player, questgiver, defstatus); diff --git a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp index eccd40e3379..c74c867c232 100755 --- a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp @@ -178,7 +178,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) } // Note: If script stop casting it must send appropriate data to client to prevent stuck item in gray state. - if (!sScriptMgr.OnItemUse(pUser,pItem,targets)) + if (!sScriptMgr->OnItemUse(pUser,pItem,targets)) { // no script or script not process request by self pUser->CastItemUseSpell(pItem,targets,castCount,glyphIndex); @@ -294,7 +294,7 @@ void WorldSession::HandleGameObjectUseOpcode(WorldPacket & recv_data) if (!obj) return; - if (sScriptMgr.OnGossipHello(_player, obj)) + if (sScriptMgr->OnGossipHello(_player, obj)) return; obj->AI()->GossipHello(_player); @@ -392,7 +392,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) // auto-selection buff level base at target level (in spellInfo) if (targets.getUnitTarget()) { - SpellEntry const *actualSpellInfo = sSpellMgr.SelectAuraRankForPlayerLevel(spellInfo,targets.getUnitTarget()->getLevel()); + SpellEntry const *actualSpellInfo = sSpellMgr->SelectAuraRankForPlayerLevel(spellInfo,targets.getUnitTarget()->getLevel()); // if rank not found then function return NULL but in explicit cast case original spell can be casted and later failed with appropriate error message if (actualSpellInfo) @@ -561,7 +561,7 @@ void WorldSession::HandleSpellClick(WorldPacket & recv_data) if (!unit->IsInWorld()) return; - SpellClickInfoMapBounds clickPair = sObjectMgr.GetSpellClickInfoMapBounds(unit->GetEntry()); + SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(unit->GetEntry()); for (SpellClickInfoMap::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr) { if (itr->second.IsFitToRequirements(_player, unit)) diff --git a/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp b/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp index 15937a4b54c..cbf980e3245 100755 --- a/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp @@ -49,7 +49,7 @@ void WorldSession::SendTaxiStatus(uint64 guid) return; } - uint32 curloc = sObjectMgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer()->GetTeam()); + uint32 curloc = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer()->GetTeam()); // not found nearest if (curloc == 0) @@ -94,7 +94,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recv_data) void WorldSession::SendTaxiMenu(Creature* unit) { // find current node - uint32 curloc = sObjectMgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer()->GetTeam()); + uint32 curloc = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer()->GetTeam()); if (curloc == 0) return; @@ -134,7 +134,7 @@ void WorldSession::SendDoFlight(uint32 mountDisplayId, uint32 path, uint32 pathN bool WorldSession::SendLearnNewTaxiNode(Creature* unit) { // find current node - uint32 curloc = sObjectMgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer()->GetTeam()); + uint32 curloc = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer()->GetTeam()); if (curloc == 0) return true; // `true` send to avoid WorldSession::SendTaxiMenu call with one more curlock seartch with same false result. @@ -254,10 +254,10 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data) sLog.outDebug("WORLD: Taxi has to go from %u to %u", sourcenode, destinationnode); - uint32 mountDisplayId = sObjectMgr.GetTaxiMountDisplayId(sourcenode, GetPlayer()->GetTeam()); + uint32 mountDisplayId = sObjectMgr->GetTaxiMountDisplayId(sourcenode, GetPlayer()->GetTeam()); uint32 path, cost; - sObjectMgr.GetTaxiPath(sourcenode, destinationnode, path, cost); + sObjectMgr->GetTaxiPath(sourcenode, destinationnode, path, cost); if (path && mountDisplayId) SendDoFlight(mountDisplayId, path, 1); // skip start fly node diff --git a/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp b/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp index 2e05078f51d..4ece09a7588 100755 --- a/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp @@ -29,7 +29,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data) { // Don't accept tickets if the ticket queue is disabled. (Ticket UI is greyed out but not fully dependable) - if (sTicketMgr.GetStatus() == GMTICKET_QUEUE_STATUS_DISABLED) + if (sTicketMgr->GetStatus() == GMTICKET_QUEUE_STATUS_DISABLED) return; if (GetPlayer()->getLevel() < sWorld.getIntConfig(CONFIG_TICKET_LEVEL_REQ)) @@ -38,7 +38,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data) return; } - if (sTicketMgr.GetGMTicketByPlayer(GetPlayer()->GetGUID())) + if (sTicketMgr->GetGMTicketByPlayer(GetPlayer()->GetGUID())) { WorldPacket data(SMSG_GMTICKET_CREATE, 4); data << uint32(GMTICKET_RESPONSE_FAILURE); // You already have GM ticket @@ -63,7 +63,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data) GM_Ticket *ticket = new GM_Ticket; ticket->name = GetPlayer()->GetName(); - ticket->guid = sTicketMgr.GenerateGMTicketId(); + ticket->guid = sTicketMgr->GenerateGMTicketId(); ticket->playerGuid = GetPlayer()->GetGUID(); ticket->message = ticketText; ticket->createtime = time(NULL); @@ -79,7 +79,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data) ticket->escalated = TICKET_UNASSIGNED; ticket->response = ""; - sTicketMgr.AddOrUpdateGMTicket(*ticket, true); + sTicketMgr->AddOrUpdateGMTicket(*ticket, true); WorldPacket data(SMSG_GMTICKET_CREATE, 4); data << uint32(GMTICKET_RESPONSE_SUCCESS); @@ -93,7 +93,7 @@ void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket & recv_data) std::string message; recv_data >> message; - GM_Ticket *ticket = sTicketMgr.GetGMTicketByPlayer(GetPlayer()->GetGUID()); + GM_Ticket *ticket = sTicketMgr->GetGMTicketByPlayer(GetPlayer()->GetGUID()); if (!ticket) { WorldPacket data(SMSG_GMTICKET_UPDATETEXT, 4); @@ -105,7 +105,7 @@ void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket & recv_data) ticket->message = message; ticket->timestamp = time(NULL); - sTicketMgr.AddOrUpdateGMTicket(*ticket); + sTicketMgr->AddOrUpdateGMTicket(*ticket); WorldPacket data(SMSG_GMTICKET_UPDATETEXT, 4); data << uint32(GMTICKET_RESPONSE_SUCCESS); @@ -116,7 +116,7 @@ void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket & recv_data) void WorldSession::HandleGMTicketDeleteOpcode(WorldPacket & /*recv_data*/) { - GM_Ticket* ticket = sTicketMgr.GetGMTicketByPlayer(GetPlayer()->GetGUID()); + GM_Ticket* ticket = sTicketMgr->GetGMTicketByPlayer(GetPlayer()->GetGUID()); if (ticket) { @@ -125,7 +125,7 @@ void WorldSession::HandleGMTicketDeleteOpcode(WorldPacket & /*recv_data*/) SendPacket(&data); sWorld.SendGMText(LANG_COMMAND_TICKETPLAYERABANDON, GetPlayer()->GetName(), ticket->guid); - sTicketMgr.RemoveGMTicket(ticket, GetPlayer()->GetGUID(), false); + sTicketMgr->RemoveGMTicket(ticket, GetPlayer()->GetGUID(), false); SendGMTicketGetTicket(GMTICKET_STATUS_DEFAULT, NULL); } } @@ -134,7 +134,7 @@ void WorldSession::HandleGMTicketGetTicketOpcode(WorldPacket & /*recv_data*/) { SendQueryTimeResponse(); - if (GM_Ticket *ticket = sTicketMgr.GetGMTicketByPlayer(GetPlayer()->GetGUID())) + if (GM_Ticket *ticket = sTicketMgr->GetGMTicketByPlayer(GetPlayer()->GetGUID())) { if (ticket->completed) SendGMTicketResponse(ticket); @@ -150,7 +150,7 @@ void WorldSession::HandleGMTicketSystemStatusOpcode(WorldPacket & /*recv_data*/) WorldPacket data(SMSG_GMTICKET_SYSTEMSTATUS, 4); // Note: This only disables the ticket UI at client side and is not fully reliable // are we sure this is a uint32? Should ask Zor - data << uint32(sTicketMgr.GetStatus() ? GMTICKET_QUEUE_STATUS_ENABLED : GMTICKET_QUEUE_STATUS_DISABLED); + data << uint32(sTicketMgr->GetStatus() ? GMTICKET_QUEUE_STATUS_ENABLED : GMTICKET_QUEUE_STATUS_DISABLED); SendPacket(&data); } @@ -175,7 +175,7 @@ void WorldSession::SendGMTicketGetTicket(uint32 status, char const* text, GM_Tic ticketAge /= DAY; data << float(ticketAge); // ticketAge (days) - if (GM_Ticket *oldestTicket = sTicketMgr.GetOldestOpenGMTicket()) + if (GM_Ticket *oldestTicket = sTicketMgr->GetOldestOpenGMTicket()) { // get ticketage, but it's stored in seconds so we have to do it in days float oldestTicketAge = (float)time(NULL) - (float)oldestTicket->timestamp; @@ -186,7 +186,7 @@ void WorldSession::SendGMTicketGetTicket(uint32 status, char const* text, GM_Tic data << float(0); // I am not sure how blizzlike this is, and we don't really have a way to find out - int64 lastChange = int64(sTicketMgr.GetLastChange()); + int64 lastChange = int64(sTicketMgr->GetLastChange()); float timeDiff = float(int64(time(NULL)) - lastChange); timeDiff /= DAY; data << float(timeDiff); @@ -225,7 +225,7 @@ void WorldSession::SendGMTicketResponse(GM_Ticket *ticket) void WorldSession::HandleGMSurveySubmit(WorldPacket& recv_data) { - uint64 nextSurveyID = sTicketMgr.GetNextSurveyID(); + uint64 nextSurveyID = sTicketMgr->GetNextSurveyID(); // just put the survey into the database std::ostringstream ss; uint32 mainSurvey; // GMSurveyCurrentSurvey.dbc, column 1 (all 9) ref to GMSurveySurveys.dbc @@ -297,7 +297,7 @@ void WorldSession::HandleReportLag(WorldPacket& recv_data) void WorldSession::HandleGMResponseResolve(WorldPacket& /*recvPacket*/) { // empty packet - GM_Ticket* ticket = sTicketMgr.GetGMTicketByPlayer(GetPlayer()->GetGUID()); + GM_Ticket* ticket = sTicketMgr->GetGMTicketByPlayer(GetPlayer()->GetGUID()); if (ticket) { @@ -312,7 +312,7 @@ void WorldSession::HandleGMResponseResolve(WorldPacket& /*recvPacket*/) WorldPacket data2(SMSG_GMTICKET_DELETETICKET, 4); data2 << uint32(GMTICKET_RESPONSE_TICKET_DELETED); SendPacket(&data2); - sTicketMgr.RemoveGMTicket(ticket, GetPlayer()->GetGUID(), true); + sTicketMgr->RemoveGMTicket(ticket, GetPlayer()->GetGUID(), true); SendGMTicketGetTicket(GMTICKET_STATUS_DEFAULT, NULL); } } diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 55c870552a7..81e9f5c7ed7 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -237,7 +237,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); - sScriptMgr.OnUnknownPacketReceive(m_Socket, WorldPacket(*packet)); + sScriptMgr->OnUnknownPacketReceive(m_Socket, WorldPacket(*packet)); } else { @@ -255,7 +255,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) } else if (_player->IsInWorld()) { - sScriptMgr.OnPacketReceive(m_Socket, WorldPacket(*packet)); + sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); (this->*opHandle.handler)(*packet); if (sLog.IsOutDebug() && packet->rpos() < packet->wpos()) LogUnprocessedTail(packet); @@ -268,7 +268,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) else { // not expected _player or must checked in packet hanlder - sScriptMgr.OnPacketReceive(m_Socket, WorldPacket(*packet)); + sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); (this->*opHandle.handler)(*packet); if (sLog.IsOutDebug() && packet->rpos() < packet->wpos()) LogUnprocessedTail(packet); @@ -281,7 +281,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) LogUnexpectedOpcode(packet, "the player is still in world"); else { - sScriptMgr.OnPacketReceive(m_Socket, WorldPacket(*packet)); + sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); (this->*opHandle.handler)(*packet); if (sLog.IsOutDebug() && packet->rpos() < packet->wpos()) LogUnprocessedTail(packet); @@ -300,7 +300,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) if (packet->GetOpcode() != CMSG_SET_ACTIVE_VOICE_CHANNEL) m_playerRecentlyLogout = false; - sScriptMgr.OnPacketReceive(m_Socket, WorldPacket(*packet)); + sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); (this->*opHandle.handler)(*packet); if (sLog.IsOutDebug() && packet->rpos() < packet->wpos()) LogUnprocessedTail(packet); @@ -432,14 +432,14 @@ void WorldSession::LogoutPlayer(bool Save) if (!_player->m_InstanceValid && !_player->isGameMaster()) _player->TeleportTo(_player->m_homebindMapId, _player->m_homebindX, _player->m_homebindY, _player->m_homebindZ, _player->GetOrientation()); - sOutdoorPvPMgr.HandlePlayerLeaveZone(_player,_player->GetZoneId()); + sOutdoorPvPMgr->HandlePlayerLeaveZone(_player,_player->GetZoneId()); for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i) { if (BattlegroundQueueTypeId bgQueueTypeId = _player->GetBattlegroundQueueTypeId(i)) { _player->RemoveBattlegroundQueueId(bgQueueTypeId); - sBattlegroundMgr.m_BattlegroundQueues[ bgQueueTypeId ].RemovePlayer(_player->GetGUID(), true); + sBattlegroundMgr->m_BattlegroundQueues[ bgQueueTypeId ].RemovePlayer(_player->GetGUID(), true); } } @@ -449,7 +449,7 @@ void WorldSession::LogoutPlayer(bool Save) HandleMoveWorldportAckOpcode(); ///- If the player is in a guild, update the guild roster and broadcast a logout message to other guild members - if (Guild *pGuild = sObjectMgr.GetGuildById(_player->GetGuildId())) + if (Guild *pGuild = sObjectMgr->GetGuildById(_player->GetGuildId())) pGuild->HandleMemberLogout(this); ///- Remove pet @@ -489,11 +489,11 @@ void WorldSession::LogoutPlayer(bool Save) } ///- Broadcast a logout message to the player's friends - sSocialMgr.SendFriendStatus(_player, FRIEND_OFFLINE, _player->GetGUIDLow(), true); - sSocialMgr.RemovePlayerSocial (_player->GetGUIDLow ()); + sSocialMgr->SendFriendStatus(_player, FRIEND_OFFLINE, _player->GetGUIDLow(), true); + sSocialMgr->RemovePlayerSocial (_player->GetGUIDLow ()); // Call script hook before deletion - sScriptMgr.OnPlayerLogout(GetPlayer()); + sScriptMgr->OnPlayerLogout(GetPlayer()); ///- Remove the player from the world // the player may not be in the world when logging out @@ -566,7 +566,7 @@ void WorldSession::SendNotification(uint32 string_id,...) const char * WorldSession::GetTrinityString(int32 entry) const { - return sObjectMgr.GetTrinityString(entry, GetSessionDbLocaleIndex()); + return sObjectMgr->GetTrinityString(entry, GetSessionDbLocaleIndex()); } void WorldSession::Handle_NULL(WorldPacket& recvPacket) @@ -877,7 +877,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data) AddonInfo addon(addonName, enabled, crc, 2, true); - SavedAddon const* savedAddon = sAddonMgr.GetAddonInfo(addonName); + SavedAddon const* savedAddon = sAddonMgr->GetAddonInfo(addonName); if (savedAddon) { bool match = true; @@ -892,7 +892,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data) } else { - sAddonMgr.SaveAddon(addon); + sAddonMgr->SaveAddon(addon); sLog.outDetail("ADDON: %s (0x%x) was not known, saving...", addon.Name.c_str(), addon.CRC); } diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index db42274555a..986a8c74d12 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -179,7 +179,7 @@ int WorldSocket::SendPacket (const WorldPacket& pct) } // Create a copy of the original packet; this is to avoid issues if a hook modifies it. - sScriptMgr.OnPacketSend(this, WorldPacket(pct)); + sScriptMgr->OnPacketSend(this, WorldPacket(pct)); ServerPktHeader header(pct.size()+2, pct.GetOpcode()); m_Crypt.EncryptSend ((uint8*)header.header, header.getHeaderLength()); @@ -713,11 +713,11 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) return -1; } - sScriptMgr.OnPacketReceive(this, WorldPacket(*new_pct)); + sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return HandleAuthSession (*new_pct); case CMSG_KEEP_ALIVE: sLog.outStaticDebug ("CMSG_KEEP_ALIVE ,size: " UI64FMTD, uint64(new_pct->size())); - sScriptMgr.OnPacketReceive(this, WorldPacket(*new_pct)); + sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return 0; default: { diff --git a/src/server/game/Server/WorldSocketMgr.cpp b/src/server/game/Server/WorldSocketMgr.cpp index b49d3a98ef8..33dd8f7b8d2 100755 --- a/src/server/game/Server/WorldSocketMgr.cpp +++ b/src/server/game/Server/WorldSocketMgr.cpp @@ -115,7 +115,7 @@ class ReactorRunnable : protected ACE_Task_Base sock->reactor (m_Reactor); m_NewSockets.insert (sock); - sScriptMgr.OnSocketOpen(sock); + sScriptMgr->OnSocketOpen(sock); return 0; } @@ -140,7 +140,7 @@ class ReactorRunnable : protected ACE_Task_Base if (sock->IsClosed()) { - sScriptMgr.OnSocketClose(sock, true); + sScriptMgr->OnSocketClose(sock, true); sock->RemoveReference(); --m_Connections; @@ -180,7 +180,7 @@ class ReactorRunnable : protected ACE_Task_Base (*t)->CloseSocket(); - sScriptMgr.OnSocketClose((*t), false); + sScriptMgr->OnSocketClose((*t), false); (*t)->RemoveReference(); --m_Connections; @@ -282,7 +282,7 @@ WorldSocketMgr::StartNetwork (ACE_UINT16 port, const char* address) if (StartReactiveIO(port, address) == -1) return -1; - sScriptMgr.OnNetworkStart(); + sScriptMgr->OnNetworkStart(); return 0; } @@ -306,7 +306,7 @@ WorldSocketMgr::StopNetwork() Wait(); - sScriptMgr.OnNetworkStop(); + sScriptMgr->OnNetworkStop(); } void diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp index 8a9b548d64a..139393bcc15 100755 --- a/src/server/game/Skills/SkillDiscovery.cpp +++ b/src/server/game/Skills/SkillDiscovery.cpp @@ -112,7 +112,7 @@ void LoadSkillDiscoveryTable() } else if (reqSkillOrSpell == 0) // skill case { - SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spellId); + SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId); if (bounds.first == bounds.second) { @@ -162,7 +162,7 @@ uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player) if (tab == SkillDiscoveryStore.end()) return 0; - SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spellId); + SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId); uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->skillId) : 0; float full_chance = 0; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index d373c17e2ec..ae043057fd2 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -650,7 +650,7 @@ int32 AuraEffect::CalculateAmount(Unit * caster) amount += int32(caster->ApplyEffectModifiers(m_spellProto, m_effIndex, mwb)); // "If used while your target is above 75% health, Rend does 35% more damage." // as for 3.1.3 only ranks above 9 (wrong tooltip?) - if (sSpellMgr.GetSpellRank(m_spellProto->Id) >= 9) + if (sSpellMgr->GetSpellRank(m_spellProto->Id) >= 9) { if (GetBase()->GetUnitOwner()->HasAuraState(AURA_STATE_HEALTH_ABOVE_75_PERCENT, m_spellProto, caster)) AddPctN(amount, SpellMgr::CalculateSpellEffectAmount(m_spellProto, 2, caster)); @@ -1025,7 +1025,7 @@ void AuraEffect::ApplySpellMod(Unit * target, bool apply) Aura * aura = iter->second->GetBase(); // only passive auras-active auras should have amount set on spellcast and not be affected // if aura is casted by others, it will not be affected - if ((aura->IsPassive() || aura->GetSpellProto()->AttributesEx2 & SPELL_ATTR2_ALWAYS_APPLY_MODIFIERS) && aura->GetCasterGUID() == guid && sSpellMgr.IsAffectedByMod(aura->GetSpellProto(), m_spellmod)) + if ((aura->IsPassive() || aura->GetSpellProto()->AttributesEx2 & SPELL_ATTR2_ALWAYS_APPLY_MODIFIERS) && aura->GetCasterGUID() == guid && sSpellMgr->IsAffectedByMod(aura->GetSpellProto(), m_spellmod)) { if (GetMiscValue() == SPELLMOD_ALL_EFFECTS) { @@ -2418,7 +2418,7 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const else { Creature* c = triggerTarget->ToCreature(); - if (!c || (c && !sScriptMgr.OnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex()), triggerTarget->ToCreature())) || + if (!c || (c && !sScriptMgr->OnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex()), triggerTarget->ToCreature())) || (c && !c->AI()->sOnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex())))) sLog.outError("AuraEffect::TriggerSpell: Spell %u has value 0 in EffectTriggered[%d] and is therefor not handled. Define as custom case?",GetId(),GetEffIndex()); } @@ -2959,7 +2959,7 @@ void AuraEffect::HandlePhase(AuraApplication const * aurApp, uint8 mode, bool ap { newPhase = PHASEMASK_NORMAL; if (Creature* creature = target->ToCreature()) - if (CreatureData const* data = sObjectMgr.GetCreatureData(creature->GetDBTableGUIDLow())) + if (CreatureData const* data = sObjectMgr->GetCreatureData(creature->GetDBTableGUIDLow())) newPhase = data->phaseMask; } @@ -3340,8 +3340,8 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode, if (target->GetTypeId() == TYPEID_PLAYER) team = target->ToPlayer()->GetTeam(); - uint32 display_id = sObjectMgr.ChooseDisplayId(team,ci); - CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id); + uint32 display_id = sObjectMgr->ChooseDisplayId(team,ci); + CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(display_id); if (minfo) display_id = minfo->modelid; @@ -3789,8 +3789,8 @@ void AuraEffect::HandleAuraMounted(AuraApplication const * aurApp, uint8 mode, b if (target->GetTypeId() == TYPEID_PLAYER) team = target->ToPlayer()->GetTeam(); - uint32 display_id = sObjectMgr.ChooseDisplayId(team,ci); - CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id); + uint32 display_id = sObjectMgr->ChooseDisplayId(team,ci); + CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(display_id); if (minfo) display_id = minfo->modelid; @@ -4420,7 +4420,7 @@ void AuraEffect::HandleAuraModEffectImmunity(AuraApplication const * aurApp, uin bg->EventPlayerDroppedFlag(target->ToPlayer()); } else - sOutdoorPvPMgr.HandleDropFlag((Player*)target,GetSpellProto()->Id); + sOutdoorPvPMgr->HandleDropFlag((Player*)target,GetSpellProto()->Id); } } @@ -6098,8 +6098,8 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo if (target->GetTypeId() == TYPEID_PLAYER) team = target->ToPlayer()->GetTeam(); - uint32 display_id = sObjectMgr.ChooseDisplayId(team, creatureInfo); - CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id); + uint32 display_id = sObjectMgr->ChooseDisplayId(team, creatureInfo); + CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(display_id); if (minfo) display_id = minfo->modelid; @@ -6200,7 +6200,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo if (mode & AURA_EFFECT_HANDLE_REAL) { // pet auras - if (PetAura const* petSpell = sSpellMgr.GetPetAura(GetId(), m_effIndex)) + if (PetAura const* petSpell = sSpellMgr->GetPetAura(GetId(), m_effIndex)) { if (apply) target->AddPetAura(petSpell); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index d462fcdbdaa..6257db65ade 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -527,7 +527,7 @@ void Aura::UpdateTargetMap(Unit * caster, bool apply) for (Unit::AuraApplicationMap::iterator iter = itr->first->GetAppliedAuras().begin(); iter != itr->first->GetAppliedAuras().end(); ++iter) { Aura const * aura = iter->second->GetBase(); - if (!sSpellMgr.CanAurasStack(this, aura, aura->GetCasterGUID() == GetCasterGUID())) + if (!sSpellMgr->CanAurasStack(this, aura, aura->GetCasterGUID() == GetCasterGUID())) { addUnit = false; break; @@ -863,7 +863,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, Unit * target = aurApp->GetTarget(); AuraRemoveMode removeMode = aurApp->GetRemoveMode(); // spell_area table - SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAuraMapBounds(GetId()); + SpellAreaForAreaMapBounds saBounds = sSpellMgr->GetSpellAreaForAuraMapBounds(GetId()); if (saBounds.first != saBounds.second) { uint32 zone, area; @@ -886,9 +886,9 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, if (apply) { // Apply linked auras (On first aura apply) - if (sSpellMgr.GetSpellCustomAttr(GetId()) & SPELL_ATTR0_CU_LINK_AURA) + if (sSpellMgr->GetSpellCustomAttr(GetId()) & SPELL_ATTR0_CU_LINK_AURA) { - if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(GetId() + SPELL_LINK_AURA)) + if (const std::vector<int32> *spell_triggered = sSpellMgr->GetSpellLinked(GetId() + SPELL_LINK_AURA)) for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr) { if (*itr < 0) @@ -1090,11 +1090,11 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, // Remove Linked Auras if (removeMode != AURA_REMOVE_BY_STACK && removeMode != AURA_REMOVE_BY_DEATH) { - if (uint32 customAttr = sSpellMgr.GetSpellCustomAttr(GetId())) + if (uint32 customAttr = sSpellMgr->GetSpellCustomAttr(GetId())) { if (customAttr & SPELL_ATTR0_CU_LINK_REMOVE) { - if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(-(int32)GetId())) + if (const std::vector<int32> *spell_triggered = sSpellMgr->GetSpellLinked(-(int32)GetId())) for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr) { if (*itr < 0) @@ -1105,7 +1105,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, } if (customAttr & SPELL_ATTR0_CU_LINK_AURA) { - if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(GetId() + SPELL_LINK_AURA)) + if (const std::vector<int32> *spell_triggered = sSpellMgr->GetSpellLinked(GetId() + SPELL_LINK_AURA)) for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr) { if (*itr < 0) @@ -1634,7 +1634,7 @@ void Aura::_DeleteRemovedApplications() void Aura::LoadScripts() { sLog.outDebug("Aura::LoadScripts"); - sScriptMgr.CreateAuraScripts(m_spellProto->Id, m_loadedScripts); + sScriptMgr->CreateAuraScripts(m_spellProto->Id, m_loadedScripts); for(std::list<AuraScript *>::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;) { if (!(*itr)->_Load(this)) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 48e6f071a40..8d1f603c5a4 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -420,10 +420,10 @@ void SpellCastTargets::write (ByteBuffer & data) } Spell::Spell(Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID, bool skipCheck): -m_spellInfo(sSpellMgr.GetSpellForDifficultyFromSpell(info, Caster)), +m_spellInfo(sSpellMgr->GetSpellForDifficultyFromSpell(info, Caster)), m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo)) { - m_customAttr = sSpellMgr.GetSpellCustomAttr(m_spellInfo->Id); + m_customAttr = sSpellMgr->GetSpellCustomAttr(m_spellInfo->Id); m_skipCheck = skipCheck; m_selfContainer = NULL; m_referencedFromCurrentSpell = false; @@ -704,7 +704,7 @@ void Spell::SelectSpellTargets() case SPELL_EFFECT_SUMMON_PLAYER: if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->GetSelection()) { - Player* target = sObjectMgr.GetPlayer(m_caster->ToPlayer()->GetSelection()); + Player* target = sObjectMgr->GetPlayer(m_caster->ToPlayer()->GetSelection()); if (target) AddUnitTarget(target, i); } @@ -949,7 +949,7 @@ void Spell::AddUnitTarget(Unit* pVictim, uint32 effIndex) ihit->scaleAura = false; if (m_auraScaleMask && ihit->effectMask == m_auraScaleMask && m_caster != pVictim) { - SpellEntry const * auraSpell = sSpellStore.LookupEntry(sSpellMgr.GetFirstSpellInChain(m_spellInfo->Id)); + SpellEntry const * auraSpell = sSpellStore.LookupEntry(sSpellMgr->GetFirstSpellInChain(m_spellInfo->Id)); if (uint32(pVictim->getLevel() + 10) >= auraSpell->spellLevel) ihit->scaleAura = true; } @@ -970,7 +970,7 @@ void Spell::AddUnitTarget(Unit* pVictim, uint32 effIndex) target.scaleAura = false; if (m_auraScaleMask && target.effectMask == m_auraScaleMask && m_caster != pVictim) { - SpellEntry const * auraSpell = sSpellStore.LookupEntry(sSpellMgr.GetFirstSpellInChain(m_spellInfo->Id)); + SpellEntry const * auraSpell = sSpellStore.LookupEntry(sSpellMgr->GetFirstSpellInChain(m_spellInfo->Id)); if (uint32(pVictim->getLevel() + 10) >= auraSpell->spellLevel) target.scaleAura = true; } @@ -1462,7 +1462,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool int32 basePoints[3]; if (scaleAura) { - aurSpellInfo = sSpellMgr.SelectAuraRankForPlayerLevel(m_spellInfo,unitTarget->getLevel()); + aurSpellInfo = sSpellMgr->SelectAuraRankForPlayerLevel(m_spellInfo,unitTarget->getLevel()); ASSERT(aurSpellInfo); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { @@ -1584,7 +1584,7 @@ void Spell::DoTriggersOnSpellHit(Unit *unit) if (m_customAttr & SPELL_ATTR0_CU_LINK_HIT) { - if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(m_spellInfo->Id + SPELL_LINK_HIT)) + if (const std::vector<int32> *spell_triggered = sSpellMgr->GetSpellLinked(m_spellInfo->Id + SPELL_LINK_HIT)) for (std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i) if (*i < 0) unit->RemoveAurasDueToSpell(-(*i)); @@ -1884,7 +1884,7 @@ WorldObject* Spell::SearchNearbyTarget(float range, SpellTargets TargetType, Spe { case SPELL_TARGETS_ENTRY: { - ConditionList conditions = sConditionMgr.GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, m_spellInfo->Id); + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, m_spellInfo->Id); if (conditions.empty()) { sLog.outDebug("Spell (ID: %u) (caster Entry: %u) does not have record in `conditions` for spell script target (ConditionSourceType 13)", m_spellInfo->Id, m_caster->GetEntry()); @@ -2281,7 +2281,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) switch(cur) { case TARGET_DST_DB: - if (SpellTargetPosition const* st = sSpellMgr.GetSpellTargetPosition(m_spellInfo->Id)) + if (SpellTargetPosition const* st = sSpellMgr->GetSpellTargetPosition(m_spellInfo->Id)) { //TODO: fix this check if (m_spellInfo->Effect[0] == SPELL_EFFECT_TELEPORT_UNITS @@ -2476,7 +2476,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) { case SPELL_TARGETS_ENTRY: { - ConditionList conditions = sConditionMgr.GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, m_spellInfo->Id); + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, m_spellInfo->Id); if (!conditions.empty()) { for (ConditionList::const_iterator i_spellST = conditions.begin(); i_spellST != conditions.end(); ++i_spellST) @@ -2573,7 +2573,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) } case SPELL_TARGETS_GO: { - ConditionList conditions = sConditionMgr.GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, m_spellInfo->Id); + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, m_spellInfo->Id); if (!conditions.empty()) { for (ConditionList::const_iterator i_spellST = conditions.begin(); i_spellST != conditions.end(); ++i_spellST) @@ -2922,10 +2922,10 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const * triggere if (Player* plrCaster = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself()) { //check for special spell conditions - ConditionList conditions = sConditionMgr.GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL, m_spellInfo->Id); + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL, m_spellInfo->Id); if (!conditions.empty()) { - if (!sConditionMgr.IsPlayerMeetToConditions(plrCaster, conditions)) + if (!sConditionMgr->IsPlayerMeetToConditions(plrCaster, conditions)) { //SendCastResult(SPELL_FAILED_DONT_REPORT); SendCastResult(plrCaster, m_spellInfo, m_cast_count, SPELL_FAILED_DONT_REPORT); @@ -2996,7 +2996,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const * triggere return; } - if (sDisableMgr.IsDisabledFor(DISABLE_TYPE_SPELL, m_spellInfo->Id, m_caster)) + if (sDisableMgr->IsDisabledFor(DISABLE_TYPE_SPELL, m_spellInfo->Id, m_caster)) { SendCastResult(SPELL_FAILED_SPELL_UNAVAILABLE); finish(false); @@ -3175,7 +3175,7 @@ void Spell::cast(bool skipCheck) // now that we've done the basic check, now run the scripts // should be done before the spell is actually executed if (Player *playerCaster = m_caster->ToPlayer()) - sScriptMgr.OnPlayerSpellCast(playerCaster, this, skipCheck); + sScriptMgr->OnPlayerSpellCast(playerCaster, this, skipCheck); SetExecutedCurrently(true); @@ -3377,7 +3377,7 @@ void Spell::cast(bool skipCheck) if (m_customAttr & SPELL_ATTR0_CU_LINK_CAST) { - if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(m_spellInfo->Id)) + if (const std::vector<int32> *spell_triggered = sSpellMgr->GetSpellLinked(m_spellInfo->Id)) { for (std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i) if (*i < 0) @@ -4705,14 +4705,14 @@ void Spell::HandleThreatSpells(uint32 spellId) if (!m_targets.getUnitTarget()->CanHaveThreatList()) return; - uint16 threat = sSpellMgr.GetSpellThreat(spellId); + uint16 threat = sSpellMgr->GetSpellThreat(spellId); if (!threat) return; m_targets.getUnitTarget()->AddThreat(m_caster, float(threat)); - sLog.outStaticDebug("Spell %u, rank %u, added an additional %i threat", spellId, sSpellMgr.GetSpellRank(spellId), threat); + sLog.outStaticDebug("Spell %u, rank %u, added an additional %i threat", spellId, sSpellMgr->GetSpellRank(spellId), threat); } void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTarget,uint32 i) @@ -4871,7 +4871,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (!m_IsTriggeredSpell && target == m_caster && m_spellInfo->AttributesEx & SPELL_ATTR1_CANT_TARGET_SELF) return SPELL_FAILED_BAD_TARGETS; - bool non_caster_target = target != m_caster && !sSpellMgr.IsSpellWithCasterSourceTargetsOnly(m_spellInfo); + bool non_caster_target = target != m_caster && !sSpellMgr->IsSpellWithCasterSourceTargetsOnly(m_spellInfo); if (non_caster_target) { @@ -5045,7 +5045,7 @@ SpellCastResult Spell::CheckCast(bool strict) uint32 zone, area; m_caster->GetZoneAndAreaId(zone,area); - SpellCastResult locRes= sSpellMgr.GetSpellAllowedInLocationError(m_spellInfo,m_caster->GetMapId(),zone,area, + SpellCastResult locRes= sSpellMgr->GetSpellAllowedInLocationError(m_spellInfo,m_caster->GetMapId(),zone,area, m_caster->GetTypeId() == TYPEID_PLAYER ? m_caster->ToPlayer() : NULL); if (locRes != SPELL_CAST_OK) return locRes; @@ -5396,7 +5396,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (!m_caster->ToPlayer()->GetSelection()) return SPELL_FAILED_BAD_TARGETS; - Player* target = sObjectMgr.GetPlayer(m_caster->ToPlayer()->GetSelection()); + Player* target = sObjectMgr->GetPlayer(m_caster->ToPlayer()->GetSelection()); if (!target || m_caster->ToPlayer() == target || !target->IsInSameRaidWith(m_caster->ToPlayer())) return SPELL_FAILED_BAD_TARGETS; @@ -5407,7 +5407,7 @@ SpellCastResult Spell::CheckCast(bool strict) InstanceTemplate const* instance = ObjectMgr::GetInstanceTemplate(pMap->GetId()); if (!instance) return SPELL_FAILED_TARGET_NOT_IN_INSTANCE; - if (!target->Satisfy(sObjectMgr.GetAccessRequirement(pMap->GetId(), pMap->GetDifficulty()), pMap->GetId())) + if (!target->Satisfy(sObjectMgr->GetAccessRequirement(pMap->GetId(), pMap->GetDifficulty()), pMap->GetId())) return SPELL_FAILED_BAD_TARGETS; } break; @@ -7268,7 +7268,7 @@ void Spell::CheckEffectExecuteData() void Spell::LoadScripts() { sLog.outDebug("Spell::LoadScripts"); - sScriptMgr.CreateSpellScripts(m_spellInfo->Id, m_loadedScripts); + sScriptMgr->CreateSpellScripts(m_spellInfo->Id, m_loadedScripts); for(std::list<SpellScript *>::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;) { if (!(*itr)->_Load(this)) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 97def26e5c9..095905002a0 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1510,7 +1510,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) } // pet auras - if (PetAura const* petSpell = sSpellMgr.GetPetAura(m_spellInfo->Id,effIndex)) + if (PetAura const* petSpell = sSpellMgr->GetPetAura(m_spellInfo->Id,effIndex)) { m_caster->AddPetAura(petSpell); return; @@ -1523,11 +1523,11 @@ void Spell::EffectDummy(SpellEffIndex effIndex) // Script based implementation. Must be used only for not good for implementation in core spell effects // So called only for not proccessed cases if (gameObjTarget) - sScriptMgr.OnDummyEffect(m_caster, m_spellInfo->Id, effIndex, gameObjTarget); + sScriptMgr->OnDummyEffect(m_caster, m_spellInfo->Id, effIndex, gameObjTarget); else if (unitTarget && unitTarget->GetTypeId() == TYPEID_UNIT) - sScriptMgr.OnDummyEffect(m_caster, m_spellInfo->Id, effIndex, unitTarget->ToCreature()); + sScriptMgr->OnDummyEffect(m_caster, m_spellInfo->Id, effIndex, unitTarget->ToCreature()); else if (itemTarget) - sScriptMgr.OnDummyEffect(m_caster, m_spellInfo->Id, effIndex, itemTarget); + sScriptMgr->OnDummyEffect(m_caster, m_spellInfo->Id, effIndex, itemTarget); } void Spell::EffectTriggerSpellWithValue(SpellEffIndex effIndex) @@ -1595,7 +1595,7 @@ void Spell::EffectForceCast(SpellEffIndex effIndex) return; case 72378: // Blood Nova case 73058: // Blood Nova - spellInfo = sSpellMgr.GetSpellForDifficultyFromSpell(spellInfo, m_caster); + spellInfo = sSpellMgr->GetSpellForDifficultyFromSpell(spellInfo, m_caster); break; } } @@ -2418,7 +2418,7 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype) // for battleground marks send by mail if not add all expected if (no_space > 0 && bgType) { - if (Battleground* bg = sBattlegroundMgr.GetBattlegroundTemplate(BattlegroundTypeId(bgType))) + if (Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(BattlegroundTypeId(bgType))) bg->SendRewardMarkByMail(player, newitemid, no_space); } */ @@ -2486,7 +2486,7 @@ void Spell::EffectPersistentAA(SpellEffIndex effIndex) if (!caster->IsInWorld()) return; DynamicObject* dynObj = new DynamicObject; - if (!dynObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo->Id, m_targets.m_dstPos, radius, false)) + if (!dynObj->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo->Id, m_targets.m_dstPos, radius, false)) { delete dynObj; return; @@ -2570,10 +2570,10 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) { uint32 spell_id = itr->second->GetBase()->GetId(); if (!guardianFound) - if (sSpellMgr.IsSpellMemberOfSpellGroup(spell_id, SPELL_GROUP_ELIXIR_GUARDIAN)) + if (sSpellMgr->IsSpellMemberOfSpellGroup(spell_id, SPELL_GROUP_ELIXIR_GUARDIAN)) guardianFound = true; if (!battleFound) - if (sSpellMgr.IsSpellMemberOfSpellGroup(spell_id, SPELL_GROUP_ELIXIR_BATTLE)) + if (sSpellMgr->IsSpellMemberOfSpellGroup(spell_id, SPELL_GROUP_ELIXIR_BATTLE)) battleFound = true; if (battleFound && guardianFound) break; @@ -2582,17 +2582,17 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) // get all available elixirs by mask and spell level std::set<uint32> avalibleElixirs; if (!guardianFound) - sSpellMgr.GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_GUARDIAN, avalibleElixirs); + sSpellMgr->GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_GUARDIAN, avalibleElixirs); if (!battleFound) - sSpellMgr.GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_BATTLE, avalibleElixirs); + sSpellMgr->GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_BATTLE, avalibleElixirs); for (std::set<uint32>::iterator itr = avalibleElixirs.begin(); itr != avalibleElixirs.end() ;) { SpellEntry const *spellInfo = sSpellStore.LookupEntry(*itr); if (spellInfo->spellLevel < m_spellInfo->spellLevel || spellInfo->spellLevel > unitTarget->getLevel()) avalibleElixirs.erase(itr++); - else if (sSpellMgr.IsSpellMemberOfSpellGroup(*itr, SPELL_GROUP_ELIXIR_SHATTRATH)) + else if (sSpellMgr->IsSpellMemberOfSpellGroup(*itr, SPELL_GROUP_ELIXIR_SHATTRATH)) avalibleElixirs.erase(itr++); - else if (sSpellMgr.IsSpellMemberOfSpellGroup(*itr, SPELL_GROUP_ELIXIR_UNSTABLE)) + else if (sSpellMgr->IsSpellMemberOfSpellGroup(*itr, SPELL_GROUP_ELIXIR_UNSTABLE)) avalibleElixirs.erase(itr++); else ++itr; @@ -2637,7 +2637,7 @@ void Spell::SendLoot(uint64 guid, LootType loottype) if (gameObjTarget) { - if (sScriptMgr.OnGossipHello(player, gameObjTarget)) + if (sScriptMgr->OnGossipHello(player, gameObjTarget)) return; gameObjTarget->AI()->GossipHello(player); @@ -2735,7 +2735,7 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex) // TODO: Add script for spell 41920 - Filling, becouse server it freze when use this spell // handle outdoor pvp object opening, return true if go was registered for handling // these objects must have been spawned by outdoorpvp! - else if (gameObjTarget->GetGOInfo()->type == GAMEOBJECT_TYPE_GOOBER && sOutdoorPvPMgr.HandleOpenGo(player, gameObjTarget->GetGUID())) + else if (gameObjTarget->GetGOInfo()->type == GAMEOBJECT_TYPE_GOOBER && sOutdoorPvPMgr->HandleOpenGo(player, gameObjTarget->GetGUID())) return; lockId = goInfo->GetLockId(); guid = gameObjTarget->GetGUID(); @@ -3297,7 +3297,7 @@ void Spell::EffectAddFarsight(SpellEffIndex effIndex) if (!m_caster->IsInWorld()) return; DynamicObject* dynObj = new DynamicObject; - if (!dynObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, m_targets.m_dstPos, radius, true)) + if (!dynObj->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, m_targets.m_dstPos, radius, true)) { delete dynObj; return; @@ -3763,7 +3763,7 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex) pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id); // generate new name for summon pet - std::string new_name=sObjectMgr.GeneratePetName(petentry); + std::string new_name=sObjectMgr->GeneratePetName(petentry); if (!new_name.empty()) pet->SetName(new_name); @@ -4220,7 +4220,7 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex) Map *map = target->GetMap(); - if (!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id, map, + if (!pGameObj->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id, map, m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY)) { delete pGameObj; @@ -4271,7 +4271,7 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex) if (uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry()) { GameObject* linkedGO = new GameObject; - if (linkedGO->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, map, + if (linkedGO->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, map, m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY)) { linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0); @@ -5425,7 +5425,7 @@ void Spell::EffectDuel(SpellEffIndex effIndex) uint32 gameobject_id = m_spellInfo->EffectMiscValue[effIndex]; Map *map = m_caster->GetMap(); - if (!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id, + if (!pGameObj->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id, map, m_caster->GetPhaseMask(), m_caster->GetPositionX()+(unitTarget->GetPositionX()-m_caster->GetPositionX())/2 , m_caster->GetPositionY()+(unitTarget->GetPositionY()-m_caster->GetPositionY())/2 , @@ -5473,7 +5473,7 @@ void Spell::EffectDuel(SpellEffIndex effIndex) caster->SetUInt64Value(PLAYER_DUEL_ARBITER, pGameObj->GetGUID()); target->SetUInt64Value(PLAYER_DUEL_ARBITER, pGameObj->GetGUID()); - sScriptMgr.OnPlayerDuelRequest(target, caster); + sScriptMgr->OnPlayerDuelRequest(target, caster); } void Spell::EffectStuck(SpellEffIndex /*effIndex*/) @@ -5760,7 +5760,7 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex) m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE); Map *map = m_caster->GetMap(); - if (!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), go_id, map, + if (!pGameObj->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), go_id, map, m_caster->GetPhaseMask(), x, y, z, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY)) { delete pGameObj; @@ -5887,7 +5887,7 @@ void Spell::EffectReputation(SpellEffIndex effIndex) if (!factionEntry) return; - if (RepRewardRate const * repData = sObjectMgr.GetRepRewardRate(faction_id)) + if (RepRewardRate const * repData = sObjectMgr->GetRepRewardRate(faction_id)) { rep_change = int32((float)rep_change * repData->spell_rate); } @@ -6089,7 +6089,7 @@ void Spell::EffectQuestClear(SpellEffIndex effIndex) uint32 quest_id = m_spellInfo->EffectMiscValue[effIndex]; - Quest const* pQuest = sObjectMgr.GetQuestTemplate(quest_id); + Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id); if (!pQuest) return; @@ -6346,7 +6346,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex) GameObject* pGameObj = new GameObject; - if (!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), name_id, cMap, + if (!pGameObj->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), name_id, cMap, m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY)) { delete pGameObj; @@ -6412,7 +6412,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex) if (uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry()) { GameObject* linkedGO = new GameObject; - if (linkedGO->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, cMap, + if (linkedGO->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, cMap, m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY)) { linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0); @@ -6653,7 +6653,7 @@ void Spell::EffectQuestStart(SpellEffIndex effIndex) return; Player * player = unitTarget->ToPlayer(); - if (Quest const* qInfo = sObjectMgr.GetQuestTemplate(m_spellInfo->EffectMiscValue[effIndex])) + if (Quest const* qInfo = sObjectMgr->GetQuestTemplate(m_spellInfo->EffectMiscValue[effIndex])) { if (player->CanTakeQuest(qInfo, false) && player->CanAddQuest(qInfo, false)) { @@ -7061,7 +7061,7 @@ void Spell::EffectBind(SpellEffIndex effIndex) WorldLocation loc; if (m_spellInfo->EffectImplicitTargetA[effIndex] == TARGET_DST_DB || m_spellInfo->EffectImplicitTargetB[effIndex] == TARGET_DST_DB) { - SpellTargetPosition const* st = sSpellMgr.GetSpellTargetPosition(m_spellInfo->Id); + SpellTargetPosition const* st = sSpellMgr->GetSpellTargetPosition(m_spellInfo->Id); if (!st) { sLog.outError("Spell::EffectBind - unknown teleport coordinates for spell ID %u", m_spellInfo->Id); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 925a0c947a4..22379b1db68 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -359,7 +359,7 @@ bool IsAutocastableSpell(uint32 spellId) bool IsHigherHankOfSpell(uint32 spellId_1, uint32 spellId_2) { - return sSpellMgr.GetSpellRank(spellId_1)<sSpellMgr.GetSpellRank(spellId_2); + return sSpellMgr->GetSpellRank(spellId_1) < sSpellMgr->GetSpellRank(spellId_2); } uint32 CalculatePowerCost(SpellEntry const * spellInfo, Unit const * caster, SpellSchoolMask schoolMask) @@ -535,7 +535,7 @@ SpellSpecific GetSpellSpecific(SpellEntry const * spellInfo) // scrolls effects else { - uint32 firstSpell = sSpellMgr.GetFirstSpellInChain(spellInfo->Id); + uint32 firstSpell = sSpellMgr->GetFirstSpellInChain(spellInfo->Id); switch (firstSpell) { case 8118: // Strength @@ -980,7 +980,7 @@ bool IsPositiveSpell(uint32 spellId) { if (!sSpellStore.LookupEntry(spellId)) // non-existing spells return false; - return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR0_CU_NEGATIVE); + return !(sSpellMgr->GetSpellCustomAttr(spellId) & SPELL_ATTR0_CU_NEGATIVE); } bool IsPositiveEffect(uint32 spellId, uint32 effIndex) @@ -990,9 +990,9 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex) switch(effIndex) { default: - case 0: return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR0_CU_NEGATIVE_EFF0); - case 1: return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR0_CU_NEGATIVE_EFF1); - case 2: return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR0_CU_NEGATIVE_EFF2); + case 0: return !(sSpellMgr->GetSpellCustomAttr(spellId) & SPELL_ATTR0_CU_NEGATIVE_EFF0); + case 1: return !(sSpellMgr->GetSpellCustomAttr(spellId) & SPELL_ATTR0_CU_NEGATIVE_EFF1); + case 2: return !(sSpellMgr->GetSpellCustomAttr(spellId) & SPELL_ATTR0_CU_NEGATIVE_EFF2); } } @@ -1166,7 +1166,7 @@ void SpellMgr::LoadSpellTargetPositions() // additional requirements if (spellInfo->Effect[i]==SPELL_EFFECT_BIND && spellInfo->EffectMiscValue[i]) { - uint32 area_id = sMapMgr.GetAreaId(st.target_mapId, st.target_X, st.target_Y, st.target_Z); + uint32 area_id = sMapMgr->GetAreaId(st.target_mapId, st.target_X, st.target_Y, st.target_Z); if (area_id != uint32(spellInfo->EffectMiscValue[i])) { sLog.outErrorDb("Spell (Id: %u) listed in `spell_target_position` expected point to zone %u bit point to zone %u.",Spell_ID, spellInfo->EffectMiscValue[i], area_id); @@ -1218,7 +1218,7 @@ void SpellMgr::LoadSpellTargetPositions() } if (found) { -// if (!sSpellMgr.GetSpellTargetPosition(i)) +// if (!sSpellMgr->GetSpellTargetPosition(i)) // sLog.outDebug("Spell (ID: %u) does not have record in `spell_target_position`", i); } } @@ -1683,7 +1683,7 @@ bool SpellMgr::canStackSpellRanks(SpellEntry const *spellInfo) if (IsProfessionOrRidingSpell(spellInfo->Id)) return false; - if (sSpellMgr.IsSkillBonusSpell(spellInfo->Id)) + if (sSpellMgr->IsSkillBonusSpell(spellInfo->Id)) return false; // All stance spells. if any better way, change it. @@ -2220,7 +2220,7 @@ bool LoadPetDefaultSpells_helper(CreatureInfo const* cInfo, PetDefaultSpellsEntr return false; // remove duplicates with levelupSpells if any - if (PetLevelupSpellSet const *levelupSpells = cInfo->family ? sSpellMgr.GetPetLevelupSpellList(cInfo->family) : NULL) + if (PetLevelupSpellSet const *levelupSpells = cInfo->family ? sSpellMgr->GetPetLevelupSpellList(cInfo->family) : NULL) { for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j) { @@ -2519,7 +2519,7 @@ void SpellMgr::LoadSpellAreas() continue; } - if (spellArea.questStart && !sObjectMgr.GetQuestTemplate(spellArea.questStart)) + if (spellArea.questStart && !sObjectMgr->GetQuestTemplate(spellArea.questStart)) { sLog.outErrorDb("Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell,spellArea.questStart); continue; @@ -2527,7 +2527,7 @@ void SpellMgr::LoadSpellAreas() if (spellArea.questEnd) { - if (!sObjectMgr.GetQuestTemplate(spellArea.questEnd)) + if (!sObjectMgr->GetQuestTemplate(spellArea.questEnd)) { sLog.outErrorDb("Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell,spellArea.questEnd); continue; @@ -2675,7 +2675,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell } // DB base check (if non empty then must fit at least single for allow) - SpellAreaMapBounds saBounds = sSpellMgr.GetSpellAreaMapBounds(spellInfo->Id); + SpellAreaMapBounds saBounds = sSpellMgr->GetSpellAreaMapBounds(spellInfo->Id); if (saBounds.first != saBounds.second) { for (SpellAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) @@ -3156,7 +3156,7 @@ bool SpellMgr::CanAurasStack(Aura const *aura1, Aura const *aura2, bool sameCast if (spellId_1 == 44413) return true; if (aura1->GetCastItemGUID() && aura2->GetCastItemGUID()) - if (aura1->GetCastItemGUID() != aura2->GetCastItemGUID() && (sSpellMgr.GetSpellCustomAttr(spellId_1) & SPELL_ATTR0_CU_ENCHANT_PROC)) + if (aura1->GetCastItemGUID() != aura2->GetCastItemGUID() && (sSpellMgr->GetSpellCustomAttr(spellId_1) & SPELL_ATTR0_CU_ENCHANT_PROC)) return true; // same spell with same caster should not stack return false; diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 8b5cf987267..27741b82080 100755 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -1442,6 +1442,6 @@ class SpellMgr SpellDifficultySearcherMap mSpellDifficultySearcherMap; }; -#define sSpellMgr (*ACE_Singleton<SpellMgr, ACE_Null_Mutex>::instance()) +#define sSpellMgr ACE_Singleton<SpellMgr, ACE_Null_Mutex>::instance() #endif diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index 7ea25511f01..b4dc9f60971 100755 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -335,7 +335,7 @@ void CreatureTextMgr::SendChatPacket(WorldPacket *data, WorldObject* source, Cha { if (range == TEXT_RANGE_NORMAL)//ignores team and gmOnly { - Player *player = sObjectMgr.GetPlayer(whisperGuid); + Player *player = sObjectMgr->GetPlayer(whisperGuid); if (!player || !player->GetSession()) return; player->GetSession()->SendPacket(data); diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h index 6487c835bc4..e38b734536a 100755 --- a/src/server/game/Texts/CreatureTextMgr.h +++ b/src/server/game/Texts/CreatureTextMgr.h @@ -79,5 +79,5 @@ class CreatureTextMgr CreatureTextRepeatMap mTextRepeatMap; }; -#define sCreatureTextMgr (*ACE_Singleton<CreatureTextMgr, ACE_Null_Mutex>::instance()) +#define sCreatureTextMgr ACE_Singleton<CreatureTextMgr, ACE_Null_Mutex>::instance() #endif diff --git a/src/server/game/Tickets/TicketMgr.h b/src/server/game/Tickets/TicketMgr.h index b6b6513eef0..a9d1a9334d0 100755 --- a/src/server/game/Tickets/TicketMgr.h +++ b/src/server/game/Tickets/TicketMgr.h @@ -163,6 +163,6 @@ protected: time_t lastChange; }; -#define sTicketMgr (*ACE_Singleton<TicketMgr, ACE_Null_Mutex>::instance()) +#define sTicketMgr ACE_Singleton<TicketMgr, ACE_Null_Mutex>::instance() #endif // _TICKETMGR_H diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp index 76feb5375c6..30ca207bd4d 100755 --- a/src/server/game/Tools/PlayerDump.cpp +++ b/src/server/game/Tools/PlayerDump.cpp @@ -382,7 +382,7 @@ void fixNULLfields(std::string &line) DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, std::string name, uint32 guid) { - uint32 charcount = sAccountMgr.GetCharactersCount(account); + uint32 charcount = sAccountMgr->GetCharactersCount(account); if (charcount >= 10) return DUMP_TOO_MANY_CHARS; @@ -395,15 +395,15 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s // make sure the same guid doesn't already exist and is safe to use bool incHighest = true; - if (guid != 0 && guid < sObjectMgr.m_hiCharGuid) + if (guid != 0 && guid < sObjectMgr->m_hiCharGuid) { result = CharacterDatabase.PQuery("SELECT 1 FROM characters WHERE guid = '%d'", guid); if (result) - guid = sObjectMgr.m_hiCharGuid; // use first free if exists + guid = sObjectMgr->m_hiCharGuid; // use first free if exists else incHighest = false; } else - guid = sObjectMgr.m_hiCharGuid; + guid = sObjectMgr->m_hiCharGuid; // normalize the name if specified and check if it exists if (!normalizePlayerName(name)) @@ -423,7 +423,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s snprintf(newguid, 20, "%d", guid); snprintf(chraccount, 20, "%d", account); - snprintf(newpetid, 20, "%d", sObjectMgr.GeneratePetNumber()); + snprintf(newpetid, 20, "%d", sObjectMgr->GeneratePetNumber()); snprintf(lastpetid, 20, "%s", ""); std::map<uint32,uint32> items; @@ -540,7 +540,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s ROLLBACK(DUMP_FILE_BROKEN); // character_equipmentsets.guid char newSetGuid[24]; - snprintf(newSetGuid, 24, UI64FMTD, sObjectMgr.GenerateEquipmentSetGuid()); + snprintf(newSetGuid, 24, UI64FMTD, sObjectMgr->GenerateEquipmentSetGuid()); if (!changenth(line, 2, newSetGuid)) ROLLBACK(DUMP_FILE_BROKEN); // character_equipmentsets.setguid break; @@ -550,15 +550,15 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s if (!changenth(line, 1, newguid)) // character_inventory.guid update ROLLBACK(DUMP_FILE_BROKEN); - if (!changeGuid(line, 2, items, sObjectMgr.m_hiItemGuid, true)) + if (!changeGuid(line, 2, items, sObjectMgr->m_hiItemGuid, true)) ROLLBACK(DUMP_FILE_BROKEN); // character_inventory.bag update - if (!changeGuid(line, 4, items, sObjectMgr.m_hiItemGuid)) + if (!changeGuid(line, 4, items, sObjectMgr->m_hiItemGuid)) ROLLBACK(DUMP_FILE_BROKEN); // character_inventory.item update break; } case DTT_MAIL: // mail { - if (!changeGuid(line, 1, mails, sObjectMgr.m_mailid)) + if (!changeGuid(line, 1, mails, sObjectMgr->m_mailid)) ROLLBACK(DUMP_FILE_BROKEN); // mail.id update if (!changenth(line, 6, newguid)) // mail.receiver update ROLLBACK(DUMP_FILE_BROKEN); @@ -566,9 +566,9 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s } case DTT_MAIL_ITEM: // mail_items { - if (!changeGuid(line, 1, mails, sObjectMgr.m_mailid)) + if (!changeGuid(line, 1, mails, sObjectMgr->m_mailid)) ROLLBACK(DUMP_FILE_BROKEN); // mail_items.id - if (!changeGuid(line, 2, items, sObjectMgr.m_hiItemGuid)) + if (!changeGuid(line, 2, items, sObjectMgr->m_hiItemGuid)) ROLLBACK(DUMP_FILE_BROKEN); // mail_items.item_guid if (!changenth(line, 4, newguid)) // mail_items.receiver ROLLBACK(DUMP_FILE_BROKEN); @@ -577,7 +577,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s case DTT_ITEM: { // item, owner, data field:item, owner guid - if (!changeGuid(line, 1, items, sObjectMgr.m_hiItemGuid)) + if (!changeGuid(line, 1, items, sObjectMgr->m_hiItemGuid)) ROLLBACK(DUMP_FILE_BROKEN); // item_instance.guid update if (!changenth(line, 3, newguid)) // item_instance.owner_guid update ROLLBACK(DUMP_FILE_BROKEN); @@ -587,7 +587,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s { if (!changenth(line, 1, newguid)) // character_gifts.guid update ROLLBACK(DUMP_FILE_BROKEN); - if (!changeGuid(line, 2, items, sObjectMgr.m_hiItemGuid)) + if (!changeGuid(line, 2, items, sObjectMgr->m_hiItemGuid)) ROLLBACK(DUMP_FILE_BROKEN); // character_gifts.item_guid update break; } @@ -599,7 +599,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s snprintf(lastpetid, 20, "%s", currpetid); if (strcmp(lastpetid,currpetid) != 0) { - snprintf(newpetid, 20, "%d", sObjectMgr.GeneratePetNumber()); + snprintf(newpetid, 20, "%d", sObjectMgr->GeneratePetNumber()); snprintf(lastpetid, 20, "%s", currpetid); } @@ -645,11 +645,11 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s CharacterDatabase.CommitTransaction(trans); - sObjectMgr.m_hiItemGuid += items.size(); - sObjectMgr.m_mailid += mails.size(); + sObjectMgr->m_hiItemGuid += items.size(); + sObjectMgr->m_mailid += mails.size(); if (incHighest) - ++sObjectMgr.m_hiCharGuid; + ++sObjectMgr->m_hiCharGuid; fclose(fin); diff --git a/src/server/game/Weather/Weather.cpp b/src/server/game/Weather/Weather.cpp index 36e5d7eb444..c35a9dbbf06 100755 --- a/src/server/game/Weather/Weather.cpp +++ b/src/server/game/Weather/Weather.cpp @@ -61,7 +61,7 @@ bool Weather::Update(uint32 diff) } } - sScriptMgr.OnWeatherUpdate(this, diff); + sScriptMgr->OnWeatherUpdate(this, diff); return true; } @@ -268,7 +268,7 @@ bool Weather::UpdateWeather() } sLog.outDetail("Change the weather of zone %u to %s.", m_zone, wthstr); - sScriptMgr.OnWeatherChange(this, state, m_grade); + sScriptMgr->OnWeatherChange(this, state, m_grade); return true; } diff --git a/src/server/game/Weather/WeatherMgr.cpp b/src/server/game/Weather/WeatherMgr.cpp index 77b5703b996..0108c2dcc35 100755 --- a/src/server/game/Weather/WeatherMgr.cpp +++ b/src/server/game/Weather/WeatherMgr.cpp @@ -123,7 +123,7 @@ void WeatherMgr::LoadWeatherData() } } - wzc.ScriptId = sObjectMgr.GetScriptId(fields[13].GetCString()); + wzc.ScriptId = sObjectMgr->GetScriptId(fields[13].GetCString()); ++count; } diff --git a/src/server/game/Weather/WeatherMgr.h b/src/server/game/Weather/WeatherMgr.h index e0f27212ac6..f41945a1431 100755 --- a/src/server/game/Weather/WeatherMgr.h +++ b/src/server/game/Weather/WeatherMgr.h @@ -63,6 +63,6 @@ class WeatherMgr WeatherZoneMap mWeatherZoneMap; }; -#define sWeatherMgr (*ACE_Singleton<WeatherMgr, ACE_Null_Mutex>::instance()) +#define sWeatherMgr ACE_Singleton<WeatherMgr, ACE_Null_Mutex>::instance() #endif diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 6f9788d3923..fb9ee0787ae 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -164,14 +164,14 @@ void World::SetClosed(bool val) m_isClosed = val; // Invert the value, for simplicity for scripters. - sScriptMgr.OnOpenStateChange(!val); + sScriptMgr->OnOpenStateChange(!val); } void World::SetMotd(const std::string& motd) { m_motd = motd; - sScriptMgr.OnMotdChange(m_motd); + sScriptMgr->OnMotdChange(m_motd); } const char* World::GetMotd() const @@ -597,7 +597,7 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_INTERVAL_GRIDCLEAN] = MIN_GRID_DELAY; } if (reload) - sMapMgr.SetGridCleanUpDelay(m_int_configs[CONFIG_INTERVAL_GRIDCLEAN]); + sMapMgr->SetGridCleanUpDelay(m_int_configs[CONFIG_INTERVAL_GRIDCLEAN]); m_int_configs[CONFIG_INTERVAL_MAPUPDATE] = sConfig.GetIntDefault("MapUpdateInterval", 100); if (m_int_configs[CONFIG_INTERVAL_MAPUPDATE] < MIN_MAP_UPDATE_DELAY) @@ -606,7 +606,7 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_INTERVAL_MAPUPDATE] = MIN_MAP_UPDATE_DELAY; } if (reload) - sMapMgr.SetMapUpdateInterval(m_int_configs[CONFIG_INTERVAL_MAPUPDATE]); + sMapMgr->SetMapUpdateInterval(m_int_configs[CONFIG_INTERVAL_MAPUPDATE]); m_int_configs[CONFIG_INTERVAL_CHANGEWEATHER] = sConfig.GetIntDefault("ChangeWeatherInterval", 10 * MINUTE * IN_MILLISECONDS); @@ -1176,7 +1176,7 @@ void World::LoadConfigSettings(bool reload) // MySQL ping time interval m_int_configs[CONFIG_DB_PING_INTERVAL] = sConfig.GetIntDefault("MaxPingTime", 30); - sScriptMgr.OnConfigLoad(reload); + sScriptMgr->OnConfigLoad(reload); } /// Initialize the World @@ -1195,7 +1195,7 @@ void World::SetInitialWorldSettings() LoadDBAllowedSecurityLevel(); ///- Init highest guids before any table loading to prevent using not initialized guids in some code. - sObjectMgr.SetHighestGuids(); + sObjectMgr->SetHighestGuids(); ///- Check the existence of the map files for all races' startup areas. if (!MapManager::ExistMapAndVMap(0,-6240.32f, 331.033f) @@ -1215,7 +1215,7 @@ void World::SetInitialWorldSettings() ///- Loading strings. Getting no records means core load has to be canceled because no error message can be output. sLog.outString(); sLog.outString("Loading Trinity strings..."); - if (!sObjectMgr.LoadTrinityStrings()) + if (!sObjectMgr->LoadTrinityStrings()) exit(1); // Error message displayed in function already ///- Update the realm entry in the database with the realm type from the config file @@ -1239,230 +1239,230 @@ void World::SetInitialWorldSettings() DetectDBCLang(); sLog.outString("Loading Script Names..."); - sObjectMgr.LoadScriptNames(); + sObjectMgr->LoadScriptNames(); sLog.outString("Loading Instance Template..."); - sObjectMgr.LoadInstanceTemplate(); + sObjectMgr->LoadInstanceTemplate(); sLog.outString("Loading SkillLineAbilityMultiMap Data..."); - sSpellMgr.LoadSkillLineAbilityMap(); + sSpellMgr->LoadSkillLineAbilityMap(); ///- Clean up and pack instances sLog.outString("Cleaning up and packing instances..."); - sInstanceSaveMgr.CleanupAndPackInstances(); // must be called before `creature_respawn`/`gameobject_respawn` tables + sInstanceSaveMgr->CleanupAndPackInstances(); // must be called before `creature_respawn`/`gameobject_respawn` tables sLog.outString("Loading Localization strings..."); uint32 oldMSTime = getMSTime(); - sObjectMgr.LoadCreatureLocales(); - sObjectMgr.LoadGameObjectLocales(); - sObjectMgr.LoadItemLocales(); - sObjectMgr.LoadItemSetNameLocales(); - sObjectMgr.LoadQuestLocales(); - sObjectMgr.LoadNpcTextLocales(); - sObjectMgr.LoadPageTextLocales(); - sObjectMgr.LoadGossipMenuItemsLocales(); - sObjectMgr.LoadPointOfInterestLocales(); - - sObjectMgr.SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts) + sObjectMgr->LoadCreatureLocales(); + sObjectMgr->LoadGameObjectLocales(); + sObjectMgr->LoadItemLocales(); + sObjectMgr->LoadItemSetNameLocales(); + sObjectMgr->LoadQuestLocales(); + sObjectMgr->LoadNpcTextLocales(); + sObjectMgr->LoadPageTextLocales(); + sObjectMgr->LoadGossipMenuItemsLocales(); + sObjectMgr->LoadPointOfInterestLocales(); + + sObjectMgr->SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts) sLog.outString(">> Localization strings loaded in %u ms", GetMSTimeDiffToNow(oldMSTime)); sLog.outString(); sLog.outString("Loading Page Texts..."); - sObjectMgr.LoadPageTexts(); + sObjectMgr->LoadPageTexts(); sLog.outString("Loading Game Object Templates..."); // must be after LoadPageTexts - sObjectMgr.LoadGameobjectInfo(); + sObjectMgr->LoadGameobjectInfo(); sLog.outString("Loading Spell Rank Data..."); - sSpellMgr.LoadSpellRanks(); + sSpellMgr->LoadSpellRanks(); sLog.outString("Loading Spell Required Data..."); - sSpellMgr.LoadSpellRequired(); + sSpellMgr->LoadSpellRequired(); sLog.outString("Loading Spell Group types..."); - sSpellMgr.LoadSpellGroups(); + sSpellMgr->LoadSpellGroups(); sLog.outString("Loading Spell Learn Skills..."); - sSpellMgr.LoadSpellLearnSkills(); // must be after LoadSpellRanks + sSpellMgr->LoadSpellLearnSkills(); // must be after LoadSpellRanks sLog.outString("Loading Spell Learn Spells..."); - sSpellMgr.LoadSpellLearnSpells(); + sSpellMgr->LoadSpellLearnSpells(); sLog.outString("Loading Spell Proc Event conditions..."); - sSpellMgr.LoadSpellProcEvents(); + sSpellMgr->LoadSpellProcEvents(); sLog.outString("Loading Spell Bonus Data..."); - sSpellMgr.LoadSpellBonusess(); + sSpellMgr->LoadSpellBonusess(); sLog.outString("Loading Aggro Spells Definitions..."); - sSpellMgr.LoadSpellThreats(); + sSpellMgr->LoadSpellThreats(); sLog.outString("Loading Spell Group Stack Rules..."); - sSpellMgr.LoadSpellGroupStackRules(); + sSpellMgr->LoadSpellGroupStackRules(); sLog.outString("Loading NPC Texts..."); - sObjectMgr.LoadGossipText(); + sObjectMgr->LoadGossipText(); sLog.outString("Loading Enchant Spells Proc datas..."); - sSpellMgr.LoadSpellEnchantProcData(); + sSpellMgr->LoadSpellEnchantProcData(); sLog.outString("Loading Item Random Enchantments Table..."); LoadRandomEnchantmentsTable(); sLog.outString("Loading Disables"); - sDisableMgr.LoadDisables(); // must be before loading quests and items + sDisableMgr->LoadDisables(); // must be before loading quests and items sLog.outString("Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts - sObjectMgr.LoadItemPrototypes(); + sObjectMgr->LoadItemPrototypes(); sLog.outString("Loading Item set names..."); // must be after LoadItemPrototypes - sObjectMgr.LoadItemSetNames(); + sObjectMgr->LoadItemSetNames(); sLog.outString("Loading Creature Model Based Info Data..."); - sObjectMgr.LoadCreatureModelInfo(); + sObjectMgr->LoadCreatureModelInfo(); sLog.outString("Loading Equipment templates..."); - sObjectMgr.LoadEquipmentTemplates(); + sObjectMgr->LoadEquipmentTemplates(); sLog.outString("Loading Creature templates..."); - sObjectMgr.LoadCreatureTemplates(); + sObjectMgr->LoadCreatureTemplates(); sLog.outString("Loading Vehicle scaling information..."); - sObjectMgr.LoadVehicleScaling(); + sObjectMgr->LoadVehicleScaling(); sLog.outString("Loading Reputation Reward Rates..."); - sObjectMgr.LoadReputationRewardRate(); + sObjectMgr->LoadReputationRewardRate(); sLog.outString("Loading Creature Reputation OnKill Data..."); - sObjectMgr.LoadReputationOnKill(); + sObjectMgr->LoadReputationOnKill(); sLog.outString( "Loading Reputation Spillover Data..." ); - sObjectMgr.LoadReputationSpilloverTemplate(); + sObjectMgr->LoadReputationSpilloverTemplate(); sLog.outString("Loading Points Of Interest Data..."); - sObjectMgr.LoadPointsOfInterest(); + sObjectMgr->LoadPointsOfInterest(); sLog.outString("Loading Creature Base Stats..."); - sObjectMgr.LoadCreatureClassLevelStats(); + sObjectMgr->LoadCreatureClassLevelStats(); sLog.outString("Loading Creature Data..."); - sObjectMgr.LoadCreatures(); + sObjectMgr->LoadCreatures(); sLog.outString("Loading Creature Linked Respawn..."); - sObjectMgr.LoadCreatureLinkedRespawn(); // must be after LoadCreatures() + sObjectMgr->LoadCreatureLinkedRespawn(); // must be after LoadCreatures() sLog.outString("Loading pet levelup spells..."); - sSpellMgr.LoadPetLevelupSpellMap(); + sSpellMgr->LoadPetLevelupSpellMap(); sLog.outString("Loading pet default spells additional to levelup spells..."); - sSpellMgr.LoadPetDefaultSpells(); + sSpellMgr->LoadPetDefaultSpells(); sLog.outString("Loading Creature Template Addon Data..."); - sObjectMgr.LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures() + sObjectMgr->LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures() sLog.outString("Loading Vehicle Accessories..."); - sObjectMgr.LoadVehicleAccessories(); // must be after LoadCreatureTemplates() + sObjectMgr->LoadVehicleAccessories(); // must be after LoadCreatureTemplates() sLog.outString("Loading Creature Respawn Data..."); // must be after PackInstances() - sObjectMgr.LoadCreatureRespawnTimes(); + sObjectMgr->LoadCreatureRespawnTimes(); sLog.outString("Loading Gameobject Data..."); - sObjectMgr.LoadGameobjects(); + sObjectMgr->LoadGameobjects(); sLog.outString("Loading Gameobject Respawn Data..."); // must be after PackInstances() - sObjectMgr.LoadGameobjectRespawnTimes(); + sObjectMgr->LoadGameobjectRespawnTimes(); sLog.outString("Loading Objects Pooling Data..."); // TODOLEAK: scope - sPoolMgr.LoadFromDB(); + sPoolMgr->LoadFromDB(); sLog.outString("Loading Weather Data..."); - sWeatherMgr.LoadWeatherData(); + sWeatherMgr->LoadWeatherData(); sLog.outString("Loading Quests..."); - sObjectMgr.LoadQuests(); // must be loaded after DBCs, creature_template, item_template, gameobject tables + sObjectMgr->LoadQuests(); // must be loaded after DBCs, creature_template, item_template, gameobject tables sLog.outString("Checking Quest Disables"); - sDisableMgr.CheckQuestDisables(); // must be after loading quests + sDisableMgr->CheckQuestDisables(); // must be after loading quests sLog.outString("Loading Quest POI"); - sObjectMgr.LoadQuestPOI(); + sObjectMgr->LoadQuestPOI(); sLog.outString("Loading Quests Relations..."); - sObjectMgr.LoadQuestRelations(); // must be after quest load + sObjectMgr->LoadQuestRelations(); // must be after quest load sLog.outString("Loading Quest Pooling Data..."); - sPoolMgr.LoadQuestPools(); + sPoolMgr->LoadQuestPools(); sLog.outString("Loading Game Event Data..."); // must be after loading pools fully - sGameEventMgr.LoadFromDB(); // TODOLEAK: add scopes + sGameEventMgr->LoadFromDB(); // TODOLEAK: add scopes sLog.outString("Loading Dungeon boss data..."); - sLFGMgr.LoadDungeonEncounters(); + sLFGMgr->LoadDungeonEncounters(); sLog.outString("Loading LFG rewards..."); - sLFGMgr.LoadRewards(); + sLFGMgr->LoadRewards(); sLog.outString("Loading UNIT_NPC_FLAG_SPELLCLICK Data..."); - sObjectMgr.LoadNPCSpellClickSpells(); + sObjectMgr->LoadNPCSpellClickSpells(); sLog.outString("Loading SpellArea Data..."); // must be after quest load - sSpellMgr.LoadSpellAreas(); + sSpellMgr->LoadSpellAreas(); sLog.outString("Loading AreaTrigger definitions..."); - sObjectMgr.LoadAreaTriggerTeleports(); + sObjectMgr->LoadAreaTriggerTeleports(); sLog.outString("Loading Access Requirements..."); - sObjectMgr.LoadAccessRequirements(); // must be after item template load + sObjectMgr->LoadAccessRequirements(); // must be after item template load sLog.outString("Loading Quest Area Triggers..."); - sObjectMgr.LoadQuestAreaTriggers(); // must be after LoadQuests + sObjectMgr->LoadQuestAreaTriggers(); // must be after LoadQuests sLog.outString("Loading Tavern Area Triggers..."); - sObjectMgr.LoadTavernAreaTriggers(); + sObjectMgr->LoadTavernAreaTriggers(); sLog.outString("Loading AreaTrigger script names..."); - sObjectMgr.LoadAreaTriggerScripts(); + sObjectMgr->LoadAreaTriggerScripts(); sLog.outString("Loading Graveyard-zone links..."); - sObjectMgr.LoadGraveyardZones(); + sObjectMgr->LoadGraveyardZones(); sLog.outString("Loading spell pet auras..."); - sSpellMgr.LoadSpellPetAuras(); + sSpellMgr->LoadSpellPetAuras(); sLog.outString("Loading spell extra attributes..."); - sSpellMgr.LoadSpellCustomAttr(); + sSpellMgr->LoadSpellCustomAttr(); sLog.outString("Loading Spell target coordinates..."); - sSpellMgr.LoadSpellTargetPositions(); + sSpellMgr->LoadSpellTargetPositions(); sLog.outString("Loading enchant custom attributes..."); - sSpellMgr.LoadEnchantCustomAttr(); + sSpellMgr->LoadEnchantCustomAttr(); sLog.outString("Loading linked spells..."); - sSpellMgr.LoadSpellLinked(); + sSpellMgr->LoadSpellLinked(); sLog.outString("Loading Player Create Data..."); - sObjectMgr.LoadPlayerInfo(); + sObjectMgr->LoadPlayerInfo(); sLog.outString("Loading Exploration BaseXP Data..."); - sObjectMgr.LoadExplorationBaseXP(); + sObjectMgr->LoadExplorationBaseXP(); sLog.outString("Loading Pet Name Parts..."); - sObjectMgr.LoadPetNames(); + sObjectMgr->LoadPetNames(); CharacterDatabaseCleaner::CleanDatabase(); sLog.outString("Loading the max pet number..."); - sObjectMgr.LoadPetNumber(); + sObjectMgr->LoadPetNumber(); sLog.outString("Loading pet level stats..."); - sObjectMgr.LoadPetLevelInfo(); + sObjectMgr->LoadPetLevelInfo(); sLog.outString("Loading Player Corpses..."); - sObjectMgr.LoadCorpses(); + sObjectMgr->LoadCorpses(); sLog.outString("Loading Player level dependent mail rewards..."); - sObjectMgr.LoadMailLevelRewards(); + sObjectMgr->LoadMailLevelRewards(); // Loot tables LoadLootTables(); //TODOLEAK: untangle that shit @@ -1474,138 +1474,138 @@ void World::SetInitialWorldSettings() LoadSkillExtraItemTable(); sLog.outString("Loading Skill Fishing base level requirements..."); - sObjectMgr.LoadFishingBaseSkillLevel(); + sObjectMgr->LoadFishingBaseSkillLevel(); sLog.outString("Loading Achievements..."); - sAchievementMgr.LoadAchievementReferenceList(); + sAchievementMgr->LoadAchievementReferenceList(); sLog.outString("Loading Achievement Criteria Lists..."); - sAchievementMgr.LoadAchievementCriteriaList(); + sAchievementMgr->LoadAchievementCriteriaList(); sLog.outString("Loading Achievement Criteria Data..."); - sAchievementMgr.LoadAchievementCriteriaData(); + sAchievementMgr->LoadAchievementCriteriaData(); sLog.outString("Loading Achievement Rewards..."); - sAchievementMgr.LoadRewards(); + sAchievementMgr->LoadRewards(); sLog.outString("Loading Achievement Reward Locales..."); - sAchievementMgr.LoadRewardLocales(); + sAchievementMgr->LoadRewardLocales(); sLog.outString("Loading Completed Achievements..."); - sAchievementMgr.LoadCompletedAchievements(); + sAchievementMgr->LoadCompletedAchievements(); ///- Load dynamic data tables from the database sLog.outString("Loading Item Auctions..."); - sAuctionMgr.LoadAuctionItems(); + sAuctionMgr->LoadAuctionItems(); sLog.outString("Loading Auctions..."); - sAuctionMgr.LoadAuctions(); + sAuctionMgr->LoadAuctions(); - sObjectMgr.LoadGuilds(); + sObjectMgr->LoadGuilds(); sLog.outString("Loading ArenaTeams..."); - sObjectMgr.LoadArenaTeams(); + sObjectMgr->LoadArenaTeams(); sLog.outString("Loading Groups..."); - sObjectMgr.LoadGroups(); + sObjectMgr->LoadGroups(); sLog.outString("Loading ReservedNames..."); - sObjectMgr.LoadReservedPlayersNames(); + sObjectMgr->LoadReservedPlayersNames(); sLog.outString("Loading GameObjects for quests..."); - sObjectMgr.LoadGameObjectForQuests(); + sObjectMgr->LoadGameObjectForQuests(); sLog.outString("Loading BattleMasters..."); - sBattlegroundMgr.LoadBattleMastersEntry(); + sBattlegroundMgr->LoadBattleMastersEntry(); sLog.outString("Loading GameTeleports..."); - sObjectMgr.LoadGameTele(); + sObjectMgr->LoadGameTele(); sLog.outString("Loading Npc Text Id..."); - sObjectMgr.LoadNpcTextId(); // must be after load Creature and NpcText + sObjectMgr->LoadNpcTextId(); // must be after load Creature and NpcText - sObjectMgr.LoadGossipScripts(); // must be before gossip menu options + sObjectMgr->LoadGossipScripts(); // must be before gossip menu options sLog.outString("Loading Gossip menu..."); - sObjectMgr.LoadGossipMenu(); + sObjectMgr->LoadGossipMenu(); sLog.outString("Loading Gossip menu options..."); - sObjectMgr.LoadGossipMenuItems(); + sObjectMgr->LoadGossipMenuItems(); sLog.outString("Loading Vendors..."); - sObjectMgr.LoadVendors(); // must be after load CreatureTemplate and ItemTemplate + sObjectMgr->LoadVendors(); // must be after load CreatureTemplate and ItemTemplate sLog.outString("Loading Trainers..."); - sObjectMgr.LoadTrainerSpell(); // must be after load CreatureTemplate + sObjectMgr->LoadTrainerSpell(); // must be after load CreatureTemplate sLog.outString("Loading Waypoints..."); sWaypointMgr->Load(); sLog.outString("Loading SmartAI Waypoints..."); - sSmartWaypointMgr.LoadFromDB(); + sSmartWaypointMgr->LoadFromDB(); sLog.outString("Loading Creature Formations..."); formation_mgr.LoadCreatureFormations(); sLog.outString("Loading Conditions..."); - sConditionMgr.LoadConditions(); + sConditionMgr->LoadConditions(); sLog.outString("Loading faction change achievement pairs..."); - sObjectMgr.LoadFactionChangeAchievements(); + sObjectMgr->LoadFactionChangeAchievements(); sLog.outString("Loading faction change spell pairs..."); - sObjectMgr.LoadFactionChangeSpells(); + sObjectMgr->LoadFactionChangeSpells(); sLog.outString("Loading faction change item pairs..."); - sObjectMgr.LoadFactionChangeItems(); + sObjectMgr->LoadFactionChangeItems(); sLog.outString("Loading faction change reputation pairs..."); - sObjectMgr.LoadFactionChangeReputations(); + sObjectMgr->LoadFactionChangeReputations(); sLog.outString("Loading GM tickets..."); - sTicketMgr.LoadGMTickets(); + sTicketMgr->LoadGMTickets(); sLog.outString("Loading GM surveys..."); - sTicketMgr.LoadGMSurveys(); + sTicketMgr->LoadGMSurveys(); sLog.outString("Loading client addons..."); - sAddonMgr.LoadFromDB(); + sAddonMgr->LoadFromDB(); ///- Handle outdated emails (delete/return) sLog.outString("Returning old mails..."); - sObjectMgr.ReturnOrDeleteOldMails(false); + sObjectMgr->ReturnOrDeleteOldMails(false); sLog.outString("Loading Autobroadcasts..."); LoadAutobroadcasts(); ///- Load and initialize scripts - sObjectMgr.LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate - sObjectMgr.LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate - sObjectMgr.LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data) - sObjectMgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data) - sObjectMgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data) - sObjectMgr.LoadWaypointScripts(); + sObjectMgr->LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate + sObjectMgr->LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate + sObjectMgr->LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data) + sObjectMgr->LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data) + sObjectMgr->LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data) + sObjectMgr->LoadWaypointScripts(); sLog.outString("Loading Scripts text locales..."); // must be after Load*Scripts calls - sObjectMgr.LoadDbScriptStrings(); + sObjectMgr->LoadDbScriptStrings(); sLog.outString("Loading CreatureEventAI Texts..."); - sEventAIMgr.LoadCreatureEventAI_Texts(); + sEventAIMgr->LoadCreatureEventAI_Texts(); sLog.outString("Loading CreatureEventAI Summons..."); - sEventAIMgr.LoadCreatureEventAI_Summons(); + sEventAIMgr->LoadCreatureEventAI_Summons(); sLog.outString("Loading CreatureEventAI Scripts..."); - sEventAIMgr.LoadCreatureEventAI_Scripts(); + sEventAIMgr->LoadCreatureEventAI_Scripts(); sLog.outString("Loading spell script names..."); - sObjectMgr.LoadSpellScriptNames(); + sObjectMgr->LoadSpellScriptNames(); sLog.outString("Loading Creature Texts..."); - sCreatureTextMgr.LoadCreatureTexts(); + sCreatureTextMgr->LoadCreatureTexts(); sLog.outString("Initializing Scripts..."); - sScriptMgr.Initialize(); //LEAKTODO + sScriptMgr->Initialize(); //LEAKTODO sLog.outString("Validating spell scripts..."); - sObjectMgr.ValidateSpellScripts(); + sObjectMgr->ValidateSpellScripts(); sLog.outString("Loading SmartAI scripts..."); - sSmartScriptMgr.LoadSmartAIFromDB(); + sSmartScriptMgr->LoadSmartAIFromDB(); ///- Initialize game time and timers sLog.outDebug("DEBUG:: Initialize game time and timers"); @@ -1653,10 +1653,10 @@ void World::SetInitialWorldSettings() ///- Initialize MapManager sLog.outString("Starting Map System"); - sMapMgr.Initialize(); + sMapMgr->Initialize(); sLog.outString("Starting Game Event system..."); - uint32 nextGameEvent = sGameEventMgr.Initialize(); + uint32 nextGameEvent = sGameEventMgr->Initialize(); m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event // Delete all characters which have been deleted X days before @@ -1666,33 +1666,33 @@ void World::SetInitialWorldSettings() Channel::CleanOldChannelsInDB(); sLog.outString("Starting Arena Season..."); - sGameEventMgr.StartArenaSeason(); + sGameEventMgr->StartArenaSeason(); - sTicketMgr.Initialize(); + sTicketMgr->Initialize(); sLog.outString("Loading World States..."); // must be loaded before battleground and outdoor PvP LoadWorldStates(); ///- Initialize Battlegrounds sLog.outString("Starting Battleground System"); - sBattlegroundMgr.CreateInitialBattlegrounds(); - sBattlegroundMgr.InitAutomaticArenaPointDistribution(); + sBattlegroundMgr->CreateInitialBattlegrounds(); + sBattlegroundMgr->InitAutomaticArenaPointDistribution(); ///- Initialize outdoor pvp sLog.outString("Starting Outdoor PvP System"); - sOutdoorPvPMgr.InitOutdoorPvP(); + sOutdoorPvPMgr->InitOutdoorPvP(); sLog.outString("Loading Transports..."); - sMapMgr.LoadTransports(); + sMapMgr->LoadTransports(); sLog.outString("Loading Transport NPCs..."); - sMapMgr.LoadTransportNPCs(); + sMapMgr->LoadTransportNPCs(); sLog.outString("Deleting expired bans..."); LoginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate"); sLog.outString("Starting objects Pooling system..."); - sPoolMgr.Initialize(); + sPoolMgr->Initialize(); sLog.outString("Calculate next daily quest reset time..."); InitDailyQuestResetTime(); @@ -1876,11 +1876,11 @@ void World::Update(uint32 diff) if (++mail_timer > mail_timer_expires) { mail_timer = 0; - sObjectMgr.ReturnOrDeleteOldMails(true); + sObjectMgr->ReturnOrDeleteOldMails(true); } ///- Handle expired auctions - sAuctionMgr.Update(); + sAuctionMgr->Update(); } /// <li> Handle session updates when the timer has passed @@ -1892,7 +1892,7 @@ void World::Update(uint32 diff) if (m_timers[WUPDATE_WEATHERS].Passed()) { m_timers[WUPDATE_WEATHERS].Reset(); - sWeatherMgr.Update(uint32(m_timers[WUPDATE_WEATHERS].GetInterval())); + sWeatherMgr->Update(uint32(m_timers[WUPDATE_WEATHERS].GetInterval())); } /// <li> Update uptime table @@ -1918,7 +1918,7 @@ void World::Update(uint32 diff) /// <li> Handle all other objects ///- Update objects when the timer has passed (maps, transport, creatures,...) - sMapMgr.Update(diff); // As interval = 0 + sMapMgr->Update(diff); // As interval = 0 if (sWorld.getBoolConfig(CONFIG_AUTOBROADCAST)) { @@ -1929,10 +1929,10 @@ void World::Update(uint32 diff) } } - sBattlegroundMgr.Update(diff); + sBattlegroundMgr->Update(diff); RecordTimeDiff("UpdateBattlegroundMgr"); - sOutdoorPvPMgr.Update(diff); + sOutdoorPvPMgr->Update(diff); RecordTimeDiff("UpdateOutdoorPvPMgr"); ///- Delete all characters which have been deleted X days before @@ -1942,7 +1942,7 @@ void World::Update(uint32 diff) Player::DeleteOldCharacters(); } - sLFGMgr.Update(diff); + sLFGMgr->Update(diff); RecordTimeDiff("UpdateLFGMgr"); // execute callbacks from sql queries that were queued recently @@ -1960,7 +1960,7 @@ void World::Update(uint32 diff) if (m_timers[WUPDATE_EVENTS].Passed()) { m_timers[WUPDATE_EVENTS].Reset(); // to give time for Update() to be processed - uint32 nextGameEvent = sGameEventMgr.Update(); + uint32 nextGameEvent = sGameEventMgr->Update(); m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); m_timers[WUPDATE_EVENTS].Reset(); } @@ -1976,18 +1976,18 @@ void World::Update(uint32 diff) } // update the instance reset times - sInstanceSaveMgr.Update(); + sInstanceSaveMgr->Update(); // And last, but not least handle the issued cli commands ProcessCliCommands(); - sScriptMgr.OnWorldUpdate(diff); + sScriptMgr->OnWorldUpdate(diff); } void World::ForceGameEventUpdate() { m_timers[WUPDATE_EVENTS].Reset(); // to give time for Update() to be processed - uint32 nextGameEvent = sGameEventMgr.Update(); + uint32 nextGameEvent = sGameEventMgr->Update(); m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); m_timers[WUPDATE_EVENTS].Reset(); } @@ -2036,7 +2036,7 @@ namespace Trinity explicit WorldWorldTextBuilder(int32 textId, va_list* args = NULL) : i_textId(textId), i_args(args) {} void operator()(WorldPacketList& data_list, LocaleConstant loc_idx) { - char const* text = sObjectMgr.GetTrinityString(i_textId,loc_idx); + char const* text = sObjectMgr->GetTrinityString(i_textId,loc_idx); if (i_args) { @@ -2280,9 +2280,9 @@ bool World::RemoveBanAccount(BanMode mode, std::string nameOrIP) { uint32 account = 0; if (mode == BAN_ACCOUNT) - account = sAccountMgr.GetId(nameOrIP); + account = sAccountMgr->GetId(nameOrIP); else if (mode == BAN_CHARACTER) - account = sObjectMgr.GetPlayerAccountIdByPlayerName(nameOrIP); + account = sObjectMgr->GetPlayerAccountIdByPlayerName(nameOrIP); if (!account) return false; @@ -2298,7 +2298,7 @@ bool World::RemoveBanAccount(BanMode mode, std::string nameOrIP) /// Ban an account or ban an IP address, duration will be parsed using TimeStringToSecs if it is positive, otherwise permban BanReturn World::BanCharacter(std::string name, std::string duration, std::string reason, std::string author) { - Player *pBanned = sObjectMgr.GetPlayer(name.c_str()); + Player *pBanned = sObjectMgr->GetPlayer(name.c_str()); uint32 guid = 0; uint32 duration_secs = TimeStringToSecs(duration); @@ -2339,7 +2339,7 @@ BanReturn World::BanCharacter(std::string name, std::string duration, std::strin /// Remove a ban from a character bool World::RemoveBanCharacter(std::string name) { - Player *pBanned = sObjectMgr.GetPlayer(name.c_str()); + Player *pBanned = sObjectMgr->GetPlayer(name.c_str()); uint32 guid = 0; /// Pick a player to ban if not online @@ -2420,7 +2420,7 @@ void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode) ShutdownMsg(true); } - sScriptMgr.OnShutdownInitiate(ShutdownExitCode(exitcode), ShutdownMask(options)); + sScriptMgr->OnShutdownInitiate(ShutdownExitCode(exitcode), ShutdownMask(options)); } /// Display a shutdown message to the user(s) @@ -2464,7 +2464,7 @@ void World::ShutdownCancel() sLog.outStaticDebug("Server %s cancelled.",(m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown")); - sScriptMgr.OnShutdownCancel(); + sScriptMgr->OnShutdownCancel(); } /// Send a server message to the user(s) @@ -2659,7 +2659,7 @@ void World::ResetDailyQuests() itr->second->GetPlayer()->ResetDailyQuestStatus(); // change available dailies - sPoolMgr.ChangeDailyQuests(); + sPoolMgr->ChangeDailyQuests(); } void World::LoadDBAllowedSecurityLevel() @@ -2689,7 +2689,7 @@ void World::ResetWeeklyQuests() sWorld.setWorldState(WS_WEEKLY_QUEST_RESET_TIME, uint64(m_NextWeeklyQuestReset)); // change available weeklies - sPoolMgr.ChangeWeeklyQuests(); + sPoolMgr->ChangeWeeklyQuests(); } void World::ResetRandomBG() diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 8641d70ceb4..122d034e86e 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -99,11 +99,11 @@ public: if (!szAcc || !szPassword) return false; - // normalized in sAccountMgr.CreateAccount + // normalized in sAccountMgr->CreateAccount std::string account_name = szAcc; std::string password = szPassword; - AccountOpResult result = sAccountMgr.CreateAccount(account_name, password); + AccountOpResult result = sAccountMgr->CreateAccount(account_name, password); switch(result) { case AOR_OK: @@ -150,7 +150,7 @@ public: return false; } - uint32 account_id = sAccountMgr.GetId(account_name); + uint32 account_id = sAccountMgr->GetId(account_name); if (!account_id) { handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str()); @@ -164,7 +164,7 @@ public: if (handler->HasLowerSecurityAccount (NULL,account_id,true)) return false; - AccountOpResult result = sAccountMgr.DeleteAccount(account_id); + AccountOpResult result = sAccountMgr->DeleteAccount(account_id); switch(result) { case AOR_OK: @@ -286,7 +286,7 @@ public: std::string password_new = new_pass; std::string password_new_c = new_pass_c; - if (!sAccountMgr.CheckPassword(handler->GetSession()->GetAccountId(), password_old)) + if (!sAccountMgr->CheckPassword(handler->GetSession()->GetAccountId(), password_old)) { handler->SendSysMessage(LANG_COMMAND_WRONGOLDPASSWORD); handler->SetSentErrorMessage(true); @@ -300,7 +300,7 @@ public: return false; } - AccountOpResult result = sAccountMgr.ChangePassword(handler->GetSession()->GetAccountId(), password_new); + AccountOpResult result = sAccountMgr->ChangePassword(handler->GetSession()->GetAccountId(), password_new); switch(result) { case AOR_OK: @@ -346,7 +346,7 @@ public: return false; account_id = player->GetSession()->GetAccountId(); - sAccountMgr.GetName(account_id,account_name); + sAccountMgr->GetName(account_id,account_name); szExp = szAcc; } else @@ -360,7 +360,7 @@ public: return false; } - account_id = sAccountMgr.GetId(account_name); + account_id = sAccountMgr->GetId(account_name); if (!account_id) { handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str()); @@ -433,17 +433,17 @@ public: } // handler->getSession() == NULL only for console - targetAccountId = (isAccountNameGiven) ? sAccountMgr.GetId(targetAccountName) : handler->getSelectedPlayer()->GetSession()->GetAccountId(); + targetAccountId = (isAccountNameGiven) ? sAccountMgr->GetId(targetAccountName) : handler->getSelectedPlayer()->GetSession()->GetAccountId(); int32 gmRealmID = (isAccountNameGiven) ? atoi(arg3) : atoi(arg2); uint32 plSecurity; if (handler->GetSession()) - plSecurity = sAccountMgr.GetSecurity(handler->GetSession()->GetAccountId(), gmRealmID); + plSecurity = sAccountMgr->GetSecurity(handler->GetSession()->GetAccountId(), gmRealmID); else plSecurity = SEC_CONSOLE; // can set security level only for target with less security and to less security that we have // This is also reject self apply in fact - targetSecurity = sAccountMgr.GetSecurity(targetAccountId, gmRealmID); + targetSecurity = sAccountMgr->GetSecurity(targetAccountId, gmRealmID); if (targetSecurity >= plSecurity || gm >= plSecurity) { handler->SendSysMessage(LANG_YOURS_SECURITY_IS_LOW); @@ -505,7 +505,7 @@ public: return false; } - uint32 targetAccountId = sAccountMgr.GetId(account_name); + uint32 targetAccountId = sAccountMgr->GetId(account_name); if (!targetAccountId) { handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str()); @@ -525,7 +525,7 @@ public: return false; } - AccountOpResult result = sAccountMgr.ChangePassword(targetAccountId, szPassword1); + AccountOpResult result = sAccountMgr->ChangePassword(targetAccountId, szPassword1); switch (result) { diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index cc041f08ced..bb3374234f3 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -723,13 +723,13 @@ public: static bool HandleDebugBattlegroundCommand(ChatHandler* /*handler*/, const char* /*args*/) { - sBattlegroundMgr.ToggleTesting(); + sBattlegroundMgr->ToggleTesting(); return true; } static bool HandleDebugArenaCommand(ChatHandler* /*handler*/, const char* /*args*/) { - sBattlegroundMgr.ToggleArenaTesting(); + sBattlegroundMgr->ToggleArenaTesting(); return true; } @@ -865,7 +865,7 @@ public: Map *map = handler->GetSession()->GetPlayer()->GetMap(); - if (!v->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_VEHICLE), map, handler->GetSession()->GetPlayer()->GetPhaseMask(), entry, id, handler->GetSession()->GetPlayer()->GetTeam(), x, y, z, o)) + if (!v->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_VEHICLE), map, handler->GetSession()->GetPlayer()->GetPhaseMask(), entry, id, handler->GetSession()->GetPlayer()->GetTeam(), x, y, z, o)) { delete v; return false; @@ -971,7 +971,7 @@ public: return false; handler->GetSession()->GetPlayer()->DestroyItem(i->GetBagSlot(), i->GetSlot(), true); - sScriptMgr.OnItemExpire(handler->GetSession()->GetPlayer(), i->GetProto()); + sScriptMgr->OnItemExpire(handler->GetSession()->GetPlayer(), i->GetProto()); return true; } diff --git a/src/server/scripts/Commands/cs_event.cpp b/src/server/scripts/Commands/cs_event.cpp index 2ef88bf8738..24721760460 100644 --- a/src/server/scripts/Commands/cs_event.cpp +++ b/src/server/scripts/Commands/cs_event.cpp @@ -53,8 +53,8 @@ public: { uint32 counter = 0; - GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap(); - GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr.GetActiveEventList(); + GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap(); + GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList(); char const* active = handler->GetTrinityString(LANG_ACTIVE); @@ -90,7 +90,7 @@ public: uint32 event_id = atoi(cId); - GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap(); + GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap(); if (event_id >=events.size()) { @@ -107,14 +107,14 @@ public: return false; } - GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr.GetActiveEventList(); + GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList(); bool active = activeEvents.find(event_id) != activeEvents.end(); char const* activeStr = active ? handler->GetTrinityString(LANG_ACTIVE) : ""; std::string startTimeStr = TimeToTimestampStr(eventData.start); std::string endTimeStr = TimeToTimestampStr(eventData.end); - uint32 delay = sGameEventMgr.NextCheck(event_id); + uint32 delay = sGameEventMgr->NextCheck(event_id); time_t nextTime = time(NULL)+delay; std::string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? TimeToTimestampStr(time(NULL)+delay) : "-"; @@ -139,7 +139,7 @@ public: int32 event_id = atoi(cId); - GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap(); + GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap(); if (event_id < 1 || uint32(event_id) >= events.size()) { @@ -156,7 +156,7 @@ public: return false; } - GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr.GetActiveEventList(); + GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList(); if (activeEvents.find(event_id) != activeEvents.end()) { handler->PSendSysMessage(LANG_EVENT_ALREADY_ACTIVE,event_id); @@ -164,7 +164,7 @@ public: return false; } - sGameEventMgr.StartEvent(event_id,true); + sGameEventMgr->StartEvent(event_id,true); return true; } @@ -180,7 +180,7 @@ public: int32 event_id = atoi(cId); - GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap(); + GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap(); if (event_id < 1 || uint32(event_id) >= events.size()) { @@ -197,7 +197,7 @@ public: return false; } - GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr.GetActiveEventList(); + GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList(); if (activeEvents.find(event_id) == activeEvents.end()) { @@ -206,7 +206,7 @@ public: return false; } - sGameEventMgr.StopEvent(event_id,true); + sGameEventMgr->StopEvent(event_id,true); return true; } }; diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index 7d4591fe70b..0007ad62e40 100644 --- a/src/server/scripts/Commands/cs_go.cpp +++ b/src/server/scripts/Commands/cs_go.cpp @@ -245,7 +245,7 @@ public: else _player->SaveRecallPosition(); - Map const *map = sMapMgr.CreateBaseMap(mapid); + Map const *map = sMapMgr->CreateBaseMap(mapid); float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y)); _player->TeleportTo(mapid, x, y, z, _player->GetOrientation()); @@ -272,7 +272,7 @@ public: int mapid; // by DB guid - if (GameObjectData const* go_data = sObjectMgr.GetGOData(guid)) + if (GameObjectData const* go_data = sObjectMgr->GetGOData(guid)) { x = go_data->posX; y = go_data->posY; @@ -433,7 +433,7 @@ public: // update to parent zone if exist (client map show only zones without parents) AreaTableEntry const* zoneEntry = areaEntry->zone ? GetAreaEntryByAreaID(areaEntry->zone) : areaEntry; - Map const *map = sMapMgr.CreateBaseMap(zoneEntry->mapid); + Map const *map = sMapMgr->CreateBaseMap(zoneEntry->mapid); if (map->Instanceable()) { @@ -506,7 +506,7 @@ public: else _player->SaveRecallPosition(); - Map const *map = sMapMgr.CreateBaseMap(mapid); + Map const *map = sMapMgr->CreateBaseMap(mapid); float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y)); _player->TeleportTo(mapid, x, y, z, _player->GetOrientation()); @@ -573,7 +573,7 @@ public: if (!ticket_id) return false; - GM_Ticket *ticket = sTicketMgr.GetGMTicket(ticket_id); + GM_Ticket *ticket = sTicketMgr->GetGMTicket(ticket_id); if (!ticket) { handler->SendSysMessage(LANG_COMMAND_TICKETNOTEXIST); diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 866deba41e3..f36a876abdc 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -85,7 +85,7 @@ public: GameObject* obj = NULL; // by DB guid - if (GameObjectData const* go_data = sObjectMgr.GetGOData(lowguid)) + if (GameObjectData const* go_data = sObjectMgr->GetGOData(lowguid)) obj = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id); if (!obj) @@ -147,7 +147,7 @@ public: Map *map = chr->GetMap(); GameObject* pGameObj = new GameObject; - uint32 db_lowGUID = sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT); + uint32 db_lowGUID = sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT); if (!pGameObj->Create(db_lowGUID, gInfo->id, map, chr->GetPhaseMaskForSpawn(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY)) { @@ -177,7 +177,7 @@ public: map->Add(pGameObj); // TODO: is it really necessary to add both the real and DB table guid here ? - sObjectMgr.AddGameobjectToGrid(db_lowGUID, sObjectMgr.GetGOData(db_lowGUID)); + sObjectMgr->AddGameobjectToGrid(db_lowGUID, sObjectMgr->GetGOData(db_lowGUID)); handler->PSendSysMessage(LANG_GAMEOBJECT_ADD,id,gInfo->name,db_lowGUID,x,y,z); return true; @@ -219,7 +219,7 @@ public: { Player* pl = handler->GetSession()->GetPlayer(); QueryResult result; - GameEventMgr::ActiveEvents const& activeEventsList = sGameEventMgr.GetActiveEventList(); + GameEventMgr::ActiveEvents const& activeEventsList = sGameEventMgr->GetActiveEventList(); if (*args) { // number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r @@ -293,8 +293,8 @@ public: o = fields[5].GetFloat(); mapid = fields[6].GetUInt16(); phase = fields[7].GetUInt16(); - pool_id = sPoolMgr.IsPartOfAPool<GameObject>(lowguid); - if (!pool_id || sPoolMgr.IsSpawnedObject<GameObject>(lowguid)) + pool_id = sPoolMgr->IsPartOfAPool<GameObject>(lowguid); + if (!pool_id || sPoolMgr->IsSpawnedObject<GameObject>(lowguid)) found = true; } while (result->NextRow() && (!found)); @@ -345,7 +345,7 @@ public: GameObject* obj = NULL; // by DB guid - if (GameObjectData const* go_data = sObjectMgr.GetGOData(lowguid)) + if (GameObjectData const* go_data = sObjectMgr->GetGOData(lowguid)) obj = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id); if (!obj) @@ -393,7 +393,7 @@ public: GameObject* obj = NULL; // by DB guid - if (GameObjectData const* go_data = sObjectMgr.GetGOData(lowguid)) + if (GameObjectData const* go_data = sObjectMgr->GetGOData(lowguid)) obj = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id); if (!obj) @@ -444,7 +444,7 @@ public: GameObject* obj = NULL; // by DB guid - if (GameObjectData const* go_data = sObjectMgr.GetGOData(lowguid)) + if (GameObjectData const* go_data = sObjectMgr->GetGOData(lowguid)) obj = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id); if (!obj) @@ -509,7 +509,7 @@ public: GameObject* obj = NULL; // by DB guid - if (GameObjectData const* go_data = sObjectMgr.GetGOData(lowguid)) + if (GameObjectData const* go_data = sObjectMgr->GetGOData(lowguid)) obj = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id); if (!obj) @@ -624,7 +624,7 @@ public: GameObject* gobj = NULL; - if (GameObjectData const* goData = sObjectMgr.GetGOData(lowguid)) + if (GameObjectData const* goData = sObjectMgr->GetGOData(lowguid)) gobj = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid, goData->id); if (!gobj) diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index 750395ff67c..eabfc4f3b2b 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -110,7 +110,7 @@ public: else targetPlayer->learnSpell(spell, false); - uint32 first_spell = sSpellMgr.GetFirstSpellInChain(spell); + uint32 first_spell = sSpellMgr->GetFirstSpellInChain(spell); if (GetTalentSpellCost(first_spell)) targetPlayer->SendTalentsInfoData(false); @@ -814,7 +814,7 @@ public: continue; // skip spells with first rank learned as talent (and all talents then also) - uint32 first_rank = sSpellMgr.GetFirstSpellInChain(spellInfo->Id); + uint32 first_rank = sSpellMgr->GetFirstSpellInChain(spellInfo->Id); if (GetTalentSpellCost(first_rank) > 0) continue; diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 32586f0c9c6..99e8d06e204 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1320,7 +1320,7 @@ public: return false; } - PlayerInfo const* info = sObjectMgr.GetPlayerInfo(target->getRace(), target->getClass()); + PlayerInfo const* info = sObjectMgr->GetPlayerInfo(target->getRace(), target->getClass()); if (!info) return false; diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index dff80798a99..3a45f774672 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -137,7 +137,7 @@ public: } Creature* pCreature = new Creature; - if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, (uint32)teamval, x, y, z, o)) + if (!pCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, (uint32)teamval, x, y, z, o)) { delete pCreature; return false; @@ -151,7 +151,7 @@ public: pCreature->LoadFromDB(db_guid, map); map->Add(pCreature); - sObjectMgr.AddCreatureToGrid(db_guid, sObjectMgr.GetCreatureData(db_guid)); + sObjectMgr->AddCreatureToGrid(db_guid, sObjectMgr->GetCreatureData(db_guid)); return true; } @@ -193,13 +193,13 @@ public: uint32 vendor_entry = vendor ? vendor->GetEntry() : 0; - if (!sObjectMgr.IsVendorItemValid(vendor_entry,itemId,maxcount,incrtime,extendedcost,handler->GetSession()->GetPlayer())) + if (!sObjectMgr->IsVendorItemValid(vendor_entry,itemId,maxcount,incrtime,extendedcost,handler->GetSession()->GetPlayer())) { handler->SetSentErrorMessage(true); return false; } - sObjectMgr.AddVendorItem(vendor_entry,itemId,maxcount,incrtime,extendedcost); + sObjectMgr->AddVendorItem(vendor_entry,itemId,maxcount,incrtime,extendedcost); ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(itemId); @@ -228,7 +228,7 @@ public: // attempt check creature existence by DB data if (!pCreature) { - CreatureData const* data = sObjectMgr.GetCreatureData(lowguid); + CreatureData const* data = sObjectMgr->GetCreatureData(lowguid); if (!data) { handler->PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid); @@ -335,7 +335,7 @@ public: { if (((Pet*)pCreature)->getPetType() == HUNTER_PET) { - pCreature->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(lvl)/4); + pCreature->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr->GetXPForLevel(lvl)/4); pCreature->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0); } ((Pet*)pCreature)->GivePetLevel(lvl); @@ -366,7 +366,7 @@ public: if (!lowguid) return false; - if (CreatureData const* cr_data = sObjectMgr.GetCreatureData(lowguid)) + if (CreatureData const* cr_data = sObjectMgr->GetCreatureData(lowguid)) unit = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(lowguid, cr_data->id, HIGHGUID_UNIT)); } else @@ -412,7 +412,7 @@ public: } uint32 itemId = atol(pitem); - if (!sObjectMgr.RemoveVendorItem(vendor->GetEntry(),itemId)) + if (!sObjectMgr->RemoveVendorItem(vendor->GetEntry(),itemId)) { handler->PSendSysMessage(LANG_ITEM_NOT_IN_LIST,itemId); handler->SetSentErrorMessage(true); @@ -548,7 +548,7 @@ public: handler->PSendSysMessage(LANG_NPCINFO_POSITION,float(target->GetPositionX()), float(target->GetPositionY()), float(target->GetPositionZ())); if (const CreatureData* const linked = target->GetLinkedRespawnCreatureData()) if (CreatureInfo const *master = GetCreatureInfo(linked->id)) - handler->PSendSysMessage(LANG_NPCINFO_LINKGUID, sObjectMgr.GetLinkedRespawnGuid(target->GetDBTableGUIDLow()), linked->id, master->Name); + handler->PSendSysMessage(LANG_NPCINFO_LINKGUID, sObjectMgr->GetLinkedRespawnGuid(target->GetDBTableGUIDLow()), linked->id, master->Name); if ((npcflags & UNIT_NPC_FLAG_VENDOR)) { @@ -586,7 +586,7 @@ public: // Attempting creature load from DB data if (!pCreature) { - CreatureData const* data = sObjectMgr.GetCreatureData(lowguid); + CreatureData const* data = sObjectMgr->GetCreatureData(lowguid); if (!data) { handler->PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid); @@ -620,7 +620,7 @@ public: if (pCreature) { - if (CreatureData const* data = sObjectMgr.GetCreatureData(pCreature->GetDBTableGUIDLow())) + if (CreatureData const* data = sObjectMgr->GetCreatureData(pCreature->GetDBTableGUIDLow())) { const_cast<CreatureData*>(data)->posX = x; const_cast<CreatureData*>(data)->posY = y; @@ -773,7 +773,7 @@ public: // attempt check creature existence by DB data if (!pCreature) { - CreatureData const* data = sObjectMgr.GetCreatureData(lowguid); + CreatureData const* data = sObjectMgr->GetCreatureData(lowguid); if (!data) { handler->PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid); @@ -1044,7 +1044,7 @@ public: uint64 receiver_guid= atol(receiver_str); // check online security - if (handler->HasLowerSecurity(sObjectMgr.GetPlayer(receiver_guid), 0)) + if (handler->HasLowerSecurity(sObjectMgr->GetPlayer(receiver_guid), 0)) return false; pCreature->MonsterWhisper(text,receiver_guid); @@ -1259,7 +1259,7 @@ public: return false; } - if (!sObjectMgr.SetCreatureLinkedRespawn(pCreature->GetDBTableGUIDLow(), linkguid)) + if (!sObjectMgr->SetCreatureLinkedRespawn(pCreature->GetDBTableGUIDLow(), linkguid)) { handler->PSendSysMessage("Selected creature can't link with guid '%u'", linkguid); handler->SetSentErrorMessage(true); @@ -1377,7 +1377,7 @@ public: } pCreature->SetName(args); - uint32 idname = sObjectMgr.AddCreatureTemplate(pCreature->GetName()); + uint32 idname = sObjectMgr->AddCreatureTemplate(pCreature->GetName()); pCreature->SetUInt32Value(OBJECT_FIELD_ENTRY, idname); pCreature->SaveToDB(); @@ -1423,7 +1423,7 @@ public: return true; } - uint32 idname = sObjectMgr.AddCreatureSubName(pCreature->GetName(),args,pCreature->GetUInt32Value(UNIT_FIELD_DISPLAYID)); + uint32 idname = sObjectMgr->AddCreatureSubName(pCreature->GetName(),args,pCreature->GetUInt32Value(UNIT_FIELD_DISPLAYID)); pCreature->SetUInt32Value(OBJECT_FIELD_ENTRY, idname); pCreature->SaveToDB(); diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index 62984862ff9..a083b62f973 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -66,7 +66,7 @@ public: uint32 entry = atol(cId); - Quest const* pQuest = sObjectMgr.GetQuestTemplate(entry); + Quest const* pQuest = sObjectMgr->GetQuestTemplate(entry); if (!pQuest) { @@ -120,7 +120,7 @@ public: uint32 entry = atol(cId); - Quest const* pQuest = sObjectMgr.GetQuestTemplate(entry); + Quest const* pQuest = sObjectMgr->GetQuestTemplate(entry); if (!pQuest) { @@ -170,7 +170,7 @@ public: uint32 entry = atol(cId); - Quest const* pQuest = sObjectMgr.GetQuestTemplate(entry); + Quest const* pQuest = sObjectMgr->GetQuestTemplate(entry); // If player doesn't have the quest if (!pQuest || player->GetQuestStatus(entry) == QUEST_STATUS_NONE) diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index aeb507cf344..676daa6a22f 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -166,7 +166,7 @@ public: //reload commands static bool HandleReloadGMTicketsCommand(ChatHandler* /*handler*/, const char* /*args*/) { - sTicketMgr.LoadGMTickets(); + sTicketMgr->LoadGMTickets(); return true; } @@ -217,7 +217,7 @@ public: sLog.outString("Re-Loading Loot Tables..."); LoadLootTables(); handler->SendGlobalGMSysMessage("DB tables `*_loot_template` reloaded."); - sConditionMgr.LoadConditions(true); + sConditionMgr->LoadConditions(true); return true; } @@ -239,7 +239,7 @@ public: HandleReloadQuestTemplateCommand(handler,"a"); sLog.outString("Re-Loading Quests Relations..."); - sObjectMgr.LoadQuestRelations(); + sObjectMgr->LoadQuestRelations(); handler->SendGlobalGMSysMessage("DB tables `*_questrelation` and `*_involvedrelation` reloaded."); return true; } @@ -328,7 +328,7 @@ public: { sLog.outString("Re-Loading config settings..."); sWorld.LoadConfigSettings(true); - sMapMgr.InitializeVisibilityDistanceInfo(); + sMapMgr->InitializeVisibilityDistanceInfo(); handler->SendGlobalGMSysMessage("World config settings reloaded."); return true; } @@ -336,7 +336,7 @@ public: static bool HandleReloadAccessRequirementCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Access Requirement definitions..."); - sObjectMgr.LoadAccessRequirements(); + sObjectMgr->LoadAccessRequirements(); handler->SendGlobalGMSysMessage("DB table `access_requirement` reloaded."); return true; } @@ -344,7 +344,7 @@ public: static bool HandleReloadAchievementCriteriaDataCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Additional Achievement Criteria Data..."); - sAchievementMgr.LoadAchievementCriteriaData(); + sAchievementMgr->LoadAchievementCriteriaData(); handler->SendGlobalGMSysMessage("DB table `achievement_criteria_data` reloaded."); return true; } @@ -352,7 +352,7 @@ public: static bool HandleReloadAchievementRewardCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Achievement Reward Data..."); - sAchievementMgr.LoadRewards(); + sAchievementMgr->LoadRewards(); handler->SendGlobalGMSysMessage("DB table `achievement_reward` reloaded."); return true; } @@ -360,7 +360,7 @@ public: static bool HandleReloadAreaTriggerTavernCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Tavern Area Triggers..."); - sObjectMgr.LoadTavernAreaTriggers(); + sObjectMgr->LoadTavernAreaTriggers(); handler->SendGlobalGMSysMessage("DB table `areatrigger_tavern` reloaded."); return true; } @@ -368,7 +368,7 @@ public: static bool HandleReloadAreaTriggerTeleportCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading AreaTrigger teleport definitions..."); - sObjectMgr.LoadAreaTriggerTeleports(); + sObjectMgr->LoadAreaTriggerTeleports(); handler->SendGlobalGMSysMessage("DB table `areatrigger_teleport` reloaded."); return true; } @@ -391,7 +391,7 @@ public: static bool HandleReloadOnKillReputationCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading creature award reputation definitions..."); - sObjectMgr.LoadReputationOnKill(); + sObjectMgr->LoadReputationOnKill(); handler->SendGlobalGMSysMessage("DB table `creature_onkill_reputation` reloaded."); return true; } @@ -529,9 +529,9 @@ public: const_cast<CreatureInfo*>(cInfo)->equipmentId = fields[79].GetUInt32(); const_cast<CreatureInfo*>(cInfo)->MechanicImmuneMask = fields[80].GetUInt32(); const_cast<CreatureInfo*>(cInfo)->flags_extra = fields[81].GetUInt32(); - const_cast<CreatureInfo*>(cInfo)->ScriptID = sObjectMgr.GetScriptId(fields[82].GetCString()); + const_cast<CreatureInfo*>(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[82].GetCString()); - sObjectMgr.CheckCreatureTemplate(cInfo); + sObjectMgr->CheckCreatureTemplate(cInfo); handler->SendGlobalGMSysMessage("Creature template reloaded."); return true; @@ -540,7 +540,7 @@ public: static bool HandleReloadCreatureQuestRelationsCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Loading Quests Relations... (`creature_questrelation`)"); - sObjectMgr.LoadCreatureQuestRelations(); + sObjectMgr->LoadCreatureQuestRelations(); handler->SendGlobalGMSysMessage("DB table `creature_questrelation` (creature quest givers) reloaded."); return true; } @@ -548,7 +548,7 @@ public: static bool HandleReloadCreatureLinkedRespawnCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Loading Linked Respawns... (`creature_linked_respawn`)"); - sObjectMgr.LoadCreatureLinkedRespawn(); + sObjectMgr->LoadCreatureLinkedRespawn(); handler->SendGlobalGMSysMessage("DB table `creature_linked_respawn` (creature linked respawns) reloaded."); return true; } @@ -556,7 +556,7 @@ public: static bool HandleReloadCreatureQuestInvRelationsCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Loading Quests Relations... (`creature_involvedrelation`)"); - sObjectMgr.LoadCreatureInvolvedRelations(); + sObjectMgr->LoadCreatureInvolvedRelations(); handler->SendGlobalGMSysMessage("DB table `creature_involvedrelation` (creature quest takers) reloaded."); return true; } @@ -564,25 +564,25 @@ public: static bool HandleReloadGossipMenuCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading `gossip_menu` Table!"); - sObjectMgr.LoadGossipMenu(); + sObjectMgr->LoadGossipMenu(); handler->SendGlobalGMSysMessage("DB table `gossip_menu` reloaded."); - sConditionMgr.LoadConditions(true); + sConditionMgr->LoadConditions(true); return true; } static bool HandleReloadGossipMenuOptionCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading `gossip_menu_option` Table!"); - sObjectMgr.LoadGossipMenuItems(); + sObjectMgr->LoadGossipMenuItems(); handler->SendGlobalGMSysMessage("DB table `gossip_menu_option` reloaded."); - sConditionMgr.LoadConditions(true); + sConditionMgr->LoadConditions(true); return true; } static bool HandleReloadGOQuestRelationsCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Loading Quests Relations... (`gameobject_questrelation`)"); - sObjectMgr.LoadGameobjectQuestRelations(); + sObjectMgr->LoadGameobjectQuestRelations(); handler->SendGlobalGMSysMessage("DB table `gameobject_questrelation` (gameobject quest givers) reloaded."); return true; } @@ -590,7 +590,7 @@ public: static bool HandleReloadGOQuestInvRelationsCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Loading Quests Relations... (`gameobject_involvedrelation`)"); - sObjectMgr.LoadGameobjectInvolvedRelations(); + sObjectMgr->LoadGameobjectInvolvedRelations(); handler->SendGlobalGMSysMessage("DB table `gameobject_involvedrelation` (gameobject quest takers) reloaded."); return true; } @@ -598,7 +598,7 @@ public: static bool HandleReloadQuestAreaTriggersCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Quest Area Triggers..."); - sObjectMgr.LoadQuestAreaTriggers(); + sObjectMgr->LoadQuestAreaTriggers(); handler->SendGlobalGMSysMessage("DB table `areatrigger_involvedrelation` (quest area triggers) reloaded."); return true; } @@ -606,12 +606,12 @@ public: static bool HandleReloadQuestTemplateCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Quest Templates..."); - sObjectMgr.LoadQuests(); + sObjectMgr->LoadQuests(); handler->SendGlobalGMSysMessage("DB table `quest_template` (quest definitions) reloaded."); /// dependent also from `gameobject` but this table not reloaded anyway sLog.outString("Re-Loading GameObjects for quests..."); - sObjectMgr.LoadGameObjectForQuests(); + sObjectMgr->LoadGameObjectForQuests(); handler->SendGlobalGMSysMessage("Data GameObjects for quests reloaded."); return true; } @@ -622,7 +622,7 @@ public: LoadLootTemplates_Creature(); LootTemplates_Creature.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `creature_loot_template` reloaded."); - sConditionMgr.LoadConditions(true); + sConditionMgr->LoadConditions(true); return true; } @@ -632,7 +632,7 @@ public: LoadLootTemplates_Disenchant(); LootTemplates_Disenchant.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `disenchant_loot_template` reloaded."); - sConditionMgr.LoadConditions(true); + sConditionMgr->LoadConditions(true); return true; } @@ -642,7 +642,7 @@ public: LoadLootTemplates_Fishing(); LootTemplates_Fishing.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `fishing_loot_template` reloaded."); - sConditionMgr.LoadConditions(true); + sConditionMgr->LoadConditions(true); return true; } @@ -652,7 +652,7 @@ public: LoadLootTemplates_Gameobject(); LootTemplates_Gameobject.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `gameobject_loot_template` reloaded."); - sConditionMgr.LoadConditions(true); + sConditionMgr->LoadConditions(true); return true; } @@ -662,7 +662,7 @@ public: LoadLootTemplates_Item(); LootTemplates_Item.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `item_loot_template` reloaded."); - sConditionMgr.LoadConditions(true); + sConditionMgr->LoadConditions(true); return true; } @@ -672,7 +672,7 @@ public: LoadLootTemplates_Milling(); LootTemplates_Milling.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `milling_loot_template` reloaded."); - sConditionMgr.LoadConditions(true); + sConditionMgr->LoadConditions(true); return true; } @@ -682,7 +682,7 @@ public: LoadLootTemplates_Pickpocketing(); LootTemplates_Pickpocketing.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `pickpocketing_loot_template` reloaded."); - sConditionMgr.LoadConditions(true); + sConditionMgr->LoadConditions(true); return true; } @@ -692,7 +692,7 @@ public: LoadLootTemplates_Prospecting(); LootTemplates_Prospecting.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `prospecting_loot_template` reloaded."); - sConditionMgr.LoadConditions(true); + sConditionMgr->LoadConditions(true); return true; } @@ -702,7 +702,7 @@ public: LoadLootTemplates_Mail(); LootTemplates_Mail.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `mail_loot_template` reloaded."); - sConditionMgr.LoadConditions(true); + sConditionMgr->LoadConditions(true); return true; } @@ -711,7 +711,7 @@ public: sLog.outString("Re-Loading Loot Tables... (`reference_loot_template`)"); LoadLootTemplates_Reference(); handler->SendGlobalGMSysMessage("DB table `reference_loot_template` reloaded."); - sConditionMgr.LoadConditions(true); + sConditionMgr->LoadConditions(true); return true; } @@ -721,7 +721,7 @@ public: LoadLootTemplates_Skinning(); LootTemplates_Skinning.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `skinning_loot_template` reloaded."); - sConditionMgr.LoadConditions(true); + sConditionMgr->LoadConditions(true); return true; } @@ -731,14 +731,14 @@ public: LoadLootTemplates_Spell(); LootTemplates_Spell.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `spell_loot_template` reloaded."); - sConditionMgr.LoadConditions(true); + sConditionMgr->LoadConditions(true); return true; } static bool HandleReloadTrinityStringCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading trinity_string Table!"); - sObjectMgr.LoadTrinityStrings(); + sObjectMgr->LoadTrinityStrings(); handler->SendGlobalGMSysMessage("DB table `trinity_string` reloaded."); return true; } @@ -746,7 +746,7 @@ public: static bool HandleReloadNpcGossipCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading `npc_gossip` Table!"); - sObjectMgr.LoadNpcTextId(); + sObjectMgr->LoadNpcTextId(); handler->SendGlobalGMSysMessage("DB table `npc_gossip` reloaded."); return true; } @@ -754,7 +754,7 @@ public: static bool HandleReloadNpcTrainerCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading `npc_trainer` Table!"); - sObjectMgr.LoadTrainerSpell(); + sObjectMgr->LoadTrainerSpell(); handler->SendGlobalGMSysMessage("DB table `npc_trainer` reloaded."); return true; } @@ -762,7 +762,7 @@ public: static bool HandleReloadNpcVendorCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading `npc_vendor` Table!"); - sObjectMgr.LoadVendors(); + sObjectMgr->LoadVendors(); handler->SendGlobalGMSysMessage("DB table `npc_vendor` reloaded."); return true; } @@ -770,7 +770,7 @@ public: static bool HandleReloadPointsOfInterestCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading `points_of_interest` Table!"); - sObjectMgr.LoadPointsOfInterest(); + sObjectMgr->LoadPointsOfInterest(); handler->SendGlobalGMSysMessage("DB table `points_of_interest` reloaded."); return true; } @@ -778,7 +778,7 @@ public: static bool HandleReloadQuestPOICommand(ChatHandler* handler, const char* /*args*/) { sLog.outString( "Re-Loading Quest POI ..." ); - sObjectMgr.LoadQuestPOI(); + sObjectMgr->LoadQuestPOI(); handler->SendGlobalGMSysMessage("DB Table `quest_poi` and `quest_poi_points` reloaded."); return true; } @@ -786,7 +786,7 @@ public: static bool HandleReloadSpellClickSpellsCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading `npc_spellclick_spells` Table!"); - sObjectMgr.LoadNPCSpellClickSpells(); + sObjectMgr->LoadNPCSpellClickSpells(); handler->SendGlobalGMSysMessage("DB table `npc_spellclick_spells` reloaded."); return true; } @@ -794,7 +794,7 @@ public: static bool HandleReloadReservedNameCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Loading ReservedNames... (`reserved_name`)"); - sObjectMgr.LoadReservedPlayersNames(); + sObjectMgr->LoadReservedPlayersNames(); handler->SendGlobalGMSysMessage("DB table `reserved_name` (player reserved names) reloaded."); return true; } @@ -802,7 +802,7 @@ public: static bool HandleReloadReputationRewardRateCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString( "Re-Loading `reputation_reward_rate` Table!" ); - sObjectMgr.LoadReputationRewardRate(); + sObjectMgr->LoadReputationRewardRate(); handler->SendGlobalSysMessage("DB table `reputation_reward_rate` reloaded."); return true; } @@ -810,7 +810,7 @@ public: static bool HandleReloadReputationSpilloverTemplateCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString( "Re-Loading `reputation_spillover_template` Table!" ); - sObjectMgr.LoadReputationSpilloverTemplate(); + sObjectMgr->LoadReputationSpilloverTemplate(); handler->SendGlobalSysMessage("DB table `reputation_spillover_template` reloaded."); return true; } @@ -834,7 +834,7 @@ public: static bool HandleReloadSkillFishingBaseLevelCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Skill Fishing base level requirements..."); - sObjectMgr.LoadFishingBaseSkillLevel(); + sObjectMgr->LoadFishingBaseSkillLevel(); handler->SendGlobalGMSysMessage("DB table `skill_fishing_base_level` (fishing base level for zone/subzone) reloaded."); return true; } @@ -842,7 +842,7 @@ public: static bool HandleReloadSpellAreaCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading SpellArea Data..."); - sSpellMgr.LoadSpellAreas(); + sSpellMgr->LoadSpellAreas(); handler->SendGlobalGMSysMessage("DB table `spell_area` (spell dependences from area/quest/auras state) reloaded."); return true; } @@ -850,7 +850,7 @@ public: static bool HandleReloadSpellRequiredCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Spell Required Data... "); - sSpellMgr.LoadSpellRequired(); + sSpellMgr->LoadSpellRequired(); handler->SendGlobalGMSysMessage("DB table `spell_required` reloaded."); return true; } @@ -858,7 +858,7 @@ public: static bool HandleReloadSpellGroupsCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Spell Groups..."); - sSpellMgr.LoadSpellGroups(); + sSpellMgr->LoadSpellGroups(); handler->SendGlobalGMSysMessage("DB table `spell_group` (spell groups) reloaded."); return true; } @@ -866,7 +866,7 @@ public: static bool HandleReloadSpellLearnSpellCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Spell Learn Spells..."); - sSpellMgr.LoadSpellLearnSpells(); + sSpellMgr->LoadSpellLearnSpells(); handler->SendGlobalGMSysMessage("DB table `spell_learn_spell` reloaded."); return true; } @@ -874,7 +874,7 @@ public: static bool HandleReloadSpellLinkedSpellCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Spell Linked Spells..."); - sSpellMgr.LoadSpellLinked(); + sSpellMgr->LoadSpellLinked(); handler->SendGlobalGMSysMessage("DB table `spell_linked_spell` reloaded."); return true; } @@ -882,7 +882,7 @@ public: static bool HandleReloadSpellProcEventCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Spell Proc Event conditions..."); - sSpellMgr.LoadSpellProcEvents(); + sSpellMgr->LoadSpellProcEvents(); handler->SendGlobalGMSysMessage("DB table `spell_proc_event` (spell proc trigger requirements) reloaded."); return true; } @@ -890,7 +890,7 @@ public: static bool HandleReloadSpellBonusesCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Spell Bonus Data..."); - sSpellMgr.LoadSpellBonusess(); + sSpellMgr->LoadSpellBonusess(); handler->SendGlobalGMSysMessage("DB table `spell_bonus_data` (spell damage/healing coefficients) reloaded."); return true; } @@ -898,7 +898,7 @@ public: static bool HandleReloadSpellTargetPositionCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Spell target coordinates..."); - sSpellMgr.LoadSpellTargetPositions(); + sSpellMgr->LoadSpellTargetPositions(); handler->SendGlobalGMSysMessage("DB table `spell_target_position` (destination coordinates for spell targets) reloaded."); return true; } @@ -906,7 +906,7 @@ public: static bool HandleReloadSpellThreatsCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Aggro Spells Definitions..."); - sSpellMgr.LoadSpellThreats(); + sSpellMgr->LoadSpellThreats(); handler->SendGlobalGMSysMessage("DB table `spell_threat` (spell aggro definitions) reloaded."); return true; } @@ -914,7 +914,7 @@ public: static bool HandleReloadSpellGroupStackRulesCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Spell Group Stack Rules..."); - sSpellMgr.LoadSpellGroupStackRules(); + sSpellMgr->LoadSpellGroupStackRules(); handler->SendGlobalGMSysMessage("DB table `spell_group_stack_rules` (spell stacking definitions) reloaded."); return true; } @@ -922,7 +922,7 @@ public: static bool HandleReloadSpellPetAurasCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Spell pet auras..."); - sSpellMgr.LoadSpellPetAuras(); + sSpellMgr->LoadSpellPetAuras(); handler->SendGlobalGMSysMessage("DB table `spell_pet_auras` reloaded."); return true; } @@ -930,7 +930,7 @@ public: static bool HandleReloadPageTextsCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Page Texts..."); - sObjectMgr.LoadPageTexts(); + sObjectMgr->LoadPageTexts(); handler->SendGlobalGMSysMessage("DB table `page_texts` reloaded."); return true; } @@ -963,7 +963,7 @@ public: if (*args != 'a') sLog.outString("Re-Loading Scripts from `gossip_scripts`..."); - sObjectMgr.LoadGossipScripts(); + sObjectMgr->LoadGossipScripts(); if (*args != 'a') handler->SendGlobalGMSysMessage("DB table `gossip_scripts` reloaded."); @@ -983,7 +983,7 @@ public: if (*args != 'a') sLog.outString("Re-Loading Scripts from `gameobject_scripts`..."); - sObjectMgr.LoadGameObjectScripts(); + sObjectMgr->LoadGameObjectScripts(); if (*args != 'a') handler->SendGlobalGMSysMessage("DB table `gameobject_scripts` reloaded."); @@ -1003,7 +1003,7 @@ public: if (*args != 'a') sLog.outString("Re-Loading Scripts from `event_scripts`..."); - sObjectMgr.LoadEventScripts(); + sObjectMgr->LoadEventScripts(); if (*args != 'a') handler->SendGlobalGMSysMessage("DB table `event_scripts` reloaded."); @@ -1023,7 +1023,7 @@ public: if (*args != 'a') sLog.outString("Re-Loading Scripts from `waypoint_scripts`..."); - sObjectMgr.LoadWaypointScripts(); + sObjectMgr->LoadWaypointScripts(); if (*args != 'a') handler->SendGlobalGMSysMessage("DB table `waypoint_scripts` reloaded."); @@ -1035,7 +1035,7 @@ public: { sLog.outString("Re-Loading Texts from `creature_ai_texts`..."); - sEventAIMgr.LoadCreatureEventAI_Texts(); + sEventAIMgr->LoadCreatureEventAI_Texts(); handler->SendGlobalGMSysMessage("DB table `creature_ai_texts` reloaded."); return true; } @@ -1043,7 +1043,7 @@ public: static bool HandleReloadEventAISummonsCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Summons from `creature_ai_summons`..."); - sEventAIMgr.LoadCreatureEventAI_Summons(); + sEventAIMgr->LoadCreatureEventAI_Summons(); handler->SendGlobalGMSysMessage("DB table `creature_ai_summons` reloaded."); return true; } @@ -1051,7 +1051,7 @@ public: static bool HandleReloadEventAIScriptsCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Scripts from `creature_ai_scripts`..."); - sEventAIMgr.LoadCreatureEventAI_Scripts(); + sEventAIMgr->LoadCreatureEventAI_Scripts(); handler->SendGlobalGMSysMessage("DB table `creature_ai_scripts` reloaded."); return true; } @@ -1068,7 +1068,7 @@ public: if (*args != 'a') sLog.outString("Re-Loading Scripts from `quest_end_scripts`..."); - sObjectMgr.LoadQuestEndScripts(); + sObjectMgr->LoadQuestEndScripts(); if (*args != 'a') handler->SendGlobalGMSysMessage("DB table `quest_end_scripts` reloaded."); @@ -1088,7 +1088,7 @@ public: if (*args != 'a') sLog.outString("Re-Loading Scripts from `quest_start_scripts`..."); - sObjectMgr.LoadQuestStartScripts(); + sObjectMgr->LoadQuestStartScripts(); if (*args != 'a') handler->SendGlobalGMSysMessage("DB table `quest_start_scripts` reloaded."); @@ -1108,7 +1108,7 @@ public: if (*args != 'a') sLog.outString("Re-Loading Scripts from `spell_scripts`..."); - sObjectMgr.LoadSpellScripts(); + sObjectMgr->LoadSpellScripts(); if (*args != 'a') handler->SendGlobalGMSysMessage("DB table `spell_scripts` reloaded."); @@ -1119,7 +1119,7 @@ public: static bool HandleReloadDbScriptStringCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Script strings from `db_script_string`..."); - sObjectMgr.LoadDbScriptStrings(); + sObjectMgr->LoadDbScriptStrings(); handler->SendGlobalGMSysMessage("DB table `db_script_string` reloaded."); return true; } @@ -1128,7 +1128,7 @@ public: { sLog.outString("Re-Loading Graveyard-zone links..."); - sObjectMgr.LoadGraveyardZones(); + sObjectMgr->LoadGraveyardZones(); handler->SendGlobalGMSysMessage("DB table `game_graveyard_zone` reloaded."); @@ -1139,7 +1139,7 @@ public: { sLog.outString("Re-Loading Game Tele coordinates..."); - sObjectMgr.LoadGameTele(); + sObjectMgr->LoadGameTele(); handler->SendGlobalGMSysMessage("DB table `game_tele` reloaded."); @@ -1149,9 +1149,9 @@ public: static bool HandleReloadDisablesCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading disables table..."); - sDisableMgr.LoadDisables(); + sDisableMgr->LoadDisables(); sLog.outString("Checking quest disables..."); - sDisableMgr.CheckQuestDisables(); + sDisableMgr->CheckQuestDisables(); handler->SendGlobalGMSysMessage("DB table `disables` reloaded."); return true; } @@ -1159,7 +1159,7 @@ public: static bool HandleReloadLocalesAchievementRewardCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Locales Achievement Reward Data..."); - sAchievementMgr.LoadRewardLocales(); + sAchievementMgr->LoadRewardLocales(); handler->SendGlobalGMSysMessage("DB table `locales_achievement_reward` reloaded."); return true; } @@ -1167,7 +1167,7 @@ public: static bool HandleReloadLfgEncountersCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading dungeon encounter lfg associations..."); - sLFGMgr.LoadDungeonEncounters(); + sLFGMgr->LoadDungeonEncounters(); handler->SendGlobalGMSysMessage("DB table `lfg_dungeon_encounters` reloaded."); return true; } @@ -1175,7 +1175,7 @@ public: static bool HandleReloadLfgRewardsCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading lfg dungeon rewards..."); - sLFGMgr.LoadRewards(); + sLFGMgr->LoadRewards(); handler->SendGlobalGMSysMessage("DB table `lfg_dungeon_rewards` reloaded."); return true; } @@ -1183,7 +1183,7 @@ public: static bool HandleReloadLocalesCreatureCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Locales Creature ..."); - sObjectMgr.LoadCreatureLocales(); + sObjectMgr->LoadCreatureLocales(); handler->SendGlobalGMSysMessage("DB table `locales_creature` reloaded."); return true; } @@ -1191,7 +1191,7 @@ public: static bool HandleReloadLocalesGameobjectCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Locales Gameobject ... "); - sObjectMgr.LoadGameObjectLocales(); + sObjectMgr->LoadGameObjectLocales(); handler->SendGlobalGMSysMessage("DB table `locales_gameobject` reloaded."); return true; } @@ -1199,7 +1199,7 @@ public: static bool HandleReloadLocalesGossipMenuOptionCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString( "Re-Loading Locales Gossip Menu Option ... "); - sObjectMgr.LoadGossipMenuItemsLocales(); + sObjectMgr->LoadGossipMenuItemsLocales(); handler->SendGlobalGMSysMessage("DB table `locales_gossip_menu_option` reloaded."); return true; } @@ -1207,7 +1207,7 @@ public: static bool HandleReloadLocalesItemCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Locales Item ... "); - sObjectMgr.LoadItemLocales(); + sObjectMgr->LoadItemLocales(); handler->SendGlobalGMSysMessage("DB table `locales_item` reloaded."); return true; } @@ -1215,7 +1215,7 @@ public: static bool HandleReloadLocalesItemSetNameCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Locales Item set name... "); - sObjectMgr.LoadItemSetNameLocales(); + sObjectMgr->LoadItemSetNameLocales(); handler->SendGlobalGMSysMessage("DB table `locales_item_set_name` reloaded."); return true; } @@ -1223,7 +1223,7 @@ public: static bool HandleReloadLocalesNpcTextCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Locales NPC Text ... "); - sObjectMgr.LoadNpcTextLocales(); + sObjectMgr->LoadNpcTextLocales(); handler->SendGlobalGMSysMessage("DB table `locales_npc_text` reloaded."); return true; } @@ -1231,7 +1231,7 @@ public: static bool HandleReloadLocalesPageTextCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Locales Page Text ... "); - sObjectMgr.LoadPageTextLocales(); + sObjectMgr->LoadPageTextLocales(); handler->SendGlobalGMSysMessage("DB table `locales_page_text` reloaded."); return true; } @@ -1239,7 +1239,7 @@ public: static bool HandleReloadLocalesPointsOfInterestCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Locales Points Of Interest ... "); - sObjectMgr.LoadPointOfInterestLocales(); + sObjectMgr->LoadPointOfInterestLocales(); handler->SendGlobalGMSysMessage("DB table `locales_points_of_interest` reloaded."); return true; } @@ -1247,7 +1247,7 @@ public: static bool HandleReloadLocalesQuestCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Locales Quest ... "); - sObjectMgr.LoadQuestLocales(); + sObjectMgr->LoadQuestLocales(); handler->SendGlobalGMSysMessage("DB table `locales_quest` reloaded."); return true; } @@ -1255,7 +1255,7 @@ public: static bool HandleReloadMailLevelRewardCommand(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Player level dependent mail rewards..."); - sObjectMgr.LoadMailLevelRewards(); + sObjectMgr->LoadMailLevelRewards(); handler->SendGlobalGMSysMessage("DB table `mail_level_reward` reloaded."); return true; } @@ -1264,8 +1264,8 @@ public: { ///- Reload dynamic data tables from the database sLog.outString("Re-Loading Auctions..."); - sAuctionMgr.LoadAuctionItems(); - sAuctionMgr.LoadAuctions(); + sAuctionMgr->LoadAuctionItems(); + sAuctionMgr->LoadAuctions(); handler->SendGlobalGMSysMessage("Auctions reloaded."); return true; } @@ -1273,7 +1273,7 @@ public: static bool HandleReloadConditions(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Conditions..."); - sConditionMgr.LoadConditions(true); + sConditionMgr->LoadConditions(true); handler->SendGlobalGMSysMessage("Conditions reloaded."); return true; } @@ -1281,7 +1281,7 @@ public: static bool HandleReloadCreatureText(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Creature Texts..."); - sCreatureTextMgr.LoadCreatureTexts(); + sCreatureTextMgr->LoadCreatureTexts(); handler->SendGlobalGMSysMessage("Creature Texts reloaded."); return true; } @@ -1289,7 +1289,7 @@ public: static bool HandleReloadSmartScripts(ChatHandler* handler, const char* /*args*/) { sLog.outString("Re-Loading Smart Scripts..."); - sSmartScriptMgr.LoadSmartAIFromDB(); + sSmartScriptMgr->LoadSmartAIFromDB(); handler->SendGlobalGMSysMessage("Smart Scripts reloaded."); return true; } diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index cada62a684c..f17ddec56cd 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -63,7 +63,7 @@ public: std::string name = args; - if (sObjectMgr.GetGameTele(name)) + if (sObjectMgr->GetGameTele(name)) { handler->SendSysMessage(LANG_COMMAND_TP_ALREADYEXIST); handler->SetSentErrorMessage(true); @@ -78,7 +78,7 @@ public: tele.mapId = player->GetMapId(); tele.name = name; - if (sObjectMgr.AddGameTele(tele)) + if (sObjectMgr->AddGameTele(tele)) { handler->SendSysMessage(LANG_COMMAND_TP_ADDED); } @@ -99,7 +99,7 @@ public: std::string name = args; - if (!sObjectMgr.DeleteGameTele(name)) + if (!sObjectMgr->DeleteGameTele(name)) { handler->SendSysMessage(LANG_COMMAND_TELE_NOTFOUND); handler->SetSentErrorMessage(true); @@ -175,7 +175,7 @@ public: handler->PSendSysMessage(LANG_TELEPORTING_TO, nameLink.c_str(), handler->GetTrinityString(LANG_OFFLINE), tele->name.c_str()); Player::SavePositionInDB(tele->mapId,tele->position_x,tele->position_y,tele->position_z,tele->orientation, - sMapMgr.GetZoneId(tele->mapId,tele->position_x,tele->position_y,tele->position_z),target_guid); + sMapMgr->GetZoneId(tele->mapId,tele->position_x,tele->position_y,tele->position_z),target_guid); } return true; diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index ed09879e1b1..17e2ef27907 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -599,7 +599,7 @@ public: wpCreature->AddObjectToRemoveList(); // re-create Creature* wpCreature2 = new Creature; - if (!wpCreature2->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0, 0, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation())) + if (!wpCreature2->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0, 0, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation())) { handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT); delete wpCreature2; @@ -610,7 +610,7 @@ public: // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells(); wpCreature2->LoadFromDB(wpCreature2->GetDBTableGUIDLow(), map); map->Add(wpCreature2); - //sMapMgr.GetMap(npcCreature->GetMapId())->Add(wpCreature2); + //sMapMgr->GetMap(npcCreature->GetMapId())->Add(wpCreature2); } WorldDatabase.PExecute("UPDATE waypoint_data SET position_x = '%f',position_y = '%f',position_z = '%f' where id = '%u' AND point='%u'", @@ -804,7 +804,7 @@ public: float o = chr->GetOrientation(); Creature* wpCreature = new Creature; - if (!wpCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o)) + if (!wpCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o)) { handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id); delete wpCreature; @@ -856,7 +856,7 @@ public: Map *map = chr->GetMap(); Creature* pCreature = new Creature; - if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT),map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o)) + if (!pCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT),map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o)) { handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id); delete pCreature; @@ -904,7 +904,7 @@ public: Map *map = chr->GetMap(); Creature* pCreature = new Creature; - if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o)) + if (!pCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o)) { handler->PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id); delete pCreature; diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp index 54e7a8d75df..ea226e84682 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp @@ -230,9 +230,9 @@ public: //Trinity::Singleton<MapManager>::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin(); /* - list <Player*>::const_iterator i = sMapMgr.GetMap(me->GetMapId(), me)->GetPlayers().begin(); + list <Player*>::const_iterator i = sMapMgr->GetMap(me->GetMapId(), me)->GetPlayers().begin(); - for (i = sMapMgr.GetMap(me->GetMapId(), me)->GetPlayers().begin(); i != sMapMgr.GetMap(me->GetMapId(), me)->GetPlayers().end(); ++i) + for (i = sMapMgr->GetMap(me->GetMapId(), me)->GetPlayers().begin(); i != sMapMgr->GetMap(me->GetMapId(), me)->GetPlayers().end(); ++i) { AttackStart((*i)); } @@ -329,7 +329,7 @@ public: if (SpawnedAdds >= 42) { //Teleport Victor Nefarius way out of the map - //sMapMgr.GetMap(me->GetMapId(), me)->CreatureRelocation(me,0,0,-5000,0); + //sMapMgr->GetMap(me->GetMapId(), me)->CreatureRelocation(me,0,0,-5000,0); //Interrupt any spell casting me->InterruptNonMeleeSpells(false); diff --git a/src/server/scripts/Examples/example_misc.cpp b/src/server/scripts/Examples/example_misc.cpp index 98a7323e1dd..ee91568d0c5 100644 --- a/src/server/scripts/Examples/example_misc.cpp +++ b/src/server/scripts/Examples/example_misc.cpp @@ -58,7 +58,7 @@ class ItemUse_example_item : public ItemScript bool OnUse(Player* /*player*/, Item* /*item*/, SpellCastTargets const& /*targets*/) { - sScriptMgr.LoadDatabase(); + sScriptMgr->LoadDatabase(); return true; } }; diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp index 8b9eef64f93..c45b29a8ae3 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/azshara.cpp @@ -418,7 +418,7 @@ public: void SendText(int32 iTextEntry, Player* pPlayer) { LocaleConstant loc_idx = pPlayer->GetSession()->GetSessionDbLocaleIndex(); - const char* text = sObjectMgr.GetTrinityString(iTextEntry, loc_idx); + const char* text = sObjectMgr->GetTrinityString(iTextEntry, loc_idx); sWorld.SendServerMessage(SERVER_MSG_STRING, text, pPlayer); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index cc2267a7505..7e679f0a0ca 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -357,7 +357,7 @@ class boss_prince_keleseth_icc : public CreatureScript void InitializeAI() { - if (CreatureData const* data = sObjectMgr.GetCreatureData(me->GetDBTableGUIDLow())) + if (CreatureData const* data = sObjectMgr->GetCreatureData(me->GetDBTableGUIDLow())) if (data->curhealth) spawnHealth = data->curhealth; @@ -542,7 +542,7 @@ class boss_prince_taldaram_icc : public CreatureScript void InitializeAI() { - if (CreatureData const* data = sObjectMgr.GetCreatureData(me->GetDBTableGUIDLow())) + if (CreatureData const* data = sObjectMgr->GetCreatureData(me->GetDBTableGUIDLow())) if (data->curhealth) spawnHealth = data->curhealth; @@ -741,7 +741,7 @@ class boss_prince_valanar_icc : public CreatureScript void InitializeAI() { - if (CreatureData const* data = sObjectMgr.GetCreatureData(me->GetDBTableGUIDLow())) + if (CreatureData const* data = sObjectMgr->GetCreatureData(me->GetDBTableGUIDLow())) if (data->curhealth) spawnHealth = data->curhealth; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index 7632752f5a4..6c032d58bc2 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -433,7 +433,7 @@ class spell_blood_queen_vampiric_bite : public SpellScriptLoader } SpellEntry const* spell = sSpellStore.LookupEntry(SPELL_FRENZIED_BLOODTHIRST); - spell = sSpellMgr.GetSpellForDifficultyFromSpell(spell, GetCaster()); + spell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, GetCaster()); GetCaster()->RemoveAura(spell->Id, 0, 0, AURA_REMOVE_BY_ENEMY_SPELL); GetCaster()->CastSpell(GetCaster(), SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_PLR, true); // Presence of the Darkfallen buff on Blood-Queen diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp index 086bd0547bf..a8fc9405285 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp @@ -365,7 +365,7 @@ class spell_festergut_pungent_blight : public SpellScriptLoader return; // Get Inhaled Blight id for our difficulty - spellInfo = sSpellMgr.GetSpellForDifficultyFromSpell(spellInfo, GetCaster()); + spellInfo = sSpellMgr->GetSpellForDifficultyFromSpell(spellInfo, GetCaster()); // ...and remove it GetCaster()->RemoveAurasDueToSpell(spellInfo->Id); @@ -404,7 +404,7 @@ class spell_festergut_gastric_bloat : public SpellScriptLoader return; // Get Gastric Explosion id for our difficulty - spellInfo = sSpellMgr.GetSpellForDifficultyFromSpell(spellInfo, GetCaster()); + spellInfo = sSpellMgr->GetSpellForDifficultyFromSpell(spellInfo, GetCaster()); GetHitUnit()->RemoveAurasDueToSpell(GetSpellInfo()->Id); GetHitUnit()->CastSpell(GetHitUnit(), spellInfo, true); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index f88274ca956..28d6a58b935 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -348,7 +348,7 @@ class boss_professor_putricide : public CreatureScript case PHASE_COMBAT_2: { SpellEntry const* spell = sSpellStore.LookupEntry(SPELL_CREATE_CONCOCTION); - spell = sSpellMgr.GetSpellForDifficultyFromSpell(spell, me); + spell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, me); DoCast(me, SPELL_CREATE_CONCOCTION); events.ScheduleEvent(EVENT_PHASE_TRANSITION, GetSpellCastTime(spell)+100); break; @@ -356,7 +356,7 @@ class boss_professor_putricide : public CreatureScript case PHASE_COMBAT_3: { SpellEntry const* spell = sSpellStore.LookupEntry(SPELL_GUZZLE_POTIONS); - spell = sSpellMgr.GetSpellForDifficultyFromSpell(spell, me); + spell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, me); DoCast(me, SPELL_GUZZLE_POTIONS); events.ScheduleEvent(EVENT_PHASE_TRANSITION, GetSpellCastTime(spell)+100); break; @@ -686,7 +686,7 @@ class npc_volatile_ooze : public CreatureScript void SpellHitTarget(Unit* /*target*/, SpellEntry const* spell) { SpellEntry const* explode = sSpellStore.LookupEntry(SPELL_OOZE_ERUPTION); - explode = sSpellMgr.GetSpellForDifficultyFromSpell(explode, me); + explode = sSpellMgr->GetSpellForDifficultyFromSpell(explode, me); if (explode->Id == spell->Id) { newTargetSelectTimer = 5000; @@ -955,7 +955,7 @@ class spell_putricide_ooze_eruption_searcher : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { SpellEntry const* adhesive = sSpellStore.LookupEntry(SPELL_VOLATILE_OOZE_ADHESIVE); - adhesive = sSpellMgr.GetSpellForDifficultyFromSpell(adhesive, GetCaster()); + adhesive = sSpellMgr->GetSpellForDifficultyFromSpell(adhesive, GetCaster()); if (GetHitUnit()->HasAura(adhesive->Id)) { GetCaster()->CastSpell(GetHitUnit(), SPELL_OOZE_ERUPTION, true); @@ -1031,8 +1031,8 @@ class spell_putricide_unbound_plague : public SpellScriptLoader professor = Unit::GetCreature(*GetCaster(), instance->GetData64(DATA_PROFESSOR_PUTRICIDE)); if (professor) { - plague = sSpellMgr.GetSpellForDifficultyFromSpell(plague, professor); - searcher = sSpellMgr.GetSpellForDifficultyFromSpell(searcher, professor); + plague = sSpellMgr->GetSpellForDifficultyFromSpell(plague, professor); + searcher = sSpellMgr->GetSpellForDifficultyFromSpell(searcher, professor); } } @@ -1125,7 +1125,7 @@ class spell_putricide_mutated_plague : public SpellScriptLoader uint32 triggerSpell = GetSpellProto()->EffectTriggerSpell[aurEff->GetEffIndex()]; SpellEntry const* spell = sSpellStore.LookupEntry(triggerSpell); - spell = sSpellMgr.GetSpellForDifficultyFromSpell(spell, caster); + spell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, caster); int32 damage = SpellMgr::CalculateSpellEffectAmount(spell, 0, caster); float multiplier = 2.0f; diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index 1957f718969..38f5b85387f 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -2130,7 +2130,7 @@ public: (me->HasAura(SPELL_AURA_NOTSOBIG_1) || me->HasAura(SPELL_AURA_NOTSOBIG_2) || me->HasAura(SPELL_AURA_NOTSOBIG_3) || me->HasAura(SPELL_AURA_NOTSOBIG_4))) { - Quest const* qInfo = sObjectMgr.GetQuestTemplate(QUEST_YOU_RE_NOT_SO_BIG_NOW); + Quest const* qInfo = sObjectMgr->GetQuestTemplate(QUEST_YOU_RE_NOT_SO_BIG_NOW); if (qInfo) CAST_PLR(pKiller)->KilledMonsterCredit(qInfo->ReqCreatureOrGOId[0],0); } diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp index 962eca6506e..1975bb9233b 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp @@ -40,12 +40,12 @@ void OPvPCapturePointEP_EWT::ChangeState() // if changing from controlling alliance to horde or vice versa if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State ) { - sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_A)); + sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_A)); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_EWT] = 0; } else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State ) { - sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_H)); + sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_H)); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_EWT] = 0; } @@ -58,14 +58,14 @@ void OPvPCapturePointEP_EWT::ChangeState() artkit = 2; SummonSupportUnitAtNorthpassTower(ALLIANCE); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_EWT] = ALLIANCE; - if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_A)); + if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_A)); break; case OBJECTIVESTATE_HORDE: m_TowerState = EP_TS_H; artkit = 1; SummonSupportUnitAtNorthpassTower(HORDE); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_EWT] = HORDE; - if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_H)); + if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_H)); break; case OBJECTIVESTATE_NEUTRAL: m_TowerState = EP_TS_N; @@ -178,12 +178,12 @@ void OPvPCapturePointEP_NPT::ChangeState() // if changing from controlling alliance to horde or vice versa if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State ) { - sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_A)); + sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_A)); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_NPT] = 0; } else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State ) { - sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_H)); + sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_H)); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_NPT] = 0; } @@ -196,14 +196,14 @@ void OPvPCapturePointEP_NPT::ChangeState() artkit = 2; SummonGO(ALLIANCE); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_NPT] = ALLIANCE; - if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_A)); + if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_A)); break; case OBJECTIVESTATE_HORDE: m_TowerState = EP_TS_H; artkit = 1; SummonGO(HORDE); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_NPT] = HORDE; - if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_H)); + if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_H)); break; case OBJECTIVESTATE_NEUTRAL: m_TowerState = EP_TS_N; @@ -321,12 +321,12 @@ void OPvPCapturePointEP_CGT::ChangeState() // if changing from controlling alliance to horde or vice versa if( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State ) { - sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_A)); + sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_A)); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_CGT] = 0; } else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State ) { - sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_H)); + sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_H)); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_CGT] = 0; } @@ -339,14 +339,14 @@ void OPvPCapturePointEP_CGT::ChangeState() artkit = 2; LinkGraveYard(ALLIANCE); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_CGT] = ALLIANCE; - if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_A)); + if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_A)); break; case OBJECTIVESTATE_HORDE: m_TowerState = EP_TS_H; artkit = 1; LinkGraveYard(HORDE); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_CGT] = HORDE; - if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_H)); + if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_H)); break; case OBJECTIVESTATE_NEUTRAL: m_TowerState = EP_TS_N; @@ -432,8 +432,8 @@ void OPvPCapturePointEP_CGT::LinkGraveYard(uint32 team) if (m_GraveyardSide != team) { m_GraveyardSide = team; - sObjectMgr.RemoveGraveYardLink(EP_GraveYardId,EP_GraveYardZone,team,false); - sObjectMgr.AddGraveYardLink(EP_GraveYardId,EP_GraveYardZone,team,false); + sObjectMgr->RemoveGraveYardLink(EP_GraveYardId,EP_GraveYardZone,team,false); + sObjectMgr->AddGraveYardLink(EP_GraveYardId,EP_GraveYardZone,team,false); } } @@ -450,12 +450,12 @@ void OPvPCapturePointEP_PWT::ChangeState() // if changing from controlling alliance to horde or vice versa if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State ) { - sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_A)); + sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_A)); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_PWT] = 0; } else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State ) { - sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_H)); + sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_H)); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_PWT] = 0; } @@ -468,14 +468,14 @@ void OPvPCapturePointEP_PWT::ChangeState() SummonFlightMaster(ALLIANCE); artkit = 2; ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_PWT] = ALLIANCE; - if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_A)); + if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_A)); break; case OBJECTIVESTATE_HORDE: m_TowerState = EP_TS_H; SummonFlightMaster(HORDE); artkit = 1; ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_PWT] = HORDE; - if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_H)); + if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_H)); break; case OBJECTIVESTATE_NEUTRAL: m_TowerState = EP_TS_N; @@ -584,7 +584,7 @@ void OPvPCapturePointEP_PWT::SummonFlightMaster(uint32 team) GossipOption gso; gso.Action = GOSSIP_OPTION_OUTDOORPVP; gso.GossipId = 0; - gso.OptionText.assign(sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_NPT)); + gso.OptionText.assign(sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_NPT)); gso.Id = 50; gso.Icon = 0; gso.NpcFlag = 0; @@ -594,7 +594,7 @@ void OPvPCapturePointEP_PWT::SummonFlightMaster(uint32 team) gso.Action = GOSSIP_OPTION_OUTDOORPVP; gso.GossipId = 0; - gso.OptionText.assign(sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_EWT)); + gso.OptionText.assign(sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_EWT)); gso.Id = 50; gso.Icon = 0; gso.NpcFlag = 0; @@ -604,7 +604,7 @@ void OPvPCapturePointEP_PWT::SummonFlightMaster(uint32 team) gso.Action = GOSSIP_OPTION_OUTDOORPVP; gso.GossipId = 0; - gso.OptionText.assign(sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_CGT)); + gso.OptionText.assign(sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_CGT)); gso.Id = 50; gso.Icon = 0; gso.NpcFlag = 0; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp index c53945dbe42..ec38838dcf6 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp @@ -175,13 +175,13 @@ void OPvPCapturePointHP::ChangeState() field = HP_MAP_A[m_TowerType]; if (((OutdoorPvPHP*)m_PvP)->m_AllianceTowersControlled) ((OutdoorPvPHP*)m_PvP)->m_AllianceTowersControlled--; - sWorld.SendZoneText(OutdoorPvPHPBuffZones[0],sObjectMgr.GetTrinityStringForDBCLocale(HP_LANG_LOSE_A[m_TowerType])); + sWorld.SendZoneText(OutdoorPvPHPBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_LOSE_A[m_TowerType])); break; case OBJECTIVESTATE_HORDE: field = HP_MAP_H[m_TowerType]; if (((OutdoorPvPHP*)m_PvP)->m_HordeTowersControlled) ((OutdoorPvPHP*)m_PvP)->m_HordeTowersControlled--; - sWorld.SendZoneText(OutdoorPvPHPBuffZones[0],sObjectMgr.GetTrinityStringForDBCLocale(HP_LANG_LOSE_H[m_TowerType])); + sWorld.SendZoneText(OutdoorPvPHPBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_LOSE_H[m_TowerType])); break; case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: field = HP_MAP_N[m_TowerType]; @@ -216,7 +216,7 @@ void OPvPCapturePointHP::ChangeState() artkit2 = HP_TowerArtKit_A[m_TowerType]; if (((OutdoorPvPHP*)m_PvP)->m_AllianceTowersControlled<3) ((OutdoorPvPHP*)m_PvP)->m_AllianceTowersControlled++; - sWorld.SendZoneText(OutdoorPvPHPBuffZones[0],sObjectMgr.GetTrinityStringForDBCLocale(HP_LANG_CAPTURE_A[m_TowerType])); + sWorld.SendZoneText(OutdoorPvPHPBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_CAPTURE_A[m_TowerType])); break; case OBJECTIVESTATE_HORDE: field = HP_MAP_H[m_TowerType]; @@ -224,7 +224,7 @@ void OPvPCapturePointHP::ChangeState() artkit2 = HP_TowerArtKit_H[m_TowerType]; if (((OutdoorPvPHP*)m_PvP)->m_HordeTowersControlled<3) ((OutdoorPvPHP*)m_PvP)->m_HordeTowersControlled++; - sWorld.SendZoneText(OutdoorPvPHPBuffZones[0],sObjectMgr.GetTrinityStringForDBCLocale(HP_LANG_CAPTURE_H[m_TowerType])); + sWorld.SendZoneText(OutdoorPvPHPBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_CAPTURE_H[m_TowerType])); break; case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: field = HP_MAP_N[m_TowerType]; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp index d5bc0e14147..1144ac970e6 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp @@ -69,7 +69,7 @@ uint32 OPvPCapturePointNA::GetAliveGuardsCount() if (cr->isAlive()) ++cnt; } - else if (CreatureData const * cd = sObjectMgr.GetCreatureData(GUID_LOPART(itr->second))) + else if (CreatureData const * cd = sObjectMgr->GetCreatureData(GUID_LOPART(itr->second))) { if (!cd->is_dead) ++cnt; @@ -137,15 +137,15 @@ void OPvPCapturePointNA::DeSpawnGOs() void OPvPCapturePointNA::FactionTakeOver(uint32 team) { if (m_ControllingFaction) - sObjectMgr.RemoveGraveYardLink(NA_HALAA_GRAVEYARD,NA_HALAA_GRAVEYARD_ZONE,m_ControllingFaction,false); + sObjectMgr->RemoveGraveYardLink(NA_HALAA_GRAVEYARD,NA_HALAA_GRAVEYARD_ZONE,m_ControllingFaction,false); if (m_ControllingFaction == ALLIANCE) - sWorld.SendZoneText(NA_HALAA_GRAVEYARD_ZONE,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_NA_LOSE_A)); + sWorld.SendZoneText(NA_HALAA_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_LOSE_A)); else if (m_ControllingFaction == HORDE) - sWorld.SendZoneText(NA_HALAA_GRAVEYARD_ZONE,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_NA_LOSE_H)); + sWorld.SendZoneText(NA_HALAA_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_LOSE_H)); m_ControllingFaction = team; if (m_ControllingFaction) - sObjectMgr.AddGraveYardLink(NA_HALAA_GRAVEYARD,NA_HALAA_GRAVEYARD_ZONE,m_ControllingFaction,false); + sObjectMgr->AddGraveYardLink(NA_HALAA_GRAVEYARD,NA_HALAA_GRAVEYARD_ZONE,m_ControllingFaction,false); DeSpawnGOs(); DeSpawnNPCs(); SpawnGOsForTeam(team); @@ -163,7 +163,7 @@ void OPvPCapturePointNA::FactionTakeOver(uint32 team) m_PvP->SendUpdateWorldState(NA_UI_HORDE_GUARDS_SHOW, 0); m_PvP->SendUpdateWorldState(NA_UI_ALLIANCE_GUARDS_SHOW, 1); m_PvP->SendUpdateWorldState(NA_UI_GUARDS_LEFT, m_GuardsAlive); - sWorld.SendZoneText(NA_HALAA_GRAVEYARD_ZONE,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_NA_CAPTURE_A)); + sWorld.SendZoneText(NA_HALAA_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_CAPTURE_A)); } else { @@ -175,7 +175,7 @@ void OPvPCapturePointNA::FactionTakeOver(uint32 team) m_PvP->SendUpdateWorldState(NA_UI_HORDE_GUARDS_SHOW, 1); m_PvP->SendUpdateWorldState(NA_UI_ALLIANCE_GUARDS_SHOW, 0); m_PvP->SendUpdateWorldState(NA_UI_GUARDS_LEFT, m_GuardsAlive); - sWorld.SendZoneText(NA_HALAA_GRAVEYARD_ZONE,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_NA_CAPTURE_H)); + sWorld.SendZoneText(NA_HALAA_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_CAPTURE_H)); } UpdateWyvernRoostWorldState(NA_ROOST_S); UpdateWyvernRoostWorldState(NA_ROOST_N); diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp index 4d92c03c4c7..88f992891ef 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp @@ -94,7 +94,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player *plr, uint32 trigger) if (m_Gathered_A >= SI_MAX_RESOURCES) { TeamApplyBuff(TEAM_ALLIANCE, SI_CENARION_FAVOR); - sWorld.SendZoneText(OutdoorPvPSIBuffZones[0],sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_SI_CAPTURE_A)); + sWorld.SendZoneText(OutdoorPvPSIBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_SI_CAPTURE_A)); m_LastController = ALLIANCE; m_Gathered_A = 0; m_Gathered_H = 0; @@ -119,7 +119,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player *plr, uint32 trigger) if (m_Gathered_H >= SI_MAX_RESOURCES) { TeamApplyBuff(TEAM_HORDE, SI_CENARION_FAVOR); - sWorld.SendZoneText(OutdoorPvPSIBuffZones[0],sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_SI_CAPTURE_H)); + sWorld.SendZoneText(OutdoorPvPSIBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_SI_CAPTURE_H)); m_LastController = HORDE; m_Gathered_A = 0; m_Gathered_H = 0; @@ -163,7 +163,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player *plr, uint32 spellId) return true; } - if (!go->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map, plr->GetPhaseMask(), plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,GO_STATE_READY)) + if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map, plr->GetPhaseMask(), plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,GO_STATE_READY)) { delete go; } @@ -192,7 +192,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player *plr, uint32 spellId) delete go; return true; } - if (!go->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map, plr->GetPhaseMask() ,plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,GO_STATE_READY)) + if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map, plr->GetPhaseMask() ,plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,GO_STATE_READY)) { delete go; } diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp index 53e8052a26d..5a47cdf8ef3 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp @@ -250,14 +250,14 @@ void OPvPCapturePointTF::ChangeState() { if (((OutdoorPvPTF*)m_PvP)->m_AllianceTowersControlled) ((OutdoorPvPTF*)m_PvP)->m_AllianceTowersControlled--; - sWorld.SendZoneText(OutdoorPvPTFBuffZones[0],sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_TF_LOSE_A)); + sWorld.SendZoneText(OutdoorPvPTFBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_LOSE_A)); } // if changing from controlling horde to alliance else if (m_OldState == OBJECTIVESTATE_HORDE) { if (((OutdoorPvPTF*)m_PvP)->m_HordeTowersControlled) ((OutdoorPvPTF*)m_PvP)->m_HordeTowersControlled--; - sWorld.SendZoneText(OutdoorPvPTFBuffZones[0],sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_TF_LOSE_H)); + sWorld.SendZoneText(OutdoorPvPTFBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_LOSE_H)); } uint32 artkit = 21; @@ -269,7 +269,7 @@ void OPvPCapturePointTF::ChangeState() artkit = 2; if (((OutdoorPvPTF*)m_PvP)->m_AllianceTowersControlled<TF_TOWER_NUM) ((OutdoorPvPTF*)m_PvP)->m_AllianceTowersControlled++; - sWorld.SendZoneText(OutdoorPvPTFBuffZones[0],sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_TF_CAPTURE_A)); + sWorld.SendZoneText(OutdoorPvPTFBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_CAPTURE_A)); for (PlayerSet::iterator itr = m_activePlayers[0].begin(); itr != m_activePlayers[0].end(); ++itr) (*itr)->AreaExploredOrEventHappens(TF_ALLY_QUEST); break; @@ -278,7 +278,7 @@ void OPvPCapturePointTF::ChangeState() artkit = 1; if (((OutdoorPvPTF*)m_PvP)->m_HordeTowersControlled<TF_TOWER_NUM) ((OutdoorPvPTF*)m_PvP)->m_HordeTowersControlled++; - sWorld.SendZoneText(OutdoorPvPTFBuffZones[0],sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_TF_CAPTURE_H)); + sWorld.SendZoneText(OutdoorPvPTFBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_CAPTURE_H)); for (PlayerSet::iterator itr = m_activePlayers[1].begin(); itr != m_activePlayers[1].end(); ++itr) (*itr)->AreaExploredOrEventHappens(TF_HORDE_QUEST); break; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp index bdaf0961d2c..cc31dfe672f 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp @@ -78,14 +78,14 @@ void OPvPCapturePointZM_Beacon::ChangeState() { if (((OutdoorPvPZM*)m_PvP)->m_AllianceTowersControlled) ((OutdoorPvPZM*)m_PvP)->m_AllianceTowersControlled--; - sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr.GetTrinityStringForDBCLocale(ZMBeaconLoseA[m_TowerType])); + sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconLoseA[m_TowerType])); } // if changing from controlling horde to alliance else if (m_OldState == OBJECTIVESTATE_HORDE) { if (((OutdoorPvPZM*)m_PvP)->m_HordeTowersControlled) ((OutdoorPvPZM*)m_PvP)->m_HordeTowersControlled--; - sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr.GetTrinityStringForDBCLocale(ZMBeaconLoseH[m_TowerType])); + sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconLoseH[m_TowerType])); } switch(m_State) @@ -94,13 +94,13 @@ void OPvPCapturePointZM_Beacon::ChangeState() m_TowerState = ZM_TOWERSTATE_A; if (((OutdoorPvPZM*)m_PvP)->m_AllianceTowersControlled<ZM_NUM_BEACONS) ((OutdoorPvPZM*)m_PvP)->m_AllianceTowersControlled++; - sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr.GetTrinityStringForDBCLocale(ZMBeaconCaptureA[m_TowerType])); + sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconCaptureA[m_TowerType])); break; case OBJECTIVESTATE_HORDE: m_TowerState = ZM_TOWERSTATE_H; if (((OutdoorPvPZM*)m_PvP)->m_HordeTowersControlled<ZM_NUM_BEACONS) ((OutdoorPvPZM*)m_PvP)->m_HordeTowersControlled++; - sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr.GetTrinityStringForDBCLocale(ZMBeaconCaptureH[m_TowerType])); + sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconCaptureH[m_TowerType])); break; case OBJECTIVESTATE_NEUTRAL: case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: @@ -216,28 +216,28 @@ int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player *plr, uint64 guid) if (plr->HasAura(ZM_BATTLE_STANDARD_A) && m_GraveYardState != ZM_GRAVEYARD_A) { if (m_GraveYardState == ZM_GRAVEYARD_H) - sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_ZM_LOSE_GY_H)); + sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_LOSE_GY_H)); m_GraveYardState = ZM_GRAVEYARD_A; DelObject(0); // only one gotype is used in the whole outdoor pvp, no need to call it a constant AddObject(0,ZM_Banner_A.entry,ZM_Banner_A.map,ZM_Banner_A.x,ZM_Banner_A.y,ZM_Banner_A.z,ZM_Banner_A.o,ZM_Banner_A.rot0,ZM_Banner_A.rot1,ZM_Banner_A.rot2,ZM_Banner_A.rot3); - sObjectMgr.RemoveGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, HORDE); // rem gy - sObjectMgr.AddGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, ALLIANCE, false); // add gy + sObjectMgr->RemoveGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, HORDE); // rem gy + sObjectMgr->AddGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, ALLIANCE, false); // add gy m_PvP->TeamApplyBuff(TEAM_ALLIANCE, ZM_CAPTURE_BUFF); plr->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A); - sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_A)); + sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_A)); } else if (plr->HasAura(ZM_BATTLE_STANDARD_H) && m_GraveYardState != ZM_GRAVEYARD_H) { if (m_GraveYardState == ZM_GRAVEYARD_A) - sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_ZM_LOSE_GY_A)); + sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_LOSE_GY_A)); m_GraveYardState = ZM_GRAVEYARD_H; DelObject(0); // only one gotype is used in the whole outdoor pvp, no need to call it a constant AddObject(0,ZM_Banner_H.entry,ZM_Banner_H.map,ZM_Banner_H.x,ZM_Banner_H.y,ZM_Banner_H.z,ZM_Banner_H.o,ZM_Banner_H.rot0,ZM_Banner_H.rot1,ZM_Banner_H.rot2,ZM_Banner_H.rot3); - sObjectMgr.RemoveGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, ALLIANCE); // rem gy - sObjectMgr.AddGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, HORDE, false); // add gy + sObjectMgr->RemoveGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, ALLIANCE); // rem gy + sObjectMgr->AddGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, HORDE, false); // add gy m_PvP->TeamApplyBuff(TEAM_HORDE, ZM_CAPTURE_BUFF); plr->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H); - sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr.GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_H)); + sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_H)); } UpdateTowerState(); } @@ -311,7 +311,7 @@ void OPvPCapturePointZM_GraveYard::SetBeaconState(uint32 controlling_faction) if (m_FlagCarrierGUID) { // remove flag from carrier, reset flag carrier guid - Player * p = sObjectMgr.GetPlayer(m_FlagCarrierGUID); + Player * p = sObjectMgr->GetPlayer(m_FlagCarrierGUID); if (p) { p->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index c63a699fed0..b237ead269d 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -183,13 +183,13 @@ public: return false; // can't use other spell than holy shock due to spell_ranks dependency - if (sSpellMgr.GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr.GetFirstSpellInChain(spellEntry->Id)) + if (sSpellMgr->GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id)) return false; - uint8 rank = sSpellMgr.GetSpellRank(spellEntry->Id); - if (!sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank, true)) + uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id); + if (!sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank, true)) return false; - if (!sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank, true)) + if (!sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank, true)) return false; return true; @@ -201,12 +201,12 @@ public: { Unit *caster = GetCaster(); - uint8 rank = sSpellMgr.GetSpellRank(GetSpellInfo()->Id); + uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); if (caster->IsFriendlyTo(unitTarget)) - caster->CastSpell(unitTarget, sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank), true, 0); + caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank), true, 0); else - caster->CastSpell(unitTarget, sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank), true, 0); + caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank), true, 0); } } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 5359cbaf252..6631d840309 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -107,13 +107,13 @@ class spell_pri_penance : public SpellScriptLoader if (!sSpellStore.LookupEntry(PRIEST_SPELL_PENANCE_R1)) return false; // can't use other spell than this penance due to spell_ranks dependency - if (sSpellMgr.GetFirstSpellInChain(PRIEST_SPELL_PENANCE_R1) != sSpellMgr.GetFirstSpellInChain(spellEntry->Id)) + if (sSpellMgr->GetFirstSpellInChain(PRIEST_SPELL_PENANCE_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id)) return false; - uint8 rank = sSpellMgr.GetSpellRank(spellEntry->Id); - if (!sSpellMgr.GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_DAMAGE, rank, true)) + uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id); + if (!sSpellMgr->GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_DAMAGE, rank, true)) return false; - if (!sSpellMgr.GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_HEAL, rank, true)) + if (!sSpellMgr->GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_HEAL, rank, true)) return false; return true; @@ -127,12 +127,12 @@ class spell_pri_penance : public SpellScriptLoader Unit *caster = GetCaster(); - uint8 rank = sSpellMgr.GetSpellRank(GetSpellInfo()->Id); + uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); if (caster->IsFriendlyTo(unitTarget)) - caster->CastSpell(unitTarget, sSpellMgr.GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_HEAL, rank), false, 0); + caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_HEAL, rank), false, 0); else - caster->CastSpell(unitTarget, sSpellMgr.GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_DAMAGE, rank), false, 0); + caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_DAMAGE, rank), false, 0); } void Register() diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index d65874068df..640faaad64f 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -49,11 +49,11 @@ public: { if (!sSpellStore.LookupEntry(SHAMAN_SPELL_FIRE_NOVA_R1)) return false; - if (sSpellMgr.GetFirstSpellInChain(SHAMAN_SPELL_FIRE_NOVA_R1) != sSpellMgr.GetFirstSpellInChain(spellEntry->Id)) + if (sSpellMgr->GetFirstSpellInChain(SHAMAN_SPELL_FIRE_NOVA_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id)) return false; - uint8 rank = sSpellMgr.GetSpellRank(spellEntry->Id); - if (!sSpellMgr.GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank, true)) + uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id); + if (!sSpellMgr->GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank, true)) return false; return true; } @@ -62,8 +62,8 @@ public: { if (Unit* caster = GetCaster()) { - uint8 rank = sSpellMgr.GetSpellRank(GetSpellInfo()->Id); - uint32 spellId = sSpellMgr.GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank); + uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); + uint32 spellId = sSpellMgr->GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank); // fire slot if (spellId && caster->m_SummonSlot[1]) { diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index e3a341fa0ec..0338569b3e6 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -172,7 +172,7 @@ public: break; } } - uint8 spellRank = sSpellMgr.GetSpellRank(GetSpellInfo()->Id); + uint8 spellRank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); if (spellRank > 0 && spellRank <= 8) CreateItem(effIndex, iTypes[spellRank - 1][rank]); } diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 887b862c6c1..8c903a67df6 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -1005,7 +1005,7 @@ public: if (!pPrisoner || !pPrisoner->isAlive()) return true; - Quest const* qInfo = sObjectMgr.GetQuestTemplate(QUEST_PRISONERS_OF_WYRMSKULL); + Quest const* qInfo = sObjectMgr->GetQuestTemplate(QUEST_PRISONERS_OF_WYRMSKULL); if (qInfo) { //TODO: prisoner should help player for a short period of time diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp index e9da92f9e6b..8b2fe8bd422 100755 --- a/src/server/worldserver/CommandLine/CliRunnable.cpp +++ b/src/server/worldserver/CommandLine/CliRunnable.cpp @@ -157,7 +157,7 @@ bool ChatHandler::GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::s info.accountId = fields[2].GetUInt32(); // account name will be empty for not existed account - sAccountMgr.GetName(info.accountId, info.accountName); + sAccountMgr->GetName(info.accountId, info.accountName); info.deleteDate = time_t(fields[3].GetUInt64()); @@ -280,14 +280,14 @@ void ChatHandler::HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo } // check character count - uint32 charcount = sAccountMgr.GetCharactersCount(delInfo.accountId); + uint32 charcount = sAccountMgr->GetCharactersCount(delInfo.accountId); if (charcount >= 10) { PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); return; } - if (sObjectMgr.GetPlayerGUIDByName(delInfo.name)) + if (sObjectMgr->GetPlayerGUIDByName(delInfo.name)) { PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); return; @@ -352,7 +352,7 @@ bool ChatHandler::HandleCharacterDeletedRestoreCommand(const char* args) if (newAccount && newAccount != delInfo.accountId) { delInfo.accountId = newAccount; - sAccountMgr.GetName(newAccount, delInfo.accountName); + sAccountMgr->GetName(newAccount, delInfo.accountName); } HandleCharacterDeletedRestoreHelper(delInfo); @@ -447,7 +447,7 @@ bool ChatHandler::HandleCharacterEraseCommand(const char* args){ uint64 character_guid; uint32 account_id; - Player *player = sObjectMgr.GetPlayer(character_name.c_str()); + Player *player = sObjectMgr->GetPlayer(character_name.c_str()); if (player) { character_guid = player->GetGUID(); @@ -456,7 +456,7 @@ bool ChatHandler::HandleCharacterEraseCommand(const char* args){ } else { - character_guid = sObjectMgr.GetPlayerGUIDByName(character_name); + character_guid = sObjectMgr->GetPlayerGUIDByName(character_name); if (!character_guid) { PSendSysMessage(LANG_NO_PLAYER,character_name.c_str()); @@ -464,11 +464,11 @@ bool ChatHandler::HandleCharacterEraseCommand(const char* args){ return false; } - account_id = sObjectMgr.GetPlayerAccountIdByGUID(character_guid); + account_id = sObjectMgr->GetPlayerAccountIdByGUID(character_guid); } std::string account_name; - sAccountMgr.GetName (account_id,account_name); + sAccountMgr->GetName (account_id,account_name); Player::DeleteFromDB(character_guid, account_id, true, true); PSendSysMessage(LANG_CHARACTER_DELETED,character_name.c_str(),GUID_LOPART(character_guid),account_name.c_str(), account_id); diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp index 1052c08a281..ba49c9dcf57 100755 --- a/src/server/worldserver/RemoteAccess/RASocket.cpp +++ b/src/server/worldserver/RemoteAccess/RASocket.cpp @@ -213,7 +213,7 @@ int RASocket::check_password(const std::string& user, const std::string& pass) AccountMgr::normalizeString(safe_pass); LoginDatabase.escape_string(safe_pass); - std::string hash = sAccountMgr.CalculateShaPassHash(safe_user, safe_pass); + std::string hash = sAccountMgr->CalculateShaPassHash(safe_user, safe_pass); QueryResult check = LoginDatabase.PQuery( "SELECT 1 FROM account WHERE username = '%s' AND sha_pass_hash = '%s'", diff --git a/src/server/worldserver/TCSoap/TCSoap.cpp b/src/server/worldserver/TCSoap/TCSoap.cpp index eaf5f8c41ff..2bdc4b49678 100755 --- a/src/server/worldserver/TCSoap/TCSoap.cpp +++ b/src/server/worldserver/TCSoap/TCSoap.cpp @@ -91,20 +91,20 @@ int ns1__executeCommand(soap* soap, char* command, char** result) return 401; } - uint32 accountId = sAccountMgr.GetId(soap->userid); + uint32 accountId = sAccountMgr->GetId(soap->userid); if(!accountId) { sLog.outDebug("TCSoap: Client used invalid username '%s'", soap->userid); return 401; } - if(!sAccountMgr.CheckPassword(accountId, soap->passwd)) + if(!sAccountMgr->CheckPassword(accountId, soap->passwd)) { sLog.outDebug("TCSoap: invalid password for account '%s'", soap->userid); return 401; } - if(sAccountMgr.GetSecurity(accountId) < SEC_ADMINISTRATOR) + if(sAccountMgr->GetSecurity(accountId) < SEC_ADMINISTRATOR) { sLog.outDebug("TCSoap: %s's gmlevel is too low", soap->userid); return 403; diff --git a/src/server/worldserver/WorldThread/WorldRunnable.cpp b/src/server/worldserver/WorldThread/WorldRunnable.cpp index c0ef054e7c2..bcb2cb6190b 100755 --- a/src/server/worldserver/WorldThread/WorldRunnable.cpp +++ b/src/server/worldserver/WorldThread/WorldRunnable.cpp @@ -46,7 +46,7 @@ void WorldRunnable::run() uint32 prevSleepTime = 0; // used for balanced full tick time length near WORLD_SLEEP_CONST - sScriptMgr.OnStartup(); + sScriptMgr->OnStartup(); ///- While we have not World::m_stopEvent, update the world while (!World::IsStopped()) @@ -80,16 +80,16 @@ void WorldRunnable::run() #endif } - sScriptMgr.OnShutdown(); + sScriptMgr->OnShutdown(); sWorld.KickAll(); // save and kick all players sWorld.UpdateSessions( 1 ); // real players unload required UpdateSessions call // unload battleground templates before different singletons destroyed - sBattlegroundMgr.DeleteAllBattlegrounds(); + sBattlegroundMgr->DeleteAllBattlegrounds(); sWorldSocketMgr->StopNetwork(); - sMapMgr.UnloadAll(); // unload all grids (including locked in memory) + sMapMgr->UnloadAll(); // unload all grids (including locked in memory) } |