[8789] Rename several singleton macros to use more consistent names.

* objmgr -> sObjectMgr
 * spellmgr -> sSpellMgr
 * WaypointMgr -> sWaypointMgr
 * poolhandler -> sPoolMgr
 * objaccessor -> sObjectAccessor
 * mapmgr -> sMapMgr
 * sInstanceSaveManager -> sInstanceSaveMgr
 * ticketmgr -> sTicketMgr
 * CreatureEAI_Mgr -> sEventAIMgr
 * auctionmgr -> sAuctionMgr
 * achievementmgr -> sAchievementMgr
This commit is contained in:
XTZGZoReX 2009-11-08 12:11:18 +01:00
parent 539072fcbd
commit 0734adb746
84 changed files with 1113 additions and 1113 deletions

View file

@ -49,7 +49,7 @@ namespace MaNGOS
: i_player(pl), i_msgtype(msgtype), i_textId(textId), i_achievementId(ach_id) {} : i_player(pl), i_msgtype(msgtype), i_textId(textId), i_achievementId(ach_id) {}
void operator()(WorldPacket& data, int32 loc_idx) void operator()(WorldPacket& data, int32 loc_idx)
{ {
char const* text = objmgr.GetMangosString(i_textId,loc_idx); char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
data << uint8(i_msgtype); data << uint8(i_msgtype);
data << uint32(LANG_UNIVERSAL); data << uint32(LANG_UNIVERSAL);
@ -366,7 +366,7 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin
if (!sWorld.getConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER) if (!sWorld.getConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER)
return; return;
AchievementCriteriaEntryList const& achievementCriteriaList = achievementmgr.GetAchievementCriteriaByType(type); AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetAchievementCriteriaByType(type);
for(AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i) for(AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i)
{ {
AchievementCriteriaEntry const *achievementCriteria = (*i); AchievementCriteriaEntry const *achievementCriteria = (*i);
@ -522,7 +522,7 @@ void AchievementMgr::LoadFromDB(QueryResult *achievementResult, QueryResult *cri
uint32 achievement_id = fields[0].GetUInt32(); uint32 achievement_id = fields[0].GetUInt32();
// don't must happen: cleanup at server startup in achievementmgr.LoadCompletedAchievements() // don't must happen: cleanup at server startup in sAchievementMgr.LoadCompletedAchievements()
if(!sAchievementStore.LookupEntry(achievement_id)) if(!sAchievementStore.LookupEntry(achievement_id))
continue; continue;
@ -575,7 +575,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
sLog.outDebug("AchievementMgr::SendAchievementEarned(%u)", achievement->ID); sLog.outDebug("AchievementMgr::SendAchievementEarned(%u)", achievement->ID);
#endif #endif
if(Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId())) if(Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId()))
{ {
MaNGOS::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED,achievement->ID); MaNGOS::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED,achievement->ID);
MaNGOS::LocalizedPacketDo<MaNGOS::AchievementChatBuilder> say_do(say_builder); MaNGOS::LocalizedPacketDo<MaNGOS::AchievementChatBuilder> say_do(say_builder);
@ -665,7 +665,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if (!sWorld.getConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER) if (!sWorld.getConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER)
return; return;
AchievementCriteriaEntryList const& achievementCriteriaList = achievementmgr.GetAchievementCriteriaByType(type); AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetAchievementCriteriaByType(type);
for(AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i) for(AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i)
{ {
AchievementCriteriaEntry const *achievementCriteria = (*i); AchievementCriteriaEntry const *achievementCriteria = (*i);
@ -741,7 +741,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if (achievementCriteria->win_bg.additionalRequirement1_type) if (achievementCriteria->win_bg.additionalRequirement1_type)
{ {
// those requirements couldn't be found in the dbc // those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = achievementmgr.GetCriteriaRequirementSet(achievementCriteria); AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if (!data || !data->Meets(GetPlayer(),unit)) if (!data || !data->Meets(GetPlayer(),unit))
continue; continue;
} }
@ -787,7 +787,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
continue; continue;
// those requirements couldn't be found in the dbc // those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = achievementmgr.GetCriteriaRequirementSet(achievementCriteria); AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if(!data || !data->Meets(GetPlayer(),unit)) if(!data || !data->Meets(GetPlayer(),unit))
continue; continue;
@ -833,7 +833,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
uint32 counter =0; uint32 counter =0;
for(QuestStatusMap::const_iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr!=GetPlayer()->getQuestStatusMap().end(); ++itr) for(QuestStatusMap::const_iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr!=GetPlayer()->getQuestStatusMap().end(); ++itr)
{ {
Quest const* quest = objmgr.GetQuestTemplate(itr->first); Quest const* quest = sObjectMgr.GetQuestTemplate(itr->first);
if(itr->second.m_rewarded && quest->GetZoneOrSort() >= 0 && uint32(quest->GetZoneOrSort()) == achievementCriteria->complete_quests_in_zone.zoneID) if(itr->second.m_rewarded && quest->GetZoneOrSort() >= 0 && uint32(quest->GetZoneOrSort()) == achievementCriteria->complete_quests_in_zone.zoneID)
counter++; counter++;
} }
@ -886,7 +886,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if(!miscvalue1) if(!miscvalue1)
continue; continue;
Map const* map = GetPlayer()->IsInWorld() ? GetPlayer()->GetMap() : mapmgr.FindMap(GetPlayer()->GetMapId(), GetPlayer()->GetInstanceId()); Map const* map = GetPlayer()->IsInWorld() ? GetPlayer()->GetMap() : sMapMgr.FindMap(GetPlayer()->GetMapId(), GetPlayer()->GetInstanceId());
if(!map || !map->IsDungeon()) if(!map || !map->IsDungeon())
continue; continue;
@ -955,7 +955,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
continue; continue;
// those requirements couldn't be found in the dbc // those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = achievementmgr.GetCriteriaRequirementSet(achievementCriteria); AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if(!data || !data->Meets(GetPlayer(),unit)) if(!data || !data->Meets(GetPlayer(),unit))
continue; continue;
@ -997,7 +997,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
case 1789: case 1789:
{ {
// those requirements couldn't be found in the dbc // those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = achievementmgr.GetCriteriaRequirementSet(achievementCriteria); AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if(!data || !data->Meets(GetPlayer(),unit)) if(!data || !data->Meets(GetPlayer(),unit))
continue; continue;
break; break;
@ -1023,7 +1023,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
continue; continue;
// those requirements couldn't be found in the dbc // those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = achievementmgr.GetCriteriaRequirementSet(achievementCriteria); AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if(!data) if(!data)
continue; continue;
@ -1053,7 +1053,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if(achievementCriteria->loot_type.lootTypeCount==1) if(achievementCriteria->loot_type.lootTypeCount==1)
{ {
// those requirements couldn't be found in the dbc // those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = achievementmgr.GetCriteriaRequirementSet(achievementCriteria); AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if(!data || !data->Meets(GetPlayer(),unit)) if(!data || !data->Meets(GetPlayer(),unit))
continue; continue;
} }
@ -1076,7 +1076,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if(achievementCriteria->win_rated_arena.flag==ACHIEVEMENT_CRITERIA_CONDITION_NO_LOOSE) if(achievementCriteria->win_rated_arena.flag==ACHIEVEMENT_CRITERIA_CONDITION_NO_LOOSE)
{ {
// those requirements couldn't be found in the dbc // those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = achievementmgr.GetCriteriaRequirementSet(achievementCriteria); AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if(!data || !data->Meets(GetPlayer(),unit,miscvalue1)) if(!data || !data->Meets(GetPlayer(),unit,miscvalue1))
{ {
// reset the progress as we have a win without the requirement. // reset the progress as we have a win without the requirement.
@ -1191,7 +1191,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if(achievementCriteria->do_emote.count) if(achievementCriteria->do_emote.count)
{ {
// those requirements couldn't be found in the dbc // those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = achievementmgr.GetCriteriaRequirementSet(achievementCriteria); AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if(!data || !data->Meets(GetPlayer(),unit)) if(!data || !data->Meets(GetPlayer(),unit))
continue; continue;
} }
@ -1254,7 +1254,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
spellIter != GetPlayer()->GetSpellMap().end(); spellIter != GetPlayer()->GetSpellMap().end();
++spellIter) ++spellIter)
{ {
SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(spellIter->first); SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spellIter->first);
for(SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) for(SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
{ {
if(skillIter->second->skillId == achievementCriteria->learn_skillline_spell.skillLine) if(skillIter->second->skillId == achievementCriteria->learn_skillline_spell.skillLine)
@ -1272,7 +1272,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if (achievementCriteria->win_duel.duelCount) if (achievementCriteria->win_duel.duelCount)
{ {
// those requirements couldn't be found in the dbc // those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = achievementmgr.GetCriteriaRequirementSet(achievementCriteria); AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if (!data) if (!data)
continue; continue;
@ -1301,7 +1301,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
spellIter != GetPlayer()->GetSpellMap().end(); spellIter != GetPlayer()->GetSpellMap().end();
++spellIter) ++spellIter)
{ {
SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(spellIter->first); SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spellIter->first);
for(SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) for(SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
if (skillIter->second->skillId == achievementCriteria->learn_skill_line.skillLine) if (skillIter->second->skillId == achievementCriteria->learn_skill_line.skillLine)
spellCount++; spellCount++;
@ -1371,7 +1371,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
CompletedAchievement(achievement); CompletedAchievement(achievement);
} }
if(AchievementEntryList const* achRefList = achievementmgr.GetAchievementByReferencedId(achievement->ID)) if(AchievementEntryList const* achRefList = sAchievementMgr.GetAchievementByReferencedId(achievement->ID))
{ {
for(AchievementEntryList::const_iterator itr = achRefList->begin(); itr != achRefList->end(); ++itr) for(AchievementEntryList::const_iterator itr = achRefList->begin(); itr != achRefList->end(); ++itr)
if(IsCompletedAchievement(*itr)) if(IsCompletedAchievement(*itr))
@ -1392,7 +1392,7 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve
if(achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL)) if(achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL))
{ {
// someone on this realm has already completed that achievement // someone on this realm has already completed that achievement
if(achievementmgr.IsRealmCompleted(achievement)) if(sAchievementMgr.IsRealmCompleted(achievement))
return false; return false;
} }
@ -1554,7 +1554,7 @@ bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry)
uint32 achievmentForTestId = entry->refAchievement ? entry->refAchievement : entry->ID; uint32 achievmentForTestId = entry->refAchievement ? entry->refAchievement : entry->ID;
uint32 achievmentForTestCount = entry->count; uint32 achievmentForTestCount = entry->count;
AchievementCriteriaEntryList const* cList = achievementmgr.GetAchievementCriteriaByAchievement(achievmentForTestId); AchievementCriteriaEntryList const* cList = sAchievementMgr.GetAchievementCriteriaByAchievement(achievmentForTestId);
if(!cList) if(!cList)
return false; return false;
uint32 count = 0; uint32 count = 0;
@ -1683,12 +1683,12 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
// don't insert for ACHIEVEMENT_FLAG_REALM_FIRST_KILL since otherwise only the first group member would reach that achievement // 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? // TODO: where do set this instead?
if(!(achievement->flags & ACHIEVEMENT_FLAG_REALM_FIRST_KILL)) if(!(achievement->flags & ACHIEVEMENT_FLAG_REALM_FIRST_KILL))
achievementmgr.SetRealmCompleted(achievement); sAchievementMgr.SetRealmCompleted(achievement);
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT);
// reward items and titles if any // reward items and titles if any
AchievementReward const* reward = achievementmgr.GetAchievementReward(achievement); AchievementReward const* reward = sAchievementMgr.GetAchievementReward(achievement);
// no rewards // no rewards
if(!reward) if(!reward)
@ -1713,7 +1713,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
std::string text = reward->text; std::string text = reward->text;
if ( loc_idx >= 0 ) if ( loc_idx >= 0 )
{ {
if(AchievementRewardLocale const* loc = achievementmgr.GetAchievementRewardLocale(achievement)) if(AchievementRewardLocale const* loc = sAchievementMgr.GetAchievementRewardLocale(achievement))
{ {
if (loc->subject.size() > size_t(loc_idx) && !loc->subject[loc_idx].empty()) if (loc->subject.size() > size_t(loc_idx) && !loc->subject[loc_idx].empty())
subject = loc->subject[loc_idx]; subject = loc->subject[loc_idx];
@ -1722,7 +1722,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
} }
} }
uint32 itemTextId = objmgr.CreateItemText( text ); uint32 itemTextId = sObjectMgr.CreateItemText( text );
MailDraft draft(subject, itemTextId); MailDraft draft(subject, itemTextId);
@ -2164,7 +2164,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
std::string str = fields[1+2*(i-1)].GetCppString(); std::string str = fields[1+2*(i-1)].GetCppString();
if(!str.empty()) if(!str.empty())
{ {
int idx = objmgr.GetOrNewIndexForLocale(LocaleConstant(i)); int idx = sObjectMgr.GetOrNewIndexForLocale(LocaleConstant(i));
if(idx >= 0) if(idx >= 0)
{ {
if(data.subject.size() <= size_t(idx)) if(data.subject.size() <= size_t(idx))
@ -2176,7 +2176,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
str = fields[1+2*(i-1)+1].GetCppString(); str = fields[1+2*(i-1)+1].GetCppString();
if(!str.empty()) if(!str.empty())
{ {
int idx = objmgr.GetOrNewIndexForLocale(LocaleConstant(i)); int idx = sObjectMgr.GetOrNewIndexForLocale(LocaleConstant(i));
if(idx >= 0) if(idx >= 0)
{ {
if(data.text.size() <= size_t(idx)) if(data.text.size() <= size_t(idx))

View file

@ -323,6 +323,6 @@ class AchievementGlobalMgr
AchievementRewardLocales m_achievementRewardLocales; AchievementRewardLocales m_achievementRewardLocales;
}; };
#define achievementmgr MaNGOS::Singleton<AchievementGlobalMgr>::Instance() #define sAchievementMgr MaNGOS::Singleton<AchievementGlobalMgr>::Instance()
#endif #endif

View file

@ -50,9 +50,9 @@ ArenaTeam::~ArenaTeam()
bool ArenaTeam::Create(uint64 captainGuid, uint32 type, std::string ArenaTeamName) bool ArenaTeam::Create(uint64 captainGuid, uint32 type, std::string ArenaTeamName)
{ {
if(!objmgr.GetPlayer(captainGuid)) // player not exist if(!sObjectMgr.GetPlayer(captainGuid)) // player not exist
return false; return false;
if(objmgr.GetArenaTeamByName(ArenaTeamName)) // arena team with this name already exist if(sObjectMgr.GetArenaTeamByName(ArenaTeamName)) // arena team with this name already exist
return false; return false;
sLog.outDebug("GUILD: creating arena team %s to leader: %u", ArenaTeamName.c_str(), GUID_LOPART(captainGuid)); sLog.outDebug("GUILD: creating arena team %s to leader: %u", ArenaTeamName.c_str(), GUID_LOPART(captainGuid));
@ -61,7 +61,7 @@ bool ArenaTeam::Create(uint64 captainGuid, uint32 type, std::string ArenaTeamNam
m_Name = ArenaTeamName; m_Name = ArenaTeamName;
m_Type = type; m_Type = type;
m_TeamId = objmgr.GenerateArenaTeamId(); m_TeamId = sObjectMgr.GenerateArenaTeamId();
// ArenaTeamName already assigned to ArenaTeam::name, use it to encode string for DB // ArenaTeamName already assigned to ArenaTeam::name, use it to encode string for DB
CharacterDatabase.escape_string(ArenaTeamName); CharacterDatabase.escape_string(ArenaTeamName);
@ -90,7 +90,7 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)
if(GetMembersSize() >= GetType() * 2) if(GetMembersSize() >= GetType() * 2)
return false; return false;
Player *pl = objmgr.GetPlayer(PlayerGuid); Player *pl = sObjectMgr.GetPlayer(PlayerGuid);
if(pl) if(pl)
{ {
if(pl->GetArenaTeamId(GetSlot())) if(pl->GetArenaTeamId(GetSlot()))
@ -250,7 +250,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult *arenaTeamMembersResult)
void ArenaTeam::SetCaptain(const uint64& guid) void ArenaTeam::SetCaptain(const uint64& guid)
{ {
// disable remove/promote buttons // disable remove/promote buttons
Player *oldcaptain = objmgr.GetPlayer(GetCaptain()); Player *oldcaptain = sObjectMgr.GetPlayer(GetCaptain());
if(oldcaptain) if(oldcaptain)
oldcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * ARENA_TEAM_END) + ARENA_TEAM_MEMBER, 1); oldcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * ARENA_TEAM_END) + ARENA_TEAM_MEMBER, 1);
@ -261,7 +261,7 @@ void ArenaTeam::SetCaptain(const uint64& guid)
CharacterDatabase.PExecute("UPDATE arena_team SET captainguid = '%u' WHERE arenateamid = '%u'", GUID_LOPART(guid), m_TeamId); CharacterDatabase.PExecute("UPDATE arena_team SET captainguid = '%u' WHERE arenateamid = '%u'", GUID_LOPART(guid), m_TeamId);
// enable remove/promote buttons // enable remove/promote buttons
Player *newcaptain = objmgr.GetPlayer(guid); Player *newcaptain = sObjectMgr.GetPlayer(guid);
if(newcaptain) if(newcaptain)
newcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * ARENA_TEAM_END) + ARENA_TEAM_MEMBER, 0); newcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * ARENA_TEAM_END) + ARENA_TEAM_MEMBER, 0);
} }
@ -277,7 +277,7 @@ void ArenaTeam::DelMember(uint64 guid)
} }
} }
if(Player *player = objmgr.GetPlayer(guid)) if(Player *player = sObjectMgr.GetPlayer(guid))
{ {
player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0); player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);
// delete all info regarding this team // delete all info regarding this team
@ -309,7 +309,7 @@ void ArenaTeam::Disband(WorldSession *session)
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u'", m_TeamId); //< this should be alredy done by calling DelMember(memberGuids[j]); for each member CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u'", m_TeamId); //< this should be alredy done by calling DelMember(memberGuids[j]); for each member
CharacterDatabase.PExecute("DELETE FROM arena_team_stats WHERE arenateamid = '%u'", m_TeamId); CharacterDatabase.PExecute("DELETE FROM arena_team_stats WHERE arenateamid = '%u'", m_TeamId);
CharacterDatabase.CommitTransaction(); CharacterDatabase.CommitTransaction();
objmgr.RemoveArenaTeam(m_TeamId); sObjectMgr.RemoveArenaTeam(m_TeamId);
} }
void ArenaTeam::Roster(WorldSession *session) void ArenaTeam::Roster(WorldSession *session)
@ -326,7 +326,7 @@ void ArenaTeam::Roster(WorldSession *session)
for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
{ {
pl = objmgr.GetPlayer(itr->guid); pl = sObjectMgr.GetPlayer(itr->guid);
data << uint64(itr->guid); // guid data << uint64(itr->guid); // guid
data << uint8((pl ? 1 : 0)); // online flag data << uint8((pl ? 1 : 0)); // online flag
@ -384,7 +384,7 @@ void ArenaTeam::NotifyStatsChanged()
// updates arena team stats for every member of the team (not only the ones who participated!) // 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) for(MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
{ {
Player * plr = objmgr.GetPlayer(itr->guid); Player * plr = sObjectMgr.GetPlayer(itr->guid);
if(plr) if(plr)
Stats(plr->GetSession()); Stats(plr->GetSession());
} }
@ -457,7 +457,7 @@ void ArenaTeam::BroadcastPacket(WorldPacket *packet)
{ {
for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
{ {
Player *player = objmgr.GetPlayer(itr->guid); Player *player = sObjectMgr.GetPlayer(itr->guid);
if(player) if(player)
player->GetSession()->SendPacket(packet); player->GetSession()->SendPacket(packet);
} }
@ -529,8 +529,8 @@ void ArenaTeam::FinishGame(int32 mod)
m_stats.games_season += 1; m_stats.games_season += 1;
// update team's rank // update team's rank
m_stats.rank = 1; m_stats.rank = 1;
ObjectMgr::ArenaTeamMap::const_iterator i = objmgr.GetArenaTeamMapBegin(); ObjectMgr::ArenaTeamMap::const_iterator i = sObjectMgr.GetArenaTeamMapBegin();
for ( ; i != objmgr.GetArenaTeamMapEnd(); ++i) for ( ; i != sObjectMgr.GetArenaTeamMapEnd(); ++i)
{ {
if (i->second->GetType() == this->m_Type && i->second->GetStats().rating > m_stats.rating) if (i->second->GetType() == this->m_Type && i->second->GetStats().rating > m_stats.rating)
++m_stats.rank; ++m_stats.rank;
@ -700,7 +700,7 @@ bool ArenaTeam::IsFighting() const
{ {
for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
{ {
if (Player *p = objmgr.GetPlayer(itr->guid)) if (Player *p = sObjectMgr.GetPlayer(itr->guid))
{ {
if (p->GetMap()->IsBattleArena()) if (p->GetMap()->IsBattleArena())
return true; return true;

View file

@ -34,13 +34,13 @@ void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket & recv_data)
recv_data >> guid; recv_data >> guid;
sLog.outDebug("Inspect Arena stats (GUID: %u TypeId: %u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid))); sLog.outDebug("Inspect Arena stats (GUID: %u TypeId: %u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid)));
if(Player *plr = objmgr.GetPlayer(guid)) if(Player *plr = sObjectMgr.GetPlayer(guid))
{ {
for (uint8 i = 0; i < MAX_ARENA_SLOT; ++i) for (uint8 i = 0; i < MAX_ARENA_SLOT; ++i)
{ {
if(uint32 a_id = plr->GetArenaTeamId(i)) if(uint32 a_id = plr->GetArenaTeamId(i))
{ {
if(ArenaTeam *at = objmgr.GetArenaTeamById(a_id)) if(ArenaTeam *at = sObjectMgr.GetArenaTeamById(a_id))
at->InspectStats(this, plr->GetGUID()); at->InspectStats(this, plr->GetGUID());
} }
} }
@ -54,7 +54,7 @@ void WorldSession::HandleArenaTeamQueryOpcode(WorldPacket & recv_data)
uint32 ArenaTeamId; uint32 ArenaTeamId;
recv_data >> ArenaTeamId; recv_data >> ArenaTeamId;
if(ArenaTeam *arenateam = objmgr.GetArenaTeamById(ArenaTeamId)) if(ArenaTeam *arenateam = sObjectMgr.GetArenaTeamById(ArenaTeamId))
{ {
arenateam->Query(this); arenateam->Query(this);
arenateam->Stats(this); arenateam->Stats(this);
@ -68,7 +68,7 @@ void WorldSession::HandleArenaTeamRosterOpcode(WorldPacket & recv_data)
uint32 ArenaTeamId; // arena team id uint32 ArenaTeamId; // arena team id
recv_data >> ArenaTeamId; recv_data >> ArenaTeamId;
if(ArenaTeam *arenateam = objmgr.GetArenaTeamById(ArenaTeamId)) if(ArenaTeam *arenateam = sObjectMgr.GetArenaTeamById(ArenaTeamId))
arenateam->Roster(this); arenateam->Roster(this);
} }
@ -103,7 +103,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data)
return; return;
} }
ArenaTeam *arenateam = objmgr.GetArenaTeamById(ArenaTeamId); ArenaTeam *arenateam = sObjectMgr.GetArenaTeamById(ArenaTeamId);
if(!arenateam) if(!arenateam)
{ {
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", "", ERR_ARENA_TEAM_PLAYER_NOT_IN_TEAM); SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", "", ERR_ARENA_TEAM_PLAYER_NOT_IN_TEAM);
@ -154,7 +154,7 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/)
{ {
sLog.outDebug("CMSG_ARENA_TEAM_ACCEPT"); // empty opcode sLog.outDebug("CMSG_ARENA_TEAM_ACCEPT"); // empty opcode
ArenaTeam *at = objmgr.GetArenaTeamById(_player->GetArenaTeamIdInvited()); ArenaTeam *at = sObjectMgr.GetArenaTeamById(_player->GetArenaTeamIdInvited());
if(!at) if(!at)
return; return;
@ -164,7 +164,7 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/)
return; return;
} }
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && _player->GetTeam() != objmgr.GetPlayerTeamByGUID(at->GetCaptain())) if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && _player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(at->GetCaptain()))
{ {
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S,"","",ERR_ARENA_TEAM_NOT_ALLIED);// not let enemies sign petition SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S,"","",ERR_ARENA_TEAM_NOT_ALLIED);// not let enemies sign petition
return; return;
@ -196,7 +196,7 @@ void WorldSession::HandleArenaTeamLeaveOpcode(WorldPacket & recv_data)
uint32 ArenaTeamId; // arena team id uint32 ArenaTeamId; // arena team id
recv_data >> ArenaTeamId; recv_data >> ArenaTeamId;
ArenaTeam *at = objmgr.GetArenaTeamById(ArenaTeamId); ArenaTeam *at = sObjectMgr.GetArenaTeamById(ArenaTeamId);
if(!at) if(!at)
return; return;
@ -233,7 +233,7 @@ void WorldSession::HandleArenaTeamDisbandOpcode(WorldPacket & recv_data)
uint32 ArenaTeamId; // arena team id uint32 ArenaTeamId; // arena team id
recv_data >> ArenaTeamId; recv_data >> ArenaTeamId;
if(ArenaTeam *at = objmgr.GetArenaTeamById(ArenaTeamId)) if(ArenaTeam *at = sObjectMgr.GetArenaTeamById(ArenaTeamId))
{ {
if(at->GetCaptain() != _player->GetGUID()) if(at->GetCaptain() != _player->GetGUID())
return; return;
@ -256,7 +256,7 @@ void WorldSession::HandleArenaTeamRemoveOpcode(WorldPacket & recv_data)
recv_data >> ArenaTeamId; recv_data >> ArenaTeamId;
recv_data >> name; recv_data >> name;
ArenaTeam *at = objmgr.GetArenaTeamById(ArenaTeamId); ArenaTeam *at = sObjectMgr.GetArenaTeamById(ArenaTeamId);
if(!at) // arena team not found if(!at) // arena team not found
return; return;
@ -300,7 +300,7 @@ void WorldSession::HandleArenaTeamLeaderOpcode(WorldPacket & recv_data)
recv_data >> ArenaTeamId; recv_data >> ArenaTeamId;
recv_data >> name; recv_data >> name;
ArenaTeam *at = objmgr.GetArenaTeamById(ArenaTeamId); ArenaTeam *at = sObjectMgr.GetArenaTeamById(ArenaTeamId);
if(!at) // arena team not found if(!at) // arena team not found
return; return;

View file

@ -107,11 +107,11 @@ void WorldSession::SendAuctionOwnerNotification( AuctionEntry* auction)
void WorldSession::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 newPrice) void WorldSession::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 newPrice)
{ {
uint64 oldBidder_guid = MAKE_NEW_GUID(auction->bidder,0, HIGHGUID_PLAYER); uint64 oldBidder_guid = MAKE_NEW_GUID(auction->bidder,0, HIGHGUID_PLAYER);
Player *oldBidder = objmgr.GetPlayer(oldBidder_guid); Player *oldBidder = sObjectMgr.GetPlayer(oldBidder_guid);
uint32 oldBidder_accId = 0; uint32 oldBidder_accId = 0;
if(!oldBidder) if(!oldBidder)
oldBidder_accId = objmgr.GetPlayerAccountIdByGUID(oldBidder_guid); oldBidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(oldBidder_guid);
// old bidder exist // old bidder exist
if(oldBidder || oldBidder_accId) if(oldBidder || oldBidder_accId)
@ -132,11 +132,11 @@ void WorldSession::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 newPri
void WorldSession::SendAuctionCancelledToBidderMail( AuctionEntry* auction ) void WorldSession::SendAuctionCancelledToBidderMail( AuctionEntry* auction )
{ {
uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER); uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER);
Player *bidder = objmgr.GetPlayer(bidder_guid); Player *bidder = sObjectMgr.GetPlayer(bidder_guid);
uint32 bidder_accId = 0; uint32 bidder_accId = 0;
if(!bidder) if(!bidder)
bidder_accId = objmgr.GetPlayerAccountIdByGUID(bidder_guid); bidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(bidder_guid);
// bidder exist // bidder exist
if(bidder || bidder_accId) if(bidder || bidder_accId)
@ -202,7 +202,7 @@ void WorldSession::HandleAuctionSellItem( WorldPacket & recv_data )
Item *it = pl->GetItemByGuid( item ); Item *it = pl->GetItemByGuid( item );
//do not allow to sell already auctioned items //do not allow to sell already auctioned items
if(auctionmgr.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)); 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); SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR);
@ -227,7 +227,7 @@ void WorldSession::HandleAuctionSellItem( WorldPacket & recv_data )
return; return;
} }
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() ); AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap( pCreature->getFaction() );
//we have to take deposit : //we have to take deposit :
uint32 deposit = AuctionHouseMgr::GetAuctionDeposit( auctionHouseEntry, etime, it ); uint32 deposit = AuctionHouseMgr::GetAuctionDeposit( auctionHouseEntry, etime, it );
@ -248,7 +248,7 @@ void WorldSession::HandleAuctionSellItem( WorldPacket & recv_data )
uint32 auction_time = uint32(etime * sWorld.getRate(RATE_AUCTION_TIME)); uint32 auction_time = uint32(etime * sWorld.getRate(RATE_AUCTION_TIME));
AuctionEntry *AH = new AuctionEntry; AuctionEntry *AH = new AuctionEntry;
AH->Id = objmgr.GenerateAuctionID(); AH->Id = sObjectMgr.GenerateAuctionID();
AH->auctioneer = GUID_LOPART(auctioneer); AH->auctioneer = GUID_LOPART(auctioneer);
AH->item_guidlow = GUID_LOPART(item); AH->item_guidlow = GUID_LOPART(item);
AH->item_template = it->GetEntry(); AH->item_template = it->GetEntry();
@ -264,7 +264,7 @@ void WorldSession::HandleAuctionSellItem( WorldPacket & recv_data )
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), GUID_LOPART(auctioneer), bid, buyout, auction_time, AH->GetHouseId()); 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), GUID_LOPART(auctioneer), bid, buyout, auction_time, AH->GetHouseId());
auctionHouse->AddAuction(AH); auctionHouse->AddAuction(AH);
auctionmgr.AddAItem(it); sAuctionMgr.AddAItem(it);
pl->MoveItemFromInventory( it->GetBagSlot(), it->GetSlot(), true); pl->MoveItemFromInventory( it->GetBagSlot(), it->GetSlot(), true);
CharacterDatabase.BeginTransaction(); CharacterDatabase.BeginTransaction();
@ -300,7 +300,7 @@ void WorldSession::HandleAuctionPlaceBid( WorldPacket & recv_data )
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED)) if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH); GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() ); AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap( pCreature->getFaction() );
AuctionEntry *auction = auctionHouse->GetAuction(auctionId); AuctionEntry *auction = auctionHouse->GetAuction(auctionId);
Player *pl = GetPlayer(); Player *pl = GetPlayer();
@ -313,8 +313,8 @@ void WorldSession::HandleAuctionPlaceBid( WorldPacket & recv_data )
} }
// impossible have online own another character (use this for speedup check in case online owner) // impossible have online own another character (use this for speedup check in case online owner)
Player* auction_owner = objmgr.GetPlayer(MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER)); Player* auction_owner = sObjectMgr.GetPlayer(MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER));
if( !auction_owner && objmgr.GetPlayerAccountIdByGUID(MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER)) == pl->GetSession()->GetAccountId()) if( !auction_owner && sObjectMgr.GetPlayerAccountIdByGUID(MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER)) == pl->GetSession()->GetAccountId())
{ {
//you cannot bid your another character auction: //you cannot bid your another character auction:
SendAuctionCommandResult( 0, AUCTION_PLACE_BID, CANNOT_BID_YOUR_AUCTION_ERROR ); SendAuctionCommandResult( 0, AUCTION_PLACE_BID, CANNOT_BID_YOUR_AUCTION_ERROR );
@ -387,13 +387,13 @@ void WorldSession::HandleAuctionPlaceBid( WorldPacket & recv_data )
auction->bid = auction->buyout; auction->bid = auction->buyout;
GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, auction->buyout); GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, auction->buyout);
auctionmgr.SendAuctionSalePendingMail( auction ); sAuctionMgr.SendAuctionSalePendingMail( auction );
auctionmgr.SendAuctionSuccessfulMail( auction ); sAuctionMgr.SendAuctionSuccessfulMail( auction );
auctionmgr.SendAuctionWonMail( auction ); sAuctionMgr.SendAuctionWonMail( auction );
SendAuctionCommandResult(auction->Id, AUCTION_PLACE_BID, AUCTION_OK); SendAuctionCommandResult(auction->Id, AUCTION_PLACE_BID, AUCTION_OK);
auctionmgr.RemoveAItem(auction->item_guidlow); sAuctionMgr.RemoveAItem(auction->item_guidlow);
auctionHouse->RemoveAuction(auction->Id); auctionHouse->RemoveAuction(auction->Id);
auction->DeleteFromDB(); auction->DeleteFromDB();
@ -424,14 +424,14 @@ void WorldSession::HandleAuctionRemoveItem( WorldPacket & recv_data )
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED)) if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH); GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() ); AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap( pCreature->getFaction() );
AuctionEntry *auction = auctionHouse->GetAuction(auctionId); AuctionEntry *auction = auctionHouse->GetAuction(auctionId);
Player *pl = GetPlayer(); Player *pl = GetPlayer();
if (auction && auction->owner == pl->GetGUIDLow()) if (auction && auction->owner == pl->GetGUIDLow())
{ {
Item *pItem = auctionmgr.GetAItem(auction->item_guidlow); Item *pItem = sAuctionMgr.GetAItem(auction->item_guidlow);
if (pItem) if (pItem)
{ {
if (auction->bidder > 0) // If we have a bidder, we have to send him the money he paid if (auction->bidder > 0) // If we have a bidder, we have to send him the money he paid
@ -474,7 +474,7 @@ void WorldSession::HandleAuctionRemoveItem( WorldPacket & recv_data )
auction->DeleteFromDB(); auction->DeleteFromDB();
pl->SaveInventoryAndGoldToDB(); pl->SaveInventoryAndGoldToDB();
CharacterDatabase.CommitTransaction(); CharacterDatabase.CommitTransaction();
auctionmgr.RemoveAItem( auction->item_guidlow ); sAuctionMgr.RemoveAItem( auction->item_guidlow );
auctionHouse->RemoveAuction( auction->Id ); auctionHouse->RemoveAuction( auction->Id );
delete auction; delete auction;
} }
@ -506,7 +506,7 @@ void WorldSession::HandleAuctionListBidderItems( WorldPacket & recv_data )
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED)) if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH); GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() ); AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap( pCreature->getFaction() );
WorldPacket data( SMSG_AUCTION_BIDDER_LIST_RESULT, (4+4+4) ); WorldPacket data( SMSG_AUCTION_BIDDER_LIST_RESULT, (4+4+4) );
Player *pl = GetPlayer(); Player *pl = GetPlayer();
@ -553,7 +553,7 @@ void WorldSession::HandleAuctionListOwnerItems( WorldPacket & recv_data )
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED)) if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH); GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() ); AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap( pCreature->getFaction() );
WorldPacket data( SMSG_AUCTION_OWNER_LIST_RESULT, (4+4+4) ); WorldPacket data( SMSG_AUCTION_OWNER_LIST_RESULT, (4+4+4) );
data << (uint32) 0; // amount place holder data << (uint32) 0; // amount place holder
@ -597,7 +597,7 @@ void WorldSession::HandleAuctionListItems( WorldPacket & recv_data )
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED)) if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH); GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.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", //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); // GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid)), listfrom, searchedname.c_str(), levelmin, levelmax, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, usable);

View file

@ -79,7 +79,7 @@ void AuctionHouseMgr::SendAuctionWonMail( AuctionEntry *auction )
return; return;
uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER); uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER);
Player *bidder = objmgr.GetPlayer(bidder_guid); Player *bidder = sObjectMgr.GetPlayer(bidder_guid);
uint32 bidder_accId = 0; uint32 bidder_accId = 0;
@ -96,30 +96,30 @@ void AuctionHouseMgr::SendAuctionWonMail( AuctionEntry *auction )
} }
else else
{ {
bidder_accId = objmgr.GetPlayerAccountIdByGUID(bidder_guid); bidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(bidder_guid);
bidder_security = accmgr.GetSecurity(bidder_accId); bidder_security = accmgr.GetSecurity(bidder_accId);
if(bidder_security > SEC_PLAYER ) // not do redundant DB requests if(bidder_security > SEC_PLAYER ) // not do redundant DB requests
{ {
if(!objmgr.GetPlayerNameByGUID(bidder_guid,bidder_name)) if(!sObjectMgr.GetPlayerNameByGUID(bidder_guid,bidder_name))
bidder_name = objmgr.GetMangosStringForDBCLocale(LANG_UNKNOWN); bidder_name = sObjectMgr.GetMangosStringForDBCLocale(LANG_UNKNOWN);
} }
} }
if( bidder_security > SEC_PLAYER ) if( bidder_security > SEC_PLAYER )
{ {
std::string owner_name; std::string owner_name;
if(!objmgr.GetPlayerNameByGUID(auction->owner,owner_name)) if(!sObjectMgr.GetPlayerNameByGUID(auction->owner,owner_name))
owner_name = objmgr.GetMangosStringForDBCLocale(LANG_UNKNOWN); owner_name = sObjectMgr.GetMangosStringForDBCLocale(LANG_UNKNOWN);
uint32 owner_accid = objmgr.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)", 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); bidder_name.c_str(),bidder_accId,pItem->GetProto()->Name1,pItem->GetEntry(),pItem->GetCount(),auction->bid,owner_name.c_str(),owner_accid);
} }
} }
else if(!bidder) else if(!bidder)
bidder_accId = objmgr.GetPlayerAccountIdByGUID(bidder_guid); bidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(bidder_guid);
// receiver exist // receiver exist
if(bidder || bidder_accId) if(bidder || bidder_accId)
@ -134,7 +134,7 @@ void AuctionHouseMgr::SendAuctionWonMail( AuctionEntry *auction )
sLog.outDebug( "AuctionWon body string : %s", msgAuctionWonBody.str().c_str() ); sLog.outDebug( "AuctionWon body string : %s", msgAuctionWonBody.str().c_str() );
//prepare mail data... : //prepare mail data... :
uint32 itemTextId = objmgr.CreateItemText( msgAuctionWonBody.str() ); uint32 itemTextId = sObjectMgr.CreateItemText( msgAuctionWonBody.str() );
// set owner to bidder (to prevent delete item with sender char deleting) // set owner to bidder (to prevent delete item with sender char deleting)
// owner in `data` will set at mail receive and item extracting // owner in `data` will set at mail receive and item extracting
@ -163,10 +163,10 @@ void AuctionHouseMgr::SendAuctionWonMail( AuctionEntry *auction )
void AuctionHouseMgr::SendAuctionSalePendingMail( AuctionEntry * auction ) void AuctionHouseMgr::SendAuctionSalePendingMail( AuctionEntry * auction )
{ {
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER); uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
Player *owner = objmgr.GetPlayer(owner_guid); Player *owner = sObjectMgr.GetPlayer(owner_guid);
// owner exist (online or offline) // owner exist (online or offline)
if(owner || objmgr.GetPlayerAccountIdByGUID(owner_guid)) if(owner || sObjectMgr.GetPlayerAccountIdByGUID(owner_guid))
{ {
std::ostringstream msgAuctionSalePendingSubject; std::ostringstream msgAuctionSalePendingSubject;
msgAuctionSalePendingSubject << auction->item_template << ":0:" << AUCTION_SALE_PENDING; msgAuctionSalePendingSubject << auction->item_template << ":0:" << AUCTION_SALE_PENDING;
@ -184,7 +184,7 @@ void AuctionHouseMgr::SendAuctionSalePendingMail( AuctionEntry * auction )
sLog.outDebug("AuctionSalePending body string : %s", msgAuctionSalePendingBody.str().c_str()); sLog.outDebug("AuctionSalePending body string : %s", msgAuctionSalePendingBody.str().c_str());
uint32 itemTextId = objmgr.CreateItemText( msgAuctionSalePendingBody.str() ); uint32 itemTextId = sObjectMgr.CreateItemText( msgAuctionSalePendingBody.str() );
MailDraft(msgAuctionSalePendingSubject.str(), itemTextId) MailDraft(msgAuctionSalePendingSubject.str(), itemTextId)
.SendMailTo(MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_AUCTION); .SendMailTo(MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_AUCTION);
@ -195,11 +195,11 @@ void AuctionHouseMgr::SendAuctionSalePendingMail( AuctionEntry * auction )
void AuctionHouseMgr::SendAuctionSuccessfulMail( AuctionEntry * auction ) void AuctionHouseMgr::SendAuctionSuccessfulMail( AuctionEntry * auction )
{ {
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER); uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
Player *owner = objmgr.GetPlayer(owner_guid); Player *owner = sObjectMgr.GetPlayer(owner_guid);
uint32 owner_accId = 0; uint32 owner_accId = 0;
if(!owner) if(!owner)
owner_accId = objmgr.GetPlayerAccountIdByGUID(owner_guid); owner_accId = sObjectMgr.GetPlayerAccountIdByGUID(owner_guid);
// owner exist // owner exist
if(owner || owner_accId) if(owner || owner_accId)
@ -217,7 +217,7 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail( AuctionEntry * auction )
sLog.outDebug("AuctionSuccessful body string : %s", auctionSuccessfulBody.str().c_str()); sLog.outDebug("AuctionSuccessful body string : %s", auctionSuccessfulBody.str().c_str());
uint32 itemTextId = objmgr.CreateItemText( auctionSuccessfulBody.str() ); uint32 itemTextId = sObjectMgr.CreateItemText( auctionSuccessfulBody.str() );
uint32 profit = auction->bid + auction->deposit - auctionCut; uint32 profit = auction->bid + auction->deposit - auctionCut;
@ -246,11 +246,11 @@ void AuctionHouseMgr::SendAuctionExpiredMail( AuctionEntry * auction )
} }
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER); uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
Player *owner = objmgr.GetPlayer(owner_guid); Player *owner = sObjectMgr.GetPlayer(owner_guid);
uint32 owner_accId = 0; uint32 owner_accId = 0;
if(!owner) if(!owner)
owner_accId = objmgr.GetPlayerAccountIdByGUID(owner_guid); owner_accId = sObjectMgr.GetPlayerAccountIdByGUID(owner_guid);
// owner exist // owner exist
if(owner || owner_accId) if(owner || owner_accId)
@ -388,7 +388,7 @@ void AuctionHouseMgr::LoadAuctions()
aItem->startbid = fields[9].GetUInt32(); aItem->startbid = fields[9].GetUInt32();
aItem->deposit = fields[10].GetUInt32(); aItem->deposit = fields[10].GetUInt32();
CreatureData const* auctioneerData = objmgr.GetCreatureData(aItem->auctioneer); CreatureData const* auctioneerData = sObjectMgr.GetCreatureData(aItem->auctioneer);
if(!auctioneerData) if(!auctioneerData)
{ {
aItem->DeleteFromDB(); aItem->DeleteFromDB();
@ -514,7 +514,7 @@ void AuctionHouseObject::Update()
///- Either cancel the auction if there was no bidder ///- Either cancel the auction if there was no bidder
if (itr->second->bidder == 0) if (itr->second->bidder == 0)
{ {
auctionmgr.SendAuctionExpiredMail( itr->second ); sAuctionMgr.SendAuctionExpiredMail( itr->second );
} }
///- Or perform the transaction ///- Or perform the transaction
else else
@ -522,13 +522,13 @@ void AuctionHouseObject::Update()
//we should send an "item sold" message if the seller is online //we should send an "item sold" message if the seller is online
//we send the item to the winner //we send the item to the winner
//we send the money to the seller //we send the money to the seller
auctionmgr.SendAuctionSuccessfulMail( itr->second ); sAuctionMgr.SendAuctionSuccessfulMail( itr->second );
auctionmgr.SendAuctionWonMail( itr->second ); sAuctionMgr.SendAuctionWonMail( itr->second );
} }
///- In any case clear the auction ///- In any case clear the auction
itr->second->DeleteFromDB(); itr->second->DeleteFromDB();
auctionmgr.RemoveAItem(itr->second->item_guidlow); sAuctionMgr.RemoveAItem(itr->second->item_guidlow);
delete itr->second; delete itr->second;
RemoveAuction(itr->first); RemoveAuction(itr->first);
} }
@ -573,7 +573,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin();itr != AuctionsMap.end();++itr) for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin();itr != AuctionsMap.end();++itr)
{ {
AuctionEntry *Aentry = itr->second; AuctionEntry *Aentry = itr->second;
Item *item = auctionmgr.GetAItem(Aentry->item_guidlow); Item *item = sAuctionMgr.GetAItem(Aentry->item_guidlow);
if (!item) if (!item)
continue; continue;
@ -604,7 +604,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
// local name // local name
if ( loc_idx >= 0 ) if ( loc_idx >= 0 )
{ {
ItemLocale const *il = objmgr.GetItemLocale(proto->ItemId); ItemLocale const *il = sObjectMgr.GetItemLocale(proto->ItemId);
if (il) if (il)
{ {
if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty()) if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty())
@ -627,7 +627,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
//this function inserts to WorldPacket auction's data //this function inserts to WorldPacket auction's data
bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const
{ {
Item *pItem = auctionmgr.GetAItem(item_guidlow); Item *pItem = sAuctionMgr.GetAItem(item_guidlow);
if (!pItem) if (!pItem)
{ {
sLog.outError("auction to item, that doesn't exist !!!!"); sLog.outError("auction to item, that doesn't exist !!!!");

View file

@ -160,6 +160,6 @@ class AuctionHouseMgr
ItemMap mAitems; ItemMap mAitems;
}; };
#define auctionmgr MaNGOS::Singleton<AuctionHouseMgr>::Instance() #define sAuctionMgr MaNGOS::Singleton<AuctionHouseMgr>::Instance()
#endif #endif

View file

@ -42,7 +42,7 @@ namespace MaNGOS
: i_msgtype(msgtype), i_textId(textId), i_source(source), i_args(args) {} : i_msgtype(msgtype), i_textId(textId), i_source(source), i_args(args) {}
void operator()(WorldPacket& data, int32 loc_idx) void operator()(WorldPacket& data, int32 loc_idx)
{ {
char const* text = objmgr.GetMangosString(i_textId,loc_idx); char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
if (i_args) if (i_args)
{ {
@ -87,7 +87,7 @@ namespace MaNGOS
: i_language(language), i_textId(textId), i_source(source), i_args(args) {} : i_language(language), i_textId(textId), i_source(source), i_args(args) {}
void operator()(WorldPacket& data, int32 loc_idx) void operator()(WorldPacket& data, int32 loc_idx)
{ {
char const* text = objmgr.GetMangosString(i_textId,loc_idx); char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
if(i_args) if(i_args)
{ {
@ -134,9 +134,9 @@ namespace MaNGOS
: i_msgtype(msgtype), i_textId(textId), i_source(source), i_arg1(arg1), i_arg2(arg2) {} : i_msgtype(msgtype), i_textId(textId), i_source(source), i_arg1(arg1), i_arg2(arg2) {}
void operator()(WorldPacket& data, int32 loc_idx) void operator()(WorldPacket& data, int32 loc_idx)
{ {
char const* text = objmgr.GetMangosString(i_textId,loc_idx); char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
char const* arg1str = i_arg1 ? objmgr.GetMangosString(i_arg1,loc_idx) : ""; char const* arg1str = i_arg1 ? sObjectMgr.GetMangosString(i_arg1,loc_idx) : "";
char const* arg2str = i_arg2 ? objmgr.GetMangosString(i_arg2,loc_idx) : ""; char const* arg2str = i_arg2 ? sObjectMgr.GetMangosString(i_arg2,loc_idx) : "";
char str [2048]; char str [2048];
snprintf(str,2048,text, arg1str, arg2str ); snprintf(str,2048,text, arg1str, arg2str );
@ -168,9 +168,9 @@ namespace MaNGOS
: i_language(language), i_textId(textId), i_source(source), i_arg1(arg1), i_arg2(arg2) {} : i_language(language), i_textId(textId), i_source(source), i_arg1(arg1), i_arg2(arg2) {}
void operator()(WorldPacket& data, int32 loc_idx) void operator()(WorldPacket& data, int32 loc_idx)
{ {
char const* text = objmgr.GetMangosString(i_textId,loc_idx); char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
char const* arg1str = i_arg1 ? objmgr.GetMangosString(i_arg1,loc_idx) : ""; char const* arg1str = i_arg1 ? sObjectMgr.GetMangosString(i_arg1,loc_idx) : "";
char const* arg2str = i_arg2 ? objmgr.GetMangosString(i_arg2,loc_idx) : ""; char const* arg2str = i_arg2 ? sObjectMgr.GetMangosString(i_arg2,loc_idx) : "";
char str [2048]; char str [2048];
snprintf(str,2048,text, arg1str, arg2str ); snprintf(str,2048,text, arg1str, arg2str );
@ -455,7 +455,7 @@ void BattleGround::Update(uint32 diff)
//TODO : add arena sound PlaySoundToAll(SOUND_ARENA_START); //TODO : add arena sound PlaySoundToAll(SOUND_ARENA_START);
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if (Player *plr = objmgr.GetPlayer(itr->first)) if (Player *plr = sObjectMgr.GetPlayer(itr->first))
plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION); plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
CheckArenaWinConditions(); CheckArenaWinConditions();
@ -466,7 +466,7 @@ void BattleGround::Update(uint32 diff)
PlaySoundToAll(SOUND_BG_START); PlaySoundToAll(SOUND_BG_START);
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if (Player* plr = objmgr.GetPlayer(itr->first)) if (Player* plr = sObjectMgr.GetPlayer(itr->first))
plr->RemoveAurasDueToSpell(SPELL_PREPARATION); plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
//Announce BG starting //Announce BG starting
if (sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE)) if (sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
@ -517,7 +517,7 @@ void BattleGround::SendPacketToAll(WorldPacket *packet)
{ {
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{ {
Player *plr = objmgr.GetPlayer(itr->first); Player *plr = sObjectMgr.GetPlayer(itr->first);
if (plr) if (plr)
plr->GetSession()->SendPacket(packet); plr->GetSession()->SendPacket(packet);
else else
@ -529,7 +529,7 @@ void BattleGround::SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player *
{ {
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{ {
Player *plr = objmgr.GetPlayer(itr->first); Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr) if (!plr)
{ {
@ -561,7 +561,7 @@ void BattleGround::PlaySoundToTeam(uint32 SoundID, uint32 TeamID)
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{ {
Player *plr = objmgr.GetPlayer(itr->first); Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr) if (!plr)
{ {
@ -584,7 +584,7 @@ void BattleGround::CastSpellOnTeam(uint32 SpellID, uint32 TeamID)
{ {
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{ {
Player *plr = objmgr.GetPlayer(itr->first); Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr) if (!plr)
{ {
@ -604,7 +604,7 @@ void BattleGround::RewardHonorToTeam(uint32 Honor, uint32 TeamID)
{ {
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{ {
Player *plr = objmgr.GetPlayer(itr->first); Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr) if (!plr)
{ {
@ -629,7 +629,7 @@ void BattleGround::RewardReputationToTeam(uint32 faction_id, uint32 Reputation,
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{ {
Player *plr = objmgr.GetPlayer(itr->first); Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr) if (!plr)
{ {
@ -698,8 +698,8 @@ void BattleGround::EndBattleGround(uint32 winner)
// arena rating calculation // arena rating calculation
if (isArena() && isRated()) if (isArena() && isRated())
{ {
winner_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(winner)); winner_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(winner));
loser_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(winner))); loser_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(winner)));
if (winner_arena_team && loser_arena_team) if (winner_arena_team && loser_arena_team)
{ {
loser_rating = loser_arena_team->GetStats().rating; loser_rating = loser_arena_team->GetStats().rating;
@ -719,7 +719,7 @@ void BattleGround::EndBattleGround(uint32 winner)
for(BattleGroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) for(BattleGroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{ {
Player *plr = objmgr.GetPlayer(itr->first); Player *plr = sObjectMgr.GetPlayer(itr->first);
uint32 team = itr->second.Team; uint32 team = itr->second.Team;
if (!plr) if (!plr)
@ -937,7 +937,7 @@ void BattleGround::SendRewardMarkByMail(Player *plr,uint32 mark, uint32 count)
std::string subject = markProto->Name1; std::string subject = markProto->Name1;
int loc_idx = plr->GetSession()->GetSessionDbLocaleIndex(); int loc_idx = plr->GetSession()->GetSessionDbLocaleIndex();
if (loc_idx >= 0 ) if (loc_idx >= 0 )
if (ItemLocale const *il = objmgr.GetItemLocale(markProto->ItemId)) if (ItemLocale const *il = sObjectMgr.GetItemLocale(markProto->ItemId))
if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty()) if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty())
subject = il->Name[loc_idx]; subject = il->Name[loc_idx];
@ -945,7 +945,7 @@ void BattleGround::SendRewardMarkByMail(Player *plr,uint32 mark, uint32 count)
std::string textFormat = plr->GetSession()->GetMangosString(LANG_BG_MARK_BY_MAIL); std::string textFormat = plr->GetSession()->GetMangosString(LANG_BG_MARK_BY_MAIL);
char textBuf[300]; char textBuf[300];
snprintf(textBuf,300,textFormat.c_str(),GetName(),GetName()); snprintf(textBuf,300,textFormat.c_str(),GetName(),GetName());
uint32 itemTextId = objmgr.CreateItemText( textBuf ); uint32 itemTextId = sObjectMgr.CreateItemText( textBuf );
MailDraft(subject, itemTextId) MailDraft(subject, itemTextId)
.AddItem(markItem) .AddItem(markItem)
@ -1003,7 +1003,7 @@ void BattleGround::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
m_PlayerScores.erase(itr2); m_PlayerScores.erase(itr2);
} }
Player *plr = objmgr.GetPlayer(guid); Player *plr = sObjectMgr.GetPlayer(guid);
// should remove spirit of redemption // should remove spirit of redemption
if (plr && plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION)) if (plr && plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
@ -1040,8 +1040,8 @@ void BattleGround::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
if (isRated() && GetStatus() == STATUS_IN_PROGRESS) if (isRated() && GetStatus() == STATUS_IN_PROGRESS)
{ {
//left a rated match while the encounter was in progress, consider as loser //left a rated match while the encounter was in progress, consider as loser
ArenaTeam * winner_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team))); ArenaTeam * winner_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
ArenaTeam * loser_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(team)); ArenaTeam * loser_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
if (winner_arena_team && loser_arena_team) if (winner_arena_team && loser_arena_team)
loser_arena_team->MemberLost(plr,winner_arena_team->GetRating()); loser_arena_team->MemberLost(plr,winner_arena_team->GetRating());
} }
@ -1062,8 +1062,8 @@ void BattleGround::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
if (isRated() && GetStatus() == STATUS_IN_PROGRESS) if (isRated() && GetStatus() == STATUS_IN_PROGRESS)
{ {
//left a rated match while the encounter was in progress, consider as loser //left a rated match while the encounter was in progress, consider as loser
ArenaTeam * others_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team))); ArenaTeam * others_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
ArenaTeam * players_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(team)); ArenaTeam * players_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
if (others_arena_team && players_arena_team) if (others_arena_team && players_arena_team)
players_arena_team->OfflineMemberLost(guid, others_arena_team->GetRating()); players_arena_team->OfflineMemberLost(guid, others_arena_team->GetRating());
} }
@ -1384,7 +1384,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 // 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 // so we must create it specific for this instance
GameObject * go = new GameObject; GameObject * go = new GameObject;
if(!go->Create(objmgr.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)) 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); sLog.outErrorDb("Gameobject template %u not found in database! BattleGround not created!", entry);
@ -1397,7 +1397,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 // 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 // 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 = objmgr.NewGOData(guid); GameObjectData& data = sObjectMgr.NewGOData(guid);
data.id = entry; data.id = entry;
data.mapid = GetMapId(); data.mapid = GetMapId();
@ -1727,7 +1727,7 @@ void BattleGround::HandleKillPlayer( Player *player, Player *killer )
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{ {
Player *plr = objmgr.GetPlayer(itr->first); Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr || plr == killer) if (!plr || plr == killer)
continue; continue;
@ -1784,7 +1784,7 @@ uint32 BattleGround::GetAlivePlayersCountByTeam(uint32 Team) const
{ {
if (itr->second.Team == Team) if (itr->second.Team == Team)
{ {
Player * pl = objmgr.GetPlayer(itr->first); Player * pl = sObjectMgr.GetPlayer(itr->first);
if (pl && pl->isAlive()) if (pl && pl->isAlive())
++count; ++count;
} }
@ -1810,7 +1810,7 @@ void BattleGround::SetBgRaid( uint32 TeamID, Group *bg_raid )
WorldSafeLocsEntry const* BattleGround::GetClosestGraveYard( Player* player ) WorldSafeLocsEntry const* BattleGround::GetClosestGraveYard( Player* player )
{ {
return objmgr.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 bool BattleGround::IsTeamScoreInRange(uint32 team, uint32 minScore, uint32 maxScore) const

View file

@ -131,7 +131,7 @@ void BattleGroundEY::CheckSomeoneJoinedPoint()
uint8 j = 0; uint8 j = 0;
while (j < m_PlayersNearPoint[BG_EY_NODES_MAX].size()) while (j < m_PlayersNearPoint[BG_EY_NODES_MAX].size())
{ {
Player *plr = objmgr.GetPlayer(m_PlayersNearPoint[BG_EY_NODES_MAX][j]); Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[BG_EY_NODES_MAX][j]);
if (!plr) if (!plr)
{ {
sLog.outError("BattleGroundEY: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[BG_EY_NODES_MAX][j])); sLog.outError("BattleGroundEY: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[BG_EY_NODES_MAX][j]));
@ -167,7 +167,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
uint8 j = 0; uint8 j = 0;
while (j < m_PlayersNearPoint[i].size()) while (j < m_PlayersNearPoint[i].size())
{ {
Player *plr = objmgr.GetPlayer(m_PlayersNearPoint[i][j]); Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[i][j]);
if (!plr) if (!plr)
{ {
sLog.outError("BattleGroundEY: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j])); sLog.outError("BattleGroundEY: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j]));
@ -222,7 +222,7 @@ void BattleGroundEY::UpdatePointStatuses()
for (uint8 i = 0; i < m_PlayersNearPoint[point].size(); ++i) for (uint8 i = 0; i < m_PlayersNearPoint[point].size(); ++i)
{ {
Player *plr = objmgr.GetPlayer(m_PlayersNearPoint[point][i]); Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[point][i]);
if (plr) if (plr)
{ {
UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[point], plr); UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[point], plr);

View file

@ -205,11 +205,11 @@ void WorldSession::HandleBattleGroundPlayerPositionsOpcode( WorldPacket & /*recv
uint32 count1 = 0; //always constant zero? uint32 count1 = 0; //always constant zero?
uint32 count2 = 0; //count of next fields uint32 count2 = 0; //count of next fields
Player *ali_plr = objmgr.GetPlayer(((BattleGroundWS*)bg)->GetAllianceFlagPickerGUID()); Player *ali_plr = sObjectMgr.GetPlayer(((BattleGroundWS*)bg)->GetAllianceFlagPickerGUID());
if (ali_plr) if (ali_plr)
++count2; ++count2;
Player *horde_plr = objmgr.GetPlayer(((BattleGroundWS*)bg)->GetHordeFlagPickerGUID()); Player *horde_plr = sObjectMgr.GetPlayer(((BattleGroundWS*)bg)->GetHordeFlagPickerGUID());
if (horde_plr) if (horde_plr)
++count2; ++count2;
@ -467,7 +467,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 player leaves rated arena match before match start, it is counted as he played but he lost
if (isRated) if (isRated)
{ {
ArenaTeam * at = objmgr.GetArenaTeamById(team); ArenaTeam * at = sObjectMgr.GetArenaTeamById(team);
if (at) 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()), opponentsRating); sLog.outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u, because he has left queue!", GUID_LOPART(_player->GetGUID()), opponentsRating);
@ -698,7 +698,7 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
{ {
ateamId = _player->GetArenaTeamId(arenaslot); 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) // check real arenateam existence only here (if it was moved to group->CanJoin .. () then we would ahve to get it twice)
ArenaTeam * at = objmgr.GetArenaTeamById(ateamId); ArenaTeam * at = sObjectMgr.GetArenaTeamById(ateamId);
if (!at) if (!at)
{ {
_player->GetSession()->SendNotInArenaTeamPacket(arenatype); _player->GetSession()->SendNotInArenaTeamPacket(arenatype);
@ -770,7 +770,7 @@ void WorldSession::HandleReportPvPAFK( WorldPacket & recv_data )
{ {
uint64 playerGuid; uint64 playerGuid;
recv_data >> playerGuid; recv_data >> playerGuid;
Player *reportedPlayer = objmgr.GetPlayer(playerGuid); Player *reportedPlayer = sObjectMgr.GetPlayer(playerGuid);
if (!reportedPlayer) if (!reportedPlayer)
{ {

View file

@ -247,7 +247,7 @@ uint32 BattleGroundQueue::GetAverageQueueWaitTime(GroupQueueInfo* ginfo, BGQueue
//remove player from queue and from group info, if group info is empty then remove it too //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) void BattleGroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCount)
{ {
//Player *plr = objmgr.GetPlayer(guid); //Player *plr = sObjectMgr.GetPlayer(guid);
int32 queue_id = -1; // signed for proper for-loop finish int32 queue_id = -1; // signed for proper for-loop finish
QueuedPlayersMap::iterator itr; QueuedPlayersMap::iterator itr;
@ -322,11 +322,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 loose //if player leaves queue and he is invited to rated arena match, then he have to loose
if (group->IsInvitedToBGInstanceGUID && group->IsRated && decreaseInvitedCount) if (group->IsInvitedToBGInstanceGUID && group->IsRated && decreaseInvitedCount)
{ {
ArenaTeam * at = objmgr.GetArenaTeamById(group->ArenaTeamId); ArenaTeam * at = sObjectMgr.GetArenaTeamById(group->ArenaTeamId);
if (at) if (at)
{ {
sLog.outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u", GUID_LOPART(guid), group->OpponentsTeamRating); sLog.outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u", GUID_LOPART(guid), group->OpponentsTeamRating);
Player *plr = objmgr.GetPlayer(guid); Player *plr = sObjectMgr.GetPlayer(guid);
if (plr) if (plr)
at->MemberLost(plr, group->OpponentsTeamRating); at->MemberLost(plr, group->OpponentsTeamRating);
else else
@ -348,7 +348,7 @@ void BattleGroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou
{ {
// remove next player, this is recursive // remove next player, this is recursive
// first send removal information // first send removal information
if (Player *plr2 = objmgr.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); BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(group->BgTypeId, group->ArenaType);
@ -386,7 +386,7 @@ void BattleGroundQueue::AnnounceWorld(GroupQueueInfo *ginfo, const uint64& playe
{ {
if (sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE)) if (sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
{ {
Player *plr = objmgr.GetPlayer(playerGUID); Player *plr = sObjectMgr.GetPlayer(playerGUID);
BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(ginfo->BgTypeId); BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(ginfo->BgTypeId);
if (!bg || !plr) if (!bg || !plr)
return; return;
@ -446,7 +446,7 @@ bool BattleGroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, BattleGround * b
for(std::map<uint64,PlayerQueueInfo*>::iterator itr = ginfo->Players.begin(); itr != ginfo->Players.end(); ++itr) for(std::map<uint64,PlayerQueueInfo*>::iterator itr = ginfo->Players.begin(); itr != ginfo->Players.end(); ++itr)
{ {
// get the player // get the player
Player* plr = objmgr.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 offline, skip him, this should not happen - player is removed from queue when he logs out
if (!plr) if (!plr)
continue; continue;
@ -1009,7 +1009,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLeve
bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
{ {
Player* plr = objmgr.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) // player logged off (we should do nothing, he is correctly removed from queue in another procedure)
if (!plr) if (!plr)
return true; return true;
@ -1054,7 +1054,7 @@ void BGQueueInviteEvent::Abort(uint64 /*e_time*/)
*/ */
bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
{ {
Player* plr = objmgr.GetPlayer( m_PlayerGuid ); Player* plr = sObjectMgr.GetPlayer( m_PlayerGuid );
if (!plr) if (!plr)
// player logged off (we should do nothing, he is correctly removed from queue in another procedure) // player logged off (we should do nothing, he is correctly removed from queue in another procedure)
return true; return true;
@ -1332,7 +1332,7 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg)
for(int i = 1; i >= 0; --i) for(int i = 1; i >= 0; --i)
{ {
uint32 at_id = bg->m_ArenaTeamIds[i]; uint32 at_id = bg->m_ArenaTeamIds[i];
ArenaTeam * at = objmgr.GetArenaTeamById(at_id); ArenaTeam * at = sObjectMgr.GetArenaTeamById(at_id);
if (at) if (at)
*data << at->GetName(); *data << at->GetName();
else else
@ -1364,7 +1364,7 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg)
} }
else else
{ {
Player *plr = objmgr.GetPlayer(itr->first); Player *plr = sObjectMgr.GetPlayer(itr->first);
uint32 team = bg->GetPlayerTeam(itr->first); uint32 team = bg->GetPlayerTeam(itr->first);
if (!team && plr) if (!team && plr)
team = plr->GetTeam(); team = plr->GetTeam();
@ -1597,7 +1597,7 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI
} }
// generate a new instance id // generate a new instance id
bg->SetInstanceID(mapmgr.GenerateInstanceId()); // set instance id bg->SetInstanceID(sMapMgr.GenerateInstanceId()); // set instance id
bg->SetClientInstanceID(CreateClientVisibleInstanceId(bgTypeId, queue_id)); bg->SetClientInstanceID(CreateClientVisibleInstanceId(bgTypeId, queue_id));
// reset the new bg (set status to status_wait_queue from status_none) // reset the new bg (set status to status_wait_queue from status_none)
@ -1807,7 +1807,7 @@ void BattleGroundMgr::DistributeArenaPoints()
std::map<uint32, uint32> PlayerPoints; std::map<uint32, uint32> PlayerPoints;
//at first update all points for all team members //at first update all points for all team members
for(ObjectMgr::ArenaTeamMap::iterator team_itr = objmgr.GetArenaTeamMapBegin(); team_itr != objmgr.GetArenaTeamMapEnd(); ++team_itr) for(ObjectMgr::ArenaTeamMap::iterator team_itr = sObjectMgr.GetArenaTeamMapBegin(); team_itr != sObjectMgr.GetArenaTeamMapEnd(); ++team_itr)
{ {
if (ArenaTeam * at = team_itr->second) if (ArenaTeam * at = team_itr->second)
{ {
@ -1821,7 +1821,7 @@ void BattleGroundMgr::DistributeArenaPoints()
//update to database //update to database
CharacterDatabase.PExecute("UPDATE characters SET arena_pending_points = '%u' WHERE guid = '%u'", plr_itr->second, plr_itr->first); CharacterDatabase.PExecute("UPDATE characters SET arena_pending_points = '%u' WHERE guid = '%u'", plr_itr->second, plr_itr->first);
//add points if player is online //add points if player is online
Player* pl = objmgr.GetPlayer(plr_itr->first); Player* pl = sObjectMgr.GetPlayer(plr_itr->first);
if (pl) if (pl)
pl->ModifyArenaPoints(plr_itr->second); pl->ModifyArenaPoints(plr_itr->second);
} }
@ -1831,7 +1831,7 @@ void BattleGroundMgr::DistributeArenaPoints()
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_END); sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_END);
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_START); sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_START);
for(ObjectMgr::ArenaTeamMap::iterator titr = objmgr.GetArenaTeamMapBegin(); titr != objmgr.GetArenaTeamMapEnd(); ++titr) for(ObjectMgr::ArenaTeamMap::iterator titr = sObjectMgr.GetArenaTeamMapBegin(); titr != sObjectMgr.GetArenaTeamMapEnd(); ++titr)
{ {
if (ArenaTeam * at = titr->second) if (ArenaTeam * at = titr->second)
{ {

View file

@ -77,7 +77,7 @@ void Channel::Join(uint64 p, const char *pass)
return; return;
} }
Player *plr = objmgr.GetPlayer(p); Player *plr = sObjectMgr.GetPlayer(p);
if(plr) if(plr)
{ {
@ -135,7 +135,7 @@ void Channel::Leave(uint64 p, bool send)
} }
else else
{ {
Player *plr = objmgr.GetPlayer(p); Player *plr = sObjectMgr.GetPlayer(p);
if(send) if(send)
{ {
@ -170,7 +170,7 @@ void Channel::Leave(uint64 p, bool send)
void Channel::KickOrBan(uint64 good, const char *badname, bool ban) void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
{ {
AccountTypes sec = SEC_PLAYER; AccountTypes sec = SEC_PLAYER;
Player *gplr = objmgr.GetPlayer(good); Player *gplr = sObjectMgr.GetPlayer(good);
if(gplr) if(gplr)
sec = gplr->GetSession()->GetSecurity(); sec = gplr->GetSession()->GetSecurity();
@ -188,7 +188,7 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
} }
else else
{ {
Player *bad = objmgr.GetPlayer(badname); Player *bad = sObjectMgr.GetPlayer(badname);
if(bad == NULL || !IsOn(bad->GetGUID())) if(bad == NULL || !IsOn(bad->GetGUID()))
{ {
WorldPacket data; WorldPacket data;
@ -231,7 +231,7 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
void Channel::UnBan(uint64 good, const char *badname) void Channel::UnBan(uint64 good, const char *badname)
{ {
uint32 sec = 0; uint32 sec = 0;
Player *gplr = objmgr.GetPlayer(good); Player *gplr = sObjectMgr.GetPlayer(good);
if(gplr) if(gplr)
sec = gplr->GetSession()->GetSecurity(); sec = gplr->GetSession()->GetSecurity();
@ -249,7 +249,7 @@ void Channel::UnBan(uint64 good, const char *badname)
} }
else else
{ {
Player *bad = objmgr.GetPlayer(badname); Player *bad = sObjectMgr.GetPlayer(badname);
if(bad == NULL || !IsBanned(bad->GetGUID())) if(bad == NULL || !IsBanned(bad->GetGUID()))
{ {
WorldPacket data; WorldPacket data;
@ -270,7 +270,7 @@ void Channel::UnBan(uint64 good, const char *badname)
void Channel::Password(uint64 p, const char *pass) void Channel::Password(uint64 p, const char *pass)
{ {
uint32 sec = 0; uint32 sec = 0;
Player *plr = objmgr.GetPlayer(p); Player *plr = sObjectMgr.GetPlayer(p);
if(plr) if(plr)
sec = plr->GetSession()->GetSecurity(); sec = plr->GetSession()->GetSecurity();
@ -298,7 +298,7 @@ void Channel::Password(uint64 p, const char *pass)
void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set) void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
{ {
Player *plr = objmgr.GetPlayer(p); Player *plr = sObjectMgr.GetPlayer(p);
if (!plr) if (!plr)
return; return;
@ -318,7 +318,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
} }
else else
{ {
Player *newp = objmgr.GetPlayer(p2n); Player *newp = sObjectMgr.GetPlayer(p2n);
if(!newp) if(!newp)
{ {
WorldPacket data; WorldPacket data;
@ -367,7 +367,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
void Channel::SetOwner(uint64 p, const char *newname) void Channel::SetOwner(uint64 p, const char *newname)
{ {
Player *plr = objmgr.GetPlayer(p); Player *plr = sObjectMgr.GetPlayer(p);
if (!plr) if (!plr)
return; return;
@ -389,7 +389,7 @@ void Channel::SetOwner(uint64 p, const char *newname)
return; return;
} }
Player *newp = objmgr.GetPlayer(newname); Player *newp = sObjectMgr.GetPlayer(newname);
if(newp == NULL || !IsOn(newp->GetGUID())) if(newp == NULL || !IsOn(newp->GetGUID()))
{ {
WorldPacket data; WorldPacket data;
@ -451,7 +451,7 @@ void Channel::List(Player* player)
uint32 count = 0; uint32 count = 0;
for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i) for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
{ {
Player *plr = objmgr.GetPlayer(i->first); Player *plr = sObjectMgr.GetPlayer(i->first);
// PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters // PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all // MODERATOR, GAME MASTER, ADMINISTRATOR can see all
@ -473,7 +473,7 @@ void Channel::List(Player* player)
void Channel::Announce(uint64 p) void Channel::Announce(uint64 p)
{ {
uint32 sec = 0; uint32 sec = 0;
Player *plr = objmgr.GetPlayer(p); Player *plr = sObjectMgr.GetPlayer(p);
if(plr) if(plr)
sec = plr->GetSession()->GetSecurity(); sec = plr->GetSession()->GetSecurity();
@ -505,7 +505,7 @@ void Channel::Announce(uint64 p)
void Channel::Moderate(uint64 p) void Channel::Moderate(uint64 p)
{ {
uint32 sec = 0; uint32 sec = 0;
Player *plr = objmgr.GetPlayer(p); Player *plr = sObjectMgr.GetPlayer(p);
if(plr) if(plr)
sec = plr->GetSession()->GetSecurity(); sec = plr->GetSession()->GetSecurity();
@ -542,7 +542,7 @@ void Channel::Say(uint64 p, const char *what, uint32 lang)
lang = LANG_UNIVERSAL; lang = LANG_UNIVERSAL;
uint32 sec = 0; uint32 sec = 0;
Player *plr = objmgr.GetPlayer(p); Player *plr = sObjectMgr.GetPlayer(p);
if(plr) if(plr)
sec = plr->GetSession()->GetSecurity(); sec = plr->GetSession()->GetSecurity();
@ -593,7 +593,7 @@ void Channel::Invite(uint64 p, const char *newname)
return; return;
} }
Player *newp = objmgr.GetPlayer(newname); Player *newp = sObjectMgr.GetPlayer(newname);
if(!newp) if(!newp)
{ {
WorldPacket data; WorldPacket data;
@ -602,7 +602,7 @@ void Channel::Invite(uint64 p, const char *newname)
return; return;
} }
Player *plr = objmgr.GetPlayer(p); Player *plr = sObjectMgr.GetPlayer(p);
if (!plr) if (!plr)
return; return;
@ -665,7 +665,7 @@ void Channel::SendToAll(WorldPacket *data, uint64 p)
{ {
for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i) for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
{ {
Player *plr = objmgr.GetPlayer(i->first); Player *plr = sObjectMgr.GetPlayer(i->first);
if(plr) if(plr)
{ {
if(!p || !plr->GetSocial()->HasIgnore(GUID_LOPART(p))) if(!p || !plr->GetSocial()->HasIgnore(GUID_LOPART(p)))
@ -680,7 +680,7 @@ void Channel::SendToAllButOne(WorldPacket *data, uint64 who)
{ {
if(i->first != who) if(i->first != who)
{ {
Player *plr = objmgr.GetPlayer(i->first); Player *plr = sObjectMgr.GetPlayer(i->first);
if(plr) if(plr)
plr->GetSession()->SendPacket(data); plr->GetSession()->SendPacket(data);
} }
@ -689,7 +689,7 @@ void Channel::SendToAllButOne(WorldPacket *data, uint64 who)
void Channel::SendToOne(WorldPacket *data, uint64 who) void Channel::SendToOne(WorldPacket *data, uint64 who)
{ {
Player *plr = objmgr.GetPlayer(who); Player *plr = sObjectMgr.GetPlayer(who);
if(plr) if(plr)
plr->GetSession()->SendPacket(data); plr->GetSession()->SendPacket(data);
} }
@ -793,7 +793,7 @@ void Channel::MakeChannelOwner(WorldPacket *data)
{ {
std::string name = ""; std::string name = "";
if(!objmgr.GetPlayerNameByGUID(m_ownerGUID, name) || name.empty()) if(!sObjectMgr.GetPlayerNameByGUID(m_ownerGUID, name) || name.empty())
name = "PLAYER_NOT_FOUND"; name = "PLAYER_NOT_FOUND";
MakeNotifyPacket(data, CHAT_CHANNEL_OWNER_NOTICE); MakeNotifyPacket(data, CHAT_CHANNEL_OWNER_NOTICE);

View file

@ -255,14 +255,14 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
return; return;
} }
if (GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(name)) if (GetSecurity() == SEC_PLAYER && sObjectMgr.IsReservedName(name))
{ {
data << (uint8)CHAR_NAME_RESERVED; data << (uint8)CHAR_NAME_RESERVED;
SendPacket( &data ); SendPacket( &data );
return; return;
} }
if (objmgr.GetPlayerGUIDByName(name)) if (sObjectMgr.GetPlayerGUIDByName(name))
{ {
data << (uint8)CHAR_CREATE_NAME_IN_USE; data << (uint8)CHAR_CREATE_NAME_IN_USE;
SendPacket( &data ); SendPacket( &data );
@ -432,7 +432,7 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
recv_data >> hairStyle >> hairColor >> facialHair >> outfitId; recv_data >> hairStyle >> hairColor >> facialHair >> outfitId;
Player *pNewChar = new Player(this); Player *pNewChar = new Player(this);
if(!pNewChar->Create( objmgr.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?) // Player not create (race/class problem?)
delete pNewChar; delete pNewChar;
@ -469,14 +469,14 @@ void WorldSession::HandleCharDeleteOpcode( WorldPacket & recv_data )
recv_data >> guid; recv_data >> guid;
// can't delete loaded character // can't delete loaded character
if(objmgr.GetPlayer(guid)) if(sObjectMgr.GetPlayer(guid))
return; return;
uint32 accountId = 0; uint32 accountId = 0;
std::string name; std::string name;
// is guild leader // is guild leader
if(objmgr.GetGuildByLeader(guid)) if(sObjectMgr.GetGuildByLeader(guid))
{ {
WorldPacket data(SMSG_CHAR_DELETE, 1); WorldPacket data(SMSG_CHAR_DELETE, 1);
data << (uint8)CHAR_DELETE_FAILED_GUILD_LEADER; data << (uint8)CHAR_DELETE_FAILED_GUILD_LEADER;
@ -485,7 +485,7 @@ void WorldSession::HandleCharDeleteOpcode( WorldPacket & recv_data )
} }
// is arena team captain // is arena team captain
if(objmgr.GetArenaTeamByCaptain(guid)) if(sObjectMgr.GetArenaTeamByCaptain(guid))
{ {
WorldPacket data(SMSG_CHAR_DELETE, 1); WorldPacket data(SMSG_CHAR_DELETE, 1);
data << (uint8)CHAR_DELETE_FAILED_ARENA_CAPTAIN; data << (uint8)CHAR_DELETE_FAILED_ARENA_CAPTAIN;
@ -637,7 +637,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder *holder)
if(pCurrChar->GetGuildId() != 0) if(pCurrChar->GetGuildId() != 0)
{ {
Guild* guild = objmgr.GetGuildById(pCurrChar->GetGuildId()); Guild* guild = sObjectMgr.GetGuildById(pCurrChar->GetGuildId());
if(guild) if(guild)
{ {
data.Initialize(SMSG_GUILD_EVENT, (2+guild->GetMOTD().size()+1)); data.Initialize(SMSG_GUILD_EVENT, (2+guild->GetMOTD().size()+1));
@ -692,14 +692,14 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder *holder)
if (!pCurrChar->GetMap()->Add(pCurrChar)) if (!pCurrChar->GetMap()->Add(pCurrChar))
{ {
AreaTrigger const* at = objmgr.GetGoBackTrigger(pCurrChar->GetMapId()); AreaTrigger const* at = sObjectMgr.GetGoBackTrigger(pCurrChar->GetMapId());
if(at) if(at)
pCurrChar->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, pCurrChar->GetOrientation()); pCurrChar->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, pCurrChar->GetOrientation());
else else
pCurrChar->TeleportTo(pCurrChar->m_homebindMapId, pCurrChar->m_homebindX, pCurrChar->m_homebindY, pCurrChar->m_homebindZ, pCurrChar->GetOrientation()); pCurrChar->TeleportTo(pCurrChar->m_homebindMapId, pCurrChar->m_homebindX, pCurrChar->m_homebindY, pCurrChar->m_homebindZ, pCurrChar->GetOrientation());
} }
objaccessor.AddObject(pCurrChar); sObjectAccessor.AddObject(pCurrChar);
//sLog.outDebug("Player %s added to Map.",pCurrChar->GetName()); //sLog.outDebug("Player %s added to Map.",pCurrChar->GetName());
pCurrChar->SendInitialPacketsAfterAddToMap(); pCurrChar->SendInitialPacketsAfterAddToMap();
@ -918,7 +918,7 @@ void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data)
} }
// check name limitations // check name limitations
if (GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(newname)) if (GetSecurity() == SEC_PLAYER && sObjectMgr.IsReservedName(newname))
{ {
WorldPacket data(SMSG_CHAR_RENAME, 1); WorldPacket data(SMSG_CHAR_RENAME, 1);
data << uint8(CHAR_NAME_RESERVED); data << uint8(CHAR_NAME_RESERVED);
@ -981,7 +981,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data)
// not accept declined names for unsupported languages // not accept declined names for unsupported languages
std::string name; std::string name;
if(!objmgr.GetPlayerNameByGUID(guid, name)) if(!sObjectMgr.GetPlayerNameByGUID(guid, name))
{ {
WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4+8); WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4+8);
data << uint32(1); data << uint32(1);
@ -1181,7 +1181,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
} }
// check name limitations // check name limitations
if (GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(newname)) if (GetSecurity() == SEC_PLAYER && sObjectMgr.IsReservedName(newname))
{ {
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1); WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
data << uint8(CHAR_NAME_RESERVED); data << uint8(CHAR_NAME_RESERVED);
@ -1190,7 +1190,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
} }
// character with this name already exist // character with this name already exist
if (uint64 newguid = objmgr.GetPlayerGUIDByName(newname)) if (uint64 newguid = sObjectMgr.GetPlayerGUIDByName(newname))
{ {
if (newguid != guid) if (newguid != guid)
{ {

View file

@ -698,7 +698,7 @@ bool ChatHandler::HasLowerSecurity(Player* target, uint64 guid, bool strong)
if (target) if (target)
target_session = target->GetSession(); target_session = target->GetSession();
else if (guid) else if (guid)
target_account = objmgr.GetPlayerAccountIdByGUID(guid); target_account = sObjectMgr.GetPlayerAccountIdByGUID(guid);
if(!target_session && !target_account) if(!target_session && !target_account)
{ {
@ -1243,7 +1243,7 @@ valid examples:
c = reader.peek(); c = reader.peek();
} }
linkedQuest = objmgr.GetQuestTemplate(questid); linkedQuest = sObjectMgr.GetQuestTemplate(questid);
if(!linkedQuest) if(!linkedQuest)
{ {
@ -1414,7 +1414,7 @@ valid examples:
if (linkedSpell->Attributes & SPELL_ATTR_TRADESPELL) if (linkedSpell->Attributes & SPELL_ATTR_TRADESPELL)
{ {
// lookup skillid // lookup skillid
SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(linkedSpell->Id); SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(linkedSpell->Id);
if (bounds.first == bounds.second) if (bounds.first == bounds.second)
{ {
return false; return false;
@ -1461,7 +1461,7 @@ valid examples:
{ {
if (linkedQuest->GetTitle() != buffer) if (linkedQuest->GetTitle() != buffer)
{ {
QuestLocale const *ql = objmgr.GetQuestLocale(linkedQuest->GetQuestId()); QuestLocale const *ql = sObjectMgr.GetQuestLocale(linkedQuest->GetQuestId());
if (!ql) if (!ql)
{ {
@ -1502,12 +1502,12 @@ valid examples:
if (expectedName != buffer) if (expectedName != buffer)
{ {
ItemLocale const *il = objmgr.GetItemLocale(linkedItem->ItemId); ItemLocale const *il = sObjectMgr.GetItemLocale(linkedItem->ItemId);
bool foundName = false; bool foundName = false;
for(uint8 i=LOCALE_koKR; i<MAX_LOCALE; ++i) for(uint8 i=LOCALE_koKR; i<MAX_LOCALE; ++i)
{ {
int8 dbIndex = objmgr.GetIndexForLocale(LocaleConstant(i)); int8 dbIndex = sObjectMgr.GetIndexForLocale(LocaleConstant(i));
if (dbIndex == -1 || il == NULL || dbIndex >= il->Name.size()) if (dbIndex == -1 || il == NULL || dbIndex >= il->Name.size())
// using strange database/client combinations can lead to this case // using strange database/client combinations can lead to this case
expectedName = linkedItem->Name1; expectedName = linkedItem->Name1;
@ -1758,7 +1758,7 @@ Player * ChatHandler::getSelectedPlayer()
if (guid == 0) if (guid == 0)
return m_session->GetPlayer(); return m_session->GetPlayer();
return objmgr.GetPlayer(guid); return sObjectMgr.GetPlayer(guid);
} }
Unit* ChatHandler::getSelectedUnit() Unit* ChatHandler::getSelectedUnit()
@ -1935,7 +1935,7 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid
GameObject* obj = pl->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, entry, HIGHGUID_GAMEOBJECT)); GameObject* obj = pl->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, entry, HIGHGUID_GAMEOBJECT));
if(!obj && objmgr.GetGOData(lowguid)) // guid is DB guid of object if(!obj && sObjectMgr.GetGOData(lowguid)) // guid is DB guid of object
{ {
// search near player then // search near player then
CellPair p(MaNGOS::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY())); CellPair p(MaNGOS::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY()));
@ -2036,9 +2036,9 @@ GameTele const* ChatHandler::extractGameTeleFromLink(char* text)
// id case (explicit or from shift link) // id case (explicit or from shift link)
if(cId[0] >= '0' || cId[0] >= '9') if(cId[0] >= '0' || cId[0] >= '9')
if(uint32 id = atoi(cId)) if(uint32 id = atoi(cId))
return objmgr.GetGameTele(id); return sObjectMgr.GetGameTele(id);
return objmgr.GetGameTele(cId); return sObjectMgr.GetGameTele(cId);
} }
enum GuidLinkType enum GuidLinkType
@ -2075,10 +2075,10 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
if(!normalizePlayerName(name)) if(!normalizePlayerName(name))
return 0; return 0;
if(Player* player = objmgr.GetPlayer(name.c_str())) if(Player* player = sObjectMgr.GetPlayer(name.c_str()))
return player->GetGUID(); return player->GetGUID();
if(uint64 guid = objmgr.GetPlayerGUIDByName(name)) if(uint64 guid = sObjectMgr.GetPlayerGUIDByName(name))
return guid; return guid;
return 0; return 0;
@ -2087,7 +2087,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
{ {
uint32 lowguid = (uint32)atol(idS); uint32 lowguid = (uint32)atol(idS);
if(CreatureData const* data = objmgr.GetCreatureData(lowguid) ) if(CreatureData const* data = sObjectMgr.GetCreatureData(lowguid) )
return MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_UNIT); return MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_UNIT);
else else
return 0; return 0;
@ -2096,7 +2096,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
{ {
uint32 lowguid = (uint32)atol(idS); uint32 lowguid = (uint32)atol(idS);
if(GameObjectData const* data = objmgr.GetGOData(lowguid) ) if(GameObjectData const* data = sObjectMgr.GetGOData(lowguid) )
return MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_GAMEOBJECT); return MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_GAMEOBJECT);
else else
return 0; return 0;
@ -2133,14 +2133,14 @@ bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* playe
return false; return false;
} }
Player* pl = objmgr.GetPlayer(name.c_str()); Player* pl = sObjectMgr.GetPlayer(name.c_str());
// if allowed player pointer // if allowed player pointer
if(player) if(player)
*player = pl; *player = pl;
// if need guid value from DB (in name case for check player existence) // if need guid value from DB (in name case for check player existence)
uint64 guid = !pl && (player_guid || player_name) ? objmgr.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 allowed player guid (if no then only online players allowed)
if(player_guid) if(player_guid)
@ -2226,7 +2226,7 @@ int ChatHandler::GetSessionDbLocaleIndex() const
const char *CliHandler::GetMangosString(int32 entry) const const char *CliHandler::GetMangosString(int32 entry) const
{ {
return objmgr.GetMangosStringForDBCLocale(entry); return sObjectMgr.GetMangosStringForDBCLocale(entry);
} }
bool CliHandler::isAvailable(ChatCommand const& cmd) const bool CliHandler::isAvailable(ChatCommand const& cmd) const
@ -2258,5 +2258,5 @@ LocaleConstant CliHandler::GetSessionDbcLocale() const
int CliHandler::GetSessionDbLocaleIndex() const int CliHandler::GetSessionDbLocaleIndex() const
{ {
return objmgr.GetDBCLocaleIndex(); return sObjectMgr.GetDBCLocaleIndex();
} }

View file

@ -206,7 +206,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
break; break;
} }
Player *player = objmgr.GetPlayer(to.c_str()); Player *player = sObjectMgr.GetPlayer(to.c_str());
uint32 tSecurity = GetSecurity(); uint32 tSecurity = GetSecurity();
uint32 pSecurity = player ? player->GetSession()->GetSecurity() : SEC_PLAYER; uint32 pSecurity = player ? player->GetSession()->GetSecurity() : SEC_PLAYER;
if (!player || (tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers())) if (!player || (tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers()))
@ -280,7 +280,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
if (GetPlayer()->GetGuildId()) if (GetPlayer()->GetGuildId())
{ {
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()); Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if (guild) if (guild)
guild->BroadcastToGuild(this, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL); guild->BroadcastToGuild(this, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
} }
@ -306,7 +306,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
if (GetPlayer()->GetGuildId()) if (GetPlayer()->GetGuildId())
{ {
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()); Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if (guild) if (guild)
guild->BroadcastToOfficers(this, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL); guild->BroadcastToOfficers(this, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
} }
@ -602,7 +602,7 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data )
recv_data >> iguid; recv_data >> iguid;
recv_data >> unk; // probably related to spam reporting recv_data >> unk; // probably related to spam reporting
Player *player = objmgr.GetPlayer(iguid); Player *player = sObjectMgr.GetPlayer(iguid);
if(!player || !player->GetSession()) if(!player || !player->GetSession())
return; return;

View file

@ -50,7 +50,7 @@ void Corpse::AddToWorld()
{ {
///- Register the corpse for guid lookup ///- Register the corpse for guid lookup
if(!IsInWorld()) if(!IsInWorld())
objaccessor.AddObject(this); sObjectAccessor.AddObject(this);
Object::AddToWorld(); Object::AddToWorld();
} }
@ -59,7 +59,7 @@ void Corpse::RemoveFromWorld()
{ {
///- Remove the corpse from the accessor ///- Remove the corpse from the accessor
if(IsInWorld()) if(IsInWorld())
objaccessor.RemoveObject(this); sObjectAccessor.RemoveObject(this);
Object::RemoveFromWorld(); Object::RemoveFromWorld();
} }

View file

@ -219,14 +219,14 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data )
// known valid are: CLASS_WARRIOR,CLASS_PALADIN,CLASS_ROGUE,CLASS_MAGE // known valid are: CLASS_WARRIOR,CLASS_PALADIN,CLASS_ROGUE,CLASS_MAGE
SetByteValue(UNIT_FIELD_BYTES_0, 1, uint8(cinfo->unit_class)); SetByteValue(UNIT_FIELD_BYTES_0, 1, uint8(cinfo->unit_class));
uint32 display_id = objmgr.ChooseDisplayId(team, GetCreatureInfo(), data); uint32 display_id = sObjectMgr.ChooseDisplayId(team, GetCreatureInfo(), data);
if (!display_id) // Cancel load if no display id if (!display_id) // Cancel load if no display id
{ {
sLog.outErrorDb("Creature (Entry: %u) has model %u not found in table `creature_model_info`, can't load. ", Entry, display_id); sLog.outErrorDb("Creature (Entry: %u) has model %u not found in table `creature_model_info`, can't load. ", Entry, display_id);
return false; return false;
} }
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id); CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
if (!minfo) // Cancel load if no model defined 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); sLog.outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ",Entry);
@ -369,9 +369,9 @@ void Creature::Update(uint32 diff)
//Call AI respawn virtual function //Call AI respawn virtual function
i_AI->JustRespawned(); i_AI->JustRespawned();
uint16 poolid = poolhandler.IsPartOfAPool(GetGUIDLow(), GetTypeId()); uint16 poolid = sPoolMgr.IsPartOfAPool(GetGUIDLow(), GetTypeId());
if (poolid) if (poolid)
poolhandler.UpdatePool(poolid, GetGUIDLow(), TYPEID_UNIT); sPoolMgr.UpdatePool(poolid, GetGUIDLow(), TYPEID_UNIT);
else else
GetMap()->Add(this); GetMap()->Add(this);
} }
@ -398,7 +398,7 @@ void Creature::Update(uint32 diff)
} }
else else
{ {
Group* group = objmgr.GetGroupByLeader(lootingGroupLeaderGUID); Group* group = sObjectMgr.GetGroupByLeader(lootingGroupLeaderGUID);
if (group) if (group)
group->EndRoll(); group->EndRoll();
m_groupLootTimer = 0; m_groupLootTimer = 0;
@ -761,7 +761,7 @@ void Creature::prepareGossipMenu( Player *pPlayer,uint32 gossipid )
if(gso->Id==1) if(gso->Id==1)
{ {
uint32 textid=GetNpcTextId(); uint32 textid=GetNpcTextId();
GossipText const* gossiptext=objmgr.GetGossipText(textid); GossipText const* gossiptext=sObjectMgr.GetGossipText(textid);
if(!gossiptext) if(!gossiptext)
cantalking=false; cantalking=false;
} }
@ -835,7 +835,7 @@ void Creature::prepareGossipMenu( Player *pPlayer,uint32 gossipid )
int loc_idx = pPlayer->GetSession()->GetSessionDbLocaleIndex(); int loc_idx = pPlayer->GetSession()->GetSessionDbLocaleIndex();
if (loc_idx >= 0) if (loc_idx >= 0)
{ {
NpcOptionLocale const *no = objmgr.GetNpcOptionLocale(gso->Id); NpcOptionLocale const *no = sObjectMgr.GetNpcOptionLocale(gso->Id);
if (no) if (no)
{ {
if (no->OptionText.size() > loc_idx && !no->OptionText[loc_idx].empty()) if (no->OptionText.size() > loc_idx && !no->OptionText[loc_idx].empty())
@ -1031,7 +1031,7 @@ uint32 Creature::GetNpcTextId()
if (!m_DBTableGuid) if (!m_DBTableGuid)
return DEFAULT_GOSSIP_MESSAGE; return DEFAULT_GOSSIP_MESSAGE;
if(uint32 pos = objmgr.GetNpcGossip(m_DBTableGuid)) if(uint32 pos = sObjectMgr.GetNpcGossip(m_DBTableGuid))
return pos; return pos;
return DEFAULT_GOSSIP_MESSAGE; return DEFAULT_GOSSIP_MESSAGE;
@ -1054,7 +1054,7 @@ void Creature::LoadGossipOptions()
uint32 npcflags=GetUInt32Value(UNIT_NPC_FLAGS); uint32 npcflags=GetUInt32Value(UNIT_NPC_FLAGS);
CacheNpcOptionList const& noList = objmgr.GetNpcOptions (); CacheNpcOptionList const& noList = sObjectMgr.GetNpcOptions ();
for (CacheNpcOptionList::const_iterator i = noList.begin (); i != noList.end (); ++i) for (CacheNpcOptionList::const_iterator i = noList.begin (); i != noList.end (); ++i)
if(i->NpcFlag & npcflags) if(i->NpcFlag & npcflags)
addGossipOption(*i); addGossipOption(*i);
@ -1116,7 +1116,7 @@ void Creature::SaveToDB()
{ {
// this should only be used when the creature has already been loaded // this should only be used when the creature has already been loaded
// preferably after adding to map, because mapid may not be valid otherwise // preferably after adding to map, because mapid may not be valid otherwise
CreatureData const *data = objmgr.GetCreatureData(m_DBTableGuid); CreatureData const *data = sObjectMgr.GetCreatureData(m_DBTableGuid);
if(!data) if(!data)
{ {
sLog.outError("Creature::SaveToDB failed, cannot get creature data!"); sLog.outError("Creature::SaveToDB failed, cannot get creature data!");
@ -1131,7 +1131,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
// update in loaded data // update in loaded data
if (!m_DBTableGuid) if (!m_DBTableGuid)
m_DBTableGuid = GetGUIDLow(); m_DBTableGuid = GetGUIDLow();
CreatureData& data = objmgr.NewOrExistCreatureData(m_DBTableGuid); CreatureData& data = sObjectMgr.NewOrExistCreatureData(m_DBTableGuid);
uint32 displayId = GetNativeDisplayId(); uint32 displayId = GetNativeDisplayId();
@ -1143,22 +1143,22 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
displayId != cinfo->DisplayID_H[0] && displayId != cinfo->DisplayID_H[1]) displayId != cinfo->DisplayID_H[0] && displayId != cinfo->DisplayID_H[1])
{ {
if (cinfo->DisplayID_A[0]) if (cinfo->DisplayID_A[0])
if (CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(cinfo->DisplayID_A[0])) if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->DisplayID_A[0]))
if(displayId == minfo->modelid_other_gender) if(displayId == minfo->modelid_other_gender)
displayId = 0; displayId = 0;
if (displayId && cinfo->DisplayID_A[1]) if (displayId && cinfo->DisplayID_A[1])
if (CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(cinfo->DisplayID_A[1])) if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->DisplayID_A[1]))
if(displayId == minfo->modelid_other_gender) if(displayId == minfo->modelid_other_gender)
displayId = 0; displayId = 0;
if (displayId && cinfo->DisplayID_H[0]) if (displayId && cinfo->DisplayID_H[0])
if (CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(cinfo->DisplayID_H[0])) if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->DisplayID_H[0]))
if(displayId == minfo->modelid_other_gender) if(displayId == minfo->modelid_other_gender)
displayId = 0; displayId = 0;
if (displayId && cinfo->DisplayID_H[1]) if (displayId && cinfo->DisplayID_H[1])
if (CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(cinfo->DisplayID_H[1])) if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->DisplayID_H[1]))
if(displayId == minfo->modelid_other_gender) if(displayId == minfo->modelid_other_gender)
displayId = 0; displayId = 0;
} }
@ -1345,7 +1345,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 team, const
bool Creature::LoadFromDB(uint32 guid, Map *map) bool Creature::LoadFromDB(uint32 guid, Map *map)
{ {
CreatureData const* data = objmgr.GetCreatureData(guid); CreatureData const* data = sObjectMgr.GetCreatureData(guid);
if(!data) if(!data)
{ {
@ -1364,7 +1364,7 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
return false; return false;
} }
else else
guid = objmgr.GenerateLowGuid(HIGHGUID_UNIT); guid = sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT);
uint16 team = 0; uint16 team = 0;
if(!Create(guid,map,data->phaseMask,data->id,team,data)) if(!Create(guid,map,data->phaseMask,data->id,team,data))
@ -1384,7 +1384,7 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
m_isDeadByDefault = data->is_dead; m_isDeadByDefault = data->is_dead;
m_deathState = m_isDeadByDefault ? DEAD : ALIVE; m_deathState = m_isDeadByDefault ? DEAD : ALIVE;
m_respawnTime = objmgr.GetCreatureRespawnTime(m_DBTableGuid,GetInstanceId()); m_respawnTime = sObjectMgr.GetCreatureRespawnTime(m_DBTableGuid,GetInstanceId());
if(m_respawnTime > time(NULL)) // not ready to respawn if(m_respawnTime > time(NULL)) // not ready to respawn
{ {
m_deathState = DEAD; m_deathState = DEAD;
@ -1398,7 +1398,7 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
else if(m_respawnTime) // respawn time set but expired else if(m_respawnTime) // respawn time set but expired
{ {
m_respawnTime = 0; m_respawnTime = 0;
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0); sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
} }
uint32 curhealth = data->curhealth; uint32 curhealth = data->curhealth;
@ -1434,7 +1434,7 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force)
return; return;
} }
EquipmentInfo const *einfo = objmgr.GetEquipmentInfo(equip_entry); EquipmentInfo const *einfo = sObjectMgr.GetEquipmentInfo(equip_entry);
if (!einfo) if (!einfo)
return; return;
@ -1445,7 +1445,7 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force)
bool Creature::hasQuest(uint32 quest_id) const bool Creature::hasQuest(uint32 quest_id) const
{ {
QuestRelations const& qr = objmgr.mCreatureQuestRelations; QuestRelations const& qr = sObjectMgr.mCreatureQuestRelations;
for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr) for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
{ {
if(itr->second==quest_id) if(itr->second==quest_id)
@ -1456,7 +1456,7 @@ bool Creature::hasQuest(uint32 quest_id) const
bool Creature::hasInvolvedQuest(uint32 quest_id) const bool Creature::hasInvolvedQuest(uint32 quest_id) const
{ {
QuestRelations const& qr = objmgr.mCreatureQuestInvolvedRelations; QuestRelations const& qr = sObjectMgr.mCreatureQuestInvolvedRelations;
for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr) for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
{ {
if(itr->second==quest_id) if(itr->second==quest_id)
@ -1473,8 +1473,8 @@ void Creature::DeleteFromDB()
return; return;
} }
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0); sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
objmgr.DeleteCreatureData(m_DBTableGuid); sObjectMgr.DeleteCreatureData(m_DBTableGuid);
WorldDatabase.BeginTransaction(); WorldDatabase.BeginTransaction();
WorldDatabase.PExecuteLog("DELETE FROM creature WHERE guid = '%u'", m_DBTableGuid); WorldDatabase.PExecuteLog("DELETE FROM creature WHERE guid = '%u'", m_DBTableGuid);
@ -1607,7 +1607,7 @@ void Creature::Respawn()
if(getDeathState()==DEAD) if(getDeathState()==DEAD)
{ {
if (m_DBTableGuid) if (m_DBTableGuid)
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0); sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
m_respawnTime = time(NULL); // respawn at next tick m_respawnTime = time(NULL); // respawn at next tick
} }
} }
@ -1902,9 +1902,9 @@ void Creature::SaveRespawnTime()
return; return;
if(m_respawnTime > time(NULL)) // dead (no corpse) if(m_respawnTime > time(NULL)) // dead (no corpse)
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime); sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
else if(m_deathTimer > 0) // dead (corpse) else if(m_deathTimer > 0) // dead (corpse)
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),time(NULL)+m_respawnDelay+m_deathTimer/IN_MILISECONDS); sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),time(NULL)+m_respawnDelay+m_deathTimer/IN_MILISECONDS);
} }
bool Creature::IsOutOfThreatArea(Unit* pVictim) const bool Creature::IsOutOfThreatArea(Unit* pVictim) const
@ -2139,7 +2139,7 @@ void Creature::GetRespawnCoord( float &x, float &y, float &z, float* ori, float*
{ {
if (m_DBTableGuid) if (m_DBTableGuid)
{ {
if (CreatureData const* data = objmgr.GetCreatureData(GetDBTableGUIDLow())) if (CreatureData const* data = sObjectMgr.GetCreatureData(GetDBTableGUIDLow()))
{ {
x = data->posX; x = data->posX;
y = data->posY; y = data->posY;
@ -2203,7 +2203,7 @@ std::string Creature::GetAIName() const
std::string Creature::GetScriptName() const std::string Creature::GetScriptName() const
{ {
return objmgr.GetScriptName(GetScriptId()); return sObjectMgr.GetScriptName(GetScriptId());
} }
uint32 Creature::GetScriptId() const uint32 Creature::GetScriptId() const
@ -2213,7 +2213,7 @@ uint32 Creature::GetScriptId() const
VendorItemData const* Creature::GetVendorItems() const VendorItemData const* Creature::GetVendorItems() const
{ {
return objmgr.GetNpcVendorItemList(GetEntry()); return sObjectMgr.GetNpcVendorItemList(GetEntry());
} }
uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem) uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem)
@ -2290,7 +2290,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us
TrainerSpellData const* Creature::GetTrainerSpells() const TrainerSpellData const* Creature::GetTrainerSpells() const
{ {
return objmgr.GetNpcTrainerSpells(GetEntry()); return sObjectMgr.GetNpcTrainerSpells(GetEntry());
} }
// overwrite WorldObject function for proper name localization // overwrite WorldObject function for proper name localization
@ -2298,7 +2298,7 @@ const char* Creature::GetNameForLocaleIdx(int32 loc_idx) const
{ {
if (loc_idx >= 0) if (loc_idx >= 0)
{ {
CreatureLocale const *cl = objmgr.GetCreatureLocale(GetEntry()); CreatureLocale const *cl = sObjectMgr.GetCreatureLocale(GetEntry());
if (cl) if (cl)
{ {
if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty()) if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty())

View file

@ -55,8 +55,8 @@ int CreatureEventAI::Permissible(const Creature *creature)
CreatureEventAI::CreatureEventAI(Creature *c ) : CreatureAI(c) CreatureEventAI::CreatureEventAI(Creature *c ) : CreatureAI(c)
{ {
// Need make copy for filter unneeded steps and safe in case table reload // Need make copy for filter unneeded steps and safe in case table reload
CreatureEventAI_Event_Map::const_iterator CreatureEvents = CreatureEAI_Mgr.GetCreatureEventAIMap().find(m_creature->GetEntry()); CreatureEventAI_Event_Map::const_iterator CreatureEvents = sEventAIMgr.GetCreatureEventAIMap().find(m_creature->GetEntry());
if (CreatureEvents != CreatureEAI_Mgr.GetCreatureEventAIMap().end()) if (CreatureEvents != sEventAIMgr.GetCreatureEventAIMap().end())
{ {
std::vector<CreatureEventAI_Event>::const_iterator i; std::vector<CreatureEventAI_Event>::const_iterator i;
for (i = (*CreatureEvents).second.begin(); i != (*CreatureEvents).second.end(); ++i) for (i = (*CreatureEvents).second.begin(); i != (*CreatureEvents).second.end(); ++i)
@ -406,7 +406,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
{ {
if (CreatureInfo const* ci = GetCreatureTemplateStore(action.morph.creatureId)) if (CreatureInfo const* ci = GetCreatureTemplateStore(action.morph.creatureId))
{ {
uint32 display_id = objmgr.ChooseDisplayId(0,ci); uint32 display_id = sObjectMgr.ChooseDisplayId(0,ci);
m_creature->SetDisplayId(display_id); m_creature->SetDisplayId(display_id);
} }
} }
@ -672,8 +672,8 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
{ {
Unit* target = GetTargetByType(action.summon_id.target, pActionInvoker); Unit* target = GetTargetByType(action.summon_id.target, pActionInvoker);
CreatureEventAI_Summon_Map::const_iterator i = CreatureEAI_Mgr.GetCreatureEventAISummonMap().find(action.summon_id.spawnId); CreatureEventAI_Summon_Map::const_iterator i = sEventAIMgr.GetCreatureEventAISummonMap().find(action.summon_id.spawnId);
if (i == CreatureEAI_Mgr.GetCreatureEventAISummonMap().end()) 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, m_creature->GetEntry()); 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, m_creature->GetEntry());
return; return;
@ -1259,9 +1259,9 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit*
return; return;
} }
CreatureEventAI_TextMap::const_iterator i = CreatureEAI_Mgr.GetCreatureEventAITextMap().find(textEntry); CreatureEventAI_TextMap::const_iterator i = sEventAIMgr.GetCreatureEventAITextMap().find(textEntry);
if (i == CreatureEAI_Mgr.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); 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; return;

View file

@ -36,7 +36,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts(bool check_entry_use)
m_CreatureEventAI_TextMap.clear(); m_CreatureEventAI_TextMap.clear();
// Load EventAI Text // Load EventAI Text
objmgr.LoadMangosStrings(WorldDatabase,"creature_ai_texts",MIN_CREATURE_AI_TEXT_STRING_ID,MAX_CREATURE_AI_TEXT_STRING_ID); sObjectMgr.LoadMangosStrings(WorldDatabase,"creature_ai_texts",MIN_CREATURE_AI_TEXT_STRING_ID,MAX_CREATURE_AI_TEXT_STRING_ID);
// Gather Additional data from EventAI Texts // Gather Additional data from EventAI Texts
QueryResult *result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM creature_ai_texts"); QueryResult *result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM creature_ai_texts");
@ -67,7 +67,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts(bool check_entry_use)
} }
// range negative (don't must be happen, loaded from same table) // range negative (don't must be happen, loaded from same table)
if (!objmgr.GetMangosStringLocale(i)) if (!sObjectMgr.GetMangosStringLocale(i))
{ {
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` not found",i); sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` not found",i);
continue; continue;
@ -411,7 +411,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
break; break;
case EVENT_T_QUEST_ACCEPT: case EVENT_T_QUEST_ACCEPT:
case EVENT_T_QUEST_COMPLETE: case EVENT_T_QUEST_COMPLETE:
if (!objmgr.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 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); sLog.outErrorDb("CreatureEventAI: Creature %u using not implemented event (%u) in event %u.", temp.creature_id, temp.event_id, i);
continue; continue;
@ -619,7 +619,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); sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j+1, action.threat_all_pct.percent);
break; break;
case ACTION_T_QUEST_EVENT: case ACTION_T_QUEST_EVENT:
if (Quest const* qid = objmgr.GetQuestTemplate(action.quest_event.questId)) if (Quest const* qid = sObjectMgr.GetQuestTemplate(action.quest_event.questId))
{ {
if (!qid->HasFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT)) if (!qid->HasFlag(QUEST_MANGOS_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); 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);
@ -661,7 +661,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); 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; break;
case ACTION_T_QUEST_EVENT_ALL: case ACTION_T_QUEST_EVENT_ALL:
if (Quest const* qid = objmgr.GetQuestTemplate(action.quest_event_all.questId)) if (Quest const* qid = sObjectMgr.GetQuestTemplate(action.quest_event_all.questId))
{ {
if (!qid->HasFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT)) if (!qid->HasFlag(QUEST_MANGOS_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); 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);

View file

@ -45,5 +45,5 @@ class CreatureEventAIMgr
CreatureEventAI_TextMap m_CreatureEventAI_TextMap; CreatureEventAI_TextMap m_CreatureEventAI_TextMap;
}; };
#define CreatureEAI_Mgr MaNGOS::Singleton<CreatureEventAIMgr>::Instance() #define sEventAIMgr MaNGOS::Singleton<CreatureEventAIMgr>::Instance()
#endif #endif

View file

@ -50,7 +50,7 @@ void WorldSession::HandleGMTicketGetTicketOpcode( WorldPacket & /*recv_data*/ )
data << (uint32)0; data << (uint32)0;
SendPacket( &data ); SendPacket( &data );
GMTicket* ticket = ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow()); GMTicket* ticket = sTicketMgr.GetGMTicket(GetPlayer()->GetGUIDLow());
if(ticket) if(ticket)
SendGMTicketGetTicket(0x06,ticket->GetText()); SendGMTicketGetTicket(0x06,ticket->GetText());
else else
@ -62,7 +62,7 @@ void WorldSession::HandleGMTicketUpdateTextOpcode( WorldPacket & recv_data )
std::string ticketText; std::string ticketText;
recv_data >> ticketText; recv_data >> ticketText;
if(GMTicket* ticket = ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow())) if(GMTicket* ticket = sTicketMgr.GetGMTicket(GetPlayer()->GetGUIDLow()))
ticket->SetText(ticketText.c_str()); ticket->SetText(ticketText.c_str());
else else
sLog.outError("Ticket update: Player %s (GUID: %u) doesn't have active ticket", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow()); sLog.outError("Ticket update: Player %s (GUID: %u) doesn't have active ticket", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
@ -70,7 +70,7 @@ void WorldSession::HandleGMTicketUpdateTextOpcode( WorldPacket & recv_data )
void WorldSession::HandleGMTicketDeleteTicketOpcode( WorldPacket & /*recv_data*/ ) void WorldSession::HandleGMTicketDeleteTicketOpcode( WorldPacket & /*recv_data*/ )
{ {
ticketmgr.Delete(GetPlayer()->GetGUIDLow()); sTicketMgr.Delete(GetPlayer()->GetGUIDLow());
WorldPacket data( SMSG_GMTICKET_DELETETICKET, 4 ); WorldPacket data( SMSG_GMTICKET_DELETETICKET, 4 );
data << uint32(9); data << uint32(9);
@ -95,7 +95,7 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
sLog.outDebug("TicketCreate: map %u, x %f, y %f, z %f, text %s", map, x, y, z, ticketText.c_str()); sLog.outDebug("TicketCreate: map %u, x %f, y %f, z %f, text %s", map, x, y, z, ticketText.c_str());
if(ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow())) if(sTicketMgr.GetGMTicket(GetPlayer()->GetGUIDLow()))
{ {
WorldPacket data( SMSG_GMTICKET_CREATE, 4 ); WorldPacket data( SMSG_GMTICKET_CREATE, 4 );
data << uint32(1); // 1 - You already have GM ticket data << uint32(1); // 1 - You already have GM ticket
@ -103,7 +103,7 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
return; return;
} }
ticketmgr.Create(_player->GetGUIDLow(), ticketText.c_str()); sTicketMgr.Create(_player->GetGUIDLow(), ticketText.c_str());
WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 ); WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 );
data << (uint32)time(NULL); data << (uint32)time(NULL);
@ -116,7 +116,7 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
DEBUG_LOG("update the ticket"); DEBUG_LOG("update the ticket");
//TODO: Guard player map //TODO: Guard player map
HashMapHolder<Player>::MapType &m = objaccessor.GetPlayers(); HashMapHolder<Player>::MapType &m = sObjectAccessor.GetPlayers();
for(HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) for(HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
{ {
if(itr->second->GetSession()->GetSecurity() >= SEC_GAMEMASTER && itr->second->isAcceptTickets()) if(itr->second->GetSession()->GetSecurity() >= SEC_GAMEMASTER && itr->second->isAcceptTickets())

View file

@ -72,7 +72,7 @@ void GMTicketMgr::DeleteAll()
{ {
for(GMTicketMap::const_iterator itr = m_GMTicketMap.begin(); itr != m_GMTicketMap.end(); ++itr) for(GMTicketMap::const_iterator itr = m_GMTicketMap.begin(); itr != m_GMTicketMap.end(); ++itr)
{ {
if(Player* owner = objmgr.GetPlayer(MAKE_NEW_GUID(itr->first,0,HIGHGUID_PLAYER))) if(Player* owner = sObjectMgr.GetPlayer(MAKE_NEW_GUID(itr->first,0,HIGHGUID_PLAYER)))
owner->GetSession()->SendGMTicketGetTicket(0x0A,0); owner->GetSession()->SendGMTicketGetTicket(0x0A,0);
} }
CharacterDatabase.PExecute("DELETE FROM character_ticket"); CharacterDatabase.PExecute("DELETE FROM character_ticket");

View file

@ -121,5 +121,5 @@ class GMTicketMgr
GMTicketMap m_GMTicketMap; GMTicketMap m_GMTicketMap;
}; };
#define ticketmgr MaNGOS::Singleton<GMTicketMgr>::Instance() #define sTicketMgr MaNGOS::Singleton<GMTicketMgr>::Instance()
#endif #endif

View file

@ -305,7 +305,7 @@ void GameEventMgr::LoadFromDB()
if(newModelEquipSet.equipment_id > 0) if(newModelEquipSet.equipment_id > 0)
{ {
if(!objmgr.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); 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; continue;
@ -399,7 +399,7 @@ void GameEventMgr::LoadFromDB()
continue; continue;
} }
if (!poolhandler.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); 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; continue;
@ -514,13 +514,13 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
for (GuidList::iterator itr = mGameEventCreatureGuids[internal_event_id].begin();itr != mGameEventCreatureGuids[internal_event_id].end();++itr) for (GuidList::iterator itr = mGameEventCreatureGuids[internal_event_id].begin();itr != mGameEventCreatureGuids[internal_event_id].end();++itr)
{ {
// Add to correct cell // Add to correct cell
CreatureData const* data = objmgr.GetCreatureData(*itr); CreatureData const* data = sObjectMgr.GetCreatureData(*itr);
if (data) if (data)
{ {
objmgr.AddCreatureToGrid(*itr, data); sObjectMgr.AddCreatureToGrid(*itr, data);
// Spawn if necessary (loaded grids only) // Spawn if necessary (loaded grids only)
Map* map = const_cast<Map*>(mapmgr.CreateBaseMap(data->mapid)); Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(data->mapid));
// We use spawn coords to spawn // We use spawn coords to spawn
if(!map->Instanceable() && map->IsLoaded(data->posX,data->posY)) if(!map->Instanceable() && map->IsLoaded(data->posX,data->posY))
{ {
@ -547,13 +547,13 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
for (GuidList::iterator itr = mGameEventGameobjectGuids[internal_event_id].begin();itr != mGameEventGameobjectGuids[internal_event_id].end();++itr) for (GuidList::iterator itr = mGameEventGameobjectGuids[internal_event_id].begin();itr != mGameEventGameobjectGuids[internal_event_id].end();++itr)
{ {
// Add to correct cell // Add to correct cell
GameObjectData const* data = objmgr.GetGOData(*itr); GameObjectData const* data = sObjectMgr.GetGOData(*itr);
if (data) if (data)
{ {
objmgr.AddGameobjectToGrid(*itr, data); sObjectMgr.AddGameobjectToGrid(*itr, data);
// Spawn if necessary (loaded grids only) // Spawn if necessary (loaded grids only)
// this base map checked as non-instanced and then only existed // this base map checked as non-instanced and then only existed
Map* map = const_cast<Map*>(mapmgr.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 // We use current coords to unspawn, not spawn coords since creature can have changed grid
if(!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) if(!map->Instanceable() && map->IsLoaded(data->posX, data->posY))
{ {
@ -580,9 +580,9 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin();itr != mGameEventPoolIds[internal_event_id].end();++itr) for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin();itr != mGameEventPoolIds[internal_event_id].end();++itr)
{ {
poolhandler.SpawnPool(*itr, 0, 0); sPoolMgr.SpawnPool(*itr, 0, 0);
poolhandler.SpawnPool(*itr, 0, TYPEID_GAMEOBJECT); sPoolMgr.SpawnPool(*itr, 0, TYPEID_GAMEOBJECT);
poolhandler.SpawnPool(*itr, 0, TYPEID_UNIT); sPoolMgr.SpawnPool(*itr, 0, TYPEID_UNIT);
} }
} }
@ -599,9 +599,9 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
for (GuidList::iterator itr = mGameEventCreatureGuids[internal_event_id].begin();itr != mGameEventCreatureGuids[internal_event_id].end();++itr) for (GuidList::iterator itr = mGameEventCreatureGuids[internal_event_id].begin();itr != mGameEventCreatureGuids[internal_event_id].end();++itr)
{ {
// Remove the creature from grid // Remove the creature from grid
if( CreatureData const* data = objmgr.GetCreatureData(*itr) ) if( CreatureData const* data = sObjectMgr.GetCreatureData(*itr) )
{ {
objmgr.RemoveCreatureFromGrid(*itr, data); sObjectMgr.RemoveCreatureFromGrid(*itr, data);
if( Creature* pCreature = ObjectAccessor::GetCreatureInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_UNIT)) ) if( Creature* pCreature = ObjectAccessor::GetCreatureInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_UNIT)) )
pCreature->AddObjectToRemoveList(); pCreature->AddObjectToRemoveList();
@ -617,9 +617,9 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
for (GuidList::iterator itr = mGameEventGameobjectGuids[internal_event_id].begin();itr != mGameEventGameobjectGuids[internal_event_id].end();++itr) for (GuidList::iterator itr = mGameEventGameobjectGuids[internal_event_id].begin();itr != mGameEventGameobjectGuids[internal_event_id].end();++itr)
{ {
// Remove the gameobject from grid // Remove the gameobject from grid
if(GameObjectData const* data = objmgr.GetGOData(*itr)) if(GameObjectData const* data = sObjectMgr.GetGOData(*itr))
{ {
objmgr.RemoveGameobjectFromGrid(*itr, data); sObjectMgr.RemoveGameobjectFromGrid(*itr, data);
if( GameObject* pGameobject = ObjectAccessor::GetGameObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_GAMEOBJECT)) ) if( GameObject* pGameobject = ObjectAccessor::GetGameObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_GAMEOBJECT)) )
pGameobject->AddObjectToRemoveList(); pGameobject->AddObjectToRemoveList();
@ -633,7 +633,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin();itr != mGameEventPoolIds[internal_event_id].end();++itr) for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin();itr != mGameEventPoolIds[internal_event_id].end();++itr)
{ {
poolhandler.DespawnPool(*itr); sPoolMgr.DespawnPool(*itr);
} }
} }
@ -642,7 +642,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
for(ModelEquipList::iterator itr = mGameEventModelEquip[event_id].begin();itr != mGameEventModelEquip[event_id].end();++itr) for(ModelEquipList::iterator itr = mGameEventModelEquip[event_id].begin();itr != mGameEventModelEquip[event_id].end();++itr)
{ {
// Remove the creature from grid // Remove the creature from grid
CreatureData const* data = objmgr.GetCreatureData(itr->first); CreatureData const* data = sObjectMgr.GetCreatureData(itr->first);
if(!data) if(!data)
continue; continue;
@ -657,7 +657,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
pCreature->LoadEquipment(itr->second.equipment_id, true); pCreature->LoadEquipment(itr->second.equipment_id, true);
if (itr->second.modelid >0 && itr->second.modelid_prev != itr->second.modelid) if (itr->second.modelid >0 && itr->second.modelid_prev != itr->second.modelid)
{ {
CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(itr->second.modelid); CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(itr->second.modelid);
if (minfo) if (minfo)
{ {
pCreature->SetDisplayId(itr->second.modelid); pCreature->SetDisplayId(itr->second.modelid);
@ -672,7 +672,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
pCreature->LoadEquipment(itr->second.equipement_id_prev, true); pCreature->LoadEquipment(itr->second.equipement_id_prev, true);
if (itr->second.modelid_prev >0 && itr->second.modelid_prev != itr->second.modelid) if (itr->second.modelid_prev >0 && itr->second.modelid_prev != itr->second.modelid)
{ {
CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(itr->second.modelid_prev); CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(itr->second.modelid_prev);
if (minfo) if (minfo)
{ {
pCreature->SetDisplayId(itr->second.modelid_prev); pCreature->SetDisplayId(itr->second.modelid_prev);
@ -685,12 +685,12 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
} }
else // If not spawned else // If not spawned
{ {
CreatureData const* data2 = objmgr.GetCreatureData(itr->first); CreatureData const* data2 = sObjectMgr.GetCreatureData(itr->first);
if (data2 && activate) if (data2 && activate)
{ {
CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(data2->id); CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(data2->id);
uint32 display_id = objmgr.ChooseDisplayId(0,cinfo,data2); uint32 display_id = sObjectMgr.ChooseDisplayId(0,cinfo,data2);
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id); CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
if (minfo) if (minfo)
display_id = minfo->modelid; display_id = minfo->modelid;
@ -703,7 +703,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
} }
// now last step: put in data // now last step: put in data
// just to have write access to it // just to have write access to it
CreatureData& data2 = objmgr.NewOrExistCreatureData(itr->first); CreatureData& data2 = sObjectMgr.NewOrExistCreatureData(itr->first);
if (activate) if (activate)
{ {
data2.displayid = itr->second.modelid; data2.displayid = itr->second.modelid;
@ -722,7 +722,7 @@ void GameEventMgr::UpdateEventQuests(uint16 event_id, bool Activate)
QuestRelList::iterator itr; QuestRelList::iterator itr;
for (itr = mGameEventQuests[event_id].begin();itr != mGameEventQuests[event_id].end();++itr) for (itr = mGameEventQuests[event_id].begin();itr != mGameEventQuests[event_id].end();++itr)
{ {
QuestRelations &CreatureQuestMap = objmgr.mCreatureQuestRelations; QuestRelations &CreatureQuestMap = sObjectMgr.mCreatureQuestRelations;
if (Activate) // Add the pair(id,quest) to the multimap if (Activate) // Add the pair(id,quest) to the multimap
CreatureQuestMap.insert(QuestRelations::value_type(itr->first, itr->second)); CreatureQuestMap.insert(QuestRelations::value_type(itr->first, itr->second));
else else

View file

@ -258,9 +258,9 @@ void GameObject::Update(uint32 /*p_time*/)
return; return;
} }
// respawn timer // respawn timer
uint16 poolid = poolhandler.IsPartOfAPool(GetGUIDLow(), TYPEID_GAMEOBJECT); uint16 poolid = sPoolMgr.IsPartOfAPool(GetGUIDLow(), TYPEID_GAMEOBJECT);
if (poolid) if (poolid)
poolhandler.UpdatePool(poolid, GetGUIDLow(), TYPEID_GAMEOBJECT); sPoolMgr.UpdatePool(poolid, GetGUIDLow(), TYPEID_GAMEOBJECT);
else else
GetMap()->Add(this); GetMap()->Add(this);
break; break;
@ -473,9 +473,9 @@ void GameObject::Delete()
SetGoState(GO_STATE_READY); SetGoState(GO_STATE_READY);
SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags); SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags);
uint16 poolid = poolhandler.IsPartOfAPool(GetGUIDLow(), TYPEID_GAMEOBJECT); uint16 poolid = sPoolMgr.IsPartOfAPool(GetGUIDLow(), TYPEID_GAMEOBJECT);
if (poolid) if (poolid)
poolhandler.UpdatePool(poolid, GetGUIDLow(), TYPEID_GAMEOBJECT); sPoolMgr.UpdatePool(poolid, GetGUIDLow(), TYPEID_GAMEOBJECT);
else else
AddObjectToRemoveList(); AddObjectToRemoveList();
} }
@ -497,7 +497,7 @@ void GameObject::SaveToDB()
{ {
// this should only be used when the gameobject has already been loaded // this should only be used when the gameobject has already been loaded
// preferably after adding to map, because mapid may not be valid otherwise // preferably after adding to map, because mapid may not be valid otherwise
GameObjectData const *data = objmgr.GetGOData(m_DBTableGuid); GameObjectData const *data = sObjectMgr.GetGOData(m_DBTableGuid);
if(!data) if(!data)
{ {
sLog.outError("GameObject::SaveToDB failed, cannot get gameobject data!"); sLog.outError("GameObject::SaveToDB failed, cannot get gameobject data!");
@ -517,7 +517,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
if (!m_DBTableGuid) if (!m_DBTableGuid)
m_DBTableGuid = GetGUIDLow(); m_DBTableGuid = GetGUIDLow();
// update in loaded data (changing data only in this place) // update in loaded data (changing data only in this place)
GameObjectData& data = objmgr.NewGOData(m_DBTableGuid); GameObjectData& data = sObjectMgr.NewGOData(m_DBTableGuid);
// data->guid = guid don't must be update at save // data->guid = guid don't must be update at save
data.id = GetEntry(); data.id = GetEntry();
@ -564,7 +564,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
bool GameObject::LoadFromDB(uint32 guid, Map *map) bool GameObject::LoadFromDB(uint32 guid, Map *map)
{ {
GameObjectData const* data = objmgr.GetGOData(guid); GameObjectData const* data = sObjectMgr.GetGOData(guid);
if( !data ) if( !data )
{ {
@ -589,7 +589,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
GOState go_state = data->go_state; GOState go_state = data->go_state;
m_DBTableGuid = guid; m_DBTableGuid = guid;
if (map->GetInstanceId() != 0) guid = objmgr.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) ) if (!Create(guid,entry, map, phaseMask, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state) )
return false; return false;
@ -607,13 +607,13 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
{ {
m_spawnedByDefault = true; m_spawnedByDefault = true;
m_respawnDelayTime = data->spawntimesecs; m_respawnDelayTime = data->spawntimesecs;
m_respawnTime = objmgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId()); m_respawnTime = sObjectMgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId());
// ready to respawn // ready to respawn
if(m_respawnTime && m_respawnTime <= time(NULL)) if(m_respawnTime && m_respawnTime <= time(NULL))
{ {
m_respawnTime = 0; m_respawnTime = 0;
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0); sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
} }
} }
else else
@ -629,8 +629,8 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
void GameObject::DeleteFromDB() void GameObject::DeleteFromDB()
{ {
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0); sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
objmgr.DeleteGOData(m_DBTableGuid); sObjectMgr.DeleteGOData(m_DBTableGuid);
WorldDatabase.PExecuteLog("DELETE FROM gameobject WHERE guid = '%u'", m_DBTableGuid); WorldDatabase.PExecuteLog("DELETE FROM gameobject WHERE guid = '%u'", m_DBTableGuid);
WorldDatabase.PExecuteLog("DELETE FROM game_event_gameobject WHERE guid = '%u'", m_DBTableGuid); WorldDatabase.PExecuteLog("DELETE FROM game_event_gameobject WHERE guid = '%u'", m_DBTableGuid);
WorldDatabase.PExecuteLog("DELETE FROM gameobject_battleground WHERE guid = '%u'", m_DBTableGuid); WorldDatabase.PExecuteLog("DELETE FROM gameobject_battleground WHERE guid = '%u'", m_DBTableGuid);
@ -646,7 +646,7 @@ GameObjectInfo const *GameObject::GetGOInfo() const
/*********************************************************/ /*********************************************************/
bool GameObject::hasQuest(uint32 quest_id) const bool GameObject::hasQuest(uint32 quest_id) const
{ {
QuestRelations const& qr = objmgr.mGOQuestRelations; QuestRelations const& qr = sObjectMgr.mGOQuestRelations;
for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr) for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
{ {
if(itr->second==quest_id) if(itr->second==quest_id)
@ -657,7 +657,7 @@ bool GameObject::hasQuest(uint32 quest_id) const
bool GameObject::hasInvolvedQuest(uint32 quest_id) const bool GameObject::hasInvolvedQuest(uint32 quest_id) const
{ {
QuestRelations const& qr = objmgr.mGOQuestInvolvedRelations; QuestRelations const& qr = sObjectMgr.mGOQuestInvolvedRelations;
for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr) for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
{ {
if(itr->second==quest_id) if(itr->second==quest_id)
@ -682,7 +682,7 @@ Unit* GameObject::GetOwner() const
void GameObject::SaveRespawnTime() void GameObject::SaveRespawnTime()
{ {
if(m_respawnTime > time(NULL) && m_spawnedByDefault) if(m_respawnTime > time(NULL) && m_spawnedByDefault)
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime); sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
} }
bool GameObject::isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const bool GameObject::isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const
@ -725,13 +725,13 @@ void GameObject::Respawn()
if(m_spawnedByDefault && m_respawnTime > 0) if(m_spawnedByDefault && m_respawnTime > 0)
{ {
m_respawnTime = time(NULL); m_respawnTime = time(NULL);
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0); sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
} }
} }
bool GameObject::ActivateToQuest( Player *pTarget)const bool GameObject::ActivateToQuest( Player *pTarget)const
{ {
if(!objmgr.IsGameObjectForQuests(GetEntry())) if(!sObjectMgr.IsGameObjectForQuests(GetEntry()))
return false; return false;
switch(GetGoType()) switch(GetGoType())
@ -1012,9 +1012,9 @@ void GameObject::Use(Unit* user)
uint32 zone, subzone; uint32 zone, subzone;
GetZoneAndAreaId(zone,subzone); GetZoneAndAreaId(zone,subzone);
int32 zone_skill = objmgr.GetFishingBaseSkillLevel( subzone ); int32 zone_skill = sObjectMgr.GetFishingBaseSkillLevel( subzone );
if(!zone_skill) if(!zone_skill)
zone_skill = objmgr.GetFishingBaseSkillLevel( zone ); zone_skill = sObjectMgr.GetFishingBaseSkillLevel( zone );
//provide error, no fishable zone or area should be 0 //provide error, no fishable zone or area should be 0
if(!zone_skill) if(!zone_skill)
@ -1293,7 +1293,7 @@ const char* GameObject::GetNameForLocaleIdx(int32 loc_idx) const
{ {
if (loc_idx >= 0) if (loc_idx >= 0)
{ {
GameObjectLocale const *cl = objmgr.GetGameObjectLocale(GetEntry()); GameObjectLocale const *cl = sObjectMgr.GetGameObjectLocale(GetEntry());
if (cl) if (cl)
{ {
if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty()) if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty())

View file

@ -51,7 +51,7 @@ static void CorpsesEraseCallBack(QueryResult *result, bool bones)
/// Resurrectable - convert corpses to bones /// Resurrectable - convert corpses to bones
if(!bones) if(!bones)
{ {
if(!objaccessor.ConvertCorpseForPlayer(player_guid)) if(!sObjectAccessor.ConvertCorpseForPlayer(player_guid))
{ {
sLog.outDebug("Corpse %u not found in world or bones creating forbidden. Delete from DB.",guidlow); sLog.outDebug("Corpse %u not found in world or bones creating forbidden. Delete from DB.",guidlow);
CharacterDatabase.PExecute("DELETE FROM corpse WHERE guid = '%u'",guidlow); CharacterDatabase.PExecute("DELETE FROM corpse WHERE guid = '%u'",guidlow);
@ -60,7 +60,7 @@ static void CorpsesEraseCallBack(QueryResult *result, bool bones)
else else
///- or delete bones ///- or delete bones
{ {
mapmgr.RemoveBonesFromMap(mapid, guid, positionX, positionY); sMapMgr.RemoveBonesFromMap(mapid, guid, positionX, positionY);
///- remove bones from the database ///- remove bones from the database
CharacterDatabase.PExecute("DELETE FROM corpse WHERE guid = '%u'",guidlow); CharacterDatabase.PExecute("DELETE FROM corpse WHERE guid = '%u'",guidlow);

View file

@ -147,7 +147,7 @@ void PlayerMenu::SendGossipMenu( uint32 TitleTextId, uint64 npcGUID )
{ {
QuestMenuItem const& qItem = mQuestMenu.GetItem(iI); QuestMenuItem const& qItem = mQuestMenu.GetItem(iI);
uint32 questID = qItem.m_qId; uint32 questID = qItem.m_qId;
Quest const* pQuest = objmgr.GetQuestTemplate(questID); Quest const* pQuest = sObjectMgr.GetQuestTemplate(questID);
data << uint32(questID); data << uint32(questID);
data << uint32(qItem.m_qIcon); data << uint32(qItem.m_qIcon);
@ -157,7 +157,7 @@ void PlayerMenu::SendGossipMenu( uint32 TitleTextId, uint64 npcGUID )
int loc_idx = pSession->GetSessionDbLocaleIndex(); int loc_idx = pSession->GetSessionDbLocaleIndex();
if (loc_idx >= 0) if (loc_idx >= 0)
{ {
QuestLocale const *ql = objmgr.GetQuestLocale(questID); QuestLocale const *ql = sObjectMgr.GetQuestLocale(questID);
if (ql) if (ql)
{ {
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty()) if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
@ -195,7 +195,7 @@ void PlayerMenu::SendPointOfInterest( float X, float Y, uint32 Icon, uint32 Flag
void PlayerMenu::SendPointOfInterest( uint32 poi_id ) void PlayerMenu::SendPointOfInterest( uint32 poi_id )
{ {
PointOfInterest const* poi = objmgr.GetPointOfInterest(poi_id); PointOfInterest const* poi = sObjectMgr.GetPointOfInterest(poi_id);
if(!poi) if(!poi)
{ {
sLog.outErrorDb("Requested send not existed POI (Id: %u), ignore.",poi_id); sLog.outErrorDb("Requested send not existed POI (Id: %u), ignore.",poi_id);
@ -207,7 +207,7 @@ void PlayerMenu::SendPointOfInterest( uint32 poi_id )
int loc_idx = pSession->GetSessionDbLocaleIndex(); int loc_idx = pSession->GetSessionDbLocaleIndex();
if (loc_idx >= 0) if (loc_idx >= 0)
{ {
PointOfInterestLocale const *pl = objmgr.GetPointOfInterestLocale(poi_id); PointOfInterestLocale const *pl = sObjectMgr.GetPointOfInterestLocale(poi_id);
if (pl) if (pl)
{ {
if (pl->IconName.size() > size_t(loc_idx) && !pl->IconName[loc_idx].empty()) if (pl->IconName.size() > size_t(loc_idx) && !pl->IconName[loc_idx].empty())
@ -229,7 +229,7 @@ void PlayerMenu::SendPointOfInterest( uint32 poi_id )
void PlayerMenu::SendTalking( uint32 textID ) void PlayerMenu::SendTalking( uint32 textID )
{ {
GossipText const* pGossip = objmgr.GetGossipText(textID); GossipText const* pGossip = sObjectMgr.GetGossipText(textID);
WorldPacket data( SMSG_NPC_TEXT_UPDATE, 100 ); // guess size WorldPacket data( SMSG_NPC_TEXT_UPDATE, 100 ); // guess size
data << textID; // can be < 0 data << textID; // can be < 0
@ -261,7 +261,7 @@ void PlayerMenu::SendTalking( uint32 textID )
int loc_idx = pSession->GetSessionDbLocaleIndex(); int loc_idx = pSession->GetSessionDbLocaleIndex();
if (loc_idx >= 0) if (loc_idx >= 0)
{ {
NpcTextLocale const *nl = objmgr.GetNpcTextLocale(textID); NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textID);
if (nl) if (nl)
{ {
for (int i=0;i<8;++i) for (int i=0;i<8;++i)
@ -340,7 +340,7 @@ QuestMenu::~QuestMenu()
void QuestMenu::AddMenuItem( uint32 QuestId, uint8 Icon) void QuestMenu::AddMenuItem( uint32 QuestId, uint8 Icon)
{ {
Quest const* qinfo = objmgr.GetQuestTemplate(QuestId); Quest const* qinfo = sObjectMgr.GetQuestTemplate(QuestId);
if (!qinfo) return; if (!qinfo) return;
ASSERT( m_qItems.size() <= GOSSIP_MAX_MENU_ITEMS ); ASSERT( m_qItems.size() <= GOSSIP_MAX_MENU_ITEMS );
@ -384,14 +384,14 @@ void PlayerMenu::SendQuestGiverQuestList( QEmote eEmote, const std::string& Titl
QuestMenuItem const& qmi = mQuestMenu.GetItem(iI); QuestMenuItem const& qmi = mQuestMenu.GetItem(iI);
uint32 questID = qmi.m_qId; uint32 questID = qmi.m_qId;
Quest const *pQuest = objmgr.GetQuestTemplate(questID); Quest const *pQuest = sObjectMgr.GetQuestTemplate(questID);
std::string title = pQuest ? pQuest->GetTitle() : ""; std::string title = pQuest ? pQuest->GetTitle() : "";
int loc_idx = pSession->GetSessionDbLocaleIndex(); int loc_idx = pSession->GetSessionDbLocaleIndex();
if (loc_idx >= 0) if (loc_idx >= 0)
{ {
if(QuestLocale const *ql = objmgr.GetQuestLocale(questID)) if(QuestLocale const *ql = sObjectMgr.GetQuestLocale(questID))
{ {
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty()) if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
title=ql->Title[loc_idx]; title=ql->Title[loc_idx];
@ -429,7 +429,7 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID
int loc_idx = pSession->GetSessionDbLocaleIndex(); int loc_idx = pSession->GetSessionDbLocaleIndex();
if (loc_idx >= 0) if (loc_idx >= 0)
{ {
QuestLocale const *ql = objmgr.GetQuestLocale(pQuest->GetQuestId()); QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
if (ql) if (ql)
{ {
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty()) if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
@ -525,7 +525,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
int loc_idx = pSession->GetSessionDbLocaleIndex(); int loc_idx = pSession->GetSessionDbLocaleIndex();
if (loc_idx >= 0) if (loc_idx >= 0)
{ {
QuestLocale const *ql = objmgr.GetQuestLocale(pQuest->GetQuestId()); QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
if (ql) if (ql)
{ {
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty()) if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
@ -647,7 +647,7 @@ void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID,
int loc_idx = pSession->GetSessionDbLocaleIndex(); int loc_idx = pSession->GetSessionDbLocaleIndex();
if (loc_idx >= 0) if (loc_idx >= 0)
{ {
QuestLocale const *ql = objmgr.GetQuestLocale(pQuest->GetQuestId()); QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
if (ql) if (ql)
{ {
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty()) if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
@ -735,7 +735,7 @@ void PlayerMenu::SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID
int loc_idx = pSession->GetSessionDbLocaleIndex(); int loc_idx = pSession->GetSessionDbLocaleIndex();
if (loc_idx >= 0) if (loc_idx >= 0)
{ {
QuestLocale const *ql = objmgr.GetQuestLocale(pQuest->GetQuestId()); QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
if (ql) if (ql)
{ {
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty()) if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())

View file

@ -99,7 +99,7 @@ bool Group::Create(const uint64 &guid, const char * name)
m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL; m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
if(!isBGGroup()) if(!isBGGroup())
{ {
Player *leader = objmgr.GetPlayer(guid); Player *leader = sObjectMgr.GetPlayer(guid);
if(leader) if(leader)
{ {
m_dungeonDifficulty = leader->GetDungeonDifficulty(); m_dungeonDifficulty = leader->GetDungeonDifficulty();
@ -145,7 +145,7 @@ bool Group::LoadGroupFromDB(const uint64 &leaderGuid, QueryResult *result, bool
m_leaderGuid = leaderGuid; m_leaderGuid = leaderGuid;
// group leader not exist // group leader not exist
if(!objmgr.GetPlayerNameByGUID(m_leaderGuid, m_leaderName)) if(!sObjectMgr.GetPlayerNameByGUID(m_leaderGuid, m_leaderName))
{ {
if(!external) delete result; if(!external) delete result;
return false; return false;
@ -202,7 +202,7 @@ bool Group::LoadMemberFromDB(uint32 guidLow, uint8 subgroup, bool assistant)
member.guid = MAKE_NEW_GUID(guidLow, 0, HIGHGUID_PLAYER); member.guid = MAKE_NEW_GUID(guidLow, 0, HIGHGUID_PLAYER);
// skip non-existed member // skip non-existed member
if(!objmgr.GetPlayerNameByGUID(member.guid, member.name)) if(!sObjectMgr.GetPlayerNameByGUID(member.guid, member.name))
return false; return false;
member.group = subgroup; member.group = subgroup;
@ -226,7 +226,7 @@ void Group::ConvertToRaid()
// update quest related GO states (quest activity dependent from raid membership) // update quest related GO states (quest activity dependent from raid membership)
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr) for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
if(Player* player = objmgr.GetPlayer(citr->guid)) if(Player* player = sObjectMgr.GetPlayer(citr->guid))
player->UpdateForQuestWorldObjects(); player->UpdateForQuestWorldObjects();
} }
@ -301,7 +301,7 @@ bool Group::AddMember(const uint64 &guid, const char* name)
return false; return false;
SendUpdate(); SendUpdate();
Player *player = objmgr.GetPlayer(guid); Player *player = sObjectMgr.GetPlayer(guid);
if(player) if(player)
{ {
if(!IsLeader(player->GetGUID()) && !isBGGroup()) if(!IsLeader(player->GetGUID()) && !isBGGroup())
@ -343,7 +343,7 @@ uint32 Group::RemoveMember(const uint64 &guid, const uint8 &method)
{ {
bool leaderChanged = _removeMember(guid); bool leaderChanged = _removeMember(guid);
if(Player *player = objmgr.GetPlayer( guid )) if(Player *player = sObjectMgr.GetPlayer( guid ))
{ {
// quest related GO state dependent from raid membership // quest related GO state dependent from raid membership
if(isRaidGroup()) if(isRaidGroup())
@ -409,7 +409,7 @@ void Group::Disband(bool hideDestroy)
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr) for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{ {
player = objmgr.GetPlayer(citr->guid); player = sObjectMgr.GetPlayer(citr->guid);
if(!player) if(!player)
continue; continue;
@ -490,7 +490,7 @@ void Group::SendLootStartRoll(uint32 CountDown, const Roll &r)
for (Roll::PlayerVote::const_iterator itr = r.playerVote.begin(); itr != r.playerVote.end(); ++itr) for (Roll::PlayerVote::const_iterator itr = r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
{ {
Player *p = objmgr.GetPlayer(itr->first); Player *p = sObjectMgr.GetPlayer(itr->first);
if(!p || !p->GetSession()) if(!p || !p->GetSession())
continue; continue;
@ -514,7 +514,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) for( Roll::PlayerVote::const_iterator itr = r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
{ {
Player *p = objmgr.GetPlayer(itr->first); Player *p = sObjectMgr.GetPlayer(itr->first);
if(!p || !p->GetSession()) if(!p || !p->GetSession())
continue; continue;
@ -537,7 +537,7 @@ void Group::SendLootRollWon(const uint64& SourceGuid, const uint64& TargetGuid,
for( Roll::PlayerVote::const_iterator itr = r.playerVote.begin(); itr != r.playerVote.end(); ++itr) for( Roll::PlayerVote::const_iterator itr = r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
{ {
Player *p = objmgr.GetPlayer(itr->first); Player *p = sObjectMgr.GetPlayer(itr->first);
if(!p || !p->GetSession()) if(!p || !p->GetSession())
continue; continue;
@ -557,7 +557,7 @@ void Group::SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r)
for( Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr!=r.playerVote.end(); ++itr) for( Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr!=r.playerVote.end(); ++itr)
{ {
Player *p = objmgr.GetPlayer(itr->first); Player *p = sObjectMgr.GetPlayer(itr->first);
if(!p || !p->GetSession()) if(!p || !p->GetSession())
continue; continue;
@ -571,7 +571,7 @@ void Group::GroupLoot(const uint64& playerGUID, Loot *loot, Creature *creature)
std::vector<LootItem>::iterator i; std::vector<LootItem>::iterator i;
ItemPrototype const *item; ItemPrototype const *item;
uint8 itemSlot = 0; uint8 itemSlot = 0;
Player *player = objmgr.GetPlayer(playerGUID); Player *player = sObjectMgr.GetPlayer(playerGUID);
Group *group = player->GetGroup(); Group *group = player->GetGroup();
for (i = loot->items.begin(); i != loot->items.end(); ++i, ++itemSlot) for (i = loot->items.begin(); i != loot->items.end(); ++i, ++itemSlot)
@ -586,7 +586,7 @@ void Group::GroupLoot(const uint64& playerGUID, Loot *loot, Creature *creature)
//roll for over-threshold item if it's one-player loot //roll for over-threshold item if it's one-player loot
if (item->Quality >= uint32(m_lootThreshold) && !i->freeforall) if (item->Quality >= uint32(m_lootThreshold) && !i->freeforall)
{ {
uint64 newitemGUID = MAKE_NEW_GUID(objmgr.GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM); uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM);
Roll* r = new Roll(newitemGUID, *i); Roll* r = new Roll(newitemGUID, *i);
//a vector is filled with only near party members //a vector is filled with only near party members
@ -624,7 +624,7 @@ void Group::GroupLoot(const uint64& playerGUID, Loot *loot, Creature *creature)
void Group::NeedBeforeGreed(const uint64& playerGUID, Loot *loot, Creature *creature) void Group::NeedBeforeGreed(const uint64& playerGUID, Loot *loot, Creature *creature)
{ {
ItemPrototype const *item; ItemPrototype const *item;
Player *player = objmgr.GetPlayer(playerGUID); Player *player = sObjectMgr.GetPlayer(playerGUID);
Group *group = player->GetGroup(); Group *group = player->GetGroup();
uint8 itemSlot = 0; uint8 itemSlot = 0;
@ -635,7 +635,7 @@ void Group::NeedBeforeGreed(const uint64& playerGUID, Loot *loot, Creature *crea
//only roll for one-player items, not for ones everyone can get //only roll for one-player items, not for ones everyone can get
if (item->Quality >= uint32(m_lootThreshold) && !i->freeforall) if (item->Quality >= uint32(m_lootThreshold) && !i->freeforall)
{ {
uint64 newitemGUID = MAKE_NEW_GUID(objmgr.GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM); uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM);
Roll* r = new Roll(newitemGUID, *i); Roll* r = new Roll(newitemGUID, *i);
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
@ -677,7 +677,7 @@ void Group::NeedBeforeGreed(const uint64& playerGUID, Loot *loot, Creature *crea
void Group::MasterLoot(const uint64& playerGUID, Loot* /*loot*/, Creature *creature) void Group::MasterLoot(const uint64& playerGUID, Loot* /*loot*/, Creature *creature)
{ {
Player *player = objmgr.GetPlayer(playerGUID); Player *player = sObjectMgr.GetPlayer(playerGUID);
if(!player) if(!player)
return; return;
@ -801,7 +801,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
} }
} }
SendLootRollWon(0, maxguid, maxresul, ROLL_NEED, *roll); SendLootRollWon(0, maxguid, maxresul, ROLL_NEED, *roll);
player = objmgr.GetPlayer(maxguid); player = sObjectMgr.GetPlayer(maxguid);
if(player && player->GetSession()) if(player && player->GetSession())
{ {
@ -848,7 +848,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
} }
} }
SendLootRollWon(0, maxguid, maxresul, ROLL_GREED, *roll); SendLootRollWon(0, maxguid, maxresul, ROLL_GREED, *roll);
player = objmgr.GetPlayer(maxguid); player = sObjectMgr.GetPlayer(maxguid);
if(player && player->GetSession()) if(player && player->GetSession())
{ {
@ -951,7 +951,7 @@ void Group::SendUpdate()
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr) for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{ {
player = objmgr.GetPlayer(citr->guid); player = sObjectMgr.GetPlayer(citr->guid);
if(!player || !player->GetSession() || player->GetGroup() != this ) if(!player || !player->GetSession() || player->GetGroup() != this )
continue; continue;
// guess size // guess size
@ -966,7 +966,7 @@ void Group::SendUpdate()
{ {
if(citr->guid == citr2->guid) if(citr->guid == citr2->guid)
continue; continue;
Player* member = objmgr.GetPlayer(citr2->guid); Player* member = sObjectMgr.GetPlayer(citr2->guid);
uint8 onlineState = (member) ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE; uint8 onlineState = (member) ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE;
onlineState = onlineState | ((isBGGroup()) ? MEMBER_STATUS_PVP : 0); onlineState = onlineState | ((isBGGroup()) ? MEMBER_STATUS_PVP : 0);
@ -1036,7 +1036,7 @@ void Group::OfflineReadyCheck()
{ {
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr) for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{ {
Player *pl = objmgr.GetPlayer(citr->guid); Player *pl = sObjectMgr.GetPlayer(citr->guid);
if (!pl || !pl->GetSession()) if (!pl || !pl->GetSession())
{ {
WorldPacket data(MSG_RAID_READY_CHECK_CONFIRM, 9); WorldPacket data(MSG_RAID_READY_CHECK_CONFIRM, 9);
@ -1078,7 +1078,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, bool isAssistant, u
if(!guid) if(!guid)
return false; return false;
Player *player = objmgr.GetPlayer(guid); Player *player = sObjectMgr.GetPlayer(guid);
MemberSlot member; MemberSlot member;
member.guid = guid; member.guid = guid;
@ -1124,7 +1124,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, bool isAssistant, u
bool Group::_removeMember(const uint64 &guid) bool Group::_removeMember(const uint64 &guid)
{ {
Player *player = objmgr.GetPlayer(guid); Player *player = sObjectMgr.GetPlayer(guid);
if (player) if (player)
{ {
//if we are removing player from battleground raid //if we are removing player from battleground raid
@ -1185,7 +1185,7 @@ void Group::_setLeader(const uint64 &guid)
")", GUID_LOPART(m_leaderGuid), GUID_LOPART(slot->guid) ")", GUID_LOPART(m_leaderGuid), GUID_LOPART(slot->guid)
); );
Player *player = objmgr.GetPlayer(slot->guid); Player *player = sObjectMgr.GetPlayer(slot->guid);
if(player) if(player)
{ {
for(uint8 i = 0; i < MAX_DIFFICULTY; ++i) for(uint8 i = 0; i < MAX_DIFFICULTY; ++i)
@ -1316,7 +1316,7 @@ void Group::ChangeMembersGroup(const uint64 &guid, const uint8 &group)
{ {
if(!isRaidGroup()) if(!isRaidGroup())
return; return;
Player *player = objmgr.GetPlayer(guid); Player *player = sObjectMgr.GetPlayer(guid);
if (!player) if (!player)
{ {
@ -1561,7 +1561,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo)
bool isEmpty = true; bool isEmpty = true;
// if the map is loaded, reset it // if the map is loaded, reset it
Map *map = mapmgr.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(map && map->IsDungeon() && !(method == INSTANCE_RESET_GROUP_DISBAND && !p->CanReset()))
isEmpty = ((InstanceMap*)map)->Reset(method); isEmpty = ((InstanceMap*)map)->Reset(method);
@ -1680,7 +1680,7 @@ void Group::_homebindIfInstance(Player *player)
{ {
// leaving the group in an instance, the homebind timer is started // leaving the group in an instance, the homebind timer is started
// unless the player is permanently saved to the instance // unless the player is permanently saved to the instance
InstanceSave *save = sInstanceSaveManager.GetInstanceSave(player->GetInstanceId()); InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(player->GetInstanceId());
InstancePlayerBind *playerBind = save ? player->GetBoundInstance(save->GetMapId(), save->GetDifficulty()) : NULL; InstancePlayerBind *playerBind = save ? player->GetBoundInstance(save->GetMapId(), save->GetDifficulty()) : NULL;
if(!playerBind || !playerBind->perm) if(!playerBind || !playerBind->perm)
player->m_InstanceValid = false; player->m_InstanceValid = false;

View file

@ -64,7 +64,7 @@ void WorldSession::HandleGroupInviteOpcode( WorldPacket & recv_data )
return; return;
} }
Player *player = objmgr.GetPlayer(membername.c_str()); Player *player = sObjectMgr.GetPlayer(membername.c_str());
// no player // no player
if(!player) if(!player)
@ -181,7 +181,7 @@ void WorldSession::HandleGroupAcceptOpcode( WorldPacket & /*recv_data*/ )
return; return;
} }
Player* leader = objmgr.GetPlayer(group->GetLeaderGUID()); Player* leader = sObjectMgr.GetPlayer(group->GetLeaderGUID());
// forming a new group, create it // forming a new group, create it
if(!group->IsCreated()) if(!group->IsCreated())
@ -189,7 +189,7 @@ void WorldSession::HandleGroupAcceptOpcode( WorldPacket & /*recv_data*/ )
if( leader ) if( leader )
group->RemoveInvite(leader); group->RemoveInvite(leader);
group->Create(group->GetLeaderGUID(), group->GetLeaderName()); group->Create(group->GetLeaderGUID(), group->GetLeaderName());
objmgr.AddGroup(group); sObjectMgr.AddGroup(group);
} }
// everything's fine, do it, PLAYER'S GROUP IS SET IN ADDMEMBER!!! // everything's fine, do it, PLAYER'S GROUP IS SET IN ADDMEMBER!!!
@ -204,7 +204,7 @@ void WorldSession::HandleGroupDeclineOpcode( WorldPacket & /*recv_data*/ )
if (!group) return; if (!group) return;
// remember leader if online // remember leader if online
Player *leader = objmgr.GetPlayer(group->GetLeaderGUID()); Player *leader = sObjectMgr.GetPlayer(group->GetLeaderGUID());
// uninvite, group can be deleted // uninvite, group can be deleted
GetPlayer()->UninviteFromGroup(); GetPlayer()->UninviteFromGroup();
@ -307,7 +307,7 @@ void WorldSession::HandleGroupSetLeaderOpcode( WorldPacket & recv_data )
uint64 guid; uint64 guid;
recv_data >> guid; recv_data >> guid;
Player *player = objmgr.GetPlayer(guid); Player *player = sObjectMgr.GetPlayer(guid);
/** error handling **/ /** error handling **/
if (!player || !group->IsLeader(GetPlayer()->GetGUID()) || player->GetGroup() != group) if (!player || !group->IsLeader(GetPlayer()->GetGUID()) || player->GetGroup() != group)
@ -511,7 +511,7 @@ void WorldSession::HandleGroupChangeSubGroupOpcode( WorldPacket & recv_data )
/********************/ /********************/
// everything's fine, do it // everything's fine, do it
group->ChangeMembersGroup(objmgr.GetPlayer(name.c_str()), groupNr); group->ChangeMembersGroup(sObjectMgr.GetPlayer(name.c_str()), groupNr);
} }
void WorldSession::HandleGroupAssistantLeaderOpcode( WorldPacket & recv_data ) void WorldSession::HandleGroupAssistantLeaderOpcode( WorldPacket & recv_data )
@ -774,7 +774,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode( WorldPacket &recv_data )
uint64 Guid; uint64 Guid;
recv_data >> Guid; recv_data >> Guid;
Player *player = objmgr.GetPlayer(Guid); Player *player = sObjectMgr.GetPlayer(Guid);
if(!player) if(!player)
{ {
WorldPacket data(SMSG_PARTY_MEMBER_STATS_FULL, 3+4+2); WorldPacket data(SMSG_PARTY_MEMBER_STATS_FULL, 3+4+2);

View file

@ -64,7 +64,7 @@ Guild::~Guild()
bool Guild::Create(Player* leader, std::string gname) bool Guild::Create(Player* leader, std::string gname)
{ {
if (objmgr.GetGuildByName(gname)) if (sObjectMgr.GetGuildByName(gname))
return false; return false;
WorldSession* lSession = leader->GetSession(); WorldSession* lSession = leader->GetSession();
@ -77,7 +77,7 @@ bool Guild::Create(Player* leader, std::string gname)
MOTD = "No message set."; MOTD = "No message set.";
m_GuildBankMoney = 0; m_GuildBankMoney = 0;
m_PurchasedTabs = 0; m_PurchasedTabs = 0;
m_Id = objmgr.GenerateGuildId(); m_Id = sObjectMgr.GenerateGuildId();
sLog.outDebug("GUILD: creating guild %s to leader: %u", gname.c_str(), GUID_LOPART(m_LeaderGuid)); sLog.outDebug("GUILD: creating guild %s to leader: %u", gname.c_str(), GUID_LOPART(m_LeaderGuid));
@ -107,18 +107,18 @@ void Guild::CreateDefaultGuildRanks(int locale_idx)
CharacterDatabase.PExecute("DELETE FROM guild_rank WHERE guildid='%u'", m_Id); CharacterDatabase.PExecute("DELETE FROM guild_rank WHERE guildid='%u'", m_Id);
CharacterDatabase.PExecute("DELETE FROM guild_bank_right WHERE guildid = '%u'", m_Id); CharacterDatabase.PExecute("DELETE FROM guild_bank_right WHERE guildid = '%u'", m_Id);
CreateRank(objmgr.GetMangosString(LANG_GUILD_MASTER, locale_idx), GR_RIGHT_ALL); CreateRank(sObjectMgr.GetMangosString(LANG_GUILD_MASTER, locale_idx), GR_RIGHT_ALL);
CreateRank(objmgr.GetMangosString(LANG_GUILD_OFFICER, locale_idx), GR_RIGHT_ALL); CreateRank(sObjectMgr.GetMangosString(LANG_GUILD_OFFICER, locale_idx), GR_RIGHT_ALL);
CreateRank(objmgr.GetMangosString(LANG_GUILD_VETERAN, locale_idx), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK); CreateRank(sObjectMgr.GetMangosString(LANG_GUILD_VETERAN, locale_idx), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
CreateRank(objmgr.GetMangosString(LANG_GUILD_MEMBER, locale_idx), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK); CreateRank(sObjectMgr.GetMangosString(LANG_GUILD_MEMBER, locale_idx), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
CreateRank(objmgr.GetMangosString(LANG_GUILD_INITIATE, locale_idx), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK); CreateRank(sObjectMgr.GetMangosString(LANG_GUILD_INITIATE, locale_idx), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
SetBankMoneyPerDay((uint32)GR_GUILDMASTER, WITHDRAW_MONEY_UNLIMITED); SetBankMoneyPerDay((uint32)GR_GUILDMASTER, WITHDRAW_MONEY_UNLIMITED);
} }
bool Guild::AddMember(uint64 plGuid, uint32 plRank) bool Guild::AddMember(uint64 plGuid, uint32 plRank)
{ {
Player* pl = objmgr.GetPlayer(plGuid); Player* pl = sObjectMgr.GetPlayer(plGuid);
if (pl) if (pl)
{ {
if (pl->GetGuildId() != 0) if (pl->GetGuildId() != 0)
@ -482,7 +482,7 @@ void Guild::DelMember(uint64 guid, bool isDisbanding)
SetLeader(newLeaderGUID); SetLeader(newLeaderGUID);
// If player not online data in data field will be loaded from guild tabs no need to update it !! // If player not online data in data field will be loaded from guild tabs no need to update it !!
if (Player *newLeader = objmgr.GetPlayer(newLeaderGUID)) if (Player *newLeader = sObjectMgr.GetPlayer(newLeaderGUID))
newLeader->SetRank(GR_GUILDMASTER); newLeader->SetRank(GR_GUILDMASTER);
// when leader non-exist (at guild load with deleted leader only) not send broadcasts // when leader non-exist (at guild load with deleted leader only) not send broadcasts
@ -507,7 +507,7 @@ void Guild::DelMember(uint64 guid, bool isDisbanding)
members.erase(GUID_LOPART(guid)); members.erase(GUID_LOPART(guid));
Player *player = objmgr.GetPlayer(guid); Player *player = sObjectMgr.GetPlayer(guid);
// If player not online data in data field will be loaded from guild tabs no need to update it !! // If player not online data in data field will be loaded from guild tabs no need to update it !!
if (player) if (player)
{ {
@ -524,7 +524,7 @@ void Guild::ChangeRank(uint64 guid, uint32 newRank)
if (itr != members.end()) if (itr != members.end())
itr->second.RankId = newRank; itr->second.RankId = newRank;
Player *player = objmgr.GetPlayer(guid); Player *player = sObjectMgr.GetPlayer(guid);
// If player not online data in data field will be loaded from guild tabs no need to update it !! // If player not online data in data field will be loaded from guild tabs no need to update it !!
if (player) if (player)
player->SetRank(newRank); player->SetRank(newRank);
@ -723,7 +723,7 @@ void Guild::Disband()
CharacterDatabase.PExecute("DELETE FROM guild_bank_eventlog WHERE guildid = '%u'", m_Id); CharacterDatabase.PExecute("DELETE FROM guild_bank_eventlog WHERE guildid = '%u'", m_Id);
CharacterDatabase.PExecute("DELETE FROM guild_eventlog WHERE guildid = '%u'", m_Id); CharacterDatabase.PExecute("DELETE FROM guild_eventlog WHERE guildid = '%u'", m_Id);
CharacterDatabase.CommitTransaction(); CharacterDatabase.CommitTransaction();
objmgr.RemoveGuild(m_Id); sObjectMgr.RemoveGuild(m_Id);
} }
void Guild::Roster(WorldSession *session /*= NULL*/) void Guild::Roster(WorldSession *session /*= NULL*/)

View file

@ -34,7 +34,7 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket)
uint32 guildId; uint32 guildId;
recvPacket >> guildId; recvPacket >> guildId;
if(Guild *guild = objmgr.GetGuildById(guildId)) if(Guild *guild = sObjectMgr.GetGuildById(guildId))
{ {
guild->Query(this); guild->Query(this);
return; return;
@ -60,7 +60,7 @@ void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket)
return; return;
} }
objmgr.AddGuild(guild); sObjectMgr.AddGuild(guild);
} }
void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
@ -81,7 +81,7 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
return; return;
} }
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()); Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild) if(!guild)
{ {
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD); SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -143,7 +143,7 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket)
if(!normalizePlayerName(plName)) if(!normalizePlayerName(plName))
return; return;
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()); Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild) if(!guild)
{ {
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD); SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -196,12 +196,12 @@ void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/)
sLog.outDebug("WORLD: Received CMSG_GUILD_ACCEPT"); sLog.outDebug("WORLD: Received CMSG_GUILD_ACCEPT");
guild = objmgr.GetGuildById(player->GetGuildIdInvited()); guild = sObjectMgr.GetGuildById(player->GetGuildIdInvited());
if(!guild || player->GetGuildId()) if(!guild || player->GetGuildId())
return; return;
// not let enemies sign guild charter // not let enemies sign guild charter
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != objmgr.GetPlayerTeamByGUID(guild->GetLeader())) if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(guild->GetLeader()))
return; return;
if(!guild->AddMember(GetPlayer()->GetGUID(),guild->GetLowestRank())) if(!guild->AddMember(GetPlayer()->GetGUID(),guild->GetLowestRank()))
@ -230,7 +230,7 @@ void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/)
{ {
sLog.outDebug("WORLD: Received CMSG_GUILD_INFO"); sLog.outDebug("WORLD: Received CMSG_GUILD_INFO");
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()); Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild) if(!guild)
{ {
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD); SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -252,7 +252,7 @@ void WorldSession::HandleGuildRosterOpcode(WorldPacket& /*recvPacket*/)
{ {
sLog.outDebug("WORLD: Received CMSG_GUILD_ROSTER"); sLog.outDebug("WORLD: Received CMSG_GUILD_ROSTER");
if(Guild* guild = objmgr.GetGuildById(_player->GetGuildId())) if(Guild* guild = sObjectMgr.GetGuildById(_player->GetGuildId()))
guild->Roster(this); guild->Roster(this);
} }
@ -266,7 +266,7 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
if(!normalizePlayerName(plName)) if(!normalizePlayerName(plName))
return; return;
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()); Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild) if(!guild)
{ {
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD); SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -327,7 +327,7 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
if(!normalizePlayerName(plName)) if(!normalizePlayerName(plName))
return; return;
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()); Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild) if(!guild)
{ {
@ -389,7 +389,7 @@ void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/)
{ {
sLog.outDebug("WORLD: Received CMSG_GUILD_LEAVE"); sLog.outDebug("WORLD: Received CMSG_GUILD_LEAVE");
Guild *guild = objmgr.GetGuildById(_player->GetGuildId()); Guild *guild = sObjectMgr.GetGuildById(_player->GetGuildId());
if(!guild) if(!guild)
{ {
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD); SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -427,7 +427,7 @@ void WorldSession::HandleGuildDisbandOpcode(WorldPacket& /*recvPacket*/)
{ {
sLog.outDebug("WORLD: Received CMSG_GUILD_DISBAND"); sLog.outDebug("WORLD: Received CMSG_GUILD_DISBAND");
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()); Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild) if(!guild)
{ {
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD); SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -457,7 +457,7 @@ void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket)
if(!normalizePlayerName(name)) if(!normalizePlayerName(name))
return; return;
Guild *guild = objmgr.GetGuildById(oldLeader->GetGuildId()); Guild *guild = sObjectMgr.GetGuildById(oldLeader->GetGuildId());
if (!guild) if (!guild)
{ {
@ -504,7 +504,7 @@ void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket)
else else
MOTD = ""; MOTD = "";
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()); Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild) if(!guild)
{ {
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD); SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -537,7 +537,7 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket)
if(!normalizePlayerName(name)) if(!normalizePlayerName(name))
return; return;
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()); Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if (!guild) if (!guild)
{ {
@ -576,7 +576,7 @@ void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket)
if (!normalizePlayerName(plName)) if (!normalizePlayerName(plName))
return; return;
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()); Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if (!guild) if (!guild)
{ {
@ -612,7 +612,7 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
sLog.outDebug("WORLD: Received CMSG_GUILD_RANK"); sLog.outDebug("WORLD: Received CMSG_GUILD_RANK");
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()); Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild) if(!guild)
{ {
recvPacket.rpos(recvPacket.wpos()); // set to end to avoid warnings spam recvPacket.rpos(recvPacket.wpos()); // set to end to avoid warnings spam
@ -662,7 +662,7 @@ void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket)
std::string rankname; std::string rankname;
recvPacket >> rankname; recvPacket >> rankname;
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()); Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild) if(!guild)
{ {
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD); SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -688,7 +688,7 @@ void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/)
{ {
sLog.outDebug("WORLD: Received CMSG_GUILD_DEL_RANK"); sLog.outDebug("WORLD: Received CMSG_GUILD_DEL_RANK");
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()); Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild) if(!guild)
{ {
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD); SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -724,7 +724,7 @@ void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket)
std::string GINFO; std::string GINFO;
recvPacket >> GINFO; recvPacket >> GINFO;
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()); Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild) if(!guild)
{ {
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD); SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -763,7 +763,7 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket)
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED)) if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH); GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()); Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild) if(!guild)
{ {
//"You are not part of a guild!"; //"You are not part of a guild!";
@ -800,7 +800,7 @@ void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */)
sLog.outDebug("WORLD: Received (MSG_GUILD_EVENT_LOG_QUERY)"); sLog.outDebug("WORLD: Received (MSG_GUILD_EVENT_LOG_QUERY)");
if(uint32 GuildId = GetPlayer()->GetGuildId()) if(uint32 GuildId = GetPlayer()->GetGuildId())
if(Guild *pGuild = objmgr.GetGuildById(GuildId)) if(Guild *pGuild = sObjectMgr.GetGuildById(GuildId))
pGuild->DisplayGuildEventLog(this); pGuild->DisplayGuildEventLog(this);
} }
@ -811,7 +811,7 @@ void WorldSession::HandleGuildBankMoneyWithdrawn( WorldPacket & /* recv_data */
sLog.outDebug("WORLD: Received (MSG_GUILD_BANK_MONEY_WITHDRAWN)"); sLog.outDebug("WORLD: Received (MSG_GUILD_BANK_MONEY_WITHDRAWN)");
if(uint32 GuildId = GetPlayer()->GetGuildId()) if(uint32 GuildId = GetPlayer()->GetGuildId())
if(Guild *pGuild = objmgr.GetGuildById(GuildId)) if(Guild *pGuild = sObjectMgr.GetGuildById(GuildId))
pGuild->SendMoneyInfo(this, GetPlayer()->GetGUIDLow()); pGuild->SendMoneyInfo(this, GetPlayer()->GetGUIDLow());
} }
@ -821,7 +821,7 @@ void WorldSession::HandleGuildPermissions( WorldPacket& /* recv_data */ )
if(uint32 GuildId = GetPlayer()->GetGuildId()) if(uint32 GuildId = GetPlayer()->GetGuildId())
{ {
if(Guild *pGuild = objmgr.GetGuildById(GuildId)) if(Guild *pGuild = sObjectMgr.GetGuildById(GuildId))
{ {
uint32 rankId = GetPlayer()->GetRank(); uint32 rankId = GetPlayer()->GetRank();
@ -857,7 +857,7 @@ void WorldSession::HandleGuildBankerActivate( WorldPacket & recv_data )
if (uint32 GuildId = GetPlayer()->GetGuildId()) if (uint32 GuildId = GetPlayer()->GetGuildId())
{ {
if(Guild *pGuild = objmgr.GetGuildById(GuildId)) if(Guild *pGuild = sObjectMgr.GetGuildById(GuildId))
{ {
pGuild->DisplayGuildBankTabsInfo(this); // this also will load guild bank if not yet pGuild->DisplayGuildBankTabsInfo(this); // this also will load guild bank if not yet
return; return;
@ -883,7 +883,7 @@ void WorldSession::HandleGuildBankQueryTab( WorldPacket & recv_data )
if (!GuildId) if (!GuildId)
return; return;
Guild *pGuild = objmgr.GetGuildById(GuildId); Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if (!pGuild) if (!pGuild)
return; return;
@ -917,7 +917,7 @@ void WorldSession::HandleGuildBankDepositMoney( WorldPacket & recv_data )
if (!GuildId) if (!GuildId)
return; return;
Guild *pGuild = objmgr.GetGuildById(GuildId); Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if (!pGuild) if (!pGuild)
return; return;
@ -965,7 +965,7 @@ void WorldSession::HandleGuildBankWithdrawMoney( WorldPacket & recv_data )
if (GuildId == 0) if (GuildId == 0)
return; return;
Guild *pGuild = objmgr.GetGuildById(GuildId); Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if(!pGuild) if(!pGuild)
return; return;
@ -1025,7 +1025,7 @@ void WorldSession::HandleGuildBankSwapItems( WorldPacket & recv_data )
return; return;
} }
Guild *pGuild = objmgr.GetGuildById(GuildId); Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if (!pGuild || !pGuild->IsGuildBankLoaded()) if (!pGuild || !pGuild->IsGuildBankLoaded())
{ {
recv_data.rpos(recv_data.wpos()); // prevent additional spam at rejected packet recv_data.rpos(recv_data.wpos()); // prevent additional spam at rejected packet
@ -1123,7 +1123,7 @@ void WorldSession::HandleGuildBankBuyTab( WorldPacket & recv_data )
if (!GuildId) if (!GuildId)
return; return;
Guild *pGuild = objmgr.GetGuildById(GuildId); Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if(!pGuild) if(!pGuild)
return; return;
@ -1173,7 +1173,7 @@ void WorldSession::HandleGuildBankUpdateTab( WorldPacket & recv_data )
if (!GuildId) if (!GuildId)
return; return;
Guild *pGuild = objmgr.GetGuildById(GuildId); Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if (!pGuild) if (!pGuild)
return; return;
@ -1196,7 +1196,7 @@ void WorldSession::HandleGuildBankLogQuery( WorldPacket & recv_data )
if (!GuildId) if (!GuildId)
return; return;
Guild *pGuild = objmgr.GetGuildById(GuildId); Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if (!pGuild) if (!pGuild)
return; return;
@ -1221,7 +1221,7 @@ void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recv_data)
if (!GuildId) if (!GuildId)
return; return;
Guild *pGuild = objmgr.GetGuildById(GuildId); Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if (!pGuild) if (!pGuild)
return; return;
@ -1244,7 +1244,7 @@ void WorldSession::HandleSetGuildBankTabText(WorldPacket &recv_data)
if (!GuildId) if (!GuildId)
return; return;
Guild *pGuild = objmgr.GetGuildById(GuildId); Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if (!pGuild) if (!pGuild)
return; return;

View file

@ -68,7 +68,7 @@ HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff
// restore orientation of not moving creature at returning to home // restore orientation of not moving creature at returning to home
if(owner.GetDefaultMovementType()==IDLE_MOTION_TYPE) if(owner.GetDefaultMovementType()==IDLE_MOTION_TYPE)
{ {
if(CreatureData const* data = objmgr.GetCreatureData(owner.GetDBTableGUIDLow())) if(CreatureData const* data = sObjectMgr.GetCreatureData(owner.GetDBTableGUIDLow()))
{ {
owner.SetOrientation(data->orientation); owner.SetOrientation(data->orientation);
WorldPacket packet; WorldPacket packet;

View file

@ -168,7 +168,7 @@ void InstanceSave::SaveToDB()
// save instance data too // save instance data too
std::string data; std::string data;
Map *map = mapmgr.FindMap(GetMapId(),m_instanceid); Map *map = sMapMgr.FindMap(GetMapId(),m_instanceid);
if(map) if(map)
{ {
assert(map->IsDungeon()); assert(map->IsDungeon());
@ -214,8 +214,8 @@ bool InstanceSave::UnloadIfEmpty()
{ {
if(m_playerList.empty() && m_groupList.empty()) if(m_playerList.empty() && m_groupList.empty())
{ {
if(!sInstanceSaveManager.lock_instLists) if(!sInstanceSaveMgr.lock_instLists)
sInstanceSaveManager.RemoveInstanceSave(GetInstanceId()); sInstanceSaveMgr.RemoveInstanceSave(GetInstanceId());
return false; return false;
} }
else else
@ -258,7 +258,7 @@ void InstanceSaveManager::CleanupInstances()
bar.step(); bar.step();
// load reset times and clean expired instances // load reset times and clean expired instances
sInstanceSaveManager.LoadResetTimes(); sInstanceSaveMgr.LoadResetTimes();
// clean character/group - instance binds with invalid group/characters // clean character/group - instance binds with invalid group/characters
_DelHelper(CharacterDatabase, "character_instance.guid, instance", "character_instance", "LEFT JOIN characters ON character_instance.guid = characters.guid WHERE characters.guid IS NULL"); _DelHelper(CharacterDatabase, "character_instance.guid, instance", "character_instance", "LEFT JOIN characters ON character_instance.guid = characters.guid WHERE characters.guid IS NULL");
@ -567,7 +567,7 @@ void InstanceSaveManager::_ResetSave(InstanceSaveHashMap::iterator &itr)
void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId) void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId)
{ {
sLog.outDebug("InstanceSaveMgr::_ResetInstance %u, %u", mapid, instanceId); sLog.outDebug("InstanceSaveMgr::_ResetInstance %u, %u", mapid, instanceId);
Map *map = (MapInstanced*)mapmgr.CreateBaseMap(mapid); Map *map = (MapInstanced*)sMapMgr.CreateBaseMap(mapid);
if(!map->Instanceable()) if(!map->Instanceable())
return; return;
@ -577,14 +577,14 @@ void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId)
Map* iMap = ((MapInstanced*)map)->FindMap(instanceId); Map* iMap = ((MapInstanced*)map)->FindMap(instanceId);
if(iMap && iMap->IsDungeon()) ((InstanceMap*)iMap)->Reset(INSTANCE_RESET_RESPAWN_DELAY); if(iMap && iMap->IsDungeon()) ((InstanceMap*)iMap)->Reset(INSTANCE_RESET_RESPAWN_DELAY);
else objmgr.DeleteRespawnTimeForInstance(instanceId); // even if map is not loaded else sObjectMgr.DeleteRespawnTimeForInstance(instanceId); // even if map is not loaded
} }
void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, bool warn, uint32 timeLeft) void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, bool warn, uint32 timeLeft)
{ {
// global reset for all instances of the given map // global reset for all instances of the given map
// note: this isn't fast but it's meant to be executed very rarely // note: this isn't fast but it's meant to be executed very rarely
Map const *map = mapmgr.CreateBaseMap(mapid); Map const *map = sMapMgr.CreateBaseMap(mapid);
if(!map->Instanceable()) if(!map->Instanceable())
return; return;
uint64 now = (uint64)time(NULL); uint64 now = (uint64)time(NULL);

View file

@ -169,5 +169,5 @@ class MANGOS_DLL_DECL InstanceSaveManager : public MaNGOS::Singleton<InstanceSav
ResetTimeQueue m_resetTimeQueue; ResetTimeQueue m_resetTimeQueue;
}; };
#define sInstanceSaveManager MaNGOS::Singleton<InstanceSaveManager>::Instance() #define sInstanceSaveMgr MaNGOS::Singleton<InstanceSaveManager>::Instance()
#endif #endif

View file

@ -446,7 +446,7 @@ ItemPrototype const *Item::GetProto() const
Player* Item::GetOwner()const Player* Item::GetOwner()const
{ {
return objmgr.GetPlayer(GetOwnerGUID()); return sObjectMgr.GetPlayer(GetOwnerGUID());
} }
uint32 Item::GetSkill() uint32 Item::GetSkill()
@ -774,7 +774,7 @@ bool Item::IsFitToSpellRequirements(SpellEntry const* spellInfo) const
bool Item::IsTargetValidForItemUse(Unit* pUnitTarget) bool Item::IsTargetValidForItemUse(Unit* pUnitTarget)
{ {
ItemRequiredTargetMapBounds bounds = objmgr.GetItemRequiredTargetMapBounds(GetProto()->ItemId); ItemRequiredTargetMapBounds bounds = sObjectMgr.GetItemRequiredTargetMapBounds(GetProto()->ItemId);
if (bounds.first == bounds.second) if (bounds.first == bounds.second)
return true; return true;
@ -945,7 +945,7 @@ Item* Item::CreateItem( uint32 item, uint32 count, Player const* player )
assert(count !=0 && "pProto->Stackable==0 but checked at loading already"); assert(count !=0 && "pProto->Stackable==0 but checked at loading already");
Item *pItem = NewItemOrBag( pProto ); Item *pItem = NewItemOrBag( pProto );
if( pItem->Create(objmgr.GenerateLowGuid(HIGHGUID_ITEM), item, player) ) if( pItem->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM), item, player) )
{ {
pItem->SetCount( count ); pItem->SetCount( count );
return pItem; return pItem;
@ -985,14 +985,14 @@ bool Item::IsBindedNotWith( Player const* player ) const
return true; return true;
// online // online
if(Player* owner = objmgr.GetPlayer(GetOwnerGUID())) if(Player* owner = sObjectMgr.GetPlayer(GetOwnerGUID()))
{ {
return owner->GetSession()->GetAccountId() != player->GetSession()->GetAccountId(); return owner->GetSession()->GetAccountId() != player->GetSession()->GetAccountId();
} }
// offline slow case // offline slow case
else else
{ {
return objmgr.GetPlayerAccountIdByGUID(GetOwnerGUID()) != player->GetSession()->GetAccountId(); return sObjectMgr.GetPlayerAccountIdByGUID(GetOwnerGUID()) != player->GetSession()->GetAccountId();
} }
} }

View file

@ -294,7 +294,7 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data )
int loc_idx = GetSessionDbLocaleIndex(); int loc_idx = GetSessionDbLocaleIndex();
if ( loc_idx >= 0 ) if ( loc_idx >= 0 )
{ {
ItemLocale const *il = objmgr.GetItemLocale(pProto->ItemId); ItemLocale const *il = sObjectMgr.GetItemLocale(pProto->ItemId);
if (il) if (il)
{ {
if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty()) if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty())
@ -980,7 +980,7 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data)
int loc_idx = GetSessionDbLocaleIndex(); int loc_idx = GetSessionDbLocaleIndex();
if (loc_idx >= 0) if (loc_idx >= 0)
{ {
ItemLocale const *il = objmgr.GetItemLocale(pProto->ItemId); ItemLocale const *il = sObjectMgr.GetItemLocale(pProto->ItemId);
if (il) if (il)
{ {
if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty()) if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty())

View file

@ -31,7 +31,7 @@ static void AttemptJoin(Player* _player)
return; return;
//TODO: Guard Player Map //TODO: Guard Player Map
HashMapHolder<Player>::MapType const& players = objaccessor.GetPlayers(); HashMapHolder<Player>::MapType const& players = sObjectAccessor.GetPlayers();
for(HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter) for(HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter)
{ {
Player *plr = iter->second; Player *plr = iter->second;
@ -62,7 +62,7 @@ static void AttemptJoin(Player* _player)
continue; continue;
} }
objmgr.AddGroup(group); sObjectMgr.AddGroup(group);
} }
// stop at success join // stop at success join
@ -91,7 +91,7 @@ static void AttemptAddMore(Player* _player)
return; return;
//TODO: Guard Player map //TODO: Guard Player map
HashMapHolder<Player>::MapType const& players = objaccessor.GetPlayers(); HashMapHolder<Player>::MapType const& players = sObjectAccessor.GetPlayers();
for(HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter) for(HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter)
{ {
Player *plr = iter->second; Player *plr = iter->second;
@ -120,7 +120,7 @@ static void AttemptAddMore(Player* _player)
return; // can't create group (??) return; // can't create group (??)
} }
objmgr.AddGroup(group); sObjectMgr.AddGroup(group);
} }
// stop at join fail (full) // stop at join fail (full)
@ -302,7 +302,7 @@ void WorldSession::SendLfgResult(uint32 type, uint32 entry, uint8 lfg_type)
data << uint32(0); // unk data << uint32(0); // unk
//TODO: Guard Player map //TODO: Guard Player map
HashMapHolder<Player>::MapType const& players = objaccessor.GetPlayers(); HashMapHolder<Player>::MapType const& players = sObjectAccessor.GetPlayers();
for(HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter) for(HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter)
{ {
Player *plr = iter->second; Player *plr = iter->second;

View file

@ -113,7 +113,7 @@ bool ChatHandler::HandleNpcWhisperCommand(const char* args)
uint64 receiver_guid= atol(receiver_str); uint64 receiver_guid= atol(receiver_str);
// check online security // check online security
if (HasLowerSecurity(objmgr.GetPlayer(receiver_guid), 0)) if (HasLowerSecurity(sObjectMgr.GetPlayer(receiver_guid), 0))
return false; return false;
pCreature->MonsterWhisper(text,receiver_guid); pCreature->MonsterWhisper(text,receiver_guid);
@ -545,7 +545,7 @@ bool ChatHandler::HandleGonameCommand(const char* args)
InstanceGroupBind *gBind = group ? group->GetBoundInstance(target) : NULL; InstanceGroupBind *gBind = group ? group->GetBoundInstance(target) : NULL;
// if no bind exists, create a solo bind // if no bind exists, create a solo bind
if (!gBind) if (!gBind)
if (InstanceSave *save = sInstanceSaveManager.GetInstanceSave(target->GetInstanceId())) if (InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(target->GetInstanceId()))
_player->BindToInstance(save, !save->CanReset()); _player->BindToInstance(save, !save->CanReset());
} }
@ -1911,7 +1911,7 @@ bool ChatHandler::HandleLookupTeleCommand(const char * args)
std::ostringstream reply; std::ostringstream reply;
GameTeleMap const & teleMap = objmgr.GetGameTeleMap(); GameTeleMap const & teleMap = sObjectMgr.GetGameTeleMap();
for(GameTeleMap::const_iterator itr = teleMap.begin(); itr != teleMap.end(); ++itr) for(GameTeleMap::const_iterator itr = teleMap.begin(); itr != teleMap.end(); ++itr)
{ {
GameTele const* tele = &itr->second; GameTele const* tele = &itr->second;
@ -1967,7 +1967,7 @@ bool ChatHandler::HandleWhispersCommand(const char* args)
//Save all players in the world //Save all players in the world
bool ChatHandler::HandleSaveAllCommand(const char* /*args*/) bool ChatHandler::HandleSaveAllCommand(const char* /*args*/)
{ {
objaccessor.SaveAllPlayers(); sObjectAccessor.SaveAllPlayers();
SendSysMessage(LANG_PLAYERS_SAVED); SendSysMessage(LANG_PLAYERS_SAVED);
return true; return true;
} }
@ -2005,7 +2005,7 @@ bool ChatHandler::HandleSendMailCommand(const char* args)
// from console show not existed sender // from console show not existed sender
MailSender sender(MAIL_NORMAL,m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); MailSender sender(MAIL_NORMAL,m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
uint32 itemTextId = !text.empty() ? objmgr.CreateItemText( text ) : 0; uint32 itemTextId = !text.empty() ? sObjectMgr.CreateItemText( text ) : 0;
MailDraft(subject, itemTextId) MailDraft(subject, itemTextId)
.SendMailTo(MailReceiver(target,GUID_LOPART(target_guid)),sender); .SendMailTo(MailReceiver(target,GUID_LOPART(target_guid)),sender);
@ -2080,7 +2080,7 @@ bool ChatHandler::HandleTeleNameCommand(const char * args)
PSendSysMessage(LANG_TELEPORTING_TO, nameLink.c_str(), GetMangosString(LANG_OFFLINE), tele->name.c_str()); PSendSysMessage(LANG_TELEPORTING_TO, nameLink.c_str(), GetMangosString(LANG_OFFLINE), tele->name.c_str());
Player::SavePositionInDB(tele->mapId,tele->position_x,tele->position_y,tele->position_z,tele->orientation, Player::SavePositionInDB(tele->mapId,tele->position_x,tele->position_y,tele->position_z,tele->orientation,
mapmgr.GetZoneId(tele->mapId,tele->position_x,tele->position_y,tele->position_z),target_guid); sMapMgr.GetZoneId(tele->mapId,tele->position_x,tele->position_y,tele->position_z),target_guid);
} }
return true; return true;
@ -2338,7 +2338,7 @@ bool ChatHandler::HandleGoXYCommand(const char* args)
else else
_player->SaveRecallPosition(); _player->SaveRecallPosition();
Map const *map = mapmgr.CreateBaseMap(mapid); Map const *map = sMapMgr.CreateBaseMap(mapid);
float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y)); float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y));
_player->TeleportTo(mapid, x, y, z, _player->GetOrientation()); _player->TeleportTo(mapid, x, y, z, _player->GetOrientation());
@ -2431,7 +2431,7 @@ bool ChatHandler::HandleGoZoneXYCommand(const char* args)
// update to parent zone if exist (client map show only zones without parents) // update to parent zone if exist (client map show only zones without parents)
AreaTableEntry const* zoneEntry = areaEntry->zone ? GetAreaEntryByAreaID(areaEntry->zone) : areaEntry; AreaTableEntry const* zoneEntry = areaEntry->zone ? GetAreaEntryByAreaID(areaEntry->zone) : areaEntry;
Map const *map = mapmgr.CreateBaseMap(zoneEntry->mapid); Map const *map = sMapMgr.CreateBaseMap(zoneEntry->mapid);
if(map->Instanceable()) if(map->Instanceable())
{ {
@ -2506,7 +2506,7 @@ bool ChatHandler::HandleGoGridCommand(const char* args)
else else
_player->SaveRecallPosition(); _player->SaveRecallPosition();
Map const *map = mapmgr.CreateBaseMap(mapid); Map const *map = sMapMgr.CreateBaseMap(mapid);
float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y)); float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y));
_player->TeleportTo(mapid, x, y, z, _player->GetOrientation()); _player->TeleportTo(mapid, x, y, z, _player->GetOrientation());

View file

@ -64,7 +64,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
if(!extractPlayerTarget(nameStr,&target,&target_guid,&target_name)) if(!extractPlayerTarget(nameStr,&target,&target_guid,&target_name))
return false; return false;
uint32 account_id = target ? target->GetSession()->GetAccountId() : objmgr.GetPlayerAccountIdByGUID(target_guid); uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr.GetPlayerAccountIdByGUID(target_guid);
// find only player from same account if any // find only player from same account if any
if(!target) if(!target)
@ -104,7 +104,7 @@ bool ChatHandler::HandleUnmuteCommand(const char* args)
if(!extractPlayerTarget((char*)args,&target,&target_guid,&target_name)) if(!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
return false; return false;
uint32 account_id = target ? target->GetSession()->GetAccountId() : objmgr.GetPlayerAccountIdByGUID(target_guid); uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr.GetPlayerAccountIdByGUID(target_guid);
// find only player from same account if any // find only player from same account if any
if(!target) if(!target)
@ -358,7 +358,7 @@ bool ChatHandler::HandleGoObjectCommand(const char* args)
int mapid; int mapid;
// by DB guid // by DB guid
if (GameObjectData const* go_data = objmgr.GetGOData(guid)) if (GameObjectData const* go_data = sObjectMgr.GetGOData(guid))
{ {
x = go_data->posX; x = go_data->posX;
y = go_data->posY; y = go_data->posY;
@ -470,8 +470,8 @@ bool ChatHandler::HandleGameObjectTargetCommand(const char* args)
z = fields[4].GetFloat(); z = fields[4].GetFloat();
o = fields[5].GetFloat(); o = fields[5].GetFloat();
mapid = fields[6].GetUInt16(); mapid = fields[6].GetUInt16();
pool_id = poolhandler.IsPartOfAPool(lowguid, TYPEID_GAMEOBJECT); pool_id = sPoolMgr.IsPartOfAPool(lowguid, TYPEID_GAMEOBJECT);
if (!pool_id || (pool_id && poolhandler.IsSpawnedObject(pool_id, lowguid, TYPEID_GAMEOBJECT))) if (!pool_id || (pool_id && sPoolMgr.IsSpawnedObject(pool_id, lowguid, TYPEID_GAMEOBJECT)))
found = true; found = true;
} while( result->NextRow() && (!found) ); } while( result->NextRow() && (!found) );
@ -524,7 +524,7 @@ bool ChatHandler::HandleGameObjectDeleteCommand(const char* args)
GameObject* obj = NULL; GameObject* obj = NULL;
// by DB guid // by DB guid
if (GameObjectData const* go_data = objmgr.GetGOData(lowguid)) if (GameObjectData const* go_data = sObjectMgr.GetGOData(lowguid))
obj = GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id); obj = GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id);
if(!obj) if(!obj)
@ -572,7 +572,7 @@ bool ChatHandler::HandleGameObjectTurnCommand(const char* args)
GameObject* obj = NULL; GameObject* obj = NULL;
// by DB guid // by DB guid
if (GameObjectData const* go_data = objmgr.GetGOData(lowguid)) if (GameObjectData const* go_data = sObjectMgr.GetGOData(lowguid))
obj = GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id); obj = GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id);
if(!obj) if(!obj)
@ -626,7 +626,7 @@ bool ChatHandler::HandleGameObjectMoveCommand(const char* args)
GameObject* obj = NULL; GameObject* obj = NULL;
// by DB guid // by DB guid
if (GameObjectData const* go_data = objmgr.GetGOData(lowguid)) if (GameObjectData const* go_data = sObjectMgr.GetGOData(lowguid))
obj = GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id); obj = GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id);
if(!obj) if(!obj)
@ -726,7 +726,7 @@ bool ChatHandler::HandleGameObjectAddCommand(const char* args)
Map *map = chr->GetMap(); Map *map = chr->GetMap();
GameObject* pGameObj = new GameObject; GameObject* pGameObj = new GameObject;
uint32 db_lowGUID = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT); uint32 db_lowGUID = sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);
if(!pGameObj->Create(db_lowGUID, gInfo->id, map, chr->GetPhaseMaskForSpawn(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY)) if(!pGameObj->Create(db_lowGUID, gInfo->id, map, chr->GetPhaseMaskForSpawn(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
{ {
@ -756,7 +756,7 @@ bool ChatHandler::HandleGameObjectAddCommand(const char* args)
map->Add(pGameObj); map->Add(pGameObj);
// TODO: is it really necessary to add both the real and DB table guid here ? // TODO: is it really necessary to add both the real and DB table guid here ?
objmgr.AddGameobjectToGrid(db_lowGUID, objmgr.GetGOData(db_lowGUID)); sObjectMgr.AddGameobjectToGrid(db_lowGUID, sObjectMgr.GetGOData(db_lowGUID));
PSendSysMessage(LANG_GAMEOBJECT_ADD,id,gInfo->name,db_lowGUID,x,y,z); PSendSysMessage(LANG_GAMEOBJECT_ADD,id,gInfo->name,db_lowGUID,x,y,z);
return true; return true;
@ -777,7 +777,7 @@ bool ChatHandler::HandleGameObjectPhaseCommand(const char* args)
GameObject* obj = NULL; GameObject* obj = NULL;
// by DB guid // by DB guid
if (GameObjectData const* go_data = objmgr.GetGOData(lowguid)) if (GameObjectData const* go_data = sObjectMgr.GetGOData(lowguid))
obj = GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id); obj = GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id);
if(!obj) if(!obj)
@ -1074,7 +1074,7 @@ bool ChatHandler::HandleNpcAddCommand(const char* args)
Map *map = chr->GetMap(); Map *map = chr->GetMap();
Creature* pCreature = new Creature; Creature* pCreature = new Creature;
if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, (uint32)teamval)) if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, (uint32)teamval))
{ {
delete pCreature; delete pCreature;
return false; return false;
@ -1097,7 +1097,7 @@ bool ChatHandler::HandleNpcAddCommand(const char* args)
pCreature->LoadFromDB(db_guid, map); pCreature->LoadFromDB(db_guid, map);
map->Add(pCreature); map->Add(pCreature);
objmgr.AddCreatureToGrid(db_guid, objmgr.GetCreatureData(db_guid)); sObjectMgr.AddCreatureToGrid(db_guid, sObjectMgr.GetCreatureData(db_guid));
return true; return true;
} }
@ -1134,13 +1134,13 @@ bool ChatHandler::HandleNpcAddVendorItemCommand(const char* args)
uint32 vendor_entry = vendor ? vendor->GetEntry() : 0; uint32 vendor_entry = vendor ? vendor->GetEntry() : 0;
if(!objmgr.IsVendorItemValid(vendor_entry,itemId,maxcount,incrtime,extendedcost,m_session->GetPlayer())) if(!sObjectMgr.IsVendorItemValid(vendor_entry,itemId,maxcount,incrtime,extendedcost,m_session->GetPlayer()))
{ {
SetSentErrorMessage(true); SetSentErrorMessage(true);
return false; return false;
} }
objmgr.AddVendorItem(vendor_entry,itemId,maxcount,incrtime,extendedcost); sObjectMgr.AddVendorItem(vendor_entry,itemId,maxcount,incrtime,extendedcost);
ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(itemId); ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(itemId);
@ -1171,7 +1171,7 @@ bool ChatHandler::HandleNpcDelVendorItemCommand(const char* args)
} }
uint32 itemId = atol(pitem); uint32 itemId = atol(pitem);
if(!objmgr.RemoveVendorItem(vendor->GetEntry(),itemId)) if(!sObjectMgr.RemoveVendorItem(vendor->GetEntry(),itemId))
{ {
PSendSysMessage(LANG_ITEM_NOT_IN_LIST,itemId); PSendSysMessage(LANG_ITEM_NOT_IN_LIST,itemId);
SetSentErrorMessage(true); SetSentErrorMessage(true);
@ -1205,7 +1205,7 @@ bool ChatHandler::HandleNpcAddMoveCommand(const char* args)
// attempt check creature existence by DB data // attempt check creature existence by DB data
if(!pCreature) if(!pCreature)
{ {
CreatureData const* data = objmgr.GetCreatureData(lowguid); CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data) if(!data)
{ {
PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid); PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid);
@ -1226,7 +1226,7 @@ bool ChatHandler::HandleNpcAddMoveCommand(const char* args)
Player* player = m_session->GetPlayer(); Player* player = m_session->GetPlayer();
WaypointMgr.AddLastNode(lowguid, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), wait, 0); sWaypointMgr.AddLastNode(lowguid, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), wait, 0);
// update movement type // update movement type
WorldDatabase.PExecuteLog("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE,lowguid); WorldDatabase.PExecuteLog("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE,lowguid);
@ -1273,7 +1273,7 @@ bool ChatHandler::HandleNpcChangeLevelCommand(const char* args)
{ {
if(((Pet*)pCreature)->getPetType()==HUNTER_PET) if(((Pet*)pCreature)->getPetType()==HUNTER_PET)
{ {
pCreature->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(lvl)/4); pCreature->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(lvl)/4);
pCreature->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0); pCreature->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
} }
((Pet*)pCreature)->GivePetLevel(lvl); ((Pet*)pCreature)->GivePetLevel(lvl);
@ -1330,7 +1330,7 @@ bool ChatHandler::HandleNpcDeleteCommand(const char* args)
if(!lowguid) if(!lowguid)
return false; return false;
if (CreatureData const* cr_data = objmgr.GetCreatureData(lowguid)) if (CreatureData const* cr_data = sObjectMgr.GetCreatureData(lowguid))
unit = m_session->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(lowguid, cr_data->id, HIGHGUID_UNIT)); unit = m_session->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(lowguid, cr_data->id, HIGHGUID_UNIT));
} }
else else
@ -1377,7 +1377,7 @@ bool ChatHandler::HandleNpcMoveCommand(const char* args)
// Attempting creature load from DB data // Attempting creature load from DB data
if(!pCreature) if(!pCreature)
{ {
CreatureData const* data = objmgr.GetCreatureData(lowguid); CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data) if(!data)
{ {
PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid); PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid);
@ -1411,7 +1411,7 @@ bool ChatHandler::HandleNpcMoveCommand(const char* args)
if (pCreature) if (pCreature)
{ {
if(CreatureData const* data = objmgr.GetCreatureData(pCreature->GetDBTableGUIDLow())) if(CreatureData const* data = sObjectMgr.GetCreatureData(pCreature->GetDBTableGUIDLow()))
{ {
const_cast<CreatureData*>(data)->posX = x; const_cast<CreatureData*>(data)->posX = x;
const_cast<CreatureData*>(data)->posY = y; const_cast<CreatureData*>(data)->posY = y;
@ -1517,7 +1517,7 @@ bool ChatHandler::HandleNpcSetMoveTypeCommand(const char* args)
// attempt check creature existence by DB data // attempt check creature existence by DB data
if(!pCreature) if(!pCreature)
{ {
CreatureData const* data = objmgr.GetCreatureData(lowguid); CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data) if(!data)
{ {
PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid); PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid);
@ -1549,7 +1549,7 @@ bool ChatHandler::HandleNpcSetMoveTypeCommand(const char* args)
// update movement type // update movement type
if(doNotDelete == false) if(doNotDelete == false)
WaypointMgr.DeletePath(lowguid); sWaypointMgr.DeletePath(lowguid);
if(pCreature) if(pCreature)
{ {
@ -1933,7 +1933,7 @@ bool ChatHandler::HandleNpcNameCommand(const char* /*args*/)
} }
pCreature->SetName(args); pCreature->SetName(args);
uint32 idname = objmgr.AddCreatureTemplate(pCreature->GetName()); uint32 idname = sObjectMgr.AddCreatureTemplate(pCreature->GetName());
pCreature->SetUInt32Value(OBJECT_FIELD_ENTRY, idname); pCreature->SetUInt32Value(OBJECT_FIELD_ENTRY, idname);
pCreature->SaveToDB(); pCreature->SaveToDB();
@ -1980,7 +1980,7 @@ bool ChatHandler::HandleNpcSubNameCommand(const char* /*args*/)
return true; return true;
} }
uint32 idname = objmgr.AddCreatureSubName(pCreature->GetName(),args,pCreature->GetUInt32Value(UNIT_FIELD_DISPLAYID)); uint32 idname = sObjectMgr.AddCreatureSubName(pCreature->GetName(),args,pCreature->GetUInt32Value(UNIT_FIELD_DISPLAYID));
pCreature->SetUInt32Value(OBJECT_FIELD_ENTRY, idname); pCreature->SetUInt32Value(OBJECT_FIELD_ENTRY, idname);
pCreature->SaveToDB(); pCreature->SaveToDB();
@ -2197,7 +2197,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
void ChatHandler::ShowTicket(uint64 guid, char const* text, char const* time) void ChatHandler::ShowTicket(uint64 guid, char const* text, char const* time)
{ {
std::string name; std::string name;
if(!objmgr.GetPlayerNameByGUID(guid,name)) if(!sObjectMgr.GetPlayerNameByGUID(guid,name))
name = GetMangosString(LANG_UNKNOWN); name = GetMangosString(LANG_UNKNOWN);
std::string nameLink = playerLink(name); std::string nameLink = playerLink(name);
@ -2220,7 +2220,7 @@ bool ChatHandler::HandleTicketCommand(const char* args)
return false; return false;
} }
size_t count = ticketmgr.GetTicketCount(); size_t count = sTicketMgr.GetTicketCount();
bool accept = m_session->GetPlayer()->isAcceptTickets(); bool accept = m_session->GetPlayer()->isAcceptTickets();
@ -2287,7 +2287,7 @@ bool ChatHandler::HandleTicketCommand(const char* args)
return false; return false;
// ticket $char_name // ticket $char_name
GMTicket* ticket = ticketmgr.GetGMTicket(GUID_LOPART(target_guid)); GMTicket* ticket = sTicketMgr.GetGMTicket(GUID_LOPART(target_guid));
if(!ticket) if(!ticket)
return false; return false;
@ -2308,7 +2308,7 @@ bool ChatHandler::HandleDelTicketCommand(const char *args)
// delticket all // delticket all
if(strncmp(px,"all",4) == 0) if(strncmp(px,"all",4) == 0)
{ {
ticketmgr.DeleteAll(); sTicketMgr.DeleteAll();
SendSysMessage(LANG_COMMAND_ALLTICKETDELETED); SendSysMessage(LANG_COMMAND_ALLTICKETDELETED);
return true; return true;
} }
@ -2329,10 +2329,10 @@ bool ChatHandler::HandleDelTicketCommand(const char *args)
uint32 guid = fields[0].GetUInt32(); uint32 guid = fields[0].GetUInt32();
delete result; delete result;
ticketmgr.Delete(guid); sTicketMgr.Delete(guid);
//notify player //notify player
if(Player* pl = objmgr.GetPlayer(MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER))) if(Player* pl = sObjectMgr.GetPlayer(MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER)))
{ {
pl->GetSession()->SendGMTicketGetTicket(0x0A, 0); pl->GetSession()->SendGMTicketGetTicket(0x0A, 0);
PSendSysMessage(LANG_COMMAND_TICKETPLAYERDEL, GetNameLink(pl).c_str()); PSendSysMessage(LANG_COMMAND_TICKETPLAYERDEL, GetNameLink(pl).c_str());
@ -2350,7 +2350,7 @@ bool ChatHandler::HandleDelTicketCommand(const char *args)
return false; return false;
// delticket $char_name // delticket $char_name
ticketmgr.Delete(GUID_LOPART(target_guid)); sTicketMgr.Delete(GUID_LOPART(target_guid));
// notify players about ticket deleting // notify players about ticket deleting
if(target) if(target)
@ -2447,7 +2447,7 @@ bool ChatHandler::HandleWpAddCommand(const char* args)
}while( result->NextRow() ); }while( result->NextRow() );
delete result; delete result;
CreatureData const* data = objmgr.GetCreatureData(lowguid); CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data) if(!data)
{ {
PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid);
@ -2481,7 +2481,7 @@ bool ChatHandler::HandleWpAddCommand(const char* args)
} }
lowguid = atoi((char*)guid_str); lowguid = atoi((char*)guid_str);
CreatureData const* data = objmgr.GetCreatureData(lowguid); CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data) if(!data)
{ {
PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid);
@ -2504,7 +2504,7 @@ bool ChatHandler::HandleWpAddCommand(const char* args)
sLog.outDebug("DEBUG: HandleWpAddCommand - point == 0"); sLog.outDebug("DEBUG: HandleWpAddCommand - point == 0");
Player* player = m_session->GetPlayer(); Player* player = m_session->GetPlayer();
WaypointMgr.AddLastNode(lowguid, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), 0, 0); sWaypointMgr.AddLastNode(lowguid, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), 0, 0);
// update movement type // update movement type
if(target) if(target)
@ -2627,7 +2627,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
} }
lowguid = atoi((char*)guid_str); lowguid = atoi((char*)guid_str);
CreatureData const* data = objmgr.GetCreatureData(lowguid); CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data) if(!data)
{ {
PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid);
@ -2696,7 +2696,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
PSendSysMessage("DEBUG: wp modify add, GUID: %u", lowguid); PSendSysMessage("DEBUG: wp modify add, GUID: %u", lowguid);
// Get the creature for which we read the waypoint // Get the creature for which we read the waypoint
CreatureData const* data = objmgr.GetCreatureData(lowguid); CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data) if(!data)
{ {
PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid);
@ -2737,7 +2737,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
// create the waypoint creature // create the waypoint creature
wpGuid = 0; wpGuid = 0;
Creature* wpCreature = new Creature; Creature* wpCreature = new Creature;
if (!wpCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT,0)) if (!wpCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT,0))
{ {
PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT); PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
delete wpCreature; delete wpCreature;
@ -2761,7 +2761,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
} }
} }
WaypointMgr.AddAfterNode(lowguid, point, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), 0, 0, wpGuid); sWaypointMgr.AddAfterNode(lowguid, point, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), 0, 0, wpGuid);
if(!wpGuid) if(!wpGuid)
return false; return false;
@ -2775,7 +2775,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
PSendSysMessage("DEBUG: wp modify del, GUID: %u", lowguid); PSendSysMessage("DEBUG: wp modify del, GUID: %u", lowguid);
// Get the creature for which we read the waypoint // Get the creature for which we read the waypoint
CreatureData const* data = objmgr.GetCreatureData(lowguid); CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data) if(!data)
{ {
PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid);
@ -2799,7 +2799,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
// Adjust the waypoints // Adjust the waypoints
// Respawn the owner of the waypoints // Respawn the owner of the waypoints
WaypointMgr.DeleteNode(lowguid, point); sWaypointMgr.DeleteNode(lowguid, point);
if(npcCreature) if(npcCreature)
{ {
@ -2835,7 +2835,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
Map *map = chr->GetMap(); Map *map = chr->GetMap();
{ {
// Get the creature for which we read the waypoint // Get the creature for which we read the waypoint
CreatureData const* data = objmgr.GetCreatureData(lowguid); CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data) if(!data)
{ {
PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid);
@ -2857,7 +2857,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
wpCreature->AddObjectToRemoveList(); wpCreature->AddObjectToRemoveList();
// re-create // re-create
Creature* wpCreature2 = new Creature; Creature* wpCreature2 = new Creature;
if (!wpCreature2->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0)) if (!wpCreature2->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0))
{ {
PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT); PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
delete wpCreature2; delete wpCreature2;
@ -2880,7 +2880,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
//npcCreature->GetMap()->Add(wpCreature2); //npcCreature->GetMap()->Add(wpCreature2);
} }
WaypointMgr.SetNodePosition(lowguid, point, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ()); sWaypointMgr.SetNodePosition(lowguid, point, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ());
if(npcCreature) if(npcCreature)
{ {
@ -2897,7 +2897,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
} // move } // move
// Create creature - npc that has the waypoint // Create creature - npc that has the waypoint
CreatureData const* data = objmgr.GetCreatureData(lowguid); CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data) if(!data)
{ {
PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid);
@ -2912,7 +2912,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
return false; return false;
} }
WaypointMgr.SetNodeText(lowguid, point, show_str, arg_str); sWaypointMgr.SetNodeText(lowguid, point, show_str, arg_str);
Creature* npcCreature = m_session->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_UNIT)); Creature* npcCreature = m_session->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_UNIT));
if(npcCreature) if(npcCreature)
@ -3006,7 +3006,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
uint32 lowguid = atoi((char*)guid_str); uint32 lowguid = atoi((char*)guid_str);
CreatureData const* data = objmgr.GetCreatureData(lowguid); CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data) if(!data)
{ {
PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid);
@ -3161,7 +3161,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
float o = chr->GetOrientation(); float o = chr->GetOrientation();
Creature* wpCreature = new Creature; Creature* wpCreature = new Creature;
if (!wpCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0)) if (!wpCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0))
{ {
PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id); PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
delete wpCreature; delete wpCreature;
@ -3219,7 +3219,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
Map *map = chr->GetMap(); Map *map = chr->GetMap();
Creature* pCreature = new Creature; Creature* pCreature = new Creature;
if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT),map, chr->GetPhaseMaskForSpawn(), id, 0)) if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT),map, chr->GetPhaseMaskForSpawn(), id, 0))
{ {
PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id); PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
delete pCreature; delete pCreature;
@ -3279,7 +3279,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
Map *map = chr->GetMap(); Map *map = chr->GetMap();
Creature* pCreature = new Creature; Creature* pCreature = new Creature;
if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0)) if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0))
{ {
PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id); PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id);
delete pCreature; delete pCreature;

View file

@ -116,7 +116,7 @@ bool ChatHandler::HandleReloadAllQuestCommand(const char* /*args*/)
HandleReloadQuestTemplateCommand("a"); HandleReloadQuestTemplateCommand("a");
sLog.outString( "Re-Loading Quests Relations..." ); sLog.outString( "Re-Loading Quests Relations..." );
objmgr.LoadQuestRelations(); sObjectMgr.LoadQuestRelations();
SendGlobalSysMessage("DB tables `*_questrelation` and `*_involvedrelation` reloaded."); SendGlobalSysMessage("DB tables `*_questrelation` and `*_involvedrelation` reloaded.");
return true; return true;
} }
@ -192,7 +192,7 @@ bool ChatHandler::HandleReloadConfigCommand(const char* /*args*/)
{ {
sLog.outString( "Re-Loading config settings..." ); sLog.outString( "Re-Loading config settings..." );
sWorld.LoadConfigSettings(true); sWorld.LoadConfigSettings(true);
mapmgr.InitializeVisibilityDistanceInfo(); sMapMgr.InitializeVisibilityDistanceInfo();
SendGlobalSysMessage("World config settings reloaded."); SendGlobalSysMessage("World config settings reloaded.");
return true; return true;
} }
@ -200,7 +200,7 @@ bool ChatHandler::HandleReloadConfigCommand(const char* /*args*/)
bool ChatHandler::HandleReloadAchievementCriteriaRequirementCommand(const char*) bool ChatHandler::HandleReloadAchievementCriteriaRequirementCommand(const char*)
{ {
sLog.outString( "Re-Loading Additional Achievement Criteria Requirements Data..." ); sLog.outString( "Re-Loading Additional Achievement Criteria Requirements Data..." );
achievementmgr.LoadAchievementCriteriaRequirements(); sAchievementMgr.LoadAchievementCriteriaRequirements();
SendGlobalSysMessage("DB table `achievement_criteria_requirement` reloaded."); SendGlobalSysMessage("DB table `achievement_criteria_requirement` reloaded.");
return true; return true;
} }
@ -208,7 +208,7 @@ bool ChatHandler::HandleReloadAchievementCriteriaRequirementCommand(const char*)
bool ChatHandler::HandleReloadAchievementRewardCommand(const char*) bool ChatHandler::HandleReloadAchievementRewardCommand(const char*)
{ {
sLog.outString( "Re-Loading Achievement Reward Data..." ); sLog.outString( "Re-Loading Achievement Reward Data..." );
achievementmgr.LoadRewards(); sAchievementMgr.LoadRewards();
SendGlobalSysMessage("DB table `achievement_reward` reloaded."); SendGlobalSysMessage("DB table `achievement_reward` reloaded.");
return true; return true;
} }
@ -216,7 +216,7 @@ bool ChatHandler::HandleReloadAchievementRewardCommand(const char*)
bool ChatHandler::HandleReloadAreaTriggerTavernCommand(const char*) bool ChatHandler::HandleReloadAreaTriggerTavernCommand(const char*)
{ {
sLog.outString( "Re-Loading Tavern Area Triggers..." ); sLog.outString( "Re-Loading Tavern Area Triggers..." );
objmgr.LoadTavernAreaTriggers(); sObjectMgr.LoadTavernAreaTriggers();
SendGlobalSysMessage("DB table `areatrigger_tavern` reloaded."); SendGlobalSysMessage("DB table `areatrigger_tavern` reloaded.");
return true; return true;
} }
@ -224,7 +224,7 @@ bool ChatHandler::HandleReloadAreaTriggerTavernCommand(const char*)
bool ChatHandler::HandleReloadAreaTriggerTeleportCommand(const char*) bool ChatHandler::HandleReloadAreaTriggerTeleportCommand(const char*)
{ {
sLog.outString( "Re-Loading AreaTrigger teleport definitions..." ); sLog.outString( "Re-Loading AreaTrigger teleport definitions..." );
objmgr.LoadAreaTriggerTeleports(); sObjectMgr.LoadAreaTriggerTeleports();
SendGlobalSysMessage("DB table `areatrigger_teleport` reloaded."); SendGlobalSysMessage("DB table `areatrigger_teleport` reloaded.");
return true; return true;
} }
@ -239,7 +239,7 @@ bool ChatHandler::HandleReloadCommandCommand(const char*)
bool ChatHandler::HandleReloadCreatureQuestRelationsCommand(const char*) bool ChatHandler::HandleReloadCreatureQuestRelationsCommand(const char*)
{ {
sLog.outString( "Loading Quests Relations... (`creature_questrelation`)" ); sLog.outString( "Loading Quests Relations... (`creature_questrelation`)" );
objmgr.LoadCreatureQuestRelations(); sObjectMgr.LoadCreatureQuestRelations();
SendGlobalSysMessage("DB table `creature_questrelation` (creature quest givers) reloaded."); SendGlobalSysMessage("DB table `creature_questrelation` (creature quest givers) reloaded.");
return true; return true;
} }
@ -247,7 +247,7 @@ bool ChatHandler::HandleReloadCreatureQuestRelationsCommand(const char*)
bool ChatHandler::HandleReloadCreatureQuestInvRelationsCommand(const char*) bool ChatHandler::HandleReloadCreatureQuestInvRelationsCommand(const char*)
{ {
sLog.outString( "Loading Quests Relations... (`creature_involvedrelation`)" ); sLog.outString( "Loading Quests Relations... (`creature_involvedrelation`)" );
objmgr.LoadCreatureInvolvedRelations(); sObjectMgr.LoadCreatureInvolvedRelations();
SendGlobalSysMessage("DB table `creature_involvedrelation` (creature quest takers) reloaded."); SendGlobalSysMessage("DB table `creature_involvedrelation` (creature quest takers) reloaded.");
return true; return true;
} }
@ -255,7 +255,7 @@ bool ChatHandler::HandleReloadCreatureQuestInvRelationsCommand(const char*)
bool ChatHandler::HandleReloadGOQuestRelationsCommand(const char*) bool ChatHandler::HandleReloadGOQuestRelationsCommand(const char*)
{ {
sLog.outString( "Loading Quests Relations... (`gameobject_questrelation`)" ); sLog.outString( "Loading Quests Relations... (`gameobject_questrelation`)" );
objmgr.LoadGameobjectQuestRelations(); sObjectMgr.LoadGameobjectQuestRelations();
SendGlobalSysMessage("DB table `gameobject_questrelation` (gameobject quest givers) reloaded."); SendGlobalSysMessage("DB table `gameobject_questrelation` (gameobject quest givers) reloaded.");
return true; return true;
} }
@ -263,7 +263,7 @@ bool ChatHandler::HandleReloadGOQuestRelationsCommand(const char*)
bool ChatHandler::HandleReloadGOQuestInvRelationsCommand(const char*) bool ChatHandler::HandleReloadGOQuestInvRelationsCommand(const char*)
{ {
sLog.outString( "Loading Quests Relations... (`gameobject_involvedrelation`)" ); sLog.outString( "Loading Quests Relations... (`gameobject_involvedrelation`)" );
objmgr.LoadGameobjectInvolvedRelations(); sObjectMgr.LoadGameobjectInvolvedRelations();
SendGlobalSysMessage("DB table `gameobject_involvedrelation` (gameobject quest takers) reloaded."); SendGlobalSysMessage("DB table `gameobject_involvedrelation` (gameobject quest takers) reloaded.");
return true; return true;
} }
@ -271,7 +271,7 @@ bool ChatHandler::HandleReloadGOQuestInvRelationsCommand(const char*)
bool ChatHandler::HandleReloadQuestAreaTriggersCommand(const char*) bool ChatHandler::HandleReloadQuestAreaTriggersCommand(const char*)
{ {
sLog.outString( "Re-Loading Quest Area Triggers..." ); sLog.outString( "Re-Loading Quest Area Triggers..." );
objmgr.LoadQuestAreaTriggers(); sObjectMgr.LoadQuestAreaTriggers();
SendGlobalSysMessage("DB table `areatrigger_involvedrelation` (quest area triggers) reloaded."); SendGlobalSysMessage("DB table `areatrigger_involvedrelation` (quest area triggers) reloaded.");
return true; return true;
} }
@ -279,12 +279,12 @@ bool ChatHandler::HandleReloadQuestAreaTriggersCommand(const char*)
bool ChatHandler::HandleReloadQuestTemplateCommand(const char*) bool ChatHandler::HandleReloadQuestTemplateCommand(const char*)
{ {
sLog.outString( "Re-Loading Quest Templates..." ); sLog.outString( "Re-Loading Quest Templates..." );
objmgr.LoadQuests(); sObjectMgr.LoadQuests();
SendGlobalSysMessage("DB table `quest_template` (quest definitions) reloaded."); SendGlobalSysMessage("DB table `quest_template` (quest definitions) reloaded.");
/// dependent also from `gameobject` but this table not reloaded anyway /// dependent also from `gameobject` but this table not reloaded anyway
sLog.outString( "Re-Loading GameObjects for quests..." ); sLog.outString( "Re-Loading GameObjects for quests..." );
objmgr.LoadGameObjectForQuests(); sObjectMgr.LoadGameObjectForQuests();
SendGlobalSysMessage("Data GameObjects for quests reloaded."); SendGlobalSysMessage("Data GameObjects for quests reloaded.");
return true; return true;
} }
@ -399,7 +399,7 @@ bool ChatHandler::HandleReloadLootTemplatesSpellCommand(const char*)
bool ChatHandler::HandleReloadMangosStringCommand(const char*) bool ChatHandler::HandleReloadMangosStringCommand(const char*)
{ {
sLog.outString( "Re-Loading mangos_string Table!" ); sLog.outString( "Re-Loading mangos_string Table!" );
objmgr.LoadMangosStrings(); sObjectMgr.LoadMangosStrings();
SendGlobalSysMessage("DB table `mangos_string` reloaded."); SendGlobalSysMessage("DB table `mangos_string` reloaded.");
return true; return true;
} }
@ -407,7 +407,7 @@ bool ChatHandler::HandleReloadMangosStringCommand(const char*)
bool ChatHandler::HandleReloadNpcOptionCommand(const char*) bool ChatHandler::HandleReloadNpcOptionCommand(const char*)
{ {
sLog.outString( "Re-Loading `npc_option` Table!" ); sLog.outString( "Re-Loading `npc_option` Table!" );
objmgr.LoadNpcOptions(); sObjectMgr.LoadNpcOptions();
SendGlobalSysMessage("DB table `npc_option` reloaded."); SendGlobalSysMessage("DB table `npc_option` reloaded.");
return true; return true;
} }
@ -415,7 +415,7 @@ bool ChatHandler::HandleReloadNpcOptionCommand(const char*)
bool ChatHandler::HandleReloadNpcGossipCommand(const char*) bool ChatHandler::HandleReloadNpcGossipCommand(const char*)
{ {
sLog.outString( "Re-Loading `npc_gossip` Table!" ); sLog.outString( "Re-Loading `npc_gossip` Table!" );
objmgr.LoadNpcTextId(); sObjectMgr.LoadNpcTextId();
SendGlobalSysMessage("DB table `npc_gossip` reloaded."); SendGlobalSysMessage("DB table `npc_gossip` reloaded.");
return true; return true;
} }
@ -423,7 +423,7 @@ bool ChatHandler::HandleReloadNpcGossipCommand(const char*)
bool ChatHandler::HandleReloadNpcTrainerCommand(const char*) bool ChatHandler::HandleReloadNpcTrainerCommand(const char*)
{ {
sLog.outString( "Re-Loading `npc_trainer` Table!" ); sLog.outString( "Re-Loading `npc_trainer` Table!" );
objmgr.LoadTrainerSpell(); sObjectMgr.LoadTrainerSpell();
SendGlobalSysMessage("DB table `npc_trainer` reloaded."); SendGlobalSysMessage("DB table `npc_trainer` reloaded.");
return true; return true;
} }
@ -431,7 +431,7 @@ bool ChatHandler::HandleReloadNpcTrainerCommand(const char*)
bool ChatHandler::HandleReloadNpcVendorCommand(const char*) bool ChatHandler::HandleReloadNpcVendorCommand(const char*)
{ {
sLog.outString( "Re-Loading `npc_vendor` Table!" ); sLog.outString( "Re-Loading `npc_vendor` Table!" );
objmgr.LoadVendors(); sObjectMgr.LoadVendors();
SendGlobalSysMessage("DB table `npc_vendor` reloaded."); SendGlobalSysMessage("DB table `npc_vendor` reloaded.");
return true; return true;
} }
@ -439,7 +439,7 @@ bool ChatHandler::HandleReloadNpcVendorCommand(const char*)
bool ChatHandler::HandleReloadPointsOfInterestCommand(const char*) bool ChatHandler::HandleReloadPointsOfInterestCommand(const char*)
{ {
sLog.outString( "Re-Loading `points_of_interest` Table!" ); sLog.outString( "Re-Loading `points_of_interest` Table!" );
objmgr.LoadPointsOfInterest(); sObjectMgr.LoadPointsOfInterest();
SendGlobalSysMessage("DB table `points_of_interest` reloaded."); SendGlobalSysMessage("DB table `points_of_interest` reloaded.");
return true; return true;
} }
@ -447,7 +447,7 @@ bool ChatHandler::HandleReloadPointsOfInterestCommand(const char*)
bool ChatHandler::HandleReloadSpellClickSpellsCommand(const char*) bool ChatHandler::HandleReloadSpellClickSpellsCommand(const char*)
{ {
sLog.outString( "Re-Loading `npc_spellclick_spells` Table!" ); sLog.outString( "Re-Loading `npc_spellclick_spells` Table!" );
objmgr.LoadNPCSpellClickSpells(); sObjectMgr.LoadNPCSpellClickSpells();
SendGlobalSysMessage("DB table `npc_spellclick_spells` reloaded."); SendGlobalSysMessage("DB table `npc_spellclick_spells` reloaded.");
return true; return true;
} }
@ -455,7 +455,7 @@ bool ChatHandler::HandleReloadSpellClickSpellsCommand(const char*)
bool ChatHandler::HandleReloadReservedNameCommand(const char*) bool ChatHandler::HandleReloadReservedNameCommand(const char*)
{ {
sLog.outString( "Loading ReservedNames... (`reserved_name`)" ); sLog.outString( "Loading ReservedNames... (`reserved_name`)" );
objmgr.LoadReservedPlayersNames(); sObjectMgr.LoadReservedPlayersNames();
SendGlobalSysMessage("DB table `reserved_name` (player reserved names) reloaded."); SendGlobalSysMessage("DB table `reserved_name` (player reserved names) reloaded.");
return true; return true;
} }
@ -479,7 +479,7 @@ bool ChatHandler::HandleReloadSkillExtraItemTemplateCommand(const char* /*args*/
bool ChatHandler::HandleReloadSkillFishingBaseLevelCommand(const char* /*args*/) bool ChatHandler::HandleReloadSkillFishingBaseLevelCommand(const char* /*args*/)
{ {
sLog.outString( "Re-Loading Skill Fishing base level requirements..." ); sLog.outString( "Re-Loading Skill Fishing base level requirements..." );
objmgr.LoadFishingBaseSkillLevel(); sObjectMgr.LoadFishingBaseSkillLevel();
SendGlobalSysMessage("DB table `skill_fishing_base_level` (fishing base level for zone/subzone) reloaded."); SendGlobalSysMessage("DB table `skill_fishing_base_level` (fishing base level for zone/subzone) reloaded.");
return true; return true;
} }
@ -487,7 +487,7 @@ bool ChatHandler::HandleReloadSkillFishingBaseLevelCommand(const char* /*args*/)
bool ChatHandler::HandleReloadSpellAreaCommand(const char*) bool ChatHandler::HandleReloadSpellAreaCommand(const char*)
{ {
sLog.outString( "Re-Loading SpellArea Data..." ); sLog.outString( "Re-Loading SpellArea Data..." );
spellmgr.LoadSpellAreas(); sSpellMgr.LoadSpellAreas();
SendGlobalSysMessage("DB table `spell_area` (spell dependences from area/quest/auras state) reloaded."); SendGlobalSysMessage("DB table `spell_area` (spell dependences from area/quest/auras state) reloaded.");
return true; return true;
} }
@ -495,7 +495,7 @@ bool ChatHandler::HandleReloadSpellAreaCommand(const char*)
bool ChatHandler::HandleReloadSpellChainCommand(const char*) bool ChatHandler::HandleReloadSpellChainCommand(const char*)
{ {
sLog.outString( "Re-Loading Spell Chain Data... " ); sLog.outString( "Re-Loading Spell Chain Data... " );
spellmgr.LoadSpellChains(); sSpellMgr.LoadSpellChains();
SendGlobalSysMessage("DB table `spell_chain` (spell ranks) reloaded."); SendGlobalSysMessage("DB table `spell_chain` (spell ranks) reloaded.");
return true; return true;
} }
@ -503,7 +503,7 @@ bool ChatHandler::HandleReloadSpellChainCommand(const char*)
bool ChatHandler::HandleReloadSpellElixirCommand(const char*) bool ChatHandler::HandleReloadSpellElixirCommand(const char*)
{ {
sLog.outString( "Re-Loading Spell Elixir types..." ); sLog.outString( "Re-Loading Spell Elixir types..." );
spellmgr.LoadSpellElixirs(); sSpellMgr.LoadSpellElixirs();
SendGlobalSysMessage("DB table `spell_elixir` (spell elixir types) reloaded."); SendGlobalSysMessage("DB table `spell_elixir` (spell elixir types) reloaded.");
return true; return true;
} }
@ -511,7 +511,7 @@ bool ChatHandler::HandleReloadSpellElixirCommand(const char*)
bool ChatHandler::HandleReloadSpellLearnSpellCommand(const char*) bool ChatHandler::HandleReloadSpellLearnSpellCommand(const char*)
{ {
sLog.outString( "Re-Loading Spell Learn Spells..." ); sLog.outString( "Re-Loading Spell Learn Spells..." );
spellmgr.LoadSpellLearnSpells(); sSpellMgr.LoadSpellLearnSpells();
SendGlobalSysMessage("DB table `spell_learn_spell` reloaded."); SendGlobalSysMessage("DB table `spell_learn_spell` reloaded.");
return true; return true;
} }
@ -519,7 +519,7 @@ bool ChatHandler::HandleReloadSpellLearnSpellCommand(const char*)
bool ChatHandler::HandleReloadSpellProcEventCommand(const char*) bool ChatHandler::HandleReloadSpellProcEventCommand(const char*)
{ {
sLog.outString( "Re-Loading Spell Proc Event conditions..." ); sLog.outString( "Re-Loading Spell Proc Event conditions..." );
spellmgr.LoadSpellProcEvents(); sSpellMgr.LoadSpellProcEvents();
SendGlobalSysMessage("DB table `spell_proc_event` (spell proc trigger requirements) reloaded."); SendGlobalSysMessage("DB table `spell_proc_event` (spell proc trigger requirements) reloaded.");
return true; return true;
} }
@ -527,7 +527,7 @@ bool ChatHandler::HandleReloadSpellProcEventCommand(const char*)
bool ChatHandler::HandleReloadSpellBonusesCommand(const char*) bool ChatHandler::HandleReloadSpellBonusesCommand(const char*)
{ {
sLog.outString( "Re-Loading Spell Bonus Data..." ); sLog.outString( "Re-Loading Spell Bonus Data..." );
spellmgr.LoadSpellBonusess(); sSpellMgr.LoadSpellBonusess();
SendGlobalSysMessage("DB table `spell_bonus_data` (spell damage/healing coefficients) reloaded."); SendGlobalSysMessage("DB table `spell_bonus_data` (spell damage/healing coefficients) reloaded.");
return true; return true;
} }
@ -535,7 +535,7 @@ bool ChatHandler::HandleReloadSpellBonusesCommand(const char*)
bool ChatHandler::HandleReloadSpellProcItemEnchantCommand(const char*) bool ChatHandler::HandleReloadSpellProcItemEnchantCommand(const char*)
{ {
sLog.outString( "Re-Loading Spell Proc Item Enchant..." ); sLog.outString( "Re-Loading Spell Proc Item Enchant..." );
spellmgr.LoadSpellProcItemEnchant(); sSpellMgr.LoadSpellProcItemEnchant();
SendGlobalSysMessage("DB table `spell_proc_item_enchant` (item enchantment ppm) reloaded."); SendGlobalSysMessage("DB table `spell_proc_item_enchant` (item enchantment ppm) reloaded.");
return true; return true;
} }
@ -543,7 +543,7 @@ bool ChatHandler::HandleReloadSpellProcItemEnchantCommand(const char*)
bool ChatHandler::HandleReloadSpellScriptTargetCommand(const char*) bool ChatHandler::HandleReloadSpellScriptTargetCommand(const char*)
{ {
sLog.outString( "Re-Loading SpellsScriptTarget..." ); sLog.outString( "Re-Loading SpellsScriptTarget..." );
spellmgr.LoadSpellScriptTarget(); sSpellMgr.LoadSpellScriptTarget();
SendGlobalSysMessage("DB table `spell_script_target` (spell targets selection in case specific creature/GO requirements) reloaded."); SendGlobalSysMessage("DB table `spell_script_target` (spell targets selection in case specific creature/GO requirements) reloaded.");
return true; return true;
} }
@ -551,7 +551,7 @@ bool ChatHandler::HandleReloadSpellScriptTargetCommand(const char*)
bool ChatHandler::HandleReloadSpellTargetPositionCommand(const char*) bool ChatHandler::HandleReloadSpellTargetPositionCommand(const char*)
{ {
sLog.outString( "Re-Loading Spell target coordinates..." ); sLog.outString( "Re-Loading Spell target coordinates..." );
spellmgr.LoadSpellTargetPositions(); sSpellMgr.LoadSpellTargetPositions();
SendGlobalSysMessage("DB table `spell_target_position` (destination coordinates for spell targets) reloaded."); SendGlobalSysMessage("DB table `spell_target_position` (destination coordinates for spell targets) reloaded.");
return true; return true;
} }
@ -559,7 +559,7 @@ bool ChatHandler::HandleReloadSpellTargetPositionCommand(const char*)
bool ChatHandler::HandleReloadSpellThreatsCommand(const char*) bool ChatHandler::HandleReloadSpellThreatsCommand(const char*)
{ {
sLog.outString( "Re-Loading Aggro Spells Definitions..."); sLog.outString( "Re-Loading Aggro Spells Definitions...");
spellmgr.LoadSpellThreats(); sSpellMgr.LoadSpellThreats();
SendGlobalSysMessage("DB table `spell_threat` (spell aggro definitions) reloaded."); SendGlobalSysMessage("DB table `spell_threat` (spell aggro definitions) reloaded.");
return true; return true;
} }
@ -567,7 +567,7 @@ bool ChatHandler::HandleReloadSpellThreatsCommand(const char*)
bool ChatHandler::HandleReloadSpellPetAurasCommand(const char*) bool ChatHandler::HandleReloadSpellPetAurasCommand(const char*)
{ {
sLog.outString( "Re-Loading Spell pet auras..."); sLog.outString( "Re-Loading Spell pet auras...");
spellmgr.LoadSpellPetAuras(); sSpellMgr.LoadSpellPetAuras();
SendGlobalSysMessage("DB table `spell_pet_auras` reloaded."); SendGlobalSysMessage("DB table `spell_pet_auras` reloaded.");
return true; return true;
} }
@ -575,7 +575,7 @@ bool ChatHandler::HandleReloadSpellPetAurasCommand(const char*)
bool ChatHandler::HandleReloadPageTextsCommand(const char*) bool ChatHandler::HandleReloadPageTextsCommand(const char*)
{ {
sLog.outString( "Re-Loading Page Texts..." ); sLog.outString( "Re-Loading Page Texts..." );
objmgr.LoadPageTexts(); sObjectMgr.LoadPageTexts();
SendGlobalSysMessage("DB table `page_texts` reloaded."); SendGlobalSysMessage("DB table `page_texts` reloaded.");
return true; return true;
} }
@ -591,7 +591,7 @@ bool ChatHandler::HandleReloadItemEnchantementsCommand(const char*)
bool ChatHandler::HandleReloadItemRequiredTragetCommand(const char*) bool ChatHandler::HandleReloadItemRequiredTragetCommand(const char*)
{ {
sLog.outString( "Re-Loading Item Required Targets Table..." ); sLog.outString( "Re-Loading Item Required Targets Table..." );
objmgr.LoadItemRequiredTarget(); sObjectMgr.LoadItemRequiredTarget();
SendGlobalSysMessage("DB table `item_required_target` reloaded."); SendGlobalSysMessage("DB table `item_required_target` reloaded.");
return true; return true;
} }
@ -616,7 +616,7 @@ bool ChatHandler::HandleReloadGameObjectScriptsCommand(const char* arg)
if(*arg!='a') if(*arg!='a')
sLog.outString( "Re-Loading Scripts from `gameobject_scripts`..."); sLog.outString( "Re-Loading Scripts from `gameobject_scripts`...");
objmgr.LoadGameObjectScripts(); sObjectMgr.LoadGameObjectScripts();
if(*arg!='a') if(*arg!='a')
SendGlobalSysMessage("DB table `gameobject_scripts` reloaded."); SendGlobalSysMessage("DB table `gameobject_scripts` reloaded.");
@ -636,7 +636,7 @@ bool ChatHandler::HandleReloadEventScriptsCommand(const char* arg)
if(*arg!='a') if(*arg!='a')
sLog.outString( "Re-Loading Scripts from `event_scripts`..."); sLog.outString( "Re-Loading Scripts from `event_scripts`...");
objmgr.LoadEventScripts(); sObjectMgr.LoadEventScripts();
if(*arg!='a') if(*arg!='a')
SendGlobalSysMessage("DB table `event_scripts` reloaded."); SendGlobalSysMessage("DB table `event_scripts` reloaded.");
@ -648,7 +648,7 @@ bool ChatHandler::HandleReloadEventAITextsCommand(const char* arg)
{ {
sLog.outString( "Re-Loading Texts from `creature_ai_texts`..."); sLog.outString( "Re-Loading Texts from `creature_ai_texts`...");
CreatureEAI_Mgr.LoadCreatureEventAI_Texts(true); sEventAIMgr.LoadCreatureEventAI_Texts(true);
SendGlobalSysMessage("DB table `creature_ai_texts` reloaded."); SendGlobalSysMessage("DB table `creature_ai_texts` reloaded.");
return true; return true;
} }
@ -656,7 +656,7 @@ bool ChatHandler::HandleReloadEventAITextsCommand(const char* arg)
bool ChatHandler::HandleReloadEventAISummonsCommand(const char* arg) bool ChatHandler::HandleReloadEventAISummonsCommand(const char* arg)
{ {
sLog.outString( "Re-Loading Summons from `creature_ai_summons`..."); sLog.outString( "Re-Loading Summons from `creature_ai_summons`...");
CreatureEAI_Mgr.LoadCreatureEventAI_Summons(true); sEventAIMgr.LoadCreatureEventAI_Summons(true);
SendGlobalSysMessage("DB table `creature_ai_summons` reloaded."); SendGlobalSysMessage("DB table `creature_ai_summons` reloaded.");
return true; return true;
} }
@ -664,7 +664,7 @@ bool ChatHandler::HandleReloadEventAISummonsCommand(const char* arg)
bool ChatHandler::HandleReloadEventAIScriptsCommand(const char* arg) bool ChatHandler::HandleReloadEventAIScriptsCommand(const char* arg)
{ {
sLog.outString( "Re-Loading Scripts from `creature_ai_scripts`..."); sLog.outString( "Re-Loading Scripts from `creature_ai_scripts`...");
CreatureEAI_Mgr.LoadCreatureEventAI_Scripts(); sEventAIMgr.LoadCreatureEventAI_Scripts();
SendGlobalSysMessage("DB table `creature_ai_scripts` reloaded."); SendGlobalSysMessage("DB table `creature_ai_scripts` reloaded.");
return true; return true;
} }
@ -681,7 +681,7 @@ bool ChatHandler::HandleReloadQuestEndScriptsCommand(const char* arg)
if(*arg!='a') if(*arg!='a')
sLog.outString( "Re-Loading Scripts from `quest_end_scripts`..."); sLog.outString( "Re-Loading Scripts from `quest_end_scripts`...");
objmgr.LoadQuestEndScripts(); sObjectMgr.LoadQuestEndScripts();
if(*arg!='a') if(*arg!='a')
SendGlobalSysMessage("DB table `quest_end_scripts` reloaded."); SendGlobalSysMessage("DB table `quest_end_scripts` reloaded.");
@ -701,7 +701,7 @@ bool ChatHandler::HandleReloadQuestStartScriptsCommand(const char* arg)
if(*arg!='a') if(*arg!='a')
sLog.outString( "Re-Loading Scripts from `quest_start_scripts`..."); sLog.outString( "Re-Loading Scripts from `quest_start_scripts`...");
objmgr.LoadQuestStartScripts(); sObjectMgr.LoadQuestStartScripts();
if(*arg!='a') if(*arg!='a')
SendGlobalSysMessage("DB table `quest_start_scripts` reloaded."); SendGlobalSysMessage("DB table `quest_start_scripts` reloaded.");
@ -721,7 +721,7 @@ bool ChatHandler::HandleReloadSpellScriptsCommand(const char* arg)
if(*arg!='a') if(*arg!='a')
sLog.outString( "Re-Loading Scripts from `spell_scripts`..."); sLog.outString( "Re-Loading Scripts from `spell_scripts`...");
objmgr.LoadSpellScripts(); sObjectMgr.LoadSpellScripts();
if(*arg!='a') if(*arg!='a')
SendGlobalSysMessage("DB table `spell_scripts` reloaded."); SendGlobalSysMessage("DB table `spell_scripts` reloaded.");
@ -732,7 +732,7 @@ bool ChatHandler::HandleReloadSpellScriptsCommand(const char* arg)
bool ChatHandler::HandleReloadDbScriptStringCommand(const char* /*arg*/) bool ChatHandler::HandleReloadDbScriptStringCommand(const char* /*arg*/)
{ {
sLog.outString( "Re-Loading Script strings from `db_script_string`..."); sLog.outString( "Re-Loading Script strings from `db_script_string`...");
objmgr.LoadDbScriptStrings(); sObjectMgr.LoadDbScriptStrings();
SendGlobalSysMessage("DB table `db_script_string` reloaded."); SendGlobalSysMessage("DB table `db_script_string` reloaded.");
return true; return true;
} }
@ -741,7 +741,7 @@ bool ChatHandler::HandleReloadGameGraveyardZoneCommand(const char* /*arg*/)
{ {
sLog.outString( "Re-Loading Graveyard-zone links..."); sLog.outString( "Re-Loading Graveyard-zone links...");
objmgr.LoadGraveyardZones(); sObjectMgr.LoadGraveyardZones();
SendGlobalSysMessage("DB table `game_graveyard_zone` reloaded."); SendGlobalSysMessage("DB table `game_graveyard_zone` reloaded.");
@ -752,7 +752,7 @@ bool ChatHandler::HandleReloadGameTeleCommand(const char* /*arg*/)
{ {
sLog.outString( "Re-Loading Game Tele coordinates..."); sLog.outString( "Re-Loading Game Tele coordinates...");
objmgr.LoadGameTele(); sObjectMgr.LoadGameTele();
SendGlobalSysMessage("DB table `game_tele` reloaded."); SendGlobalSysMessage("DB table `game_tele` reloaded.");
@ -762,7 +762,7 @@ bool ChatHandler::HandleReloadGameTeleCommand(const char* /*arg*/)
bool ChatHandler::HandleReloadLocalesAchievementRewardCommand(const char*) bool ChatHandler::HandleReloadLocalesAchievementRewardCommand(const char*)
{ {
sLog.outString( "Re-Loading Locales Achievement Reward Data..." ); sLog.outString( "Re-Loading Locales Achievement Reward Data..." );
achievementmgr.LoadRewardLocales(); sAchievementMgr.LoadRewardLocales();
SendGlobalSysMessage("DB table `locales_achievement_reward` reloaded."); SendGlobalSysMessage("DB table `locales_achievement_reward` reloaded.");
return true; return true;
} }
@ -770,7 +770,7 @@ bool ChatHandler::HandleReloadLocalesAchievementRewardCommand(const char*)
bool ChatHandler::HandleReloadLocalesCreatureCommand(const char* /*arg*/) bool ChatHandler::HandleReloadLocalesCreatureCommand(const char* /*arg*/)
{ {
sLog.outString( "Re-Loading Locales Creature ..."); sLog.outString( "Re-Loading Locales Creature ...");
objmgr.LoadCreatureLocales(); sObjectMgr.LoadCreatureLocales();
SendGlobalSysMessage("DB table `locales_creature` reloaded."); SendGlobalSysMessage("DB table `locales_creature` reloaded.");
return true; return true;
} }
@ -778,7 +778,7 @@ bool ChatHandler::HandleReloadLocalesCreatureCommand(const char* /*arg*/)
bool ChatHandler::HandleReloadLocalesGameobjectCommand(const char* /*arg*/) bool ChatHandler::HandleReloadLocalesGameobjectCommand(const char* /*arg*/)
{ {
sLog.outString( "Re-Loading Locales Gameobject ... "); sLog.outString( "Re-Loading Locales Gameobject ... ");
objmgr.LoadGameObjectLocales(); sObjectMgr.LoadGameObjectLocales();
SendGlobalSysMessage("DB table `locales_gameobject` reloaded."); SendGlobalSysMessage("DB table `locales_gameobject` reloaded.");
return true; return true;
} }
@ -786,7 +786,7 @@ bool ChatHandler::HandleReloadLocalesGameobjectCommand(const char* /*arg*/)
bool ChatHandler::HandleReloadLocalesItemCommand(const char* /*arg*/) bool ChatHandler::HandleReloadLocalesItemCommand(const char* /*arg*/)
{ {
sLog.outString( "Re-Loading Locales Item ... "); sLog.outString( "Re-Loading Locales Item ... ");
objmgr.LoadItemLocales(); sObjectMgr.LoadItemLocales();
SendGlobalSysMessage("DB table `locales_item` reloaded."); SendGlobalSysMessage("DB table `locales_item` reloaded.");
return true; return true;
} }
@ -794,7 +794,7 @@ bool ChatHandler::HandleReloadLocalesItemCommand(const char* /*arg*/)
bool ChatHandler::HandleReloadLocalesNpcTextCommand(const char* /*arg*/) bool ChatHandler::HandleReloadLocalesNpcTextCommand(const char* /*arg*/)
{ {
sLog.outString( "Re-Loading Locales NPC Text ... "); sLog.outString( "Re-Loading Locales NPC Text ... ");
objmgr.LoadNpcTextLocales(); sObjectMgr.LoadNpcTextLocales();
SendGlobalSysMessage("DB table `locales_npc_text` reloaded."); SendGlobalSysMessage("DB table `locales_npc_text` reloaded.");
return true; return true;
} }
@ -802,7 +802,7 @@ bool ChatHandler::HandleReloadLocalesNpcTextCommand(const char* /*arg*/)
bool ChatHandler::HandleReloadLocalesPageTextCommand(const char* /*arg*/) bool ChatHandler::HandleReloadLocalesPageTextCommand(const char* /*arg*/)
{ {
sLog.outString( "Re-Loading Locales Page Text ... "); sLog.outString( "Re-Loading Locales Page Text ... ");
objmgr.LoadPageTextLocales(); sObjectMgr.LoadPageTextLocales();
SendGlobalSysMessage("DB table `locales_page_text` reloaded."); SendGlobalSysMessage("DB table `locales_page_text` reloaded.");
return true; return true;
} }
@ -810,7 +810,7 @@ bool ChatHandler::HandleReloadLocalesPageTextCommand(const char* /*arg*/)
bool ChatHandler::HandleReloadLocalesPointsOfInterestCommand(const char* /*arg*/) bool ChatHandler::HandleReloadLocalesPointsOfInterestCommand(const char* /*arg*/)
{ {
sLog.outString( "Re-Loading Locales Points Of Interest ... "); sLog.outString( "Re-Loading Locales Points Of Interest ... ");
objmgr.LoadPointOfInterestLocales(); sObjectMgr.LoadPointOfInterestLocales();
SendGlobalSysMessage("DB table `locales_points_of_interest` reloaded."); SendGlobalSysMessage("DB table `locales_points_of_interest` reloaded.");
return true; return true;
} }
@ -818,7 +818,7 @@ bool ChatHandler::HandleReloadLocalesPointsOfInterestCommand(const char* /*arg*/
bool ChatHandler::HandleReloadLocalesQuestCommand(const char* /*arg*/) bool ChatHandler::HandleReloadLocalesQuestCommand(const char* /*arg*/)
{ {
sLog.outString( "Re-Loading Locales Quest ... "); sLog.outString( "Re-Loading Locales Quest ... ");
objmgr.LoadQuestLocales(); sObjectMgr.LoadQuestLocales();
SendGlobalSysMessage("DB table `locales_quest` reloaded."); SendGlobalSysMessage("DB table `locales_quest` reloaded.");
return true; return true;
} }
@ -826,7 +826,7 @@ bool ChatHandler::HandleReloadLocalesQuestCommand(const char* /*arg*/)
bool ChatHandler::HandleReloadMailLevelRewardCommand(const char* /*arg*/) bool ChatHandler::HandleReloadMailLevelRewardCommand(const char* /*arg*/)
{ {
sLog.outString( "Re-Loading Player level dependent mail rewards..." ); sLog.outString( "Re-Loading Player level dependent mail rewards..." );
objmgr.LoadMailLevelRewards(); sObjectMgr.LoadMailLevelRewards();
SendGlobalSysMessage("DB table `mail_level_reward` reloaded."); SendGlobalSysMessage("DB table `mail_level_reward` reloaded.");
return true; return true;
} }
@ -1086,7 +1086,7 @@ bool ChatHandler::HandleUnLearnCommand(const char* args)
} }
if(allRanks) if(allRanks)
spell_id = spellmgr.GetFirstSpellInChain (spell_id); spell_id = sSpellMgr.GetFirstSpellInChain (spell_id);
if (target->HasSpell(spell_id)) if (target->HasSpell(spell_id))
target->removeSpell(spell_id,false,!allRanks); target->removeSpell(spell_id,false,!allRanks);
@ -1837,7 +1837,7 @@ bool ChatHandler::HandleLearnAllMySpellsCommand(const char* /*args*/)
continue; continue;
// skip spells with first rank learned as talent (and all talents then also) // skip spells with first rank learned as talent (and all talents then also)
uint32 first_rank = spellmgr.GetFirstSpellInChain(spellInfo->Id); uint32 first_rank = sSpellMgr.GetFirstSpellInChain(spellInfo->Id);
if(GetTalentSpellCost(first_rank) > 0 ) if(GetTalentSpellCost(first_rank) > 0 )
continue; continue;
@ -2038,7 +2038,7 @@ bool ChatHandler::HandleLearnCommand(const char* args)
else else
targetPlayer->learnSpell(spell,false); targetPlayer->learnSpell(spell,false);
uint32 first_spell = spellmgr.GetFirstSpellInChain(spell); uint32 first_spell = sSpellMgr.GetFirstSpellInChain(spell);
if(GetTalentSpellCost(first_spell)) if(GetTalentSpellCost(first_spell))
targetPlayer->SendTalentsInfoData(false); targetPlayer->SendTalentsInfoData(false);
@ -2622,7 +2622,7 @@ bool ChatHandler::HandleLookupItemCommand(const char* args)
int loc_idx = GetSessionDbLocaleIndex(); int loc_idx = GetSessionDbLocaleIndex();
if ( loc_idx >= 0 ) if ( loc_idx >= 0 )
{ {
ItemLocale const *il = objmgr.GetItemLocale(pProto->ItemId); ItemLocale const *il = sObjectMgr.GetItemLocale(pProto->ItemId);
if (il) if (il)
{ {
if (il->Name.size() > loc_idx && !il->Name[loc_idx].empty()) if (il->Name.size() > loc_idx && !il->Name[loc_idx].empty())
@ -2860,7 +2860,7 @@ bool ChatHandler::HandleLookupSpellCommand(const char* args)
// unit32 used to prevent interpreting uint8 as char at output // unit32 used to prevent interpreting uint8 as char at output
// find rank of learned spell for learning spell, or talent rank // find rank of learned spell for learning spell, or talent rank
uint32 rank = talentCost ? talentCost : spellmgr.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 // send spell in "id - [name, rank N] [talent] [passive] [learn] [known]" format
std::ostringstream ss; std::ostringstream ss;
@ -2919,7 +2919,7 @@ bool ChatHandler::HandleLookupQuestCommand(const char* args)
uint32 counter = 0 ; uint32 counter = 0 ;
ObjectMgr::QuestMap const& qTemplates = objmgr.GetQuestTemplates(); ObjectMgr::QuestMap const& qTemplates = sObjectMgr.GetQuestTemplates();
for (ObjectMgr::QuestMap::const_iterator iter = qTemplates.begin(); iter != qTemplates.end(); ++iter) for (ObjectMgr::QuestMap::const_iterator iter = qTemplates.begin(); iter != qTemplates.end(); ++iter)
{ {
Quest * qinfo = iter->second; Quest * qinfo = iter->second;
@ -2927,7 +2927,7 @@ bool ChatHandler::HandleLookupQuestCommand(const char* args)
int loc_idx = GetSessionDbLocaleIndex(); int loc_idx = GetSessionDbLocaleIndex();
if ( loc_idx >= 0 ) if ( loc_idx >= 0 )
{ {
QuestLocale const *il = objmgr.GetQuestLocale(qinfo->GetQuestId()); QuestLocale const *il = sObjectMgr.GetQuestLocale(qinfo->GetQuestId());
if (il) if (il)
{ {
if (il->Title.size() > loc_idx && !il->Title[loc_idx].empty()) if (il->Title.size() > loc_idx && !il->Title[loc_idx].empty())
@ -3027,7 +3027,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char* args)
int loc_idx = GetSessionDbLocaleIndex(); int loc_idx = GetSessionDbLocaleIndex();
if (loc_idx >= 0) if (loc_idx >= 0)
{ {
CreatureLocale const *cl = objmgr.GetCreatureLocale (id); CreatureLocale const *cl = sObjectMgr.GetCreatureLocale (id);
if (cl) if (cl)
{ {
if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty ()) if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty ())
@ -3092,7 +3092,7 @@ bool ChatHandler::HandleLookupObjectCommand(const char* args)
int loc_idx = GetSessionDbLocaleIndex(); int loc_idx = GetSessionDbLocaleIndex();
if ( loc_idx >= 0 ) if ( loc_idx >= 0 )
{ {
GameObjectLocale const *gl = objmgr.GetGameObjectLocale(id); GameObjectLocale const *gl = sObjectMgr.GetGameObjectLocale(id);
if (gl) if (gl)
{ {
if (gl->Name.size() > loc_idx && !gl->Name[loc_idx].empty()) if (gl->Name.size() > loc_idx && !gl->Name[loc_idx].empty())
@ -3237,7 +3237,7 @@ bool ChatHandler::HandleGuildCreateCommand(const char* args)
return false; return false;
} }
objmgr.AddGuild (guild); sObjectMgr.AddGuild (guild);
return true; return true;
} }
@ -3260,7 +3260,7 @@ bool ChatHandler::HandleGuildInviteCommand(const char *args)
return false; return false;
std::string glName = guildStr; std::string glName = guildStr;
Guild* targetGuild = objmgr.GetGuildByName (glName); Guild* targetGuild = sObjectMgr.GetGuildByName (glName);
if (!targetGuild) if (!targetGuild)
return false; return false;
@ -3282,7 +3282,7 @@ bool ChatHandler::HandleGuildUninviteCommand(const char *args)
if (!glId) if (!glId)
return false; return false;
Guild* targetGuild = objmgr.GetGuildById (glId); Guild* targetGuild = sObjectMgr.GetGuildById (glId);
if (!targetGuild) if (!targetGuild)
return false; return false;
@ -3308,7 +3308,7 @@ bool ChatHandler::HandleGuildRankCommand(const char *args)
if (!glId) if (!glId)
return false; return false;
Guild* targetGuild = objmgr.GetGuildById (glId); Guild* targetGuild = sObjectMgr.GetGuildById (glId);
if (!targetGuild) if (!targetGuild)
return false; return false;
@ -3331,7 +3331,7 @@ bool ChatHandler::HandleGuildDeleteCommand(const char* args)
std::string gld = guildStr; std::string gld = guildStr;
Guild* targetGuild = objmgr.GetGuildByName (gld); Guild* targetGuild = sObjectMgr.GetGuildByName (gld);
if (!targetGuild) if (!targetGuild)
return false; return false;
@ -3515,7 +3515,7 @@ bool ChatHandler::HandleReviveCommand(const char* args)
} }
else else
// will resurrected at login without corpse // will resurrected at login without corpse
objaccessor.ConvertCorpseForPlayer(target_guid); sObjectAccessor.ConvertCorpseForPlayer(target_guid);
return true; return true;
} }
@ -3626,7 +3626,7 @@ bool ChatHandler::HandleLinkGraveCommand(const char* args)
return false; return false;
} }
if(objmgr.AddGraveYardLink(g_id,zoneId,g_team)) if(sObjectMgr.AddGraveYardLink(g_id,zoneId,g_team))
PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, g_id,zoneId); PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, g_id,zoneId);
else else
PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, g_id,zoneId); PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, g_id,zoneId);
@ -3652,14 +3652,14 @@ bool ChatHandler::HandleNearGraveCommand(const char* args)
Player* player = m_session->GetPlayer(); Player* player = m_session->GetPlayer();
uint32 zone_id = player->GetZoneId(); uint32 zone_id = player->GetZoneId();
WorldSafeLocsEntry const* graveyard = objmgr.GetClosestGraveYard( WorldSafeLocsEntry const* graveyard = sObjectMgr.GetClosestGraveYard(
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(),player->GetMapId(),g_team); player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(),player->GetMapId(),g_team);
if(graveyard) if(graveyard)
{ {
uint32 g_id = graveyard->ID; uint32 g_id = graveyard->ID;
GraveYardData const* data = objmgr.FindGraveYardData(g_id,zone_id); GraveYardData const* data = sObjectMgr.FindGraveYardData(g_id,zone_id);
if (!data) if (!data)
{ {
PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR,g_id); PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR,g_id);
@ -4164,7 +4164,7 @@ bool ChatHandler::HandleTeleAddCommand(const char * args)
std::string name = args; std::string name = args;
if(objmgr.GetGameTele(name)) if(sObjectMgr.GetGameTele(name))
{ {
SendSysMessage(LANG_COMMAND_TP_ALREADYEXIST); SendSysMessage(LANG_COMMAND_TP_ALREADYEXIST);
SetSentErrorMessage(true); SetSentErrorMessage(true);
@ -4179,7 +4179,7 @@ bool ChatHandler::HandleTeleAddCommand(const char * args)
tele.mapId = player->GetMapId(); tele.mapId = player->GetMapId();
tele.name = name; tele.name = name;
if(objmgr.AddGameTele(tele)) if(sObjectMgr.AddGameTele(tele))
{ {
SendSysMessage(LANG_COMMAND_TP_ADDED); SendSysMessage(LANG_COMMAND_TP_ADDED);
} }
@ -4200,7 +4200,7 @@ bool ChatHandler::HandleTeleDelCommand(const char * args)
std::string name = args; std::string name = args;
if(!objmgr.DeleteGameTele(name)) if(!sObjectMgr.DeleteGameTele(name))
{ {
SendSysMessage(LANG_COMMAND_TELE_NOTFOUND); SendSysMessage(LANG_COMMAND_TELE_NOTFOUND);
SetSentErrorMessage(true); SetSentErrorMessage(true);
@ -4517,7 +4517,7 @@ bool ChatHandler::HandleResetAllCommand(const char * args)
} }
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE (at_login & '%u') = '0'",atLogin,atLogin); CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE (at_login & '%u') = '0'",atLogin,atLogin);
HashMapHolder<Player>::MapType const& plist = objaccessor.GetPlayers(); HashMapHolder<Player>::MapType const& plist = sObjectAccessor.GetPlayers();
for(HashMapHolder<Player>::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr) for(HashMapHolder<Player>::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr)
itr->second->SetAtLoginFlag(atLogin); itr->second->SetAtLoginFlag(atLogin);
@ -4688,7 +4688,7 @@ bool ChatHandler::HandleQuestAdd(const char* args)
uint32 entry = atol(cId); uint32 entry = atol(cId);
Quest const* pQuest = objmgr.GetQuestTemplate(entry); Quest const* pQuest = sObjectMgr.GetQuestTemplate(entry);
if(!pQuest) if(!pQuest)
{ {
@ -4742,7 +4742,7 @@ bool ChatHandler::HandleQuestRemove(const char* args)
uint32 entry = atol(cId); uint32 entry = atol(cId);
Quest const* pQuest = objmgr.GetQuestTemplate(entry); Quest const* pQuest = sObjectMgr.GetQuestTemplate(entry);
if(!pQuest) if(!pQuest)
{ {
@ -4792,7 +4792,7 @@ bool ChatHandler::HandleQuestComplete(const char* args)
uint32 entry = atol(cId); uint32 entry = atol(cId);
Quest const* pQuest = objmgr.GetQuestTemplate(entry); Quest const* pQuest = sObjectMgr.GetQuestTemplate(entry);
// If player doesn't have the quest // If player doesn't have the quest
if(!pQuest || player->GetQuestStatus(entry) == QUEST_STATUS_NONE) if(!pQuest || player->GetQuestStatus(entry) == QUEST_STATUS_NONE)
@ -5044,7 +5044,7 @@ bool ChatHandler::HandleBanInfoCharacterCommand(const char* args)
if (!extractPlayerTarget((char*)args,&target,&target_guid)) if (!extractPlayerTarget((char*)args,&target,&target_guid))
return false; return false;
uint32 accountid = target ? target->GetSession()->GetAccountId() : objmgr.GetPlayerAccountIdByGUID(target_guid); uint32 accountid = target ? target->GetSession()->GetAccountId() : sObjectMgr.GetPlayerAccountIdByGUID(target_guid);
std::string accountname; std::string accountname;
if (!accmgr.GetName(accountid,accountname)) if (!accmgr.GetName(accountid,accountname))
@ -5456,7 +5456,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args)
return false; return false;
} }
if (objmgr.GetPlayerAccountIdByGUID(guid)) if (sObjectMgr.GetPlayerAccountIdByGUID(guid))
{ {
PSendSysMessage(LANG_CHARACTER_GUID_IN_USE,guid); PSendSysMessage(LANG_CHARACTER_GUID_IN_USE,guid);
SetSentErrorMessage(true); SetSentErrorMessage(true);
@ -5515,10 +5515,10 @@ bool ChatHandler::HandlePDumpWriteCommand(const char *args)
return false; return false;
} }
guid = objmgr.GetPlayerGUIDByName(name); guid = sObjectMgr.GetPlayerGUIDByName(name);
} }
if(!objmgr.GetPlayerAccountIdByGUID(guid)) if(!sObjectMgr.GetPlayerAccountIdByGUID(guid))
{ {
PSendSysMessage(LANG_PLAYER_NOT_FOUND); PSendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true); SetSentErrorMessage(true);
@ -6014,11 +6014,11 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char* args)
bool ChatHandler::HandleInstanceStatsCommand(const char* /*args*/) bool ChatHandler::HandleInstanceStatsCommand(const char* /*args*/)
{ {
PSendSysMessage("instances loaded: %d", mapmgr.GetNumInstances()); PSendSysMessage("instances loaded: %d", sMapMgr.GetNumInstances());
PSendSysMessage("players in instances: %d", mapmgr.GetNumPlayersInInstances()); PSendSysMessage("players in instances: %d", sMapMgr.GetNumPlayersInInstances());
PSendSysMessage("instance saves: %d", sInstanceSaveManager.GetNumInstanceSaves()); PSendSysMessage("instance saves: %d", sInstanceSaveMgr.GetNumInstanceSaves());
PSendSysMessage("players bound: %d", sInstanceSaveManager.GetNumBoundPlayersTotal()); PSendSysMessage("players bound: %d", sInstanceSaveMgr.GetNumBoundPlayersTotal());
PSendSysMessage("groups bound: %d", sInstanceSaveManager.GetNumBoundGroupsTotal()); PSendSysMessage("groups bound: %d", sInstanceSaveMgr.GetNumBoundGroupsTotal());
return true; return true;
} }
@ -6227,7 +6227,7 @@ bool ChatHandler::HandleSendItemsCommand(const char* args)
// from console show not existed sender // from console show not existed sender
MailSender sender(MAIL_NORMAL,m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); MailSender sender(MAIL_NORMAL,m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
uint32 itemTextId = !text.empty() ? objmgr.CreateItemText( text ) : 0; uint32 itemTextId = !text.empty() ? sObjectMgr.CreateItemText( text ) : 0;
// fill mail // fill mail
MailDraft draft(subject, itemTextId); MailDraft draft(subject, itemTextId);
@ -6287,7 +6287,7 @@ bool ChatHandler::HandleSendMoneyCommand(const char* args)
// from console show not existed sender // from console show not existed sender
MailSender sender(MAIL_NORMAL,m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); MailSender sender(MAIL_NORMAL,m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
uint32 itemTextId = !text.empty() ? objmgr.CreateItemText( text ) : 0; uint32 itemTextId = !text.empty() ? sObjectMgr.CreateItemText( text ) : 0;
MailDraft(subject, itemTextId) MailDraft(subject, itemTextId)
.AddMoney(money) .AddMoney(money)
@ -6349,7 +6349,7 @@ bool ChatHandler::HandleModifyGenderCommand(const char *args)
return false; return false;
} }
PlayerInfo const* info = objmgr.GetPlayerInfo(player->getRace(), player->getClass()); PlayerInfo const* info = sObjectMgr.GetPlayerInfo(player->getRace(), player->getClass());
if(!info) if(!info)
return false; return false;

View file

@ -133,7 +133,7 @@ void LootStore::LoadLootTable()
} }
// (condition + cond_value1/2) are converted into single conditionId // (condition + cond_value1/2) are converted into single conditionId
uint16 conditionId = objmgr.GetConditionId(condition, cond_value1, cond_value2); uint16 conditionId = sObjectMgr.GetConditionId(condition, cond_value1, cond_value2);
LootStoreItem storeitem = LootStoreItem(item, chanceOrQuestChance, group, conditionId, mincountOrRef, maxcount); LootStoreItem storeitem = LootStoreItem(item, chanceOrQuestChance, group, conditionId, mincountOrRef, maxcount);
@ -337,7 +337,7 @@ LootItem::LootItem(LootStoreItem const& li)
bool LootItem::AllowedForPlayer(Player const * player) const bool LootItem::AllowedForPlayer(Player const * player) const
{ {
// DB conditions check // DB conditions check
if ( !objmgr.IsPlayerMeetToCondition(player,conditionId) ) if ( !sObjectMgr.IsPlayerMeetToCondition(player,conditionId) )
return false; return false;
if ( needs_quest ) if ( needs_quest )

View file

@ -91,7 +91,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
uint64 rc = 0; uint64 rc = 0;
if (normalizePlayerName(receiver)) if (normalizePlayerName(receiver))
rc = objmgr.GetPlayerGUIDByName(receiver); rc = sObjectMgr.GetPlayerGUIDByName(receiver);
if (!rc) if (!rc)
{ {
@ -119,7 +119,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
return; return;
} }
Player *receive = objmgr.GetPlayer(rc); Player *receive = sObjectMgr.GetPlayer(rc);
uint32 rc_team = 0; uint32 rc_team = 0;
uint8 mails_count = 0; // do not allow to send to one player more than 100 mails uint8 mails_count = 0; // do not allow to send to one player more than 100 mails
@ -131,7 +131,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
} }
else else
{ {
rc_team = objmgr.GetPlayerTeamByGUID(rc); rc_team = sObjectMgr.GetPlayerTeamByGUID(rc);
if (QueryResult* result = CharacterDatabase.PQuery("SELECT COUNT(*) FROM mail WHERE receiver = '%u'", GUID_LOPART(rc))) if (QueryResult* result = CharacterDatabase.PQuery("SELECT COUNT(*) FROM mail WHERE receiver = '%u'", GUID_LOPART(rc)))
{ {
Field *fields = result->Fetch(); Field *fields = result->Fetch();
@ -156,7 +156,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
uint32 rc_account = receive uint32 rc_account = receive
? receive->GetSession()->GetAccountId() ? receive->GetSession()->GetAccountId()
: objmgr.GetPlayerAccountIdByGUID(rc); : sObjectMgr.GetPlayerAccountIdByGUID(rc);
Item* items[MAX_MAIL_ITEMS]; Item* items[MAX_MAIL_ITEMS];
@ -206,7 +206,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
pl->SendMailResult(0, MAIL_SEND, MAIL_OK); pl->SendMailResult(0, MAIL_SEND, MAIL_OK);
uint32 itemTextId = !body.empty() ? objmgr.CreateItemText( body ) : 0; uint32 itemTextId = !body.empty() ? sObjectMgr.CreateItemText( body ) : 0;
pl->ModifyMoney( -int32(reqmoney) ); pl->ModifyMoney( -int32(reqmoney) );
pl->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL, cost); pl->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL, cost);
@ -415,7 +415,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 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); uint64 sender_guid = MAKE_NEW_GUID(m->sender, 0, HIGHGUID_PLAYER);
Player *receive = objmgr.GetPlayer(sender_guid); Player *receive = sObjectMgr.GetPlayer(sender_guid);
uint32 sender_accId = 0; uint32 sender_accId = 0;
@ -430,16 +430,16 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data )
else else
{ {
// can be calculated early // can be calculated early
sender_accId = objmgr.GetPlayerAccountIdByGUID(sender_guid); sender_accId = sObjectMgr.GetPlayerAccountIdByGUID(sender_guid);
if(!objmgr.GetPlayerNameByGUID(sender_guid, sender_name)) if(!sObjectMgr.GetPlayerNameByGUID(sender_guid, sender_name))
sender_name = objmgr.GetMangosStringForDBCLocale(LANG_UNKNOWN); sender_name = sObjectMgr.GetMangosStringForDBCLocale(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)", 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); GetPlayerName(), GetAccountId(), it->GetProto()->Name1, it->GetEntry(), it->GetCount(), m->COD, sender_name.c_str(), sender_accId);
} }
else if(!receive) else if(!receive)
sender_accId = objmgr.GetPlayerAccountIdByGUID(sender_guid); sender_accId = sObjectMgr.GetPlayerAccountIdByGUID(sender_guid);
// check player existence // check player existence
if(receive || sender_accId) if(receive || sender_accId)
@ -650,7 +650,7 @@ void WorldSession::HandleItemTextQuery(WorldPacket & recv_data )
WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, (4+10));// guess size WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, (4+10));// guess size
data << itemTextId; data << itemTextId;
data << objmgr.GetItemText( itemTextId ); data << sObjectMgr.GetItemText( itemTextId );
SendPacket(&data); SendPacket(&data);
} }
@ -688,11 +688,11 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data )
return; return;
} }
itemTextId = objmgr.CreateItemText(mailTemplateEntry->content[GetSessionDbcLocale()]); itemTextId = sObjectMgr.CreateItemText(mailTemplateEntry->content[GetSessionDbcLocale()]);
} }
Item *bodyItem = new Item; // This is not bag and then can be used new Item. Item *bodyItem = new Item; // This is not bag and then can be used new Item.
if(!bodyItem->Create(objmgr.GenerateLowGuid(HIGHGUID_ITEM), MAIL_BODY_ITEM_TEMPLATE, pl)) if(!bodyItem->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM), MAIL_BODY_ITEM_TEMPLATE, pl))
{ {
delete bodyItem; delete bodyItem;
return; return;
@ -871,11 +871,11 @@ void MailDraft::deleteIncludedItems( bool inDB /*= false*/ )
void MailDraft::SendReturnToSender(uint32 sender_acc, uint32 sender_guid, uint32 receiver_guid ) void MailDraft::SendReturnToSender(uint32 sender_acc, uint32 sender_guid, uint32 receiver_guid )
{ {
Player *receiver = objmgr.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; uint32 rc_account = 0;
if(!receiver) if(!receiver)
rc_account = objmgr.GetPlayerAccountIdByGUID(MAKE_NEW_GUID(receiver_guid, 0, HIGHGUID_PLAYER)); rc_account = sObjectMgr.GetPlayerAccountIdByGUID(MAKE_NEW_GUID(receiver_guid, 0, HIGHGUID_PLAYER));
if(!receiver && !rc_account) // sender not exist if(!receiver && !rc_account) // sender not exist
{ {
@ -918,7 +918,7 @@ void MailDraft::SendMailTo(MailReceiver const& receiver, MailSender const& sende
prepareItems(pReceiver); // generate mail template items prepareItems(pReceiver); // generate mail template items
uint32 mailId = objmgr.GenerateMailID(); uint32 mailId = sObjectMgr.GenerateMailID();
time_t deliver_time = time(NULL) + deliver_delay; time_t deliver_time = time(NULL) + deliver_delay;

View file

@ -323,7 +323,7 @@ void Map::DeleteFromWorld(T* obj)
template<> template<>
void Map::DeleteFromWorld(Player* pl) void Map::DeleteFromWorld(Player* pl)
{ {
objaccessor.RemoveObject(pl); sObjectAccessor.RemoveObject(pl);
delete pl; delete pl;
} }
@ -411,7 +411,7 @@ bool Map::EnsureGridLoaded(const Cell &cell)
loader.LoadN(); loader.LoadN();
// Add resurrectable corpses to world object list in grid // Add resurrectable corpses to world object list in grid
objaccessor.AddCorpsesToGrid(GridPair(cell.GridX(),cell.GridY()),(*grid)(cell.CellX(), cell.CellY()), this); sObjectAccessor.AddCorpsesToGrid(GridPair(cell.GridX(),cell.GridY()),(*grid)(cell.CellX(), cell.CellY()), this);
setGridObjectDataLoaded(true,cell.GridX(), cell.GridY()); setGridObjectDataLoaded(true,cell.GridX(), cell.GridY());
return true; return true;
@ -2059,7 +2059,7 @@ void Map::SendInitSelf( Player * player )
void Map::SendInitTransports( Player * player ) void Map::SendInitTransports( Player * player )
{ {
// Hack to send out transports // Hack to send out transports
MapManager::TransportMap& tmap = mapmgr.m_TransportsByMap; MapManager::TransportMap& tmap = sMapMgr.m_TransportsByMap;
// no transports at map // no transports at map
if (tmap.find(player->GetMapId()) == tmap.end()) if (tmap.find(player->GetMapId()) == tmap.end())
@ -2086,7 +2086,7 @@ void Map::SendInitTransports( Player * player )
void Map::SendRemoveTransports( Player * player ) void Map::SendRemoveTransports( Player * player )
{ {
// Hack to send out transports // Hack to send out transports
MapManager::TransportMap& tmap = mapmgr.m_TransportsByMap; MapManager::TransportMap& tmap = sMapMgr.m_TransportsByMap;
// no transports at map // no transports at map
if (tmap.find(player->GetMapId()) == tmap.end()) if (tmap.find(player->GetMapId()) == tmap.end())
@ -2359,11 +2359,11 @@ bool InstanceMap::Add(Player *player)
if(IsDungeon()) if(IsDungeon())
{ {
// get or create an instance save for the map // get or create an instance save for the map
InstanceSave *mapSave = sInstanceSaveManager.GetInstanceSave(GetInstanceId()); InstanceSave *mapSave = sInstanceSaveMgr.GetInstanceSave(GetInstanceId());
if(!mapSave) if(!mapSave)
{ {
sLog.outDetail("InstanceMap::Add: creating instance save for map %d spawnmode %d with instance id %d", GetId(), GetSpawnMode(), GetInstanceId()); sLog.outDetail("InstanceMap::Add: creating instance save for map %d spawnmode %d with instance id %d", GetId(), GetSpawnMode(), GetInstanceId());
mapSave = sInstanceSaveManager.AddInstanceSave(GetId(), GetInstanceId(), Difficulty(GetSpawnMode()), 0, true); mapSave = sInstanceSaveMgr.AddInstanceSave(GetId(), GetInstanceId(), Difficulty(GetSpawnMode()), 0, true);
} }
// check for existing instance binds // check for existing instance binds
@ -2493,7 +2493,7 @@ void InstanceMap::CreateInstanceData(bool load)
const char* data = fields[0].GetString(); const char* data = fields[0].GetString();
if(data) if(data)
{ {
sLog.outDebug("Loading instance data for `%s` with id %u", objmgr.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); i_data->Load(data);
} }
delete result; delete result;
@ -2501,7 +2501,7 @@ void InstanceMap::CreateInstanceData(bool load)
} }
else else
{ {
sLog.outDebug("New instance data, \"%s\" ,initialized!", objmgr.GetScriptName(i_script_id)); sLog.outDebug("New instance data, \"%s\" ,initialized!", sObjectMgr.GetScriptName(i_script_id));
i_data->Initialize(); i_data->Initialize();
} }
} }
@ -2552,7 +2552,7 @@ void InstanceMap::PermBindAllPlayers(Player *player)
if(!IsDungeon()) if(!IsDungeon())
return; return;
InstanceSave *save = sInstanceSaveManager.GetInstanceSave(GetInstanceId()); InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(GetInstanceId());
if(!save) if(!save)
{ {
sLog.outError("Cannot bind players, no instance save available for map!"); sLog.outError("Cannot bind players, no instance save available for map!");
@ -2594,7 +2594,7 @@ void InstanceMap::UnloadAll(bool pForce)
} }
if(m_resetAfterUnload == true) if(m_resetAfterUnload == true)
objmgr.DeleteRespawnTimeForInstance(GetInstanceId()); sObjectMgr.DeleteRespawnTimeForInstance(GetInstanceId());
Map::UnloadAll(pForce); Map::UnloadAll(pForce);
} }
@ -2612,9 +2612,9 @@ void InstanceMap::SetResetSchedule(bool on)
// it is assumed that the reset time will rarely (if ever) change while the reset is scheduled // it is assumed that the reset time will rarely (if ever) change while the reset is scheduled
if(IsDungeon() && !HavePlayers() && !IsRaid() && !IsHeroic()) if(IsDungeon() && !HavePlayers() && !IsRaid() && !IsHeroic())
{ {
InstanceSave *save = sInstanceSaveManager.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()); if(!save) sLog.outError("InstanceMap::SetResetSchedule: cannot turn schedule %s, no save available for instance %d of %d", on ? "on" : "off", GetInstanceId(), GetId());
else sInstanceSaveManager.ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), GetInstanceId())); else sInstanceSaveMgr.ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), GetInstanceId()));
} }
} }

View file

@ -166,7 +166,7 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player * player)
{ {
// if no instanceId via group members or instance saves is found // if no instanceId via group members or instance saves is found
// the instance will be created for the first time // the instance will be created for the first time
NewInstanceId = mapmgr.GenerateInstanceId(); NewInstanceId = sMapMgr.GenerateInstanceId();
Difficulty diff = player->GetGroup() ? player->GetGroup()->GetDifficulty(IsRaid()) : player->GetDifficulty(IsRaid()); Difficulty diff = player->GetGroup() ? player->GetGroup()->GetDifficulty(IsRaid()) : player->GetDifficulty(IsRaid());
map = CreateInstance(NewInstanceId, NULL, diff); map = CreateInstance(NewInstanceId, NULL, diff);

View file

@ -155,6 +155,6 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton<MapManager, MaNGOS::
uint32 i_MaxInstanceId; uint32 i_MaxInstanceId;
}; };
#define mapmgr MapManager::Instance() #define sMapMgr MapManager::Instance()
#endif #endif

View file

@ -142,7 +142,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
data << clientcount; // clientcount place holder data << clientcount; // clientcount place holder
//TODO: Guard Player map //TODO: Guard Player map
HashMapHolder<Player>::MapType& m = objaccessor.GetPlayers(); HashMapHolder<Player>::MapType& m = sObjectAccessor.GetPlayers();
for(HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) for(HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
{ {
if (security == SEC_PLAYER) if (security == SEC_PLAYER)
@ -204,7 +204,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
if (!(wplayer_name.empty() || wpname.find(wplayer_name) != std::wstring::npos)) if (!(wplayer_name.empty() || wpname.find(wplayer_name) != std::wstring::npos))
continue; continue;
std::string gname = objmgr.GetGuildNameById(itr->second->GetGuildId()); std::string gname = sObjectMgr.GetGuildNameById(itr->second->GetGuildId());
std::wstring wgname; std::wstring wgname;
if(!Utf8toWStr(gname,wgname)) if(!Utf8toWStr(gname,wgname))
continue; continue;
@ -754,10 +754,10 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
if(Script->scriptAreaTrigger(GetPlayer(), atEntry)) if(Script->scriptAreaTrigger(GetPlayer(), atEntry))
return; return;
uint32 quest_id = objmgr.GetQuestForAreaTrigger( Trigger_ID ); uint32 quest_id = sObjectMgr.GetQuestForAreaTrigger( Trigger_ID );
if( quest_id && GetPlayer()->isAlive() && GetPlayer()->IsActiveQuest(quest_id) ) if( quest_id && GetPlayer()->isAlive() && GetPlayer()->IsActiveQuest(quest_id) )
{ {
Quest const* pQuest = objmgr.GetQuestTemplate(quest_id); Quest const* pQuest = sObjectMgr.GetQuestTemplate(quest_id);
if( pQuest ) if( pQuest )
{ {
if(GetPlayer()->GetQuestStatus(quest_id) == QUEST_STATUS_INCOMPLETE) if(GetPlayer()->GetQuestStatus(quest_id) == QUEST_STATUS_INCOMPLETE)
@ -765,7 +765,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
} }
} }
if(objmgr.IsTavernAreaTrigger(Trigger_ID)) if(sObjectMgr.IsTavernAreaTrigger(Trigger_ID))
{ {
// set resting flag we are in the inn // set resting flag we are in the inn
GetPlayer()->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING); GetPlayer()->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
@ -787,7 +787,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
} }
// NULL if all values default (non teleport trigger) // NULL if all values default (non teleport trigger)
AreaTrigger const* at = objmgr.GetAreaTrigger(Trigger_ID); AreaTrigger const* at = sObjectMgr.GetAreaTrigger(Trigger_ID);
if(!at) if(!at)
return; return;
@ -1129,7 +1129,7 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data)
_player->SetSelection(guid); _player->SetSelection(guid);
Player *plr = objmgr.GetPlayer(guid); Player *plr = sObjectMgr.GetPlayer(guid);
if(!plr) // wrong player if(!plr) // wrong player
return; return;
@ -1157,7 +1157,7 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data)
uint64 guid; uint64 guid;
recv_data >> guid; recv_data >> guid;
Player *player = objmgr.GetPlayer(guid); Player *player = sObjectMgr.GetPlayer(guid);
if(!player) if(!player)
{ {
@ -1230,7 +1230,7 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data)
return; return;
} }
Player *plr = objmgr.GetPlayer(charname.c_str()); Player *plr = sObjectMgr.GetPlayer(charname.c_str());
if(!plr) if(!plr)
{ {
@ -1554,7 +1554,7 @@ void WorldSession::HandleQueryInspectAchievements( WorldPacket & recv_data )
if(!recv_data.readPackGUID(guid)) if(!recv_data.readPackGUID(guid))
return; return;
if(Player *player = objmgr.GetPlayer(guid)) if(Player *player = sObjectMgr.GetPlayer(guid))
player->GetAchievementMgr().SendRespondInspectAchievements(_player); player->GetAchievementMgr().SendRespondInspectAchievements(_player);
} }

View file

@ -65,7 +65,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
GetPlayer()->SetSemaphoreTeleportFar(false); GetPlayer()->SetSemaphoreTeleportFar(false);
// relocate the player to the teleport destination // relocate the player to the teleport destination
GetPlayer()->SetMap(mapmgr.CreateMap(loc.mapid, GetPlayer())); GetPlayer()->SetMap(sMapMgr.CreateMap(loc.mapid, GetPlayer()));
GetPlayer()->Relocate(loc.coord_x, loc.coord_y, loc.coord_z, loc.orientation); GetPlayer()->Relocate(loc.coord_x, loc.coord_y, loc.coord_z, loc.orientation);
GetPlayer()->SendInitialPacketsBeforeAddToMap(); GetPlayer()->SendInitialPacketsBeforeAddToMap();
@ -141,14 +141,14 @@ void WorldSession::HandleMoveWorldportAckOpcode()
{ {
if(mEntry->IsRaid()) if(mEntry->IsRaid())
{ {
uint32 timeleft = sInstanceSaveManager.GetResetTimeFor(GetPlayer()->GetMapId()) - time(NULL); uint32 timeleft = sInstanceSaveMgr.GetResetTimeFor(GetPlayer()->GetMapId()) - time(NULL);
GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), GetPlayer()->GetRaidDifficulty(), timeleft); GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), GetPlayer()->GetRaidDifficulty(), timeleft);
} }
else if(mEntry->IsNonRaidDungeon() && GetPlayer()->GetDungeonDifficulty() > DUNGEON_DIFFICULTY_NORMAL) else if(mEntry->IsNonRaidDungeon() && GetPlayer()->GetDungeonDifficulty() > DUNGEON_DIFFICULTY_NORMAL)
{ {
if(MapDifficulty const* mapDiff = GetMapDifficultyData(mEntry->MapID,GetPlayer()->GetDungeonDifficulty())) if(MapDifficulty const* mapDiff = GetMapDifficultyData(mEntry->MapID,GetPlayer()->GetDungeonDifficulty()))
{ {
uint32 timeleft = sInstanceSaveManager.GetResetTimeFor(GetPlayer()->GetMapId()) - time(NULL); uint32 timeleft = sInstanceSaveMgr.GetResetTimeFor(GetPlayer()->GetMapId()) - time(NULL);
GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), GetPlayer()->GetDungeonDifficulty(), timeleft); GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), GetPlayer()->GetDungeonDifficulty(), timeleft);
} }
} }
@ -274,7 +274,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
if (plMover && !plMover->m_transport) if (plMover && !plMover->m_transport)
{ {
// elevators also cause the client to send MOVEMENTFLAG_ONTRANSPORT - just unmount if the guid can be found in the transport list // 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 = mapmgr.m_Transports.begin(); iter != mapmgr.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) if ((*iter)->GetGUID() == movementInfo.t_guid)
{ {

View file

@ -157,8 +157,8 @@ void WorldSession::SendTrainerList( uint64 guid, const std::string& strTitle )
if(!_player->IsSpellFitByClassAndRace(tSpell->learnedSpell)) if(!_player->IsSpellFitByClassAndRace(tSpell->learnedSpell))
continue; continue;
bool primary_prof_first_rank = spellmgr.IsPrimaryProfessionFirstRankSpell(tSpell->learnedSpell); bool primary_prof_first_rank = sSpellMgr.IsPrimaryProfessionFirstRankSpell(tSpell->learnedSpell);
SpellChainNode const* chain_node = spellmgr.GetSpellChainNode(tSpell->learnedSpell); SpellChainNode const* chain_node = sSpellMgr.GetSpellChainNode(tSpell->learnedSpell);
TrainerSpellState state = _player->GetTrainerSpellState(tSpell); TrainerSpellState state = _player->GetTrainerSpellState(tSpell);
data << uint32(tSpell->spell); // learned spell (or cast-spell in profession case) data << uint32(tSpell->spell); // learned spell (or cast-spell in profession case)
@ -356,7 +356,7 @@ void WorldSession::SendSpiritResurrect()
WorldSafeLocsEntry const *corpseGrave = NULL; WorldSafeLocsEntry const *corpseGrave = NULL;
Corpse *corpse = _player->GetCorpse(); Corpse *corpse = _player->GetCorpse();
if(corpse) if(corpse)
corpseGrave = objmgr.GetClosestGraveYard( corpseGrave = sObjectMgr.GetClosestGraveYard(
corpse->GetPositionX(), corpse->GetPositionY(), corpse->GetPositionZ(), corpse->GetMapId(), _player->GetTeam() ); corpse->GetPositionX(), corpse->GetPositionY(), corpse->GetPositionZ(), corpse->GetMapId(), _player->GetTeam() );
// now can spawn bones // now can spawn bones
@ -365,7 +365,7 @@ void WorldSession::SendSpiritResurrect()
// teleport to nearest from corpse graveyard, if different from nearest to player ghost // teleport to nearest from corpse graveyard, if different from nearest to player ghost
if(corpseGrave) if(corpseGrave)
{ {
WorldSafeLocsEntry const *ghostGrave = objmgr.GetClosestGraveYard( WorldSafeLocsEntry const *ghostGrave = sObjectMgr.GetClosestGraveYard(
_player->GetPositionX(), _player->GetPositionY(), _player->GetPositionZ(), _player->GetMapId(), _player->GetTeam() ); _player->GetPositionX(), _player->GetPositionY(), _player->GetPositionZ(), _player->GetMapId(), _player->GetTeam() );
if(corpseGrave != ghostGrave) if(corpseGrave != ghostGrave)
@ -829,7 +829,7 @@ void WorldSession::HandleRepairItemOpcode( WorldPacket & recv_data )
uint32 GuildId = _player->GetGuildId(); uint32 GuildId = _player->GetGuildId();
if (!GuildId) if (!GuildId)
return; return;
Guild *pGuild = objmgr.GetGuildById(GuildId); Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if (!pGuild) if (!pGuild)
return; return;
pGuild->LogBankEvent(GUILD_BANK_LOG_REPAIR_MONEY, 0, _player->GetGUIDLow(), TotalCost); pGuild->LogBankEvent(GUILD_BANK_LOG_REPAIR_MONEY, 0, _player->GetGUIDLow(), TotalCost);

View file

@ -1457,7 +1457,7 @@ void WorldObject::MonsterTextEmote(const char* text, uint64 TargetGuid, bool IsB
void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossWhisper) void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossWhisper)
{ {
Player *player = objmgr.GetPlayer(receiver); Player *player = sObjectMgr.GetPlayer(receiver);
if(!player || !player->GetSession()) if(!player || !player->GetSession())
return; return;
@ -1476,7 +1476,7 @@ namespace MaNGOS
: i_object(obj), i_msgtype(msgtype), i_textId(textId), i_language(language), i_targetGUID(targetGUID) {} : i_object(obj), i_msgtype(msgtype), i_textId(textId), i_language(language), i_targetGUID(targetGUID) {}
void operator()(WorldPacket& data, int32 loc_idx) void operator()(WorldPacket& data, int32 loc_idx)
{ {
char const* text = objmgr.GetMangosString(i_textId,loc_idx); char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
// TODO: i_object.GetName() also must be localized? // TODO: i_object.GetName() also must be localized?
i_object.BuildMonsterChat(&data,i_msgtype,text,i_language,i_object.GetNameForLocaleIdx(loc_idx),i_targetGUID); i_object.BuildMonsterChat(&data,i_msgtype,text,i_language,i_object.GetNameForLocaleIdx(loc_idx),i_targetGUID);
@ -1554,12 +1554,12 @@ void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossE
void WorldObject::MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper) void WorldObject::MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper)
{ {
Player *player = objmgr.GetPlayer(receiver); Player *player = sObjectMgr.GetPlayer(receiver);
if(!player || !player->GetSession()) if(!player || !player->GetSession())
return; return;
uint32 loc_idx = player->GetSession()->GetSessionDbLocaleIndex(); uint32 loc_idx = player->GetSession()->GetSessionDbLocaleIndex();
char const* text = objmgr.GetMangosString(textId,loc_idx); char const* text = sObjectMgr.GetMangosString(textId,loc_idx);
WorldPacket data(SMSG_MESSAGECHAT, 200); WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildMonsterChat(&data,IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER,text,LANG_UNIVERSAL,GetNameForLocaleIdx(loc_idx),receiver); BuildMonsterChat(&data,IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER,text,LANG_UNIVERSAL,GetNameForLocaleIdx(loc_idx),receiver);
@ -1589,7 +1589,7 @@ void WorldObject::BuildMonsterChat(WorldPacket *data, uint8 msgtype, char const*
void WorldObject::SendMessageToSet(WorldPacket *data, bool /*bToSelf*/) void WorldObject::SendMessageToSet(WorldPacket *data, bool /*bToSelf*/)
{ {
//if object is in world, map for it already created! //if object is in world, map for it already created!
Map * _map = IsInWorld() ? GetMap() : mapmgr.FindMap(GetMapId(), GetInstanceId()); Map * _map = IsInWorld() ? GetMap() : sMapMgr.FindMap(GetMapId(), GetInstanceId());
if(_map) if(_map)
_map->MessageBroadcast(this, data); _map->MessageBroadcast(this, data);
} }
@ -1597,7 +1597,7 @@ void WorldObject::SendMessageToSet(WorldPacket *data, bool /*bToSelf*/)
void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /*bToSelf*/) void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /*bToSelf*/)
{ {
//if object is in world, map for it already created! //if object is in world, map for it already created!
Map * _map = IsInWorld() ? GetMap() : mapmgr.FindMap(GetMapId(), GetInstanceId()); Map * _map = IsInWorld() ? GetMap() : sMapMgr.FindMap(GetMapId(), GetInstanceId());
if(_map) if(_map)
_map->MessageDistBroadcast(this, data, dist); _map->MessageDistBroadcast(this, data, dist);
} }
@ -1637,7 +1637,7 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa
if (GetTypeId()==TYPEID_PLAYER) if (GetTypeId()==TYPEID_PLAYER)
team = ((Player*)this)->GetTeam(); team = ((Player*)this)->GetTeam();
if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), GetMap(), GetPhaseMask(), id, team)) if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), GetMap(), GetPhaseMask(), id, team))
{ {
delete pCreature; delete pCreature;
return NULL; return NULL;

View file

@ -186,7 +186,7 @@ ObjectAccessor::RemoveCorpse(Corpse *corpse)
CellPair cell_pair = MaNGOS::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY()); CellPair cell_pair = MaNGOS::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY());
uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
objmgr.DeleteCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID()); sObjectMgr.DeleteCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID());
corpse->RemoveFromWorld(); corpse->RemoveFromWorld();
i_player2corpse.erase(iter); i_player2corpse.erase(iter);
@ -205,7 +205,7 @@ ObjectAccessor::AddCorpse(Corpse *corpse)
CellPair cell_pair = MaNGOS::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY()); CellPair cell_pair = MaNGOS::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY());
uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
objmgr.AddCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID(), corpse->GetInstanceId()); sObjectMgr.AddCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID(), corpse->GetInstanceId());
} }
void void
@ -249,7 +249,7 @@ ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia)
// remove resurrectable corpse from grid object registry (loaded state checked into call) // remove resurrectable corpse from grid object registry (loaded state checked into call)
// do not load the map if it's not loaded // do not load the map if it's not loaded
Map *map = mapmgr.FindMap(corpse->GetMapId(), corpse->GetInstanceId()); Map *map = sMapMgr.FindMap(corpse->GetMapId(), corpse->GetInstanceId());
if(map) if(map)
map->Remove(corpse, false); map->Remove(corpse, false);

View file

@ -168,6 +168,6 @@ inline Unit* ObjectAccessor::GetUnitInWorld(WorldObject const& obj, uint64 guid)
return GetCreatureInWorld(guid); return GetCreatureInWorld(guid);
} }
#define objaccessor ObjectAccessor::Instance() #define sObjectAccessor ObjectAccessor::Instance()
#endif #endif

View file

@ -147,7 +147,7 @@ void LoadHelper(CellCorpseSet const& cell_corpses, CellPair &cell, CorpseMapType
uint32 player_guid = itr->first; uint32 player_guid = itr->first;
Corpse *obj = objaccessor.GetCorpseForPlayerGUID(player_guid); Corpse *obj = sObjectAccessor.GetCorpseForPlayerGUID(player_guid);
if(!obj) if(!obj)
continue; continue;
@ -171,7 +171,7 @@ ObjectGridLoader::Visit(GameObjectMapType &m)
CellPair cell_pair(x,y); CellPair cell_pair(x,y);
uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
CellObjectGuids const& cell_guids = objmgr.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); LoadHelper(cell_guids.gameobjects, cell_pair, m, i_gameObjects, i_map);
} }
@ -184,7 +184,7 @@ ObjectGridLoader::Visit(CreatureMapType &m)
CellPair cell_pair(x,y); CellPair cell_pair(x,y);
uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
CellObjectGuids const& cell_guids = objmgr.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); LoadHelper(cell_guids.creatures, cell_pair, m, i_creatures, i_map);
} }
@ -198,7 +198,7 @@ ObjectWorldLoader::Visit(CorpseMapType &m)
uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; 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 // corpses are always added to spawn mode 0 and they are spawned by their instance id
CellObjectGuids const& cell_guids = objmgr.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); LoadHelper(cell_guids.corpses, cell_pair, m, i_corpses, i_map);
} }

View file

@ -461,7 +461,7 @@ struct SQLCreatureLoader : public SQLStorageLoaderBase<SQLCreatureLoader>
template<class D> template<class D>
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst) void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
{ {
dst = D(objmgr.GetScriptId(src)); dst = D(sObjectMgr.GetScriptId(src));
} }
}; };
@ -1653,7 +1653,7 @@ struct SQLItemLoader : public SQLStorageLoaderBase<SQLItemLoader>
template<class D> template<class D>
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst) void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
{ {
dst = D(objmgr.GetScriptId(src)); dst = D(sObjectMgr.GetScriptId(src));
} }
}; };
@ -2124,7 +2124,7 @@ void ObjectMgr::LoadItemRequiredTarget()
if (pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE || if (pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE ||
pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE) pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE)
{ {
SpellScriptTargetBounds bounds = spellmgr.GetSpellScriptTargetBounds(pSpellInfo->Id); SpellScriptTargetBounds bounds = sSpellMgr.GetSpellScriptTargetBounds(pSpellInfo->Id);
if (bounds.first != bounds.second) if (bounds.first != bounds.second)
break; break;
@ -3224,7 +3224,7 @@ void ObjectMgr::LoadGroups()
diff = 0; // default for both difficaly types diff = 0; // default for both difficaly types
} }
InstanceSave *save = sInstanceSaveManager.AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), (time_t)fields[5].GetUInt64(), (fields[6].GetUInt32() == 0), true); InstanceSave *save = sInstanceSaveMgr.AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), (time_t)fields[5].GetUInt64(), (fields[6].GetUInt32() == 0), true);
group->BindToInstance(save, fields[3].GetBool(), true); group->BindToInstance(save, fields[3].GetBool(), true);
}while( result->NextRow() ); }while( result->NextRow() );
delete result; delete result;
@ -4099,7 +4099,7 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
continue; continue;
} }
// if(!objmgr.GetMangosStringLocale(tmp.dataint)) will checked after db_script_string loading // if(!sObjectMgr.GetMangosStringLocale(tmp.dataint)) will checked after db_script_string loading
break; break;
} }
@ -4564,7 +4564,7 @@ struct SQLInstanceLoader : public SQLStorageLoaderBase<SQLInstanceLoader>
template<class D> template<class D>
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst) void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
{ {
dst = D(objmgr.GetScriptId(src)); dst = D(sObjectMgr.GetScriptId(src));
} }
}; };
@ -5111,11 +5111,11 @@ uint32 ObjectMgr::GetTaxiMountDisplayId( uint32 id, uint32 team, bool allowed_al
if (!mount_info) if (!mount_info)
return 0; return 0;
uint16 mount_id = objmgr.ChooseDisplayId(team,mount_info); uint16 mount_id = sObjectMgr.ChooseDisplayId(team,mount_info);
if (!mount_id) if (!mount_id)
return 0; return 0;
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(mount_id); CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(mount_id);
if (minfo) if (minfo)
mount_id = minfo->modelid; mount_id = minfo->modelid;
@ -5232,7 +5232,7 @@ void ObjectMgr::LoadGraveyardZones()
WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team) WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team)
{ {
// search for zone associated closest graveyard // search for zone associated closest graveyard
uint32 zoneId = mapmgr.GetZoneId(MapId,x,y,z); uint32 zoneId = sMapMgr.GetZoneId(MapId,x,y,z);
// Simulate std. algorithm: // Simulate std. algorithm:
// found some graveyard associated to (ghost_zone,ghost_map) // found some graveyard associated to (ghost_zone,ghost_map)
@ -5834,7 +5834,7 @@ struct SQLGameObjectLoader : public SQLStorageLoaderBase<SQLGameObjectLoader>
template<class D> template<class D>
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst) void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
{ {
dst = D(objmgr.GetScriptId(src)); dst = D(sObjectMgr.GetScriptId(src));
} }
}; };
@ -6225,7 +6225,7 @@ void ObjectMgr::LoadCorpses()
continue; continue;
} }
objaccessor.AddCorpse(corpse); sObjectAccessor.AddCorpse(corpse);
++count; ++count;
} }
@ -7349,7 +7349,7 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val
case CONDITION_QUESTREWARDED: case CONDITION_QUESTREWARDED:
case CONDITION_QUESTTAKEN: case CONDITION_QUESTTAKEN:
{ {
Quest const *Quest = objmgr.GetQuestTemplate(value1); Quest const *Quest = sObjectMgr.GetQuestTemplate(value1);
if (!Quest) if (!Quest)
{ {
sLog.outErrorDb("Quest condition specifies non-existing quest (%u), skipped", value1); sLog.outErrorDb("Quest condition specifies non-existing quest (%u), skipped", value1);
@ -8086,7 +8086,7 @@ void ObjectMgr::LoadDbScriptStrings()
CheckScripts(sGameObjectScripts,ids); CheckScripts(sGameObjectScripts,ids);
CheckScripts(sEventScripts,ids); CheckScripts(sEventScripts,ids);
WaypointMgr.CheckTextsExistance(ids); sWaypointMgr.CheckTextsExistance(ids);
for(std::set<int32>::const_iterator itr = ids.begin(); itr != ids.end(); ++itr) for(std::set<int32>::const_iterator itr = ids.begin(); itr != ids.end(); ++itr)
sLog.outErrorDb( "Table `db_script_string` has unused string id %u", *itr); sLog.outErrorDb( "Table `db_script_string` has unused string id %u", *itr);
@ -8095,7 +8095,7 @@ void ObjectMgr::LoadDbScriptStrings()
// Functions for scripting access // Functions for scripting access
uint32 GetAreaTriggerScriptId(uint32 trigger_id) uint32 GetAreaTriggerScriptId(uint32 trigger_id)
{ {
return objmgr.GetAreaTriggerScriptId(trigger_id); return sObjectMgr.GetAreaTriggerScriptId(trigger_id);
} }
bool LoadMangosStrings(DatabaseType& db, char const* table,int32 start_value, int32 end_value) bool LoadMangosStrings(DatabaseType& db, char const* table,int32 start_value, int32 end_value)
@ -8108,17 +8108,17 @@ bool LoadMangosStrings(DatabaseType& db, char const* table,int32 start_value, in
return false; return false;
} }
return objmgr.LoadMangosStrings(db,table,start_value,end_value); return sObjectMgr.LoadMangosStrings(db,table,start_value,end_value);
} }
uint32 MANGOS_DLL_SPEC GetScriptId(const char *name) uint32 MANGOS_DLL_SPEC GetScriptId(const char *name)
{ {
return objmgr.GetScriptId(name); return sObjectMgr.GetScriptId(name);
} }
ObjectMgr::ScriptNameMap & GetScriptNames() ObjectMgr::ScriptNameMap & GetScriptNames()
{ {
return objmgr.GetScriptNames(); return sObjectMgr.GetScriptNames();
} }
CreatureInfo const* GetCreatureTemplateStore(uint32 entry) CreatureInfo const* GetCreatureTemplateStore(uint32 entry)
@ -8128,5 +8128,5 @@ CreatureInfo const* GetCreatureTemplateStore(uint32 entry)
Quest const* GetQuestTemplateStore(uint32 entry) Quest const* GetQuestTemplateStore(uint32 entry)
{ {
return objmgr.GetQuestTemplate(entry); return sObjectMgr.GetQuestTemplate(entry);
} }

View file

@ -920,7 +920,7 @@ class ObjectMgr
CacheTrainerSpellMap m_mCacheTrainerSpellMap; CacheTrainerSpellMap m_mCacheTrainerSpellMap;
}; };
#define objmgr MaNGOS::Singleton<ObjectMgr>::Instance() #define sObjectMgr MaNGOS::Singleton<ObjectMgr>::Instance()
// scripting access functions // scripting access functions
MANGOS_DLL_SPEC bool LoadMangosStrings(DatabaseType& db, char const* table,int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min()); MANGOS_DLL_SPEC bool LoadMangosStrings(DatabaseType& db, char const* table,int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min());

View file

@ -627,7 +627,7 @@ bool Pet::CanTakeMoreActiveSpells(uint32 spellid)
if(IsPassiveSpell(spellid)) if(IsPassiveSpell(spellid))
return true; return true;
chainstartstore[0] = spellmgr.GetFirstSpellInChain(spellid); chainstartstore[0] = sSpellMgr.GetFirstSpellInChain(spellid);
for (PetSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr) for (PetSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
{ {
@ -637,7 +637,7 @@ bool Pet::CanTakeMoreActiveSpells(uint32 spellid)
if(IsPassiveSpell(itr->first)) if(IsPassiveSpell(itr->first))
continue; continue;
uint32 chainstart = spellmgr.GetFirstSpellInChain(itr->first); uint32 chainstart = sSpellMgr.GetFirstSpellInChain(itr->first);
uint8 x; uint8 x;
@ -711,7 +711,7 @@ void Pet::GivePetXP(uint32 xp)
newXP -= nextLvlXP; newXP -= nextLvlXP;
GivePetLevel(level+1); GivePetLevel(level+1);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(level+1)/4); SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(level+1)/4);
level = getLevel(); level = getLevel();
nextLvlXP = GetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP); nextLvlXP = GetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP);
@ -741,7 +741,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
uint32 guid = creature->GetMap()->GenerateLocalLowGuid(HIGHGUID_PET); uint32 guid = creature->GetMap()->GenerateLocalLowGuid(HIGHGUID_PET);
sLog.outBasic("Create pet"); sLog.outBasic("Create pet");
uint32 pet_number = objmgr.GeneratePetNumber(); uint32 pet_number = sObjectMgr.GeneratePetNumber();
if(!Create(guid, creature->GetMap(), creature->GetPhaseMask(), creature->GetEntry(), pet_number)) if(!Create(guid, creature->GetMap(), creature->GetPhaseMask(), creature->GetEntry(), pet_number))
return false; return false;
@ -773,13 +773,13 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
setPowerType(POWER_FOCUS); setPowerType(POWER_FOCUS);
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0); SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0); SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(creature->getLevel())/4); SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(creature->getLevel())/4);
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
if(CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family)) if(CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family))
SetName(cFamily->Name[sWorld.GetDefaultDbcLocale()]); SetName(cFamily->Name[sWorld.GetDefaultDbcLocale()]);
else else
SetName(creature->GetNameForLocaleIdx(objmgr.GetDBCLocaleIndex())); SetName(creature->GetNameForLocaleIdx(sObjectMgr.GetDBCLocaleIndex()));
if(cinfo->type == CREATURE_TYPE_BEAST) if(cinfo->type == CREATURE_TYPE_BEAST)
{ {
@ -886,7 +886,7 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner)
//SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, float(cinfo->attackpower)); //SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, float(cinfo->attackpower));
PetLevelInfo const* pInfo = objmgr.GetPetLevelInfo(creature_ID, petlevel); PetLevelInfo const* pInfo = sObjectMgr.GetPetLevelInfo(creature_ID, petlevel);
if(pInfo) // exist in DB if(pInfo) // exist in DB
{ {
SetCreateHealth(pInfo->health); SetCreateHealth(pInfo->health);
@ -918,7 +918,7 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner)
} }
case HUNTER_PET: case HUNTER_PET:
{ {
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(petlevel)/4); SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(petlevel)/4);
//these formula may not be correct; however, it is designed to be close to what it should be //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 //this makes dps 0.5 of pets level
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)) ); SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)) );
@ -927,7 +927,7 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner)
//damage is increased afterwards as strength and pet scaling modify attack power //damage is increased afterwards as strength and pet scaling modify attack power
//stored standard pet stats are entry 1 in pet_levelinfo //stored standard pet stats are entry 1 in pet_levelinfo
PetLevelInfo const* pInfo = objmgr.GetPetLevelInfo(creature_ID, petlevel); PetLevelInfo const* pInfo = sObjectMgr.GetPetLevelInfo(creature_ID, petlevel);
if(pInfo) // exist in DB if(pInfo) // exist in DB
{ {
SetCreateHealth(pInfo->health); SetCreateHealth(pInfo->health);
@ -1337,16 +1337,16 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel
} }
} }
} }
else if(spellmgr.GetSpellRank(spell_id)!=0) else if(sSpellMgr.GetSpellRank(spell_id)!=0)
{ {
for (PetSpellMap::const_iterator itr2 = m_spells.begin(); itr2 != m_spells.end(); ++itr2) for (PetSpellMap::const_iterator itr2 = m_spells.begin(); itr2 != m_spells.end(); ++itr2)
{ {
if(itr2->second.state == PETSPELL_REMOVED) continue; if(itr2->second.state == PETSPELL_REMOVED) continue;
if( spellmgr.IsRankSpellDueToSpell(spellInfo,itr2->first) ) if( sSpellMgr.IsRankSpellDueToSpell(spellInfo,itr2->first) )
{ {
// replace by new high rank // replace by new high rank
if(spellmgr.IsHighRankOfSpell(spell_id,itr2->first)) if(sSpellMgr.IsHighRankOfSpell(spell_id,itr2->first))
{ {
newspell.active = itr2->second.active; newspell.active = itr2->second.active;
@ -1358,7 +1358,7 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel
break; break;
} }
// ignore new lesser rank // ignore new lesser rank
else if(spellmgr.IsHighRankOfSpell(itr2->first,spell_id)) else if(sSpellMgr.IsHighRankOfSpell(itr2->first,spell_id))
return false; return false;
} }
} }
@ -1411,7 +1411,7 @@ void Pet::InitLevelupSpellsForLevel()
{ {
uint32 level = getLevel(); uint32 level = getLevel();
if(PetLevelupSpellSet const *levelupSpells = GetCreatureInfo()->family ? spellmgr.GetPetLevelupSpellList(GetCreatureInfo()->family) : NULL) if(PetLevelupSpellSet const *levelupSpells = GetCreatureInfo()->family ? sSpellMgr.GetPetLevelupSpellList(GetCreatureInfo()->family) : NULL)
{ {
// PetLevelupSpellSet ordered by levels, process in reversed order // PetLevelupSpellSet ordered by levels, process in reversed order
for(PetLevelupSpellSet::const_reverse_iterator itr = levelupSpells->rbegin(); itr != levelupSpells->rend(); ++itr) for(PetLevelupSpellSet::const_reverse_iterator itr = levelupSpells->rbegin(); itr != levelupSpells->rend(); ++itr)
@ -1428,7 +1428,7 @@ void Pet::InitLevelupSpellsForLevel()
int32 petSpellsId = GetCreatureInfo()->PetSpellDataId ? -(int32)GetCreatureInfo()->PetSpellDataId : GetEntry(); 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) // 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 = spellmgr.GetPetDefaultSpellsEntry(petSpellsId)) if(PetDefaultSpellsEntry const *defSpells = sSpellMgr.GetPetDefaultSpellsEntry(petSpellsId))
{ {
for(int i = 0; i < MAX_CREATURE_SPELL_DATA_SLOT; ++i) for(int i = 0; i < MAX_CREATURE_SPELL_DATA_SLOT; ++i)
{ {
@ -1497,7 +1497,7 @@ bool Pet::removeSpell(uint32 spell_id, bool learn_prev, bool clear_ab)
if (learn_prev) if (learn_prev)
{ {
if (uint32 prev_id = spellmgr.GetPrevSpellInChain (spell_id)) if (uint32 prev_id = sSpellMgr.GetPrevSpellInChain (spell_id))
learnSpell(prev_id); learnSpell(prev_id);
else else
learn_prev = false; learn_prev = false;
@ -1605,10 +1605,10 @@ bool Pet::resetTalents(bool no_cost)
continue; continue;
} }
// remove learned spells (all ranks) // remove learned spells (all ranks)
uint32 itrFirstId = spellmgr.GetFirstSpellInChain(itr->first); uint32 itrFirstId = sSpellMgr.GetFirstSpellInChain(itr->first);
// unlearn if first rank is talent or learned by talent // unlearn if first rank is talent or learned by talent
if (itrFirstId == talentInfo->RankID[j] || spellmgr.IsSpellLearnToSpell(talentInfo->RankID[j],itrFirstId)) if (itrFirstId == talentInfo->RankID[j] || sSpellMgr.IsSpellLearnToSpell(talentInfo->RankID[j],itrFirstId))
{ {
removeSpell(itr->first,false); removeSpell(itr->first,false);
itr = m_spells.begin(); itr = m_spells.begin();
@ -1924,7 +1924,7 @@ void Pet::learnSpellHighRank(uint32 spellid)
learnSpell(spellid); learnSpell(spellid);
DoPetLearnSpell worker(*this); DoPetLearnSpell worker(*this);
spellmgr.doForHighRanks(spellid,worker); sSpellMgr.doForHighRanks(spellid,worker);
} }
void Pet::SynchronizeLevelWithOwner() void Pet::SynchronizeLevelWithOwner()
@ -1944,7 +1944,7 @@ void Pet::SynchronizeLevelWithOwner()
if(getLevel() > owner->getLevel()) if(getLevel() > owner->getLevel())
{ {
GivePetLevel(owner->getLevel()); GivePetLevel(owner->getLevel());
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(owner->getLevel())/4); SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(owner->getLevel())/4);
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, GetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP)-1); SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, GetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP)-1);
} }
break; break;

View file

@ -394,7 +394,7 @@ void WorldSession::HandlePetRename( WorldPacket & recv_data )
return; return;
} }
if(objmgr.IsReservedName(name)) if(sObjectMgr.IsReservedName(name))
{ {
SendPetNameInvalid(PET_NAME_RESERVED, name, NULL); SendPetNameInvalid(PET_NAME_RESERVED, name, NULL);
return; return;

View file

@ -145,12 +145,12 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
if(type == 9) if(type == 9)
{ {
if(objmgr.GetGuildByName(name)) if(sObjectMgr.GetGuildByName(name))
{ {
SendGuildCommandResult(GUILD_CREATE_S, name, GUILD_NAME_EXISTS); SendGuildCommandResult(GUILD_CREATE_S, name, GUILD_NAME_EXISTS);
return; return;
} }
if(objmgr.IsReservedName(name) || !ObjectMgr::IsValidCharterName(name)) if(sObjectMgr.IsReservedName(name) || !ObjectMgr::IsValidCharterName(name))
{ {
SendGuildCommandResult(GUILD_CREATE_S, name, GUILD_NAME_INVALID); SendGuildCommandResult(GUILD_CREATE_S, name, GUILD_NAME_INVALID);
return; return;
@ -158,12 +158,12 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
} }
else else
{ {
if(objmgr.GetArenaTeamByName(name)) if(sObjectMgr.GetArenaTeamByName(name))
{ {
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_EXISTS_S); SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_EXISTS_S);
return; return;
} }
if(objmgr.IsReservedName(name) || !ObjectMgr::IsValidCharterName(name)) if(sObjectMgr.IsReservedName(name) || !ObjectMgr::IsValidCharterName(name))
{ {
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_INVALID); SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_INVALID);
return; return;
@ -401,12 +401,12 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data)
if(type == 9) if(type == 9)
{ {
if(objmgr.GetGuildByName(newname)) if(sObjectMgr.GetGuildByName(newname))
{ {
SendGuildCommandResult(GUILD_CREATE_S, newname, GUILD_NAME_EXISTS); SendGuildCommandResult(GUILD_CREATE_S, newname, GUILD_NAME_EXISTS);
return; return;
} }
if(objmgr.IsReservedName(newname) || !ObjectMgr::IsValidCharterName(newname)) if(sObjectMgr.IsReservedName(newname) || !ObjectMgr::IsValidCharterName(newname))
{ {
SendGuildCommandResult(GUILD_CREATE_S, newname, GUILD_NAME_INVALID); SendGuildCommandResult(GUILD_CREATE_S, newname, GUILD_NAME_INVALID);
return; return;
@ -414,12 +414,12 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data)
} }
else else
{ {
if(objmgr.GetArenaTeamByName(newname)) if(sObjectMgr.GetArenaTeamByName(newname))
{ {
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, newname, "", ERR_ARENA_TEAM_NAME_EXISTS_S); SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, newname, "", ERR_ARENA_TEAM_NAME_EXISTS_S);
return; return;
} }
if(objmgr.IsReservedName(newname) || !ObjectMgr::IsValidCharterName(newname)) if(sObjectMgr.IsReservedName(newname) || !ObjectMgr::IsValidCharterName(newname))
{ {
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, newname, "", ERR_ARENA_TEAM_NAME_INVALID); SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, newname, "", ERR_ARENA_TEAM_NAME_INVALID);
return; return;
@ -473,7 +473,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
return; return;
// not let enemies sign guild charter // not let enemies sign guild charter
if(!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != objmgr.GetPlayerTeamByGUID(ownerguid)) if(!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(ownerguid))
{ {
if(type != 9) if(type != 9)
SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED); SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED);
@ -539,7 +539,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
SendPacket(&data); SendPacket(&data);
// update for owner if online // update for owner if online
if(Player *owner = objmgr.GetPlayer(ownerguid)) if(Player *owner = sObjectMgr.GetPlayer(ownerguid))
owner->GetSession()->SendPacket(&data); owner->GetSession()->SendPacket(&data);
return; return;
} }
@ -562,7 +562,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
// item->SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1+1, signs); // item->SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1+1, signs);
// update for owner if online // update for owner if online
if(Player *owner = objmgr.GetPlayer(ownerguid)) if(Player *owner = sObjectMgr.GetPlayer(ownerguid))
owner->GetSession()->SendPacket(&data); owner->GetSession()->SendPacket(&data);
} }
@ -584,7 +584,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recv_data)
ownerguid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER); ownerguid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER);
delete result; delete result;
Player *owner = objmgr.GetPlayer(ownerguid); Player *owner = sObjectMgr.GetPlayer(ownerguid);
if(owner) // petition owner online if(owner) // petition owner online
{ {
WorldPacket data(MSG_PETITION_DECLINE, 8); WorldPacket data(MSG_PETITION_DECLINE, 8);
@ -782,7 +782,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
if(type == 9) if(type == 9)
{ {
if(objmgr.GetGuildByName(name)) if(sObjectMgr.GetGuildByName(name))
{ {
SendGuildCommandResult(GUILD_CREATE_S, name, GUILD_NAME_EXISTS); SendGuildCommandResult(GUILD_CREATE_S, name, GUILD_NAME_EXISTS);
delete result; delete result;
@ -791,7 +791,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
} }
else else
{ {
if(objmgr.GetArenaTeamByName(name)) if(sObjectMgr.GetArenaTeamByName(name))
{ {
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_EXISTS_S); SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_EXISTS_S);
delete result; delete result;
@ -823,7 +823,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
} }
// register guild and add guildmaster // register guild and add guildmaster
objmgr.AddGuild(guild); sObjectMgr.AddGuild(guild);
// add members // add members
for(uint8 i = 0; i < signs; ++i) for(uint8 i = 0; i < signs; ++i)
@ -850,7 +850,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
at->SetEmblem(backgroud, icon, iconcolor, border, bordercolor); at->SetEmblem(backgroud, icon, iconcolor, border, bordercolor);
// register team and add captain // register team and add captain
objmgr.AddArenaTeam(at); sObjectMgr.AddArenaTeam(at);
sLog.outDebug("PetitonsHandler: arena team added to objmrg"); sLog.outDebug("PetitonsHandler: arena team added to objmrg");
// add members // add members

File diff suppressed because it is too large Load diff

View file

@ -413,18 +413,18 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
// make sure the same guid doesn't already exist and is safe to use // make sure the same guid doesn't already exist and is safe to use
bool incHighest = true; bool incHighest = true;
if (guid != 0 && guid < objmgr.m_hiCharGuid) if (guid != 0 && guid < sObjectMgr.m_hiCharGuid)
{ {
result = CharacterDatabase.PQuery("SELECT * FROM characters WHERE guid = '%d'", guid); result = CharacterDatabase.PQuery("SELECT * FROM characters WHERE guid = '%d'", guid);
if (result) if (result)
{ {
guid = objmgr.m_hiCharGuid; // use first free if exists guid = sObjectMgr.m_hiCharGuid; // use first free if exists
delete result; delete result;
} }
else incHighest = false; else incHighest = false;
} }
else else
guid = objmgr.m_hiCharGuid; guid = sObjectMgr.m_hiCharGuid;
// normalize the name if specified and check if it exists // normalize the name if specified and check if it exists
if (!normalizePlayerName(name)) if (!normalizePlayerName(name))
@ -447,7 +447,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
snprintf(newguid, 20, "%d", guid); snprintf(newguid, 20, "%d", guid);
snprintf(chraccount, 20, "%d", account); snprintf(chraccount, 20, "%d", account);
snprintf(newpetid, 20, "%d", objmgr.GeneratePetNumber()); snprintf(newpetid, 20, "%d", sObjectMgr.GeneratePetNumber());
snprintf(lastpetid, 20, "%s", ""); snprintf(lastpetid, 20, "%s", "");
std::map<uint32,uint32> items; std::map<uint32,uint32> items;
@ -533,7 +533,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
if(!changetoknth(vals, OBJECT_FIELD_GUID+1, newguid)) if(!changetoknth(vals, OBJECT_FIELD_GUID+1, newguid))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
for(uint16 field = PLAYER_FIELD_INV_SLOT_HEAD; field < PLAYER_FARSIGHT; field++) for(uint16 field = PLAYER_FIELD_INV_SLOT_HEAD; field < PLAYER_FARSIGHT; field++)
if(!changetokGuid(vals, field+1, items, objmgr.m_hiItemGuid, true)) if(!changetokGuid(vals, field+1, items, sObjectMgr.m_hiItemGuid, true))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
if(!changenth(line, 3, vals.c_str())) if(!changenth(line, 3, vals.c_str()))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
@ -563,25 +563,25 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
// bag, item // bag, item
if(!changeGuid(line, 2, items, objmgr.m_hiItemGuid, true)) if(!changeGuid(line, 2, items, sObjectMgr.m_hiItemGuid, true))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
if(!changeGuid(line, 4, items, objmgr.m_hiItemGuid)) if(!changeGuid(line, 4, items, sObjectMgr.m_hiItemGuid))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
break; break;
} }
case DTT_ITEM: // item_instance t. case DTT_ITEM: // item_instance t.
{ {
// item, owner, data field:item, owner guid // item, owner, data field:item, owner guid
if(!changeGuid(line, 1, items, objmgr.m_hiItemGuid)) if(!changeGuid(line, 1, items, sObjectMgr.m_hiItemGuid))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
if(!changenth(line, 2, newguid)) if(!changenth(line, 2, newguid))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
std::string vals = getnth(line,3); std::string vals = getnth(line,3);
if(!changetokGuid(vals, OBJECT_FIELD_GUID+1, items, objmgr.m_hiItemGuid)) if(!changetokGuid(vals, OBJECT_FIELD_GUID+1, items, sObjectMgr.m_hiItemGuid))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
if(!changetoknth(vals, ITEM_FIELD_OWNER+1, newguid)) if(!changetoknth(vals, ITEM_FIELD_OWNER+1, newguid))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
if(!changetokGuid(vals, ITEM_FIELD_ITEM_TEXT_ID+1, itemTexts, objmgr.m_ItemTextId,true)) if(!changetokGuid(vals, ITEM_FIELD_ITEM_TEXT_ID+1, itemTexts, sObjectMgr.m_ItemTextId,true))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
if(!changenth(line, 3, vals.c_str())) if(!changenth(line, 3, vals.c_str()))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
@ -592,7 +592,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
// guid,item_guid, // guid,item_guid,
if(!changenth(line, 1, newguid)) if(!changenth(line, 1, newguid))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
if(!changeGuid(line, 2, items, objmgr.m_hiItemGuid)) if(!changeGuid(line, 2, items, sObjectMgr.m_hiItemGuid))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
break; break;
} }
@ -603,7 +603,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
if(strlen(lastpetid)==0) snprintf(lastpetid, 20, "%s", currpetid); if(strlen(lastpetid)==0) snprintf(lastpetid, 20, "%s", currpetid);
if(strcmp(lastpetid,currpetid)!=0) if(strcmp(lastpetid,currpetid)!=0)
{ {
snprintf(newpetid, 20, "%d", objmgr.GeneratePetNumber()); snprintf(newpetid, 20, "%d", sObjectMgr.GeneratePetNumber());
snprintf(lastpetid, 20, "%s", currpetid); snprintf(lastpetid, 20, "%s", currpetid);
} }
@ -641,20 +641,20 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
case DTT_MAIL: // mail case DTT_MAIL: // mail
{ {
// id,messageType,stationery,mailtemplate,sender,receiver,subject,itemText // id,messageType,stationery,mailtemplate,sender,receiver,subject,itemText
if(!changeGuid(line, 1, mails, objmgr.m_mailid)) if(!changeGuid(line, 1, mails, sObjectMgr.m_mailid))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
if(!changenth(line, 6, newguid)) if(!changenth(line, 6, newguid))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
if(!changeGuid(line, 8, itemTexts, objmgr.m_ItemTextId)) if(!changeGuid(line, 8, itemTexts, sObjectMgr.m_ItemTextId))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
break; break;
} }
case DTT_MAIL_ITEM: // mail_items case DTT_MAIL_ITEM: // mail_items
{ {
// mail_id,item_guid,item_template,receiver // mail_id,item_guid,item_template,receiver
if(!changeGuid(line, 1, mails, objmgr.m_mailid)) if(!changeGuid(line, 1, mails, sObjectMgr.m_mailid))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
if(!changeGuid(line, 2, items, objmgr.m_hiItemGuid)) if(!changeGuid(line, 2, items, sObjectMgr.m_hiItemGuid))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
if(!changenth(line, 4, newguid)) if(!changenth(line, 4, newguid))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
@ -663,13 +663,13 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
case DTT_ITEM_TEXT: // item_text case DTT_ITEM_TEXT: // item_text
{ {
// id // id
if(!changeGuid(line, 1, itemTexts, objmgr.m_ItemTextId)) if(!changeGuid(line, 1, itemTexts, sObjectMgr.m_ItemTextId))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
// add it to cache // add it to cache
uint32 id= atoi(getnth(line,1).c_str()); uint32 id= atoi(getnth(line,1).c_str());
std::string text = getnth(line,2); std::string text = getnth(line,2);
objmgr.AddItemText(id,text); sObjectMgr.AddItemText(id,text);
break; break;
} }
default: default:
@ -683,12 +683,12 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
CharacterDatabase.CommitTransaction(); CharacterDatabase.CommitTransaction();
objmgr.m_hiItemGuid += items.size(); sObjectMgr.m_hiItemGuid += items.size();
objmgr.m_mailid += mails.size(); sObjectMgr.m_mailid += mails.size();
objmgr.m_ItemTextId += itemTexts.size(); sObjectMgr.m_ItemTextId += itemTexts.size();
if(incHighest) if(incHighest)
++objmgr.m_hiCharGuid; ++sObjectMgr.m_hiCharGuid;
fclose(fin); fclose(fin);

View file

@ -143,9 +143,9 @@ void PoolGroup<T>::DespawnObject(uint32 guid)
template<> template<>
void PoolGroup<Creature>::Despawn1Object(uint32 guid) void PoolGroup<Creature>::Despawn1Object(uint32 guid)
{ {
if (CreatureData const* data = objmgr.GetCreatureData(guid)) if (CreatureData const* data = sObjectMgr.GetCreatureData(guid))
{ {
objmgr.RemoveCreatureFromGrid(guid, data); sObjectMgr.RemoveCreatureFromGrid(guid, data);
if (Creature* pCreature = ObjectAccessor::GetCreatureInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT))) if (Creature* pCreature = ObjectAccessor::GetCreatureInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT)))
pCreature->AddObjectToRemoveList(); pCreature->AddObjectToRemoveList();
@ -156,9 +156,9 @@ void PoolGroup<Creature>::Despawn1Object(uint32 guid)
template<> template<>
void PoolGroup<GameObject>::Despawn1Object(uint32 guid) void PoolGroup<GameObject>::Despawn1Object(uint32 guid)
{ {
if (GameObjectData const* data = objmgr.GetGOData(guid)) if (GameObjectData const* data = sObjectMgr.GetGOData(guid))
{ {
objmgr.RemoveGameobjectFromGrid(guid, data); sObjectMgr.RemoveGameobjectFromGrid(guid, data);
if (GameObject* pGameobject = ObjectAccessor::GetGameObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_GAMEOBJECT))) if (GameObject* pGameobject = ObjectAccessor::GetGameObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_GAMEOBJECT)))
pGameobject->AddObjectToRemoveList(); pGameobject->AddObjectToRemoveList();
@ -169,7 +169,7 @@ void PoolGroup<GameObject>::Despawn1Object(uint32 guid)
template<> template<>
void PoolGroup<Pool>::Despawn1Object(uint32 child_pool_id) void PoolGroup<Pool>::Despawn1Object(uint32 child_pool_id)
{ {
poolhandler.DespawnPool(child_pool_id); sPoolMgr.DespawnPool(child_pool_id);
} }
// Method for a pool only to remove any found record causing a circular dependency loop // Method for a pool only to remove any found record causing a circular dependency loop
@ -243,12 +243,12 @@ void PoolGroup<T>::SpawnObject(uint32 limit, uint32 triggerFrom)
template <> template <>
bool PoolGroup<Creature>::Spawn1Object(uint32 guid) bool PoolGroup<Creature>::Spawn1Object(uint32 guid)
{ {
if (CreatureData const* data = objmgr.GetCreatureData(guid)) if (CreatureData const* data = sObjectMgr.GetCreatureData(guid))
{ {
objmgr.AddCreatureToGrid(guid, data); sObjectMgr.AddCreatureToGrid(guid, data);
// Spawn if necessary (loaded grids only) // Spawn if necessary (loaded grids only)
Map* map = const_cast<Map*>(mapmgr.CreateBaseMap(data->mapid)); Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(data->mapid));
// We use spawn coords to spawn // We use spawn coords to spawn
if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY))
{ {
@ -271,12 +271,12 @@ bool PoolGroup<Creature>::Spawn1Object(uint32 guid)
template <> template <>
bool PoolGroup<GameObject>::Spawn1Object(uint32 guid) bool PoolGroup<GameObject>::Spawn1Object(uint32 guid)
{ {
if (GameObjectData const* data = objmgr.GetGOData(guid)) if (GameObjectData const* data = sObjectMgr.GetGOData(guid))
{ {
objmgr.AddGameobjectToGrid(guid, data); sObjectMgr.AddGameobjectToGrid(guid, data);
// Spawn if necessary (loaded grids only) // Spawn if necessary (loaded grids only)
// this base map checked as non-instanced and then only existed // this base map checked as non-instanced and then only existed
Map* map = const_cast<Map*>(mapmgr.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 // We use current coords to unspawn, not spawn coords since creature can have changed grid
if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY))
{ {
@ -302,9 +302,9 @@ bool PoolGroup<GameObject>::Spawn1Object(uint32 guid)
template <> template <>
bool PoolGroup<Pool>::Spawn1Object(uint32 child_pool_id) bool PoolGroup<Pool>::Spawn1Object(uint32 child_pool_id)
{ {
poolhandler.SpawnPool(child_pool_id, 0, 0); sPoolMgr.SpawnPool(child_pool_id, 0, 0);
poolhandler.SpawnPool(child_pool_id, 0, TYPEID_GAMEOBJECT); sPoolMgr.SpawnPool(child_pool_id, 0, TYPEID_GAMEOBJECT);
poolhandler.SpawnPool(child_pool_id, 0, TYPEID_UNIT); sPoolMgr.SpawnPool(child_pool_id, 0, TYPEID_UNIT);
return true; return true;
} }
@ -312,7 +312,7 @@ bool PoolGroup<Pool>::Spawn1Object(uint32 child_pool_id)
template <> template <>
bool PoolGroup<Creature>::ReSpawn1Object(uint32 guid) bool PoolGroup<Creature>::ReSpawn1Object(uint32 guid)
{ {
if (CreatureData const* data = objmgr.GetCreatureData(guid)) if (CreatureData const* data = sObjectMgr.GetCreatureData(guid))
{ {
if (Creature* pCreature = ObjectAccessor::GetCreatureInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT))) if (Creature* pCreature = ObjectAccessor::GetCreatureInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT)))
pCreature->GetMap()->Add(pCreature); pCreature->GetMap()->Add(pCreature);
@ -325,7 +325,7 @@ bool PoolGroup<Creature>::ReSpawn1Object(uint32 guid)
template <> template <>
bool PoolGroup<GameObject>::ReSpawn1Object(uint32 guid) bool PoolGroup<GameObject>::ReSpawn1Object(uint32 guid)
{ {
if (GameObjectData const* data = objmgr.GetGOData(guid)) if (GameObjectData const* data = sObjectMgr.GetGOData(guid))
{ {
if (GameObject* pGameobject = ObjectAccessor::GetGameObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_GAMEOBJECT))) if (GameObject* pGameobject = ObjectAccessor::GetGameObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_GAMEOBJECT)))
pGameobject->GetMap()->Add(pGameobject); pGameobject->GetMap()->Add(pGameobject);
@ -428,7 +428,7 @@ void PoolManager::LoadFromDB()
uint16 pool_id = fields[1].GetUInt16(); uint16 pool_id = fields[1].GetUInt16();
float chance = fields[2].GetFloat(); float chance = fields[2].GetFloat();
CreatureData const* data = objmgr.GetCreatureData(guid); CreatureData const* data = sObjectMgr.GetCreatureData(guid);
if (!data) if (!data)
{ {
sLog.outErrorDb("`pool_creature` has a non existing creature spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id ); sLog.outErrorDb("`pool_creature` has a non existing creature spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id );
@ -489,7 +489,7 @@ void PoolManager::LoadFromDB()
uint16 pool_id = fields[1].GetUInt16(); uint16 pool_id = fields[1].GetUInt16();
float chance = fields[2].GetFloat(); float chance = fields[2].GetFloat();
GameObjectData const* data = objmgr.GetGOData(guid); GameObjectData const* data = sObjectMgr.GetGOData(guid);
if (!data) if (!data)
{ {
sLog.outErrorDb("`pool_gameobject` has a non existing gameobject spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id ); sLog.outErrorDb("`pool_gameobject` has a non existing gameobject spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id );

View file

@ -99,5 +99,5 @@ class PoolManager
}; };
#define poolhandler MaNGOS::Singleton<PoolManager>::Instance() #define sPoolMgr MaNGOS::Singleton<PoolManager>::Instance()
#endif #endif

View file

@ -129,7 +129,7 @@ void WorldSession::HandleNameQueryOpcode( WorldPacket & recv_data )
recv_data >> guid; recv_data >> guid;
Player *pChar = objmgr.GetPlayer(guid); Player *pChar = sObjectMgr.GetPlayer(guid);
if (pChar) if (pChar)
SendNameQueryOpcode(pChar); SendNameQueryOpcode(pChar);
@ -164,7 +164,7 @@ void WorldSession::HandleCreatureQueryOpcode( WorldPacket & recv_data )
int loc_idx = GetSessionDbLocaleIndex(); int loc_idx = GetSessionDbLocaleIndex();
if (loc_idx >= 0) if (loc_idx >= 0)
{ {
CreatureLocale const *cl = objmgr.GetCreatureLocale(entry); CreatureLocale const *cl = sObjectMgr.GetCreatureLocale(entry);
if (cl) if (cl)
{ {
if (cl->Name.size() > size_t(loc_idx) && !cl->Name[loc_idx].empty()) if (cl->Name.size() > size_t(loc_idx) && !cl->Name[loc_idx].empty())
@ -233,7 +233,7 @@ void WorldSession::HandleGameObjectQueryOpcode( WorldPacket & recv_data )
int loc_idx = GetSessionDbLocaleIndex(); int loc_idx = GetSessionDbLocaleIndex();
if (loc_idx >= 0) if (loc_idx >= 0)
{ {
GameObjectLocale const *gl = objmgr.GetGameObjectLocale(entryID); GameObjectLocale const *gl = sObjectMgr.GetGameObjectLocale(entryID);
if (gl) if (gl)
{ {
if (gl->Name.size() > size_t(loc_idx) && !gl->Name[loc_idx].empty()) if (gl->Name.size() > size_t(loc_idx) && !gl->Name[loc_idx].empty())
@ -299,7 +299,7 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/)
if(corpseMapEntry->IsDungeon() && corpseMapEntry->entrance_map >= 0) if(corpseMapEntry->IsDungeon() && corpseMapEntry->entrance_map >= 0)
{ {
// if corpse map have entrance // if corpse map have entrance
if(Map const* entranceMap = mapmgr.CreateBaseMap(corpseMapEntry->entrance_map)) if(Map const* entranceMap = sMapMgr.CreateBaseMap(corpseMapEntry->entrance_map))
{ {
mapid = corpseMapEntry->entrance_map; mapid = corpseMapEntry->entrance_map;
x = corpseMapEntry->entrance_x; x = corpseMapEntry->entrance_x;
@ -332,7 +332,7 @@ void WorldSession::HandleNpcTextQueryOpcode( WorldPacket & recv_data )
recv_data >> guid; recv_data >> guid;
_player->SetTargetGUID(guid); _player->SetTargetGUID(guid);
GossipText const* pGossip = objmgr.GetGossipText(textID); GossipText const* pGossip = sObjectMgr.GetGossipText(textID);
WorldPacket data( SMSG_NPC_TEXT_UPDATE, 100 ); // guess size WorldPacket data( SMSG_NPC_TEXT_UPDATE, 100 ); // guess size
data << textID; data << textID;
@ -365,7 +365,7 @@ void WorldSession::HandleNpcTextQueryOpcode( WorldPacket & recv_data )
int loc_idx = GetSessionDbLocaleIndex(); int loc_idx = GetSessionDbLocaleIndex();
if (loc_idx >= 0) if (loc_idx >= 0)
{ {
NpcTextLocale const *nl = objmgr.GetNpcTextLocale(textID); NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textID);
if (nl) if (nl)
{ {
for (int i = 0; i < 8; ++i) for (int i = 0; i < 8; ++i)
@ -436,7 +436,7 @@ void WorldSession::HandlePageTextQueryOpcode( WorldPacket & recv_data )
int loc_idx = GetSessionDbLocaleIndex(); int loc_idx = GetSessionDbLocaleIndex();
if (loc_idx >= 0) if (loc_idx >= 0)
{ {
PageTextLocale const *pl = objmgr.GetPageTextLocale(pageID); PageTextLocale const *pl = sObjectMgr.GetPageTextLocale(pageID);
if (pl) if (pl)
{ {
if (pl->Text.size() > size_t(loc_idx) && !pl->Text[loc_idx].empty()) if (pl->Text.size() > size_t(loc_idx) && !pl->Text[loc_idx].empty())

View file

@ -129,7 +129,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data )
return; return;
} }
Quest const* qInfo = objmgr.GetQuestTemplate(quest); Quest const* qInfo = sObjectMgr.GetQuestTemplate(quest);
if ( qInfo ) if ( qInfo )
{ {
// prevent cheating // prevent cheating
@ -239,7 +239,7 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode( WorldPacket & recv_data )
return; return;
} }
Quest const* pQuest = objmgr.GetQuestTemplate(quest); Quest const* pQuest = sObjectMgr.GetQuestTemplate(quest);
if ( pQuest ) if ( pQuest )
{ {
_player->PlayerTalkClass->SendQuestGiverQuestDetails(pQuest, pObject->GetGUID(), true); _player->PlayerTalkClass->SendQuestGiverQuestDetails(pQuest, pObject->GetGUID(), true);
@ -252,7 +252,7 @@ void WorldSession::HandleQuestQueryOpcode( WorldPacket & recv_data )
recv_data >> quest; recv_data >> quest;
sLog.outDebug( "WORLD: Received CMSG_QUEST_QUERY quest = %u",quest ); sLog.outDebug( "WORLD: Received CMSG_QUEST_QUERY quest = %u",quest );
Quest const *pQuest = objmgr.GetQuestTemplate(quest); Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest);
if ( pQuest ) if ( pQuest )
{ {
_player->PlayerTalkClass->SendQuestQueryResponse( pQuest ); _player->PlayerTalkClass->SendQuestQueryResponse( pQuest );
@ -283,7 +283,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode( WorldPacket & recv_data )
if(!pObject->hasInvolvedQuest(quest)) if(!pObject->hasInvolvedQuest(quest))
return; return;
Quest const *pQuest = objmgr.GetQuestTemplate(quest); Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest);
if( pQuest ) if( pQuest )
{ {
if( _player->CanRewardQuest( pQuest, reward, true ) ) if( _player->CanRewardQuest( pQuest, reward, true ) )
@ -336,7 +336,7 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode( WorldPacket & recv_data
if( _player->GetQuestStatus( quest ) != QUEST_STATUS_COMPLETE ) if( _player->GetQuestStatus( quest ) != QUEST_STATUS_COMPLETE )
return; return;
if(Quest const *pQuest = objmgr.GetQuestTemplate(quest)) if(Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest))
_player->PlayerTalkClass->SendQuestGiverOfferReward( pQuest, guid, true ); _player->PlayerTalkClass->SendQuestGiverOfferReward( pQuest, guid, true );
} }
@ -374,7 +374,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data)
if(!_player->TakeQuestSourceItem( quest, true )) if(!_player->TakeQuestSourceItem( quest, true ))
return; // can't un-equip some items, reject quest cancel return; // can't un-equip some items, reject quest cancel
if (const Quest *pQuest = objmgr.GetQuestTemplate(quest)) if (const Quest *pQuest = sObjectMgr.GetQuestTemplate(quest))
{ {
if (pQuest->HasFlag(QUEST_MANGOS_FLAGS_TIMED)) if (pQuest->HasFlag(QUEST_MANGOS_FLAGS_TIMED))
_player->RemoveTimedQuest(quest); _player->RemoveTimedQuest(quest);
@ -396,7 +396,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data)
sLog.outDebug("WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = %u", quest); sLog.outDebug("WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = %u", quest);
if (const Quest* pQuest = objmgr.GetQuestTemplate(quest)) if (const Quest* pQuest = sObjectMgr.GetQuestTemplate(quest))
{ {
if (!pQuest->HasFlag(QUEST_FLAGS_PARTY_ACCEPT)) if (!pQuest->HasFlag(QUEST_FLAGS_PARTY_ACCEPT))
return; return;
@ -435,7 +435,7 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recv_data)
sLog.outDebug( "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u",uint32(GUID_LOPART(guid)),quest ); sLog.outDebug( "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u",uint32(GUID_LOPART(guid)),quest );
Quest const *pQuest = objmgr.GetQuestTemplate(quest); Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest);
if( pQuest ) if( pQuest )
{ {
if( _player->GetQuestStatus( quest ) != QUEST_STATUS_COMPLETE ) if( _player->GetQuestStatus( quest ) != QUEST_STATUS_COMPLETE )
@ -467,7 +467,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
sLog.outDebug("WORLD: Received CMSG_PUSHQUESTTOPARTY quest = %u", questId); sLog.outDebug("WORLD: Received CMSG_PUSHQUESTTOPARTY quest = %u", questId);
if (Quest const *pQuest = objmgr.GetQuestTemplate(questId)) if (Quest const *pQuest = sObjectMgr.GetQuestTemplate(questId))
{ {
if (Group* pGroup = _player->GetGroup()) if (Group* pGroup = _player->GetGroup())
{ {
@ -550,14 +550,14 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32
{ {
case TYPEID_GAMEOBJECT: case TYPEID_GAMEOBJECT:
{ {
qir = &objmgr.mGOQuestInvolvedRelations; qir = &sObjectMgr.mGOQuestInvolvedRelations;
qr = &objmgr.mGOQuestRelations; qr = &sObjectMgr.mGOQuestRelations;
break; break;
} }
case TYPEID_UNIT: case TYPEID_UNIT:
{ {
qir = &objmgr.mCreatureQuestInvolvedRelations; qir = &sObjectMgr.mCreatureQuestInvolvedRelations;
qr = &objmgr.mCreatureQuestRelations; qr = &sObjectMgr.mCreatureQuestRelations;
break; break;
} }
default: default:
@ -570,7 +570,7 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32
{ {
uint32 result2 = 0; uint32 result2 = 0;
uint32 quest_id = i->second; uint32 quest_id = i->second;
Quest const *pQuest = objmgr.GetQuestTemplate(quest_id); Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest_id);
if ( !pQuest ) continue; if ( !pQuest ) continue;
QuestStatus status = pPlayer->GetQuestStatus( quest_id ); QuestStatus status = pPlayer->GetQuestStatus( quest_id );
@ -593,7 +593,7 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32
{ {
uint32 result2 = 0; uint32 result2 = 0;
uint32 quest_id = i->second; uint32 quest_id = i->second;
Quest const *pQuest = objmgr.GetQuestTemplate(quest_id); Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest_id);
if ( !pQuest ) if ( !pQuest )
continue; continue;

View file

@ -94,7 +94,7 @@ bool LoadScriptingModule(char const* libName)
UnloadScriptingModule(); UnloadScriptingModule();
Script=testScript; Script=testScript;
Script->ScriptsInit(objmgr.GetScriptNames()); Script->ScriptsInit(sObjectMgr.GetScriptNames());
sWorld.SetScriptsVersion(Script->ScriptsVersion()); sWorld.SetScriptsVersion(Script->ScriptsVersion());

View file

@ -116,7 +116,7 @@ void LoadSkillDiscoveryTable()
} }
else if (reqSkillOrSpell == 0) // skill case else if (reqSkillOrSpell == 0) // skill case
{ {
SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(spellId); SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spellId);
if (bounds.first==bounds.second) if (bounds.first==bounds.second)
{ {
@ -167,7 +167,7 @@ uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player)
if (tab == SkillDiscoveryStore.end()) if (tab == SkillDiscoveryStore.end())
return 0; return 0;
SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(spellId); SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spellId);
uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->skillId) : 0; uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->skillId) : 0;
float full_chance = 0; float full_chance = 0;

View file

@ -120,7 +120,7 @@ void PlayerSocial::SetFriendNote(uint32 friend_guid, std::string note)
void PlayerSocial::SendSocialList() void PlayerSocial::SendSocialList()
{ {
Player *plr = objmgr.GetPlayer(GetPlayerGUID()); Player *plr = sObjectMgr.GetPlayer(GetPlayerGUID());
if(!plr) if(!plr)
return; return;

View file

@ -1991,7 +1991,7 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap)
} }
case TARGET_TABLE_X_Y_Z_COORDINATES: case TARGET_TABLE_X_Y_Z_COORDINATES:
{ {
SpellTargetPosition const* st = spellmgr.GetSpellTargetPosition(m_spellInfo->Id); SpellTargetPosition const* st = sSpellMgr.GetSpellTargetPosition(m_spellInfo->Id);
if(st) if(st)
{ {
if (st->target_mapId == m_caster->GetMapId()) if (st->target_mapId == m_caster->GetMapId())
@ -2187,7 +2187,7 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap)
case SPELL_EFFECT_SUMMON_PLAYER: case SPELL_EFFECT_SUMMON_PLAYER:
if (m_caster->GetTypeId()==TYPEID_PLAYER && ((Player*)m_caster)->GetSelection()) if (m_caster->GetTypeId()==TYPEID_PLAYER && ((Player*)m_caster)->GetSelection())
{ {
Player* target = objmgr.GetPlayer(((Player*)m_caster)->GetSelection()); Player* target = sObjectMgr.GetPlayer(((Player*)m_caster)->GetSelection());
if(target) if(target)
TagUnitMap.push_back(target); TagUnitMap.push_back(target);
} }
@ -3765,14 +3765,14 @@ void Spell::HandleThreatSpells(uint32 spellId)
if(!m_targets.getUnitTarget()->CanHaveThreatList()) if(!m_targets.getUnitTarget()->CanHaveThreatList())
return; return;
uint16 threat = spellmgr.GetSpellThreat(spellId); uint16 threat = sSpellMgr.GetSpellThreat(spellId);
if(!threat) if(!threat)
return; return;
m_targets.getUnitTarget()->AddThreat(m_caster, float(threat), false, GetSpellSchoolMask(m_spellInfo), m_spellInfo); m_targets.getUnitTarget()->AddThreat(m_caster, float(threat), false, GetSpellSchoolMask(m_spellInfo), m_spellInfo);
DEBUG_LOG("Spell %u, rank %u, added an additional %i threat", spellId, spellmgr.GetSpellRank(spellId), threat); DEBUG_LOG("Spell %u, rank %u, added an additional %i threat", spellId, sSpellMgr.GetSpellRank(spellId), threat);
} }
void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTarget,uint32 i, float DamageMultiplier) void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTarget,uint32 i, float DamageMultiplier)
@ -4093,7 +4093,7 @@ SpellCastResult Spell::CheckCast(bool strict)
uint32 zone, area; uint32 zone, area;
m_caster->GetZoneAndAreaId(zone, area); m_caster->GetZoneAndAreaId(zone, area);
SpellCastResult locRes= spellmgr.GetSpellAllowedInLocationError(m_spellInfo,m_caster->GetMapId(),zone,area, SpellCastResult locRes= sSpellMgr.GetSpellAllowedInLocationError(m_spellInfo,m_caster->GetMapId(),zone,area,
m_caster->GetCharmerOrOwnerPlayerOrPlayerItself()); m_caster->GetCharmerOrOwnerPlayerOrPlayerItself());
if (locRes != SPELL_CAST_OK) if (locRes != SPELL_CAST_OK)
return locRes; return locRes;
@ -4128,7 +4128,7 @@ SpellCastResult Spell::CheckCast(bool strict)
m_spellInfo->EffectImplicitTargetA[j] == TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT) m_spellInfo->EffectImplicitTargetA[j] == TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT)
{ {
SpellScriptTargetBounds bounds = spellmgr.GetSpellScriptTargetBounds(m_spellInfo->Id); SpellScriptTargetBounds bounds = sSpellMgr.GetSpellScriptTargetBounds(m_spellInfo->Id);
if(bounds.first==bounds.second) if(bounds.first==bounds.second)
sLog.outErrorDb("Spell (ID: %u) has effect EffectImplicitTargetA/EffectImplicitTargetB = TARGET_SCRIPT or TARGET_SCRIPT_COORDINATES, but does not have record in `spell_script_target`",m_spellInfo->Id); sLog.outErrorDb("Spell (ID: %u) has effect EffectImplicitTargetA/EffectImplicitTargetB = TARGET_SCRIPT or TARGET_SCRIPT_COORDINATES, but does not have record in `spell_script_target`",m_spellInfo->Id);
@ -4609,7 +4609,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if(!((Player*)m_caster)->GetSelection()) if(!((Player*)m_caster)->GetSelection())
return SPELL_FAILED_BAD_TARGETS; return SPELL_FAILED_BAD_TARGETS;
Player* target = objmgr.GetPlayer(((Player*)m_caster)->GetSelection()); Player* target = sObjectMgr.GetPlayer(((Player*)m_caster)->GetSelection());
if( !target || ((Player*)m_caster) == target || !target->IsInSameRaidWith((Player*)m_caster) ) if( !target || ((Player*)m_caster) == target || !target->IsInSameRaidWith((Player*)m_caster) )
return SPELL_FAILED_BAD_TARGETS; return SPELL_FAILED_BAD_TARGETS;
@ -5690,7 +5690,7 @@ void Spell::UpdatePointers()
bool Spell::IsAffectedByAura(Aura *aura) bool Spell::IsAffectedByAura(Aura *aura)
{ {
return spellmgr.IsAffectedByMod(m_spellInfo, aura->getAuraSpellMod()); return sSpellMgr.IsAffectedByMod(m_spellInfo, aura->getAuraSpellMod());
} }
bool Spell::CheckTargetCreatureType(Unit* target) const bool Spell::CheckTargetCreatureType(Unit* target) const

View file

@ -828,7 +828,7 @@ void AreaAura::Update(uint32 diff)
if(!apply) if(!apply)
continue; continue;
if(SpellEntry const *actualSpellInfo = spellmgr.SelectAuraRankForPlayerLevel(GetSpellProto(), (*tIter)->getLevel())) if(SpellEntry const *actualSpellInfo = sSpellMgr.SelectAuraRankForPlayerLevel(GetSpellProto(), (*tIter)->getLevel()))
{ {
int32 actualBasePoints = m_currentBasePoints; int32 actualBasePoints = m_currentBasePoints;
// recalculate basepoints for lower rank (all AreaAura spell not use custom basepoints?) // recalculate basepoints for lower rank (all AreaAura spell not use custom basepoints?)
@ -2682,7 +2682,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
} }
// pet auras // pet auras
if(PetAura const* petSpell = spellmgr.GetPetAura(GetId(), m_effIndex)) if(PetAura const* petSpell = sSpellMgr.GetPetAura(GetId(), m_effIndex))
{ {
if(apply) if(apply)
m_target->AddPetAura(petSpell); m_target->AddPetAura(petSpell);
@ -2693,7 +2693,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
if(GetEffIndex()==0 && m_target->GetTypeId()==TYPEID_PLAYER) if(GetEffIndex()==0 && m_target->GetTypeId()==TYPEID_PLAYER)
{ {
SpellAreaForAreaMapBounds saBounds = spellmgr.GetSpellAreaForAuraMapBounds(GetId()); SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAuraMapBounds(GetId());
if(saBounds.first != saBounds.second) if(saBounds.first != saBounds.second)
{ {
uint32 zone, area; uint32 zone, area;
@ -2734,8 +2734,8 @@ void Aura::HandleAuraMounted(bool apply, bool Real)
if (m_target->GetTypeId()==TYPEID_PLAYER) if (m_target->GetTypeId()==TYPEID_PLAYER)
team = ((Player*)m_target)->GetTeam(); team = ((Player*)m_target)->GetTeam();
uint32 display_id = objmgr.ChooseDisplayId(team,ci); uint32 display_id = sObjectMgr.ChooseDisplayId(team,ci);
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id); CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
if (minfo) if (minfo)
display_id = minfo->modelid; display_id = minfo->modelid;
@ -3206,8 +3206,8 @@ void Aura::HandleAuraTransform(bool apply, bool Real)
if (m_target->GetTypeId() == TYPEID_PLAYER) if (m_target->GetTypeId() == TYPEID_PLAYER)
team = ((Player*)m_target)->GetTeam(); team = ((Player*)m_target)->GetTeam();
uint32 display_id = objmgr.ChooseDisplayId(team, ci); uint32 display_id = sObjectMgr.ChooseDisplayId(team, ci);
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id); CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
if (minfo) if (minfo)
display_id = minfo->modelid; display_id = minfo->modelid;
@ -3522,7 +3522,7 @@ void Aura::HandleModCharm(bool apply, bool Real)
} }
//just to enable stat window //just to enable stat window
charmInfo->SetPetNumber(objmgr.GeneratePetNumber(), true); charmInfo->SetPetNumber(sObjectMgr.GeneratePetNumber(), true);
//if charmed two demons the same session, the 2nd gets the 1st one's name //if charmed two demons the same session, the 2nd gets the 1st one's name
m_target->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, time(NULL)); m_target->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, time(NULL));
} }
@ -3669,7 +3669,7 @@ void Aura::HandleAuraModStun(bool apply, bool Real)
if(GetId() == 39837) if(GetId() == 39837)
{ {
GameObject* pObj = new GameObject; GameObject* pObj = new GameObject;
if(pObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 185584, m_target->GetMap(), m_target->GetPhaseMask(), if(pObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 185584, m_target->GetMap(), m_target->GetPhaseMask(),
m_target->GetPositionX(), m_target->GetPositionY(), m_target->GetPositionZ(), m_target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY)) m_target->GetPositionX(), m_target->GetPositionY(), m_target->GetPositionZ(), m_target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
{ {
pObj->SetRespawnTime(GetAuraDuration()/IN_MILISECONDS); pObj->SetRespawnTime(GetAuraDuration()/IN_MILISECONDS);
@ -6231,7 +6231,7 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real)
case 0: case 0:
{ {
// energize caster // energize caster
int32 manapct1000 = 5 * ((*itr)->GetModifier()->m_amount + spellmgr.GetSpellRank(vSpell->Id)); int32 manapct1000 = 5 * ((*itr)->GetModifier()->m_amount + sSpellMgr.GetSpellRank(vSpell->Id));
int32 basepoints0 = caster->GetMaxPower(POWER_MANA) * manapct1000 / 1000; int32 basepoints0 = caster->GetMaxPower(POWER_MANA) * manapct1000 / 1000;
caster->CastCustomSpell(caster, 47755, &basepoints0, NULL, NULL, true); caster->CastCustomSpell(caster, 47755, &basepoints0, NULL, NULL, true);
break; break;
@ -7355,7 +7355,7 @@ void Aura::HandlePhase(bool apply, bool Real)
if(GetEffIndex()==0) if(GetEffIndex()==0)
{ {
SpellAreaForAreaMapBounds saBounds = spellmgr.GetSpellAreaForAuraMapBounds(GetId()); SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAuraMapBounds(GetId());
if(saBounds.first != saBounds.second) if(saBounds.first != saBounds.second)
{ {
uint32 zone, area; uint32 zone, area;

View file

@ -889,7 +889,7 @@ void Spell::EffectDummy(uint32 i)
Map *map = creatureTarget->GetMap(); Map *map = creatureTarget->GetMap();
// create before death for get proper coordinates // create before death for get proper coordinates
if (!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 179644, map, m_caster->GetPhaseMask(), if (!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 179644, map, m_caster->GetPhaseMask(),
creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(), creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(),
creatureTarget->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY) ) creatureTarget->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY) )
{ {
@ -1934,7 +1934,7 @@ void Spell::EffectDummy(uint32 i)
} }
// pet auras // pet auras
if (PetAura const* petSpell = spellmgr.GetPetAura(m_spellInfo->Id, i)) if (PetAura const* petSpell = sSpellMgr.GetPetAura(m_spellInfo->Id, i))
{ {
m_caster->AddPetAura(petSpell); m_caster->AddPetAura(petSpell);
return; return;
@ -2260,7 +2260,7 @@ void Spell::EffectTeleportUnits(uint32 i)
case TARGET_AREAEFFECT_INSTANT: // in all cases first TARGET_TABLE_X_Y_Z_COORDINATES case TARGET_AREAEFFECT_INSTANT: // in all cases first TARGET_TABLE_X_Y_Z_COORDINATES
case TARGET_TABLE_X_Y_Z_COORDINATES: case TARGET_TABLE_X_Y_Z_COORDINATES:
{ {
SpellTargetPosition const* st = spellmgr.GetSpellTargetPosition(m_spellInfo->Id); SpellTargetPosition const* st = sSpellMgr.GetSpellTargetPosition(m_spellInfo->Id);
if(!st) if(!st)
{ {
sLog.outError( "Spell::EffectTeleportUnits - unknown Teleport coordinates for spell ID %u", m_spellInfo->Id ); sLog.outError( "Spell::EffectTeleportUnits - unknown Teleport coordinates for spell ID %u", m_spellInfo->Id );
@ -2953,7 +2953,7 @@ void Spell::EffectEnergize(uint32 i)
for(Unit::AuraMap::iterator itr = Auras.begin(); itr != Auras.end(); ++itr) for(Unit::AuraMap::iterator itr = Auras.begin(); itr != Auras.end(); ++itr)
{ {
uint32 spell_id = itr->second->GetId(); uint32 spell_id = itr->second->GetId();
if(uint32 mask = spellmgr.GetSpellElixirMask(spell_id)) if(uint32 mask = sSpellMgr.GetSpellElixirMask(spell_id))
elixir_mask |= mask; elixir_mask |= mask;
} }
@ -2962,7 +2962,7 @@ void Spell::EffectEnergize(uint32 i)
// get all available elixirs by mask and spell level // get all available elixirs by mask and spell level
std::vector<uint32> elixirs; std::vector<uint32> elixirs;
SpellElixirMap const& m_spellElixirs = spellmgr.GetSpellElixirMap(); SpellElixirMap const& m_spellElixirs = sSpellMgr.GetSpellElixirMap();
for(SpellElixirMap::const_iterator itr = m_spellElixirs.begin(); itr != m_spellElixirs.end(); ++itr) for(SpellElixirMap::const_iterator itr = m_spellElixirs.begin(); itr != m_spellElixirs.end(); ++itr)
{ {
if (itr->second & elixir_mask) if (itr->second & elixir_mask)
@ -3395,7 +3395,7 @@ void Spell::EffectSummon(uint32 i)
} }
Map *map = m_caster->GetMap(); Map *map = m_caster->GetMap();
uint32 pet_number = objmgr.GeneratePetNumber(); uint32 pet_number = sObjectMgr.GeneratePetNumber();
if (!spawnCreature->Create(map->GenerateLocalLowGuid(HIGHGUID_PET), map, m_caster->GetPhaseMask(), if (!spawnCreature->Create(map->GenerateLocalLowGuid(HIGHGUID_PET), map, m_caster->GetPhaseMask(),
m_spellInfo->EffectMiscValue[i], pet_number)) m_spellInfo->EffectMiscValue[i], pet_number))
{ {
@ -3810,7 +3810,7 @@ void Spell::EffectSummonGuardian(uint32 i)
Pet* spawnCreature = new Pet(GUARDIAN_PET); Pet* spawnCreature = new Pet(GUARDIAN_PET);
Map *map = m_caster->GetMap(); Map *map = m_caster->GetMap();
uint32 pet_number = objmgr.GeneratePetNumber(); uint32 pet_number = sObjectMgr.GeneratePetNumber();
if (!spawnCreature->Create(map->GenerateLocalLowGuid(HIGHGUID_PET), map,m_caster->GetPhaseMask(), if (!spawnCreature->Create(map->GenerateLocalLowGuid(HIGHGUID_PET), map,m_caster->GetPhaseMask(),
m_spellInfo->EffectMiscValue[i], pet_number)) m_spellInfo->EffectMiscValue[i], pet_number))
{ {
@ -4279,7 +4279,7 @@ void Spell::EffectSummonPet(uint32 i)
} }
Map *map = m_caster->GetMap(); Map *map = m_caster->GetMap();
uint32 pet_number = objmgr.GeneratePetNumber(); uint32 pet_number = sObjectMgr.GeneratePetNumber();
if(!NewSummon->Create(map->GenerateLocalLowGuid(HIGHGUID_PET), map, m_caster->GetPhaseMask(), if(!NewSummon->Create(map->GenerateLocalLowGuid(HIGHGUID_PET), map, m_caster->GetPhaseMask(),
petentry, pet_number)) petentry, pet_number))
{ {
@ -4354,7 +4354,7 @@ void Spell::EffectSummonPet(uint32 i)
} }
// generate new name for summon pet // generate new name for summon pet
std::string new_name=objmgr.GeneratePetName(petentry); std::string new_name=sObjectMgr.GeneratePetName(petentry);
if(!new_name.empty()) if(!new_name.empty())
NewSummon->SetName(new_name); NewSummon->SetName(new_name);
} }
@ -4798,7 +4798,7 @@ void Spell::EffectSummonObjectWild(uint32 i)
Map *map = target->GetMap(); Map *map = target->GetMap();
if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id, map, if(!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id, map,
m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY)) m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
{ {
delete pGameObj; delete pGameObj;
@ -4847,7 +4847,7 @@ void Spell::EffectSummonObjectWild(uint32 i)
if(uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry()) if(uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry())
{ {
GameObject* linkedGO = new GameObject; GameObject* linkedGO = new GameObject;
if(linkedGO->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, map, if(linkedGO->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, map,
m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY)) m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
{ {
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0); linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
@ -5613,7 +5613,7 @@ void Spell::EffectDuel(uint32 i)
uint32 gameobject_id = m_spellInfo->EffectMiscValue[i]; uint32 gameobject_id = m_spellInfo->EffectMiscValue[i];
Map *map = m_caster->GetMap(); Map *map = m_caster->GetMap();
if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id, if(!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id,
map, m_caster->GetPhaseMask(), map, m_caster->GetPhaseMask(),
m_caster->GetPositionX()+(unitTarget->GetPositionX()-m_caster->GetPositionX())/2 , m_caster->GetPositionX()+(unitTarget->GetPositionX()-m_caster->GetPositionX())/2 ,
m_caster->GetPositionY()+(unitTarget->GetPositionY()-m_caster->GetPositionY())/2 , m_caster->GetPositionY()+(unitTarget->GetPositionY()-m_caster->GetPositionY())/2 ,
@ -5798,7 +5798,7 @@ void Spell::EffectSummonTotem(uint32 i)
Totem* pTotem = new Totem; Totem* pTotem = new Totem;
if(!pTotem->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), m_caster->GetMap(), m_caster->GetPhaseMask(), if(!pTotem->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), m_caster->GetMap(), m_caster->GetPhaseMask(),
m_spellInfo->EffectMiscValue[i], team )) m_spellInfo->EffectMiscValue[i], team ))
{ {
delete pTotem; delete pTotem;
@ -6006,7 +6006,7 @@ void Spell::EffectSummonObject(uint32 i)
m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE); m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE);
Map *map = m_caster->GetMap(); Map *map = m_caster->GetMap();
if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), go_id, map, if(!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), go_id, map,
m_caster->GetPhaseMask(), x, y, z, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY)) m_caster->GetPhaseMask(), x, y, z, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
{ {
delete pGameObj; delete pGameObj;
@ -6300,7 +6300,7 @@ void Spell::EffectSummonCritter(uint32 i)
Pet* critter = new Pet(MINI_PET); Pet* critter = new Pet(MINI_PET);
Map *map = m_caster->GetMap(); Map *map = m_caster->GetMap();
uint32 pet_number = objmgr.GeneratePetNumber(); uint32 pet_number = sObjectMgr.GeneratePetNumber();
if(!critter->Create(map->GenerateLocalLowGuid(HIGHGUID_PET), map, m_caster->GetPhaseMask(), if(!critter->Create(map->GenerateLocalLowGuid(HIGHGUID_PET), map, m_caster->GetPhaseMask(),
pet_entry, pet_number)) pet_entry, pet_number))
{ {
@ -6569,7 +6569,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
GameObject* pGameObj = new GameObject; GameObject* pGameObj = new GameObject;
if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), name_id, cMap, if(!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), name_id, cMap,
m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY)) m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
{ {
delete pGameObj; delete pGameObj;
@ -6630,7 +6630,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
if(uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry()) if(uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry())
{ {
GameObject* linkedGO = new GameObject; GameObject* linkedGO = new GameObject;
if(linkedGO->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, cMap, if(linkedGO->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, cMap,
m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY)) m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
{ {
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0); linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);

View file

@ -357,7 +357,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
// auto-selection buff level base at target level (in spellInfo) // auto-selection buff level base at target level (in spellInfo)
if(targets.getUnitTarget()) if(targets.getUnitTarget())
{ {
SpellEntry const *actualSpellInfo = spellmgr.SelectAuraRankForPlayerLevel(spellInfo,targets.getUnitTarget()->getLevel()); SpellEntry const *actualSpellInfo = sSpellMgr.SelectAuraRankForPlayerLevel(spellInfo,targets.getUnitTarget()->getLevel());
// if rank not found then function return NULL but in explicit cast case original spell can be casted and later failed with appropriate error message // if rank not found then function return NULL but in explicit cast case original spell can be casted and later failed with appropriate error message
if(actualSpellInfo) if(actualSpellInfo)
@ -554,7 +554,7 @@ void WorldSession::HandleSpellClick( WorldPacket & recv_data )
if (!unit || unit->isInCombat()) // client prevent click and set different icon at combat state if (!unit || unit->isInCombat()) // client prevent click and set different icon at combat state
return; return;
SpellClickInfoMapBounds clickPair = objmgr.GetSpellClickInfoMapBounds(unit->GetEntry()); SpellClickInfoMapBounds clickPair = sObjectMgr.GetSpellClickInfoMapBounds(unit->GetEntry());
for(SpellClickInfoMap::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr) for(SpellClickInfoMap::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr)
{ {
if (itr->second.IsFitToRequirements(_player)) if (itr->second.IsFitToRequirements(_player))

View file

@ -312,7 +312,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
} }
case SPELLFAMILY_POTION: case SPELLFAMILY_POTION:
return spellmgr.GetSpellElixirSpecific(spellInfo->Id); return sSpellMgr.GetSpellElixirSpecific(spellInfo->Id);
case SPELLFAMILY_DEATHKNIGHT: case SPELLFAMILY_DEATHKNIGHT:
if (spellInfo->Category == 47) if (spellInfo->Category == 47)
@ -321,7 +321,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
} }
// elixirs can have different families, but potion most ofc. // elixirs can have different families, but potion most ofc.
if(SpellSpecific sp = spellmgr.GetSpellElixirSpecific(spellInfo->Id)) if(SpellSpecific sp = sSpellMgr.GetSpellElixirSpecific(spellInfo->Id))
return sp; return sp;
return SPELL_NORMAL; return SPELL_NORMAL;
@ -845,7 +845,7 @@ bool SpellMgr::IsAffectedByMod(SpellEntry const *spellInfo, SpellModifier *mod)
struct DoSpellProcEvent struct DoSpellProcEvent
{ {
DoSpellProcEvent(SpellProcEventEntry const& _spe) : spe(_spe) {} DoSpellProcEvent(SpellProcEventEntry const& _spe) : spe(_spe) {}
void operator() (uint32 spell_id) { spellmgr.mSpellProcEventMap[spell_id] = spe; } void operator() (uint32 spell_id) { sSpellMgr.mSpellProcEventMap[spell_id] = spe; }
SpellProcEventEntry const& spe; SpellProcEventEntry const& spe;
}; };
@ -934,7 +934,7 @@ void SpellMgr::LoadSpellProcEvents()
struct DoSpellProcItemEnchant struct DoSpellProcItemEnchant
{ {
DoSpellProcItemEnchant(float _ppm) : ppm(_ppm) {} DoSpellProcItemEnchant(float _ppm) : ppm(_ppm) {}
void operator() (uint32 spell_id) { spellmgr.mSpellProcItemEnchantMap[spell_id] = ppm; } void operator() (uint32 spell_id) { sSpellMgr.mSpellProcItemEnchantMap[spell_id] = ppm; }
float ppm; float ppm;
}; };
@ -1004,7 +1004,7 @@ void SpellMgr::LoadSpellProcItemEnchant()
struct DoSpellBonusess struct DoSpellBonusess
{ {
DoSpellBonusess(SpellBonusEntry const& _spellBonus) : spellBonus(_spellBonus) {} DoSpellBonusess(SpellBonusEntry const& _spellBonus) : spellBonus(_spellBonus) {}
void operator() (uint32 spell_id) { spellmgr.mSpellBonusMap[spell_id] = spellBonus; } void operator() (uint32 spell_id) { sSpellMgr.mSpellBonusMap[spell_id] = spellBonus; }
SpellBonusEntry const& spellBonus; SpellBonusEntry const& spellBonus;
}; };
@ -1251,7 +1251,7 @@ bool SpellMgr::canStackSpellRanks(SpellEntry const *spellInfo)
if(IsProfessionOrRidingSpell(spellInfo->Id)) if(IsProfessionOrRidingSpell(spellInfo->Id))
return false; return false;
if(spellmgr.IsSkillBonusSpell(spellInfo->Id)) if(sSpellMgr.IsSkillBonusSpell(spellInfo->Id))
return false; return false;
// All stance spells. if any better way, change it. // All stance spells. if any better way, change it.
@ -2260,8 +2260,8 @@ void SpellMgr::LoadSpellScriptTarget()
{ {
if( spellInfo->EffectImplicitTargetA[j] == TARGET_SCRIPT || spellInfo->EffectImplicitTargetA[j] != TARGET_SELF && spellInfo->EffectImplicitTargetB[j] == TARGET_SCRIPT ) if( spellInfo->EffectImplicitTargetA[j] == TARGET_SCRIPT || spellInfo->EffectImplicitTargetA[j] != TARGET_SELF && spellInfo->EffectImplicitTargetB[j] == TARGET_SCRIPT )
{ {
SpellScriptTarget::const_iterator lower = spellmgr.GetBeginSpellScriptTarget(spellInfo->Id); SpellScriptTarget::const_iterator lower = sSpellMgr.GetBeginSpellScriptTarget(spellInfo->Id);
SpellScriptTarget::const_iterator upper = spellmgr.GetEndSpellScriptTarget(spellInfo->Id); SpellScriptTarget::const_iterator upper = sSpellMgr.GetEndSpellScriptTarget(spellInfo->Id);
if(lower==upper) if(lower==upper)
{ {
sLog.outErrorDb("Spell (ID: %u) has effect EffectImplicitTargetA/EffectImplicitTargetB = %u (TARGET_SCRIPT), but does not have record in `spell_script_target`",spellInfo->Id,TARGET_SCRIPT); sLog.outErrorDb("Spell (ID: %u) has effect EffectImplicitTargetA/EffectImplicitTargetB = %u (TARGET_SCRIPT), but does not have record in `spell_script_target`",spellInfo->Id,TARGET_SCRIPT);
@ -2408,7 +2408,7 @@ bool LoadPetDefaultSpells_helper(CreatureInfo const* cInfo, PetDefaultSpellsEntr
return false; return false;
// remove duplicates with levelupSpells if any // remove duplicates with levelupSpells if any
if(PetLevelupSpellSet const *levelupSpells = cInfo->family ? spellmgr.GetPetLevelupSpellList(cInfo->family) : NULL) if(PetLevelupSpellSet const *levelupSpells = cInfo->family ? sSpellMgr.GetPetLevelupSpellList(cInfo->family) : NULL)
{ {
for(int j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j) for(int j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
{ {
@ -2680,7 +2680,7 @@ void SpellMgr::LoadSpellAreas()
continue; continue;
} }
if(spellArea.questStart && !objmgr.GetQuestTemplate(spellArea.questStart)) if(spellArea.questStart && !sObjectMgr.GetQuestTemplate(spellArea.questStart))
{ {
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell,spellArea.questStart); sLog.outErrorDb("Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell,spellArea.questStart);
continue; continue;
@ -2688,7 +2688,7 @@ void SpellMgr::LoadSpellAreas()
if(spellArea.questEnd) if(spellArea.questEnd)
{ {
if(!objmgr.GetQuestTemplate(spellArea.questEnd)) if(!sObjectMgr.GetQuestTemplate(spellArea.questEnd))
{ {
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell,spellArea.questEnd); sLog.outErrorDb("Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell,spellArea.questEnd);
continue; continue;
@ -2849,7 +2849,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
} }
// DB base check (if non empty then must fit at least single for allow) // DB base check (if non empty then must fit at least single for allow)
SpellAreaMapBounds saBounds = spellmgr.GetSpellAreaMapBounds(spellInfo->Id); SpellAreaMapBounds saBounds = sSpellMgr.GetSpellAreaMapBounds(spellInfo->Id);
if (saBounds.first != saBounds.second) if (saBounds.first != saBounds.second)
{ {
for(SpellAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) for(SpellAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)

View file

@ -1035,5 +1035,5 @@ class SpellMgr
SpellAreaForAreaMap mSpellAreaForAreaMap; SpellAreaForAreaMap mSpellAreaForAreaMap;
}; };
#define spellmgr SpellMgr::Instance() #define sSpellMgr SpellMgr::Instance()
#endif #endif

View file

@ -49,7 +49,7 @@ void WorldSession::SendTaxiStatus( uint64 guid )
return; return;
} }
uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam()); uint32 curloc = sObjectMgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
// not found nearest // not found nearest
if(curloc == 0) if(curloc == 0)
@ -94,7 +94,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes( WorldPacket & recv_data )
void WorldSession::SendTaxiMenu( Creature* unit ) void WorldSession::SendTaxiMenu( Creature* unit )
{ {
// find current node // find current node
uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam()); uint32 curloc = sObjectMgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
if ( curloc == 0 ) if ( curloc == 0 )
return; return;
@ -129,7 +129,7 @@ void WorldSession::SendDoFlight( uint32 mountDisplayId, uint32 path, uint32 path
bool WorldSession::SendLearnNewTaxiNode( Creature* unit ) bool WorldSession::SendLearnNewTaxiNode( Creature* unit )
{ {
// find current node // find current node
uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam()); uint32 curloc = sObjectMgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
if ( curloc == 0 ) if ( curloc == 0 )
return true; // `true` send to avoid WorldSession::SendTaxiMenu call with one more curlock seartch with same false result. return true; // `true` send to avoid WorldSession::SendTaxiMenu call with one more curlock seartch with same false result.
@ -231,10 +231,10 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& /*recv_data*/)
sLog.outDebug( "WORLD: Taxi has to go from %u to %u", sourcenode, destinationnode ); sLog.outDebug( "WORLD: Taxi has to go from %u to %u", sourcenode, destinationnode );
uint32 mountDisplayId = objmgr.GetTaxiMountDisplayId(sourcenode, GetPlayer()->GetTeam()); uint32 mountDisplayId = sObjectMgr.GetTaxiMountDisplayId(sourcenode, GetPlayer()->GetTeam());
uint32 path, cost; uint32 path, cost;
objmgr.GetTaxiPath( sourcenode, destinationnode, path, cost); sObjectMgr.GetTaxiPath( sourcenode, destinationnode, path, cost);
if(path && mountDisplayId) if(path && mountDisplayId)
SendDoFlight( mountDisplayId, path, 1 ); // skip start fly node SendDoFlight( mountDisplayId, path, 1 ); // skip start fly node

View file

@ -59,8 +59,8 @@ void Totem::Summon(Unit* owner)
CreatureInfo const *cinfo = GetCreatureInfo(); CreatureInfo const *cinfo = GetCreatureInfo();
if(owner->GetTypeId() == TYPEID_PLAYER && cinfo) if(owner->GetTypeId() == TYPEID_PLAYER && cinfo)
{ {
uint32 display_id = objmgr.ChooseDisplayId(((Player*)owner)->GetTeam(), cinfo); uint32 display_id = sObjectMgr.ChooseDisplayId(((Player*)owner)->GetTeam(), cinfo);
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id); CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
if (minfo) if (minfo)
display_id = minfo->modelid; display_id = minfo->modelid;
SetDisplayId(display_id); SetDisplayId(display_id);

View file

@ -102,7 +102,7 @@ void MapManager::LoadTransports()
m_TransportsByMap[*i].insert(t); m_TransportsByMap[*i].insert(t);
//If we someday decide to use the grid to track transports, here: //If we someday decide to use the grid to track transports, here:
t->SetMap(mapmgr.CreateMap(mapid, t)); t->SetMap(sMapMgr.CreateMap(mapid, t));
//t->GetMap()->Add<GameObject>((GameObject *)t); //t->GetMap()->Add<GameObject>((GameObject *)t);
++count; ++count;
@ -205,7 +205,7 @@ struct keyFrame
bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids) bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
{ {
TransportPath path; TransportPath path;
objmgr.GetTransportPathNodes(pathid, path); sObjectMgr.GetTransportPathNodes(pathid, path);
if (path.Empty()) if (path.Empty())
return false; return false;
@ -459,7 +459,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
//we need to create and save new Map object with 'newMapid' because if not done -> lead to invalid Map object reference... //we need to create and save new Map object with 'newMapid' because if not done -> lead to invalid Map object reference...
//player far teleport would try to create same instance, but we need it NOW for transport... //player far teleport would try to create same instance, but we need it NOW for transport...
//correct me if I'm wrong O.o //correct me if I'm wrong O.o
Map * newMap = mapmgr.CreateMap(newMapid, this); Map * newMap = sMapMgr.CreateMap(newMapid, this);
SetMap(newMap); SetMap(newMap);
if(oldMap != newMap) if(oldMap != newMap)

View file

@ -691,7 +691,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
// the reset time is set but not added to the scheduler // the reset time is set but not added to the scheduler
// until the players leave the instance // until the players leave the instance
time_t resettime = cVictim->GetRespawnTimeEx() + 2 * HOUR; time_t resettime = cVictim->GetRespawnTimeEx() + 2 * HOUR;
if(InstanceSave *save = sInstanceSaveManager.GetInstanceSave(cVictim->GetInstanceId())) if(InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(cVictim->GetInstanceId()))
if(save->GetResetTime() < resettime) save->SetResetTime(resettime); if(save->GetResetTime() < resettime) save->SetResetTime(resettime);
} }
} }
@ -3617,7 +3617,7 @@ void Unit::RemoveRankAurasDueToSpell(uint32 spellId)
uint32 i_spellId = (*i).second->GetId(); uint32 i_spellId = (*i).second->GetId();
if((*i).second && i_spellId && i_spellId != spellId) if((*i).second && i_spellId && i_spellId != spellId)
{ {
if(spellmgr.IsRankSpellDueToSpell(spellInfo,i_spellId)) if(sSpellMgr.IsRankSpellDueToSpell(spellInfo,i_spellId))
{ {
RemoveAurasDueToSpell(i_spellId); RemoveAurasDueToSpell(i_spellId);
@ -3673,7 +3673,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
continue; continue;
// passive non-stackable spells not stackable only with another rank of same spell // passive non-stackable spells not stackable only with another rank of same spell
if (!spellmgr.IsRankSpellDueToSpell(spellProto, i_spellId)) if (!sSpellMgr.IsRankSpellDueToSpell(spellProto, i_spellId))
continue; continue;
} }
@ -3703,7 +3703,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
if( is_spellSpecPerTarget || is_spellSpecPerTargetPerCaster && Aur->GetCasterGUID() == (*i).second->GetCasterGUID() ) if( is_spellSpecPerTarget || is_spellSpecPerTargetPerCaster && Aur->GetCasterGUID() == (*i).second->GetCasterGUID() )
{ {
// cannot remove higher rank // cannot remove higher rank
if (spellmgr.IsRankSpellDueToSpell(spellProto, i_spellId)) if (sSpellMgr.IsRankSpellDueToSpell(spellProto, i_spellId))
if(CompareAuraRanks(spellId, effIndex, i_spellId, i_effIndex) < 0) if(CompareAuraRanks(spellId, effIndex, i_spellId, i_effIndex) < 0)
return false; return false;
@ -3726,7 +3726,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
// spell with spell specific that allow single ranks for spell from diff caster // spell with spell specific that allow single ranks for spell from diff caster
// same caster case processed or early or later // same caster case processed or early or later
bool is_spellPerTarget = IsSingleFromSpellSpecificSpellRanksPerTarget(spellId_spec,i_spellId_spec); bool is_spellPerTarget = IsSingleFromSpellSpecificSpellRanksPerTarget(spellId_spec,i_spellId_spec);
if ( is_spellPerTarget && Aur->GetCasterGUID() != (*i).second->GetCasterGUID() && spellmgr.IsRankSpellDueToSpell(spellProto, i_spellId)) if ( is_spellPerTarget && Aur->GetCasterGUID() != (*i).second->GetCasterGUID() && sSpellMgr.IsRankSpellDueToSpell(spellProto, i_spellId))
{ {
// cannot remove higher rank // cannot remove higher rank
if(CompareAuraRanks(spellId, effIndex, i_spellId, i_effIndex) < 0) if(CompareAuraRanks(spellId, effIndex, i_spellId, i_effIndex) < 0)
@ -3749,7 +3749,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
} }
// non single (per caster) per target spell specific (possible single spell per target at caster) // non single (per caster) per target spell specific (possible single spell per target at caster)
if( !is_spellSpecPerTargetPerCaster && !is_spellSpecPerTarget && spellmgr.IsNoStackSpellDueToSpell(spellId, i_spellId) ) if( !is_spellSpecPerTargetPerCaster && !is_spellSpecPerTarget && sSpellMgr.IsNoStackSpellDueToSpell(spellId, i_spellId) )
{ {
// Its a parent aura (create this aura in ApplyModifier) // Its a parent aura (create this aura in ApplyModifier)
if ((*i).second->IsInUse()) if ((*i).second->IsInUse())
@ -7175,7 +7175,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
{ {
// have rank dependent proc chance, ignore too often cases // have rank dependent proc chance, ignore too often cases
// PPM = 2.5 * (rank of talent), // PPM = 2.5 * (rank of talent),
uint32 rank = spellmgr.GetSpellRank(auraSpellInfo->Id); uint32 rank = sSpellMgr.GetSpellRank(auraSpellInfo->Id);
// 5 rank -> 100% 4 rank -> 80% and etc from full rate // 5 rank -> 100% 4 rank -> 80% and etc from full rate
if(!roll_chance_i(20*rank)) if(!roll_chance_i(20*rank))
return false; return false;
@ -8463,7 +8463,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
SpellModSpellDamage /= 100.0f; SpellModSpellDamage /= 100.0f;
// Check for table values // Check for table values
if (SpellBonusEntry const* bonus = spellmgr.GetSpellBonusData(spellProto->Id)) if (SpellBonusEntry const* bonus = sSpellMgr.GetSpellBonusData(spellProto->Id))
{ {
float coeff; float coeff;
if (damagetype == DOT) if (damagetype == DOT)
@ -8911,7 +8911,7 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
SpellModSpellDamage /= 100.0f; SpellModSpellDamage /= 100.0f;
// Check for table values // Check for table values
SpellBonusEntry const* bonus = spellmgr.GetSpellBonusData(spellProto->Id); SpellBonusEntry const* bonus = sSpellMgr.GetSpellBonusData(spellProto->Id);
if (bonus) if (bonus)
{ {
float coeff; float coeff;
@ -9377,7 +9377,7 @@ uint32 Unit::MeleeDamageBonus(Unit *pVictim, uint32 pdamage,WeaponAttackType att
float LvlPenalty = CalculateLevelPenalty(spellProto); float LvlPenalty = CalculateLevelPenalty(spellProto);
// Check for table values // Check for table values
if (SpellBonusEntry const* bonus = spellmgr.GetSpellBonusData(spellProto->Id)) if (SpellBonusEntry const* bonus = sSpellMgr.GetSpellBonusData(spellProto->Id))
{ {
float coeff; float coeff;
if (damagetype == DOT) if (damagetype == DOT)
@ -11219,14 +11219,14 @@ void CharmInfo::InitCharmCreateSpells()
bool CharmInfo::AddSpellToActionBar(uint32 spell_id, ActiveStates newstate) bool CharmInfo::AddSpellToActionBar(uint32 spell_id, ActiveStates newstate)
{ {
uint32 first_id = spellmgr.GetFirstSpellInChain(spell_id); uint32 first_id = sSpellMgr.GetFirstSpellInChain(spell_id);
// new spell rank can be already listed // new spell rank can be already listed
for(uint8 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i) for(uint8 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i)
{ {
if (uint32 action = PetActionBar[i].GetAction()) if (uint32 action = PetActionBar[i].GetAction())
{ {
if (PetActionBar[i].IsActionBarForSpell() && spellmgr.GetFirstSpellInChain(action) == first_id) if (PetActionBar[i].IsActionBarForSpell() && sSpellMgr.GetFirstSpellInChain(action) == first_id)
{ {
PetActionBar[i].SetAction(spell_id); PetActionBar[i].SetAction(spell_id);
return true; return true;
@ -11248,13 +11248,13 @@ bool CharmInfo::AddSpellToActionBar(uint32 spell_id, ActiveStates newstate)
bool CharmInfo::RemoveSpellFromActionBar(uint32 spell_id) bool CharmInfo::RemoveSpellFromActionBar(uint32 spell_id)
{ {
uint32 first_id = spellmgr.GetFirstSpellInChain(spell_id); uint32 first_id = sSpellMgr.GetFirstSpellInChain(spell_id);
for(uint8 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i) for(uint8 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i)
{ {
if (uint32 action = PetActionBar[i].GetAction()) if (uint32 action = PetActionBar[i].GetAction())
{ {
if (PetActionBar[i].IsActionBarForSpell() && spellmgr.GetFirstSpellInChain(action) == first_id) if (PetActionBar[i].IsActionBarForSpell() && sSpellMgr.GetFirstSpellInChain(action) == first_id)
{ {
SetActionBar(i,0,ACT_DISABLED); SetActionBar(i,0,ACT_DISABLED);
return true; return true;
@ -11981,7 +11981,7 @@ void Unit::ClearComboPointHolders()
{ {
uint32 lowguid = *m_ComboPointHolders.begin(); uint32 lowguid = *m_ComboPointHolders.begin();
Player* plr = objmgr.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 if(plr && plr->GetComboTarget()==GetGUID()) // recheck for safe
plr->ClearComboPoints(); // remove also guid from m_ComboPointHolders; plr->ClearComboPoints(); // remove also guid from m_ComboPointHolders;
else else
@ -12341,7 +12341,7 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id)
return NULL; return NULL;
} }
pet->GetCharmInfo()->SetPetNumber(objmgr.GeneratePetNumber(), true); pet->GetCharmInfo()->SetPetNumber(sObjectMgr.GeneratePetNumber(), true);
// this enables pet details window (Shift+P) // this enables pet details window (Shift+P)
pet->AIM_Initialize(); pet->AIM_Initialize();
pet->InitPetCreateSpells(); pet->InitPetCreateSpells();
@ -12357,7 +12357,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry con
SpellEntry const* spellProto = aura->GetSpellProto (); SpellEntry const* spellProto = aura->GetSpellProto ();
// Get proc Event Entry // Get proc Event Entry
spellProcEvent = spellmgr.GetSpellProcEvent(spellProto->Id); spellProcEvent = sSpellMgr.GetSpellProcEvent(spellProto->Id);
// Aura info stored here // Aura info stored here
Modifier *mod = aura->GetModifier(); Modifier *mod = aura->GetModifier();

View file

@ -331,7 +331,7 @@ void WaypointManager::CheckTextsExistance(std::set<int32>& ids)
} }
else else
{ {
if (!objmgr.GetMangosStringLocale(be->textid[j])) if (!sObjectMgr.GetMangosStringLocale(be->textid[j]))
{ {
sLog.outErrorDb("Some waypoint has textid%u with not existing %u text.", j, be->textid[j]); sLog.outErrorDb("Some waypoint has textid%u with not existing %u text.", j, be->textid[j]);
be->textid[j] = 0; be->textid[j] = 0;

View file

@ -87,6 +87,6 @@ class WaypointManager
WaypointPathMap m_pathMap; WaypointPathMap m_pathMap;
}; };
#define WaypointMgr MaNGOS::Singleton<WaypointManager>::Instance() #define sWaypointMgr MaNGOS::Singleton<WaypointManager>::Instance()
#endif #endif

View file

@ -47,7 +47,7 @@ void WaypointMovementGenerator<Creature>::LoadPath(Creature &c)
{ {
sLog.outDetail("LoadPath: loading waypoint path for creature %d,%d", c.GetGUIDLow(), c.GetDBTableGUIDLow()); sLog.outDetail("LoadPath: loading waypoint path for creature %d,%d", c.GetGUIDLow(), c.GetDBTableGUIDLow());
i_path = WaypointMgr.GetPath(c.GetDBTableGUIDLow()); i_path = sWaypointMgr.GetPath(c.GetDBTableGUIDLow());
if(!i_path) if(!i_path)
{ {
sLog.outErrorDb("WaypointMovementGenerator::LoadPath: creature %s (Entry: %u GUID: %d) doesn't have waypoint path", sLog.outErrorDb("WaypointMovementGenerator::LoadPath: creature %s (Entry: %u GUID: %d) doesn't have waypoint path",
@ -213,7 +213,7 @@ void WaypointMovementGenerator<Creature>::MovementInform(Creature &unit)
//----------------------------------------------------// //----------------------------------------------------//
void FlightPathMovementGenerator::LoadPath(Player &) void FlightPathMovementGenerator::LoadPath(Player &)
{ {
objmgr.GetTaxiPathNodes(i_pathId, i_path,i_mapIds); sObjectMgr.GetTaxiPathNodes(i_pathId, i_path,i_mapIds);
} }
uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const

View file

@ -377,7 +377,7 @@ void World::RemoveWeather(uint32 id)
/// Add a Weather object to the list /// Add a Weather object to the list
Weather* World::AddWeather(uint32 zone_id) Weather* World::AddWeather(uint32 zone_id)
{ {
WeatherZoneChances const* weatherChances = objmgr.GetWeatherChances(zone_id); WeatherZoneChances const* weatherChances = sObjectMgr.GetWeatherChances(zone_id);
// zone not have weather, ignore // zone not have weather, ignore
if(!weatherChances) if(!weatherChances)
@ -569,7 +569,7 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_INTERVAL_GRIDCLEAN] = MIN_GRID_DELAY; m_configs[CONFIG_INTERVAL_GRIDCLEAN] = MIN_GRID_DELAY;
} }
if(reload) if(reload)
mapmgr.SetGridCleanUpDelay(m_configs[CONFIG_INTERVAL_GRIDCLEAN]); sMapMgr.SetGridCleanUpDelay(m_configs[CONFIG_INTERVAL_GRIDCLEAN]);
m_configs[CONFIG_INTERVAL_MAPUPDATE] = sConfig.GetIntDefault("MapUpdateInterval", 100); m_configs[CONFIG_INTERVAL_MAPUPDATE] = sConfig.GetIntDefault("MapUpdateInterval", 100);
if(m_configs[CONFIG_INTERVAL_MAPUPDATE] < MIN_MAP_UPDATE_DELAY) if(m_configs[CONFIG_INTERVAL_MAPUPDATE] < MIN_MAP_UPDATE_DELAY)
@ -578,7 +578,7 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_INTERVAL_MAPUPDATE] = MIN_MAP_UPDATE_DELAY; m_configs[CONFIG_INTERVAL_MAPUPDATE] = MIN_MAP_UPDATE_DELAY;
} }
if(reload) if(reload)
mapmgr.SetMapUpdateInterval(m_configs[CONFIG_INTERVAL_MAPUPDATE]); sMapMgr.SetMapUpdateInterval(m_configs[CONFIG_INTERVAL_MAPUPDATE]);
m_configs[CONFIG_INTERVAL_CHANGEWEATHER] = sConfig.GetIntDefault("ChangeWeatherInterval", 10 * MINUTE * IN_MILISECONDS); m_configs[CONFIG_INTERVAL_CHANGEWEATHER] = sConfig.GetIntDefault("ChangeWeatherInterval", 10 * MINUTE * IN_MILISECONDS);
@ -1113,7 +1113,7 @@ void World::SetInitialWorldSettings()
LoadConfigSettings(); LoadConfigSettings();
///- Init highest guids before any table loading to prevent using not initialized guids in some code. ///- Init highest guids before any table loading to prevent using not initialized guids in some code.
objmgr.SetHighestGuids(); sObjectMgr.SetHighestGuids();
///- Check the existence of the map files for all races' startup areas. ///- Check the existence of the map files for all races' startup areas.
if( !MapManager::ExistMapAndVMap(0,-6240.32f, 331.033f) if( !MapManager::ExistMapAndVMap(0,-6240.32f, 331.033f)
@ -1133,7 +1133,7 @@ void World::SetInitialWorldSettings()
///- Loading strings. Getting no records means core load has to be canceled because no error message can be output. ///- Loading strings. Getting no records means core load has to be canceled because no error message can be output.
sLog.outString(); sLog.outString();
sLog.outString("Loading MaNGOS strings..."); sLog.outString("Loading MaNGOS strings...");
if (!objmgr.LoadMangosStrings()) if (!sObjectMgr.LoadMangosStrings())
exit(1); // Error message displayed in function already exit(1); // Error message displayed in function already
///- Update the realm entry in the database with the realm type from the config file ///- Update the realm entry in the database with the realm type from the config file
@ -1153,124 +1153,124 @@ void World::SetInitialWorldSettings()
DetectDBCLang(); DetectDBCLang();
sLog.outString( "Loading Script Names..."); sLog.outString( "Loading Script Names...");
objmgr.LoadScriptNames(); sObjectMgr.LoadScriptNames();
sLog.outString( "Loading InstanceTemplate..." ); sLog.outString( "Loading InstanceTemplate..." );
objmgr.LoadInstanceTemplate(); sObjectMgr.LoadInstanceTemplate();
sLog.outString( "Loading SkillLineAbilityMultiMap Data..." ); sLog.outString( "Loading SkillLineAbilityMultiMap Data..." );
spellmgr.LoadSkillLineAbilityMap(); sSpellMgr.LoadSkillLineAbilityMap();
///- Clean up and pack instances ///- Clean up and pack instances
sLog.outString( "Cleaning up instances..." ); sLog.outString( "Cleaning up instances..." );
sInstanceSaveManager.CleanupInstances(); // must be called before `creature_respawn`/`gameobject_respawn` tables sInstanceSaveMgr.CleanupInstances(); // must be called before `creature_respawn`/`gameobject_respawn` tables
sLog.outString( "Packing instances..." ); sLog.outString( "Packing instances..." );
sInstanceSaveManager.PackInstances(); sInstanceSaveMgr.PackInstances();
sLog.outString(); sLog.outString();
sLog.outString( "Loading Localization strings..." ); sLog.outString( "Loading Localization strings..." );
objmgr.LoadCreatureLocales(); sObjectMgr.LoadCreatureLocales();
objmgr.LoadGameObjectLocales(); sObjectMgr.LoadGameObjectLocales();
objmgr.LoadItemLocales(); sObjectMgr.LoadItemLocales();
objmgr.LoadQuestLocales(); sObjectMgr.LoadQuestLocales();
objmgr.LoadNpcTextLocales(); sObjectMgr.LoadNpcTextLocales();
objmgr.LoadPageTextLocales(); sObjectMgr.LoadPageTextLocales();
objmgr.LoadNpcOptionLocales(); sObjectMgr.LoadNpcOptionLocales();
objmgr.LoadPointOfInterestLocales(); sObjectMgr.LoadPointOfInterestLocales();
objmgr.SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts) sObjectMgr.SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts)
sLog.outString( ">>> Localization strings loaded" ); sLog.outString( ">>> Localization strings loaded" );
sLog.outString(); sLog.outString();
sLog.outString( "Loading Page Texts..." ); sLog.outString( "Loading Page Texts..." );
objmgr.LoadPageTexts(); sObjectMgr.LoadPageTexts();
sLog.outString( "Loading Game Object Templates..." ); // must be after LoadPageTexts sLog.outString( "Loading Game Object Templates..." ); // must be after LoadPageTexts
objmgr.LoadGameobjectInfo(); sObjectMgr.LoadGameobjectInfo();
sLog.outString( "Loading Spell Chain Data..." ); sLog.outString( "Loading Spell Chain Data..." );
spellmgr.LoadSpellChains(); sSpellMgr.LoadSpellChains();
sLog.outString( "Loading Spell Elixir types..." ); sLog.outString( "Loading Spell Elixir types..." );
spellmgr.LoadSpellElixirs(); sSpellMgr.LoadSpellElixirs();
sLog.outString( "Loading Spell Learn Skills..." ); sLog.outString( "Loading Spell Learn Skills..." );
spellmgr.LoadSpellLearnSkills(); // must be after LoadSpellChains sSpellMgr.LoadSpellLearnSkills(); // must be after LoadSpellChains
sLog.outString( "Loading Spell Learn Spells..." ); sLog.outString( "Loading Spell Learn Spells..." );
spellmgr.LoadSpellLearnSpells(); sSpellMgr.LoadSpellLearnSpells();
sLog.outString( "Loading Spell Proc Event conditions..." ); sLog.outString( "Loading Spell Proc Event conditions..." );
spellmgr.LoadSpellProcEvents(); sSpellMgr.LoadSpellProcEvents();
sLog.outString( "Loading Spell Bonus Data..." ); sLog.outString( "Loading Spell Bonus Data..." );
spellmgr.LoadSpellBonusess(); sSpellMgr.LoadSpellBonusess();
sLog.outString( "Loading Spell Proc Item Enchant..." ); sLog.outString( "Loading Spell Proc Item Enchant..." );
spellmgr.LoadSpellProcItemEnchant(); // must be after LoadSpellChains sSpellMgr.LoadSpellProcItemEnchant(); // must be after LoadSpellChains
sLog.outString( "Loading Aggro Spells Definitions..."); sLog.outString( "Loading Aggro Spells Definitions...");
spellmgr.LoadSpellThreats(); sSpellMgr.LoadSpellThreats();
sLog.outString( "Loading NPC Texts..." ); sLog.outString( "Loading NPC Texts..." );
objmgr.LoadGossipText(); sObjectMgr.LoadGossipText();
sLog.outString( "Loading Item Random Enchantments Table..." ); sLog.outString( "Loading Item Random Enchantments Table..." );
LoadRandomEnchantmentsTable(); LoadRandomEnchantmentsTable();
sLog.outString( "Loading Items..." ); // must be after LoadRandomEnchantmentsTable and LoadPageTexts sLog.outString( "Loading Items..." ); // must be after LoadRandomEnchantmentsTable and LoadPageTexts
objmgr.LoadItemPrototypes(); sObjectMgr.LoadItemPrototypes();
sLog.outString( "Loading Item Texts..." ); sLog.outString( "Loading Item Texts..." );
objmgr.LoadItemTexts(); sObjectMgr.LoadItemTexts();
sLog.outString( "Loading Creature Model Based Info Data..." ); sLog.outString( "Loading Creature Model Based Info Data..." );
objmgr.LoadCreatureModelInfo(); sObjectMgr.LoadCreatureModelInfo();
sLog.outString( "Loading Equipment templates..."); sLog.outString( "Loading Equipment templates...");
objmgr.LoadEquipmentTemplates(); sObjectMgr.LoadEquipmentTemplates();
sLog.outString( "Loading Creature templates..." ); sLog.outString( "Loading Creature templates..." );
objmgr.LoadCreatureTemplates(); sObjectMgr.LoadCreatureTemplates();
sLog.outString( "Loading SpellsScriptTarget..."); sLog.outString( "Loading SpellsScriptTarget...");
spellmgr.LoadSpellScriptTarget(); // must be after LoadCreatureTemplates and LoadGameobjectInfo sSpellMgr.LoadSpellScriptTarget(); // must be after LoadCreatureTemplates and LoadGameobjectInfo
sLog.outString( "Loading ItemRequiredTarget..."); sLog.outString( "Loading ItemRequiredTarget...");
objmgr.LoadItemRequiredTarget(); sObjectMgr.LoadItemRequiredTarget();
sLog.outString( "Loading Creature Reputation OnKill Data..." ); sLog.outString( "Loading Creature Reputation OnKill Data..." );
objmgr.LoadReputationOnKill(); sObjectMgr.LoadReputationOnKill();
sLog.outString( "Loading Points Of Interest Data..." ); sLog.outString( "Loading Points Of Interest Data..." );
objmgr.LoadPointsOfInterest(); sObjectMgr.LoadPointsOfInterest();
sLog.outString( "Loading Creature Data..." ); sLog.outString( "Loading Creature Data..." );
objmgr.LoadCreatures(); sObjectMgr.LoadCreatures();
sLog.outString( "Loading pet levelup spells..." ); sLog.outString( "Loading pet levelup spells..." );
spellmgr.LoadPetLevelupSpellMap(); sSpellMgr.LoadPetLevelupSpellMap();
sLog.outString( "Loading pet default spell additional to levelup spells..." ); sLog.outString( "Loading pet default spell additional to levelup spells..." );
spellmgr.LoadPetDefaultSpells(); sSpellMgr.LoadPetDefaultSpells();
sLog.outString( "Loading Creature Addon Data..." ); sLog.outString( "Loading Creature Addon Data..." );
sLog.outString(); sLog.outString();
objmgr.LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures() sObjectMgr.LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures()
sLog.outString( ">>> Creature Addon Data loaded" ); sLog.outString( ">>> Creature Addon Data loaded" );
sLog.outString(); sLog.outString();
sLog.outString( "Loading Creature Respawn Data..." ); // must be after PackInstances() sLog.outString( "Loading Creature Respawn Data..." ); // must be after PackInstances()
objmgr.LoadCreatureRespawnTimes(); sObjectMgr.LoadCreatureRespawnTimes();
sLog.outString( "Loading Gameobject Data..." ); sLog.outString( "Loading Gameobject Data..." );
objmgr.LoadGameobjects(); sObjectMgr.LoadGameobjects();
sLog.outString( "Loading Gameobject Respawn Data..." ); // must be after PackInstances() sLog.outString( "Loading Gameobject Respawn Data..." ); // must be after PackInstances()
objmgr.LoadGameobjectRespawnTimes(); sObjectMgr.LoadGameobjectRespawnTimes();
sLog.outString( "Loading Objects Pooling Data..."); sLog.outString( "Loading Objects Pooling Data...");
poolhandler.LoadFromDB(); sPoolMgr.LoadFromDB();
sLog.outString( "Loading Game Event Data..."); sLog.outString( "Loading Game Event Data...");
sLog.outString(); sLog.outString();
@ -1279,67 +1279,67 @@ void World::SetInitialWorldSettings()
sLog.outString(); sLog.outString();
sLog.outString( "Loading Weather Data..." ); sLog.outString( "Loading Weather Data..." );
objmgr.LoadWeatherZoneChances(); sObjectMgr.LoadWeatherZoneChances();
sLog.outString( "Loading Quests..." ); sLog.outString( "Loading Quests..." );
objmgr.LoadQuests(); // must be loaded after DBCs, creature_template, item_template, gameobject tables sObjectMgr.LoadQuests(); // must be loaded after DBCs, creature_template, item_template, gameobject tables
sLog.outString( "Loading Quests Relations..." ); sLog.outString( "Loading Quests Relations..." );
sLog.outString(); sLog.outString();
objmgr.LoadQuestRelations(); // must be after quest load sObjectMgr.LoadQuestRelations(); // must be after quest load
sLog.outString( ">>> Quests Relations loaded" ); sLog.outString( ">>> Quests Relations loaded" );
sLog.outString(); sLog.outString();
sLog.outString( "Loading UNIT_NPC_FLAG_SPELLCLICK Data..." ); sLog.outString( "Loading UNIT_NPC_FLAG_SPELLCLICK Data..." );
objmgr.LoadNPCSpellClickSpells(); sObjectMgr.LoadNPCSpellClickSpells();
sLog.outString( "Loading SpellArea Data..." ); // must be after quest load sLog.outString( "Loading SpellArea Data..." ); // must be after quest load
spellmgr.LoadSpellAreas(); sSpellMgr.LoadSpellAreas();
sLog.outString( "Loading AreaTrigger definitions..." ); sLog.outString( "Loading AreaTrigger definitions..." );
objmgr.LoadAreaTriggerTeleports(); // must be after item template load sObjectMgr.LoadAreaTriggerTeleports(); // must be after item template load
sLog.outString( "Loading Quest Area Triggers..." ); sLog.outString( "Loading Quest Area Triggers..." );
objmgr.LoadQuestAreaTriggers(); // must be after LoadQuests sObjectMgr.LoadQuestAreaTriggers(); // must be after LoadQuests
sLog.outString( "Loading Tavern Area Triggers..." ); sLog.outString( "Loading Tavern Area Triggers..." );
objmgr.LoadTavernAreaTriggers(); sObjectMgr.LoadTavernAreaTriggers();
sLog.outString( "Loading AreaTrigger script names..." ); sLog.outString( "Loading AreaTrigger script names..." );
objmgr.LoadAreaTriggerScripts(); sObjectMgr.LoadAreaTriggerScripts();
sLog.outString( "Loading Graveyard-zone links..."); sLog.outString( "Loading Graveyard-zone links...");
objmgr.LoadGraveyardZones(); sObjectMgr.LoadGraveyardZones();
sLog.outString( "Loading Spell target coordinates..." ); sLog.outString( "Loading Spell target coordinates..." );
spellmgr.LoadSpellTargetPositions(); sSpellMgr.LoadSpellTargetPositions();
sLog.outString( "Loading spell pet auras..." ); sLog.outString( "Loading spell pet auras..." );
spellmgr.LoadSpellPetAuras(); sSpellMgr.LoadSpellPetAuras();
sLog.outString( "Loading Player Create Info & Level Stats..." ); sLog.outString( "Loading Player Create Info & Level Stats..." );
sLog.outString(); sLog.outString();
objmgr.LoadPlayerInfo(); sObjectMgr.LoadPlayerInfo();
sLog.outString( ">>> Player Create Info & Level Stats loaded" ); sLog.outString( ">>> Player Create Info & Level Stats loaded" );
sLog.outString(); sLog.outString();
sLog.outString( "Loading Exploration BaseXP Data..." ); sLog.outString( "Loading Exploration BaseXP Data..." );
objmgr.LoadExplorationBaseXP(); sObjectMgr.LoadExplorationBaseXP();
sLog.outString( "Loading Pet Name Parts..." ); sLog.outString( "Loading Pet Name Parts..." );
objmgr.LoadPetNames(); sObjectMgr.LoadPetNames();
sLog.outString( "Loading the max pet number..." ); sLog.outString( "Loading the max pet number..." );
objmgr.LoadPetNumber(); sObjectMgr.LoadPetNumber();
sLog.outString( "Loading pet level stats..." ); sLog.outString( "Loading pet level stats..." );
objmgr.LoadPetLevelInfo(); sObjectMgr.LoadPetLevelInfo();
sLog.outString( "Loading Player Corpses..." ); sLog.outString( "Loading Player Corpses..." );
objmgr.LoadCorpses(); sObjectMgr.LoadCorpses();
sLog.outString( "Loading Player level dependent mail rewards..." ); sLog.outString( "Loading Player level dependent mail rewards..." );
objmgr.LoadMailLevelRewards(); sObjectMgr.LoadMailLevelRewards();
sLog.outString( "Loading Loot Tables..." ); sLog.outString( "Loading Loot Tables..." );
sLog.outString(); sLog.outString();
@ -1354,41 +1354,41 @@ void World::SetInitialWorldSettings()
LoadSkillExtraItemTable(); LoadSkillExtraItemTable();
sLog.outString( "Loading Skill Fishing base level requirements..." ); sLog.outString( "Loading Skill Fishing base level requirements..." );
objmgr.LoadFishingBaseSkillLevel(); sObjectMgr.LoadFishingBaseSkillLevel();
sLog.outString( "Loading Achievements..." ); sLog.outString( "Loading Achievements..." );
sLog.outString(); sLog.outString();
achievementmgr.LoadAchievementReferenceList(); sAchievementMgr.LoadAchievementReferenceList();
achievementmgr.LoadAchievementCriteriaList(); sAchievementMgr.LoadAchievementCriteriaList();
achievementmgr.LoadAchievementCriteriaRequirements(); sAchievementMgr.LoadAchievementCriteriaRequirements();
achievementmgr.LoadRewards(); sAchievementMgr.LoadRewards();
achievementmgr.LoadRewardLocales(); sAchievementMgr.LoadRewardLocales();
achievementmgr.LoadCompletedAchievements(); sAchievementMgr.LoadCompletedAchievements();
sLog.outString( ">>> Achievements loaded" ); sLog.outString( ">>> Achievements loaded" );
sLog.outString(); sLog.outString();
///- Load dynamic data tables from the database ///- Load dynamic data tables from the database
sLog.outString( "Loading Auctions..." ); sLog.outString( "Loading Auctions..." );
sLog.outString(); sLog.outString();
auctionmgr.LoadAuctionItems(); sAuctionMgr.LoadAuctionItems();
auctionmgr.LoadAuctions(); sAuctionMgr.LoadAuctions();
sLog.outString( ">>> Auctions loaded" ); sLog.outString( ">>> Auctions loaded" );
sLog.outString(); sLog.outString();
sLog.outString( "Loading Guilds..." ); sLog.outString( "Loading Guilds..." );
objmgr.LoadGuilds(); sObjectMgr.LoadGuilds();
sLog.outString( "Loading ArenaTeams..." ); sLog.outString( "Loading ArenaTeams..." );
objmgr.LoadArenaTeams(); sObjectMgr.LoadArenaTeams();
sLog.outString( "Loading Groups..." ); sLog.outString( "Loading Groups..." );
objmgr.LoadGroups(); sObjectMgr.LoadGroups();
sLog.outString( "Loading ReservedNames..." ); sLog.outString( "Loading ReservedNames..." );
objmgr.LoadReservedPlayersNames(); sObjectMgr.LoadReservedPlayersNames();
sLog.outString( "Loading GameObjects for quests..." ); sLog.outString( "Loading GameObjects for quests..." );
objmgr.LoadGameObjectForQuests(); sObjectMgr.LoadGameObjectForQuests();
sLog.outString( "Loading BattleMasters..." ); sLog.outString( "Loading BattleMasters..." );
sBattleGroundMgr.LoadBattleMastersEntry(); sBattleGroundMgr.LoadBattleMastersEntry();
@ -1397,53 +1397,53 @@ void World::SetInitialWorldSettings()
sBattleGroundMgr.LoadBattleEventIndexes(); sBattleGroundMgr.LoadBattleEventIndexes();
sLog.outString( "Loading GameTeleports..." ); sLog.outString( "Loading GameTeleports..." );
objmgr.LoadGameTele(); sObjectMgr.LoadGameTele();
sLog.outString( "Loading Npc Text Id..." ); sLog.outString( "Loading Npc Text Id..." );
objmgr.LoadNpcTextId(); // must be after load Creature and NpcText sObjectMgr.LoadNpcTextId(); // must be after load Creature and NpcText
sLog.outString( "Loading Npc Options..." ); sLog.outString( "Loading Npc Options..." );
objmgr.LoadNpcOptions(); sObjectMgr.LoadNpcOptions();
sLog.outString( "Loading Vendors..." ); sLog.outString( "Loading Vendors..." );
objmgr.LoadVendors(); // must be after load CreatureTemplate and ItemTemplate sObjectMgr.LoadVendors(); // must be after load CreatureTemplate and ItemTemplate
sLog.outString( "Loading Trainers..." ); sLog.outString( "Loading Trainers..." );
objmgr.LoadTrainerSpell(); // must be after load CreatureTemplate sObjectMgr.LoadTrainerSpell(); // must be after load CreatureTemplate
sLog.outString( "Loading Waypoints..." ); sLog.outString( "Loading Waypoints..." );
sLog.outString(); sLog.outString();
WaypointMgr.Load(); sWaypointMgr.Load();
sLog.outString( "Loading GM tickets..."); sLog.outString( "Loading GM tickets...");
ticketmgr.LoadGMTickets(); sTicketMgr.LoadGMTickets();
///- Handle outdated emails (delete/return) ///- Handle outdated emails (delete/return)
sLog.outString( "Returning old mails..." ); sLog.outString( "Returning old mails..." );
objmgr.ReturnOrDeleteOldMails(false); sObjectMgr.ReturnOrDeleteOldMails(false);
///- Load and initialize scripts ///- Load and initialize scripts
sLog.outString( "Loading Scripts..." ); sLog.outString( "Loading Scripts..." );
sLog.outString(); sLog.outString();
objmgr.LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate sObjectMgr.LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
objmgr.LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate sObjectMgr.LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
objmgr.LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data) sObjectMgr.LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data)
objmgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data) sObjectMgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data)
objmgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data) sObjectMgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
sLog.outString( ">>> Scripts loaded" ); sLog.outString( ">>> Scripts loaded" );
sLog.outString(); sLog.outString();
sLog.outString( "Loading Scripts text locales..." ); // must be after Load*Scripts calls sLog.outString( "Loading Scripts text locales..." ); // must be after Load*Scripts calls
objmgr.LoadDbScriptStrings(); sObjectMgr.LoadDbScriptStrings();
sLog.outString( "Loading CreatureEventAI Texts..."); sLog.outString( "Loading CreatureEventAI Texts...");
CreatureEAI_Mgr.LoadCreatureEventAI_Texts(false); // false, will checked in LoadCreatureEventAI_Scripts sEventAIMgr.LoadCreatureEventAI_Texts(false); // false, will checked in LoadCreatureEventAI_Scripts
sLog.outString( "Loading CreatureEventAI Summons..."); sLog.outString( "Loading CreatureEventAI Summons...");
CreatureEAI_Mgr.LoadCreatureEventAI_Summons(false); // false, will checked in LoadCreatureEventAI_Scripts sEventAIMgr.LoadCreatureEventAI_Summons(false); // false, will checked in LoadCreatureEventAI_Scripts
sLog.outString( "Loading CreatureEventAI Scripts..."); sLog.outString( "Loading CreatureEventAI Scripts...");
CreatureEAI_Mgr.LoadCreatureEventAI_Scripts(); sEventAIMgr.LoadCreatureEventAI_Scripts();
sLog.outString( "Initializing Scripts..." ); sLog.outString( "Initializing Scripts..." );
if(!LoadScriptingModule()) if(!LoadScriptingModule())
@ -1489,7 +1489,7 @@ void World::SetInitialWorldSettings()
///- Initialize MapManager ///- Initialize MapManager
sLog.outString( "Starting Map System" ); sLog.outString( "Starting Map System" );
mapmgr.Initialize(); sMapMgr.Initialize();
///- Initialize Battlegrounds ///- Initialize Battlegrounds
sLog.outString( "Starting BattleGround System" ); sLog.outString( "Starting BattleGround System" );
@ -1498,7 +1498,7 @@ void World::SetInitialWorldSettings()
//Not sure if this can be moved up in the sequence (with static data loading) as it uses MapManager //Not sure if this can be moved up in the sequence (with static data loading) as it uses MapManager
sLog.outString( "Loading Transports..." ); sLog.outString( "Loading Transports..." );
mapmgr.LoadTransports(); sMapMgr.LoadTransports();
sLog.outString("Deleting expired bans..." ); sLog.outString("Deleting expired bans..." );
loginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate"); loginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate");
@ -1507,7 +1507,7 @@ void World::SetInitialWorldSettings()
InitDailyQuestResetTime(); InitDailyQuestResetTime();
sLog.outString("Starting objects Pooling system..." ); sLog.outString("Starting objects Pooling system..." );
poolhandler.Initialize(); sPoolMgr.Initialize();
sLog.outString("Starting Game Event system..." ); sLog.outString("Starting Game Event system..." );
uint32 nextGameEvent = gameeventmgr.Initialize(); uint32 nextGameEvent = gameeventmgr.Initialize();
@ -1592,11 +1592,11 @@ void World::Update(uint32 diff)
if (++mail_timer > mail_timer_expires) if (++mail_timer > mail_timer_expires)
{ {
mail_timer = 0; mail_timer = 0;
objmgr.ReturnOrDeleteOldMails(true); sObjectMgr.ReturnOrDeleteOldMails(true);
} }
///- Handle expired auctions ///- Handle expired auctions
auctionmgr.Update(); sAuctionMgr.Update();
} }
/// <li> Handle session updates when the timer has passed /// <li> Handle session updates when the timer has passed
@ -1643,7 +1643,7 @@ void World::Update(uint32 diff)
{ {
m_timers[WUPDATE_OBJECTS].Reset(); m_timers[WUPDATE_OBJECTS].Reset();
///- Update objects when the timer has passed (maps, transport, creatures,...) ///- Update objects when the timer has passed (maps, transport, creatures,...)
mapmgr.Update(diff); // As interval = 0 sMapMgr.Update(diff); // As interval = 0
sBattleGroundMgr.Update(diff); sBattleGroundMgr.Update(diff);
} }
@ -1670,10 +1670,10 @@ void World::Update(uint32 diff)
/// </ul> /// </ul>
///- Move all creatures with "delayed move" and remove and delete all objects with "delayed remove" ///- Move all creatures with "delayed move" and remove and delete all objects with "delayed remove"
mapmgr.DoDelayedMovesAndRemoves(); sMapMgr.DoDelayedMovesAndRemoves();
// update the instance reset times // update the instance reset times
sInstanceSaveManager.Update(); sInstanceSaveMgr.Update();
// And last, but not least handle the issued cli commands // And last, but not least handle the issued cli commands
ProcessCliCommands(); ProcessCliCommands();
@ -1705,7 +1705,7 @@ namespace MaNGOS
explicit WorldWorldTextBuilder(int32 textId, va_list* args = NULL) : i_textId(textId), i_args(args) {} explicit WorldWorldTextBuilder(int32 textId, va_list* args = NULL) : i_textId(textId), i_args(args) {}
void operator()(WorldPacketList& data_list, int32 loc_idx) void operator()(WorldPacketList& data_list, int32 loc_idx)
{ {
char const* text = objmgr.GetMangosString(i_textId,loc_idx); char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
if(i_args) if(i_args)
{ {
@ -1911,7 +1911,7 @@ bool World::RemoveBanAccount(BanMode mode, std::string nameOrIP)
if (mode == BAN_ACCOUNT) if (mode == BAN_ACCOUNT)
account = accmgr.GetId (nameOrIP); account = accmgr.GetId (nameOrIP);
else if (mode == BAN_CHARACTER) else if (mode == BAN_CHARACTER)
account = objmgr.GetPlayerAccountIdByPlayerName (nameOrIP); account = sObjectMgr.GetPlayerAccountIdByPlayerName (nameOrIP);
if (!account) if (!account)
return false; return false;

View file

@ -41,7 +41,7 @@
WorldSession::WorldSession(uint32 id, WorldSocket *sock, AccountTypes sec, uint8 expansion, time_t mute_time, LocaleConstant locale) : WorldSession::WorldSession(uint32 id, WorldSocket *sock, AccountTypes sec, uint8 expansion, time_t mute_time, LocaleConstant locale) :
LookingForGroup_auto_join(false), LookingForGroup_auto_add(false), m_muteTime(mute_time), LookingForGroup_auto_join(false), LookingForGroup_auto_add(false), m_muteTime(mute_time),
_player(NULL), m_Socket(sock),_security(sec), _accountId(id), m_expansion(expansion), _player(NULL), m_Socket(sock),_security(sec), _accountId(id), m_expansion(expansion),
m_sessionDbcLocale(sWorld.GetAvailableDbcLocale(locale)), m_sessionDbLocaleIndex(objmgr.GetIndexForLocale(locale)), m_sessionDbcLocale(sWorld.GetAvailableDbcLocale(locale)), m_sessionDbLocaleIndex(sObjectMgr.GetIndexForLocale(locale)),
_logoutTime(0), m_inQueue(false), m_playerLoading(false), m_playerLogout(false), m_playerRecentlyLogout(false), _logoutTime(0), m_inQueue(false), m_playerLoading(false), m_playerLogout(false), m_playerRecentlyLogout(false),
m_latency(0), m_TutorialsChanged(false) m_latency(0), m_TutorialsChanged(false)
{ {
@ -378,7 +378,7 @@ void WorldSession::LogoutPlayer(bool Save)
loginDatabase.PExecute("UPDATE account SET active_realm_id = 0 WHERE id = '%u'", GetAccountId()); loginDatabase.PExecute("UPDATE account SET active_realm_id = 0 WHERE id = '%u'", GetAccountId());
///- If the player is in a guild, update the guild roster and broadcast a logout message to other guild members ///- If the player is in a guild, update the guild roster and broadcast a logout message to other guild members
Guild *guild = objmgr.GetGuildById(_player->GetGuildId()); Guild *guild = sObjectMgr.GetGuildById(_player->GetGuildId());
if(guild) if(guild)
{ {
guild->SetMemberStats(_player->GetGUID()); guild->SetMemberStats(_player->GetGUID());
@ -523,7 +523,7 @@ void WorldSession::SendSetPhaseShift(uint32 PhaseShift)
const char * WorldSession::GetMangosString( int32 entry ) const const char * WorldSession::GetMangosString( int32 entry ) const
{ {
return objmgr.GetMangosString(entry,GetSessionDbLocaleIndex()); return sObjectMgr.GetMangosString(entry,GetSessionDbLocaleIndex());
} }
void WorldSession::Handle_NULL( WorldPacket& recvPacket ) void WorldSession::Handle_NULL( WorldPacket& recvPacket )

View file

@ -653,7 +653,7 @@ bool ChatHandler::HandleDebugSpawnVehicle(const char* args)
bool ChatHandler::HandleDebugSpellCheckCommand(const char* /*args*/) bool ChatHandler::HandleDebugSpellCheckCommand(const char* /*args*/)
{ {
sLog.outString( "Check expected in code spell properties base at table 'spell_check' content..."); sLog.outString( "Check expected in code spell properties base at table 'spell_check' content...");
spellmgr.CheckUsedSpells("spell_check"); sSpellMgr.CheckUsedSpells("spell_check");
return true; return true;
} }

View file

@ -124,7 +124,7 @@ bool ChatHandler::HandleCharacterDeleteCommand(const char* args)
uint64 character_guid; uint64 character_guid;
uint32 account_id; uint32 account_id;
Player *player = objmgr.GetPlayer(character_name.c_str()); Player *player = sObjectMgr.GetPlayer(character_name.c_str());
if(player) if(player)
{ {
character_guid = player->GetGUID(); character_guid = player->GetGUID();
@ -133,7 +133,7 @@ bool ChatHandler::HandleCharacterDeleteCommand(const char* args)
} }
else else
{ {
character_guid = objmgr.GetPlayerGUIDByName(character_name); character_guid = sObjectMgr.GetPlayerGUIDByName(character_name);
if(!character_guid) if(!character_guid)
{ {
PSendSysMessage(LANG_NO_PLAYER,character_name.c_str()); PSendSysMessage(LANG_NO_PLAYER,character_name.c_str());
@ -141,7 +141,7 @@ bool ChatHandler::HandleCharacterDeleteCommand(const char* args)
return false; return false;
} }
account_id = objmgr.GetPlayerAccountIdByGUID(character_guid); account_id = sObjectMgr.GetPlayerAccountIdByGUID(character_guid);
} }
std::string account_name; std::string account_name;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "8788" #define REVISION_NR "8789"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__