Core: Get rid of dirty operator workaround for ACE_Singleton class implementation

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-12-22 21:25:23 +01:00
parent 0948fc5bbe
commit 0f3b9019a8
159 changed files with 1943 additions and 1939 deletions
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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
@@ -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;
@@ -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);
@@ -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
@@ -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;
+1 -1
View File
@@ -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);
+15 -15
View File
@@ -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)
@@ -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)
{
@@ -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
+1 -2
View File
@@ -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
+42 -42
View File
@@ -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());
@@ -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
+1 -1
View File
@@ -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
@@ -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;
@@ -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
+14 -14
View File
@@ -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;
+62 -62
View File
@@ -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);
}
@@ -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()))
@@ -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
@@ -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);
}
}
@@ -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;
@@ -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)
@@ -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)
@@ -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))
@@ -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;
+20 -20
View File
@@ -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);
+21 -21
View File
@@ -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();
}
+2 -2
View File
@@ -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;
+5 -5
View File
@@ -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();
+34 -34
View File
@@ -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
@@ -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;
}
+14 -14
View File
@@ -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);
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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++);
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+20 -20
View File
@@ -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)
+1 -1
View File
@@ -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
+20 -20
View File
@@ -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
}
+38 -38
View File
@@ -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;
+1 -1
View File
@@ -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
+32 -32
View File
@@ -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);
}
}
@@ -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()
@@ -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();
}
+5 -5
View File
@@ -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;
+9 -9
View File
@@ -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;
+20 -20
View File
@@ -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);
}
File diff suppressed because it is too large Load Diff
@@ -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?)
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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())
@@ -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;
}
+39 -39
View File
@@ -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
+9 -9
View File
@@ -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)
+33 -33
View File
@@ -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();
}
+1 -1
View File
@@ -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);
+3 -3
View File
@@ -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);
+27 -27
View File
@@ -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)
+1 -1
View File
@@ -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());
+3 -3
View File
@@ -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);
}
+35 -35
View File
@@ -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);
}
+22 -22
View File
@@ -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
+1 -1
View File
@@ -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;
@@ -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;
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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);
+4 -4
View File
@@ -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
+17 -17
View File
@@ -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()));
}
}
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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
+7 -7
View File
@@ -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;
}
}
@@ -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)
+10 -10
View File
@@ -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
+3 -3
View File
@@ -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));
+1 -1
View File
@@ -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_*/
+28 -28
View File
@@ -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;
+1 -1
View File
@@ -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<>
+2 -2
View File
@@ -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)
{
+3 -3
View File
@@ -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);
}
+8 -8
View File
@@ -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)
+3 -3
View File
@@ -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();
}
}
+1 -1
View File
@@ -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
@@ -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;
@@ -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);
@@ -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)
{
@@ -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);
@@ -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;
@@ -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;
@@ -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);
@@ -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);
}
@@ -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);
@@ -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());
}
@@ -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;
@@ -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;
@@ -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)
{
@@ -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)
@@ -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;

Some files were not shown because too many files have changed in this diff Show More