* Some singleton renames for consistency:
accmgr -> AccountMgr objmgr -> ObjectMgr auctionmgr -> sAuctionMgr spellmgr -> sSpellMgr CreatureEAI_Mgr -> sEventAIMgr achievementmgr -> sAchievementMgr gameeventmgr -> sGameEventMgr sInstanceSaveManager -> sInstanceSaveMgr poolhandler -> sPoolMgr --HG-- branch : trunk
This commit is contained in:
@@ -60,8 +60,8 @@ int CreatureEventAI::Permissible(const Creature *creature)
|
||||
CreatureEventAI::CreatureEventAI(Creature *c) : CreatureAI(c)
|
||||
{
|
||||
// Need make copy for filter unneeded steps and safe in case table reload
|
||||
CreatureEventAI_Event_Map::const_iterator CreatureEvents = CreatureEAI_Mgr.GetCreatureEventAIMap().find(me->GetEntry());
|
||||
if (CreatureEvents != CreatureEAI_Mgr.GetCreatureEventAIMap().end())
|
||||
CreatureEventAI_Event_Map::const_iterator CreatureEvents = sEventAIMgr.GetCreatureEventAIMap().find(me->GetEntry());
|
||||
if (CreatureEvents != sEventAIMgr.GetCreatureEventAIMap().end())
|
||||
{
|
||||
std::vector<CreatureEventAI_Event>::const_iterator i;
|
||||
for (i = (*CreatureEvents).second.begin(); i != (*CreatureEvents).second.end(); ++i)
|
||||
@@ -412,7 +412,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
{
|
||||
if (CreatureInfo const* ci = GetCreatureTemplateStore(action.morph.creatureId))
|
||||
{
|
||||
uint32 display_id = objmgr.ChooseDisplayId(0,ci);
|
||||
uint32 display_id = sObjectMgr.ChooseDisplayId(0,ci);
|
||||
me->SetDisplayId(display_id);
|
||||
}
|
||||
}
|
||||
@@ -674,8 +674,8 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
{
|
||||
Unit* target = GetTargetByType(action.summon_id.target, pActionInvoker);
|
||||
|
||||
CreatureEventAI_Summon_Map::const_iterator i = CreatureEAI_Mgr.GetCreatureEventAISummonMap().find(action.summon_id.spawnId);
|
||||
if (i == CreatureEAI_Mgr.GetCreatureEventAISummonMap().end())
|
||||
CreatureEventAI_Summon_Map::const_iterator i = sEventAIMgr.GetCreatureEventAISummonMap().find(action.summon_id.spawnId);
|
||||
if (i == sEventAIMgr.GetCreatureEventAISummonMap().end())
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", action.summon_id.creatureId, action.summon_id.spawnId, EventId, me->GetEntry());
|
||||
return;
|
||||
@@ -1230,9 +1230,9 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit*
|
||||
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);
|
||||
return;
|
||||
|
||||
@@ -34,7 +34,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts()
|
||||
m_CreatureEventAI_TextMap.clear();
|
||||
|
||||
// Load EventAI Text
|
||||
objmgr.LoadTrinityStrings(WorldDatabase,"creature_ai_texts",MIN_CREATURE_AI_TEXT_STRING_ID,MAX_CREATURE_AI_TEXT_STRING_ID);
|
||||
sObjectMgr.LoadTrinityStrings(WorldDatabase,"creature_ai_texts",MIN_CREATURE_AI_TEXT_STRING_ID,MAX_CREATURE_AI_TEXT_STRING_ID);
|
||||
|
||||
// Gather Additional data from EventAI Texts
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM creature_ai_texts");
|
||||
@@ -65,7 +65,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts()
|
||||
}
|
||||
|
||||
// range negative (don't must be happen, loaded from same table)
|
||||
if (!objmgr.GetTrinityStringLocale(i))
|
||||
if (!sObjectMgr.GetTrinityStringLocale(i))
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` not found",i);
|
||||
continue;
|
||||
@@ -331,7 +331,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
||||
break;
|
||||
case EVENT_T_QUEST_ACCEPT:
|
||||
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 using not implemented event (%u) in event %u.", temp.creature_id, temp.event_id, i);
|
||||
continue;
|
||||
@@ -543,7 +543,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j+1, action.threat_all_pct.percent);
|
||||
break;
|
||||
case ACTION_T_QUEST_EVENT:
|
||||
if (Quest const* qid = objmgr.GetQuestTemplate(action.quest_event.questId))
|
||||
if (Quest const* qid = sObjectMgr.GetQuestTemplate(action.quest_event.questId))
|
||||
{
|
||||
if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event.questId);
|
||||
@@ -585,7 +585,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u is change phase by too large for any use %i.", i, j+1, action.set_inc_phase.step);
|
||||
break;
|
||||
case ACTION_T_QUEST_EVENT_ALL:
|
||||
if (Quest const* qid = objmgr.GetQuestTemplate(action.quest_event_all.questId))
|
||||
if (Quest const* qid = sObjectMgr.GetQuestTemplate(action.quest_event_all.questId))
|
||||
{
|
||||
if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event_all.questId);
|
||||
|
||||
@@ -43,5 +43,5 @@ class CreatureEventAIMgr
|
||||
CreatureEventAI_TextMap m_CreatureEventAI_TextMap;
|
||||
};
|
||||
|
||||
#define CreatureEAI_Mgr (*ACE_Singleton<CreatureEventAIMgr, ACE_Null_Mutex>::instance())
|
||||
#define sEventAIMgr (*ACE_Singleton<CreatureEventAIMgr, ACE_Null_Mutex>::instance())
|
||||
#endif
|
||||
|
||||
@@ -59,6 +59,6 @@ class AccountMgr
|
||||
static bool normalizeString(std::string& utf8str);
|
||||
};
|
||||
|
||||
#define accmgr (*ACE_Singleton<AccountMgr, ACE_Null_Mutex>::instance())
|
||||
#define sAccountMgr (*ACE_Singleton<AccountMgr, ACE_Null_Mutex>::instance())
|
||||
#endif
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Trinity
|
||||
: i_player(pl), i_msgtype(msgtype), i_textId(textId), i_achievementId(ach_id) {}
|
||||
void operator()(WorldPacket& data, int32 loc_idx)
|
||||
{
|
||||
char const* text = objmgr.GetTrinityString(i_textId,loc_idx);
|
||||
char const* text = sObjectMgr.GetTrinityString(i_textId,loc_idx);
|
||||
|
||||
data << uint8(i_msgtype);
|
||||
data << uint32(LANG_UNIVERSAL);
|
||||
@@ -110,7 +110,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
|
||||
case ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT:
|
||||
return true;
|
||||
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_CREATURE:
|
||||
if (!creature.id || !objmgr.GetCreatureTemplate(creature.id))
|
||||
if (!creature.id || !sObjectMgr.GetCreatureTemplate(creature.id))
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) has non-existing creature id in value1 (%u), ignored.",
|
||||
criteria->ID, criteria->requiredType,dataType,creature.id);
|
||||
@@ -355,7 +355,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
|
||||
}
|
||||
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM:
|
||||
{
|
||||
ItemPrototype const *pProto = objmgr.GetItemPrototype(miscvalue1);
|
||||
ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(miscvalue1);
|
||||
if (!pProto)
|
||||
return false;
|
||||
return pProto->ItemLevel >= equipped_item.item_level && pProto->Quality >= equipped_item.item_quality;
|
||||
@@ -414,7 +414,7 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin
|
||||
if (!sWorld.getConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER)
|
||||
return;
|
||||
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = achievementmgr.GetAchievementCriteriaByType(type);
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetAchievementCriteriaByType(type);
|
||||
for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i)
|
||||
{
|
||||
AchievementCriteriaEntry const *achievementCriteria = (*i);
|
||||
@@ -562,7 +562,7 @@ void AchievementMgr::LoadFromDB(QueryResult_AutoPtr achievementResult, QueryResu
|
||||
|
||||
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))
|
||||
continue;
|
||||
|
||||
@@ -617,7 +617,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
|
||||
sLog.outDebug("AchievementMgr::SendAchievementEarned(%u)", achievement->ID);
|
||||
#endif
|
||||
|
||||
if (Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()))
|
||||
if (Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId()))
|
||||
{
|
||||
Trinity::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED,achievement->ID);
|
||||
Trinity::LocalizedPacketDo<Trinity::AchievementChatBuilder> say_do(say_builder);
|
||||
@@ -710,7 +710,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
if (!sWorld.getConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER)
|
||||
return;
|
||||
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = achievementmgr.GetAchievementCriteriaByType(type);
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetAchievementCriteriaByType(type);
|
||||
for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i)
|
||||
{
|
||||
AchievementCriteriaEntry const *achievementCriteria = (*i);
|
||||
@@ -789,7 +789,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
if (achievementCriteria->additionalRequrements[0].additionalRequirement_type)
|
||||
{
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaDataSet const* data = achievementmgr.GetCriteriaDataSet(achievementCriteria);
|
||||
AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(),unit))
|
||||
continue;
|
||||
}
|
||||
@@ -835,7 +835,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
continue;
|
||||
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaDataSet const* data = achievementmgr.GetCriteriaDataSet(achievementCriteria);
|
||||
AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(),unit))
|
||||
continue;
|
||||
|
||||
@@ -911,7 +911,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
uint32 counter =0;
|
||||
for (QuestStatusMap::const_iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr != GetPlayer()->getQuestStatusMap().end(); itr++)
|
||||
{
|
||||
Quest const* quest = objmgr.GetQuestTemplate(itr->first);
|
||||
Quest const* quest = sObjectMgr.GetQuestTemplate(itr->first);
|
||||
if (itr->second.m_rewarded && quest && quest->GetZoneOrSort() >= 0 && uint32(quest->GetZoneOrSort()) == achievementCriteria->complete_quests_in_zone.zoneID)
|
||||
counter++;
|
||||
}
|
||||
@@ -1033,7 +1033,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
continue;
|
||||
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaDataSet const* data = achievementmgr.GetCriteriaDataSet(achievementCriteria);
|
||||
AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(),unit))
|
||||
continue;
|
||||
|
||||
@@ -1075,7 +1075,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
case 1789:
|
||||
{
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaDataSet const* data = achievementmgr.GetCriteriaDataSet(achievementCriteria);
|
||||
AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(),unit))
|
||||
continue;
|
||||
break;
|
||||
@@ -1094,7 +1094,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
continue;
|
||||
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaDataSet const* data = achievementmgr.GetCriteriaDataSet(achievementCriteria);
|
||||
AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria);
|
||||
if (!data)
|
||||
continue;
|
||||
|
||||
@@ -1111,7 +1111,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
continue;
|
||||
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaDataSet const* data = achievementmgr.GetCriteriaDataSet(achievementCriteria);
|
||||
AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria);
|
||||
if (!data)
|
||||
continue;
|
||||
|
||||
@@ -1141,7 +1141,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
if (achievementCriteria->loot_type.lootTypeCount == 1)
|
||||
{
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaDataSet const* data = achievementmgr.GetCriteriaDataSet(achievementCriteria);
|
||||
AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(),unit))
|
||||
continue;
|
||||
}
|
||||
@@ -1164,7 +1164,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
if (achievementCriteria->additionalRequrements[0].additionalRequirement_type == ACHIEVEMENT_CRITERIA_CONDITION_NO_LOOSE)
|
||||
{
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaDataSet const* data = achievementmgr.GetCriteriaDataSet(achievementCriteria);
|
||||
AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(),unit,miscvalue1))
|
||||
{
|
||||
// reset the progress as we have a win without the requirement.
|
||||
@@ -1260,7 +1260,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
continue;
|
||||
|
||||
// check item level and quality via achievement_criteria_data
|
||||
AchievementCriteriaDataSet const* data = achievementmgr.GetCriteriaDataSet(achievementCriteria);
|
||||
AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(), 0, miscvalue1))
|
||||
continue;
|
||||
|
||||
@@ -1278,12 +1278,12 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
if (miscvalue2 != achievementCriteria->roll_greed_on_loot.rollValue)
|
||||
continue;
|
||||
|
||||
ItemPrototype const *pProto = objmgr.GetItemPrototype(miscvalue1);
|
||||
ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(miscvalue1);
|
||||
if (!pProto)
|
||||
continue;
|
||||
|
||||
// check item level via achievement_criteria_data
|
||||
AchievementCriteriaDataSet const* data = achievementmgr.GetCriteriaDataSet(achievementCriteria);
|
||||
AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(), 0, pProto->ItemLevel))
|
||||
continue;
|
||||
|
||||
@@ -1300,7 +1300,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
if (achievementCriteria->do_emote.count)
|
||||
{
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaDataSet const* data = achievementmgr.GetCriteriaDataSet(achievementCriteria);
|
||||
AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(),unit))
|
||||
continue;
|
||||
}
|
||||
@@ -1363,7 +1363,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
spellIter != GetPlayer()->GetSpellMap().end();
|
||||
++spellIter)
|
||||
{
|
||||
SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(spellIter->first);
|
||||
SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spellIter->first);
|
||||
for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
|
||||
{
|
||||
if (skillIter->second->skillId == achievementCriteria->learn_skillline_spell.skillLine)
|
||||
@@ -1381,7 +1381,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
if (achievementCriteria->win_duel.duelCount)
|
||||
{
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaDataSet const* data = achievementmgr.GetCriteriaDataSet(achievementCriteria);
|
||||
AchievementCriteriaDataSet const* data = sAchievementMgr.GetCriteriaDataSet(achievementCriteria);
|
||||
if (!data)
|
||||
continue;
|
||||
|
||||
@@ -1422,7 +1422,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
spellIter != GetPlayer()->GetSpellMap().end();
|
||||
++spellIter)
|
||||
{
|
||||
SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(spellIter->first);
|
||||
SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spellIter->first);
|
||||
for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
|
||||
if (skillIter->second->skillId == achievementCriteria->learn_skill_line.skillLine)
|
||||
spellCount++;
|
||||
@@ -1503,7 +1503,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
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)
|
||||
if (IsCompletedAchievement(*itr))
|
||||
@@ -1524,7 +1524,7 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve
|
||||
if (achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL))
|
||||
{
|
||||
// someone on this realm has already completed that achievement
|
||||
if (achievementmgr.IsRealmCompleted(achievement))
|
||||
if (sAchievementMgr.IsRealmCompleted(achievement))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1698,7 +1698,7 @@ bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry)
|
||||
uint32 achievmentForTestId = entry->refAchievement ? entry->refAchievement : entry->ID;
|
||||
uint32 achievmentForTestCount = entry->count;
|
||||
|
||||
AchievementCriteriaEntryList const* cList = achievementmgr.GetAchievementCriteriaByAchievement(achievmentForTestId);
|
||||
AchievementCriteriaEntryList const* cList = sAchievementMgr.GetAchievementCriteriaByAchievement(achievmentForTestId);
|
||||
if (!cList)
|
||||
return false;
|
||||
uint32 count = 0;
|
||||
@@ -1856,7 +1856,7 @@ void AchievementMgr::UpdateTimedAchievements(uint32 timeDiff)
|
||||
|
||||
void AchievementMgr::StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
|
||||
{
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = achievementmgr.GetTimedAchievementCriteriaByType(type);
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetTimedAchievementCriteriaByType(type);
|
||||
for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i)
|
||||
{
|
||||
if ((*i)->timerStartEvent != entry)
|
||||
@@ -1876,7 +1876,7 @@ void AchievementMgr::StartTimedAchievement(AchievementCriteriaTimedTypes type, u
|
||||
|
||||
void AchievementMgr::RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
|
||||
{
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = achievementmgr.GetTimedAchievementCriteriaByType(type);
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetTimedAchievementCriteriaByType(type);
|
||||
for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i)
|
||||
{
|
||||
if ((*i)->timerStartEvent != entry)
|
||||
@@ -1916,13 +1916,13 @@ 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
|
||||
// TODO: where do set this instead?
|
||||
if (!(achievement->flags & ACHIEVEMENT_FLAG_REALM_FIRST_KILL))
|
||||
achievementmgr.SetRealmCompleted(achievement);
|
||||
sAchievementMgr.SetRealmCompleted(achievement);
|
||||
|
||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT);
|
||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->points);
|
||||
|
||||
// reward items and titles if any
|
||||
AchievementReward const* reward = achievementmgr.GetAchievementReward(achievement);
|
||||
AchievementReward const* reward = sAchievementMgr.GetAchievementReward(achievement);
|
||||
|
||||
// no rewards
|
||||
if (!reward)
|
||||
@@ -1945,7 +1945,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
|
||||
std::string text = reward->text;
|
||||
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())
|
||||
subject = loc->subject[loc_idx];
|
||||
@@ -2134,7 +2134,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
|
||||
if (dataType != ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT)
|
||||
sLog.outErrorDb("Table `achievement_criteria_data` has ScriptName set for non-scripted data type (Entry: %u, type %u), useless data.", criteria_id, dataType);
|
||||
else
|
||||
scriptId = objmgr.GetScriptId(scriptName);
|
||||
scriptId = sObjectMgr.GetScriptId(scriptName);
|
||||
}
|
||||
|
||||
AchievementCriteriaData data(dataType, fields[2].GetUInt32(), fields[3].GetUInt32(), scriptId);
|
||||
@@ -2346,7 +2346,7 @@ void AchievementGlobalMgr::LoadRewards()
|
||||
//check mail data before item for report including wrong item case
|
||||
if (reward.sender)
|
||||
{
|
||||
if (!objmgr.GetCreatureTemplate(reward.sender))
|
||||
if (!sObjectMgr.GetCreatureTemplate(reward.sender))
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_reward` (Entry: %u) has invalid creature entry %u as sender, mail reward skipped.", entry, reward.sender);
|
||||
reward.sender = 0;
|
||||
@@ -2366,7 +2366,7 @@ void AchievementGlobalMgr::LoadRewards()
|
||||
|
||||
if (reward.itemId)
|
||||
{
|
||||
if (!objmgr.GetItemPrototype(reward.itemId))
|
||||
if (!sObjectMgr.GetItemPrototype(reward.itemId))
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_reward` (Entry: %u) has invalid item id %u, reward mail will not contain item.", entry, reward.itemId);
|
||||
reward.itemId = 0;
|
||||
@@ -2422,7 +2422,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
|
||||
std::string str = fields[1+2*(i-1)].GetCppString();
|
||||
if (!str.empty())
|
||||
{
|
||||
int idx = objmgr.GetOrNewIndexForLocale(LocaleConstant(i));
|
||||
int idx = sObjectMgr.GetOrNewIndexForLocale(LocaleConstant(i));
|
||||
if (idx >= 0)
|
||||
{
|
||||
if (data.subject.size() <= size_t(idx))
|
||||
@@ -2434,7 +2434,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
|
||||
str = fields[1+2*(i-1)+1].GetCppString();
|
||||
if (!str.empty())
|
||||
{
|
||||
int idx = objmgr.GetOrNewIndexForLocale(LocaleConstant(i));
|
||||
int idx = sObjectMgr.GetOrNewIndexForLocale(LocaleConstant(i));
|
||||
if (idx >= 0)
|
||||
{
|
||||
if (data.text.size() <= size_t(idx))
|
||||
|
||||
@@ -345,6 +345,6 @@ class AchievementGlobalMgr
|
||||
AchievementRewardLocales m_achievementRewardLocales;
|
||||
};
|
||||
|
||||
#define achievementmgr (*ACE_Singleton<AchievementGlobalMgr, ACE_Null_Mutex>::instance())
|
||||
#define sAchievementMgr (*ACE_Singleton<AchievementGlobalMgr, ACE_Null_Mutex>::instance())
|
||||
|
||||
#endif
|
||||
|
||||
@@ -69,9 +69,9 @@ class AddonMgr
|
||||
{
|
||||
friend class ACE_Singleton<AddonMgr, ACE_Null_Mutex>;
|
||||
AddonMgr();
|
||||
public:
|
||||
~AddonMgr();
|
||||
|
||||
~AddonMgr();
|
||||
public:
|
||||
|
||||
void LoadFromDB();
|
||||
void SaveAddon(AddonInfo const& addon);
|
||||
|
||||
@@ -97,7 +97,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction)
|
||||
uint32 bidder_accId = 0;
|
||||
uint32 bidder_security = 0;
|
||||
uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER);
|
||||
Player *bidder = objmgr.GetPlayer(bidder_guid);
|
||||
Player *bidder = sObjectMgr.GetPlayer(bidder_guid);
|
||||
// data for gm.log
|
||||
if (sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
@@ -110,22 +110,22 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction)
|
||||
}
|
||||
else
|
||||
{
|
||||
bidder_accId = objmgr.GetPlayerAccountIdByGUID(bidder_guid);
|
||||
bidder_security = accmgr.GetSecurity(bidder_accId);
|
||||
bidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(bidder_guid);
|
||||
bidder_security = sAccountMgr.GetSecurity(bidder_accId);
|
||||
|
||||
if (bidder_security > SEC_PLAYER) // not do redundant DB requests
|
||||
{
|
||||
if (!objmgr.GetPlayerNameByGUID(bidder_guid,bidder_name))
|
||||
bidder_name = objmgr.GetTrinityStringForDBCLocale(LANG_UNKNOWN);
|
||||
if (!sObjectMgr.GetPlayerNameByGUID(bidder_guid,bidder_name))
|
||||
bidder_name = sObjectMgr.GetTrinityStringForDBCLocale(LANG_UNKNOWN);
|
||||
}
|
||||
}
|
||||
if (bidder_security > SEC_PLAYER)
|
||||
{
|
||||
std::string owner_name;
|
||||
if (!objmgr.GetPlayerNameByGUID(auction->owner,owner_name))
|
||||
owner_name = objmgr.GetTrinityStringForDBCLocale(LANG_UNKNOWN);
|
||||
if (!sObjectMgr.GetPlayerNameByGUID(auction->owner,owner_name))
|
||||
owner_name = sObjectMgr.GetTrinityStringForDBCLocale(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)",
|
||||
bidder_name.c_str(),bidder_accId,pItem->GetProto()->Name1,pItem->GetEntry(),pItem->GetCount(),auction->bid,owner_name.c_str(),owner_accid);
|
||||
@@ -164,8 +164,8 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction)
|
||||
void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction)
|
||||
{
|
||||
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
|
||||
Player *owner = objmgr.GetPlayer(owner_guid);
|
||||
uint32 owner_accId = objmgr.GetPlayerAccountIdByGUID(owner_guid);
|
||||
Player *owner = sObjectMgr.GetPlayer(owner_guid);
|
||||
uint32 owner_accId = sObjectMgr.GetPlayerAccountIdByGUID(owner_guid);
|
||||
// owner exist (online or offline)
|
||||
if (owner || owner_accId)
|
||||
{
|
||||
@@ -194,8 +194,8 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction)
|
||||
void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry * auction)
|
||||
{
|
||||
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
|
||||
Player *owner = objmgr.GetPlayer(owner_guid);
|
||||
uint32 owner_accId = objmgr.GetPlayerAccountIdByGUID(owner_guid);
|
||||
Player *owner = sObjectMgr.GetPlayer(owner_guid);
|
||||
uint32 owner_accId = sObjectMgr.GetPlayerAccountIdByGUID(owner_guid);
|
||||
// owner exist
|
||||
if (owner || owner_accId)
|
||||
{
|
||||
@@ -237,8 +237,8 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry * auction)
|
||||
return;
|
||||
|
||||
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
|
||||
Player *owner = objmgr.GetPlayer(owner_guid);
|
||||
uint32 owner_accId = objmgr.GetPlayerAccountIdByGUID(owner_guid);
|
||||
Player *owner = sObjectMgr.GetPlayer(owner_guid);
|
||||
uint32 owner_accId = sObjectMgr.GetPlayerAccountIdByGUID(owner_guid);
|
||||
// owner exist
|
||||
if (owner || owner_accId)
|
||||
{
|
||||
@@ -282,7 +282,7 @@ void AuctionHouseMgr::LoadAuctionItems()
|
||||
uint32 item_guid = fields[11].GetUInt32();
|
||||
uint32 item_template = fields[12].GetUInt32();
|
||||
|
||||
ItemPrototype const *proto = objmgr.GetItemPrototype(item_template);
|
||||
ItemPrototype const *proto = sObjectMgr.GetItemPrototype(item_template);
|
||||
|
||||
if (!proto)
|
||||
{
|
||||
@@ -363,7 +363,7 @@ void AuctionHouseMgr::LoadAuctions()
|
||||
aItem->startbid = fields[9].GetUInt32();
|
||||
aItem->deposit = fields[10].GetUInt32();
|
||||
|
||||
CreatureData const* auctioneerData = objmgr.GetCreatureData(aItem->auctioneer);
|
||||
CreatureData const* auctioneerData = sObjectMgr.GetCreatureData(aItem->auctioneer);
|
||||
if (!auctioneerData)
|
||||
{
|
||||
aItem->DeleteFromDB();
|
||||
@@ -372,7 +372,7 @@ void AuctionHouseMgr::LoadAuctions()
|
||||
continue;
|
||||
}
|
||||
|
||||
CreatureInfo const* auctioneerInfo = objmgr.GetCreatureTemplate(auctioneerData->id);
|
||||
CreatureInfo const* auctioneerInfo = sObjectMgr.GetCreatureTemplate(auctioneerData->id);
|
||||
if (!auctioneerInfo)
|
||||
{
|
||||
aItem->DeleteFromDB();
|
||||
@@ -534,7 +534,7 @@ void AuctionHouseObject::Update()
|
||||
///- Either cancel the auction if there was no bidder
|
||||
if (auction->bidder == 0)
|
||||
{
|
||||
auctionmgr.SendAuctionExpiredMail(auction);
|
||||
sAuctionMgr.SendAuctionExpiredMail(auction);
|
||||
sScriptMgr.OnAuctionExpire(this, auction);
|
||||
}
|
||||
///- Or perform the transaction
|
||||
@@ -543,8 +543,8 @@ void AuctionHouseObject::Update()
|
||||
//we should send an "item sold" message if the seller is online
|
||||
//we send the item to the winner
|
||||
//we send the money to the seller
|
||||
auctionmgr.SendAuctionSuccessfulMail(auction);
|
||||
auctionmgr.SendAuctionWonMail(auction);
|
||||
sAuctionMgr.SendAuctionSuccessfulMail(auction);
|
||||
sAuctionMgr.SendAuctionWonMail(auction);
|
||||
sScriptMgr.OnAuctionSuccessful(this, auction);
|
||||
}
|
||||
|
||||
@@ -552,7 +552,7 @@ void AuctionHouseObject::Update()
|
||||
CharacterDatabase.BeginTransaction();
|
||||
auction->DeleteFromDB();
|
||||
uint32 item_template = auction->item_template;
|
||||
auctionmgr.RemoveAItem(auction->item_guidlow);
|
||||
sAuctionMgr.RemoveAItem(auction->item_guidlow);
|
||||
RemoveAuction(auction, item_template);
|
||||
CharacterDatabase.CommitTransaction();
|
||||
}
|
||||
@@ -599,7 +599,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
|
||||
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); ++itr)
|
||||
{
|
||||
AuctionEntry *Aentry = itr->second;
|
||||
Item *item = auctionmgr.GetAItem(Aentry->item_guidlow);
|
||||
Item *item = sAuctionMgr.GetAItem(Aentry->item_guidlow);
|
||||
if (!item)
|
||||
continue;
|
||||
|
||||
@@ -634,7 +634,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
|
||||
// local name
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
ItemLocale const *il = objmgr.GetItemLocale(proto->ItemId);
|
||||
ItemLocale const *il = sObjectMgr.GetItemLocale(proto->ItemId);
|
||||
if (il)
|
||||
{
|
||||
if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty())
|
||||
@@ -696,7 +696,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
|
||||
//this function inserts to WorldPacket auction's data
|
||||
bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const
|
||||
{
|
||||
Item *pItem = auctionmgr.GetAItem(item_guidlow);
|
||||
Item *pItem = sAuctionMgr.GetAItem(item_guidlow);
|
||||
if (!pItem)
|
||||
{
|
||||
sLog.outError("auction to item, that doesn't exist !!!!");
|
||||
|
||||
@@ -119,9 +119,9 @@ class AuctionHouseMgr
|
||||
{
|
||||
friend class ACE_Singleton<AuctionHouseMgr, ACE_Null_Mutex>;
|
||||
AuctionHouseMgr();
|
||||
~AuctionHouseMgr();
|
||||
|
||||
public:
|
||||
~AuctionHouseMgr();
|
||||
|
||||
typedef UNORDERED_MAP<uint32, Item*> ItemMap;
|
||||
|
||||
@@ -132,9 +132,8 @@ class AuctionHouseMgr
|
||||
{
|
||||
ItemMap::const_iterator itr = mAitems.find(id);
|
||||
if (itr != mAitems.end())
|
||||
{
|
||||
return itr->second;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -147,7 +146,8 @@ class AuctionHouseMgr
|
||||
static AuctionHouseEntry const* GetAuctionHouseEntry(uint32 factionTemplateId);
|
||||
|
||||
public:
|
||||
//load first auction items, because of check if item exists, when loading
|
||||
|
||||
//load first auction items, because of check if item exists, when loading
|
||||
void LoadAuctionItems();
|
||||
void LoadAuctions();
|
||||
|
||||
@@ -157,6 +157,7 @@ class AuctionHouseMgr
|
||||
void Update();
|
||||
|
||||
private:
|
||||
|
||||
AuctionHouseObject mHordeAuctions;
|
||||
AuctionHouseObject mAllianceAuctions;
|
||||
AuctionHouseObject mNeutralAuctions;
|
||||
@@ -164,6 +165,6 @@ class AuctionHouseMgr
|
||||
ItemMap mAitems;
|
||||
};
|
||||
|
||||
#define auctionmgr (*ACE_Singleton<AuctionHouseMgr, ACE_Null_Mutex>::instance())
|
||||
#define sAuctionMgr (*ACE_Singleton<AuctionHouseMgr, ACE_Null_Mutex>::instance())
|
||||
|
||||
#endif
|
||||
|
||||
@@ -62,9 +62,9 @@ ArenaTeam::~ArenaTeam()
|
||||
|
||||
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;
|
||||
if (objmgr.GetArenaTeamByName(ArenaTeamName)) // arena team with this name already exist
|
||||
if (sObjectMgr.GetArenaTeamByName(ArenaTeamName)) // arena team with this name already exist
|
||||
return false;
|
||||
|
||||
sLog.outDebug("GUILD: creating arena team %s to leader: %u", ArenaTeamName.c_str(), GUID_LOPART(captainGuid));
|
||||
@@ -73,7 +73,7 @@ bool ArenaTeam::Create(uint64 captainGuid, uint32 type, std::string ArenaTeamNam
|
||||
m_Name = ArenaTeamName;
|
||||
m_Type = type;
|
||||
|
||||
m_TeamId = objmgr.GenerateArenaTeamId();
|
||||
m_TeamId = sObjectMgr.GenerateArenaTeamId();
|
||||
|
||||
// ArenaTeamName already assigned to ArenaTeam::name, use it to encode string for DB
|
||||
CharacterDatabase.escape_string(ArenaTeamName);
|
||||
@@ -103,7 +103,7 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)
|
||||
if (GetMembersSize() >= GetType() * 2)
|
||||
return false;
|
||||
|
||||
Player *pl = objmgr.GetPlayer(PlayerGuid);
|
||||
Player *pl = sObjectMgr.GetPlayer(PlayerGuid);
|
||||
if (pl)
|
||||
{
|
||||
if (pl->GetArenaTeamId(GetSlot()))
|
||||
@@ -266,7 +266,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult_AutoPtr arenaTeamMembersResult)
|
||||
void ArenaTeam::SetCaptain(const uint64& guid)
|
||||
{
|
||||
// disable remove/promote buttons
|
||||
Player *oldcaptain = objmgr.GetPlayer(GetCaptain());
|
||||
Player *oldcaptain = sObjectMgr.GetPlayer(GetCaptain());
|
||||
if (oldcaptain)
|
||||
oldcaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 1);
|
||||
|
||||
@@ -277,7 +277,7 @@ void ArenaTeam::SetCaptain(const uint64& guid)
|
||||
CharacterDatabase.PExecute("UPDATE arena_team SET captainguid = '%u' WHERE arenateamid = '%u'", GUID_LOPART(guid), GetId());
|
||||
|
||||
// enable remove/promote buttons
|
||||
Player *newcaptain = objmgr.GetPlayer(guid);
|
||||
Player *newcaptain = sObjectMgr.GetPlayer(guid);
|
||||
if (newcaptain)
|
||||
{
|
||||
newcaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 0);
|
||||
@@ -294,7 +294,7 @@ void ArenaTeam::DelMember(uint64 guid)
|
||||
break;
|
||||
}
|
||||
|
||||
if (Player *player = objmgr.GetPlayer(guid))
|
||||
if (Player *player = sObjectMgr.GetPlayer(guid))
|
||||
{
|
||||
player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);
|
||||
// delete all info regarding this team
|
||||
@@ -325,7 +325,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_stats WHERE arenateamid = '%u'", m_TeamId);
|
||||
CharacterDatabase.CommitTransaction();
|
||||
objmgr.RemoveArenaTeam(m_TeamId);
|
||||
sObjectMgr.RemoveArenaTeam(m_TeamId);
|
||||
}
|
||||
|
||||
void ArenaTeam::Roster(WorldSession *session)
|
||||
@@ -342,7 +342,7 @@ void ArenaTeam::Roster(WorldSession *session)
|
||||
|
||||
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 << uint8((pl ? 1 : 0)); // online flag
|
||||
@@ -400,7 +400,7 @@ void ArenaTeam::NotifyStatsChanged()
|
||||
// updates arena team stats for every member of the team (not only the ones who participated!)
|
||||
for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
{
|
||||
Player * plr = objmgr.GetPlayer(itr->guid);
|
||||
Player * plr = sObjectMgr.GetPlayer(itr->guid);
|
||||
if (plr)
|
||||
Stats(plr->GetSession());
|
||||
}
|
||||
@@ -473,7 +473,7 @@ void ArenaTeam::BroadcastPacket(WorldPacket *packet)
|
||||
{
|
||||
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)
|
||||
player->GetSession()->SendPacket(packet);
|
||||
}
|
||||
@@ -581,8 +581,8 @@ void ArenaTeam::FinishGame(int32 mod)
|
||||
m_stats.games_season += 1;
|
||||
// update team's rank
|
||||
m_stats.rank = 1;
|
||||
ObjectMgr::ArenaTeamMap::const_iterator i = objmgr.GetArenaTeamMapBegin();
|
||||
for (; i != objmgr.GetArenaTeamMapEnd(); ++i)
|
||||
ObjectMgr::ArenaTeamMap::const_iterator i = sObjectMgr.GetArenaTeamMapBegin();
|
||||
for (; i != sObjectMgr.GetArenaTeamMapEnd(); ++i)
|
||||
{
|
||||
if (i->second->GetType() == m_Type && i->second->GetStats().rating > m_stats.rating)
|
||||
++m_stats.rank;
|
||||
@@ -757,7 +757,7 @@ void ArenaTeam::FinishWeek()
|
||||
bool ArenaTeam::IsFighting() const
|
||||
{
|
||||
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())
|
||||
return true;
|
||||
return false;
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Trinity
|
||||
: i_msgtype(msgtype), i_textId(textId), i_source(source), i_args(args) {}
|
||||
void operator()(WorldPacket& data, int32 loc_idx)
|
||||
{
|
||||
char const* text = objmgr.GetTrinityString(i_textId,loc_idx);
|
||||
char const* text = sObjectMgr.GetTrinityString(i_textId,loc_idx);
|
||||
|
||||
if (i_args)
|
||||
{
|
||||
@@ -91,9 +91,9 @@ namespace Trinity
|
||||
: i_msgtype(msgtype), i_textId(textId), i_source(source), i_arg1(arg1), i_arg2(arg2) {}
|
||||
void operator()(WorldPacket& data, int32 loc_idx)
|
||||
{
|
||||
char const* text = objmgr.GetTrinityString(i_textId,loc_idx);
|
||||
char const* arg1str = i_arg1 ? objmgr.GetTrinityString(i_arg1,loc_idx) : "";
|
||||
char const* arg2str = i_arg2 ? objmgr.GetTrinityString(i_arg2,loc_idx) : "";
|
||||
char const* text = sObjectMgr.GetTrinityString(i_textId,loc_idx);
|
||||
char const* arg1str = i_arg1 ? sObjectMgr.GetTrinityString(i_arg1,loc_idx) : "";
|
||||
char const* arg2str = i_arg2 ? sObjectMgr.GetTrinityString(i_arg2,loc_idx) : "";
|
||||
|
||||
char str [2048];
|
||||
snprintf(str,2048,text, arg1str, arg2str);
|
||||
@@ -286,7 +286,7 @@ void Battleground::Update(uint32 diff)
|
||||
Creature *sh = NULL;
|
||||
for (std::vector<uint64>::const_iterator itr2 = (itr->second).begin(); itr2 != (itr->second).end(); ++itr2)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(*itr2);
|
||||
Player *plr = sObjectMgr.GetPlayer(*itr2);
|
||||
if (!plr)
|
||||
continue;
|
||||
|
||||
@@ -317,7 +317,7 @@ void Battleground::Update(uint32 diff)
|
||||
{
|
||||
for (std::vector<uint64>::const_iterator itr = m_ResurrectQueue.begin(); itr != m_ResurrectQueue.end(); ++itr)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(*itr);
|
||||
Player *plr = sObjectMgr.GetPlayer(*itr);
|
||||
if (!plr)
|
||||
continue;
|
||||
plr->ResurrectPlayer(1.0f);
|
||||
@@ -426,7 +426,7 @@ void Battleground::Update(uint32 diff)
|
||||
//TODO : add arena sound PlaySoundToAll(SOUND_ARENA_START);
|
||||
|
||||
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
|
||||
if (Player *plr = objmgr.GetPlayer(itr->first))
|
||||
if (Player *plr = sObjectMgr.GetPlayer(itr->first))
|
||||
{
|
||||
plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
|
||||
// remove auras with duration lower than 30s
|
||||
@@ -454,7 +454,7 @@ void Battleground::Update(uint32 diff)
|
||||
PlaySoundToAll(SOUND_BG_START);
|
||||
|
||||
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);
|
||||
//Announce BG starting
|
||||
if (sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
|
||||
@@ -507,7 +507,7 @@ void Battleground::SendPacketToAll(WorldPacket *packet)
|
||||
{
|
||||
if (itr->second.OfflineRemoveTime)
|
||||
continue;
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||
if (plr)
|
||||
plr->GetSession()->SendPacket(packet);
|
||||
else
|
||||
@@ -521,7 +521,7 @@ void Battleground::SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player *
|
||||
{
|
||||
if (itr->second.OfflineRemoveTime)
|
||||
continue;
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("Battleground:SendPacketToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
||||
@@ -554,7 +554,7 @@ void Battleground::PlaySoundToTeam(uint32 SoundID, uint32 TeamID)
|
||||
{
|
||||
if (itr->second.OfflineRemoveTime)
|
||||
continue;
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||
|
||||
if (!plr)
|
||||
{
|
||||
@@ -579,7 +579,7 @@ void Battleground::CastSpellOnTeam(uint32 SpellID, uint32 TeamID)
|
||||
{
|
||||
if (itr->second.OfflineRemoveTime)
|
||||
continue;
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||
|
||||
if (!plr)
|
||||
{
|
||||
@@ -600,7 +600,7 @@ void Battleground::YellToAll(Creature* creature, const char* text, uint32 langua
|
||||
for (std::map<uint64, BattlegroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
WorldPacket data(SMSG_MESSAGECHAT, 200);
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("Battleground: Player " UI64FMTD " not found!", itr->first);
|
||||
@@ -617,7 +617,7 @@ void Battleground::RewardHonorToTeam(uint32 Honor, uint32 TeamID)
|
||||
{
|
||||
if (itr->second.OfflineRemoveTime)
|
||||
continue;
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||
|
||||
if (!plr)
|
||||
{
|
||||
@@ -644,7 +644,7 @@ void Battleground::RewardReputationToTeam(uint32 faction_id, uint32 Reputation,
|
||||
{
|
||||
if (itr->second.OfflineRemoveTime)
|
||||
continue;
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||
|
||||
if (!plr)
|
||||
{
|
||||
@@ -713,8 +713,8 @@ void Battleground::EndBattleground(uint32 winner)
|
||||
// arena rating calculation
|
||||
if (isArena() && isRated())
|
||||
{
|
||||
winner_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(winner));
|
||||
loser_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(winner)));
|
||||
winner_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(winner));
|
||||
loser_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(winner)));
|
||||
if (winner_arena_team && loser_arena_team && winner_arena_team != loser_arena_team)
|
||||
{
|
||||
loser_rating = loser_arena_team->GetStats().rating;
|
||||
@@ -749,7 +749,7 @@ void Battleground::EndBattleground(uint32 winner)
|
||||
}
|
||||
continue;
|
||||
}
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("Battleground:EndBattleground Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
||||
@@ -902,7 +902,7 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
|
||||
|
||||
RemovePlayerFromResurrectQueue(guid);
|
||||
|
||||
Player *plr = objmgr.GetPlayer(guid);
|
||||
Player *plr = sObjectMgr.GetPlayer(guid);
|
||||
|
||||
// should remove spirit of redemption
|
||||
if (plr && plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
@@ -939,8 +939,8 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
|
||||
if (isRated() && GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
//left a rated match while the encounter was in progress, consider as loser
|
||||
ArenaTeam * winner_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
|
||||
ArenaTeam * loser_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
|
||||
ArenaTeam * winner_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
|
||||
ArenaTeam * loser_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
|
||||
if (winner_arena_team && loser_arena_team && winner_arena_team != loser_arena_team)
|
||||
loser_arena_team->MemberLost(plr,winner_arena_team->GetRating());
|
||||
}
|
||||
@@ -961,8 +961,8 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
|
||||
if (isRated() && GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
//left a rated match while the encounter was in progress, consider as loser
|
||||
ArenaTeam * others_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
|
||||
ArenaTeam * players_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
|
||||
ArenaTeam * others_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
|
||||
ArenaTeam * players_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
|
||||
if (others_arena_team && players_arena_team)
|
||||
players_arena_team->OfflineMemberLost(guid, others_arena_team->GetRating());
|
||||
}
|
||||
@@ -1336,7 +1336,7 @@ void Battleground::AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid
|
||||
{
|
||||
m_ReviveQueue[npc_guid].push_back(player_guid);
|
||||
|
||||
Player *plr = objmgr.GetPlayer(player_guid);
|
||||
Player *plr = sObjectMgr.GetPlayer(player_guid);
|
||||
if (!plr)
|
||||
return;
|
||||
|
||||
@@ -1353,7 +1353,7 @@ void Battleground::RemovePlayerFromResurrectQueue(uint64 player_guid)
|
||||
{
|
||||
(itr->second).erase(itr2);
|
||||
|
||||
Player *plr = objmgr.GetPlayer(player_guid);
|
||||
Player *plr = sObjectMgr.GetPlayer(player_guid);
|
||||
if (!plr)
|
||||
return;
|
||||
|
||||
@@ -1374,7 +1374,7 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float
|
||||
// and when loading it (in go::LoadFromDB()), a new guid would be assigned to the object, and a new object would be created
|
||||
// so we must create it specific for this instance
|
||||
GameObject * go = new GameObject;
|
||||
if (!go->Create(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))
|
||||
{
|
||||
sLog.outErrorDb("Gameobject template %u not found in database! Battleground not created!", entry);
|
||||
@@ -1387,7 +1387,7 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float
|
||||
|
||||
// without this, UseButtonOrDoor caused the crash, since it tried to get go info from godata
|
||||
// iirc that was changed, so adding to go data map is no longer required if that was the only function using godata from GameObject without checking if it existed
|
||||
GameObjectData& data = objmgr.NewGOData(guid);
|
||||
GameObjectData& data = sObjectMgr.NewGOData(guid);
|
||||
|
||||
data.id = entry;
|
||||
data.mapid = GetMapId();
|
||||
@@ -1498,7 +1498,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
|
||||
return NULL;
|
||||
|
||||
Creature* pCreature = new Creature;
|
||||
if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, teamval, x, y, z, o))
|
||||
if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, teamval, x, y, z, o))
|
||||
{
|
||||
sLog.outError("Can't create creature entry: %u",entry);
|
||||
delete pCreature;
|
||||
@@ -1507,7 +1507,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
|
||||
|
||||
pCreature->SetHomePosition(x, y, z, o);
|
||||
|
||||
CreatureInfo const *cinfo = objmgr.GetCreatureTemplate(entry);
|
||||
CreatureInfo const *cinfo = sObjectMgr.GetCreatureTemplate(entry);
|
||||
if (!cinfo)
|
||||
{
|
||||
sLog.outErrorDb("Battleground::AddCreature: entry %u does not exist.", entry);
|
||||
@@ -1539,7 +1539,7 @@ void Battleground::SpawnBGCreature(uint32 type, uint32 respawntime)
|
||||
{
|
||||
//obj->Respawn(); // bugged
|
||||
obj->SetRespawnTime(0);
|
||||
objmgr.SaveCreatureRespawnTime(obj->GetGUIDLow(), GetInstanceID(), 0);
|
||||
sObjectMgr.SaveCreatureRespawnTime(obj->GetGUIDLow(), GetInstanceID(), 0);
|
||||
map->Add(obj);
|
||||
}
|
||||
}
|
||||
@@ -1642,7 +1642,7 @@ void Battleground::PSendMessageToAll(int32 entry, ChatMsg type, Player const* so
|
||||
|
||||
void Battleground::SendWarningToAll(int32 entry, ...)
|
||||
{
|
||||
const char *format = objmgr.GetTrinityStringForDBCLocale(entry);
|
||||
const char *format = sObjectMgr.GetTrinityStringForDBCLocale(entry);
|
||||
va_list ap;
|
||||
char str [1024];
|
||||
va_start(ap, entry);
|
||||
@@ -1686,7 +1686,7 @@ void Battleground::EndNow()
|
||||
const char *Battleground::GetTrinityString(int32 entry)
|
||||
{
|
||||
// FIXME: now we have different DBC locales and need localized message for each target client
|
||||
return objmgr.GetTrinityStringForDBCLocale(entry);
|
||||
return sObjectMgr.GetTrinityStringForDBCLocale(entry);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1743,7 +1743,7 @@ void Battleground::HandleKillPlayer(Player *player, Player *killer)
|
||||
|
||||
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)
|
||||
continue;
|
||||
@@ -1809,7 +1809,7 @@ uint32 Battleground::GetAlivePlayersCountByTeam(uint32 Team) const
|
||||
{
|
||||
if (itr->second.Team == Team)
|
||||
{
|
||||
Player * pl = objmgr.GetPlayer(itr->first);
|
||||
Player * pl = sObjectMgr.GetPlayer(itr->first);
|
||||
if (pl && pl->isAlive() && !pl->HasByteFlag(UNIT_FIELD_BYTES_2, 3, FORM_SPIRITOFREDEMPTION))
|
||||
++count;
|
||||
}
|
||||
@@ -1862,7 +1862,7 @@ void Battleground::SetBgRaid(uint32 TeamID, Group *bg_raid)
|
||||
|
||||
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
|
||||
|
||||
@@ -252,7 +252,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket *data, Battleground *bg)
|
||||
for (int i = 1; i >= 0; --i)
|
||||
{
|
||||
uint32 at_id = bg->m_ArenaTeamIds[i];
|
||||
ArenaTeam * at = objmgr.GetArenaTeamById(at_id);
|
||||
ArenaTeam * at = sObjectMgr.GetArenaTeamById(at_id);
|
||||
if (at)
|
||||
*data << at->GetName();
|
||||
else
|
||||
@@ -284,7 +284,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket *data, Battleground *bg)
|
||||
}
|
||||
else
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||
uint32 team = bg->GetPlayerTeam(itr->first);
|
||||
if (!team && plr)
|
||||
team = plr->GetBGTeam();
|
||||
@@ -757,7 +757,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
|
||||
}
|
||||
|
||||
selectionWeight = fields[9].GetUInt8();
|
||||
scriptId = objmgr.GetScriptId(fields[10].GetString());
|
||||
scriptId = sObjectMgr.GetScriptId(fields[10].GetString());
|
||||
//sLog.outDetail("Creating battleground %s, %u-%u", bl->name[sWorld.GetDBClang()], MinLvl, MaxLvl);
|
||||
if (!CreateBattleground(bgTypeID, IsArena, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl, bl->name[sWorld.GetDefaultDbcLocale()], bl->mapid[0], AStartLoc[0], AStartLoc[1], AStartLoc[2], AStartLoc[3], HStartLoc[0], HStartLoc[1], HStartLoc[2], HStartLoc[3], scriptId))
|
||||
continue;
|
||||
@@ -805,7 +805,7 @@ void BattlegroundMgr::DistributeArenaPoints()
|
||||
std::map<uint32, uint32> PlayerPoints;
|
||||
|
||||
//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)
|
||||
at->UpdateArenaPointsHelper(PlayerPoints);
|
||||
|
||||
@@ -816,7 +816,7 @@ void BattlegroundMgr::DistributeArenaPoints()
|
||||
CharacterDatabase.PExecute("UPDATE characters SET arenaPoints = arenaPoints + '%u' WHERE guid = '%u'", plr_itr->second, plr_itr->first);
|
||||
|
||||
//add points to player if online
|
||||
Player* pl = objmgr.GetPlayer(plr_itr->first);
|
||||
Player* pl = sObjectMgr.GetPlayer(plr_itr->first);
|
||||
if (pl)
|
||||
pl->ModifyArenaPoints(plr_itr->second);
|
||||
}
|
||||
@@ -826,7 +826,7 @@ void BattlegroundMgr::DistributeArenaPoints()
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_END);
|
||||
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_START);
|
||||
for (ObjectMgr::ArenaTeamMap::iterator titr = objmgr.GetArenaTeamMapBegin(); titr != objmgr.GetArenaTeamMapEnd(); ++titr)
|
||||
for (ObjectMgr::ArenaTeamMap::iterator titr = sObjectMgr.GetArenaTeamMapBegin(); titr != sObjectMgr.GetArenaTeamMapEnd(); ++titr)
|
||||
{
|
||||
if (ArenaTeam * at = titr->second)
|
||||
{
|
||||
|
||||
@@ -155,7 +155,7 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg
|
||||
//announce world (this don't need mutex)
|
||||
if (isRated && sWorld.getConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
|
||||
{
|
||||
ArenaTeam *Team = objmgr.GetArenaTeamById(arenateamid);
|
||||
ArenaTeam *Team = sObjectMgr.GetArenaTeamById(arenateamid);
|
||||
if (Team)
|
||||
sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, Team->GetName().c_str(), ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating);
|
||||
}
|
||||
@@ -279,7 +279,7 @@ uint32 BattlegroundQueue::GetAverageQueueWaitTime(GroupQueueInfo* ginfo, Battleg
|
||||
//remove player from queue and from group info, if group info is empty then remove it too
|
||||
void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCount)
|
||||
{
|
||||
//Player *plr = objmgr.GetPlayer(guid);
|
||||
//Player *plr = sObjectMgr.GetPlayer(guid);
|
||||
|
||||
int32 bracket_id = -1; // signed for proper for-loop finish
|
||||
QueuedPlayersMap::iterator itr;
|
||||
@@ -350,7 +350,7 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou
|
||||
// announce to world if arena team left queue for rated match, show only once
|
||||
if (group->ArenaType && group->IsRated && group->Players.empty() && sWorld.getConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
|
||||
{
|
||||
ArenaTeam *Team = objmgr.GetArenaTeamById(group->ArenaTeamId);
|
||||
ArenaTeam *Team = sObjectMgr.GetArenaTeamById(group->ArenaTeamId);
|
||||
if (Team)
|
||||
sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, Team->GetName().c_str(), group->ArenaType, group->ArenaType, group->ArenaTeamRating);
|
||||
}
|
||||
@@ -358,11 +358,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 (group->IsInvitedToBGInstanceGUID && group->IsRated && decreaseInvitedCount)
|
||||
{
|
||||
ArenaTeam * at = objmgr.GetArenaTeamById(group->ArenaTeamId);
|
||||
ArenaTeam * at = sObjectMgr.GetArenaTeamById(group->ArenaTeamId);
|
||||
if (at)
|
||||
{
|
||||
sLog.outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u", GUID_LOPART(guid), group->OpponentsTeamRating);
|
||||
Player *plr = objmgr.GetPlayer(guid);
|
||||
Player *plr = sObjectMgr.GetPlayer(guid);
|
||||
if (plr)
|
||||
at->MemberLost(plr, group->OpponentsTeamRating);
|
||||
else
|
||||
@@ -384,7 +384,7 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou
|
||||
{
|
||||
// remove next player, this is recursive
|
||||
// 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);
|
||||
BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(group->BgTypeId, group->ArenaType);
|
||||
@@ -443,7 +443,7 @@ bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, Battleground * b
|
||||
for (std::map<uint64,PlayerQueueInfo*>::iterator itr = ginfo->Players.begin(); itr != ginfo->Players.end(); ++itr)
|
||||
{
|
||||
// get the player
|
||||
Player* plr = 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 (!plr)
|
||||
continue;
|
||||
@@ -1014,7 +1014,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI
|
||||
|
||||
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)
|
||||
if (!plr)
|
||||
return true;
|
||||
@@ -1057,7 +1057,7 @@ void BGQueueInviteEvent::Abort(uint64 /*e_time*/)
|
||||
*/
|
||||
bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
||||
{
|
||||
Player* plr = objmgr.GetPlayer(m_PlayerGuid);
|
||||
Player* plr = sObjectMgr.GetPlayer(m_PlayerGuid);
|
||||
if (!plr)
|
||||
// player logged off (we should do nothing, he is correctly removed from queue in another procedure)
|
||||
return true;
|
||||
|
||||
@@ -413,7 +413,7 @@ void BattlegroundAB::_NodeDeOccupied(uint8 node)
|
||||
WorldSafeLocsEntry const *ClosestGrave = NULL;
|
||||
for (std::vector<uint64>::const_iterator itr = ghost_list.begin(); itr != ghost_list.end(); ++itr)
|
||||
{
|
||||
Player* plr = objmgr.GetPlayer(*itr);
|
||||
Player* plr = sObjectMgr.GetPlayer(*itr);
|
||||
if (!plr)
|
||||
continue;
|
||||
|
||||
|
||||
@@ -291,7 +291,7 @@ Creature* BattlegroundAV::AddAVCreature(uint16 cinfoid, uint16 type)
|
||||
if (!isStatic && ((cinfoid >= AV_NPC_A_GRAVEDEFENSE0 && cinfoid <= AV_NPC_A_GRAVEDEFENSE3)
|
||||
|| (cinfoid >= AV_NPC_H_GRAVEDEFENSE0 && cinfoid <= AV_NPC_H_GRAVEDEFENSE3)))
|
||||
{
|
||||
CreatureData &data = objmgr.NewOrExistCreatureData(creature->GetDBTableGUIDLow());
|
||||
CreatureData &data = sObjectMgr.NewOrExistCreatureData(creature->GetDBTableGUIDLow());
|
||||
data.spawndist = 5;
|
||||
}
|
||||
//else spawndist will be 15, so creatures move maximum=10
|
||||
@@ -1031,7 +1031,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
||||
WorldSafeLocsEntry const *ClosestGrave = NULL;
|
||||
for (std::vector<uint64>::iterator itr = ghost_list.begin(); itr != ghost_list.end(); ++itr)
|
||||
{
|
||||
plr = objmgr.GetPlayer(*ghost_list.begin());
|
||||
plr = sObjectMgr.GetPlayer(*ghost_list.begin());
|
||||
if (!plr)
|
||||
continue;
|
||||
if (!ClosestGrave)
|
||||
|
||||
@@ -150,7 +150,7 @@ void BattlegroundEY::CheckSomeoneJoinedPoint()
|
||||
uint8 j = 0;
|
||||
while (j < m_PlayersNearPoint[EY_POINTS_MAX].size())
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(m_PlayersNearPoint[EY_POINTS_MAX][j]);
|
||||
Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[EY_POINTS_MAX][j]);
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("BattlegroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[EY_POINTS_MAX][j]));
|
||||
@@ -190,7 +190,7 @@ void BattlegroundEY::CheckSomeoneLeftPoint()
|
||||
uint8 j = 0;
|
||||
while (j < m_PlayersNearPoint[i].size())
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(m_PlayersNearPoint[i][j]);
|
||||
Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[i][j]);
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("BattlegroundEY:CheckSomeoneLeftPoint Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j]));
|
||||
@@ -245,7 +245,7 @@ void BattlegroundEY::UpdatePointStatuses()
|
||||
|
||||
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)
|
||||
{
|
||||
this->UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[point], plr);
|
||||
|
||||
@@ -232,7 +232,7 @@ void BattlegroundSA::StartShips()
|
||||
{
|
||||
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end();itr++)
|
||||
{
|
||||
if (Player* p = objmgr.GetPlayer(itr->first))
|
||||
if (Player* p = sObjectMgr.GetPlayer(itr->first))
|
||||
{
|
||||
if (p->GetTeamId() != attackers)
|
||||
continue;
|
||||
@@ -462,7 +462,7 @@ void BattlegroundSA::TeleportPlayers()
|
||||
{
|
||||
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
|
||||
{
|
||||
if (Player *plr = objmgr.GetPlayer(itr->first))
|
||||
if (Player *plr = sObjectMgr.GetPlayer(itr->first))
|
||||
{
|
||||
// should remove spirit of redemption
|
||||
if (plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
|
||||
@@ -144,20 +144,20 @@ void BattlegroundWS::Update(uint32 diff)
|
||||
m_FlagSpellForceTimer += diff;
|
||||
if (m_FlagDebuffState == 0 && m_FlagSpellForceTimer >= 600000) //10 minutes
|
||||
{
|
||||
if (Player * plr = objmgr.GetPlayer(m_FlagKeepers[0]))
|
||||
if (Player * plr = sObjectMgr.GetPlayer(m_FlagKeepers[0]))
|
||||
plr->CastSpell(plr,WS_SPELL_FOCUSED_ASSAULT,true);
|
||||
if (Player * plr = objmgr.GetPlayer(m_FlagKeepers[1]))
|
||||
if (Player * plr = sObjectMgr.GetPlayer(m_FlagKeepers[1]))
|
||||
plr->CastSpell(plr,WS_SPELL_FOCUSED_ASSAULT,true);
|
||||
m_FlagDebuffState = 1;
|
||||
}
|
||||
else if (m_FlagDebuffState == 1 && m_FlagSpellForceTimer >= 900000) //15 minutes
|
||||
{
|
||||
if (Player * plr = objmgr.GetPlayer(m_FlagKeepers[0]))
|
||||
if (Player * plr = sObjectMgr.GetPlayer(m_FlagKeepers[0]))
|
||||
{
|
||||
plr->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
|
||||
plr->CastSpell(plr,WS_SPELL_BRUTAL_ASSAULT,true);
|
||||
}
|
||||
if (Player * plr = objmgr.GetPlayer(m_FlagKeepers[1]))
|
||||
if (Player * plr = sObjectMgr.GetPlayer(m_FlagKeepers[1]))
|
||||
{
|
||||
plr->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
|
||||
plr->CastSpell(plr,WS_SPELL_BRUTAL_ASSAULT,true);
|
||||
|
||||
@@ -156,7 +156,7 @@ void Channel::Join(uint64 p, const char *pass)
|
||||
return;
|
||||
}
|
||||
|
||||
Player *plr = objmgr.GetPlayer(p);
|
||||
Player *plr = sObjectMgr.GetPlayer(p);
|
||||
|
||||
if (plr)
|
||||
{
|
||||
@@ -216,7 +216,7 @@ void Channel::Leave(uint64 p, bool send)
|
||||
}
|
||||
else
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(p);
|
||||
Player *plr = sObjectMgr.GetPlayer(p);
|
||||
|
||||
if (send)
|
||||
{
|
||||
@@ -252,7 +252,7 @@ void Channel::Leave(uint64 p, bool send)
|
||||
void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
|
||||
{
|
||||
AccountTypes sec = SEC_PLAYER;
|
||||
Player *gplr = objmgr.GetPlayer(good);
|
||||
Player *gplr = sObjectMgr.GetPlayer(good);
|
||||
if (gplr)
|
||||
sec = gplr->GetSession()->GetSecurity();
|
||||
|
||||
@@ -270,7 +270,7 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
|
||||
}
|
||||
else
|
||||
{
|
||||
Player *bad = objmgr.GetPlayer(badname);
|
||||
Player *bad = sObjectMgr.GetPlayer(badname);
|
||||
if (bad == NULL || !IsOn(bad->GetGUID()))
|
||||
{
|
||||
WorldPacket data;
|
||||
@@ -316,7 +316,7 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
|
||||
void Channel::UnBan(uint64 good, const char *badname)
|
||||
{
|
||||
uint32 sec = 0;
|
||||
Player *gplr = objmgr.GetPlayer(good);
|
||||
Player *gplr = sObjectMgr.GetPlayer(good);
|
||||
if (gplr)
|
||||
sec = gplr->GetSession()->GetSecurity();
|
||||
|
||||
@@ -334,7 +334,7 @@ void Channel::UnBan(uint64 good, const char *badname)
|
||||
}
|
||||
else
|
||||
{
|
||||
Player *bad = objmgr.GetPlayer(badname);
|
||||
Player *bad = sObjectMgr.GetPlayer(badname);
|
||||
if (bad == NULL || !IsBanned(bad->GetGUID()))
|
||||
{
|
||||
WorldPacket data;
|
||||
@@ -358,7 +358,7 @@ void Channel::Password(uint64 p, const char *pass)
|
||||
{
|
||||
std::string plName;
|
||||
uint32 sec = 0;
|
||||
Player *plr = objmgr.GetPlayer(p);
|
||||
Player *plr = sObjectMgr.GetPlayer(p);
|
||||
if (plr)
|
||||
sec = plr->GetSession()->GetSecurity();
|
||||
|
||||
@@ -396,7 +396,7 @@ void Channel::Password(uint64 p, const char *pass)
|
||||
|
||||
void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(p);
|
||||
Player *plr = sObjectMgr.GetPlayer(p);
|
||||
if (!plr)
|
||||
return;
|
||||
|
||||
@@ -416,7 +416,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
|
||||
}
|
||||
else
|
||||
{
|
||||
Player *newp = objmgr.GetPlayer(p2n);
|
||||
Player *newp = sObjectMgr.GetPlayer(p2n);
|
||||
if (!newp)
|
||||
{
|
||||
WorldPacket data;
|
||||
@@ -464,7 +464,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
|
||||
|
||||
void Channel::SetOwner(uint64 p, const char *newname)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(p);
|
||||
Player *plr = sObjectMgr.GetPlayer(p);
|
||||
if (!plr)
|
||||
return;
|
||||
|
||||
@@ -486,7 +486,7 @@ void Channel::SetOwner(uint64 p, const char *newname)
|
||||
return;
|
||||
}
|
||||
|
||||
Player *newp = objmgr.GetPlayer(newname);
|
||||
Player *newp = sObjectMgr.GetPlayer(newname);
|
||||
if (newp == NULL || !IsOn(newp->GetGUID()))
|
||||
{
|
||||
WorldPacket data;
|
||||
@@ -548,7 +548,7 @@ void Channel::List(Player* player)
|
||||
uint32 count = 0;
|
||||
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
|
||||
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
|
||||
@@ -570,7 +570,7 @@ void Channel::List(Player* player)
|
||||
void Channel::Announce(uint64 p)
|
||||
{
|
||||
uint32 sec = 0;
|
||||
Player *plr = objmgr.GetPlayer(p);
|
||||
Player *plr = sObjectMgr.GetPlayer(p);
|
||||
if (plr)
|
||||
sec = plr->GetSession()->GetSecurity();
|
||||
|
||||
@@ -605,7 +605,7 @@ void Channel::Announce(uint64 p)
|
||||
void Channel::Moderate(uint64 p)
|
||||
{
|
||||
uint32 sec = 0;
|
||||
Player *plr = objmgr.GetPlayer(p);
|
||||
Player *plr = sObjectMgr.GetPlayer(p);
|
||||
if (plr)
|
||||
sec = plr->GetSession()->GetSecurity();
|
||||
|
||||
@@ -644,7 +644,7 @@ void Channel::Say(uint64 p, const char *what, uint32 lang)
|
||||
lang = LANG_UNIVERSAL;
|
||||
|
||||
uint32 sec = 0;
|
||||
Player *plr = objmgr.GetPlayer(p);
|
||||
Player *plr = sObjectMgr.GetPlayer(p);
|
||||
if (plr)
|
||||
sec = plr->GetSession()->GetSecurity();
|
||||
|
||||
@@ -695,7 +695,7 @@ void Channel::Invite(uint64 p, const char *newname)
|
||||
return;
|
||||
}
|
||||
|
||||
Player *newp = objmgr.GetPlayer(newname);
|
||||
Player *newp = sObjectMgr.GetPlayer(newname);
|
||||
if (!newp)
|
||||
{
|
||||
WorldPacket data;
|
||||
@@ -712,7 +712,7 @@ void Channel::Invite(uint64 p, const char *newname)
|
||||
return;
|
||||
}
|
||||
|
||||
Player *plr = objmgr.GetPlayer(p);
|
||||
Player *plr = sObjectMgr.GetPlayer(p);
|
||||
if (!plr)
|
||||
return;
|
||||
|
||||
@@ -779,7 +779,7 @@ void Channel::SendToAll(WorldPacket *data, uint64 p)
|
||||
{
|
||||
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 (!p || !plr->GetSocial()->HasIgnore(GUID_LOPART(p)))
|
||||
@@ -794,7 +794,7 @@ void Channel::SendToAllButOne(WorldPacket *data, uint64 who)
|
||||
{
|
||||
if (i->first != who)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(i->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(i->first);
|
||||
if (plr)
|
||||
plr->GetSession()->SendPacket(data);
|
||||
}
|
||||
@@ -803,7 +803,7 @@ void Channel::SendToAllButOne(WorldPacket *data, uint64 who)
|
||||
|
||||
void Channel::SendToOne(WorldPacket *data, uint64 who)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(who);
|
||||
Player *plr = sObjectMgr.GetPlayer(who);
|
||||
if (plr)
|
||||
plr->GetSession()->SendPacket(data);
|
||||
}
|
||||
@@ -907,7 +907,7 @@ void Channel::MakeChannelOwner(WorldPacket *data)
|
||||
{
|
||||
std::string name = "";
|
||||
|
||||
if (!objmgr.GetPlayerNameByGUID(m_ownerGUID, name) || name.empty())
|
||||
if (!sObjectMgr.GetPlayerNameByGUID(m_ownerGUID, name) || name.empty())
|
||||
name = "PLAYER_NOT_FOUND";
|
||||
|
||||
MakeNotifyPacket(data, CHAT_CHANNEL_OWNER_NOTICE);
|
||||
|
||||
@@ -815,7 +815,7 @@ bool ChatHandler::HasLowerSecurity(Player* target, uint64 guid, bool strong)
|
||||
if (target)
|
||||
target_session = target->GetSession();
|
||||
else if (guid)
|
||||
target_account = objmgr.GetPlayerAccountIdByGUID(guid);
|
||||
target_account = sObjectMgr.GetPlayerAccountIdByGUID(guid);
|
||||
|
||||
if (!target_session && !target_account)
|
||||
{
|
||||
@@ -842,7 +842,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
|
||||
if (target)
|
||||
target_sec = target->GetSecurity();
|
||||
else if (target_account)
|
||||
target_sec = accmgr.GetSecurity(target_account);
|
||||
target_sec = sAccountMgr.GetSecurity(target_account);
|
||||
else
|
||||
return true; // caller must report error for (target == NULL && target_account == 0)
|
||||
|
||||
@@ -1316,7 +1316,7 @@ valid examples:
|
||||
// read item entry
|
||||
reader.getline(buffer, 256, ':');
|
||||
|
||||
linkedItem= objmgr.GetItemPrototype(atoi(buffer));
|
||||
linkedItem= sObjectMgr.GetItemPrototype(atoi(buffer));
|
||||
if (!linkedItem)
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
@@ -1395,7 +1395,7 @@ valid examples:
|
||||
c = reader.peek();
|
||||
}
|
||||
|
||||
linkedQuest = objmgr.GetQuestTemplate(questid);
|
||||
linkedQuest = sObjectMgr.GetQuestTemplate(questid);
|
||||
|
||||
if (!linkedQuest)
|
||||
{
|
||||
@@ -1566,7 +1566,7 @@ valid examples:
|
||||
if (linkedSpell->Attributes & SPELL_ATTR_TRADESPELL)
|
||||
{
|
||||
// lookup skillid
|
||||
SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(linkedSpell->Id);
|
||||
SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(linkedSpell->Id);
|
||||
if (bounds.first == bounds.second)
|
||||
{
|
||||
return false;
|
||||
@@ -1613,7 +1613,7 @@ valid examples:
|
||||
{
|
||||
if (linkedQuest->GetTitle() != buffer)
|
||||
{
|
||||
QuestLocale const *ql = objmgr.GetQuestLocale(linkedQuest->GetQuestId());
|
||||
QuestLocale const *ql = sObjectMgr.GetQuestLocale(linkedQuest->GetQuestId());
|
||||
|
||||
if (!ql)
|
||||
{
|
||||
@@ -1654,12 +1654,12 @@ valid examples:
|
||||
|
||||
if (expectedName != buffer)
|
||||
{
|
||||
ItemLocale const *il = objmgr.GetItemLocale(linkedItem->ItemId);
|
||||
ItemLocale const *il = sObjectMgr.GetItemLocale(linkedItem->ItemId);
|
||||
|
||||
bool foundName = false;
|
||||
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())
|
||||
// using strange database/client combinations can lead to this case
|
||||
expectedName = linkedItem->Name1;
|
||||
@@ -1911,7 +1911,7 @@ Player * ChatHandler::getSelectedPlayer()
|
||||
if (guid == 0)
|
||||
return m_session->GetPlayer();
|
||||
|
||||
return objmgr.GetPlayer(guid);
|
||||
return sObjectMgr.GetPlayer(guid);
|
||||
}
|
||||
|
||||
Unit* ChatHandler::getSelectedUnit()
|
||||
@@ -2114,7 +2114,7 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid
|
||||
|
||||
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
|
||||
CellPair p(Trinity::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY()));
|
||||
@@ -2214,9 +2214,9 @@ GameTele const* ChatHandler::extractGameTeleFromLink(char* text)
|
||||
// id case (explicit or from shift link)
|
||||
if (cId[0] >= '0' || cId[0] >= '9')
|
||||
if (uint32 id = atoi(cId))
|
||||
return objmgr.GetGameTele(id);
|
||||
return sObjectMgr.GetGameTele(id);
|
||||
|
||||
return objmgr.GetGameTele(cId);
|
||||
return sObjectMgr.GetGameTele(cId);
|
||||
}
|
||||
|
||||
enum GuidLinkType
|
||||
@@ -2253,10 +2253,10 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
|
||||
if (!normalizePlayerName(name))
|
||||
return 0;
|
||||
|
||||
if (Player* player = objmgr.GetPlayer(name.c_str()))
|
||||
if (Player* player = sObjectMgr.GetPlayer(name.c_str()))
|
||||
return player->GetGUID();
|
||||
|
||||
if (uint64 guid = objmgr.GetPlayerGUIDByName(name))
|
||||
if (uint64 guid = sObjectMgr.GetPlayerGUIDByName(name))
|
||||
return guid;
|
||||
|
||||
return 0;
|
||||
@@ -2265,7 +2265,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
|
||||
{
|
||||
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);
|
||||
else
|
||||
return 0;
|
||||
@@ -2274,7 +2274,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
|
||||
{
|
||||
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);
|
||||
else
|
||||
return 0;
|
||||
@@ -2311,14 +2311,14 @@ bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* playe
|
||||
return false;
|
||||
}
|
||||
|
||||
Player* pl = objmgr.GetPlayer(name.c_str());
|
||||
Player* pl = sObjectMgr.GetPlayer(name.c_str());
|
||||
|
||||
// if allowed player pointer
|
||||
if (player)
|
||||
*player = pl;
|
||||
|
||||
// if need guid value from DB (in name case for check player existence)
|
||||
uint64 guid = !pl && (player_guid || player_name) ? 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 (player_guid)
|
||||
@@ -2404,7 +2404,7 @@ int ChatHandler::GetSessionDbLocaleIndex() const
|
||||
|
||||
const char *CliHandler::GetTrinityString(int32 entry) const
|
||||
{
|
||||
return objmgr.GetTrinityStringForDBCLocale(entry);
|
||||
return sObjectMgr.GetTrinityStringForDBCLocale(entry);
|
||||
}
|
||||
|
||||
bool CliHandler::isAvailable(ChatCommand const& cmd) const
|
||||
@@ -2446,9 +2446,9 @@ bool ChatHandler::GetPlayerGroupAndGUIDByName(const char* cname, Player* &plr, G
|
||||
return false;
|
||||
}
|
||||
|
||||
plr = objmgr.GetPlayer(name.c_str());
|
||||
plr = sObjectMgr.GetPlayer(name.c_str());
|
||||
if (offline)
|
||||
guid = objmgr.GetPlayerGUIDByName(name.c_str());
|
||||
guid = sObjectMgr.GetPlayerGUIDByName(name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2480,5 +2480,5 @@ LocaleConstant CliHandler::GetSessionDbcLocale() const
|
||||
|
||||
int CliHandler::GetSessionDbLocaleIndex() const
|
||||
{
|
||||
return objmgr.GetDBCLocaleIndex();
|
||||
return sObjectMgr.GetDBCLocaleIndex();
|
||||
}
|
||||
|
||||
@@ -777,7 +777,7 @@ bool ChatHandler::HandleDebugSpawnVehicle(const char* args)
|
||||
|
||||
uint32 id = (uint32)atoi(i);
|
||||
|
||||
CreatureInfo const *ci = objmgr.GetCreatureTemplate(entry);
|
||||
CreatureInfo const *ci = sObjectMgr.GetCreatureTemplate(entry);
|
||||
|
||||
if (!ci)
|
||||
return false;
|
||||
@@ -791,7 +791,7 @@ bool ChatHandler::HandleDebugSpawnVehicle(const char* args)
|
||||
|
||||
Map *map = m_session->GetPlayer()->GetMap();
|
||||
|
||||
if (!v->Create(objmgr.GenerateLowGuid(HIGHGUID_VEHICLE), map, m_session->GetPlayer()->GetPhaseMask(), entry, id, m_session->GetPlayer()->GetTeam(), x, y, z, o))
|
||||
if (!v->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_VEHICLE), map, m_session->GetPlayer()->GetPhaseMask(), entry, id, m_session->GetPlayer()->GetTeam(), x, y, z, o))
|
||||
{
|
||||
delete v;
|
||||
return false;
|
||||
|
||||
@@ -205,7 +205,7 @@ bool ChatHandler::HandleAccountPasswordCommand(const char* args)
|
||||
std::string password_new = new_pass;
|
||||
std::string password_new_c = new_pass_c;
|
||||
|
||||
if (!accmgr.CheckPassword(m_session->GetAccountId(), password_old))
|
||||
if (!sAccountMgr.CheckPassword(m_session->GetAccountId(), password_old))
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_WRONGOLDPASSWORD);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -219,7 +219,7 @@ bool ChatHandler::HandleAccountPasswordCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
AccountOpResult result = accmgr.ChangePassword(m_session->GetAccountId(), password_new);
|
||||
AccountOpResult result = sAccountMgr.ChangePassword(m_session->GetAccountId(), password_new);
|
||||
switch(result)
|
||||
{
|
||||
case AOR_OK:
|
||||
|
||||
@@ -129,7 +129,7 @@ bool ChatHandler::HandleNpcWhisperCommand(const char* args)
|
||||
uint64 receiver_guid= atol(receiver_str);
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(objmgr.GetPlayer(receiver_guid), 0))
|
||||
if (HasLowerSecurity(sObjectMgr.GetPlayer(receiver_guid), 0))
|
||||
return false;
|
||||
|
||||
pCreature->MonsterWhisper(text,receiver_guid);
|
||||
@@ -302,7 +302,7 @@ std::string ChatHandler::PGetParseString(int32 entry, ...)
|
||||
bool ChatHandler::HandleGMTicketListCommand(const char* /*args*/)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETSHOWLIST);
|
||||
for (GmTicketList::iterator itr = objmgr.m_GMTicketList.begin(); itr != objmgr.m_GMTicketList.end(); ++itr)
|
||||
for (GmTicketList::iterator itr = sObjectMgr.m_GMTicketList.begin(); itr != sObjectMgr.m_GMTicketList.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->closed != 0)
|
||||
continue;
|
||||
@@ -312,7 +312,7 @@ bool ChatHandler::HandleGMTicketListCommand(const char* /*args*/)
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, (*itr)->name.c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGECREATE, (secsToTimeString(time(NULL) - (*itr)->createtime, true, false)).c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - (*itr)->timestamp, true, false)).c_str());
|
||||
if (objmgr.GetPlayerNameByGUID((*itr)->assignedToGM, gmname))
|
||||
if (sObjectMgr.GetPlayerNameByGUID((*itr)->assignedToGM, gmname))
|
||||
{
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str());
|
||||
}
|
||||
@@ -324,9 +324,9 @@ bool ChatHandler::HandleGMTicketListCommand(const char* /*args*/)
|
||||
bool ChatHandler::HandleGMTicketListOnlineCommand(const char* /*args*/)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETSHOWONLINELIST);
|
||||
for (GmTicketList::iterator itr = objmgr.m_GMTicketList.begin(); itr != objmgr.m_GMTicketList.end(); ++itr)
|
||||
for (GmTicketList::iterator itr = sObjectMgr.m_GMTicketList.begin(); itr != sObjectMgr.m_GMTicketList.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->closed != 0 || !objmgr.GetPlayer((*itr)->playerGuid))
|
||||
if ((*itr)->closed != 0 || !sObjectMgr.GetPlayer((*itr)->playerGuid))
|
||||
continue;
|
||||
|
||||
std::string gmname;
|
||||
@@ -335,7 +335,7 @@ bool ChatHandler::HandleGMTicketListOnlineCommand(const char* /*args*/)
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, (*itr)->name.c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGECREATE, (secsToTimeString(time(NULL) - (*itr)->createtime, true, false)).c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - (*itr)->timestamp, true, false)).c_str());
|
||||
if (objmgr.GetPlayerNameByGUID((*itr)->assignedToGM, gmname))
|
||||
if (sObjectMgr.GetPlayerNameByGUID((*itr)->assignedToGM, gmname))
|
||||
{
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str());
|
||||
}
|
||||
@@ -347,7 +347,7 @@ bool ChatHandler::HandleGMTicketListOnlineCommand(const char* /*args*/)
|
||||
bool ChatHandler::HandleGMTicketListClosedCommand(const char* /*args*/)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETSHOWCLOSEDLIST);
|
||||
for (GmTicketList::iterator itr = objmgr.m_GMTicketList.begin(); itr != objmgr.m_GMTicketList.end(); ++itr)
|
||||
for (GmTicketList::iterator itr = sObjectMgr.m_GMTicketList.begin(); itr != sObjectMgr.m_GMTicketList.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->closed == 0)
|
||||
continue;
|
||||
@@ -358,7 +358,7 @@ bool ChatHandler::HandleGMTicketListClosedCommand(const char* /*args*/)
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, (*itr)->name.c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGECREATE, (secsToTimeString(time(NULL) - (*itr)->createtime, true, false)).c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - (*itr)->timestamp, true, false)).c_str());
|
||||
if (objmgr.GetPlayerNameByGUID((*itr)->assignedToGM, gmname))
|
||||
if (sObjectMgr.GetPlayerNameByGUID((*itr)->assignedToGM, gmname))
|
||||
{
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str());
|
||||
}
|
||||
@@ -373,7 +373,7 @@ bool ChatHandler::HandleGMTicketGetByIdCommand(const char* args)
|
||||
return false;
|
||||
|
||||
uint64 tguid = atoi(args);
|
||||
GM_Ticket *ticket = objmgr.GetGMTicket(tguid);
|
||||
GM_Ticket *ticket = sObjectMgr.GetGMTicket(tguid);
|
||||
if (!ticket || ticket->closed != 0)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
|
||||
@@ -386,7 +386,7 @@ bool ChatHandler::HandleGMTicketGetByIdCommand(const char* args)
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGECREATE, (secsToTimeString(time(NULL) - ticket->createtime, true, false)).c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - ticket->timestamp, true, false)).c_str());
|
||||
if (objmgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname))
|
||||
if (sObjectMgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname))
|
||||
{
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str());
|
||||
}
|
||||
@@ -407,14 +407,14 @@ bool ChatHandler::HandleGMTicketGetByNameCommand(const char* args)
|
||||
std::string name = (char*)args;
|
||||
normalizePlayerName(name);
|
||||
|
||||
Player *plr = objmgr.GetPlayer(name.c_str());
|
||||
Player *plr = sObjectMgr.GetPlayer(name.c_str());
|
||||
if (!plr)
|
||||
{
|
||||
SendSysMessage(LANG_NO_PLAYERS_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
GM_Ticket *ticket = objmgr.GetGMTicketByPlayer(plr->GetGUID());
|
||||
GM_Ticket *ticket = sObjectMgr.GetGMTicketByPlayer(plr->GetGUID());
|
||||
if (!ticket)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
|
||||
@@ -427,7 +427,7 @@ bool ChatHandler::HandleGMTicketGetByNameCommand(const char* args)
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGECREATE, (secsToTimeString(time(NULL) - ticket->createtime, true, false)).c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - ticket->timestamp, true, false)).c_str());
|
||||
if (objmgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname))
|
||||
if (sObjectMgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname))
|
||||
{
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str());
|
||||
}
|
||||
@@ -446,7 +446,7 @@ bool ChatHandler::HandleGMTicketCloseByIdCommand(const char* args)
|
||||
return false;
|
||||
|
||||
uint64 tguid = atoi(args);
|
||||
GM_Ticket *ticket = objmgr.GetGMTicket(tguid);
|
||||
GM_Ticket *ticket = sObjectMgr.GetGMTicket(tguid);
|
||||
if (!ticket || ticket->closed != 0)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
|
||||
@@ -462,8 +462,8 @@ bool ChatHandler::HandleGMTicketCloseByIdCommand(const char* args)
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETCLOSED, m_session->GetPlayer()->GetName());
|
||||
SendGlobalGMSysMessage(ss.str().c_str());
|
||||
Player *plr = objmgr.GetPlayer(ticket->playerGuid);
|
||||
objmgr.RemoveGMTicket(ticket, m_session->GetPlayer()->GetGUID());
|
||||
Player *plr = sObjectMgr.GetPlayer(ticket->playerGuid);
|
||||
sObjectMgr.RemoveGMTicket(ticket, m_session->GetPlayer()->GetGUID());
|
||||
|
||||
if (!plr || !plr->IsInWorld())
|
||||
return true;
|
||||
@@ -492,7 +492,7 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args)
|
||||
return false;
|
||||
|
||||
Player *cplr = m_session->GetPlayer();
|
||||
GM_Ticket *ticket = objmgr.GetGMTicket(ticketGuid);
|
||||
GM_Ticket *ticket = sObjectMgr.GetGMTicket(ticketGuid);
|
||||
|
||||
if (!ticket || ticket->closed != 0)
|
||||
{
|
||||
@@ -500,9 +500,9 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
uint64 tarGUID = objmgr.GetPlayerGUIDByName(targm.c_str());
|
||||
uint64 accid = objmgr.GetPlayerAccountIdByGUID(tarGUID);
|
||||
uint32 gmlevel = accmgr.GetSecurity(accid, realmID);
|
||||
uint64 tarGUID = sObjectMgr.GetPlayerGUIDByName(targm.c_str());
|
||||
uint64 accid = sObjectMgr.GetPlayerAccountIdByGUID(tarGUID);
|
||||
uint32 gmlevel = sAccountMgr.GetSecurity(accid, realmID);
|
||||
|
||||
if (!tarGUID || gmlevel == SEC_PLAYER)
|
||||
{
|
||||
@@ -517,7 +517,7 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args)
|
||||
}
|
||||
|
||||
std::string gmname;
|
||||
objmgr.GetPlayerNameByGUID(tarGUID, gmname);
|
||||
sObjectMgr.GetPlayerNameByGUID(tarGUID, gmname);
|
||||
if (ticket->assignedToGM != 0 && ticket->assignedToGM != cplr->GetGUID())
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->guid, gmname.c_str());
|
||||
@@ -525,7 +525,7 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args)
|
||||
}
|
||||
|
||||
ticket->assignedToGM = tarGUID;
|
||||
objmgr.AddOrUpdateGMTicket(*ticket);
|
||||
sObjectMgr.AddOrUpdateGMTicket(*ticket);
|
||||
std::stringstream ss;
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, ticket->guid);
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str());
|
||||
@@ -541,7 +541,7 @@ bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args)
|
||||
|
||||
uint64 ticketGuid = atoi(args);
|
||||
Player *cplr = m_session->GetPlayer();
|
||||
GM_Ticket *ticket = objmgr.GetGMTicket(ticketGuid);
|
||||
GM_Ticket *ticket = sObjectMgr.GetGMTicket(ticketGuid);
|
||||
|
||||
if (!ticket|| ticket->closed != 0)
|
||||
{
|
||||
@@ -555,8 +555,8 @@ bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args)
|
||||
}
|
||||
|
||||
std::string gmname;
|
||||
objmgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname);
|
||||
Player *plr = objmgr.GetPlayer(ticket->assignedToGM);
|
||||
sObjectMgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname);
|
||||
Player *plr = sObjectMgr.GetPlayer(ticket->assignedToGM);
|
||||
if (plr && plr->IsInWorld() && plr->GetSession()->GetSecurity() > cplr->GetSession()->GetSecurity())
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETUNASSIGNSECURITY);
|
||||
@@ -570,7 +570,7 @@ bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args)
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTUNASSIGNED, cplr->GetName());
|
||||
SendGlobalGMSysMessage(ss.str().c_str());
|
||||
ticket->assignedToGM = 0;
|
||||
objmgr.AddOrUpdateGMTicket(*ticket);
|
||||
sObjectMgr.AddOrUpdateGMTicket(*ticket);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -587,7 +587,7 @@ bool ChatHandler::HandleGMTicketCommentCommand(const char* args)
|
||||
return false;
|
||||
|
||||
Player *cplr = m_session->GetPlayer();
|
||||
GM_Ticket *ticket = objmgr.GetGMTicket(ticketGuid);
|
||||
GM_Ticket *ticket = sObjectMgr.GetGMTicket(ticketGuid);
|
||||
|
||||
if (!ticket || ticket->closed != 0)
|
||||
{
|
||||
@@ -601,13 +601,13 @@ bool ChatHandler::HandleGMTicketCommentCommand(const char* args)
|
||||
}
|
||||
|
||||
std::string gmname;
|
||||
objmgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname);
|
||||
sObjectMgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname);
|
||||
ticket->comment = comment;
|
||||
objmgr.AddOrUpdateGMTicket(*ticket);
|
||||
sObjectMgr.AddOrUpdateGMTicket(*ticket);
|
||||
std::stringstream ss;
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, ticket->guid);
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str());
|
||||
if (objmgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname))
|
||||
if (sObjectMgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname))
|
||||
{
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str());
|
||||
}
|
||||
@@ -621,7 +621,7 @@ bool ChatHandler::HandleGMTicketDeleteByIdCommand(const char* args)
|
||||
if (!*args)
|
||||
return false;
|
||||
uint64 ticketGuid = atoi(args);
|
||||
GM_Ticket *ticket = objmgr.GetGMTicket(ticketGuid);
|
||||
GM_Ticket *ticket = sObjectMgr.GetGMTicket(ticketGuid);
|
||||
|
||||
if (!ticket)
|
||||
{
|
||||
@@ -639,8 +639,8 @@ bool ChatHandler::HandleGMTicketDeleteByIdCommand(const char* args)
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETDELETED, m_session->GetPlayer()->GetName());
|
||||
SendGlobalGMSysMessage(ss.str().c_str());
|
||||
Player *plr = objmgr.GetPlayer(ticket->playerGuid);
|
||||
objmgr.RemoveGMTicket(ticket, -1, true);
|
||||
Player *plr = sObjectMgr.GetPlayer(ticket->playerGuid);
|
||||
sObjectMgr.RemoveGMTicket(ticket, -1, true);
|
||||
if (plr && plr->IsInWorld())
|
||||
{
|
||||
// Force abandon ticket
|
||||
@@ -655,7 +655,7 @@ bool ChatHandler::HandleGMTicketDeleteByIdCommand(const char* args)
|
||||
|
||||
bool ChatHandler::HandleGMTicketReloadCommand(const char*)
|
||||
{
|
||||
objmgr.LoadGMTickets();
|
||||
sObjectMgr.LoadGMTickets();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -994,7 +994,7 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
||||
// if no bind exists, create a solo bind
|
||||
InstanceGroupBind *gBind = group ? group->GetBoundInstance(target) : NULL; // if no bind exists, create a solo bind
|
||||
if (!gBind)
|
||||
if (InstanceSave *save = sInstanceSaveManager.GetInstanceSave(target->GetInstanceId()))
|
||||
if (InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(target->GetInstanceId()))
|
||||
_player->BindToInstance(save, !save->CanReset());
|
||||
}
|
||||
|
||||
@@ -2327,7 +2327,7 @@ bool ChatHandler::HandleLookupTeleCommand(const char * args)
|
||||
|
||||
std::ostringstream reply;
|
||||
|
||||
GameTeleMap const & teleMap = objmgr.GetGameTeleMap();
|
||||
GameTeleMap const & teleMap = sObjectMgr.GetGameTeleMap();
|
||||
for (GameTeleMap::const_iterator itr = teleMap.begin(); itr != teleMap.end(); ++itr)
|
||||
{
|
||||
GameTele const* tele = &itr->second;
|
||||
@@ -2461,7 +2461,7 @@ bool ChatHandler::HandleTeleNameCommand(const char * args)
|
||||
return false;
|
||||
}
|
||||
|
||||
Player *chr = objmgr.GetPlayer(name.c_str());*/
|
||||
Player *chr = sObjectMgr.GetPlayer(name.c_str());*/
|
||||
|
||||
if (target)
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
|
||||
if (!extractPlayerTarget(nameStr,&target,&target_guid,&target_name))
|
||||
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
|
||||
if (!target)
|
||||
@@ -104,7 +104,7 @@ bool ChatHandler::HandleUnmuteCommand(const char* args)
|
||||
if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
|
||||
return false;
|
||||
|
||||
uint32 account_id = target ? target->GetSession()->GetAccountId() : objmgr.GetPlayerAccountIdByGUID(target_guid);
|
||||
uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr.GetPlayerAccountIdByGUID(target_guid);
|
||||
|
||||
// find only player from same account if any
|
||||
if (!target)
|
||||
@@ -152,7 +152,7 @@ bool ChatHandler::HandleGoTicketCommand(const char * args)
|
||||
if (!ticket_id)
|
||||
return false;
|
||||
|
||||
GM_Ticket *ticket = objmgr.GetGMTicket(ticket_id);
|
||||
GM_Ticket *ticket = sObjectMgr.GetGMTicket(ticket_id);
|
||||
if (!ticket)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
|
||||
@@ -394,7 +394,7 @@ bool ChatHandler::HandleGoObjectCommand(const char* args)
|
||||
int mapid;
|
||||
|
||||
// by DB guid
|
||||
if (GameObjectData const* go_data = objmgr.GetGOData(guid))
|
||||
if (GameObjectData const* go_data = sObjectMgr.GetGOData(guid))
|
||||
{
|
||||
x = go_data->posX;
|
||||
y = go_data->posY;
|
||||
@@ -434,7 +434,7 @@ bool ChatHandler::HandleGameObjectTargetCommand(const char* args)
|
||||
{
|
||||
Player* pl = m_session->GetPlayer();
|
||||
QueryResult_AutoPtr result;
|
||||
GameEventMgr::ActiveEvents const& activeEventsList = gameeventmgr.GetActiveEventList();
|
||||
GameEventMgr::ActiveEvents const& activeEventsList = sGameEventMgr.GetActiveEventList();
|
||||
if (*args)
|
||||
{
|
||||
// number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r
|
||||
@@ -507,8 +507,8 @@ bool ChatHandler::HandleGameObjectTargetCommand(const char* args)
|
||||
o = fields[5].GetFloat();
|
||||
mapid = fields[6].GetUInt16();
|
||||
phase = fields[7].GetUInt16();
|
||||
pool_id = poolhandler.IsPartOfAPool<GameObject>(lowguid);
|
||||
if (!pool_id || poolhandler.IsSpawnedObject<GameObject>(lowguid))
|
||||
pool_id = sPoolMgr.IsPartOfAPool<GameObject>(lowguid);
|
||||
if (!pool_id || sPoolMgr.IsSpawnedObject<GameObject>(lowguid))
|
||||
found = true;
|
||||
} while (result->NextRow() && (!found));
|
||||
|
||||
@@ -518,7 +518,7 @@ bool ChatHandler::HandleGameObjectTargetCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
GameObjectInfo const* goI = objmgr.GetGameObjectInfo(id);
|
||||
GameObjectInfo const* goI = sObjectMgr.GetGameObjectInfo(id);
|
||||
|
||||
if (!goI)
|
||||
{
|
||||
@@ -559,7 +559,7 @@ bool ChatHandler::HandleGameObjectDeleteCommand(const char* args)
|
||||
GameObject* obj = NULL;
|
||||
|
||||
// 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);
|
||||
|
||||
if (!obj)
|
||||
@@ -607,7 +607,7 @@ bool ChatHandler::HandleGameObjectTurnCommand(const char* args)
|
||||
GameObject* obj = NULL;
|
||||
|
||||
// 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);
|
||||
|
||||
if (!obj)
|
||||
@@ -658,7 +658,7 @@ bool ChatHandler::HandleGameObjectMoveCommand(const char* args)
|
||||
GameObject* obj = NULL;
|
||||
|
||||
// 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);
|
||||
|
||||
if (!obj)
|
||||
@@ -725,7 +725,7 @@ bool ChatHandler::HandleGameObjectAddCommand(const char* args)
|
||||
|
||||
char* spawntimeSecs = strtok(NULL, " ");
|
||||
|
||||
const GameObjectInfo *gInfo = objmgr.GetGameObjectInfo(id);
|
||||
const GameObjectInfo *gInfo = sObjectMgr.GetGameObjectInfo(id);
|
||||
|
||||
if (!gInfo)
|
||||
{
|
||||
@@ -751,7 +751,7 @@ bool ChatHandler::HandleGameObjectAddCommand(const char* args)
|
||||
Map *map = chr->GetMap();
|
||||
|
||||
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))
|
||||
{
|
||||
@@ -781,7 +781,7 @@ bool ChatHandler::HandleGameObjectAddCommand(const char* args)
|
||||
map->Add(pGameObj);
|
||||
|
||||
// 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);
|
||||
return true;
|
||||
@@ -802,7 +802,7 @@ bool ChatHandler::HandleGameObjectPhaseCommand(const char* args)
|
||||
GameObject* obj = NULL;
|
||||
|
||||
// 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);
|
||||
|
||||
if (!obj)
|
||||
@@ -850,7 +850,7 @@ bool ChatHandler::HandleGameObjectNearCommand(const char* args)
|
||||
float z = fields[4].GetFloat();
|
||||
int mapid = fields[5].GetUInt16();
|
||||
|
||||
GameObjectInfo const * gInfo = objmgr.GetGameObjectInfo(entry);
|
||||
GameObjectInfo const * gInfo = sObjectMgr.GetGameObjectInfo(entry);
|
||||
|
||||
if (!gInfo)
|
||||
continue;
|
||||
@@ -1028,7 +1028,7 @@ bool ChatHandler::HandleNpcAddCommand(const char* args)
|
||||
}
|
||||
|
||||
Creature* pCreature = new Creature;
|
||||
if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, (uint32)teamval, x, y, z, o))
|
||||
if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, (uint32)teamval, x, y, z, o))
|
||||
{
|
||||
delete pCreature;
|
||||
return false;
|
||||
@@ -1042,7 +1042,7 @@ bool ChatHandler::HandleNpcAddCommand(const char* args)
|
||||
pCreature->LoadFromDB(db_guid, map);
|
||||
|
||||
map->Add(pCreature);
|
||||
objmgr.AddCreatureToGrid(db_guid, objmgr.GetCreatureData(db_guid));
|
||||
sObjectMgr.AddCreatureToGrid(db_guid, sObjectMgr.GetCreatureData(db_guid));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1079,15 +1079,15 @@ bool ChatHandler::HandleNpcAddVendorItemCommand(const char* args)
|
||||
|
||||
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);
|
||||
return false;
|
||||
}
|
||||
|
||||
objmgr.AddVendorItem(vendor_entry,itemId,maxcount,incrtime,extendedcost);
|
||||
sObjectMgr.AddVendorItem(vendor_entry,itemId,maxcount,incrtime,extendedcost);
|
||||
|
||||
ItemPrototype const* pProto = objmgr.GetItemPrototype(itemId);
|
||||
ItemPrototype const* pProto = sObjectMgr.GetItemPrototype(itemId);
|
||||
|
||||
PSendSysMessage(LANG_ITEM_ADDED_TO_LIST,itemId,pProto->Name1,maxcount,incrtime,extendedcost);
|
||||
return true;
|
||||
@@ -1116,14 +1116,14 @@ bool ChatHandler::HandleNpcDelVendorItemCommand(const char* args)
|
||||
}
|
||||
uint32 itemId = atol(pitem);
|
||||
|
||||
if (!objmgr.RemoveVendorItem(vendor->GetEntry(),itemId))
|
||||
if (!sObjectMgr.RemoveVendorItem(vendor->GetEntry(),itemId))
|
||||
{
|
||||
PSendSysMessage(LANG_ITEM_NOT_IN_LIST,itemId);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemPrototype const* pProto = objmgr.GetItemPrototype(itemId);
|
||||
ItemPrototype const* pProto = sObjectMgr.GetItemPrototype(itemId);
|
||||
|
||||
PSendSysMessage(LANG_ITEM_DELETED_FROM_LIST,itemId,pProto->Name1);
|
||||
return true;
|
||||
@@ -1150,7 +1150,7 @@ bool ChatHandler::HandleNpcAddMoveCommand(const char* args)
|
||||
// attempt check creature existence by DB data
|
||||
if (!pCreature)
|
||||
{
|
||||
CreatureData const* data = objmgr.GetCreatureData(lowguid);
|
||||
CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
|
||||
if (!data)
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid);
|
||||
@@ -1218,7 +1218,7 @@ bool ChatHandler::HandleNpcChangeLevelCommand(const char* args)
|
||||
{
|
||||
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);
|
||||
}
|
||||
((Pet*)pCreature)->GivePetLevel(lvl);
|
||||
@@ -1275,7 +1275,7 @@ bool ChatHandler::HandleNpcDeleteCommand(const char* args)
|
||||
if (!lowguid)
|
||||
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));
|
||||
}
|
||||
else
|
||||
@@ -1322,7 +1322,7 @@ bool ChatHandler::HandleNpcMoveCommand(const char* args)
|
||||
// Attempting creature load from DB data
|
||||
if (!pCreature)
|
||||
{
|
||||
CreatureData const* data = objmgr.GetCreatureData(lowguid);
|
||||
CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
|
||||
if (!data)
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid);
|
||||
@@ -1356,7 +1356,7 @@ bool ChatHandler::HandleNpcMoveCommand(const char* args)
|
||||
|
||||
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)->posY = y;
|
||||
@@ -1462,7 +1462,7 @@ bool ChatHandler::HandleNpcSetMoveTypeCommand(const char* args)
|
||||
// attempt check creature existence by DB data
|
||||
if (!pCreature)
|
||||
{
|
||||
CreatureData const* data = objmgr.GetCreatureData(lowguid);
|
||||
CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
|
||||
if (!data)
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid);
|
||||
@@ -1882,7 +1882,7 @@ bool ChatHandler::HandleNpcNameCommand(const char* /*args*/)
|
||||
}
|
||||
|
||||
pCreature->SetName(args);
|
||||
uint32 idname = objmgr.AddCreatureTemplate(pCreature->GetName());
|
||||
uint32 idname = sObjectMgr.AddCreatureTemplate(pCreature->GetName());
|
||||
pCreature->SetUInt32Value(OBJECT_FIELD_ENTRY, idname);
|
||||
|
||||
pCreature->SaveToDB();
|
||||
@@ -1929,7 +1929,7 @@ bool ChatHandler::HandleNpcSubNameCommand(const char* /*args*/)
|
||||
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->SaveToDB();
|
||||
@@ -2070,7 +2070,7 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
Player* player = objmgr.GetPlayer(kickName);
|
||||
Player* player = sObjectMgr.GetPlayer(kickName);
|
||||
if (!player)
|
||||
{
|
||||
SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
@@ -2162,7 +2162,7 @@ bool ChatHandler::HandleGOInfoCommand(const char* args)
|
||||
else
|
||||
entry = atoi((char*)args);
|
||||
|
||||
GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(entry);
|
||||
GameObjectInfo const* goinfo = sObjectMgr.GetGameObjectInfo(entry);
|
||||
|
||||
if (!goinfo)
|
||||
return false;
|
||||
@@ -2861,7 +2861,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
|
||||
wpCreature->AddObjectToRemoveList();
|
||||
// re-create
|
||||
Creature* wpCreature2 = new Creature;
|
||||
if (!wpCreature2->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0, 0, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
|
||||
if (!wpCreature2->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0, 0, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
|
||||
{
|
||||
PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
|
||||
delete wpCreature2;
|
||||
@@ -3066,7 +3066,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
float o = chr->GetOrientation();
|
||||
|
||||
Creature* wpCreature = new Creature;
|
||||
if (!wpCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
|
||||
if (!wpCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
|
||||
{
|
||||
PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
|
||||
delete wpCreature;
|
||||
@@ -3118,7 +3118,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
Map *map = chr->GetMap();
|
||||
|
||||
Creature* pCreature = new Creature;
|
||||
if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT),map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
|
||||
if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT),map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
|
||||
{
|
||||
PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
|
||||
delete pCreature;
|
||||
@@ -3166,7 +3166,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
Map *map = chr->GetMap();
|
||||
|
||||
Creature* pCreature = new Creature;
|
||||
if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
|
||||
if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
|
||||
{
|
||||
PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id);
|
||||
delete pCreature;
|
||||
@@ -3422,8 +3422,8 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
|
||||
|
||||
bool found = false;
|
||||
|
||||
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
|
||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr.GetActiveEventList();
|
||||
|
||||
for (uint32 id = 0; id < events.size(); ++id)
|
||||
{
|
||||
@@ -3457,8 +3457,8 @@ bool ChatHandler::HandleEventActiveListCommand(const char* /*args*/)
|
||||
{
|
||||
uint32 counter = 0;
|
||||
|
||||
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
|
||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr.GetActiveEventList();
|
||||
|
||||
char const* active = GetTrinityString(LANG_ACTIVE);
|
||||
|
||||
@@ -3493,7 +3493,7 @@ bool ChatHandler::HandleEventInfoCommand(const char* args)
|
||||
|
||||
uint32 event_id = atoi(cId);
|
||||
|
||||
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
|
||||
|
||||
if (event_id >=events.size())
|
||||
{
|
||||
@@ -3510,14 +3510,14 @@ bool ChatHandler::HandleEventInfoCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr.GetActiveEventList();
|
||||
bool active = activeEvents.find(event_id) != activeEvents.end();
|
||||
char const* activeStr = active ? GetTrinityString(LANG_ACTIVE) : "";
|
||||
|
||||
std::string startTimeStr = TimeToTimestampStr(eventData.start);
|
||||
std::string endTimeStr = TimeToTimestampStr(eventData.end);
|
||||
|
||||
uint32 delay = gameeventmgr.NextCheck(event_id);
|
||||
uint32 delay = sGameEventMgr.NextCheck(event_id);
|
||||
time_t nextTime = time(NULL)+delay;
|
||||
std::string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? TimeToTimestampStr(time(NULL)+delay) : "-";
|
||||
|
||||
@@ -3542,7 +3542,7 @@ bool ChatHandler::HandleEventStartCommand(const char* args)
|
||||
|
||||
int32 event_id = atoi(cId);
|
||||
|
||||
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
|
||||
|
||||
if (event_id < 1 || event_id >=events.size())
|
||||
{
|
||||
@@ -3559,7 +3559,7 @@ bool ChatHandler::HandleEventStartCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr.GetActiveEventList();
|
||||
if (activeEvents.find(event_id) != activeEvents.end())
|
||||
{
|
||||
PSendSysMessage(LANG_EVENT_ALREADY_ACTIVE,event_id);
|
||||
@@ -3567,7 +3567,7 @@ bool ChatHandler::HandleEventStartCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
gameeventmgr.StartEvent(event_id,true);
|
||||
sGameEventMgr.StartEvent(event_id,true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3583,7 +3583,7 @@ bool ChatHandler::HandleEventStopCommand(const char* args)
|
||||
|
||||
int32 event_id = atoi(cId);
|
||||
|
||||
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
|
||||
|
||||
if (event_id < 1 || event_id >=events.size())
|
||||
{
|
||||
@@ -3600,7 +3600,7 @@ bool ChatHandler::HandleEventStopCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr.GetActiveEventList();
|
||||
|
||||
if (activeEvents.find(event_id) == activeEvents.end())
|
||||
{
|
||||
@@ -3609,7 +3609,7 @@ bool ChatHandler::HandleEventStopCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
gameeventmgr.StopEvent(event_id,true);
|
||||
sGameEventMgr.StopEvent(event_id,true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3931,7 +3931,7 @@ bool ChatHandler::HandleCreatePetCommand(const char* /*args*/)
|
||||
return false;
|
||||
}
|
||||
|
||||
CreatureInfo const* cInfo = objmgr.GetCreatureTemplate(creatureTarget->GetEntry());
|
||||
CreatureInfo const* cInfo = sObjectMgr.GetCreatureTemplate(creatureTarget->GetEntry());
|
||||
// Creatures with family 0 crashes the server
|
||||
if (cInfo->family == 0)
|
||||
{
|
||||
@@ -3978,7 +3978,7 @@ bool ChatHandler::HandleCreatePetCommand(const char* /*args*/)
|
||||
// prepare visual effect for levelup
|
||||
pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel()-1);
|
||||
|
||||
pet->GetCharmInfo()->SetPetNumber(objmgr.GeneratePetNumber(), true);
|
||||
pet->GetCharmInfo()->SetPetNumber(sObjectMgr.GeneratePetNumber(), true);
|
||||
// this enables pet details window (Shift+P)
|
||||
pet->InitPetCreateSpells();
|
||||
pet->SetHealth(pet->GetMaxHealth());
|
||||
@@ -4102,7 +4102,7 @@ bool ChatHandler::HandleActivateObjectCommand(const char *args)
|
||||
GameObject* obj = NULL;
|
||||
|
||||
// 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);
|
||||
|
||||
if (!obj)
|
||||
@@ -4241,7 +4241,7 @@ bool ChatHandler::HandleNpcSetLinkCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!objmgr.SetCreatureLinkedRespawn(pCreature->GetDBTableGUIDLow(), linkguid))
|
||||
if (!sObjectMgr.SetCreatureLinkedRespawn(pCreature->GetDBTableGUIDLow(), linkguid))
|
||||
{
|
||||
PSendSysMessage("Selected creature can't link with guid '%u'", linkguid);
|
||||
SetSentErrorMessage(true);
|
||||
|
||||
@@ -126,7 +126,7 @@ bool ChatHandler::HandleReloadAllQuestCommand(const char* /*args*/)
|
||||
HandleReloadQuestTemplateCommand("a");
|
||||
|
||||
sLog.outString("Re-Loading Quests Relations...");
|
||||
objmgr.LoadQuestRelations();
|
||||
sObjectMgr.LoadQuestRelations();
|
||||
SendGlobalGMSysMessage("DB tables `*_questrelation` and `*_involvedrelation` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -210,7 +210,7 @@ bool ChatHandler::HandleReloadConfigCommand(const char* /*args*/)
|
||||
bool ChatHandler::HandleReloadAccessRequirementCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Access Requirement definitions...");
|
||||
objmgr.LoadAccessRequirements();
|
||||
sObjectMgr.LoadAccessRequirements();
|
||||
SendGlobalGMSysMessage("DB table `access_requirement` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -218,7 +218,7 @@ bool ChatHandler::HandleReloadAccessRequirementCommand(const char*)
|
||||
bool ChatHandler::HandleReloadAchievementCriteriaDataCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Additional Achievement Criteria Data...");
|
||||
achievementmgr.LoadAchievementCriteriaData();
|
||||
sAchievementMgr.LoadAchievementCriteriaData();
|
||||
SendGlobalGMSysMessage("DB table `achievement_criteria_data` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -226,7 +226,7 @@ bool ChatHandler::HandleReloadAchievementCriteriaDataCommand(const char*)
|
||||
bool ChatHandler::HandleReloadAchievementRewardCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Achievement Reward Data...");
|
||||
achievementmgr.LoadRewards();
|
||||
sAchievementMgr.LoadRewards();
|
||||
SendGlobalGMSysMessage("DB table `achievement_reward` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -234,7 +234,7 @@ bool ChatHandler::HandleReloadAchievementRewardCommand(const char*)
|
||||
bool ChatHandler::HandleReloadAreaTriggerTavernCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Tavern Area Triggers...");
|
||||
objmgr.LoadTavernAreaTriggers();
|
||||
sObjectMgr.LoadTavernAreaTriggers();
|
||||
SendGlobalGMSysMessage("DB table `areatrigger_tavern` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -242,7 +242,7 @@ bool ChatHandler::HandleReloadAreaTriggerTavernCommand(const char*)
|
||||
bool ChatHandler::HandleReloadAreaTriggerTeleportCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading AreaTrigger teleport definitions...");
|
||||
objmgr.LoadAreaTriggerTeleports();
|
||||
sObjectMgr.LoadAreaTriggerTeleports();
|
||||
SendGlobalGMSysMessage("DB table `areatrigger_teleport` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -265,7 +265,7 @@ bool ChatHandler::HandleReloadCommandCommand(const char*)
|
||||
bool ChatHandler::HandleReloadOnKillReputationCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading creature award reputation definitions...");
|
||||
objmgr.LoadReputationOnKill();
|
||||
sObjectMgr.LoadReputationOnKill();
|
||||
SendGlobalGMSysMessage("DB table `creature_onkill_reputation` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -403,9 +403,9 @@ bool ChatHandler::HandleReloadCreatureTemplateCommand(const char* args)
|
||||
const_cast<CreatureInfo*>(cInfo)->equipmentId = fields[79].GetUInt32();
|
||||
const_cast<CreatureInfo*>(cInfo)->MechanicImmuneMask = fields[80].GetUInt32();
|
||||
const_cast<CreatureInfo*>(cInfo)->flags_extra = fields[81].GetUInt32();
|
||||
const_cast<CreatureInfo*>(cInfo)->ScriptID = objmgr.GetScriptId(fields[82].GetString());
|
||||
const_cast<CreatureInfo*>(cInfo)->ScriptID = sObjectMgr.GetScriptId(fields[82].GetString());
|
||||
|
||||
objmgr.CheckCreatureTemplate(cInfo);
|
||||
sObjectMgr.CheckCreatureTemplate(cInfo);
|
||||
|
||||
SendGlobalGMSysMessage("Creature template reloaded.");
|
||||
return true;
|
||||
@@ -414,7 +414,7 @@ bool ChatHandler::HandleReloadCreatureTemplateCommand(const char* args)
|
||||
bool ChatHandler::HandleReloadCreatureQuestRelationsCommand(const char*)
|
||||
{
|
||||
sLog.outString("Loading Quests Relations... (`creature_questrelation`)");
|
||||
objmgr.LoadCreatureQuestRelations();
|
||||
sObjectMgr.LoadCreatureQuestRelations();
|
||||
SendGlobalGMSysMessage("DB table `creature_questrelation` (creature quest givers) reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -422,7 +422,7 @@ bool ChatHandler::HandleReloadCreatureQuestRelationsCommand(const char*)
|
||||
bool ChatHandler::HandleReloadCreatureLinkedRespawnCommand(const char * /*args*/)
|
||||
{
|
||||
sLog.outString("Loading Linked Respawns... (`creature_linked_respawn`)");
|
||||
objmgr.LoadCreatureLinkedRespawn();
|
||||
sObjectMgr.LoadCreatureLinkedRespawn();
|
||||
SendGlobalGMSysMessage("DB table `creature_linked_respawn` (creature linked respawns) reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -430,7 +430,7 @@ bool ChatHandler::HandleReloadCreatureLinkedRespawnCommand(const char * /*args*/
|
||||
bool ChatHandler::HandleReloadCreatureQuestInvRelationsCommand(const char*)
|
||||
{
|
||||
sLog.outString("Loading Quests Relations... (`creature_involvedrelation`)");
|
||||
objmgr.LoadCreatureInvolvedRelations();
|
||||
sObjectMgr.LoadCreatureInvolvedRelations();
|
||||
SendGlobalGMSysMessage("DB table `creature_involvedrelation` (creature quest takers) reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -438,7 +438,7 @@ bool ChatHandler::HandleReloadCreatureQuestInvRelationsCommand(const char*)
|
||||
bool ChatHandler::HandleReloadGossipMenuCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading `gossip_menu` Table!");
|
||||
objmgr.LoadGossipMenu();
|
||||
sObjectMgr.LoadGossipMenu();
|
||||
SendGlobalGMSysMessage("DB table `gossip_menu` reloaded.");
|
||||
sConditionMgr.LoadConditions(true);
|
||||
return true;
|
||||
@@ -447,7 +447,7 @@ bool ChatHandler::HandleReloadGossipMenuCommand(const char*)
|
||||
bool ChatHandler::HandleReloadGossipMenuOptionCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading `gossip_menu_option` Table!");
|
||||
objmgr.LoadGossipMenuItems();
|
||||
sObjectMgr.LoadGossipMenuItems();
|
||||
SendGlobalGMSysMessage("DB table `gossip_menu_option` reloaded.");
|
||||
sConditionMgr.LoadConditions(true);
|
||||
return true;
|
||||
@@ -456,7 +456,7 @@ bool ChatHandler::HandleReloadGossipMenuOptionCommand(const char*)
|
||||
bool ChatHandler::HandleReloadGOQuestRelationsCommand(const char*)
|
||||
{
|
||||
sLog.outString("Loading Quests Relations... (`gameobject_questrelation`)");
|
||||
objmgr.LoadGameobjectQuestRelations();
|
||||
sObjectMgr.LoadGameobjectQuestRelations();
|
||||
SendGlobalGMSysMessage("DB table `gameobject_questrelation` (gameobject quest givers) reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -464,7 +464,7 @@ bool ChatHandler::HandleReloadGOQuestRelationsCommand(const char*)
|
||||
bool ChatHandler::HandleReloadGOQuestInvRelationsCommand(const char*)
|
||||
{
|
||||
sLog.outString("Loading Quests Relations... (`gameobject_involvedrelation`)");
|
||||
objmgr.LoadGameobjectInvolvedRelations();
|
||||
sObjectMgr.LoadGameobjectInvolvedRelations();
|
||||
SendGlobalGMSysMessage("DB table `gameobject_involvedrelation` (gameobject quest takers) reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -472,7 +472,7 @@ bool ChatHandler::HandleReloadGOQuestInvRelationsCommand(const char*)
|
||||
bool ChatHandler::HandleReloadQuestAreaTriggersCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Quest Area Triggers...");
|
||||
objmgr.LoadQuestAreaTriggers();
|
||||
sObjectMgr.LoadQuestAreaTriggers();
|
||||
SendGlobalGMSysMessage("DB table `areatrigger_involvedrelation` (quest area triggers) reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -480,12 +480,12 @@ bool ChatHandler::HandleReloadQuestAreaTriggersCommand(const char*)
|
||||
bool ChatHandler::HandleReloadQuestTemplateCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Quest Templates...");
|
||||
objmgr.LoadQuests();
|
||||
sObjectMgr.LoadQuests();
|
||||
SendGlobalGMSysMessage("DB table `quest_template` (quest definitions) reloaded.");
|
||||
|
||||
/// dependent also from `gameobject` but this table not reloaded anyway
|
||||
sLog.outString("Re-Loading GameObjects for quests...");
|
||||
objmgr.LoadGameObjectForQuests();
|
||||
sObjectMgr.LoadGameObjectForQuests();
|
||||
SendGlobalGMSysMessage("Data GameObjects for quests reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -612,7 +612,7 @@ bool ChatHandler::HandleReloadLootTemplatesSpellCommand(const char*)
|
||||
bool ChatHandler::HandleReloadTrinityStringCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading trinity_string Table!");
|
||||
objmgr.LoadTrinityStrings();
|
||||
sObjectMgr.LoadTrinityStrings();
|
||||
SendGlobalGMSysMessage("DB table `trinity_string` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -620,7 +620,7 @@ bool ChatHandler::HandleReloadTrinityStringCommand(const char*)
|
||||
bool ChatHandler::HandleReloadNpcGossipCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading `npc_gossip` Table!");
|
||||
objmgr.LoadNpcTextId();
|
||||
sObjectMgr.LoadNpcTextId();
|
||||
SendGlobalGMSysMessage("DB table `npc_gossip` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -628,7 +628,7 @@ bool ChatHandler::HandleReloadNpcGossipCommand(const char*)
|
||||
bool ChatHandler::HandleReloadNpcTrainerCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading `npc_trainer` Table!");
|
||||
objmgr.LoadTrainerSpell();
|
||||
sObjectMgr.LoadTrainerSpell();
|
||||
SendGlobalGMSysMessage("DB table `npc_trainer` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -636,7 +636,7 @@ bool ChatHandler::HandleReloadNpcTrainerCommand(const char*)
|
||||
bool ChatHandler::HandleReloadNpcVendorCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading `npc_vendor` Table!");
|
||||
objmgr.LoadVendors();
|
||||
sObjectMgr.LoadVendors();
|
||||
SendGlobalGMSysMessage("DB table `npc_vendor` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -644,7 +644,7 @@ bool ChatHandler::HandleReloadNpcVendorCommand(const char*)
|
||||
bool ChatHandler::HandleReloadPointsOfInterestCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading `points_of_interest` Table!");
|
||||
objmgr.LoadPointsOfInterest();
|
||||
sObjectMgr.LoadPointsOfInterest();
|
||||
SendGlobalGMSysMessage("DB table `points_of_interest` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -652,7 +652,7 @@ bool ChatHandler::HandleReloadPointsOfInterestCommand(const char*)
|
||||
bool ChatHandler::HandleReloadSpellClickSpellsCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading `npc_spellclick_spells` Table!");
|
||||
objmgr.LoadNPCSpellClickSpells();
|
||||
sObjectMgr.LoadNPCSpellClickSpells();
|
||||
SendGlobalGMSysMessage("DB table `npc_spellclick_spells` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -660,7 +660,7 @@ bool ChatHandler::HandleReloadSpellClickSpellsCommand(const char*)
|
||||
bool ChatHandler::HandleReloadReservedNameCommand(const char*)
|
||||
{
|
||||
sLog.outString("Loading ReservedNames... (`reserved_name`)");
|
||||
objmgr.LoadReservedPlayersNames();
|
||||
sObjectMgr.LoadReservedPlayersNames();
|
||||
SendGlobalGMSysMessage("DB table `reserved_name` (player reserved names) reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -668,7 +668,7 @@ bool ChatHandler::HandleReloadReservedNameCommand(const char*)
|
||||
bool ChatHandler::HandleReloadReputationRewardRateCommand(const char*)
|
||||
{
|
||||
sLog.outString( "Re-Loading `reputation_reward_rate` Table!" );
|
||||
objmgr.LoadReputationRewardRate();
|
||||
sObjectMgr.LoadReputationRewardRate();
|
||||
SendGlobalSysMessage("DB table `reputation_reward_rate` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -676,7 +676,7 @@ bool ChatHandler::HandleReloadReputationRewardRateCommand(const char*)
|
||||
bool ChatHandler::HandleReloadReputationSpilloverTemplateCommand(const char*)
|
||||
{
|
||||
sLog.outString( "Re-Loading `reputation_spillover_template` Table!" );
|
||||
objmgr.LoadReputationSpilloverTemplate();
|
||||
sObjectMgr.LoadReputationSpilloverTemplate();
|
||||
SendGlobalSysMessage("DB table `reputation_spillover_template` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -700,7 +700,7 @@ bool ChatHandler::HandleReloadSkillExtraItemTemplateCommand(const char* /*args*/
|
||||
bool ChatHandler::HandleReloadSkillFishingBaseLevelCommand(const char* /*args*/)
|
||||
{
|
||||
sLog.outString("Re-Loading Skill Fishing base level requirements...");
|
||||
objmgr.LoadFishingBaseSkillLevel();
|
||||
sObjectMgr.LoadFishingBaseSkillLevel();
|
||||
SendGlobalGMSysMessage("DB table `skill_fishing_base_level` (fishing base level for zone/subzone) reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -708,7 +708,7 @@ bool ChatHandler::HandleReloadSkillFishingBaseLevelCommand(const char* /*args*/)
|
||||
bool ChatHandler::HandleReloadSpellAreaCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading SpellArea Data...");
|
||||
spellmgr.LoadSpellAreas();
|
||||
sSpellMgr.LoadSpellAreas();
|
||||
SendGlobalGMSysMessage("DB table `spell_area` (spell dependences from area/quest/auras state) reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -716,7 +716,7 @@ bool ChatHandler::HandleReloadSpellAreaCommand(const char*)
|
||||
bool ChatHandler::HandleReloadSpellRequiredCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Spell Required Data... ");
|
||||
spellmgr.LoadSpellRequired();
|
||||
sSpellMgr.LoadSpellRequired();
|
||||
SendGlobalGMSysMessage("DB table `spell_required` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -724,7 +724,7 @@ bool ChatHandler::HandleReloadSpellRequiredCommand(const char*)
|
||||
bool ChatHandler::HandleReloadSpellGroupsCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Spell Groups...");
|
||||
spellmgr.LoadSpellGroups();
|
||||
sSpellMgr.LoadSpellGroups();
|
||||
SendGlobalGMSysMessage("DB table `spell_group` (spell groups) reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -732,7 +732,7 @@ bool ChatHandler::HandleReloadSpellGroupsCommand(const char*)
|
||||
bool ChatHandler::HandleReloadSpellLearnSpellCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Spell Learn Spells...");
|
||||
spellmgr.LoadSpellLearnSpells();
|
||||
sSpellMgr.LoadSpellLearnSpells();
|
||||
SendGlobalGMSysMessage("DB table `spell_learn_spell` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -740,7 +740,7 @@ bool ChatHandler::HandleReloadSpellLearnSpellCommand(const char*)
|
||||
bool ChatHandler::HandleReloadSpellLinkedSpellCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Spell Linked Spells...");
|
||||
spellmgr.LoadSpellLinked();
|
||||
sSpellMgr.LoadSpellLinked();
|
||||
SendGlobalGMSysMessage("DB table `spell_linked_spell` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -748,7 +748,7 @@ bool ChatHandler::HandleReloadSpellLinkedSpellCommand(const char*)
|
||||
bool ChatHandler::HandleReloadSpellProcEventCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Spell Proc Event conditions...");
|
||||
spellmgr.LoadSpellProcEvents();
|
||||
sSpellMgr.LoadSpellProcEvents();
|
||||
SendGlobalGMSysMessage("DB table `spell_proc_event` (spell proc trigger requirements) reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -756,7 +756,7 @@ bool ChatHandler::HandleReloadSpellProcEventCommand(const char*)
|
||||
bool ChatHandler::HandleReloadSpellBonusesCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Spell Bonus Data...");
|
||||
spellmgr.LoadSpellBonusess();
|
||||
sSpellMgr.LoadSpellBonusess();
|
||||
SendGlobalGMSysMessage("DB table `spell_bonus_data` (spell damage/healing coefficients) reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -764,7 +764,7 @@ bool ChatHandler::HandleReloadSpellBonusesCommand(const char*)
|
||||
bool ChatHandler::HandleReloadSpellTargetPositionCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Spell target coordinates...");
|
||||
spellmgr.LoadSpellTargetPositions();
|
||||
sSpellMgr.LoadSpellTargetPositions();
|
||||
SendGlobalGMSysMessage("DB table `spell_target_position` (destination coordinates for spell targets) reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -772,7 +772,7 @@ bool ChatHandler::HandleReloadSpellTargetPositionCommand(const char*)
|
||||
bool ChatHandler::HandleReloadSpellThreatsCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Aggro Spells Definitions...");
|
||||
spellmgr.LoadSpellThreats();
|
||||
sSpellMgr.LoadSpellThreats();
|
||||
SendGlobalGMSysMessage("DB table `spell_threat` (spell aggro definitions) reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -780,7 +780,7 @@ bool ChatHandler::HandleReloadSpellThreatsCommand(const char*)
|
||||
bool ChatHandler::HandleReloadSpellGroupStackRulesCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Spell Group Stack Rules...");
|
||||
spellmgr.LoadSpellGroupStackRules();
|
||||
sSpellMgr.LoadSpellGroupStackRules();
|
||||
SendGlobalGMSysMessage("DB table `spell_group_stack_rules` (spell stacking definitions) reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -788,7 +788,7 @@ bool ChatHandler::HandleReloadSpellGroupStackRulesCommand(const char*)
|
||||
bool ChatHandler::HandleReloadSpellPetAurasCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Spell pet auras...");
|
||||
spellmgr.LoadSpellPetAuras();
|
||||
sSpellMgr.LoadSpellPetAuras();
|
||||
SendGlobalGMSysMessage("DB table `spell_pet_auras` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -796,7 +796,7 @@ bool ChatHandler::HandleReloadSpellPetAurasCommand(const char*)
|
||||
bool ChatHandler::HandleReloadPageTextsCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Page Texts...");
|
||||
objmgr.LoadPageTexts();
|
||||
sObjectMgr.LoadPageTexts();
|
||||
SendGlobalGMSysMessage("DB table `page_texts` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -829,7 +829,7 @@ bool ChatHandler::HandleReloadGameObjectScriptsCommand(const char* arg)
|
||||
if (*arg != 'a')
|
||||
sLog.outString("Re-Loading Scripts from `gameobject_scripts`...");
|
||||
|
||||
objmgr.LoadGameObjectScripts();
|
||||
sObjectMgr.LoadGameObjectScripts();
|
||||
|
||||
if (*arg != 'a')
|
||||
SendGlobalGMSysMessage("DB table `gameobject_scripts` reloaded.");
|
||||
@@ -849,7 +849,7 @@ bool ChatHandler::HandleReloadEventScriptsCommand(const char* arg)
|
||||
if (*arg != 'a')
|
||||
sLog.outString("Re-Loading Scripts from `event_scripts`...");
|
||||
|
||||
objmgr.LoadEventScripts();
|
||||
sObjectMgr.LoadEventScripts();
|
||||
|
||||
if (*arg != 'a')
|
||||
SendGlobalGMSysMessage("DB table `event_scripts` reloaded.");
|
||||
@@ -869,7 +869,7 @@ bool ChatHandler::HandleReloadWpScriptsCommand(const char* arg)
|
||||
if (*arg != 'a')
|
||||
sLog.outString("Re-Loading Scripts from `waypoint_scripts`...");
|
||||
|
||||
objmgr.LoadWaypointScripts();
|
||||
sObjectMgr.LoadWaypointScripts();
|
||||
|
||||
if (*arg != 'a')
|
||||
SendGlobalGMSysMessage("DB table `waypoint_scripts` reloaded.");
|
||||
@@ -881,7 +881,7 @@ bool ChatHandler::HandleReloadEventAITextsCommand(const char* /*args*/)
|
||||
{
|
||||
|
||||
sLog.outString("Re-Loading Texts from `creature_ai_texts`...");
|
||||
CreatureEAI_Mgr.LoadCreatureEventAI_Texts();
|
||||
sEventAIMgr.LoadCreatureEventAI_Texts();
|
||||
SendGlobalGMSysMessage("DB table `creature_ai_texts` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -889,7 +889,7 @@ bool ChatHandler::HandleReloadEventAITextsCommand(const char* /*args*/)
|
||||
bool ChatHandler::HandleReloadEventAISummonsCommand(const char* /*args*/)
|
||||
{
|
||||
sLog.outString("Re-Loading Summons from `creature_ai_summons`...");
|
||||
CreatureEAI_Mgr.LoadCreatureEventAI_Summons();
|
||||
sEventAIMgr.LoadCreatureEventAI_Summons();
|
||||
SendGlobalGMSysMessage("DB table `creature_ai_summons` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -897,7 +897,7 @@ bool ChatHandler::HandleReloadEventAISummonsCommand(const char* /*args*/)
|
||||
bool ChatHandler::HandleReloadEventAIScriptsCommand(const char* /*args*/)
|
||||
{
|
||||
sLog.outString("Re-Loading Scripts from `creature_ai_scripts`...");
|
||||
CreatureEAI_Mgr.LoadCreatureEventAI_Scripts();
|
||||
sEventAIMgr.LoadCreatureEventAI_Scripts();
|
||||
SendGlobalGMSysMessage("DB table `creature_ai_scripts` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -914,7 +914,7 @@ bool ChatHandler::HandleReloadQuestEndScriptsCommand(const char* arg)
|
||||
if (*arg != 'a')
|
||||
sLog.outString("Re-Loading Scripts from `quest_end_scripts`...");
|
||||
|
||||
objmgr.LoadQuestEndScripts();
|
||||
sObjectMgr.LoadQuestEndScripts();
|
||||
|
||||
if (*arg != 'a')
|
||||
SendGlobalGMSysMessage("DB table `quest_end_scripts` reloaded.");
|
||||
@@ -934,7 +934,7 @@ bool ChatHandler::HandleReloadQuestStartScriptsCommand(const char* arg)
|
||||
if (*arg != 'a')
|
||||
sLog.outString("Re-Loading Scripts from `quest_start_scripts`...");
|
||||
|
||||
objmgr.LoadQuestStartScripts();
|
||||
sObjectMgr.LoadQuestStartScripts();
|
||||
|
||||
if (*arg != 'a')
|
||||
SendGlobalGMSysMessage("DB table `quest_start_scripts` reloaded.");
|
||||
@@ -954,7 +954,7 @@ bool ChatHandler::HandleReloadSpellScriptsCommand(const char* arg)
|
||||
if (*arg != 'a')
|
||||
sLog.outString("Re-Loading Scripts from `spell_scripts`...");
|
||||
|
||||
objmgr.LoadSpellScripts();
|
||||
sObjectMgr.LoadSpellScripts();
|
||||
|
||||
if (*arg != 'a')
|
||||
SendGlobalGMSysMessage("DB table `spell_scripts` reloaded.");
|
||||
@@ -965,7 +965,7 @@ bool ChatHandler::HandleReloadSpellScriptsCommand(const char* arg)
|
||||
bool ChatHandler::HandleReloadDbScriptStringCommand(const char* /*arg*/)
|
||||
{
|
||||
sLog.outString("Re-Loading Script strings from `db_script_string`...");
|
||||
objmgr.LoadDbScriptStrings();
|
||||
sObjectMgr.LoadDbScriptStrings();
|
||||
SendGlobalGMSysMessage("DB table `db_script_string` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -974,7 +974,7 @@ bool ChatHandler::HandleReloadGameGraveyardZoneCommand(const char* /*arg*/)
|
||||
{
|
||||
sLog.outString("Re-Loading Graveyard-zone links...");
|
||||
|
||||
objmgr.LoadGraveyardZones();
|
||||
sObjectMgr.LoadGraveyardZones();
|
||||
|
||||
SendGlobalGMSysMessage("DB table `game_graveyard_zone` reloaded.");
|
||||
|
||||
@@ -985,7 +985,7 @@ bool ChatHandler::HandleReloadGameTeleCommand(const char* /*arg*/)
|
||||
{
|
||||
sLog.outString("Re-Loading Game Tele coordinates...");
|
||||
|
||||
objmgr.LoadGameTele();
|
||||
sObjectMgr.LoadGameTele();
|
||||
|
||||
SendGlobalGMSysMessage("DB table `game_tele` reloaded.");
|
||||
|
||||
@@ -1005,7 +1005,7 @@ bool ChatHandler::HandleReloadDisablesCommand(const char* /*arg*/)
|
||||
bool ChatHandler::HandleReloadLocalesAchievementRewardCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Locales Achievement Reward Data...");
|
||||
achievementmgr.LoadRewardLocales();
|
||||
sAchievementMgr.LoadRewardLocales();
|
||||
SendGlobalGMSysMessage("DB table `locales_achievement_reward` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -1013,7 +1013,7 @@ bool ChatHandler::HandleReloadLocalesAchievementRewardCommand(const char*)
|
||||
bool ChatHandler::HandleReloadLocalesCreatureCommand(const char* /*arg*/)
|
||||
{
|
||||
sLog.outString("Re-Loading Locales Creature ...");
|
||||
objmgr.LoadCreatureLocales();
|
||||
sObjectMgr.LoadCreatureLocales();
|
||||
SendGlobalGMSysMessage("DB table `locales_creature` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -1021,7 +1021,7 @@ bool ChatHandler::HandleReloadLocalesCreatureCommand(const char* /*arg*/)
|
||||
bool ChatHandler::HandleReloadLocalesGameobjectCommand(const char* /*arg*/)
|
||||
{
|
||||
sLog.outString("Re-Loading Locales Gameobject ... ");
|
||||
objmgr.LoadGameObjectLocales();
|
||||
sObjectMgr.LoadGameObjectLocales();
|
||||
SendGlobalGMSysMessage("DB table `locales_gameobject` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -1029,7 +1029,7 @@ bool ChatHandler::HandleReloadLocalesGameobjectCommand(const char* /*arg*/)
|
||||
bool ChatHandler::HandleReloadLocalesItemCommand(const char* /*arg*/)
|
||||
{
|
||||
sLog.outString("Re-Loading Locales Item ... ");
|
||||
objmgr.LoadItemLocales();
|
||||
sObjectMgr.LoadItemLocales();
|
||||
SendGlobalGMSysMessage("DB table `locales_item` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -1037,7 +1037,7 @@ bool ChatHandler::HandleReloadLocalesItemCommand(const char* /*arg*/)
|
||||
bool ChatHandler::HandleReloadLocalesItemSetNameCommand(const char* /*arg*/)
|
||||
{
|
||||
sLog.outString("Re-Loading Locales Item set name... ");
|
||||
objmgr.LoadItemSetNameLocales();
|
||||
sObjectMgr.LoadItemSetNameLocales();
|
||||
SendGlobalGMSysMessage("DB table `locales_item_set_name` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -1045,7 +1045,7 @@ bool ChatHandler::HandleReloadLocalesItemSetNameCommand(const char* /*arg*/)
|
||||
bool ChatHandler::HandleReloadLocalesNpcTextCommand(const char* /*arg*/)
|
||||
{
|
||||
sLog.outString("Re-Loading Locales NPC Text ... ");
|
||||
objmgr.LoadNpcTextLocales();
|
||||
sObjectMgr.LoadNpcTextLocales();
|
||||
SendGlobalGMSysMessage("DB table `locales_npc_text` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -1053,7 +1053,7 @@ bool ChatHandler::HandleReloadLocalesNpcTextCommand(const char* /*arg*/)
|
||||
bool ChatHandler::HandleReloadLocalesPageTextCommand(const char* /*arg*/)
|
||||
{
|
||||
sLog.outString("Re-Loading Locales Page Text ... ");
|
||||
objmgr.LoadPageTextLocales();
|
||||
sObjectMgr.LoadPageTextLocales();
|
||||
SendGlobalGMSysMessage("DB table `locales_page_text` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -1061,7 +1061,7 @@ bool ChatHandler::HandleReloadLocalesPageTextCommand(const char* /*arg*/)
|
||||
bool ChatHandler::HandleReloadLocalesPointsOfInterestCommand(const char* /*arg*/)
|
||||
{
|
||||
sLog.outString("Re-Loading Locales Points Of Interest ... ");
|
||||
objmgr.LoadPointOfInterestLocales();
|
||||
sObjectMgr.LoadPointOfInterestLocales();
|
||||
SendGlobalGMSysMessage("DB table `locales_points_of_interest` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -1069,7 +1069,7 @@ bool ChatHandler::HandleReloadLocalesPointsOfInterestCommand(const char* /*arg*/
|
||||
bool ChatHandler::HandleReloadLocalesQuestCommand(const char* /*arg*/)
|
||||
{
|
||||
sLog.outString("Re-Loading Locales Quest ... ");
|
||||
objmgr.LoadQuestLocales();
|
||||
sObjectMgr.LoadQuestLocales();
|
||||
SendGlobalGMSysMessage("DB table `locales_quest` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -1077,7 +1077,7 @@ bool ChatHandler::HandleReloadLocalesQuestCommand(const char* /*arg*/)
|
||||
bool ChatHandler::HandleReloadMailLevelRewardCommand(const char* /*arg*/)
|
||||
{
|
||||
sLog.outString("Re-Loading Player level dependent mail rewards...");
|
||||
objmgr.LoadMailLevelRewards();
|
||||
sObjectMgr.LoadMailLevelRewards();
|
||||
SendGlobalGMSysMessage("DB table `mail_level_reward` reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -1086,8 +1086,8 @@ bool ChatHandler::HandleReloadAuctionsCommand(const char * /*args*/)
|
||||
{
|
||||
///- Reload dynamic data tables from the database
|
||||
sLog.outString("Re-Loading Auctions...");
|
||||
auctionmgr.LoadAuctionItems();
|
||||
auctionmgr.LoadAuctions();
|
||||
sAuctionMgr.LoadAuctionItems();
|
||||
sAuctionMgr.LoadAuctions();
|
||||
SendGlobalGMSysMessage("Auctions reloaded.");
|
||||
return true;
|
||||
}
|
||||
@@ -1147,13 +1147,13 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char *args)
|
||||
}
|
||||
|
||||
// m_session == NULL only for console
|
||||
targetAccountId = (isAccountNameGiven) ? accmgr.GetId(targetAccountName) : getSelectedPlayer()->GetSession()->GetAccountId();
|
||||
targetAccountId = (isAccountNameGiven) ? sAccountMgr.GetId(targetAccountName) : getSelectedPlayer()->GetSession()->GetAccountId();
|
||||
int32 gmRealmID = (isAccountNameGiven) ? atoi(arg3) : atoi(arg2);
|
||||
uint32 plSecurity = m_session ? accmgr.GetSecurity(m_session->GetAccountId(), gmRealmID) : SEC_CONSOLE;
|
||||
uint32 plSecurity = m_session ? sAccountMgr.GetSecurity(m_session->GetAccountId(), gmRealmID) : SEC_CONSOLE;
|
||||
|
||||
// can set security level only for target with less security and to less security that we have
|
||||
// This is also reject self apply in fact
|
||||
targetSecurity = accmgr.GetSecurity(targetAccountId, gmRealmID);
|
||||
targetSecurity = sAccountMgr.GetSecurity(targetAccountId, gmRealmID);
|
||||
if (targetSecurity >= plSecurity || gm >= plSecurity)
|
||||
{
|
||||
SendSysMessage(LANG_YOURS_SECURITY_IS_LOW);
|
||||
@@ -1215,7 +1215,7 @@ bool ChatHandler::HandleAccountSetPasswordCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 targetAccountId = accmgr.GetId(account_name);
|
||||
uint32 targetAccountId = sAccountMgr.GetId(account_name);
|
||||
if (!targetAccountId)
|
||||
{
|
||||
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
|
||||
@@ -1235,7 +1235,7 @@ bool ChatHandler::HandleAccountSetPasswordCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
AccountOpResult result = accmgr.ChangePassword(targetAccountId, szPassword1);
|
||||
AccountOpResult result = sAccountMgr.ChangePassword(targetAccountId, szPassword1);
|
||||
|
||||
switch (result)
|
||||
{
|
||||
@@ -1356,7 +1356,7 @@ bool ChatHandler::HandleUnLearnCommand(const char *args)
|
||||
}
|
||||
|
||||
if (allRanks)
|
||||
spell_id = spellmgr.GetFirstSpellInChain (spell_id);
|
||||
spell_id = sSpellMgr.GetFirstSpellInChain (spell_id);
|
||||
|
||||
if (target->HasSpell(spell_id))
|
||||
target->removeSpell(spell_id,false,!allRanks);
|
||||
@@ -2104,7 +2104,7 @@ bool ChatHandler::HandleLearnAllMySpellsCommand(const char* /*args*/)
|
||||
continue;
|
||||
|
||||
// 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)
|
||||
continue;
|
||||
|
||||
@@ -2309,7 +2309,7 @@ bool ChatHandler::HandleLearnCommand(const char *args)
|
||||
else
|
||||
targetPlayer->learnSpell(spell, false);
|
||||
|
||||
uint32 first_spell = spellmgr.GetFirstSpellInChain(spell);
|
||||
uint32 first_spell = sSpellMgr.GetFirstSpellInChain(spell);
|
||||
if (GetTalentSpellCost(first_spell))
|
||||
targetPlayer->SendTalentsInfoData(false);
|
||||
|
||||
@@ -2368,7 +2368,7 @@ bool ChatHandler::HandleAddItemCommand(const char *args)
|
||||
|
||||
sLog.outDetail(GetTrinityString(LANG_ADDITEM), itemId, count);
|
||||
|
||||
ItemPrototype const *pProto = objmgr.GetItemPrototype(itemId);
|
||||
ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(itemId);
|
||||
if (!pProto)
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId);
|
||||
@@ -2507,7 +2507,7 @@ bool ChatHandler::HandleListItemCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemPrototype const* itemProto = objmgr.GetItemPrototype(item_id);
|
||||
ItemPrototype const* itemProto = sObjectMgr.GetItemPrototype(item_id);
|
||||
if (!itemProto)
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, item_id);
|
||||
@@ -2712,7 +2712,7 @@ bool ChatHandler::HandleListObjectCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
GameObjectInfo const * gInfo = objmgr.GetGameObjectInfo(go_id);
|
||||
GameObjectInfo const * gInfo = sObjectMgr.GetGameObjectInfo(go_id);
|
||||
if (!gInfo)
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, go_id);
|
||||
@@ -2778,7 +2778,7 @@ bool ChatHandler::HandleGameObjectStateCommand(const char *args)
|
||||
|
||||
GameObject* gobj = NULL;
|
||||
|
||||
if (GameObjectData const* goData = objmgr.GetGOData(lowguid))
|
||||
if (GameObjectData const* goData = sObjectMgr.GetGOData(lowguid))
|
||||
gobj = GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid, goData->id);
|
||||
|
||||
if (!gobj)
|
||||
@@ -2842,7 +2842,7 @@ bool ChatHandler::HandleListCreatureCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
CreatureInfo const* cInfo = objmgr.GetCreatureTemplate(cr_id);
|
||||
CreatureInfo const* cInfo = sObjectMgr.GetCreatureTemplate(cr_id);
|
||||
if (!cInfo)
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, cr_id);
|
||||
@@ -2921,7 +2921,7 @@ bool ChatHandler::HandleLookupItemCommand(const char *args)
|
||||
int loc_idx = GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
ItemLocale const *il = objmgr.GetItemLocale(pProto->ItemId);
|
||||
ItemLocale const *il = sObjectMgr.GetItemLocale(pProto->ItemId);
|
||||
if (il)
|
||||
{
|
||||
if (il->Name.size() > loc_idx && !il->Name[loc_idx].empty())
|
||||
@@ -3167,7 +3167,7 @@ bool ChatHandler::HandleLookupSpellCommand(const char *args)
|
||||
|
||||
// unit32 used to prevent interpreting uint8 as char at output
|
||||
// find rank of learned spell for learning spell, or talent rank
|
||||
uint32 rank = talentCost ? talentCost : 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
|
||||
std::ostringstream ss;
|
||||
@@ -3227,7 +3227,7 @@ bool ChatHandler::HandleLookupQuestCommand(const char *args)
|
||||
|
||||
bool found = false;
|
||||
|
||||
ObjectMgr::QuestMap const& qTemplates = objmgr.GetQuestTemplates();
|
||||
ObjectMgr::QuestMap const& qTemplates = sObjectMgr.GetQuestTemplates();
|
||||
for (ObjectMgr::QuestMap::const_iterator iter = qTemplates.begin(); iter != qTemplates.end(); ++iter)
|
||||
{
|
||||
Quest * qinfo = iter->second;
|
||||
@@ -3235,7 +3235,7 @@ bool ChatHandler::HandleLookupQuestCommand(const char *args)
|
||||
int loc_idx = GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
QuestLocale const *il = objmgr.GetQuestLocale(qinfo->GetQuestId());
|
||||
QuestLocale const *il = sObjectMgr.GetQuestLocale(qinfo->GetQuestId());
|
||||
if (il)
|
||||
{
|
||||
if (il->Title.size() > loc_idx && !il->Title[loc_idx].empty())
|
||||
@@ -3339,7 +3339,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args)
|
||||
int loc_idx = GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
CreatureLocale const *cl = objmgr.GetCreatureLocale (id);
|
||||
CreatureLocale const *cl = sObjectMgr.GetCreatureLocale (id);
|
||||
if (cl)
|
||||
{
|
||||
if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty ())
|
||||
@@ -3409,7 +3409,7 @@ bool ChatHandler::HandleLookupObjectCommand(const char *args)
|
||||
int loc_idx = GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
GameObjectLocale const *gl = objmgr.GetGameObjectLocale(id);
|
||||
GameObjectLocale const *gl = sObjectMgr.GetGameObjectLocale(id);
|
||||
if (gl)
|
||||
{
|
||||
if (gl->Name.size() > loc_idx && !gl->Name[loc_idx].empty())
|
||||
@@ -3761,7 +3761,7 @@ bool ChatHandler::HandleGuildCreateCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
objmgr.AddGuild (guild);
|
||||
sObjectMgr.AddGuild (guild);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3784,7 +3784,7 @@ bool ChatHandler::HandleGuildInviteCommand(const char *args)
|
||||
return false;
|
||||
|
||||
std::string glName = guildStr;
|
||||
Guild* targetGuild = objmgr.GetGuildByName (glName);
|
||||
Guild* targetGuild = sObjectMgr.GetGuildByName (glName);
|
||||
if (!targetGuild)
|
||||
return false;
|
||||
|
||||
@@ -3806,7 +3806,7 @@ bool ChatHandler::HandleGuildUninviteCommand(const char *args)
|
||||
if (!glId)
|
||||
return false;
|
||||
|
||||
Guild* targetGuild = objmgr.GetGuildById (glId);
|
||||
Guild* targetGuild = sObjectMgr.GetGuildById (glId);
|
||||
if (!targetGuild)
|
||||
return false;
|
||||
|
||||
@@ -3832,7 +3832,7 @@ bool ChatHandler::HandleGuildRankCommand(const char *args)
|
||||
if (!glId)
|
||||
return false;
|
||||
|
||||
Guild* targetGuild = objmgr.GetGuildById (glId);
|
||||
Guild* targetGuild = sObjectMgr.GetGuildById (glId);
|
||||
if (!targetGuild)
|
||||
return false;
|
||||
|
||||
@@ -3855,7 +3855,7 @@ bool ChatHandler::HandleGuildDeleteCommand(const char *args)
|
||||
|
||||
std::string gld = guildStr;
|
||||
|
||||
Guild* targetGuild = objmgr.GetGuildByName (gld);
|
||||
Guild* targetGuild = sObjectMgr.GetGuildByName (gld);
|
||||
if (!targetGuild)
|
||||
return false;
|
||||
|
||||
@@ -4137,7 +4137,7 @@ bool ChatHandler::HandleLinkGraveCommand(const char *args)
|
||||
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);
|
||||
else
|
||||
PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, g_id,zoneId);
|
||||
@@ -4163,14 +4163,14 @@ bool ChatHandler::HandleNearGraveCommand(const char *args)
|
||||
Player* player = m_session->GetPlayer();
|
||||
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);
|
||||
|
||||
if (graveyard)
|
||||
{
|
||||
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)
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR,g_id);
|
||||
@@ -4287,7 +4287,7 @@ bool ChatHandler::HandleNpcInfoCommand(const char* /*args*/)
|
||||
PSendSysMessage(LANG_NPCINFO_POSITION,float(target->GetPositionX()), float(target->GetPositionY()), float(target->GetPositionZ()));
|
||||
if (const CreatureData* const linked = target->GetLinkedRespawnCreatureData())
|
||||
if (CreatureInfo const *master = GetCreatureInfo(linked->id))
|
||||
PSendSysMessage(LANG_NPCINFO_LINKGUID, objmgr.GetLinkedRespawnGuid(target->GetDBTableGUIDLow()), linked->id, master->Name);
|
||||
PSendSysMessage(LANG_NPCINFO_LINKGUID, sObjectMgr.GetLinkedRespawnGuid(target->GetDBTableGUIDLow()), linked->id, master->Name);
|
||||
|
||||
if ((npcflags & UNIT_NPC_FLAG_VENDOR))
|
||||
{
|
||||
@@ -4356,7 +4356,7 @@ bool ChatHandler::HandleNpcAddWeaponCommand(const char* /*args*/)
|
||||
uint32 ItemID = atoi(pItemID);
|
||||
uint32 SlotID = atoi(pSlotID);
|
||||
|
||||
ItemPrototype* tmpItem = objmgr.GetItemPrototype(ItemID);
|
||||
ItemPrototype* tmpItem = sObjectMgr.GetItemPrototype(ItemID);
|
||||
|
||||
bool added = false;
|
||||
if (tmpItem)
|
||||
@@ -4717,7 +4717,7 @@ bool ChatHandler::HandleTeleAddCommand(const char * args)
|
||||
|
||||
std::string name = args;
|
||||
|
||||
if (objmgr.GetGameTele(name))
|
||||
if (sObjectMgr.GetGameTele(name))
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TP_ALREADYEXIST);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -4732,7 +4732,7 @@ bool ChatHandler::HandleTeleAddCommand(const char * args)
|
||||
tele.mapId = player->GetMapId();
|
||||
tele.name = name;
|
||||
|
||||
if (objmgr.AddGameTele(tele))
|
||||
if (sObjectMgr.AddGameTele(tele))
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TP_ADDED);
|
||||
}
|
||||
@@ -4753,7 +4753,7 @@ bool ChatHandler::HandleTeleDelCommand(const char * args)
|
||||
|
||||
std::string name = args;
|
||||
|
||||
if (!objmgr.DeleteGameTele(name))
|
||||
if (!sObjectMgr.DeleteGameTele(name))
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TELE_NOTFOUND);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -5237,7 +5237,7 @@ bool ChatHandler::HandleQuestAdd(const char *args)
|
||||
|
||||
uint32 entry = atol(cId);
|
||||
|
||||
Quest const* pQuest = objmgr.GetQuestTemplate(entry);
|
||||
Quest const* pQuest = sObjectMgr.GetQuestTemplate(entry);
|
||||
|
||||
if (!pQuest)
|
||||
{
|
||||
@@ -5291,7 +5291,7 @@ bool ChatHandler::HandleQuestRemove(const char *args)
|
||||
|
||||
uint32 entry = atol(cId);
|
||||
|
||||
Quest const* pQuest = objmgr.GetQuestTemplate(entry);
|
||||
Quest const* pQuest = sObjectMgr.GetQuestTemplate(entry);
|
||||
|
||||
if (!pQuest)
|
||||
{
|
||||
@@ -5341,7 +5341,7 @@ bool ChatHandler::HandleQuestComplete(const char *args)
|
||||
|
||||
uint32 entry = atol(cId);
|
||||
|
||||
Quest const* pQuest = objmgr.GetQuestTemplate(entry);
|
||||
Quest const* pQuest = sObjectMgr.GetQuestTemplate(entry);
|
||||
|
||||
// If player doesn't have the quest
|
||||
if (!pQuest || player->GetQuestStatus(entry) == QUEST_STATUS_NONE)
|
||||
@@ -5383,7 +5383,7 @@ bool ChatHandler::HandleQuestComplete(const char *args)
|
||||
}
|
||||
else if (creature > 0)
|
||||
{
|
||||
if (CreatureInfo const* cInfo = objmgr.GetCreatureTemplate(creature))
|
||||
if (CreatureInfo const* cInfo = sObjectMgr.GetCreatureTemplate(creature))
|
||||
for (uint16 z = 0; z < creaturecount; ++z)
|
||||
player->KilledMonster(cInfo,0);
|
||||
}
|
||||
@@ -5586,7 +5586,7 @@ bool ChatHandler::HandleBanInfoAccountCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 accountid = accmgr.GetId(account_name);
|
||||
uint32 accountid = sAccountMgr.GetId(account_name);
|
||||
if (!accountid)
|
||||
{
|
||||
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
|
||||
@@ -5603,10 +5603,10 @@ bool ChatHandler::HandleBanInfoCharacterCommand(const char *args)
|
||||
if (!extractPlayerTarget((char*)args,&target,&target_guid))
|
||||
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;
|
||||
if (!accmgr.GetName(accountid,accountname))
|
||||
if (!sAccountMgr.GetName(accountid,accountname))
|
||||
{
|
||||
PSendSysMessage(LANG_BANINFO_NOCHARACTER);
|
||||
return true;
|
||||
@@ -5763,7 +5763,7 @@ bool ChatHandler::HandleBanListHelper(QueryResult_AutoPtr result)
|
||||
account_name = fields[1].GetCppString();
|
||||
// "character" case, name need extract from another DB
|
||||
else
|
||||
accmgr.GetName (account_id,account_name);
|
||||
sAccountMgr.GetName (account_id,account_name);
|
||||
|
||||
// No SQL injection. id is uint32.
|
||||
QueryResult_AutoPtr banInfo = LoginDatabase.PQuery("SELECT bandate,unbandate,bannedby,banreason FROM account_banned WHERE id = %u ORDER BY unbandate", account_id);
|
||||
@@ -5952,7 +5952,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 account_id = accmgr.GetId(account_name);
|
||||
uint32 account_id = sAccountMgr.GetId(account_name);
|
||||
if (!account_id)
|
||||
{
|
||||
account_id = atoi(account); // use original string
|
||||
@@ -5964,7 +5964,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args)
|
||||
}
|
||||
}
|
||||
|
||||
if (!accmgr.GetName(account_id,account_name))
|
||||
if (!sAccountMgr.GetName(account_id,account_name))
|
||||
{
|
||||
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
@@ -6008,7 +6008,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (objmgr.GetPlayerAccountIdByGUID(guid))
|
||||
if (sObjectMgr.GetPlayerAccountIdByGUID(guid))
|
||||
{
|
||||
PSendSysMessage(LANG_CHARACTER_GUID_IN_USE,guid);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -6067,10 +6067,10 @@ bool ChatHandler::HandlePDumpWriteCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
guid = objmgr.GetPlayerGUIDByName(name);
|
||||
guid = sObjectMgr.GetPlayerGUIDByName(name);
|
||||
}
|
||||
|
||||
if (!objmgr.GetPlayerAccountIdByGUID(guid))
|
||||
if (!sObjectMgr.GetPlayerAccountIdByGUID(guid))
|
||||
{
|
||||
PSendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -6558,9 +6558,9 @@ bool ChatHandler::HandleInstanceStatsCommand(const char* /*args*/)
|
||||
{
|
||||
PSendSysMessage("instances loaded: %d", sMapMgr.GetNumInstances());
|
||||
PSendSysMessage("players in instances: %d", sMapMgr.GetNumPlayersInInstances());
|
||||
PSendSysMessage("instance saves: %d", sInstanceSaveManager.GetNumInstanceSaves());
|
||||
PSendSysMessage("players bound: %d", sInstanceSaveManager.GetNumBoundPlayersTotal());
|
||||
PSendSysMessage("groups bound: %d", sInstanceSaveManager.GetNumBoundGroupsTotal());
|
||||
PSendSysMessage("instance saves: %d", sInstanceSaveMgr.GetNumInstanceSaves());
|
||||
PSendSysMessage("players bound: %d", sInstanceSaveMgr.GetNumBoundPlayersTotal());
|
||||
PSendSysMessage("groups bound: %d", sInstanceSaveMgr.GetNumBoundGroupsTotal());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -6664,7 +6664,7 @@ bool ChatHandler::HandleAccountSetAddonCommand(const char *args)
|
||||
return false;
|
||||
|
||||
account_id = player->GetSession()->GetAccountId();
|
||||
accmgr.GetName(account_id,account_name);
|
||||
sAccountMgr.GetName(account_id,account_name);
|
||||
szExp = szAcc;
|
||||
}
|
||||
else
|
||||
@@ -6678,7 +6678,7 @@ bool ChatHandler::HandleAccountSetAddonCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
account_id = accmgr.GetId(account_name);
|
||||
account_id = sAccountMgr.GetId(account_name);
|
||||
if (!account_id)
|
||||
{
|
||||
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
|
||||
@@ -6756,7 +6756,7 @@ bool ChatHandler::HandleSendItemsCommand(const char *args)
|
||||
if (!item_id)
|
||||
return false;
|
||||
|
||||
ItemPrototype const* item_proto = objmgr.GetItemPrototype(item_id);
|
||||
ItemPrototype const* item_proto = sObjectMgr.GetItemPrototype(item_id);
|
||||
if (!item_proto)
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, item_id);
|
||||
@@ -6909,7 +6909,7 @@ bool ChatHandler::HandleModifyGenderCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
PlayerInfo const* info = objmgr.GetPlayerInfo(player->getRace(), player->getClass());
|
||||
PlayerInfo const* info = sObjectMgr.GetPlayerInfo(player->getRace(), player->getClass());
|
||||
if (!info)
|
||||
return false;
|
||||
|
||||
@@ -7024,7 +7024,7 @@ bool ChatHandler::HandleFreezeCommand(const char *args)
|
||||
{
|
||||
name = TargetName;
|
||||
normalizePlayerName(name);
|
||||
player = objmgr.GetPlayer(name.c_str()); //get player by name
|
||||
player = sObjectMgr.GetPlayer(name.c_str()); //get player by name
|
||||
}
|
||||
|
||||
if (!player)
|
||||
@@ -7090,7 +7090,7 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args)
|
||||
{
|
||||
name = TargetName;
|
||||
normalizePlayerName(name);
|
||||
player = objmgr.GetPlayer(name.c_str()); //get player by name
|
||||
player = sObjectMgr.GetPlayer(name.c_str()); //get player by name
|
||||
}
|
||||
|
||||
//effect
|
||||
|
||||
@@ -114,7 +114,7 @@ bool Condition::Meets(Player * player, Unit* targetOverride)
|
||||
condMeets = !player->HasAuraEffect(mConditionValue1, mConditionValue2);
|
||||
break;
|
||||
case CONDITION_ACTIVE_EVENT:
|
||||
condMeets = gameeventmgr.IsActiveEvent(mConditionValue1);
|
||||
condMeets = sGameEventMgr.IsActiveEvent(mConditionValue1);
|
||||
break;
|
||||
case CONDITION_INSTANCE_DATA:
|
||||
{
|
||||
@@ -315,10 +315,10 @@ void ConditionMgr::LoadConditions(bool isReload)
|
||||
LootTemplates_Spell.ResetConditions();
|
||||
|
||||
sLog.outString("Re-Loading `gossip_menu` Table for Conditions!");
|
||||
objmgr.LoadGossipMenu();
|
||||
sObjectMgr.LoadGossipMenu();
|
||||
|
||||
sLog.outString("Re-Loading `gossip_menu_option` Table for Conditions!");
|
||||
objmgr.LoadGossipMenuItems();
|
||||
sObjectMgr.LoadGossipMenuItems();
|
||||
}
|
||||
|
||||
uint32 count = 0;
|
||||
@@ -353,7 +353,7 @@ void ConditionMgr::LoadConditions(bool isReload)
|
||||
cond->mConditionValue2 = fields[6].GetUInt32();
|
||||
cond->mConditionValue3 = fields[7].GetUInt32();
|
||||
cond->ErrorTextd = fields[8].GetUInt32();
|
||||
cond->mScriptId = objmgr.GetScriptId(fields[9].GetString());
|
||||
cond->mScriptId = sObjectMgr.GetScriptId(fields[9].GetString());
|
||||
|
||||
if (iConditionTypeOrReference >= 0)
|
||||
cond->mConditionType = ConditionType(iConditionTypeOrReference);
|
||||
@@ -523,7 +523,7 @@ bool ConditionMgr::addToLootTemplate(Condition* cond, LootTemplate* loot)
|
||||
|
||||
bool ConditionMgr::addToGossipMenus(Condition* cond)
|
||||
{
|
||||
GossipMenusMapBoundsNonConst pMenuBounds = objmgr.GetGossipMenusMapBoundsNonConst(cond->mSourceGroup);
|
||||
GossipMenusMapBoundsNonConst pMenuBounds = sObjectMgr.GetGossipMenusMapBoundsNonConst(cond->mSourceGroup);
|
||||
|
||||
if (pMenuBounds.first != pMenuBounds.second)
|
||||
{
|
||||
@@ -543,7 +543,7 @@ bool ConditionMgr::addToGossipMenus(Condition* cond)
|
||||
|
||||
bool ConditionMgr::addToGossipMenuItems(Condition* cond)
|
||||
{
|
||||
GossipMenuItemsMapBoundsNonConst pMenuItemBounds = objmgr.GetGossipMenuItemsMapBoundsNonConst(cond->mSourceGroup);
|
||||
GossipMenuItemsMapBoundsNonConst pMenuItemBounds = sObjectMgr.GetGossipMenuItemsMapBoundsNonConst(cond->mSourceGroup);
|
||||
if (pMenuItemBounds.first != pMenuItemBounds.second)
|
||||
{
|
||||
for (GossipMenuItemsMap::iterator itr = pMenuItemBounds.first; itr != pMenuItemBounds.second; ++itr)
|
||||
@@ -849,7 +849,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemPrototype const *pItemProto = objmgr.GetItemPrototype(cond->mSourceEntry);
|
||||
ItemPrototype const *pItemProto = sObjectMgr.GetItemPrototype(cond->mSourceEntry);
|
||||
if (!pItemProto)
|
||||
{
|
||||
sLog.outErrorDb("SourceEntry %u in `condition` table, does not exist in `item_tamplate`, ignoring.", cond->mSourceEntry);
|
||||
@@ -929,7 +929,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
}
|
||||
case CONDITION_ITEM:
|
||||
{
|
||||
ItemPrototype const *proto = objmgr.GetItemPrototype(cond->mConditionValue1);
|
||||
ItemPrototype const *proto = sObjectMgr.GetItemPrototype(cond->mConditionValue1);
|
||||
if (!proto)
|
||||
{
|
||||
sLog.outErrorDb("Item condition has non existing item (%u), skipped", cond->mConditionValue1);
|
||||
@@ -945,7 +945,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
}
|
||||
case CONDITION_ITEM_EQUIPPED:
|
||||
{
|
||||
ItemPrototype const *proto = objmgr.GetItemPrototype(cond->mConditionValue1);
|
||||
ItemPrototype const *proto = sObjectMgr.GetItemPrototype(cond->mConditionValue1);
|
||||
if (!proto)
|
||||
{
|
||||
sLog.outErrorDb("ItemEquipped condition has non existing item (%u), skipped", cond->mConditionValue1);
|
||||
@@ -1017,7 +1017,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
case CONDITION_QUESTTAKEN:
|
||||
case CONDITION_QUEST_NONE:
|
||||
{
|
||||
Quest const *Quest = objmgr.GetQuestTemplate(cond->mConditionValue1);
|
||||
Quest const *Quest = sObjectMgr.GetQuestTemplate(cond->mConditionValue1);
|
||||
if (!Quest)
|
||||
{
|
||||
sLog.outErrorDb("Quest condition specifies non-existing quest (%u), skipped", cond->mConditionValue1);
|
||||
@@ -1054,7 +1054,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
}
|
||||
case CONDITION_ACTIVE_EVENT:
|
||||
{
|
||||
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
|
||||
if (cond->mConditionValue1 >=events.size() || !events[cond->mConditionValue1].isValid())
|
||||
{
|
||||
sLog.outErrorDb("Active event condition has non existing event id (%u), skipped", cond->mConditionValue1);
|
||||
|
||||
@@ -182,7 +182,7 @@ void DisableMgr::CheckQuestDisables()
|
||||
{
|
||||
bar.step();
|
||||
const uint32 entry = itr->first;
|
||||
if (!objmgr.GetQuestTemplate(entry))
|
||||
if (!sObjectMgr.GetQuestTemplate(entry))
|
||||
{
|
||||
sLog.outErrorDb("Quest entry %u from `disables` doesn't exist, skipped.", entry);
|
||||
m_DisableMap[DISABLE_TYPE_QUEST].erase(itr++);
|
||||
|
||||
@@ -444,7 +444,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
continue;
|
||||
|
||||
for (int x = 0; x < MAX_DIFFICULTY; ++x)
|
||||
spellmgr.SetSpellDifficultyId(uint32(newEntry.SpellID[x]), spellDiff->ID);
|
||||
sSpellMgr.SetSpellDifficultyId(uint32(newEntry.SpellID[x]), spellDiff->ID);
|
||||
}
|
||||
|
||||
// create talent spells set
|
||||
|
||||
@@ -86,7 +86,7 @@ void LFGQueue::Update()
|
||||
queuedTime = uint32(currTime - queue->joinTime);
|
||||
for (LfgRolesMap::const_iterator itPlayer = queue->roles.begin(); itPlayer != queue->roles.end(); ++itPlayer)
|
||||
{
|
||||
plr = objmgr.GetPlayer(itPlayer->first);
|
||||
plr = sObjectMgr.GetPlayer(itPlayer->first);
|
||||
if (!plr)
|
||||
continue;
|
||||
role = itPlayer->second;
|
||||
@@ -177,7 +177,7 @@ void LFGMgr::Update(uint32 diff)
|
||||
Player *plr = NULL;
|
||||
for (LfgRolesMap::const_iterator itRoles = pRoleCheck->roles.begin(); itRoles != pRoleCheck->roles.end(); ++itRoles)
|
||||
{
|
||||
plr = objmgr.GetPlayer(itRoles->first);
|
||||
plr = sObjectMgr.GetPlayer(itRoles->first);
|
||||
if (!plr)
|
||||
continue;
|
||||
plr->GetSession()->SendPacket(&data);
|
||||
@@ -706,7 +706,7 @@ void LFGMgr::BuildLfgRoleCheck(WorldPacket &data, LfgRoleCheck *pRoleCheck)
|
||||
data << uint64(pRoleCheck->leader); // Guid
|
||||
data << uint8(roles > 0); // Ready
|
||||
data << uint32(roles); // Roles
|
||||
plr = objmgr.GetPlayer(pRoleCheck->leader);
|
||||
plr = sObjectMgr.GetPlayer(pRoleCheck->leader);
|
||||
if (plr)
|
||||
data << uint8(plr->getLevel()); // Level
|
||||
else
|
||||
@@ -721,7 +721,7 @@ void LFGMgr::BuildLfgRoleCheck(WorldPacket &data, LfgRoleCheck *pRoleCheck)
|
||||
data << uint64(itPlayers->first); // Guid
|
||||
data << uint8(roles > 0); // Ready
|
||||
data << uint32(roles); // Roles
|
||||
plr = objmgr.GetPlayer(pRoleCheck->leader);
|
||||
plr = sObjectMgr.GetPlayer(pRoleCheck->leader);
|
||||
if (plr)
|
||||
data << uint8(plr->getLevel()); // Level
|
||||
else
|
||||
|
||||
@@ -129,7 +129,7 @@ bool AssistDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
||||
|
||||
CreatureBaseStats const* CreatureBaseStats::GetBaseStats(uint8 level, uint8 unitClass)
|
||||
{
|
||||
return objmgr.GetCreatureBaseStats(level, unitClass);
|
||||
return sObjectMgr.GetCreatureBaseStats(level, unitClass);
|
||||
}
|
||||
|
||||
bool ForcedDespawnDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
||||
@@ -257,7 +257,7 @@ void Creature::RemoveCorpse()
|
||||
*/
|
||||
bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data)
|
||||
{
|
||||
CreatureInfo const *normalInfo = objmgr.GetCreatureTemplate(Entry);
|
||||
CreatureInfo const *normalInfo = sObjectMgr.GetCreatureTemplate(Entry);
|
||||
if (!normalInfo)
|
||||
{
|
||||
sLog.outErrorDb("Creature::InitEntry creature entry %u does not exist.", Entry);
|
||||
@@ -275,7 +275,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data
|
||||
// we already have valid Map pointer for current creature!
|
||||
if (GetMap()->GetSpawnMode() > diff)
|
||||
{
|
||||
cinfo = objmgr.GetCreatureTemplate(normalInfo->DifficultyEntry[diff]);
|
||||
cinfo = sObjectMgr.GetCreatureTemplate(normalInfo->DifficultyEntry[diff]);
|
||||
if (!cinfo)
|
||||
{
|
||||
// maybe check such things already at startup
|
||||
@@ -302,8 +302,8 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 display_id = objmgr.ChooseDisplayId(0, GetCreatureInfo(), data);
|
||||
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
|
||||
uint32 display_id = sObjectMgr.ChooseDisplayId(0, GetCreatureInfo(), data);
|
||||
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
|
||||
if (!minfo) // Cancel load if no model defined
|
||||
{
|
||||
sLog.outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ",Entry);
|
||||
@@ -370,7 +370,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data)
|
||||
setFaction(cInfo->faction_A);
|
||||
|
||||
if (cInfo->flags_extra & CREATURE_FLAG_EXTRA_WORLDEVENT)
|
||||
SetUInt32Value(UNIT_NPC_FLAGS,cInfo->npcflag | gameeventmgr.GetNPCFlag(this));
|
||||
SetUInt32Value(UNIT_NPC_FLAGS,cInfo->npcflag | sGameEventMgr.GetNPCFlag(this));
|
||||
else
|
||||
SetUInt32Value(UNIT_NPC_FLAGS,cInfo->npcflag);
|
||||
|
||||
@@ -384,7 +384,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data)
|
||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
|
||||
|
||||
SetMeleeDamageSchool(SpellSchools(cInfo->dmgschool));
|
||||
CreatureBaseStats const* stats = objmgr.GetCreatureBaseStats(getLevel(), cInfo->unit_class);
|
||||
CreatureBaseStats const* stats = sObjectMgr.GetCreatureBaseStats(getLevel(), cInfo->unit_class);
|
||||
float armor = stats->GenerateArmor(cInfo); // TODO: Why is this treated as uint32 when it's a float?
|
||||
SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, armor);
|
||||
SetModifierValue(UNIT_MOD_RESISTANCE_HOLY, BASE_VALUE, float(cInfo->resistance1));
|
||||
@@ -453,7 +453,7 @@ void Creature::Update(uint32 diff)
|
||||
Respawn();
|
||||
else // the master is dead
|
||||
{
|
||||
if (uint32 targetGuid = objmgr.GetLinkedRespawnGuid(m_DBTableGuid))
|
||||
if (uint32 targetGuid = sObjectMgr.GetLinkedRespawnGuid(m_DBTableGuid))
|
||||
{
|
||||
if (targetGuid == m_DBTableGuid) // if linking self, never respawn (check delayed to next day)
|
||||
SetRespawnTime(DAY);
|
||||
@@ -479,7 +479,7 @@ void Creature::Update(uint32 diff)
|
||||
|
||||
if (m_groupLootTimer <= diff)
|
||||
{
|
||||
Group* group = objmgr.GetGroupByGUID(lootingGroupLowGUID);
|
||||
Group* group = sObjectMgr.GetGroupByGUID(lootingGroupLowGUID);
|
||||
if (group)
|
||||
group->EndRoll(&loot);
|
||||
m_groupLootTimer = 0;
|
||||
@@ -773,7 +773,7 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry,
|
||||
break;
|
||||
}
|
||||
LoadCreaturesAddon();
|
||||
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(GetNativeDisplayId());
|
||||
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(GetNativeDisplayId());
|
||||
if (minfo && !isTotem()) // Cancel load if no model defined or if totem
|
||||
{
|
||||
uint32 display_id = minfo->modelid; // it can be different (for another gender)
|
||||
@@ -1001,7 +1001,7 @@ void Creature::SaveToDB()
|
||||
{
|
||||
// this should only be used when the creature has already been loaded
|
||||
// preferably after adding to map, because mapid may not be valid otherwise
|
||||
CreatureData const *data = objmgr.GetCreatureData(m_DBTableGuid);
|
||||
CreatureData const *data = sObjectMgr.GetCreatureData(m_DBTableGuid);
|
||||
if (!data)
|
||||
{
|
||||
sLog.outError("Creature::SaveToDB failed, cannot get creature data!");
|
||||
@@ -1016,7 +1016,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
||||
// update in loaded data
|
||||
if (!m_DBTableGuid)
|
||||
m_DBTableGuid = GetGUIDLow();
|
||||
CreatureData& data = objmgr.NewOrExistCreatureData(m_DBTableGuid);
|
||||
CreatureData& data = sObjectMgr.NewOrExistCreatureData(m_DBTableGuid);
|
||||
|
||||
uint32 displayId = GetNativeDisplayId();
|
||||
|
||||
@@ -1092,7 +1092,7 @@ void Creature::SelectLevel(const CreatureInfo *cinfo)
|
||||
uint8 level = minlevel == maxlevel ? minlevel : urand(minlevel, maxlevel);
|
||||
SetLevel(level);
|
||||
|
||||
CreatureBaseStats const* stats = objmgr.GetCreatureBaseStats(level, cinfo->unit_class);
|
||||
CreatureBaseStats const* stats = sObjectMgr.GetCreatureBaseStats(level, cinfo->unit_class);
|
||||
|
||||
// health
|
||||
float healthmod = _GetHealthMod(rank);
|
||||
@@ -1197,7 +1197,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint3
|
||||
return false;
|
||||
}
|
||||
|
||||
CreatureInfo const *cinfo = objmgr.GetCreatureTemplate(Entry);
|
||||
CreatureInfo const *cinfo = sObjectMgr.GetCreatureTemplate(Entry);
|
||||
if (!cinfo)
|
||||
{
|
||||
sLog.outErrorDb("Creature entry %u does not exist.", Entry);
|
||||
@@ -1222,7 +1222,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint3
|
||||
|
||||
bool Creature::LoadFromDB(uint32 guid, Map *map)
|
||||
{
|
||||
CreatureData const* data = objmgr.GetCreatureData(guid);
|
||||
CreatureData const* data = sObjectMgr.GetCreatureData(guid);
|
||||
|
||||
if (!data)
|
||||
{
|
||||
@@ -1237,7 +1237,7 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
guid = objmgr.GenerateLowGuid(HIGHGUID_UNIT);
|
||||
guid = sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT);
|
||||
|
||||
uint16 team = 0;
|
||||
if (!Create(guid,map,data->phaseMask,data->id,0,team,data->posX,data->posY,data->posZ,data->orientation,data))
|
||||
@@ -1252,7 +1252,7 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
|
||||
m_isDeadByDefault = data->is_dead;
|
||||
m_deathState = m_isDeadByDefault ? DEAD : ALIVE;
|
||||
|
||||
m_respawnTime = objmgr.GetCreatureRespawnTime(m_DBTableGuid,GetInstanceId());
|
||||
m_respawnTime = sObjectMgr.GetCreatureRespawnTime(m_DBTableGuid,GetInstanceId());
|
||||
if (m_respawnTime) // respawn on Update
|
||||
{
|
||||
m_deathState = DEAD;
|
||||
@@ -1306,7 +1306,7 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force)
|
||||
return;
|
||||
}
|
||||
|
||||
EquipmentInfo const *einfo = objmgr.GetEquipmentInfo(equip_entry);
|
||||
EquipmentInfo const *einfo = sObjectMgr.GetEquipmentInfo(equip_entry);
|
||||
if (!einfo)
|
||||
return;
|
||||
|
||||
@@ -1317,7 +1317,7 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force)
|
||||
|
||||
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)
|
||||
{
|
||||
if (itr->second == quest_id)
|
||||
@@ -1328,7 +1328,7 @@ bool Creature::hasQuest(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)
|
||||
{
|
||||
if (itr->second == quest_id)
|
||||
@@ -1345,8 +1345,8 @@ void Creature::DeleteFromDB()
|
||||
return;
|
||||
}
|
||||
|
||||
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
objmgr.DeleteCreatureData(m_DBTableGuid);
|
||||
sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
sObjectMgr.DeleteCreatureData(m_DBTableGuid);
|
||||
|
||||
WorldDatabase.BeginTransaction();
|
||||
WorldDatabase.PExecuteLog("DELETE FROM creature WHERE guid = '%u'", m_DBTableGuid);
|
||||
@@ -1569,7 +1569,7 @@ void Creature::Respawn(bool force)
|
||||
if (getDeathState() == DEAD)
|
||||
{
|
||||
if (m_DBTableGuid)
|
||||
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
|
||||
DEBUG_LOG("Respawning...");
|
||||
m_respawnTime = 0;
|
||||
@@ -1592,7 +1592,7 @@ void Creature::Respawn(bool force)
|
||||
else
|
||||
setDeathState(JUST_ALIVED);
|
||||
|
||||
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(GetNativeDisplayId());
|
||||
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(GetNativeDisplayId());
|
||||
if (minfo) // Cancel load if no model defined
|
||||
{
|
||||
uint32 display_id = minfo->modelid; // it can be different (for another gender)
|
||||
@@ -1606,9 +1606,9 @@ void Creature::Respawn(bool force)
|
||||
if (IsAIEnabled)
|
||||
AI()->JustRespawned();
|
||||
|
||||
uint16 poolid = GetDBTableGUIDLow() ? poolhandler.IsPartOfAPool<Creature>(GetDBTableGUIDLow()) : 0;
|
||||
uint16 poolid = GetDBTableGUIDLow() ? sPoolMgr.IsPartOfAPool<Creature>(GetDBTableGUIDLow()) : 0;
|
||||
if (poolid)
|
||||
poolhandler.UpdatePool<Creature>(poolid, GetDBTableGUIDLow());
|
||||
sPoolMgr.UpdatePool<Creature>(poolid, GetDBTableGUIDLow());
|
||||
|
||||
//Re-initialize reactstate that could be altered by movementgenerators
|
||||
InitializeReactState();
|
||||
@@ -1991,9 +1991,9 @@ void Creature::SaveRespawnTime()
|
||||
return;
|
||||
|
||||
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)
|
||||
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),time(NULL)+m_respawnDelay+m_deathTimer/IN_MILLISECONDS);
|
||||
sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),time(NULL)+m_respawnDelay+m_deathTimer/IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
// this should not be called by petAI or
|
||||
@@ -2228,7 +2228,7 @@ void Creature::GetRespawnCoord(float &x, float &y, float &z, float* ori, float*
|
||||
{
|
||||
if (m_DBTableGuid)
|
||||
{
|
||||
if (CreatureData const* data = objmgr.GetCreatureData(GetDBTableGUIDLow()))
|
||||
if (CreatureData const* data = sObjectMgr.GetCreatureData(GetDBTableGUIDLow()))
|
||||
{
|
||||
x = data->posX;
|
||||
y = data->posY;
|
||||
@@ -2292,7 +2292,7 @@ std::string Creature::GetAIName() const
|
||||
|
||||
std::string Creature::GetScriptName() const
|
||||
{
|
||||
return objmgr.GetScriptName(GetScriptId());
|
||||
return sObjectMgr.GetScriptName(GetScriptId());
|
||||
}
|
||||
|
||||
uint32 Creature::GetScriptId() const
|
||||
@@ -2302,7 +2302,7 @@ uint32 Creature::GetScriptId() const
|
||||
|
||||
VendorItemData const* Creature::GetVendorItems() const
|
||||
{
|
||||
return objmgr.GetNpcVendorItemList(GetEntry());
|
||||
return sObjectMgr.GetNpcVendorItemList(GetEntry());
|
||||
}
|
||||
|
||||
uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem)
|
||||
@@ -2324,7 +2324,7 @@ uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem)
|
||||
|
||||
if (vCount->lastIncrementTime + vItem->incrtime <= ptime)
|
||||
{
|
||||
ItemPrototype const* pProto = objmgr.GetItemPrototype(vItem->item);
|
||||
ItemPrototype const* pProto = sObjectMgr.GetItemPrototype(vItem->item);
|
||||
|
||||
uint32 diff = uint32((ptime - vCount->lastIncrementTime)/vItem->incrtime);
|
||||
if ((vCount->count + diff * pProto->BuyCount) >= vItem->maxcount)
|
||||
@@ -2363,7 +2363,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us
|
||||
|
||||
if (vCount->lastIncrementTime + vItem->incrtime <= ptime)
|
||||
{
|
||||
ItemPrototype const* pProto = objmgr.GetItemPrototype(vItem->item);
|
||||
ItemPrototype const* pProto = sObjectMgr.GetItemPrototype(vItem->item);
|
||||
|
||||
uint32 diff = uint32((ptime - vCount->lastIncrementTime)/vItem->incrtime);
|
||||
if ((vCount->count + diff * pProto->BuyCount) < vItem->maxcount)
|
||||
@@ -2379,7 +2379,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us
|
||||
|
||||
TrainerSpellData const* Creature::GetTrainerSpells() const
|
||||
{
|
||||
return objmgr.GetNpcTrainerSpells(GetEntry());
|
||||
return sObjectMgr.GetNpcTrainerSpells(GetEntry());
|
||||
}
|
||||
|
||||
// overwrite WorldObject function for proper name localization
|
||||
@@ -2387,7 +2387,7 @@ const char* Creature::GetNameForLocaleIdx(int32 loc_idx) const
|
||||
{
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
CreatureLocale const *cl = objmgr.GetCreatureLocale(GetEntry());
|
||||
CreatureLocale const *cl = sObjectMgr.GetCreatureLocale(GetEntry());
|
||||
if (cl)
|
||||
{
|
||||
if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty())
|
||||
@@ -2403,8 +2403,8 @@ const CreatureData* Creature::GetLinkedRespawnCreatureData() const
|
||||
if (!m_DBTableGuid) // only hard-spawned creatures from DB can have a linked master
|
||||
return NULL;
|
||||
|
||||
if (uint32 targetGuid = objmgr.GetLinkedRespawnGuid(m_DBTableGuid))
|
||||
return objmgr.GetCreatureData(targetGuid);
|
||||
if (uint32 targetGuid = sObjectMgr.GetLinkedRespawnGuid(m_DBTableGuid))
|
||||
return sObjectMgr.GetCreatureData(targetGuid);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -2415,10 +2415,10 @@ time_t Creature::GetLinkedCreatureRespawnTime() const
|
||||
if (!m_DBTableGuid) // only hard-spawned creatures from DB can have a linked master
|
||||
return 0;
|
||||
|
||||
if (uint32 targetGuid = objmgr.GetLinkedRespawnGuid(m_DBTableGuid))
|
||||
if (uint32 targetGuid = sObjectMgr.GetLinkedRespawnGuid(m_DBTableGuid))
|
||||
{
|
||||
Map* targetMap = NULL;
|
||||
if (const CreatureData* data = objmgr.GetCreatureData(targetGuid))
|
||||
if (const CreatureData* data = sObjectMgr.GetCreatureData(targetGuid))
|
||||
{
|
||||
if (data->mapid == GetMapId()) // look up on the same map
|
||||
targetMap = GetMap();
|
||||
@@ -2426,7 +2426,7 @@ time_t Creature::GetLinkedCreatureRespawnTime() const
|
||||
targetMap = sMapMgr.FindMap(data->mapid);
|
||||
}
|
||||
if (targetMap)
|
||||
return objmgr.GetCreatureRespawnTime(targetGuid,targetMap->GetInstanceId());
|
||||
return sObjectMgr.GetCreatureRespawnTime(targetGuid,targetMap->GetInstanceId());
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -712,7 +712,7 @@ class Creature : public Unit, public GridObject<Creature>
|
||||
|
||||
bool DisableReputationGain;
|
||||
|
||||
CreatureInfo const* m_creatureInfo; // in difficulty mode > 0 can different from objmgr.::GetCreatureTemplate(GetEntry())
|
||||
CreatureInfo const* m_creatureInfo; // in difficulty mode > 0 can different from sObjectMgr.::GetCreatureTemplate(GetEntry())
|
||||
CreatureData const* m_creatureData;
|
||||
|
||||
uint16 m_LootMode; // bitmask, default LOOT_MODE_DEFAULT, determines what loot will be lootable
|
||||
|
||||
@@ -162,7 +162,7 @@ void PlayerMenu::SendGossipMenu(uint32 TitleTextId, uint64 objectGUID)
|
||||
{
|
||||
QuestMenuItem const& qItem = mQuestMenu.GetItem(iI);
|
||||
uint32 questID = qItem.m_qId;
|
||||
Quest const* pQuest = objmgr.GetQuestTemplate(questID);
|
||||
Quest const* pQuest = sObjectMgr.GetQuestTemplate(questID);
|
||||
|
||||
data << uint32(questID);
|
||||
data << uint32(qItem.m_qIcon);
|
||||
@@ -173,7 +173,7 @@ void PlayerMenu::SendGossipMenu(uint32 TitleTextId, uint64 objectGUID)
|
||||
|
||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||
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())
|
||||
Title = ql->Title[loc_idx];
|
||||
data << Title; // max 0x200
|
||||
@@ -205,7 +205,7 @@ void PlayerMenu::SendPointOfInterest(float X, float Y, uint32 Icon, uint32 Flags
|
||||
|
||||
void PlayerMenu::SendPointOfInterest(uint32 poi_id)
|
||||
{
|
||||
PointOfInterest const* poi = objmgr.GetPointOfInterest(poi_id);
|
||||
PointOfInterest const* poi = sObjectMgr.GetPointOfInterest(poi_id);
|
||||
if (!poi)
|
||||
{
|
||||
sLog.outErrorDb("Request to send non-existing POI (Id: %u), ignored.",poi_id);
|
||||
@@ -217,7 +217,7 @@ void PlayerMenu::SendPointOfInterest(uint32 poi_id)
|
||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
PointOfInterestLocale const *pl = objmgr.GetPointOfInterestLocale(poi_id);
|
||||
PointOfInterestLocale const *pl = sObjectMgr.GetPointOfInterestLocale(poi_id);
|
||||
if (pl)
|
||||
{
|
||||
if (pl->IconName.size() > size_t(loc_idx) && !pl->IconName[loc_idx].empty())
|
||||
@@ -239,7 +239,7 @@ void PlayerMenu::SendPointOfInterest(uint32 poi_id)
|
||||
|
||||
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
|
||||
data << textID; // can be < 0
|
||||
@@ -271,7 +271,7 @@ void PlayerMenu::SendTalking(uint32 textID)
|
||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
NpcTextLocale const *nl = objmgr.GetNpcTextLocale(textID);
|
||||
NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textID);
|
||||
if (nl)
|
||||
{
|
||||
for (int i=0; i<8; ++i)
|
||||
@@ -350,7 +350,7 @@ QuestMenu::~QuestMenu()
|
||||
|
||||
void QuestMenu::AddMenuItem(uint32 QuestId, uint8 Icon)
|
||||
{
|
||||
Quest const* qinfo = objmgr.GetQuestTemplate(QuestId);
|
||||
Quest const* qinfo = sObjectMgr.GetQuestTemplate(QuestId);
|
||||
if (!qinfo) return;
|
||||
|
||||
ASSERT(m_qItems.size() <= GOSSIP_MAX_MENU_ITEMS);
|
||||
@@ -397,14 +397,14 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title
|
||||
|
||||
uint32 questID = qmi.m_qId;
|
||||
|
||||
if (Quest const *pQuest = objmgr.GetQuestTemplate(questID))
|
||||
if (Quest const *pQuest = sObjectMgr.GetQuestTemplate(questID))
|
||||
{
|
||||
std::string title = pQuest->GetTitle();
|
||||
|
||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
if (QuestLocale const *ql = objmgr.GetQuestLocale(questID))
|
||||
if (QuestLocale const *ql = sObjectMgr.GetQuestLocale(questID))
|
||||
{
|
||||
if (ql->Title.size() > (size_t)loc_idx && !ql->Title[loc_idx].empty())
|
||||
title = ql->Title[loc_idx];
|
||||
@@ -445,7 +445,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, uint64 npcGUID,
|
||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
QuestLocale const *ql = objmgr.GetQuestLocale(pQuest->GetQuestId());
|
||||
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
|
||||
if (ql)
|
||||
{
|
||||
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
|
||||
@@ -491,7 +491,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, uint64 npcGUID,
|
||||
data << uint32(pQuest->RewChoiceItemId[i]);
|
||||
data << uint32(pQuest->RewChoiceItemCount[i]);
|
||||
|
||||
IProto = objmgr.GetItemPrototype(pQuest->RewChoiceItemId[i]);
|
||||
IProto = sObjectMgr.GetItemPrototype(pQuest->RewChoiceItemId[i]);
|
||||
|
||||
if (IProto)
|
||||
data << uint32(IProto->DisplayInfoID);
|
||||
@@ -509,7 +509,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, uint64 npcGUID,
|
||||
data << uint32(pQuest->RewItemId[i]);
|
||||
data << uint32(pQuest->RewItemCount[i]);
|
||||
|
||||
IProto = objmgr.GetItemPrototype(pQuest->RewItemId[i]);
|
||||
IProto = sObjectMgr.GetItemPrototype(pQuest->RewItemId[i]);
|
||||
|
||||
if (IProto)
|
||||
data << uint32(IProto->DisplayInfoID);
|
||||
@@ -566,7 +566,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const *pQuest)
|
||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
QuestLocale const *ql = objmgr.GetQuestLocale(pQuest->GetQuestId());
|
||||
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
|
||||
if (ql)
|
||||
{
|
||||
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
|
||||
@@ -706,7 +706,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID,
|
||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
QuestLocale const *ql = objmgr.GetQuestLocale(pQuest->GetQuestId());
|
||||
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
|
||||
if (ql)
|
||||
{
|
||||
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
|
||||
@@ -747,7 +747,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID,
|
||||
data << uint32(pQuest->GetRewChoiceItemsCount());
|
||||
for (uint32 i=0; i < pQuest->GetRewChoiceItemsCount(); ++i)
|
||||
{
|
||||
pItem = objmgr.GetItemPrototype(pQuest->RewChoiceItemId[i]);
|
||||
pItem = sObjectMgr.GetItemPrototype(pQuest->RewChoiceItemId[i]);
|
||||
|
||||
data << uint32(pQuest->RewChoiceItemId[i]);
|
||||
data << uint32(pQuest->RewChoiceItemCount[i]);
|
||||
@@ -761,7 +761,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID,
|
||||
data << uint32(pQuest->GetRewItemsCount());
|
||||
for (uint32 i = 0; i < pQuest->GetRewItemsCount(); ++i)
|
||||
{
|
||||
pItem = objmgr.GetItemPrototype(pQuest->RewItemId[i]);
|
||||
pItem = sObjectMgr.GetItemPrototype(pQuest->RewItemId[i]);
|
||||
data << uint32(pQuest->RewItemId[i]);
|
||||
data << uint32(pQuest->RewItemCount[i]);
|
||||
|
||||
@@ -809,7 +809,7 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const *pQuest, uint64 npcGUID,
|
||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
QuestLocale const *ql = objmgr.GetQuestLocale(pQuest->GetQuestId());
|
||||
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
|
||||
if (ql)
|
||||
{
|
||||
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
|
||||
@@ -857,7 +857,7 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const *pQuest, uint64 npcGUID,
|
||||
if (!pQuest->ReqItemId[i])
|
||||
continue;
|
||||
|
||||
pItem = objmgr.GetItemPrototype(pQuest->ReqItemId[i]);
|
||||
pItem = sObjectMgr.GetItemPrototype(pQuest->ReqItemId[i]);
|
||||
|
||||
data << uint32(pQuest->ReqItemId[i]);
|
||||
data << uint32(pQuest->ReqItemCount[i]);
|
||||
|
||||
@@ -152,7 +152,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa
|
||||
|
||||
SetPhaseMask(phaseMask,false);
|
||||
|
||||
GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(name_id);
|
||||
GameObjectInfo const* goinfo = sObjectMgr.GetGameObjectInfo(name_id);
|
||||
if (!goinfo)
|
||||
{
|
||||
sLog.outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f) ang: %f rotation0: %f rotation1: %f rotation2: %f rotation3: %f",guidlow, name_id, map->GetId(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3);
|
||||
@@ -317,9 +317,9 @@ void GameObject::Update(uint32 diff)
|
||||
return;
|
||||
}
|
||||
// respawn timer
|
||||
uint16 poolid = GetDBTableGUIDLow() ? poolhandler.IsPartOfAPool<GameObject>(GetDBTableGUIDLow()) : 0;
|
||||
uint16 poolid = GetDBTableGUIDLow() ? sPoolMgr.IsPartOfAPool<GameObject>(GetDBTableGUIDLow()) : 0;
|
||||
if (poolid)
|
||||
poolhandler.UpdatePool<GameObject>(poolid, GetDBTableGUIDLow());
|
||||
sPoolMgr.UpdatePool<GameObject>(poolid, GetDBTableGUIDLow());
|
||||
else
|
||||
GetMap()->Add(this);
|
||||
break;
|
||||
@@ -444,7 +444,7 @@ void GameObject::Update(uint32 diff)
|
||||
{
|
||||
if (m_groupLootTimer <= diff)
|
||||
{
|
||||
Group* group = objmgr.GetGroupByGUID(lootingGroupLowGUID);
|
||||
Group* group = sObjectMgr.GetGroupByGUID(lootingGroupLowGUID);
|
||||
if (group)
|
||||
group->EndRoll(&loot);
|
||||
m_groupLootTimer = 0;
|
||||
@@ -559,9 +559,9 @@ void GameObject::Delete()
|
||||
SetGoState(GO_STATE_READY);
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags);
|
||||
|
||||
uint16 poolid = GetDBTableGUIDLow() ? poolhandler.IsPartOfAPool<GameObject>(GetDBTableGUIDLow()) : 0;
|
||||
uint16 poolid = GetDBTableGUIDLow() ? sPoolMgr.IsPartOfAPool<GameObject>(GetDBTableGUIDLow()) : 0;
|
||||
if (poolid)
|
||||
poolhandler.UpdatePool<GameObject>(poolid, GetDBTableGUIDLow());
|
||||
sPoolMgr.UpdatePool<GameObject>(poolid, GetDBTableGUIDLow());
|
||||
else
|
||||
AddObjectToRemoveList();
|
||||
}
|
||||
@@ -583,7 +583,7 @@ void GameObject::SaveToDB()
|
||||
{
|
||||
// this should only be used when the gameobject has already been loaded
|
||||
// preferably after adding to map, because mapid may not be valid otherwise
|
||||
GameObjectData const *data = objmgr.GetGOData(m_DBTableGuid);
|
||||
GameObjectData const *data = sObjectMgr.GetGOData(m_DBTableGuid);
|
||||
if (!data)
|
||||
{
|
||||
sLog.outError("GameObject::SaveToDB failed, cannot get gameobject data!");
|
||||
@@ -603,7 +603,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
||||
if (!m_DBTableGuid)
|
||||
m_DBTableGuid = GetGUIDLow();
|
||||
// update in loaded data (changing data only in this place)
|
||||
GameObjectData& data = objmgr.NewGOData(m_DBTableGuid);
|
||||
GameObjectData& data = sObjectMgr.NewGOData(m_DBTableGuid);
|
||||
|
||||
// data->guid = guid don't must be update at save
|
||||
data.id = GetEntry();
|
||||
@@ -651,7 +651,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
||||
|
||||
bool GameObject::LoadFromDB(uint32 guid, Map *map)
|
||||
{
|
||||
GameObjectData const* data = objmgr.GetGOData(guid);
|
||||
GameObjectData const* data = sObjectMgr.GetGOData(guid);
|
||||
|
||||
if (!data)
|
||||
{
|
||||
@@ -677,7 +677,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
|
||||
uint32 artKit = data->artKit;
|
||||
|
||||
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, artKit))
|
||||
return false;
|
||||
@@ -695,13 +695,13 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
|
||||
else
|
||||
{
|
||||
m_respawnDelayTime = data->spawntimesecs;
|
||||
m_respawnTime = objmgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId());
|
||||
m_respawnTime = sObjectMgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId());
|
||||
|
||||
// ready to respawn
|
||||
if (m_respawnTime && m_respawnTime <= time(NULL))
|
||||
{
|
||||
m_respawnTime = 0;
|
||||
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -719,8 +719,8 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
|
||||
|
||||
void GameObject::DeleteFromDB()
|
||||
{
|
||||
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
objmgr.DeleteGOData(m_DBTableGuid);
|
||||
sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
sObjectMgr.DeleteGOData(m_DBTableGuid);
|
||||
WorldDatabase.PExecuteLog("DELETE FROM gameobject WHERE guid = '%u'", m_DBTableGuid);
|
||||
WorldDatabase.PExecuteLog("DELETE FROM game_event_gameobject WHERE guid = '%u'", m_DBTableGuid);
|
||||
}
|
||||
@@ -735,7 +735,7 @@ GameObject* GameObject::GetGameObject(WorldObject& object, uint64 guid)
|
||||
/*********************************************************/
|
||||
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)
|
||||
{
|
||||
if (itr->second == quest_id)
|
||||
@@ -746,7 +746,7 @@ bool GameObject::hasQuest(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)
|
||||
{
|
||||
if (itr->second == quest_id)
|
||||
@@ -781,7 +781,7 @@ Unit* GameObject::GetOwner() const
|
||||
void GameObject::SaveRespawnTime()
|
||||
{
|
||||
if (m_goData && m_goData->dbData && 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, bool inVisibleList) const
|
||||
@@ -841,13 +841,13 @@ void GameObject::Respawn()
|
||||
if (m_spawnedByDefault && m_respawnTime > 0)
|
||||
{
|
||||
m_respawnTime = time(NULL);
|
||||
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
}
|
||||
}
|
||||
|
||||
bool GameObject::ActivateToQuest(Player *pTarget) const
|
||||
{
|
||||
if (!objmgr.IsGameObjectForQuests(GetEntry()))
|
||||
if (!sObjectMgr.IsGameObjectForQuests(GetEntry()))
|
||||
return false;
|
||||
|
||||
switch (GetGoType())
|
||||
@@ -967,7 +967,7 @@ void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = f
|
||||
void GameObject::SetGoArtKit(uint8 kit)
|
||||
{
|
||||
SetByteValue(GAMEOBJECT_BYTES_1, 2, kit);
|
||||
GameObjectData *data = const_cast<GameObjectData*>(objmgr.GetGOData(m_DBTableGuid));
|
||||
GameObjectData *data = const_cast<GameObjectData*>(sObjectMgr.GetGOData(m_DBTableGuid));
|
||||
if (data)
|
||||
data->artKit = kit;
|
||||
}
|
||||
@@ -981,7 +981,7 @@ void GameObject::SetGoArtKit(uint8 artkit, GameObject *go, uint32 lowguid)
|
||||
data = go->GetGOData();
|
||||
}
|
||||
else if (lowguid)
|
||||
data = objmgr.GetGOData(lowguid);
|
||||
data = sObjectMgr.GetGOData(lowguid);
|
||||
|
||||
if (data)
|
||||
const_cast<GameObjectData*>(data)->artKit = artkit;
|
||||
@@ -1070,7 +1070,7 @@ void GameObject::Use(Unit* user)
|
||||
float y_i = GetPositionY() + relativeDistance * sin(orthogonalOrientation);
|
||||
|
||||
if (itr->second)
|
||||
if (Player* ChairUser = objmgr.GetPlayer(itr->second))
|
||||
if (Player* ChairUser = sObjectMgr.GetPlayer(itr->second))
|
||||
if (ChairUser->IsSitState() && ChairUser->getStandState() != UNIT_STAND_STATE_SIT && ChairUser->GetExactDist2d(x_i, y_i) < 0.1f)
|
||||
continue; // This seat is already occupied by ChairUser. NOTE: Not sure if the ChairUser->getStandState() != UNIT_STAND_STATE_SIT check is required.
|
||||
else
|
||||
@@ -1144,7 +1144,7 @@ void GameObject::Use(Unit* user)
|
||||
}
|
||||
|
||||
// possible quest objective for active quests
|
||||
if (info->goober.questId && objmgr.GetQuestTemplate(info->goober.questId))
|
||||
if (info->goober.questId && sObjectMgr.GetQuestTemplate(info->goober.questId))
|
||||
{
|
||||
//Quest require to be active for GO using
|
||||
if (player->GetQuestStatus(info->goober.questId) != QUEST_STATUS_INCOMPLETE)
|
||||
@@ -1216,9 +1216,9 @@ void GameObject::Use(Unit* user)
|
||||
uint32 zone, subzone;
|
||||
GetZoneAndAreaId(zone,subzone);
|
||||
|
||||
int32 zone_skill = objmgr.GetFishingBaseSkillLevel(subzone);
|
||||
int32 zone_skill = sObjectMgr.GetFishingBaseSkillLevel(subzone);
|
||||
if (!zone_skill)
|
||||
zone_skill = objmgr.GetFishingBaseSkillLevel(zone);
|
||||
zone_skill = sObjectMgr.GetFishingBaseSkillLevel(zone);
|
||||
|
||||
//provide error, no fishable zone or area should be 0
|
||||
if (!zone_skill)
|
||||
@@ -1653,7 +1653,7 @@ void GameObject::EventInform(uint32 eventId)
|
||||
const char* GameObject::GetNameForLocaleIdx(int32 loc_idx) const
|
||||
{
|
||||
if (loc_idx >= 0)
|
||||
if (GameObjectLocale const *cl = objmgr.GetGameObjectLocale(GetEntry()))
|
||||
if (GameObjectLocale const *cl = sObjectMgr.GetGameObjectLocale(GetEntry()))
|
||||
if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty())
|
||||
return cl->Name[loc_idx].c_str();
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ void Bag::RemoveFromWorld()
|
||||
|
||||
bool Bag::Create(uint32 guidlow, uint32 itemid, Player const* owner)
|
||||
{
|
||||
ItemPrototype const * itemProto = objmgr.GetItemPrototype(itemid);
|
||||
ItemPrototype const * itemProto = sObjectMgr.GetItemPrototype(itemid);
|
||||
|
||||
if (!itemProto || itemProto->ContainerSlots > MAX_BAG_SIZE)
|
||||
return false;
|
||||
|
||||
@@ -267,7 +267,7 @@ bool Item::Create(uint32 guidlow, uint32 itemid, Player const* owner)
|
||||
SetUInt64Value(ITEM_FIELD_OWNER, owner ? owner->GetGUID() : 0);
|
||||
SetUInt64Value(ITEM_FIELD_CONTAINED, owner ? owner->GetGUID() : 0);
|
||||
|
||||
ItemPrototype const *itemProto = objmgr.GetItemPrototype(itemid);
|
||||
ItemPrototype const *itemProto = sObjectMgr.GetItemPrototype(itemid);
|
||||
if (!itemProto)
|
||||
return false;
|
||||
|
||||
@@ -483,12 +483,12 @@ void Item::DeleteFromInventoryDB()
|
||||
|
||||
ItemPrototype const *Item::GetProto() const
|
||||
{
|
||||
return objmgr.GetItemPrototype(GetEntry());
|
||||
return sObjectMgr.GetItemPrototype(GetEntry());
|
||||
}
|
||||
|
||||
Player* Item::GetOwner()const
|
||||
{
|
||||
return objmgr.GetPlayer(GetOwnerGUID());
|
||||
return sObjectMgr.GetPlayer(GetOwnerGUID());
|
||||
}
|
||||
|
||||
uint32 Item::GetSkill()
|
||||
@@ -829,7 +829,7 @@ bool Item::IsFitToSpellRequirements(SpellEntry const* spellInfo) const
|
||||
// Special case - accept vellum for armor/weapon requirements
|
||||
if ((spellInfo->EquippedItemClass == ITEM_CLASS_ARMOR && proto->IsArmorVellum())
|
||||
||(spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON && proto->IsWeaponVellum()))
|
||||
if (spellmgr.IsSkillTypeSpell(spellInfo->Id, SKILL_ENCHANTING)) // only for enchanting spells
|
||||
if (sSpellMgr.IsSkillTypeSpell(spellInfo->Id, SKILL_ENCHANTING)) // only for enchanting spells
|
||||
return true;
|
||||
|
||||
if (spellInfo->EquippedItemClass != int32(proto->Class))
|
||||
@@ -1022,7 +1022,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player)
|
||||
if (count < 1)
|
||||
return NULL; //don't create item at zero count
|
||||
|
||||
ItemPrototype const *pProto = objmgr.GetItemPrototype(item);
|
||||
ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(item);
|
||||
if (pProto)
|
||||
{
|
||||
if (count > pProto->GetMaxStackSize())
|
||||
@@ -1031,7 +1031,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player)
|
||||
ASSERT(count !=0 && "pProto->Stackable == 0 but checked at loading already");
|
||||
|
||||
Item *pItem = NewItemOrBag(pProto);
|
||||
if (pItem->Create(objmgr.GenerateLowGuid(HIGHGUID_ITEM), item, player))
|
||||
if (pItem->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM), item, player))
|
||||
{
|
||||
pItem->SetCount(count);
|
||||
return pItem;
|
||||
|
||||
@@ -127,7 +127,7 @@ uint32 GetItemEnchantMod(int32 entry)
|
||||
|
||||
uint32 GenerateEnchSuffixFactor(uint32 item_id)
|
||||
{
|
||||
ItemPrototype const *itemProto = objmgr.GetItemPrototype(item_id);
|
||||
ItemPrototype const *itemProto = sObjectMgr.GetItemPrototype(item_id);
|
||||
|
||||
if (!itemProto)
|
||||
return 0;
|
||||
|
||||
@@ -1539,7 +1539,7 @@ void WorldObject::MonsterTextEmote(const char* text, uint64 TargetGuid, bool IsB
|
||||
|
||||
void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossWhisper)
|
||||
{
|
||||
Player *player = objmgr.GetPlayer(receiver);
|
||||
Player *player = sObjectMgr.GetPlayer(receiver);
|
||||
if (!player || !player->GetSession())
|
||||
return;
|
||||
|
||||
@@ -1581,7 +1581,7 @@ namespace Trinity
|
||||
: i_object(obj), i_msgtype(msgtype), i_textId(textId), i_language(language), i_targetGUID(targetGUID) {}
|
||||
void operator()(WorldPacket& data, int32 loc_idx)
|
||||
{
|
||||
char const* text = objmgr.GetTrinityString(i_textId,loc_idx);
|
||||
char const* text = sObjectMgr.GetTrinityString(i_textId,loc_idx);
|
||||
|
||||
// TODO: i_object.GetName() also must be localized?
|
||||
i_object.BuildMonsterChat(&data,i_msgtype,text,i_language,i_object.GetNameForLocaleIdx(loc_idx),i_targetGUID);
|
||||
@@ -1656,12 +1656,12 @@ void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossE
|
||||
|
||||
void WorldObject::MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper)
|
||||
{
|
||||
Player *player = objmgr.GetPlayer(receiver);
|
||||
Player *player = sObjectMgr.GetPlayer(receiver);
|
||||
if (!player || !player->GetSession())
|
||||
return;
|
||||
|
||||
uint32 loc_idx = player->GetSession()->GetSessionDbLocaleIndex();
|
||||
char const* text = objmgr.GetTrinityString(textId,loc_idx);
|
||||
char const* text = sObjectMgr.GetTrinityString(textId,loc_idx);
|
||||
|
||||
WorldPacket data(SMSG_MESSAGECHAT, 200);
|
||||
BuildMonsterChat(&data,IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER,text,LANG_UNIVERSAL,GetNameForLocaleIdx(loc_idx),receiver);
|
||||
@@ -1822,7 +1822,7 @@ TempSummon *Map::SummonCreature(uint32 entry, const Position &pos, SummonPropert
|
||||
default: return NULL;
|
||||
}
|
||||
|
||||
if (!summon->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), this, phase, entry, vehId, team, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation()))
|
||||
if (!summon->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), this, phase, entry, vehId, team, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation()))
|
||||
{
|
||||
delete summon;
|
||||
return NULL;
|
||||
@@ -1905,8 +1905,8 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
|
||||
}
|
||||
|
||||
Map *map = GetMap();
|
||||
uint32 pet_number = objmgr.GeneratePetNumber();
|
||||
if (!pet->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map, GetPhaseMask(), entry, pet_number))
|
||||
uint32 pet_number = sObjectMgr.GeneratePetNumber();
|
||||
if (!pet->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_PET), map, GetPhaseMask(), entry, pet_number))
|
||||
{
|
||||
sLog.outError("no such creature entry %u", entry);
|
||||
delete pet;
|
||||
@@ -1978,7 +1978,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
|
||||
if (!IsInWorld())
|
||||
return NULL;
|
||||
|
||||
GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(entry);
|
||||
GameObjectInfo const* goinfo = sObjectMgr.GetGameObjectInfo(entry);
|
||||
if (!goinfo)
|
||||
{
|
||||
sLog.outErrorDb("Gameobject template %u not found in database!", entry);
|
||||
@@ -1986,7 +1986,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
|
||||
}
|
||||
Map *map = GetMap();
|
||||
GameObject *go = new GameObject();
|
||||
if (!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, map, GetPhaseMask(), x,y,z,ang,rotation0,rotation1,rotation2,rotation3,100,GO_STATE_READY))
|
||||
if (!go->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, map, GetPhaseMask(), x,y,z,ang,rotation0,rotation1,rotation2,rotation3,100,GO_STATE_READY))
|
||||
{
|
||||
delete go;
|
||||
return NULL;
|
||||
|
||||
@@ -155,7 +155,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
|
||||
PetType pet_type = PetType(fields[18].GetUInt8());
|
||||
if (pet_type == HUNTER_PET)
|
||||
{
|
||||
CreatureInfo const* creatureInfo = objmgr.GetCreatureTemplate(petentry);
|
||||
CreatureInfo const* creatureInfo = sObjectMgr.GetCreatureTemplate(petentry);
|
||||
if (!creatureInfo || !creatureInfo->isTameable(owner->CanTameExoticPets()))
|
||||
return false;
|
||||
}
|
||||
@@ -169,7 +169,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
|
||||
}
|
||||
|
||||
Map *map = owner->GetMap();
|
||||
uint32 guid = objmgr.GenerateLowGuid(HIGHGUID_PET);
|
||||
uint32 guid = sObjectMgr.GenerateLowGuid(HIGHGUID_PET);
|
||||
if (!Create(guid, map, owner->GetPhaseMask(), petentry, pet_number))
|
||||
return false;
|
||||
|
||||
@@ -654,7 +654,7 @@ bool Pet::CanTakeMoreActiveSpells(uint32 spellid)
|
||||
if (IsPassiveSpell(spellid))
|
||||
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)
|
||||
{
|
||||
@@ -664,7 +664,7 @@ bool Pet::CanTakeMoreActiveSpells(uint32 spellid)
|
||||
if (IsPassiveSpell(itr->first))
|
||||
continue;
|
||||
|
||||
uint32 chainstart = spellmgr.GetFirstSpellInChain(itr->first);
|
||||
uint32 chainstart = sSpellMgr.GetFirstSpellInChain(itr->first);
|
||||
|
||||
uint8 x;
|
||||
|
||||
@@ -717,7 +717,7 @@ void Pet::GivePetXP(uint32 xp)
|
||||
// Subtract newXP from amount needed for nextlevel
|
||||
newXP -= nextLvlXP;
|
||||
GivePetLevel(level+1);
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(level+1)*PET_XP_FACTOR);
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(level+1)*PET_XP_FACTOR);
|
||||
|
||||
// Make sure we're working with the upgraded levels for the pet XP-levels
|
||||
level = getLevel();
|
||||
@@ -772,7 +772,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
|
||||
if (CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family))
|
||||
SetName(cFamily->Name[sWorld.GetDefaultDbcLocale()]);
|
||||
else
|
||||
SetName(creature->GetNameForLocaleIdx(objmgr.GetDBCLocaleIndex()));
|
||||
SetName(creature->GetNameForLocaleIdx(sObjectMgr.GetDBCLocaleIndex()));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -793,8 +793,8 @@ bool Pet::CreateBaseAtCreatureInfo(CreatureInfo const* cinfo, Unit * owner)
|
||||
bool Pet::CreateBaseAtTamed(CreatureInfo const * cinfo, Map * map, uint32 phaseMask)
|
||||
{
|
||||
sLog.outDebug("Pet::CreateBaseForTamed");
|
||||
uint32 guid=objmgr.GenerateLowGuid(HIGHGUID_PET);
|
||||
uint32 pet_number = objmgr.GeneratePetNumber();
|
||||
uint32 guid=sObjectMgr.GenerateLowGuid(HIGHGUID_PET);
|
||||
uint32 pet_number = sObjectMgr.GeneratePetNumber();
|
||||
if (!Create(guid, map, phaseMask, cinfo->Entry, pet_number))
|
||||
return false;
|
||||
|
||||
@@ -803,7 +803,7 @@ bool Pet::CreateBaseAtTamed(CreatureInfo const * cinfo, Map * map, uint32 phaseM
|
||||
setPowerType(POWER_FOCUS);
|
||||
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
|
||||
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(getLevel()+1)*PET_XP_FACTOR);
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(getLevel()+1)*PET_XP_FACTOR);
|
||||
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
|
||||
if (cinfo->type == CREATURE_TYPE_BEAST)
|
||||
@@ -883,7 +883,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
SetModifierValue(UnitMods(UNIT_MOD_RESISTANCE_START + i), BASE_VALUE, float(createResistance[i]));
|
||||
|
||||
//health, mana, armor and resistance
|
||||
PetLevelInfo const* pInfo = objmgr.GetPetLevelInfo(creature_ID, petlevel);
|
||||
PetLevelInfo const* pInfo = sObjectMgr.GetPetLevelInfo(creature_ID, petlevel);
|
||||
if (pInfo) // exist in DB
|
||||
{
|
||||
SetCreateHealth(pInfo->health);
|
||||
@@ -929,7 +929,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
}
|
||||
case HUNTER_PET:
|
||||
{
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(petlevel)*PET_XP_FACTOR);
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(petlevel)*PET_XP_FACTOR);
|
||||
//these formula may not be correct; however, it is designed to be close to what it should be
|
||||
//this makes dps 0.5 of pets level
|
||||
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)));
|
||||
@@ -1395,16 +1395,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)
|
||||
{
|
||||
if (itr2->second.state == PETSPELL_REMOVED) continue;
|
||||
|
||||
if (spellmgr.IsRankSpellDueToSpell(spellInfo,itr2->first))
|
||||
if (sSpellMgr.IsRankSpellDueToSpell(spellInfo,itr2->first))
|
||||
{
|
||||
// replace by new high rank
|
||||
if (spellmgr.IsHighRankOfSpell(spell_id,itr2->first))
|
||||
if (sSpellMgr.IsHighRankOfSpell(spell_id,itr2->first))
|
||||
{
|
||||
newspell.active = itr2->second.active;
|
||||
|
||||
@@ -1416,7 +1416,7 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel
|
||||
break;
|
||||
}
|
||||
// ignore new lesser rank
|
||||
else if (spellmgr.IsHighRankOfSpell(itr2->first,spell_id))
|
||||
else if (sSpellMgr.IsHighRankOfSpell(itr2->first,spell_id))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1464,7 +1464,7 @@ void Pet::InitLevelupSpellsForLevel()
|
||||
{
|
||||
uint8 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
|
||||
for (PetLevelupSpellSet::const_reverse_iterator itr = levelupSpells->rbegin(); itr != levelupSpells->rend(); ++itr)
|
||||
@@ -1481,7 +1481,7 @@ void Pet::InitLevelupSpellsForLevel()
|
||||
int32 petSpellsId = GetCreatureInfo()->PetSpellDataId ? -(int32)GetCreatureInfo()->PetSpellDataId : GetEntry();
|
||||
|
||||
// default spells (can be not learned if pet level (as owner level decrease result for example) less first possible in normal game)
|
||||
if (PetDefaultSpellsEntry const *defSpells = spellmgr.GetPetDefaultSpellsEntry(petSpellsId))
|
||||
if (PetDefaultSpellsEntry const *defSpells = sSpellMgr.GetPetDefaultSpellsEntry(petSpellsId))
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_CREATURE_SPELL_DATA_SLOT; ++i)
|
||||
{
|
||||
@@ -1544,7 +1544,7 @@ bool Pet::removeSpell(uint32 spell_id, bool learn_prev, bool clear_ab)
|
||||
|
||||
if (learn_prev)
|
||||
{
|
||||
if (uint32 prev_id = spellmgr.GetPrevSpellInChain (spell_id))
|
||||
if (uint32 prev_id = sSpellMgr.GetPrevSpellInChain (spell_id))
|
||||
learnSpell(prev_id);
|
||||
else
|
||||
learn_prev = false;
|
||||
@@ -1657,10 +1657,10 @@ bool Pet::resetTalents(bool no_cost)
|
||||
continue;
|
||||
}
|
||||
// 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
|
||||
if (itrFirstId == talentInfo->RankID[j] || spellmgr.IsSpellLearnToSpell(talentInfo->RankID[j],itrFirstId))
|
||||
if (itrFirstId == talentInfo->RankID[j] || sSpellMgr.IsSpellLearnToSpell(talentInfo->RankID[j],itrFirstId))
|
||||
{
|
||||
unlearnSpell(itr->first,false);
|
||||
itr = m_spells.begin();
|
||||
@@ -1979,7 +1979,7 @@ void Pet::learnSpellHighRank(uint32 spellid)
|
||||
{
|
||||
learnSpell(spellid);
|
||||
|
||||
if (uint32 next = spellmgr.GetNextSpellInChain(spellid))
|
||||
if (uint32 next = sSpellMgr.GetNextSpellInChain(spellid))
|
||||
learnSpellHighRank(next);
|
||||
}
|
||||
|
||||
@@ -2000,13 +2000,13 @@ void Pet::SynchronizeLevelWithOwner()
|
||||
if (getLevel() > owner->getLevel())
|
||||
{
|
||||
GivePetLevel(owner->getLevel());
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(owner->getLevel())/5);
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(owner->getLevel())/5);
|
||||
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
||||
}
|
||||
if (getLevel() < owner->getLevel()-5)
|
||||
{
|
||||
GivePetLevel(owner->getLevel()-5);
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(owner->getLevel()-5)/5);
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(owner->getLevel()-5)/5);
|
||||
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -117,7 +117,7 @@ void PlayerSocial::SetFriendNote(uint32 friend_guid, std::string note)
|
||||
|
||||
void PlayerSocial::SendSocialList()
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(GetPlayerGUID());
|
||||
Player *plr = sObjectMgr.GetPlayer(GetPlayerGUID());
|
||||
if (!plr)
|
||||
return;
|
||||
|
||||
|
||||
@@ -59,8 +59,8 @@ void Totem::InitStats(uint32 duration)
|
||||
CreatureInfo const *cinfo = GetCreatureInfo();
|
||||
if (m_owner->GetTypeId() == TYPEID_PLAYER && cinfo)
|
||||
{
|
||||
uint32 display_id = objmgr.ChooseDisplayId(m_owner->ToPlayer()->GetTeam(), cinfo);
|
||||
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
|
||||
uint32 display_id = sObjectMgr.ChooseDisplayId(m_owner->ToPlayer()->GetTeam(), cinfo);
|
||||
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
|
||||
if (minfo)
|
||||
display_id = minfo->modelid;
|
||||
switch (m_owner->ToPlayer()->GetTeam())
|
||||
|
||||
@@ -55,11 +55,11 @@ void MapManager::LoadTransports()
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
std::string name = fields[1].GetCppString();
|
||||
uint32 period = fields[2].GetUInt32();
|
||||
uint32 scriptId = objmgr.GetScriptId(fields[3].GetString());
|
||||
uint32 scriptId = sObjectMgr.GetScriptId(fields[3].GetString());
|
||||
|
||||
Transport *t = new Transport(period, scriptId);
|
||||
|
||||
const GameObjectInfo *goinfo = objmgr.GetGameObjectInfo(entry);
|
||||
const GameObjectInfo *goinfo = sObjectMgr.GetGameObjectInfo(entry);
|
||||
|
||||
if (!goinfo)
|
||||
{
|
||||
@@ -197,7 +197,7 @@ bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z,
|
||||
|
||||
Object::_Create(guidlow, 0, HIGHGUID_MO_TRANSPORT);
|
||||
|
||||
GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(guidlow);
|
||||
GameObjectInfo const* goinfo = sObjectMgr.GetGameObjectInfo(guidlow);
|
||||
|
||||
if (!goinfo)
|
||||
{
|
||||
@@ -642,7 +642,7 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y,
|
||||
Map* map = GetMap();
|
||||
Creature* pCreature = new Creature;
|
||||
|
||||
if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), GetMap(), this->GetPhaseMask(), entry, 0, (uint32)(this->GetGOInfo()->faction), 0, 0, 0, 0))
|
||||
if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), GetMap(), this->GetPhaseMask(), entry, 0, (uint32)(this->GetGOInfo()->faction), 0, 0, 0, 0))
|
||||
{
|
||||
delete pCreature;
|
||||
return 0;
|
||||
|
||||
@@ -655,7 +655,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||
|
||||
// some critters required for quests (need normal entry instead possible heroic in any cases)
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
if (CreatureInfo const* normalInfo = objmgr.GetCreatureTemplate(pVictim->GetEntry()))
|
||||
if (CreatureInfo const* normalInfo = sObjectMgr.GetCreatureTemplate(pVictim->GetEntry()))
|
||||
this->ToPlayer()->KilledMonster(normalInfo,pVictim->GetGUID());
|
||||
}
|
||||
else
|
||||
@@ -1948,8 +1948,8 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff
|
||||
int32 remainingHp = (int32)pVictim->GetHealth() - RemainingDamage;
|
||||
|
||||
// min pct of hp is stored in effect 0 of talent spell
|
||||
uint32 rank = spellmgr.GetSpellRank(spellProto->Id);
|
||||
SpellEntry const * talentProto = sSpellStore.LookupEntry(spellmgr.GetSpellWithRank(49189, rank));
|
||||
uint32 rank = sSpellMgr.GetSpellRank(spellProto->Id);
|
||||
SpellEntry const * talentProto = sSpellStore.LookupEntry(sSpellMgr.GetSpellWithRank(49189, rank));
|
||||
|
||||
int32 minHp = (float)pVictim->GetMaxHealth() * (float)SpellMgr::CalculateSpellEffectAmount(talentProto, 0, (*i)->GetCaster()) / 100.0f;
|
||||
// Damage that would take you below [effect0] health or taken while you are at [effect0]
|
||||
@@ -3918,7 +3918,7 @@ bool Unit::_IsNoStackAuraDueToAura(Aura * appliedAura, Aura * existingAura) cons
|
||||
return false;
|
||||
|
||||
// passive non-stackable spells not stackable only with another rank of same spell
|
||||
if (!spellmgr.IsRankSpellDueToSpell(spellProto, i_spellId))
|
||||
if (!sSpellMgr.IsRankSpellDueToSpell(spellProto, i_spellId))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3938,7 +3938,7 @@ bool Unit::_IsNoStackAuraDueToAura(Aura * appliedAura, Aura * existingAura) cons
|
||||
if (is_triggered_by_spell)
|
||||
return false;
|
||||
|
||||
if (spellmgr.CanAurasStack(spellProto, i_spellProto, sameCaster))
|
||||
if (sSpellMgr.CanAurasStack(spellProto, i_spellProto, sameCaster))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -4516,12 +4516,12 @@ AuraEffect * Unit::GetAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster)
|
||||
|
||||
AuraEffect * Unit::GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, uint64 caster) const
|
||||
{
|
||||
uint32 rankSpell = spellmgr.GetFirstSpellInChain(spellId);
|
||||
uint32 rankSpell = sSpellMgr.GetFirstSpellInChain(spellId);
|
||||
while (true)
|
||||
{
|
||||
if (AuraEffect * aurEff = GetAuraEffect(rankSpell, effIndex, caster))
|
||||
return aurEff;
|
||||
SpellChainNode const * chainNode = spellmgr.GetSpellChainNode(rankSpell);
|
||||
SpellChainNode const * chainNode = sSpellMgr.GetSpellChainNode(rankSpell);
|
||||
if (!chainNode)
|
||||
break;
|
||||
else
|
||||
@@ -4579,12 +4579,12 @@ Aura * Unit::GetAura(uint32 spellId, uint64 casterGUID, uint8 reqEffMask) const
|
||||
|
||||
AuraApplication * Unit::GetAuraApplicationOfRankedSpel(uint32 spellId, uint64 casterGUID, uint8 reqEffMask, AuraApplication * except) const
|
||||
{
|
||||
uint32 rankSpell = spellmgr.GetFirstSpellInChain(spellId);
|
||||
uint32 rankSpell = sSpellMgr.GetFirstSpellInChain(spellId);
|
||||
while (true)
|
||||
{
|
||||
if (AuraApplication * aurApp = GetAuraApplication(rankSpell, casterGUID, reqEffMask, except))
|
||||
return aurApp;
|
||||
SpellChainNode const * chainNode = spellmgr.GetSpellChainNode(rankSpell);
|
||||
SpellChainNode const * chainNode = sSpellMgr.GetSpellChainNode(rankSpell);
|
||||
if (!chainNode)
|
||||
break;
|
||||
else
|
||||
@@ -5321,7 +5321,7 @@ bool Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
||||
}
|
||||
|
||||
// default case
|
||||
if ((!target && !spellmgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive()))
|
||||
if ((!target && !sSpellMgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive()))
|
||||
return false;
|
||||
|
||||
if (cooldown && GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->HasSpellCooldown(triggered_spell_id))
|
||||
@@ -7463,7 +7463,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
||||
// Lightning Shield
|
||||
if (AuraEffect const * aurEff = GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0x400, 0, 0))
|
||||
{
|
||||
uint32 spell = spellmgr.GetSpellWithRank(26364, spellmgr.GetSpellRank(aurEff->GetId()));
|
||||
uint32 spell = sSpellMgr.GetSpellWithRank(26364, sSpellMgr.GetSpellRank(aurEff->GetId()));
|
||||
|
||||
// custom cooldown processing case
|
||||
if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->HasSpellCooldown(spell))
|
||||
@@ -7668,7 +7668,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
||||
if (spellProto->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT
|
||||
&& spellProto->SpellFamilyFlags[0] & 0x2000)
|
||||
{
|
||||
SpellChainNode const* newChain = spellmgr.GetSpellChainNode(itr->first);
|
||||
SpellChainNode const* newChain = sSpellMgr.GetSpellChainNode(itr->first);
|
||||
|
||||
// No chain entry or entry lower than found entry
|
||||
if (!chain || !newChain || (chain->rank < newChain->rank))
|
||||
@@ -7756,7 +7756,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
||||
}
|
||||
|
||||
// default case
|
||||
if ((!target && !spellmgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive()))
|
||||
if ((!target && !sSpellMgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive()))
|
||||
return false;
|
||||
|
||||
if (cooldown_spell_id == 0)
|
||||
@@ -7818,7 +7818,7 @@ bool Unit::HandleObsModEnergyAuraProc(Unit *pVictim, uint32 /*damage*/, AuraEffe
|
||||
}
|
||||
|
||||
// default case
|
||||
if ((!target && !spellmgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive()))
|
||||
if ((!target && !sSpellMgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive()))
|
||||
return false;
|
||||
|
||||
if (cooldown && GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->HasSpellCooldown(triggered_spell_id))
|
||||
@@ -7875,7 +7875,7 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 /*damage*/, Aur
|
||||
}
|
||||
|
||||
// default case
|
||||
if ((!target && !spellmgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive()))
|
||||
if ((!target && !sSpellMgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive()))
|
||||
return false;
|
||||
|
||||
if (cooldown && GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->HasSpellCooldown(triggered_spell_id))
|
||||
@@ -8403,7 +8403,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
|
||||
// Lightning Shield (overwrite non existing triggered spell call in spell.dbc
|
||||
if (auraSpellInfo->SpellFamilyFlags[0] & 0x400)
|
||||
{
|
||||
trigger_spell_id = spellmgr.GetSpellWithRank(26364, spellmgr.GetSpellRank(auraSpellInfo->Id));
|
||||
trigger_spell_id = sSpellMgr.GetSpellWithRank(26364, sSpellMgr.GetSpellRank(auraSpellInfo->Id));
|
||||
}
|
||||
// Nature's Guardian
|
||||
else if (auraSpellInfo->SpellIconID == 2013)
|
||||
@@ -8694,7 +8694,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
|
||||
{
|
||||
// have rank dependent proc chance, ignore too often cases
|
||||
// PPM = 2.5 * (rank of talent),
|
||||
uint32 rank = spellmgr.GetSpellRank(auraSpellInfo->Id);
|
||||
uint32 rank = sSpellMgr.GetSpellRank(auraSpellInfo->Id);
|
||||
// 5 rank -> 100% 4 rank -> 80% and etc from full rate
|
||||
if (!roll_chance_i(20*rank))
|
||||
return false;
|
||||
@@ -8770,7 +8770,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
|
||||
target = !(procFlags & (PROC_FLAG_SUCCESSFUL_POSITIVE_MAGIC_SPELL | PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL_HIT)) && IsPositiveSpell(trigger_spell_id) ? this : pVictim;
|
||||
|
||||
// default case
|
||||
if ((!target && !spellmgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive()))
|
||||
if ((!target && !sSpellMgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive()))
|
||||
return false;
|
||||
|
||||
if (basepoints0)
|
||||
@@ -10183,7 +10183,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
|
||||
{
|
||||
if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0,0x02000000,0))
|
||||
{
|
||||
if (SpellChainNode const *chain = spellmgr.GetSpellChainNode((*i)->GetId()))
|
||||
if (SpellChainNode const *chain = sSpellMgr.GetSpellChainNode((*i)->GetId()))
|
||||
DoneTotalMod *= (chain->rank * 2.0f + 100.0f)/100.0f;
|
||||
}
|
||||
break;
|
||||
@@ -10401,7 +10401,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
|
||||
|
||||
// Check for table values
|
||||
float coeff = 0;
|
||||
SpellBonusEntry const *bonus = spellmgr.GetSpellBonusData(spellProto->Id);
|
||||
SpellBonusEntry const *bonus = sSpellMgr.GetSpellBonusData(spellProto->Id);
|
||||
if (bonus)
|
||||
{
|
||||
if (damagetype == DOT)
|
||||
@@ -10909,7 +10909,7 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
|
||||
}
|
||||
|
||||
// Check for table values
|
||||
SpellBonusEntry const* bonus = !scripted ? spellmgr.GetSpellBonusData(spellProto->Id) : NULL;
|
||||
SpellBonusEntry const* bonus = !scripted ? sSpellMgr.GetSpellBonusData(spellProto->Id) : NULL;
|
||||
float coeff = 0;
|
||||
float factorMod = 1.0f;
|
||||
if (bonus)
|
||||
@@ -11405,7 +11405,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att
|
||||
case 7293:
|
||||
{
|
||||
if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0,0x02000000,0))
|
||||
if (SpellChainNode const *chain = spellmgr.GetSpellChainNode((*i)->GetId()))
|
||||
if (SpellChainNode const *chain = sSpellMgr.GetSpellChainNode((*i)->GetId()))
|
||||
DoneTotalMod *= (chain->rank * 2.0f + 100.0f)/100.0f;
|
||||
break;
|
||||
}
|
||||
@@ -13598,14 +13598,14 @@ void CharmInfo::InitCharmCreateSpells()
|
||||
|
||||
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
|
||||
for (uint8 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i)
|
||||
{
|
||||
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);
|
||||
return true;
|
||||
@@ -13627,13 +13627,13 @@ bool CharmInfo::AddSpellToActionBar(uint32 spell_id, ActiveStates newstate)
|
||||
|
||||
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)
|
||||
{
|
||||
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_PASSIVE);
|
||||
return true;
|
||||
@@ -14315,7 +14315,7 @@ void Unit::ClearComboPointHolders()
|
||||
{
|
||||
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
|
||||
plr->ClearComboPoints(); // remove also guid from m_ComboPointHolders;
|
||||
else
|
||||
@@ -14651,7 +14651,7 @@ Pet* Unit::CreateTamedPetFrom(uint32 creatureEntry, uint32 spell_id)
|
||||
if (GetTypeId() != TYPEID_PLAYER)
|
||||
return NULL;
|
||||
|
||||
CreatureInfo const* creatureInfo = objmgr.GetCreatureTemplate(creatureEntry);
|
||||
CreatureInfo const* creatureInfo = sObjectMgr.GetCreatureTemplate(creatureEntry);
|
||||
if (!creatureInfo)
|
||||
return NULL;
|
||||
|
||||
@@ -14681,7 +14681,7 @@ bool Unit::InitTamedPet(Pet * pet, uint8 level, uint32 spell_id)
|
||||
return false;
|
||||
}
|
||||
|
||||
pet->GetCharmInfo()->SetPetNumber(objmgr.GeneratePetNumber(), true);
|
||||
pet->GetCharmInfo()->SetPetNumber(sObjectMgr.GeneratePetNumber(), true);
|
||||
// this enables pet details window (Shift+P)
|
||||
pet->InitPetCreateSpells();
|
||||
//pet->InitLevelupSpellsForLevel();
|
||||
@@ -14694,7 +14694,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co
|
||||
SpellEntry const *spellProto = aura->GetSpellProto();
|
||||
|
||||
// Get proc Event Entry
|
||||
spellProcEvent = spellmgr.GetSpellProcEvent(spellProto->Id);
|
||||
spellProcEvent = sSpellMgr.GetSpellProcEvent(spellProto->Id);
|
||||
|
||||
// Get EventProcFlag
|
||||
uint32 EventProcFlag;
|
||||
@@ -14714,7 +14714,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co
|
||||
}
|
||||
|
||||
// Check spellProcEvent data requirements
|
||||
if (!spellmgr.IsSpellProcEventCanTriggeredBy(spellProcEvent, EventProcFlag, procSpell, procFlag, procExtra, active))
|
||||
if (!sSpellMgr.IsSpellProcEventCanTriggeredBy(spellProcEvent, EventProcFlag, procSpell, procFlag, procExtra, active))
|
||||
return false;
|
||||
// In most cases req get honor or XP from kill
|
||||
if (EventProcFlag & PROC_FLAG_KILL && GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -14949,7 +14949,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
|
||||
group->UpdateLooterGuid(creature, true);
|
||||
if (group->GetLooterGuid())
|
||||
{
|
||||
pLooter = objmgr.GetPlayer(group->GetLooterGuid());
|
||||
pLooter = sObjectMgr.GetPlayer(group->GetLooterGuid());
|
||||
if (pLooter)
|
||||
{
|
||||
creature->SetLootRecipient(pLooter); // update creature loot recipient to the allowed looter.
|
||||
@@ -15105,7 +15105,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
|
||||
// the reset time is set but not added to the scheduler
|
||||
// until the players leave the instance
|
||||
time_t resettime = creature->GetRespawnTimeEx() + 2 * HOUR;
|
||||
if (InstanceSave *save = sInstanceSaveManager.GetInstanceSave(creature->GetInstanceId()))
|
||||
if (InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(creature->GetInstanceId()))
|
||||
if (save->GetResetTime() < resettime) save->SetResetTime(resettime);
|
||||
}
|
||||
}
|
||||
@@ -15452,7 +15452,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type)
|
||||
|
||||
//just to enable stat window
|
||||
if (GetCharmInfo())
|
||||
GetCharmInfo()->SetPetNumber(objmgr.GeneratePetNumber(), true);
|
||||
GetCharmInfo()->SetPetNumber(sObjectMgr.GeneratePetNumber(), true);
|
||||
|
||||
//if charmed two demons the same session, the 2nd gets the 1st one's name
|
||||
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, time(NULL));
|
||||
|
||||
@@ -115,7 +115,7 @@ void Vehicle::Install()
|
||||
|
||||
void Vehicle::InstallAllAccessories()
|
||||
{
|
||||
VehicleAccessoryList const* mVehicleList = objmgr.GetVehicleAccessoryList(me->GetEntry());
|
||||
VehicleAccessoryList const* mVehicleList = sObjectMgr.GetVehicleAccessoryList(me->GetEntry());
|
||||
if (!mVehicleList)
|
||||
return;
|
||||
|
||||
|
||||
@@ -521,7 +521,7 @@ void GameEventMgr::LoadFromDB()
|
||||
|
||||
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);
|
||||
continue;
|
||||
@@ -870,11 +870,11 @@ void GameEventMgr::LoadFromDB()
|
||||
// get creature entry
|
||||
newEntry.entry = 0;
|
||||
|
||||
if (CreatureData const* data = objmgr.GetCreatureData(guid))
|
||||
if (CreatureData const* data = sObjectMgr.GetCreatureData(guid))
|
||||
newEntry.entry = data->id;
|
||||
|
||||
// check validity with event's npcflag
|
||||
if (!objmgr.IsVendorItemValid(newEntry.entry, newEntry.item, newEntry.maxcount, newEntry.incrtime, newEntry.ExtendedCost, NULL, NULL, event_npc_flag))
|
||||
if (!sObjectMgr.IsVendorItemValid(newEntry.entry, newEntry.item, newEntry.maxcount, newEntry.incrtime, newEntry.ExtendedCost, NULL, NULL, event_npc_flag))
|
||||
continue;
|
||||
++count;
|
||||
vendors.push_back(newEntry);
|
||||
@@ -1015,7 +1015,7 @@ void GameEventMgr::LoadFromDB()
|
||||
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);
|
||||
continue;
|
||||
@@ -1212,7 +1212,7 @@ void GameEventMgr::UpdateEventNPCFlags(uint16 event_id)
|
||||
for (NPCFlagList::iterator itr = mGameEventNPCFlags[event_id].begin(); itr != mGameEventNPCFlags[event_id].end(); ++itr)
|
||||
{
|
||||
// get the creature data from the low guid to get the entry, to be able to find out the whole guid
|
||||
if (CreatureData const* data = objmgr.GetCreatureData(itr->first))
|
||||
if (CreatureData const* data = sObjectMgr.GetCreatureData(itr->first))
|
||||
{
|
||||
Creature * cr = HashMapHolder<Creature>::Find(MAKE_NEW_GUID(itr->first,data->id,HIGHGUID_UNIT));
|
||||
// if we found the creature, modify its npcflag
|
||||
@@ -1243,9 +1243,9 @@ void GameEventMgr::UpdateEventNPCVendor(uint16 event_id, bool activate)
|
||||
for (NPCVendorList::iterator itr = mGameEventVendors[event_id].begin(); itr != mGameEventVendors[event_id].end(); ++itr)
|
||||
{
|
||||
if (activate)
|
||||
objmgr.AddVendorItem(itr->entry, itr->item, itr->maxcount, itr->incrtime, itr->ExtendedCost, false);
|
||||
sObjectMgr.AddVendorItem(itr->entry, itr->item, itr->maxcount, itr->incrtime, itr->ExtendedCost, false);
|
||||
else
|
||||
objmgr.RemoveVendorItem(itr->entry, itr->item, false);
|
||||
sObjectMgr.RemoveVendorItem(itr->entry, itr->item, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1262,9 +1262,9 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
|
||||
for (GuidList::iterator itr = mGameEventCreatureGuids[internal_event_id].begin(); itr != mGameEventCreatureGuids[internal_event_id].end(); ++itr)
|
||||
{
|
||||
// Add to correct cell
|
||||
if (CreatureData const* data = objmgr.GetCreatureData(*itr))
|
||||
if (CreatureData const* data = sObjectMgr.GetCreatureData(*itr))
|
||||
{
|
||||
objmgr.AddCreatureToGrid(*itr, data);
|
||||
sObjectMgr.AddCreatureToGrid(*itr, data);
|
||||
|
||||
// Spawn if necessary (loaded grids only)
|
||||
Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(data->mapid));
|
||||
@@ -1290,9 +1290,9 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
|
||||
for (GuidList::iterator itr = mGameEventGameobjectGuids[internal_event_id].begin(); itr != mGameEventGameobjectGuids[internal_event_id].end(); ++itr)
|
||||
{
|
||||
// Add to correct cell
|
||||
if (GameObjectData const* data = objmgr.GetGOData(*itr))
|
||||
if (GameObjectData const* data = sObjectMgr.GetGOData(*itr))
|
||||
{
|
||||
objmgr.AddGameobjectToGrid(*itr, data);
|
||||
sObjectMgr.AddGameobjectToGrid(*itr, data);
|
||||
// Spawn if necessary (loaded grids only)
|
||||
// this base map checked as non-instanced and then only existed
|
||||
Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(data->mapid));
|
||||
@@ -1319,7 +1319,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
|
||||
}
|
||||
|
||||
for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin(); itr != mGameEventPoolIds[internal_event_id].end(); ++itr)
|
||||
poolhandler.SpawnPool(*itr);
|
||||
sPoolMgr.SpawnPool(*itr);
|
||||
}
|
||||
|
||||
void GameEventMgr::GameEventUnspawn(int16 event_id)
|
||||
@@ -1338,9 +1338,9 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
|
||||
if (event_id > 0 && hasCreatureActiveEventExcept(*itr,event_id))
|
||||
continue;
|
||||
// Remove the creature from grid
|
||||
if (CreatureData const* data = objmgr.GetCreatureData(*itr))
|
||||
if (CreatureData const* data = sObjectMgr.GetCreatureData(*itr))
|
||||
{
|
||||
objmgr.RemoveCreatureFromGrid(*itr, data);
|
||||
sObjectMgr.RemoveCreatureFromGrid(*itr, data);
|
||||
|
||||
if (Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_UNIT), (Creature*)NULL))
|
||||
pCreature->AddObjectToRemoveList();
|
||||
@@ -1359,9 +1359,9 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
|
||||
if (event_id >0 && hasGameObjectActiveEventExcept(*itr,event_id))
|
||||
continue;
|
||||
// Remove the gameobject from grid
|
||||
if (GameObjectData const* data = objmgr.GetGOData(*itr))
|
||||
if (GameObjectData const* data = sObjectMgr.GetGOData(*itr))
|
||||
{
|
||||
objmgr.RemoveGameobjectFromGrid(*itr, data);
|
||||
sObjectMgr.RemoveGameobjectFromGrid(*itr, data);
|
||||
|
||||
if (GameObject* pGameobject = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL))
|
||||
pGameobject->AddObjectToRemoveList();
|
||||
@@ -1375,7 +1375,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
|
||||
|
||||
for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin(); itr != mGameEventPoolIds[internal_event_id].end(); ++itr)
|
||||
{
|
||||
poolhandler.DespawnPool(*itr);
|
||||
sPoolMgr.DespawnPool(*itr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1384,7 +1384,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
|
||||
for (ModelEquipList::iterator itr = mGameEventModelEquip[event_id].begin(); itr != mGameEventModelEquip[event_id].end(); ++itr)
|
||||
{
|
||||
// Remove the creature from grid
|
||||
CreatureData const* data = objmgr.GetCreatureData(itr->first);
|
||||
CreatureData const* data = sObjectMgr.GetCreatureData(itr->first);
|
||||
if (!data)
|
||||
continue;
|
||||
|
||||
@@ -1399,7 +1399,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
|
||||
pCreature->LoadEquipment(itr->second.equipment_id, true);
|
||||
if (itr->second.modelid >0 && itr->second.modelid_prev != itr->second.modelid)
|
||||
{
|
||||
CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(itr->second.modelid);
|
||||
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(itr->second.modelid);
|
||||
if (minfo)
|
||||
{
|
||||
pCreature->SetDisplayId(itr->second.modelid);
|
||||
@@ -1414,7 +1414,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
|
||||
pCreature->LoadEquipment(itr->second.equipement_id_prev, true);
|
||||
if (itr->second.modelid_prev >0 && itr->second.modelid_prev != itr->second.modelid)
|
||||
{
|
||||
CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(itr->second.modelid_prev);
|
||||
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(itr->second.modelid_prev);
|
||||
if (minfo)
|
||||
{
|
||||
pCreature->SetDisplayId(itr->second.modelid_prev);
|
||||
@@ -1427,12 +1427,12 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
|
||||
}
|
||||
else // If not spawned
|
||||
{
|
||||
CreatureData const* data2 = objmgr.GetCreatureData(itr->first);
|
||||
CreatureData const* data2 = sObjectMgr.GetCreatureData(itr->first);
|
||||
if (data2 && activate)
|
||||
{
|
||||
CreatureInfo const *cinfo = objmgr.GetCreatureTemplate(data2->id);
|
||||
uint32 display_id = objmgr.ChooseDisplayId(0,cinfo,data2);
|
||||
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
|
||||
CreatureInfo const *cinfo = sObjectMgr.GetCreatureTemplate(data2->id);
|
||||
uint32 display_id = sObjectMgr.ChooseDisplayId(0,cinfo,data2);
|
||||
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
|
||||
if (minfo)
|
||||
display_id = minfo->modelid;
|
||||
|
||||
@@ -1445,7 +1445,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
|
||||
}
|
||||
// now last step: put in data
|
||||
// just to have write access to it
|
||||
CreatureData& data2 = objmgr.NewOrExistCreatureData(itr->first);
|
||||
CreatureData& data2 = sObjectMgr.NewOrExistCreatureData(itr->first);
|
||||
if (activate)
|
||||
{
|
||||
data2.displayid = itr->second.modelid;
|
||||
@@ -1524,7 +1524,7 @@ void GameEventMgr::UpdateEventQuests(uint16 event_id, bool activate)
|
||||
QuestRelList::iterator itr;
|
||||
for (itr = mGameEventCreatureQuests[event_id].begin(); itr != mGameEventCreatureQuests[event_id].end(); ++itr)
|
||||
{
|
||||
QuestRelations &CreatureQuestMap = objmgr.mCreatureQuestRelations;
|
||||
QuestRelations &CreatureQuestMap = sObjectMgr.mCreatureQuestRelations;
|
||||
if (activate) // Add the pair(id,quest) to the multimap
|
||||
CreatureQuestMap.insert(QuestRelations::value_type(itr->first, itr->second));
|
||||
else
|
||||
@@ -1549,7 +1549,7 @@ void GameEventMgr::UpdateEventQuests(uint16 event_id, bool activate)
|
||||
}
|
||||
for (itr = mGameEventGameObjectQuests[event_id].begin(); itr != mGameEventGameObjectQuests[event_id].end(); ++itr)
|
||||
{
|
||||
QuestRelations &GameObjectQuestMap = objmgr.mGOQuestRelations;
|
||||
QuestRelations &GameObjectQuestMap = sObjectMgr.mGOQuestRelations;
|
||||
if (activate) // Add the pair(id,quest) to the multimap
|
||||
GameObjectQuestMap.insert(QuestRelations::value_type(itr->first, itr->second));
|
||||
else
|
||||
@@ -1701,8 +1701,8 @@ bool IsHolidayActive(HolidayIds id)
|
||||
if (id == HOLIDAY_NONE)
|
||||
return false;
|
||||
|
||||
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
GameEventMgr::ActiveEvents const& ae = gameeventmgr.GetActiveEventList();
|
||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
|
||||
GameEventMgr::ActiveEvents const& ae = sGameEventMgr.GetActiveEventList();
|
||||
|
||||
for (GameEventMgr::ActiveEvents::const_iterator itr = ae.begin(); itr != ae.end(); ++itr)
|
||||
if (events[*itr].holiday_id == uint32(id))
|
||||
@@ -1713,6 +1713,6 @@ bool IsHolidayActive(HolidayIds id)
|
||||
|
||||
bool IsEventActive(uint16 event_id)
|
||||
{
|
||||
GameEventMgr::ActiveEvents const& ae = gameeventmgr.GetActiveEventList();
|
||||
GameEventMgr::ActiveEvents const& ae = sGameEventMgr.GetActiveEventList();
|
||||
return ae.find(event_id) != ae.end();
|
||||
}
|
||||
|
||||
@@ -174,10 +174,10 @@ class GameEventMgr
|
||||
GameEventGuidMap mGameEventGameobjectGuids;
|
||||
};
|
||||
|
||||
#define gameeventmgr (*ACE_Singleton<GameEventMgr, ACE_Null_Mutex>::instance())
|
||||
#define sGameEventMgr (*ACE_Singleton<GameEventMgr, ACE_Null_Mutex>::instance())
|
||||
|
||||
bool IsHolidayActive(HolidayIds id);
|
||||
bool IsEventActive(uint16 event_id);
|
||||
bool IsHolidayActive(HolidayIds id);
|
||||
bool IsEventActive(uint16 event_id);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ void ObjectAccessor::RemoveCorpse(Corpse* corpse)
|
||||
CellPair cell_pair = Trinity::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY());
|
||||
uint32 cell_id = (cell_pair.y_coord * TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
|
||||
|
||||
objmgr.DeleteCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID());
|
||||
sObjectMgr.DeleteCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID());
|
||||
|
||||
i_player2corpse.erase(iter);
|
||||
}
|
||||
@@ -244,7 +244,7 @@ void ObjectAccessor::AddCorpse(Corpse* corpse)
|
||||
CellPair cell_pair = Trinity::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY());
|
||||
uint32 cell_id = (cell_pair.y_coord * TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
|
||||
|
||||
objmgr.AddCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID(), corpse->GetInstanceId());
|
||||
sObjectMgr.AddCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID(), corpse->GetInstanceId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -480,7 +480,7 @@ struct SQLCreatureLoader : public SQLStorageLoaderBase<SQLCreatureLoader>
|
||||
template<class D>
|
||||
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
|
||||
{
|
||||
dst = D(objmgr.GetScriptId(src));
|
||||
dst = D(sObjectMgr.GetScriptId(src));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1230,7 +1230,7 @@ void ObjectMgr::LoadCreatures()
|
||||
spawnMasks[i] |= (1 << k);
|
||||
|
||||
//TODO: remove this
|
||||
//gameeventmgr.mGameEventCreatureGuids.resize(52*2-1);
|
||||
//sGameEventMgr.mGameEventCreatureGuids.resize(52*2-1);
|
||||
|
||||
barGoLink bar(result->GetRowCount());
|
||||
|
||||
@@ -1353,14 +1353,14 @@ void ObjectMgr::LoadCreatures()
|
||||
/*if (entry == 30739 || entry == 30740)
|
||||
{
|
||||
gameEvent = 51;
|
||||
uint32 guid2 = objmgr.GenerateLowGuid(HIGHGUID_UNIT);
|
||||
uint32 guid2 = sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT);
|
||||
CreatureData& data2 = mCreatureDataMap[guid2];
|
||||
data2 = data;
|
||||
// data2.id = (entry == 32307 ? 32308 : 32307);
|
||||
data2.id = (entry == 30739 ? 30740 : 30739);
|
||||
data2.displayid = 0;
|
||||
gameeventmgr.mGameEventCreatureGuids[51+51].push_back(guid);
|
||||
gameeventmgr.mGameEventCreatureGuids[51+50].push_back(guid2);
|
||||
sGameEventMgr.mGameEventCreatureGuids[51+51].push_back(guid);
|
||||
sGameEventMgr.mGameEventCreatureGuids[51+50].push_back(guid2);
|
||||
}*/
|
||||
|
||||
if (gameEvent == 0 && PoolId == 0) // if not this is to be managed by GameEvent System or Pool system
|
||||
@@ -1498,7 +1498,7 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float
|
||||
return 0;
|
||||
|
||||
uint32 level = cInfo->minlevel == cInfo->maxlevel ? cInfo->minlevel : urand(cInfo->minlevel, cInfo->maxlevel); // Only used for extracting creature base stats
|
||||
CreatureBaseStats const* stats = objmgr.GetCreatureBaseStats(level, cInfo->unit_class);
|
||||
CreatureBaseStats const* stats = sObjectMgr.GetCreatureBaseStats(level, cInfo->unit_class);
|
||||
|
||||
uint32 guid = GenerateLowGuid(HIGHGUID_UNIT);
|
||||
CreatureData& data = NewOrExistCreatureData(guid);
|
||||
@@ -1941,7 +1941,7 @@ struct SQLItemLoader : public SQLStorageLoaderBase<SQLItemLoader>
|
||||
template<class D>
|
||||
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
|
||||
{
|
||||
dst = D(objmgr.GetScriptId(src));
|
||||
dst = D(sObjectMgr.GetScriptId(src));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3639,7 +3639,7 @@ void ObjectMgr::LoadGroups()
|
||||
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].GetBool(), true);
|
||||
InstanceSave *save = sInstanceSaveMgr.AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt64()), fields[6].GetBool(), true);
|
||||
group->BindToInstance(save, fields[3].GetBool(), true);
|
||||
++count;
|
||||
}while (result->NextRow());
|
||||
@@ -4949,7 +4949,7 @@ void ObjectMgr::LoadSpellScriptNames()
|
||||
|
||||
if (allRanks)
|
||||
{
|
||||
if (spellmgr.GetFirstSpellInChain(spellId) != spellId)
|
||||
if (sSpellMgr.GetFirstSpellInChain(spellId) != spellId)
|
||||
{
|
||||
sLog.outErrorDb("Scriptname:`%s` spell (spell_id:%d) is not first rank of spell.",scriptName,fields[0].GetInt32());
|
||||
continue;
|
||||
@@ -4957,7 +4957,7 @@ void ObjectMgr::LoadSpellScriptNames()
|
||||
while(spellId)
|
||||
{
|
||||
mSpellScripts.insert(SpellScriptsMap::value_type(spellId, GetScriptId(scriptName)));
|
||||
spellId = spellmgr.GetNextSpellInChain(spellId);
|
||||
spellId = sSpellMgr.GetNextSpellInChain(spellId);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -4994,7 +4994,7 @@ void ObjectMgr::ValidateSpellScripts()
|
||||
{
|
||||
bar.step();
|
||||
sitr->first->Register();
|
||||
if (!sitr->first->_Validate(spellEntry, objmgr.GetScriptName(sitr->second->second)))
|
||||
if (!sitr->first->_Validate(spellEntry, sObjectMgr.GetScriptName(sitr->second->second)))
|
||||
mSpellScripts.erase(sitr->second);
|
||||
delete sitr->first;
|
||||
}
|
||||
@@ -5102,7 +5102,7 @@ struct SQLInstanceLoader : public SQLStorageLoaderBase<SQLInstanceLoader>
|
||||
template<class D>
|
||||
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
|
||||
{
|
||||
dst = D(objmgr.GetScriptId(src));
|
||||
dst = D(sObjectMgr.GetScriptId(src));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5605,7 +5605,7 @@ uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt
|
||||
}
|
||||
}
|
||||
|
||||
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(mount_id);
|
||||
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(mount_id);
|
||||
if (minfo)
|
||||
mount_id = minfo->modelid;
|
||||
|
||||
@@ -6056,7 +6056,7 @@ AreaTrigger const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
|
||||
|
||||
if (mapEntry->IsDungeon())
|
||||
{
|
||||
const InstanceTemplate *iTemplate = objmgr.GetInstanceTemplate(Map);
|
||||
const InstanceTemplate *iTemplate = sObjectMgr.GetInstanceTemplate(Map);
|
||||
|
||||
if (!iTemplate)
|
||||
return NULL;
|
||||
@@ -6337,7 +6337,7 @@ struct SQLGameObjectLoader : public SQLStorageLoaderBase<SQLGameObjectLoader>
|
||||
template<class D>
|
||||
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
|
||||
{
|
||||
dst = D(objmgr.GetScriptId(src));
|
||||
dst = D(sObjectMgr.GetScriptId(src));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -8776,7 +8776,7 @@ void ObjectMgr::LoadDbScriptStrings()
|
||||
// Functions for scripting access
|
||||
uint32 GetAreaTriggerScriptId(uint32 trigger_id)
|
||||
{
|
||||
return objmgr.GetAreaTriggerScriptId(trigger_id);
|
||||
return sObjectMgr.GetAreaTriggerScriptId(trigger_id);
|
||||
}
|
||||
|
||||
bool LoadTrinityStrings(DatabaseType& db, char const* table,int32 start_value, int32 end_value)
|
||||
@@ -8789,27 +8789,27 @@ bool LoadTrinityStrings(DatabaseType& db, char const* table,int32 start_value, i
|
||||
return false;
|
||||
}
|
||||
|
||||
return objmgr.LoadTrinityStrings(db,table,start_value,end_value);
|
||||
return sObjectMgr.LoadTrinityStrings(db,table,start_value,end_value);
|
||||
}
|
||||
|
||||
uint32 GetScriptId(const char *name)
|
||||
{
|
||||
return objmgr.GetScriptId(name);
|
||||
return sObjectMgr.GetScriptId(name);
|
||||
}
|
||||
|
||||
ObjectMgr::ScriptNameMap & GetScriptNames()
|
||||
{
|
||||
return objmgr.GetScriptNames();
|
||||
return sObjectMgr.GetScriptNames();
|
||||
}
|
||||
|
||||
GameObjectInfo const *GetGameObjectInfo(uint32 id)
|
||||
{
|
||||
return objmgr.GetGameObjectInfo(id);
|
||||
return sObjectMgr.GetGameObjectInfo(id);
|
||||
}
|
||||
|
||||
CreatureInfo const *GetCreatureInfo(uint32 id)
|
||||
{
|
||||
return objmgr.GetCreatureTemplate(id);
|
||||
return sObjectMgr.GetCreatureTemplate(id);
|
||||
}
|
||||
|
||||
CreatureInfo const* GetCreatureTemplateStore(uint32 entry)
|
||||
@@ -8819,7 +8819,7 @@ CreatureInfo const* GetCreatureTemplateStore(uint32 entry)
|
||||
|
||||
Quest const* GetQuestTemplateStore(uint32 entry)
|
||||
{
|
||||
return objmgr.GetQuestTemplate(entry);
|
||||
return sObjectMgr.GetQuestTemplate(entry);
|
||||
}
|
||||
|
||||
uint64 ObjectMgr::GenerateGMTicketId()
|
||||
|
||||
@@ -1095,7 +1095,7 @@ class ObjectMgr
|
||||
|
||||
};
|
||||
|
||||
#define objmgr (*ACE_Singleton<ObjectMgr, ACE_Null_Mutex>::instance())
|
||||
#define sObjectMgr (*ACE_Singleton<ObjectMgr, ACE_Null_Mutex>::instance())
|
||||
|
||||
// scripting access functions
|
||||
bool LoadTrinityStrings(DatabaseType& db, char const* table,int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min());
|
||||
|
||||
@@ -173,7 +173,7 @@ ObjectGridLoader::Visit(GameObjectMapType &m)
|
||||
CellPair cell_pair(x,y);
|
||||
uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
|
||||
|
||||
CellObjectGuids const& cell_guids = 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);
|
||||
}
|
||||
@@ -186,7 +186,7 @@ ObjectGridLoader::Visit(CreatureMapType &m)
|
||||
CellPair cell_pair(x,y);
|
||||
uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
|
||||
|
||||
CellObjectGuids const& cell_guids = 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);
|
||||
}
|
||||
@@ -200,7 +200,7 @@ ObjectWorldLoader::Visit(CorpseMapType &m)
|
||||
uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
|
||||
|
||||
// corpses are always added to spawn mode 0 and they are spawned by their instance id
|
||||
CellObjectGuids const& cell_guids = 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ Group::~Group()
|
||||
|
||||
bool Group::Create(const uint64 &guid, const char * name)
|
||||
{
|
||||
uint32 lowguid = objmgr.GenerateLowGuid(HIGHGUID_GROUP);
|
||||
uint32 lowguid = sObjectMgr.GenerateLowGuid(HIGHGUID_GROUP);
|
||||
m_guid = MAKE_NEW_GUID(lowguid, 0, HIGHGUID_GROUP);
|
||||
m_leaderGuid = guid;
|
||||
m_leaderName = name;
|
||||
@@ -102,7 +102,7 @@ bool Group::Create(const uint64 &guid, const char * name)
|
||||
m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
|
||||
if (!isBGGroup())
|
||||
{
|
||||
Player *leader = objmgr.GetPlayer(guid);
|
||||
Player *leader = sObjectMgr.GetPlayer(guid);
|
||||
if (leader)
|
||||
{
|
||||
m_dungeonDifficulty = leader->GetDungeonDifficulty();
|
||||
@@ -142,7 +142,7 @@ bool Group::LoadGroupFromDB(const uint32 &groupGuid, QueryResult_AutoPtr result,
|
||||
m_leaderGuid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||
|
||||
// group leader not exist
|
||||
if (!objmgr.GetPlayerNameByGUID(fields[0].GetUInt32(), m_leaderName))
|
||||
if (!sObjectMgr.GetPlayerNameByGUID(fields[0].GetUInt32(), m_leaderName))
|
||||
return false;
|
||||
|
||||
m_lootMethod = LootMethod(fields[1].GetUInt8());
|
||||
@@ -191,7 +191,7 @@ bool Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup)
|
||||
member.guid = MAKE_NEW_GUID(guidLow, 0, HIGHGUID_PLAYER);
|
||||
|
||||
// skip non-existed member
|
||||
if (!objmgr.GetPlayerNameByGUID(member.guid, member.name))
|
||||
if (!sObjectMgr.GetPlayerNameByGUID(member.guid, member.name))
|
||||
{
|
||||
CharacterDatabase.PQuery("DELETE FROM group_member WHERE memberGuid=%u", guidLow);
|
||||
return false;
|
||||
@@ -219,7 +219,7 @@ void Group::ConvertToRaid()
|
||||
|
||||
// update quest related GO states (quest activity dependent from raid membership)
|
||||
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
if (Player* player = objmgr.GetPlayer(citr->guid))
|
||||
if (Player* player = sObjectMgr.GetPlayer(citr->guid))
|
||||
player->UpdateForQuestWorldObjects();
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ bool Group::AddMember(const uint64 &guid, const char* name)
|
||||
return false;
|
||||
SendUpdate();
|
||||
|
||||
Player *player = objmgr.GetPlayer(guid);
|
||||
Player *player = sObjectMgr.GetPlayer(guid);
|
||||
if (player)
|
||||
{
|
||||
if (!IsLeader(player->GetGUID()) && !isBGGroup())
|
||||
@@ -344,7 +344,7 @@ uint32 Group::RemoveMember(const uint64 &guid, const uint8 &method)
|
||||
{
|
||||
bool leaderChanged = _removeMember(guid);
|
||||
|
||||
if (Player *player = objmgr.GetPlayer(guid))
|
||||
if (Player *player = sObjectMgr.GetPlayer(guid))
|
||||
{
|
||||
// quest related GO state dependent from raid membership
|
||||
if (isRaidGroup())
|
||||
@@ -413,7 +413,7 @@ void Group::Disband(bool hideDestroy)
|
||||
|
||||
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
{
|
||||
player = objmgr.GetPlayer(citr->guid);
|
||||
player = sObjectMgr.GetPlayer(citr->guid);
|
||||
if (!player)
|
||||
continue;
|
||||
|
||||
@@ -502,7 +502,7 @@ void Group::SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll &r)
|
||||
|
||||
for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
|
||||
{
|
||||
Player *p = objmgr.GetPlayer(itr->first);
|
||||
Player *p = sObjectMgr.GetPlayer(itr->first);
|
||||
if (!p || !p->GetSession())
|
||||
continue;
|
||||
|
||||
@@ -526,7 +526,7 @@ void Group::SendLootRoll(const uint64& SourceGuid, const uint64& TargetGuid, uin
|
||||
|
||||
for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
|
||||
{
|
||||
Player *p = objmgr.GetPlayer(itr->first);
|
||||
Player *p = sObjectMgr.GetPlayer(itr->first);
|
||||
if (!p || !p->GetSession())
|
||||
continue;
|
||||
|
||||
@@ -549,7 +549,7 @@ void Group::SendLootRollWon(const uint64& SourceGuid, const uint64& TargetGuid,
|
||||
|
||||
for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
|
||||
{
|
||||
Player *p = objmgr.GetPlayer(itr->first);
|
||||
Player *p = sObjectMgr.GetPlayer(itr->first);
|
||||
if (!p || !p->GetSession())
|
||||
continue;
|
||||
|
||||
@@ -569,7 +569,7 @@ void Group::SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r)
|
||||
|
||||
for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
|
||||
{
|
||||
Player *p = objmgr.GetPlayer(itr->first);
|
||||
Player *p = sObjectMgr.GetPlayer(itr->first);
|
||||
if (!p || !p->GetSession())
|
||||
continue;
|
||||
|
||||
@@ -606,7 +606,7 @@ void Group::GroupLoot(Loot *loot, WorldObject* pLootedObject)
|
||||
if (i->freeforall)
|
||||
continue;
|
||||
|
||||
item = objmgr.GetItemPrototype(i->itemid);
|
||||
item = sObjectMgr.GetItemPrototype(i->itemid);
|
||||
if (!item)
|
||||
{
|
||||
//sLog.outDebug("Group::GroupLoot: missing item prototype for item with id: %d", i->itemid);
|
||||
@@ -616,7 +616,7 @@ void Group::GroupLoot(Loot *loot, WorldObject* pLootedObject)
|
||||
//roll for over-threshold item if it's one-player loot
|
||||
if (item->Quality >= uint32(m_lootThreshold))
|
||||
{
|
||||
uint64 newitemGUID = MAKE_NEW_GUID(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);
|
||||
|
||||
//a vector is filled with only near party members
|
||||
@@ -659,7 +659,7 @@ void Group::GroupLoot(Loot *loot, WorldObject* pLootedObject)
|
||||
{
|
||||
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())
|
||||
continue;
|
||||
|
||||
@@ -702,12 +702,12 @@ void Group::NeedBeforeGreed(Loot *loot, WorldObject* pLootedObject)
|
||||
if (i->freeforall)
|
||||
continue;
|
||||
|
||||
item = objmgr.GetItemPrototype(i->itemid);
|
||||
item = sObjectMgr.GetItemPrototype(i->itemid);
|
||||
|
||||
//roll for over-threshold item if it's one-player loot
|
||||
if (item->Quality >= uint32(m_lootThreshold))
|
||||
{
|
||||
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);
|
||||
|
||||
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
@@ -753,7 +753,7 @@ void Group::NeedBeforeGreed(Loot *loot, WorldObject* pLootedObject)
|
||||
{
|
||||
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())
|
||||
continue;
|
||||
|
||||
@@ -906,7 +906,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
|
||||
}
|
||||
}
|
||||
SendLootRollWon(0, maxguid, maxresul, ROLL_NEED, *roll);
|
||||
player = objmgr.GetPlayer(maxguid);
|
||||
player = sObjectMgr.GetPlayer(maxguid);
|
||||
|
||||
if (player && player->GetSession())
|
||||
{
|
||||
@@ -955,7 +955,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
|
||||
}
|
||||
}
|
||||
SendLootRollWon(0, maxguid, maxresul, rollvote, *roll);
|
||||
player = objmgr.GetPlayer(maxguid);
|
||||
player = sObjectMgr.GetPlayer(maxguid);
|
||||
|
||||
if (player && player->GetSession())
|
||||
{
|
||||
@@ -1073,7 +1073,7 @@ void Group::SendUpdate()
|
||||
Player *player;
|
||||
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)
|
||||
continue;
|
||||
|
||||
@@ -1094,7 +1094,7 @@ void Group::SendUpdate()
|
||||
{
|
||||
if (citr->guid == citr2->guid)
|
||||
continue;
|
||||
Player* member = objmgr.GetPlayer(citr2->guid);
|
||||
Player* member = sObjectMgr.GetPlayer(citr2->guid);
|
||||
|
||||
uint8 onlineState = (member) ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE;
|
||||
onlineState = onlineState | ((isBGGroup()) ? MEMBER_STATUS_PVP : 0);
|
||||
@@ -1165,7 +1165,7 @@ void Group::OfflineReadyCheck()
|
||||
{
|
||||
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())
|
||||
{
|
||||
WorldPacket data(MSG_RAID_READY_CHECK_CONFIRM, 9);
|
||||
@@ -1207,7 +1207,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, uint8 group)
|
||||
if (!guid)
|
||||
return false;
|
||||
|
||||
Player *player = objmgr.GetPlayer(guid);
|
||||
Player *player = sObjectMgr.GetPlayer(guid);
|
||||
|
||||
MemberSlot member;
|
||||
member.guid = guid;
|
||||
@@ -1253,7 +1253,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, uint8 group)
|
||||
|
||||
bool Group::_removeMember(const uint64 &guid)
|
||||
{
|
||||
Player *player = objmgr.GetPlayer(guid);
|
||||
Player *player = sObjectMgr.GetPlayer(guid);
|
||||
if (player)
|
||||
{
|
||||
//if we are removing player from battleground raid
|
||||
@@ -1315,7 +1315,7 @@ void Group::_setLeader(const uint64 &guid)
|
||||
")", GUID_LOPART(m_guid), GUID_LOPART(slot->guid)
|
||||
);
|
||||
|
||||
Player *player = objmgr.GetPlayer(slot->guid);
|
||||
Player *player = sObjectMgr.GetPlayer(slot->guid);
|
||||
if (player)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
|
||||
@@ -1437,7 +1437,7 @@ void Group::ChangeMembersGroup(const uint64 &guid, const uint8 &group)
|
||||
if (!isRaidGroup())
|
||||
return;
|
||||
|
||||
Player *player = objmgr.GetPlayer(guid);
|
||||
Player *player = sObjectMgr.GetPlayer(guid);
|
||||
|
||||
if (!player)
|
||||
{
|
||||
@@ -1835,7 +1835,7 @@ void Group::BroadcastGroupUpdate(void)
|
||||
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
{
|
||||
|
||||
Player *pp = objmgr.GetPlayer(citr->guid);
|
||||
Player *pp = sObjectMgr.GetPlayer(citr->guid);
|
||||
if (pp && pp->IsInWorld())
|
||||
{
|
||||
pp->ForceValuesUpdateAtIndex(UNIT_FIELD_BYTES_2);
|
||||
@@ -1851,7 +1851,7 @@ void Group::ResetMaxEnchantingLevel()
|
||||
Player *pMember = NULL;
|
||||
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
{
|
||||
if (pMember = objmgr.GetPlayer(citr->guid))
|
||||
if (pMember = sObjectMgr.GetPlayer(citr->guid))
|
||||
if (m_maxEnchantingLevel < pMember->GetSkillValue(SKILL_ENCHANTING))
|
||||
m_maxEnchantingLevel = pMember->GetSkillValue(SKILL_ENCHANTING);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ Guild::~Guild()
|
||||
|
||||
bool Guild::Create(Player* leader, std::string gname)
|
||||
{
|
||||
if (objmgr.GetGuildByName(gname))
|
||||
if (sObjectMgr.GetGuildByName(gname))
|
||||
return false;
|
||||
|
||||
WorldSession* lSession = leader->GetSession();
|
||||
@@ -77,7 +77,7 @@ bool Guild::Create(Player* leader, std::string gname)
|
||||
MOTD = "No message set.";
|
||||
m_GuildBankMoney = 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));
|
||||
|
||||
@@ -107,16 +107,16 @@ void Guild::CreateDefaultGuildRanks(int locale_idx)
|
||||
CharacterDatabase.PExecute("DELETE FROM guild_rank WHERE guildid='%u'", m_Id);
|
||||
CharacterDatabase.PExecute("DELETE FROM guild_bank_right WHERE guildid = '%u'", m_Id);
|
||||
|
||||
CreateRank(objmgr.GetTrinityString(LANG_GUILD_MASTER, locale_idx), GR_RIGHT_ALL);
|
||||
CreateRank(objmgr.GetTrinityString(LANG_GUILD_OFFICER, locale_idx), GR_RIGHT_ALL);
|
||||
CreateRank(objmgr.GetTrinityString(LANG_GUILD_VETERAN, locale_idx), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
|
||||
CreateRank(objmgr.GetTrinityString(LANG_GUILD_MEMBER, locale_idx), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
|
||||
CreateRank(objmgr.GetTrinityString(LANG_GUILD_INITIATE, locale_idx), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
|
||||
CreateRank(sObjectMgr.GetTrinityString(LANG_GUILD_MASTER, locale_idx), GR_RIGHT_ALL);
|
||||
CreateRank(sObjectMgr.GetTrinityString(LANG_GUILD_OFFICER, locale_idx), GR_RIGHT_ALL);
|
||||
CreateRank(sObjectMgr.GetTrinityString(LANG_GUILD_VETERAN, locale_idx), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
|
||||
CreateRank(sObjectMgr.GetTrinityString(LANG_GUILD_MEMBER, locale_idx), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
|
||||
CreateRank(sObjectMgr.GetTrinityString(LANG_GUILD_INITIATE, locale_idx), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
|
||||
}
|
||||
|
||||
bool Guild::AddMember(uint64 plGuid, uint32 plRank)
|
||||
{
|
||||
Player* pl = objmgr.GetPlayer(plGuid);
|
||||
Player* pl = sObjectMgr.GetPlayer(plGuid);
|
||||
if (pl)
|
||||
{
|
||||
if (pl->GetGuildId() != 0)
|
||||
@@ -478,7 +478,7 @@ void Guild::DelMember(uint64 guid, bool isDisbanding)
|
||||
SetLeader(newLeaderGUID);
|
||||
|
||||
// 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);
|
||||
|
||||
// when leader non-exist (at guild load with deleted leader only) not send broadcasts
|
||||
@@ -492,7 +492,7 @@ void Guild::DelMember(uint64 guid, bool isDisbanding)
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -512,7 +512,7 @@ void Guild::ChangeRank(uint64 guid, uint32 newRank)
|
||||
if (itr != members.end())
|
||||
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)
|
||||
player->SetRank(newRank);
|
||||
@@ -708,7 +708,7 @@ void Guild::Disband()
|
||||
CharacterDatabase.PExecute("DELETE FROM guild_bank_eventlog WHERE guildid = '%u'", m_Id);
|
||||
CharacterDatabase.PExecute("DELETE FROM guild_eventlog WHERE guildid = '%u'", m_Id);
|
||||
CharacterDatabase.CommitTransaction();
|
||||
objmgr.RemoveGuild(m_Id);
|
||||
sObjectMgr.RemoveGuild(m_Id);
|
||||
}
|
||||
|
||||
void Guild::Roster(WorldSession *session /*= NULL*/)
|
||||
@@ -1165,7 +1165,7 @@ void Guild::LoadGuildBankFromDB()
|
||||
continue;
|
||||
}
|
||||
|
||||
ItemPrototype const *proto = objmgr.GetItemPrototype(ItemEntry);
|
||||
ItemPrototype const *proto = sObjectMgr.GetItemPrototype(ItemEntry);
|
||||
|
||||
if (!proto)
|
||||
{
|
||||
|
||||
@@ -193,7 +193,7 @@ time_t InstanceSave::GetResetTimeForDB()
|
||||
// to cache or not to cache, that is the question
|
||||
InstanceTemplate const* InstanceSave::GetTemplate()
|
||||
{
|
||||
return objmgr.GetInstanceTemplate(m_mapid);
|
||||
return sObjectMgr.GetInstanceTemplate(m_mapid);
|
||||
}
|
||||
|
||||
MapEntry const* InstanceSave::GetMapEntry()
|
||||
@@ -211,8 +211,8 @@ bool InstanceSave::UnloadIfEmpty()
|
||||
{
|
||||
if (m_playerList.empty() && m_groupList.empty())
|
||||
{
|
||||
if (!sInstanceSaveManager.lock_instLists)
|
||||
sInstanceSaveManager.RemoveInstanceSave(GetInstanceId());
|
||||
if (!sInstanceSaveMgr.lock_instLists)
|
||||
sInstanceSaveMgr.RemoveInstanceSave(GetInstanceId());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -254,7 +254,7 @@ void InstanceSaveManager::CleanupInstances()
|
||||
bar.step();
|
||||
|
||||
// load reset times and clean expired instances
|
||||
sInstanceSaveManager.LoadResetTimes();
|
||||
sInstanceSaveMgr.LoadResetTimes();
|
||||
|
||||
// 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");
|
||||
@@ -617,7 +617,7 @@ void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId)
|
||||
|
||||
Map* iMap = ((MapInstanced*)map)->FindMap(instanceId);
|
||||
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, Difficulty difficulty, bool warn, uint32 timeLeft)
|
||||
|
||||
@@ -191,5 +191,5 @@ class InstanceSaveManager
|
||||
ResetTimeQueue m_resetTimeQueue;
|
||||
};
|
||||
|
||||
#define sInstanceSaveManager (*ACE_Singleton<InstanceSaveManager, ACE_Thread_Mutex>::instance())
|
||||
#define sInstanceSaveMgr (*ACE_Singleton<InstanceSaveManager, ACE_Thread_Mutex>::instance())
|
||||
#endif
|
||||
|
||||
@@ -255,7 +255,7 @@ bool LootStoreItem::Roll(bool rate) const
|
||||
if (mincountOrRef < 0) // reference case
|
||||
return roll_chance_f(chance* (rate ? sWorld.getRate(RATE_DROP_ITEM_REFERENCED) : 1.0f));
|
||||
|
||||
ItemPrototype const *pProto = objmgr.GetItemPrototype(itemid);
|
||||
ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(itemid);
|
||||
|
||||
float qualityModifier = pProto && rate ? sWorld.getRate(qualityToRate[pProto->Quality]) : 1.0f;
|
||||
|
||||
@@ -279,7 +279,7 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const
|
||||
|
||||
if (mincountOrRef > 0) // item (quest or non-quest) entry, maybe grouped
|
||||
{
|
||||
ItemPrototype const *proto = objmgr.GetItemPrototype(itemid);
|
||||
ItemPrototype const *proto = sObjectMgr.GetItemPrototype(itemid);
|
||||
if (!proto)
|
||||
{
|
||||
sLog.outErrorDb("Table '%s' entry %d item %d: item entry not listed in `item_template` - skipped", store.GetName(), entry, itemid);
|
||||
@@ -329,7 +329,7 @@ LootItem::LootItem(LootStoreItem const& li)
|
||||
itemid = li.itemid;
|
||||
conditions = li.conditions;
|
||||
|
||||
ItemPrototype const* proto = objmgr.GetItemPrototype(itemid);
|
||||
ItemPrototype const* proto = sObjectMgr.GetItemPrototype(itemid);
|
||||
freeforall = proto && (proto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT);
|
||||
|
||||
needs_quest = li.needs_quest;
|
||||
@@ -402,7 +402,7 @@ void Loot::AddItem(LootStoreItem const & item)
|
||||
// non-ffa conditionals are counted in FillNonQuestNonFFAConditionalLoot()
|
||||
if (item.conditions.empty())
|
||||
{
|
||||
ItemPrototype const* proto = objmgr.GetItemPrototype(item.itemid);
|
||||
ItemPrototype const* proto = sObjectMgr.GetItemPrototype(item.itemid);
|
||||
if (!proto || (proto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT) == 0)
|
||||
++unlootedCount;
|
||||
}
|
||||
@@ -766,7 +766,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootItem const& li)
|
||||
{
|
||||
b << uint32(li.itemid);
|
||||
b << uint32(li.count); // nr of items of this type
|
||||
b << uint32(objmgr.GetItemPrototype(li.itemid)->DisplayInfoID);
|
||||
b << uint32(sObjectMgr.GetItemPrototype(li.itemid)->DisplayInfoID);
|
||||
b << uint32(li.randomSuffix);
|
||||
b << uint32(li.randomPropertyId);
|
||||
//b << uint8(0); // slot type - will send after this function call
|
||||
@@ -1452,7 +1452,7 @@ void LoadLootTemplates_Gameobject()
|
||||
{
|
||||
if (uint32 lootid = gInfo->GetLootId())
|
||||
{
|
||||
if (objmgr.IsGoOfSpecificEntrySpawned(gInfo->id) && ids_set.find(lootid) == ids_set.end())
|
||||
if (sObjectMgr.IsGoOfSpecificEntrySpawned(gInfo->id) && ids_set.find(lootid) == ids_set.end())
|
||||
LootTemplates_Gameobject.ReportNotExistedId(lootid);
|
||||
else
|
||||
ids_setUsed.insert(lootid);
|
||||
|
||||
@@ -99,7 +99,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
|
||||
|
||||
uint64 rc = 0;
|
||||
if (normalizePlayerName(receiver))
|
||||
rc = objmgr.GetPlayerGUIDByName(receiver);
|
||||
rc = sObjectMgr.GetPlayerGUIDByName(receiver);
|
||||
|
||||
if (!rc)
|
||||
{
|
||||
@@ -127,7 +127,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
Player *receive = objmgr.GetPlayer(rc);
|
||||
Player *receive = sObjectMgr.GetPlayer(rc);
|
||||
|
||||
uint32 rc_team = 0;
|
||||
uint8 mails_count = 0; //do not allow to send to one player more than 100 mails
|
||||
@@ -141,7 +141,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
|
||||
}
|
||||
else
|
||||
{
|
||||
rc_team = objmgr.GetPlayerTeamByGUID(rc);
|
||||
rc_team = sObjectMgr.GetPlayerTeamByGUID(rc);
|
||||
if (QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT COUNT(*) FROM mail WHERE receiver = '%u'", GUID_LOPART(rc)))
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
@@ -188,7 +188,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
|
||||
|
||||
uint32 rc_account = receive
|
||||
? receive->GetSession()->GetAccountId()
|
||||
: objmgr.GetPlayerAccountIdByGUID(rc);
|
||||
: sObjectMgr.GetPlayerAccountIdByGUID(rc);
|
||||
|
||||
Item* items[MAX_MAIL_ITEMS];
|
||||
|
||||
@@ -442,7 +442,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data)
|
||||
if (m->COD > 0) //if there is COD, take COD money from player and send them to sender by mail
|
||||
{
|
||||
uint64 sender_guid = MAKE_NEW_GUID(m->sender, 0, HIGHGUID_PLAYER);
|
||||
Player *receive = objmgr.GetPlayer(sender_guid);
|
||||
Player *receive = sObjectMgr.GetPlayer(sender_guid);
|
||||
|
||||
uint32 sender_accId = 0;
|
||||
|
||||
@@ -457,16 +457,16 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data)
|
||||
else
|
||||
{
|
||||
// can be calculated early
|
||||
sender_accId = objmgr.GetPlayerAccountIdByGUID(sender_guid);
|
||||
sender_accId = sObjectMgr.GetPlayerAccountIdByGUID(sender_guid);
|
||||
|
||||
if (!objmgr.GetPlayerNameByGUID(sender_guid,sender_name))
|
||||
sender_name = objmgr.GetTrinityStringForDBCLocale(LANG_UNKNOWN);
|
||||
if (!sObjectMgr.GetPlayerNameByGUID(sender_guid,sender_name))
|
||||
sender_name = sObjectMgr.GetTrinityStringForDBCLocale(LANG_UNKNOWN);
|
||||
}
|
||||
sLog.outCommand(GetAccountId(),"GM %s (Account: %u) receive mail item: %s (Entry: %u Count: %u) and send COD money: %u to player: %s (Account: %u)",
|
||||
GetPlayerName(),GetAccountId(),it->GetProto()->Name1,it->GetEntry(),it->GetCount(),m->COD,sender_name.c_str(),sender_accId);
|
||||
}
|
||||
else if (!receive)
|
||||
sender_accId = objmgr.GetPlayerAccountIdByGUID(sender_guid);
|
||||
sender_accId = sObjectMgr.GetPlayerAccountIdByGUID(sender_guid);
|
||||
|
||||
// check player existence
|
||||
if (receive || sender_accId)
|
||||
@@ -674,7 +674,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
Item *bodyItem = new Item; // This is not bag and then can be used new Item.
|
||||
if (!bodyItem->Create(objmgr.GenerateLowGuid(HIGHGUID_ITEM), MAIL_BODY_ITEM_TEMPLATE, pl))
|
||||
if (!bodyItem->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM), MAIL_BODY_ITEM_TEMPLATE, pl))
|
||||
{
|
||||
delete bodyItem;
|
||||
return;
|
||||
@@ -869,11 +869,11 @@ void MailDraft::deleteIncludedItems(bool inDB /*= false*/)
|
||||
|
||||
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;
|
||||
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
|
||||
{
|
||||
@@ -915,7 +915,7 @@ void MailDraft::SendMailTo(MailReceiver const& receiver, MailSender const& sende
|
||||
if (pReceiver)
|
||||
prepareItems(pReceiver); // generate mail template items
|
||||
|
||||
uint32 mailId = objmgr.GenerateMailID();
|
||||
uint32 mailId = sObjectMgr.GenerateMailID();
|
||||
|
||||
time_t deliver_time = time(NULL) + deliver_delay;
|
||||
|
||||
|
||||
@@ -2320,11 +2320,11 @@ bool InstanceMap::Add(Player *player)
|
||||
if (IsDungeon())
|
||||
{
|
||||
// get or create an instance save for the map
|
||||
InstanceSave *mapSave = sInstanceSaveManager.GetInstanceSave(GetInstanceId());
|
||||
InstanceSave *mapSave = sInstanceSaveMgr.GetInstanceSave(GetInstanceId());
|
||||
if (!mapSave)
|
||||
{
|
||||
sLog.outDetail("InstanceMap::Add: creating instance save for map %d spawnmode %d with instance id %d", GetId(), GetSpawnMode(), GetInstanceId());
|
||||
mapSave = sInstanceSaveManager.AddInstanceSave(GetId(), GetInstanceId(), Difficulty(GetSpawnMode()), 0, true);
|
||||
mapSave = sInstanceSaveMgr.AddInstanceSave(GetId(), GetInstanceId(), Difficulty(GetSpawnMode()), 0, true);
|
||||
}
|
||||
|
||||
// check for existing instance binds
|
||||
@@ -2438,7 +2438,7 @@ void InstanceMap::CreateInstanceData(bool load)
|
||||
if (i_data != NULL)
|
||||
return;
|
||||
|
||||
InstanceTemplate const* mInstance = objmgr.GetInstanceTemplate(GetId());
|
||||
InstanceTemplate const* mInstance = sObjectMgr.GetInstanceTemplate(GetId());
|
||||
if (mInstance)
|
||||
{
|
||||
i_script_id = mInstance->script_id;
|
||||
@@ -2460,7 +2460,7 @@ void InstanceMap::CreateInstanceData(bool load)
|
||||
std::string data = fields[0].GetString();
|
||||
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.c_str());
|
||||
}
|
||||
}
|
||||
@@ -2511,7 +2511,7 @@ void InstanceMap::PermBindAllPlayers(Player *player)
|
||||
if (!IsDungeon())
|
||||
return;
|
||||
|
||||
InstanceSave *save = sInstanceSaveManager.GetInstanceSave(GetInstanceId());
|
||||
InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(GetInstanceId());
|
||||
if (!save)
|
||||
{
|
||||
sLog.outError("Cannot bind players, no instance save available for map!");
|
||||
@@ -2545,7 +2545,7 @@ void InstanceMap::UnloadAll()
|
||||
ASSERT(!HavePlayers());
|
||||
|
||||
if (m_resetAfterUnload == true)
|
||||
objmgr.DeleteRespawnTimeForInstance(GetInstanceId());
|
||||
sObjectMgr.DeleteRespawnTimeForInstance(GetInstanceId());
|
||||
|
||||
Map::UnloadAll();
|
||||
}
|
||||
@@ -2563,9 +2563,9 @@ void InstanceMap::SetResetSchedule(bool on)
|
||||
// it is assumed that the reset time will rarely (if ever) change while the reset is scheduled
|
||||
if (IsDungeon() && !HavePlayers() && !IsRaidOrHeroicDungeon())
|
||||
{
|
||||
InstanceSave *save = 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());
|
||||
else sInstanceSaveManager.ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), Difficulty(GetSpawnMode()), GetInstanceId()));
|
||||
else sInstanceSaveMgr.ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), Difficulty(GetSpawnMode()), GetInstanceId()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3429,7 +3429,7 @@ void Map::ScriptsProcess()
|
||||
}
|
||||
else //check hashmap holders
|
||||
{
|
||||
if (CreatureData const* data = objmgr.GetCreatureData(step.script->datalong))
|
||||
if (CreatureData const* data = sObjectMgr.GetCreatureData(step.script->datalong))
|
||||
cTarget = ObjectAccessor::GetObjectInWorld<Creature>(data->mapid, data->posX, data->posY, MAKE_NEW_GUID(step.script->datalong, data->id, HIGHGUID_UNIT), cTarget);
|
||||
}
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave *save,
|
||||
sLog.outError("CreateInstance: no entry for map %d", GetId());
|
||||
ASSERT(false);
|
||||
}
|
||||
const InstanceTemplate * iTemplate = objmgr.GetInstanceTemplate(GetId());
|
||||
const InstanceTemplate * iTemplate = sObjectMgr.GetInstanceTemplate(GetId());
|
||||
if (!iTemplate)
|
||||
{
|
||||
sLog.outError("CreateInstance: no instance template for map %d", GetId());
|
||||
|
||||
@@ -164,7 +164,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
|
||||
if (!entry->IsDungeon())
|
||||
return true;
|
||||
|
||||
InstanceTemplate const* instance = objmgr.GetInstanceTemplate(mapid);
|
||||
InstanceTemplate const* instance = sObjectMgr.GetInstanceTemplate(mapid);
|
||||
if (!instance)
|
||||
return false;
|
||||
|
||||
@@ -214,7 +214,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
|
||||
if (instance_map == mapid)
|
||||
break;
|
||||
|
||||
InstanceTemplate const* instance = objmgr.GetInstanceTemplate(instance_map);
|
||||
InstanceTemplate const* instance = sObjectMgr.GetInstanceTemplate(instance_map);
|
||||
instance_map = instance ? instance->parent : 0;
|
||||
}
|
||||
while (instance_map);
|
||||
@@ -253,7 +253,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
|
||||
}
|
||||
|
||||
//Other requirements
|
||||
return player->Satisfy(objmgr.GetAccessRequirement(mapid, targetDifficulty), mapid, true);
|
||||
return player->Satisfy(sObjectMgr.GetAccessRequirement(mapid, targetDifficulty), mapid, true);
|
||||
}
|
||||
|
||||
void MapManager::Update(uint32 diff)
|
||||
@@ -300,7 +300,7 @@ bool MapManager::ExistMapAndVMap(uint32 mapid, float x,float y)
|
||||
bool MapManager::IsValidMAP(uint32 mapid)
|
||||
{
|
||||
MapEntry const* mEntry = sMapStore.LookupEntry(mapid);
|
||||
return mEntry && (!mEntry->IsDungeon() || objmgr.GetInstanceTemplate(mapid));
|
||||
return mEntry && (!mEntry->IsDungeon() || sObjectMgr.GetInstanceTemplate(mapid));
|
||||
// TODO: add check for battleground template
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ void OPvPCapturePoint::AddGO(uint32 type, uint32 guid, uint32 entry)
|
||||
{
|
||||
if (!entry)
|
||||
{
|
||||
const GameObjectData *data = objmgr.GetGOData(guid);
|
||||
const GameObjectData *data = sObjectMgr.GetGOData(guid);
|
||||
if (!data)
|
||||
return;
|
||||
entry = data->id;
|
||||
@@ -85,7 +85,7 @@ void OPvPCapturePoint::AddCre(uint32 type, uint32 guid, uint32 entry)
|
||||
{
|
||||
if (!entry)
|
||||
{
|
||||
const CreatureData *data = objmgr.GetCreatureData(guid);
|
||||
const CreatureData *data = sObjectMgr.GetCreatureData(guid);
|
||||
if (!data)
|
||||
return;
|
||||
entry = data->id;
|
||||
@@ -96,7 +96,7 @@ void OPvPCapturePoint::AddCre(uint32 type, uint32 guid, uint32 entry)
|
||||
|
||||
bool OPvPCapturePoint::AddObject(uint32 type, uint32 entry, uint32 map, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3)
|
||||
{
|
||||
if (uint32 guid = objmgr.AddGOData(entry, map, x, y, z, o, 0, rotation0, rotation1, rotation2, rotation3))
|
||||
if (uint32 guid = sObjectMgr.AddGOData(entry, map, x, y, z, o, 0, rotation0, rotation1, rotation2, rotation3))
|
||||
{
|
||||
AddGO(type, guid, entry);
|
||||
return true;
|
||||
@@ -107,7 +107,7 @@ bool OPvPCapturePoint::AddObject(uint32 type, uint32 entry, uint32 map, float x,
|
||||
|
||||
bool OPvPCapturePoint::AddCreature(uint32 type, uint32 entry, uint32 team, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay)
|
||||
{
|
||||
if (uint32 guid = objmgr.AddCreData(entry, team, map, x, y, z, o, spawntimedelay))
|
||||
if (uint32 guid = sObjectMgr.AddCreData(entry, team, map, x, y, z, o, spawntimedelay))
|
||||
{
|
||||
AddCre(type, guid, entry);
|
||||
return true;
|
||||
@@ -121,14 +121,14 @@ bool OPvPCapturePoint::SetCapturePointData(uint32 entry, uint32 map, float x, fl
|
||||
sLog.outDebug("Creating capture point %u", entry);
|
||||
|
||||
// check info existence
|
||||
GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(entry);
|
||||
GameObjectInfo const* goinfo = sObjectMgr.GetGameObjectInfo(entry);
|
||||
if (!goinfo || goinfo->type != GAMEOBJECT_TYPE_CAPTURE_POINT)
|
||||
{
|
||||
sLog.outError("OutdoorPvP: GO %u is not capture point!", entry);
|
||||
return false;
|
||||
}
|
||||
|
||||
m_capturePointGUID = objmgr.AddGOData(entry, map, x, y, z, o, 0, rotation0, rotation1, rotation2, rotation3);
|
||||
m_capturePointGUID = sObjectMgr.AddGOData(entry, map, x, y, z, o, 0, rotation0, rotation1, rotation2, rotation3);
|
||||
if (!m_capturePointGUID)
|
||||
return false;
|
||||
|
||||
@@ -169,7 +169,7 @@ bool OPvPCapturePoint::DelCreature(uint32 type)
|
||||
// delete respawn time for this creature
|
||||
WorldDatabase.PExecute("DELETE FROM creature_respawn WHERE guid = '%u'", guid);
|
||||
cr->AddObjectToRemoveList();
|
||||
objmgr.DeleteCreatureData(guid);
|
||||
sObjectMgr.DeleteCreatureData(guid);
|
||||
m_CreatureTypes[m_Creatures[type]] = 0;
|
||||
m_Creatures[type] = 0;
|
||||
return true;
|
||||
@@ -189,7 +189,7 @@ bool OPvPCapturePoint::DelObject(uint32 type)
|
||||
uint32 guid = obj->GetDBTableGUIDLow();
|
||||
obj->SetRespawnTime(0); // not save respawn time
|
||||
obj->Delete();
|
||||
objmgr.DeleteGOData(guid);
|
||||
sObjectMgr.DeleteGOData(guid);
|
||||
m_ObjectTypes[m_Objects[type]] = 0;
|
||||
m_Objects[type] = 0;
|
||||
return true;
|
||||
@@ -197,7 +197,7 @@ bool OPvPCapturePoint::DelObject(uint32 type)
|
||||
|
||||
bool OPvPCapturePoint::DelCapturePoint()
|
||||
{
|
||||
objmgr.DeleteGOData(m_capturePointGUID);
|
||||
sObjectMgr.DeleteGOData(m_capturePointGUID);
|
||||
m_capturePointGUID = 0;
|
||||
|
||||
if (m_capturePoint)
|
||||
|
||||
@@ -111,7 +111,7 @@ void OutdoorPvPMgr::LoadTemplates()
|
||||
OutdoorPvPData data;
|
||||
OutdoorPvPTypes realTypeId = OutdoorPvPTypes(typeId);
|
||||
data.TypeId = realTypeId;
|
||||
data.ScriptId = objmgr.GetScriptId(fields[1].GetString());
|
||||
data.ScriptId = sObjectMgr.GetScriptId(fields[1].GetString());
|
||||
m_OutdoorPvPDatas[realTypeId] = &data;
|
||||
|
||||
++count;
|
||||
|
||||
@@ -194,9 +194,9 @@ void PoolGroup<T>::DespawnObject(SpawnedPoolData& spawns, uint32 guid)
|
||||
template<>
|
||||
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 = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
|
||||
pCreature->AddObjectToRemoveList();
|
||||
@@ -207,9 +207,9 @@ void PoolGroup<Creature>::Despawn1Object(uint32 guid)
|
||||
template<>
|
||||
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 = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL))
|
||||
pGameobject->AddObjectToRemoveList();
|
||||
@@ -220,7 +220,7 @@ void PoolGroup<GameObject>::Despawn1Object(uint32 guid)
|
||||
template<>
|
||||
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
|
||||
@@ -289,9 +289,9 @@ void PoolGroup<T>::SpawnObject(SpawnedPoolData& spawns, uint32 limit, uint32 tri
|
||||
template <>
|
||||
void PoolGroup<Creature>::Spawn1Object(PoolObject* obj)
|
||||
{
|
||||
if (CreatureData const* data = objmgr.GetCreatureData(obj->guid))
|
||||
if (CreatureData const* data = sObjectMgr.GetCreatureData(obj->guid))
|
||||
{
|
||||
objmgr.AddCreatureToGrid(obj->guid, data);
|
||||
sObjectMgr.AddCreatureToGrid(obj->guid, data);
|
||||
|
||||
// Spawn if necessary (loaded grids only)
|
||||
Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(data->mapid));
|
||||
@@ -315,9 +315,9 @@ void PoolGroup<Creature>::Spawn1Object(PoolObject* obj)
|
||||
template <>
|
||||
void PoolGroup<GameObject>::Spawn1Object(PoolObject* obj)
|
||||
{
|
||||
if (GameObjectData const* data = objmgr.GetGOData(obj->guid))
|
||||
if (GameObjectData const* data = sObjectMgr.GetGOData(obj->guid))
|
||||
{
|
||||
objmgr.AddGameobjectToGrid(obj->guid, data);
|
||||
sObjectMgr.AddGameobjectToGrid(obj->guid, data);
|
||||
// Spawn if necessary (loaded grids only)
|
||||
// this base map checked as non-instanced and then only existed
|
||||
Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(data->mapid));
|
||||
@@ -344,14 +344,14 @@ void PoolGroup<GameObject>::Spawn1Object(PoolObject* obj)
|
||||
template <>
|
||||
void PoolGroup<Pool>::Spawn1Object(PoolObject* obj)
|
||||
{
|
||||
poolhandler.SpawnPool(obj->guid);
|
||||
sPoolMgr.SpawnPool(obj->guid);
|
||||
}
|
||||
|
||||
// Method that does the respawn job on the specified creature
|
||||
template <>
|
||||
void PoolGroup<Creature>::ReSpawn1Object(PoolObject* obj)
|
||||
{
|
||||
if (CreatureData const* data = objmgr.GetCreatureData(obj->guid))
|
||||
if (CreatureData const* data = sObjectMgr.GetCreatureData(obj->guid))
|
||||
if (Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
|
||||
pCreature->GetMap()->Add(pCreature);
|
||||
}
|
||||
@@ -360,7 +360,7 @@ void PoolGroup<Creature>::ReSpawn1Object(PoolObject* obj)
|
||||
template <>
|
||||
void PoolGroup<GameObject>::ReSpawn1Object(PoolObject* obj)
|
||||
{
|
||||
if (GameObjectData const* data = objmgr.GetGOData(obj->guid))
|
||||
if (GameObjectData const* data = sObjectMgr.GetGOData(obj->guid))
|
||||
if (GameObject* pGameobject = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL))
|
||||
pGameobject->GetMap()->Add(pGameobject);
|
||||
}
|
||||
@@ -457,7 +457,7 @@ void PoolMgr::LoadFromDB()
|
||||
uint16 pool_id = fields[1].GetUInt16();
|
||||
float chance = fields[2].GetFloat();
|
||||
|
||||
CreatureData const* data = objmgr.GetCreatureData(guid);
|
||||
CreatureData const* data = sObjectMgr.GetCreatureData(guid);
|
||||
if (!data)
|
||||
{
|
||||
sLog.outErrorDb("`pool_creature` has a non existing creature spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id);
|
||||
@@ -520,13 +520,13 @@ void PoolMgr::LoadFromDB()
|
||||
uint16 pool_id = fields[1].GetUInt16();
|
||||
float chance = fields[2].GetFloat();
|
||||
|
||||
GameObjectData const* data = objmgr.GetGOData(guid);
|
||||
GameObjectData const* data = sObjectMgr.GetGOData(guid);
|
||||
if (!data)
|
||||
{
|
||||
sLog.outErrorDb("`pool_gameobject` has a non existing gameobject spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id);
|
||||
continue;
|
||||
}
|
||||
GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(data->id);
|
||||
GameObjectInfo const* goinfo = sObjectMgr.GetGameObjectInfo(data->id);
|
||||
if (goinfo->type != GAMEOBJECT_TYPE_CHEST &&
|
||||
goinfo->type != GAMEOBJECT_TYPE_GOOBER &&
|
||||
goinfo->type != GAMEOBJECT_TYPE_FISHINGHOLE)
|
||||
|
||||
@@ -135,7 +135,7 @@ class PoolMgr
|
||||
SpawnedPoolData mSpawnedData;
|
||||
};
|
||||
|
||||
#define poolhandler (*ACE_Singleton<PoolMgr, ACE_Null_Mutex>::instance())
|
||||
#define sPoolMgr (*ACE_Singleton<PoolMgr, ACE_Null_Mutex>::instance())
|
||||
|
||||
// Method that tell if the creature is part of a pool and return the pool id if yes
|
||||
template<>
|
||||
|
||||
@@ -278,7 +278,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
|
||||
if (res)
|
||||
{
|
||||
// then some spillover calculation here if it exist
|
||||
if (RepSpilloverTemplate const * repTemplate = objmgr.GetRepSpilloverTemplate(factionEntry->ID))
|
||||
if (RepSpilloverTemplate const * repTemplate = sObjectMgr.GetRepSpilloverTemplate(factionEntry->ID))
|
||||
{
|
||||
for (uint32 i = 0; i < MAX_SPILLOVER_FACTIONS; ++i)
|
||||
{
|
||||
|
||||
@@ -289,7 +289,7 @@ void ScriptMgr::FillSpellSummary()
|
||||
|
||||
void ScriptMgr::CreateSpellScripts(uint32 spell_id, std::list<SpellScript *> & script_vector)
|
||||
{
|
||||
SpellScriptsBounds bounds = objmgr.GetSpellScriptsBounds(spell_id);
|
||||
SpellScriptsBounds bounds = sObjectMgr.GetSpellScriptsBounds(spell_id);
|
||||
|
||||
for (SpellScriptsMap::iterator itr = bounds.first; itr != bounds.second; ++itr)
|
||||
{
|
||||
@@ -311,7 +311,7 @@ void ScriptMgr::CreateSpellScripts(uint32 spell_id, std::list<SpellScript *> & s
|
||||
|
||||
void ScriptMgr::CreateSpellScripts(uint32 spell_id, std::vector<std::pair<SpellScript *, SpellScriptsMap::iterator> > & script_vector)
|
||||
{
|
||||
SpellScriptsBounds bounds = objmgr.GetSpellScriptsBounds(spell_id);
|
||||
SpellScriptsBounds bounds = sObjectMgr.GetSpellScriptsBounds(spell_id);
|
||||
script_vector.reserve(std::distance(bounds.first, bounds.second));
|
||||
|
||||
for (SpellScriptsMap::iterator itr = bounds.first; itr != bounds.second; ++itr)
|
||||
|
||||
@@ -37,13 +37,13 @@ void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket & recv_data)
|
||||
recv_data >> guid;
|
||||
sLog.outDebug("Inspect Arena stats (GUID: %u TypeId: %u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid)));
|
||||
|
||||
if (Player *plr = objmgr.GetPlayer(guid))
|
||||
if (Player *plr = sObjectMgr.GetPlayer(guid))
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ARENA_SLOT; ++i)
|
||||
{
|
||||
if (uint32 a_id = plr->GetArenaTeamId(i))
|
||||
{
|
||||
if (ArenaTeam *at = objmgr.GetArenaTeamById(a_id))
|
||||
if (ArenaTeam *at = sObjectMgr.GetArenaTeamById(a_id))
|
||||
at->InspectStats(this, plr->GetGUID());
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ void WorldSession::HandleArenaTeamQueryOpcode(WorldPacket & recv_data)
|
||||
uint32 ArenaTeamId;
|
||||
recv_data >> ArenaTeamId;
|
||||
|
||||
if (ArenaTeam *arenateam = objmgr.GetArenaTeamById(ArenaTeamId))
|
||||
if (ArenaTeam *arenateam = sObjectMgr.GetArenaTeamById(ArenaTeamId))
|
||||
{
|
||||
arenateam->Query(this);
|
||||
arenateam->Stats(this);
|
||||
@@ -71,7 +71,7 @@ void WorldSession::HandleArenaTeamRosterOpcode(WorldPacket & recv_data)
|
||||
uint32 ArenaTeamId; // arena team id
|
||||
recv_data >> ArenaTeamId;
|
||||
|
||||
if (ArenaTeam *arenateam = objmgr.GetArenaTeamById(ArenaTeamId))
|
||||
if (ArenaTeam *arenateam = sObjectMgr.GetArenaTeamById(ArenaTeamId))
|
||||
arenateam->Roster(this);
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
ArenaTeam *arenateam = objmgr.GetArenaTeamById(ArenaTeamId);
|
||||
ArenaTeam *arenateam = sObjectMgr.GetArenaTeamById(ArenaTeamId);
|
||||
if (!arenateam)
|
||||
{
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", "", ERR_ARENA_TEAM_PLAYER_NOT_IN_TEAM);
|
||||
@@ -157,7 +157,7 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/)
|
||||
{
|
||||
sLog.outDebug("CMSG_ARENA_TEAM_ACCEPT"); // empty opcode
|
||||
|
||||
ArenaTeam *at = objmgr.GetArenaTeamById(_player->GetArenaTeamIdInvited());
|
||||
ArenaTeam *at = sObjectMgr.GetArenaTeamById(_player->GetArenaTeamIdInvited());
|
||||
if (!at)
|
||||
return;
|
||||
|
||||
@@ -168,7 +168,7 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/)
|
||||
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()))
|
||||
{
|
||||
// not let enemies sign petition
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", "", ERR_ARENA_TEAM_NOT_ALLIED);
|
||||
@@ -200,7 +200,7 @@ void WorldSession::HandleArenaTeamLeaveOpcode(WorldPacket & recv_data)
|
||||
uint32 ArenaTeamId; // arena team id
|
||||
recv_data >> ArenaTeamId;
|
||||
|
||||
ArenaTeam *at = objmgr.GetArenaTeamById(ArenaTeamId);
|
||||
ArenaTeam *at = sObjectMgr.GetArenaTeamById(ArenaTeamId);
|
||||
if (!at)
|
||||
return;
|
||||
|
||||
@@ -235,7 +235,7 @@ void WorldSession::HandleArenaTeamDisbandOpcode(WorldPacket & recv_data)
|
||||
uint32 ArenaTeamId; // arena team id
|
||||
recv_data >> ArenaTeamId;
|
||||
|
||||
if (ArenaTeam *at = objmgr.GetArenaTeamById(ArenaTeamId))
|
||||
if (ArenaTeam *at = sObjectMgr.GetArenaTeamById(ArenaTeamId))
|
||||
{
|
||||
if (at->GetCaptain() != _player->GetGUID())
|
||||
return;
|
||||
@@ -258,7 +258,7 @@ void WorldSession::HandleArenaTeamRemoveOpcode(WorldPacket & recv_data)
|
||||
recv_data >> ArenaTeamId;
|
||||
recv_data >> name;
|
||||
|
||||
ArenaTeam *at = objmgr.GetArenaTeamById(ArenaTeamId);
|
||||
ArenaTeam *at = sObjectMgr.GetArenaTeamById(ArenaTeamId);
|
||||
if (!at) // arena team not found
|
||||
return;
|
||||
|
||||
@@ -300,7 +300,7 @@ void WorldSession::HandleArenaTeamLeaderOpcode(WorldPacket & recv_data)
|
||||
recv_data >> ArenaTeamId;
|
||||
recv_data >> name;
|
||||
|
||||
ArenaTeam *at = objmgr.GetArenaTeamById(ArenaTeamId);
|
||||
ArenaTeam *at = sObjectMgr.GetArenaTeamById(ArenaTeamId);
|
||||
if (!at) // arena team not found
|
||||
return;
|
||||
|
||||
|
||||
@@ -117,11 +117,11 @@ void WorldSession::SendAuctionOwnerNotification(AuctionEntry* auction)
|
||||
void WorldSession::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 newPrice)
|
||||
{
|
||||
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;
|
||||
if (!oldBidder)
|
||||
oldBidder_accId = objmgr.GetPlayerAccountIdByGUID(oldBidder_guid);
|
||||
oldBidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(oldBidder_guid);
|
||||
|
||||
// old bidder exist
|
||||
if (oldBidder || oldBidder_accId)
|
||||
@@ -142,11 +142,11 @@ void WorldSession::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 newPri
|
||||
void WorldSession::SendAuctionCancelledToBidderMail(AuctionEntry* auction)
|
||||
{
|
||||
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;
|
||||
if (!bidder)
|
||||
bidder_accId = objmgr.GetPlayerAccountIdByGUID(bidder_guid);
|
||||
bidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(bidder_guid);
|
||||
|
||||
// bidder exist
|
||||
if (bidder || bidder_accId)
|
||||
@@ -216,7 +216,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
|
||||
|
||||
Item *it = pl->GetItemByGuid(item);
|
||||
//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));
|
||||
SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR);
|
||||
@@ -241,10 +241,10 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap(pCreature->getFaction());
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction());
|
||||
|
||||
//we have to take deposit :
|
||||
uint32 deposit = auctionmgr.GetAuctionDeposit(auctionHouseEntry, etime, it);
|
||||
uint32 deposit = sAuctionMgr.GetAuctionDeposit(auctionHouseEntry, etime, it);
|
||||
if (pl->GetMoney() < deposit)
|
||||
{
|
||||
SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_NOT_ENOUGHT_MONEY);
|
||||
@@ -262,7 +262,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
|
||||
uint32 auction_time = uint32(etime * sWorld.getRate(RATE_AUCTION_TIME));
|
||||
|
||||
AuctionEntry *AH = new AuctionEntry;
|
||||
AH->Id = objmgr.GenerateAuctionID();
|
||||
AH->Id = sObjectMgr.GenerateAuctionID();
|
||||
if (sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION))
|
||||
AH->auctioneer = 23442;
|
||||
else
|
||||
@@ -279,7 +279,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
|
||||
AH->auctionHouseEntry = auctionHouseEntry;
|
||||
|
||||
sLog.outDetail("selling item %u to auctioneer %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", GUID_LOPART(item), AH->auctioneer, bid, buyout, auction_time, AH->GetHouseId());
|
||||
auctionmgr.AddAItem(it);
|
||||
sAuctionMgr.AddAItem(it);
|
||||
auctionHouse->AddAuction(AH);
|
||||
|
||||
pl->MoveItemFromInventory(it->GetBagSlot(), it->GetSlot(), true);
|
||||
@@ -319,7 +319,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
AuctionHouseObject *auctionHouse = auctionmgr.GetAuctionsMap(pCreature->getFaction());
|
||||
AuctionHouseObject *auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction());
|
||||
|
||||
AuctionEntry *auction = auctionHouse->GetAuction(auctionId);
|
||||
Player *pl = GetPlayer();
|
||||
@@ -332,8 +332,8 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// impossible have online own another character (use this for speedup check in case online owner)
|
||||
Player* auction_owner = objmgr.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())
|
||||
Player* auction_owner = sObjectMgr.GetPlayer(MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER));
|
||||
if (!auction_owner && sObjectMgr.GetPlayerAccountIdByGUID(MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER)) == pl->GetSession()->GetAccountId())
|
||||
{
|
||||
//you cannot bid your another character auction:
|
||||
SendAuctionCommandResult(0, AUCTION_PLACE_BID, CANNOT_BID_YOUR_AUCTION_ERROR);
|
||||
@@ -400,16 +400,16 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
|
||||
auction->bid = auction->buyout;
|
||||
GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, auction->buyout);
|
||||
|
||||
auctionmgr.SendAuctionSalePendingMail(auction);
|
||||
auctionmgr.SendAuctionSuccessfulMail(auction);
|
||||
auctionmgr.SendAuctionWonMail(auction);
|
||||
sAuctionMgr.SendAuctionSalePendingMail(auction);
|
||||
sAuctionMgr.SendAuctionSuccessfulMail(auction);
|
||||
sAuctionMgr.SendAuctionWonMail(auction);
|
||||
|
||||
SendAuctionCommandResult(auction->Id, AUCTION_PLACE_BID, AUCTION_OK);
|
||||
|
||||
CharacterDatabase.BeginTransaction();
|
||||
auction->DeleteFromDB();
|
||||
uint32 item_template = auction->item_template;
|
||||
auctionmgr.RemoveAItem(auction->item_guidlow);
|
||||
sAuctionMgr.RemoveAItem(auction->item_guidlow);
|
||||
auctionHouse->RemoveAuction(auction, item_template);
|
||||
}
|
||||
pl->SaveInventoryAndGoldToDB();
|
||||
@@ -436,14 +436,14 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data)
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap(pCreature->getFaction());
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction());
|
||||
|
||||
AuctionEntry *auction = auctionHouse->GetAuction(auctionId);
|
||||
Player *pl = GetPlayer();
|
||||
|
||||
if (auction && auction->owner == pl->GetGUIDLow())
|
||||
{
|
||||
Item *pItem = auctionmgr.GetAItem(auction->item_guidlow);
|
||||
Item *pItem = sAuctionMgr.GetAItem(auction->item_guidlow);
|
||||
if (pItem)
|
||||
{
|
||||
if (auction->bidder > 0) // If we have a bidder, we have to send him the money he paid
|
||||
@@ -487,7 +487,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data)
|
||||
pl->SaveInventoryAndGoldToDB();
|
||||
auction->DeleteFromDB();
|
||||
uint32 item_template = auction->item_template;
|
||||
auctionmgr.RemoveAItem(auction->item_guidlow);
|
||||
sAuctionMgr.RemoveAItem(auction->item_guidlow);
|
||||
auctionHouse->RemoveAuction(auction, item_template);
|
||||
CharacterDatabase.CommitTransaction();
|
||||
}
|
||||
@@ -519,7 +519,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data)
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(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));
|
||||
Player *pl = GetPlayer();
|
||||
@@ -566,7 +566,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data)
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(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));
|
||||
data << (uint32) 0; // amount place holder
|
||||
@@ -619,7 +619,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data)
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(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",
|
||||
// GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid)), listfrom, searchedname.c_str(), levelmin, levelmax, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, usable);
|
||||
|
||||
@@ -251,11 +251,11 @@ void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & /*recv_
|
||||
uint32 count1 = 0; //always constant zero?
|
||||
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)
|
||||
++count2;
|
||||
|
||||
Player *horde_plr = objmgr.GetPlayer(((BattlegroundWS*)bg)->GetHordeFlagPickerGUID());
|
||||
Player *horde_plr = sObjectMgr.GetPlayer(((BattlegroundWS*)bg)->GetHordeFlagPickerGUID());
|
||||
if (horde_plr)
|
||||
++count2;
|
||||
|
||||
@@ -468,7 +468,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data)
|
||||
// if player leaves rated arena match before match start, it is counted as he played but he lost
|
||||
if (ginfo.IsRated)
|
||||
{
|
||||
ArenaTeam * at = objmgr.GetArenaTeamById(ginfo.Team);
|
||||
ArenaTeam * at = sObjectMgr.GetArenaTeamById(ginfo.Team);
|
||||
if (at)
|
||||
{
|
||||
sLog.outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u, because he has left queue!", GUID_LOPART(_player->GetGUID()), ginfo.OpponentsTeamRating);
|
||||
@@ -707,7 +707,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data)
|
||||
{
|
||||
ateamId = _player->GetArenaTeamId(arenaslot);
|
||||
// check real arenateam existence only here (if it was moved to group->CanJoin .. () then we would ahve to get it twice)
|
||||
ArenaTeam * at = objmgr.GetArenaTeamById(ateamId);
|
||||
ArenaTeam * at = sObjectMgr.GetArenaTeamById(ateamId);
|
||||
if (!at)
|
||||
{
|
||||
_player->GetSession()->SendNotInArenaTeamPacket(arenatype);
|
||||
@@ -802,7 +802,7 @@ void WorldSession::HandleReportPvPAFK(WorldPacket & recv_data)
|
||||
{
|
||||
uint64 playerGuid;
|
||||
recv_data >> playerGuid;
|
||||
Player *reportedPlayer = objmgr.GetPlayer(playerGuid);
|
||||
Player *reportedPlayer = sObjectMgr.GetPlayer(playerGuid);
|
||||
|
||||
if (!reportedPlayer)
|
||||
{
|
||||
|
||||
@@ -89,7 +89,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket & /*recv_data*/)
|
||||
p_counter = data.wpos();
|
||||
data << uint32(counter); // raid reset count
|
||||
|
||||
ResetTimeByMapDifficultyMap const& resets = sInstanceSaveManager.GetResetTimeMap();
|
||||
ResetTimeByMapDifficultyMap const& resets = sInstanceSaveMgr.GetResetTimeMap();
|
||||
for (ResetTimeByMapDifficultyMap::const_iterator itr = resets.begin(); itr != resets.end(); ++itr)
|
||||
{
|
||||
uint32 mapid = PAIR32_LOPART(itr->first);
|
||||
|
||||
@@ -266,14 +266,14 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(name))
|
||||
if (GetSecurity() == SEC_PLAYER && sObjectMgr.IsReservedName(name))
|
||||
{
|
||||
data << (uint8)CHAR_NAME_RESERVED;
|
||||
SendPacket(&data);
|
||||
return;
|
||||
}
|
||||
|
||||
if (objmgr.GetPlayerGUIDByName(name))
|
||||
if (sObjectMgr.GetPlayerGUIDByName(name))
|
||||
{
|
||||
data << (uint8)CHAR_CREATE_NAME_IN_USE;
|
||||
SendPacket(&data);
|
||||
@@ -446,7 +446,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
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?)
|
||||
pNewChar->CleanupsBeforeDelete();
|
||||
@@ -488,14 +488,14 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data)
|
||||
recv_data >> guid;
|
||||
|
||||
// can't delete loaded character
|
||||
if (objmgr.GetPlayer(guid))
|
||||
if (sObjectMgr.GetPlayer(guid))
|
||||
return;
|
||||
|
||||
uint32 accountId = 0;
|
||||
std::string name;
|
||||
|
||||
// is guild leader
|
||||
if (objmgr.GetGuildByLeader(guid))
|
||||
if (sObjectMgr.GetGuildByLeader(guid))
|
||||
{
|
||||
WorldPacket data(SMSG_CHAR_DELETE, 1);
|
||||
data << (uint8)CHAR_DELETE_FAILED_GUILD_LEADER;
|
||||
@@ -504,7 +504,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// is arena team captain
|
||||
if (objmgr.GetArenaTeamByCaptain(guid))
|
||||
if (sObjectMgr.GetArenaTeamByCaptain(guid))
|
||||
{
|
||||
WorldPacket data(SMSG_CHAR_DELETE, 1);
|
||||
data << (uint8)CHAR_DELETE_FAILED_ARENA_CAPTAIN;
|
||||
@@ -664,7 +664,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
||||
|
||||
if (pCurrChar->GetGuildId() != 0)
|
||||
{
|
||||
Guild* guild = objmgr.GetGuildById(pCurrChar->GetGuildId());
|
||||
Guild* guild = sObjectMgr.GetGuildById(pCurrChar->GetGuildId());
|
||||
if (guild)
|
||||
{
|
||||
data.Initialize(SMSG_GUILD_EVENT, (1+1+guild->GetMOTD().size()+1));
|
||||
@@ -713,7 +713,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
||||
|
||||
if (!pCurrChar->GetMap()->Add(pCurrChar) || !pCurrChar->CheckInstanceLoginValid())
|
||||
{
|
||||
AreaTrigger const* at = objmgr.GetGoBackTrigger(pCurrChar->GetMapId());
|
||||
AreaTrigger const* at = sObjectMgr.GetGoBackTrigger(pCurrChar->GetMapId());
|
||||
if (at)
|
||||
pCurrChar->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, pCurrChar->GetOrientation());
|
||||
else
|
||||
@@ -944,7 +944,7 @@ void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data)
|
||||
}
|
||||
|
||||
// check name limitations
|
||||
if (GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(newname))
|
||||
if (GetSecurity() == SEC_PLAYER && sObjectMgr.IsReservedName(newname))
|
||||
{
|
||||
WorldPacket data(SMSG_CHAR_RENAME, 1);
|
||||
data << uint8(CHAR_NAME_RESERVED);
|
||||
@@ -1002,7 +1002,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data)
|
||||
|
||||
// not accept declined names for unsupported languages
|
||||
std::string name;
|
||||
if (!objmgr.GetPlayerNameByGUID(guid, name))
|
||||
if (!sObjectMgr.GetPlayerNameByGUID(guid, name))
|
||||
{
|
||||
WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4+8);
|
||||
data << uint32(1);
|
||||
@@ -1208,7 +1208,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
|
||||
}
|
||||
|
||||
// check name limitations
|
||||
if (GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(newname))
|
||||
if (GetSecurity() == SEC_PLAYER && sObjectMgr.IsReservedName(newname))
|
||||
{
|
||||
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
|
||||
data << uint8(CHAR_NAME_RESERVED);
|
||||
@@ -1217,7 +1217,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
|
||||
}
|
||||
|
||||
// character with this name already exist
|
||||
if (uint64 newguid = objmgr.GetPlayerGUIDByName(newname))
|
||||
if (uint64 newguid = sObjectMgr.GetPlayerGUIDByName(newname))
|
||||
{
|
||||
if (newguid != guid)
|
||||
{
|
||||
|
||||
@@ -243,7 +243,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
|
||||
break;
|
||||
}
|
||||
|
||||
Player *player = objmgr.GetPlayer(to.c_str());
|
||||
Player *player = sObjectMgr.GetPlayer(to.c_str());
|
||||
uint32 tSecurity = GetSecurity();
|
||||
uint32 pSecurity = player ? player->GetSession()->GetSecurity() : SEC_PLAYER;
|
||||
if (!player || (tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers()))
|
||||
@@ -330,7 +330,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
|
||||
|
||||
if (GetPlayer()->GetGuildId())
|
||||
{
|
||||
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
|
||||
if (guild)
|
||||
guild->BroadcastToGuild(this, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
|
||||
@@ -368,7 +368,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
|
||||
|
||||
if (GetPlayer()->GetGuildId())
|
||||
{
|
||||
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
|
||||
if (guild)
|
||||
guild->BroadcastToOfficers(this, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
|
||||
@@ -714,7 +714,7 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data)
|
||||
recv_data >> iguid;
|
||||
recv_data >> unk; // probably related to spam reporting
|
||||
|
||||
Player *player = objmgr.GetPlayer(iguid);
|
||||
Player *player = sObjectMgr.GetPlayer(iguid);
|
||||
if (!player || !player->GetSession())
|
||||
return;
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
Player *player = objmgr.GetPlayer(membername.c_str());
|
||||
Player *player = sObjectMgr.GetPlayer(membername.c_str());
|
||||
|
||||
// no player
|
||||
if (!player)
|
||||
@@ -217,7 +217,7 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket & /*recv_data*/)
|
||||
return;
|
||||
}
|
||||
|
||||
Player* leader = objmgr.GetPlayer(group->GetLeaderGUID());
|
||||
Player* leader = sObjectMgr.GetPlayer(group->GetLeaderGUID());
|
||||
|
||||
// forming a new group, create it
|
||||
if (!group->IsCreated())
|
||||
@@ -225,7 +225,7 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket & /*recv_data*/)
|
||||
if (leader)
|
||||
group->RemoveInvite(leader);
|
||||
group->Create(group->GetLeaderGUID(), group->GetLeaderName());
|
||||
objmgr.AddGroup(group);
|
||||
sObjectMgr.AddGroup(group);
|
||||
}
|
||||
|
||||
// everything's fine, do it, PLAYER'S GROUP IS SET IN ADDMEMBER!!!
|
||||
@@ -249,7 +249,7 @@ void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recv_data*/)
|
||||
if (!group) return;
|
||||
|
||||
// remember leader if online
|
||||
Player *leader = objmgr.GetPlayer(group->GetLeaderGUID());
|
||||
Player *leader = sObjectMgr.GetPlayer(group->GetLeaderGUID());
|
||||
|
||||
// uninvite, group can be deleted
|
||||
GetPlayer()->UninviteFromGroup();
|
||||
@@ -353,7 +353,7 @@ void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket & recv_data)
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
Player *player = objmgr.GetPlayer(guid);
|
||||
Player *player = sObjectMgr.GetPlayer(guid);
|
||||
|
||||
/** error handling **/
|
||||
if (!player || !group->IsLeader(GetPlayer()->GetGUID()) || player->GetGroup() != group)
|
||||
@@ -559,7 +559,7 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
/********************/
|
||||
|
||||
Player *movedPlayer = objmgr.GetPlayer(name.c_str());
|
||||
Player *movedPlayer = sObjectMgr.GetPlayer(name.c_str());
|
||||
if (movedPlayer)
|
||||
{
|
||||
//Do not allow leader to change group of player in combat
|
||||
@@ -570,7 +570,7 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data)
|
||||
group->ChangeMembersGroup(movedPlayer, groupNr);
|
||||
}
|
||||
else
|
||||
group->ChangeMembersGroup(objmgr.GetPlayerGUIDByName(name.c_str()), groupNr);
|
||||
group->ChangeMembersGroup(sObjectMgr.GetPlayerGUIDByName(name.c_str()), groupNr);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket & recv_data)
|
||||
@@ -841,7 +841,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recv_data)
|
||||
uint64 Guid;
|
||||
recv_data >> Guid;
|
||||
|
||||
Player *player = objmgr.GetPlayer(Guid);
|
||||
Player *player = sObjectMgr.GetPlayer(Guid);
|
||||
if (!player)
|
||||
{
|
||||
WorldPacket data(SMSG_PARTY_MEMBER_STATS_FULL, 3+4+2);
|
||||
|
||||
@@ -36,7 +36,7 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket)
|
||||
uint32 guildId;
|
||||
recvPacket >> guildId;
|
||||
|
||||
if (Guild *guild = objmgr.GetGuildById(guildId))
|
||||
if (Guild *guild = sObjectMgr.GetGuildById(guildId))
|
||||
{
|
||||
guild->Query(this);
|
||||
return;
|
||||
@@ -62,7 +62,7 @@ void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
objmgr.AddGuild(guild);
|
||||
sObjectMgr.AddGuild(guild);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
|
||||
@@ -83,7 +83,7 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
|
||||
@@ -145,7 +145,7 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket)
|
||||
if (!normalizePlayerName(plName))
|
||||
return;
|
||||
|
||||
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
|
||||
@@ -193,12 +193,12 @@ void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/)
|
||||
|
||||
sLog.outDebug("WORLD: Received CMSG_GUILD_ACCEPT");
|
||||
|
||||
guild = objmgr.GetGuildById(player->GetGuildIdInvited());
|
||||
guild = sObjectMgr.GetGuildById(player->GetGuildIdInvited());
|
||||
if (!guild || player->GetGuildId())
|
||||
return;
|
||||
|
||||
// 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;
|
||||
|
||||
if (!guild->AddMember(GetPlayer()->GetGUID(),guild->GetLowestRank()))
|
||||
@@ -224,7 +224,7 @@ void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/)
|
||||
Guild *guild;
|
||||
sLog.outDebug("WORLD: Received CMSG_GUILD_INFO");
|
||||
|
||||
guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
|
||||
@@ -244,7 +244,7 @@ void WorldSession::HandleGuildRosterOpcode(WorldPacket& /*recvPacket*/)
|
||||
{
|
||||
sLog.outDebug("WORLD: Received CMSG_GUILD_ROSTER");
|
||||
|
||||
if (Guild* guild = objmgr.GetGuildById(_player->GetGuildId()))
|
||||
if (Guild* guild = sObjectMgr.GetGuildById(_player->GetGuildId()))
|
||||
guild->Roster(this);
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
|
||||
if (!normalizePlayerName(plName))
|
||||
return;
|
||||
|
||||
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
|
||||
@@ -314,7 +314,7 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
|
||||
if (!normalizePlayerName(plName))
|
||||
return;
|
||||
|
||||
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
|
||||
if (!guild)
|
||||
{
|
||||
@@ -370,7 +370,7 @@ void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/)
|
||||
{
|
||||
sLog.outDebug("WORLD: Received CMSG_GUILD_LEAVE");
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(_player->GetGuildId());
|
||||
Guild *guild = sObjectMgr.GetGuildById(_player->GetGuildId());
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
|
||||
@@ -402,7 +402,7 @@ void WorldSession::HandleGuildDisbandOpcode(WorldPacket& /*recvPacket*/)
|
||||
{
|
||||
sLog.outDebug("WORLD: Received CMSG_GUILD_DISBAND");
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
|
||||
@@ -432,7 +432,7 @@ void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket)
|
||||
if (!normalizePlayerName(name))
|
||||
return;
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(oldLeader->GetGuildId());
|
||||
Guild *guild = sObjectMgr.GetGuildById(oldLeader->GetGuildId());
|
||||
|
||||
if (!guild)
|
||||
{
|
||||
@@ -472,7 +472,7 @@ void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket)
|
||||
else
|
||||
MOTD = "";
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
|
||||
@@ -500,7 +500,7 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket)
|
||||
if (!normalizePlayerName(name))
|
||||
return;
|
||||
|
||||
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
|
||||
@@ -538,7 +538,7 @@ void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket)
|
||||
if (!normalizePlayerName(plName))
|
||||
return;
|
||||
|
||||
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
|
||||
@@ -574,7 +574,7 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
|
||||
|
||||
sLog.outDebug("WORLD: Received CMSG_GUILD_RANK");
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if (!guild)
|
||||
{
|
||||
recvPacket.rpos(recvPacket.wpos()); // set to end to avoid warnings spam
|
||||
@@ -624,7 +624,7 @@ void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket)
|
||||
std::string rankname;
|
||||
recvPacket >> rankname;
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
|
||||
@@ -650,7 +650,7 @@ void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/)
|
||||
{
|
||||
sLog.outDebug("WORLD: Received CMSG_GUILD_DEL_RANK");
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
|
||||
@@ -687,7 +687,7 @@ void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket)
|
||||
|
||||
recvPacket >> GINFO;
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
|
||||
@@ -727,7 +727,7 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket)
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if (!guild)
|
||||
{
|
||||
//"You are not part of a guild!";
|
||||
@@ -763,7 +763,7 @@ void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */)
|
||||
// empty
|
||||
sLog.outDebug("WORLD: Received (MSG_GUILD_EVENT_LOG_QUERY)");
|
||||
if (uint32 GuildId = GetPlayer()->GetGuildId())
|
||||
if (Guild *pGuild = objmgr.GetGuildById(GuildId))
|
||||
if (Guild *pGuild = sObjectMgr.GetGuildById(GuildId))
|
||||
pGuild->DisplayGuildEventLog(this);
|
||||
}
|
||||
|
||||
@@ -773,7 +773,7 @@ void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recv_data */)
|
||||
{
|
||||
sLog.outDebug("WORLD: Received (MSG_GUILD_BANK_MONEY_WITHDRAWN)");
|
||||
if (uint32 GuildId = GetPlayer()->GetGuildId())
|
||||
if (Guild *pGuild = objmgr.GetGuildById(GuildId))
|
||||
if (Guild *pGuild = sObjectMgr.GetGuildById(GuildId))
|
||||
pGuild->SendMoneyInfo(this, GetPlayer()->GetGUIDLow());
|
||||
}
|
||||
|
||||
@@ -783,7 +783,7 @@ void WorldSession::HandleGuildPermissions(WorldPacket& /* recv_data */)
|
||||
|
||||
if (uint32 GuildId = GetPlayer()->GetGuildId())
|
||||
{
|
||||
if (Guild *pGuild = objmgr.GetGuildById(GuildId))
|
||||
if (Guild *pGuild = sObjectMgr.GetGuildById(GuildId))
|
||||
{
|
||||
uint32 rankId = GetPlayer()->GetRank();
|
||||
|
||||
@@ -819,7 +819,7 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket & recv_data)
|
||||
|
||||
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
|
||||
return;
|
||||
@@ -845,7 +845,7 @@ void WorldSession::HandleGuildBankQueryTab(WorldPacket & recv_data)
|
||||
if (!GuildId)
|
||||
return;
|
||||
|
||||
Guild *pGuild = objmgr.GetGuildById(GuildId);
|
||||
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
|
||||
if (!pGuild)
|
||||
return;
|
||||
|
||||
@@ -879,7 +879,7 @@ void WorldSession::HandleGuildBankDepositMoney(WorldPacket & recv_data)
|
||||
if (!GuildId)
|
||||
return;
|
||||
|
||||
Guild *pGuild = objmgr.GetGuildById(GuildId);
|
||||
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
|
||||
if (!pGuild)
|
||||
return;
|
||||
|
||||
@@ -927,7 +927,7 @@ void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket & recv_data)
|
||||
if (GuildId == 0)
|
||||
return;
|
||||
|
||||
Guild *pGuild = objmgr.GetGuildById(GuildId);
|
||||
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
|
||||
if (!pGuild)
|
||||
return;
|
||||
|
||||
@@ -987,7 +987,7 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
Guild *pGuild = objmgr.GetGuildById(GuildId);
|
||||
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
|
||||
if (!pGuild)
|
||||
{
|
||||
recv_data.rpos(recv_data.wpos()); // prevent additional spam at rejected packet
|
||||
@@ -1088,7 +1088,7 @@ void WorldSession::HandleGuildBankBuyTab(WorldPacket & recv_data)
|
||||
if (!GuildId)
|
||||
return;
|
||||
|
||||
Guild *pGuild = objmgr.GetGuildById(GuildId);
|
||||
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
|
||||
if (!pGuild)
|
||||
return;
|
||||
|
||||
@@ -1139,7 +1139,7 @@ void WorldSession::HandleGuildBankUpdateTab(WorldPacket & recv_data)
|
||||
if (!GuildId)
|
||||
return;
|
||||
|
||||
Guild *pGuild = objmgr.GetGuildById(GuildId);
|
||||
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
|
||||
if (!pGuild)
|
||||
return;
|
||||
|
||||
@@ -1162,7 +1162,7 @@ void WorldSession::HandleGuildBankLogQuery(WorldPacket & recv_data)
|
||||
if (!GuildId)
|
||||
return;
|
||||
|
||||
Guild *pGuild = objmgr.GetGuildById(GuildId);
|
||||
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
|
||||
if (!pGuild)
|
||||
return;
|
||||
|
||||
@@ -1184,7 +1184,7 @@ void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recv_data)
|
||||
if (!GuildId)
|
||||
return;
|
||||
|
||||
Guild *pGuild = objmgr.GetGuildById(GuildId);
|
||||
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
|
||||
if (!pGuild)
|
||||
return;
|
||||
|
||||
@@ -1207,7 +1207,7 @@ void WorldSession::HandleSetGuildBankTabText(WorldPacket &recv_data)
|
||||
if (!GuildId)
|
||||
return;
|
||||
|
||||
Guild *pGuild = objmgr.GetGuildById(GuildId);
|
||||
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
|
||||
if (!pGuild)
|
||||
return;
|
||||
|
||||
|
||||
@@ -287,7 +287,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data)
|
||||
|
||||
sLog.outDetail("STORAGE: Item Query = %u", item);
|
||||
|
||||
ItemPrototype const *pProto = objmgr.GetItemPrototype(item);
|
||||
ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(item);
|
||||
if (pProto)
|
||||
{
|
||||
std::string Name = pProto->Name1;
|
||||
@@ -296,7 +296,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data)
|
||||
int loc_idx = GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
ItemLocale const *il = objmgr.GetItemLocale(pProto->ItemId);
|
||||
ItemLocale const *il = sObjectMgr.GetItemLocale(pProto->ItemId);
|
||||
if (il)
|
||||
{
|
||||
if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty())
|
||||
@@ -762,7 +762,7 @@ void WorldSession::SendListInventory(uint64 vendorguid)
|
||||
{
|
||||
if (VendorItem const* crItem = vItems->GetItem(vendorslot))
|
||||
{
|
||||
if (ItemPrototype const *pProto = objmgr.GetItemPrototype(crItem->item))
|
||||
if (ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(crItem->item))
|
||||
{
|
||||
if ((pProto->AllowableClass & _player->getClassMask()) == 0 && pProto->Bonding == BIND_WHEN_PICKED_UP && !_player->isGameMaster())
|
||||
continue;
|
||||
@@ -1023,14 +1023,14 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data)
|
||||
recv_data.read_skip<uint64>(); // guid
|
||||
|
||||
sLog.outDebug("WORLD: CMSG_ITEM_NAME_QUERY %u", itemid);
|
||||
ItemSetNameEntry const *pName = objmgr.GetItemSetNameEntry(itemid);
|
||||
ItemSetNameEntry const *pName = sObjectMgr.GetItemSetNameEntry(itemid);
|
||||
if (pName)
|
||||
{
|
||||
std::string Name = pName->name;
|
||||
int loc_idx = GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
ItemSetNameLocale const *isnl = objmgr.GetItemSetNameLocale(itemid);
|
||||
ItemSetNameLocale const *isnl = sObjectMgr.GetItemSetNameLocale(itemid);
|
||||
if (isnl)
|
||||
if (isnl->Name.size() > size_t(loc_idx) && !isnl->Name[loc_idx].empty())
|
||||
Name = isnl->Name[loc_idx];
|
||||
|
||||
@@ -296,7 +296,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data)
|
||||
if (!(wplayer_name.empty() || wpname.find(wplayer_name) != std::wstring::npos))
|
||||
continue;
|
||||
|
||||
std::string gname = objmgr.GetGuildNameById(itr->second->GetGuildId());
|
||||
std::string gname = sObjectMgr.GetGuildNameById(itr->second->GetGuildId());
|
||||
std::wstring wgname;
|
||||
if (!Utf8toWStr(gname,wgname))
|
||||
continue;
|
||||
@@ -578,7 +578,7 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult_AutoPtr result, uin
|
||||
team = Player::TeamForRace((*result)[1].GetUInt8());
|
||||
friendAcctid = (*result)[2].GetUInt32();
|
||||
|
||||
if (session->GetSecurity() >= SEC_MODERATOR || sWorld.getConfig(CONFIG_ALLOW_GM_FRIEND) || accmgr.GetSecurity(friendAcctid) < SEC_MODERATOR)
|
||||
if (session->GetSecurity() >= SEC_MODERATOR || sWorld.getConfig(CONFIG_ALLOW_GM_FRIEND) || sAccountMgr.GetSecurity(friendAcctid) < SEC_MODERATOR)
|
||||
{
|
||||
if (friendGuid)
|
||||
{
|
||||
@@ -887,10 +887,10 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
|
||||
if (sScriptMgr.OnAreaTrigger(GetPlayer(), atEntry))
|
||||
return;
|
||||
|
||||
uint32 quest_id = objmgr.GetQuestForAreaTrigger(Trigger_ID);
|
||||
uint32 quest_id = sObjectMgr.GetQuestForAreaTrigger(Trigger_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 (GetPlayer()->GetQuestStatus(quest_id) == QUEST_STATUS_INCOMPLETE)
|
||||
@@ -898,7 +898,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
|
||||
GetPlayer()->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
|
||||
@@ -928,7 +928,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// NULL if all values default (non teleport trigger)
|
||||
AreaTrigger const* at = objmgr.GetAreaTrigger(Trigger_ID);
|
||||
AreaTrigger const* at = sObjectMgr.GetAreaTrigger(Trigger_ID);
|
||||
if (!at)
|
||||
return;
|
||||
|
||||
@@ -1215,7 +1215,7 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data)
|
||||
|
||||
_player->SetSelection(guid);
|
||||
|
||||
Player *plr = objmgr.GetPlayer(guid);
|
||||
Player *plr = sObjectMgr.GetPlayer(guid);
|
||||
if (!plr) // wrong player
|
||||
return;
|
||||
|
||||
@@ -1244,7 +1244,7 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data)
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
Player *player = objmgr.GetPlayer(guid);
|
||||
Player *player = sObjectMgr.GetPlayer(guid);
|
||||
|
||||
if (!player)
|
||||
{
|
||||
@@ -1316,7 +1316,7 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
Player *plr = objmgr.GetPlayer(charname.c_str());
|
||||
Player *plr = sObjectMgr.GetPlayer(charname.c_str());
|
||||
|
||||
if (!plr)
|
||||
{
|
||||
@@ -1687,7 +1687,7 @@ void WorldSession::HandleQueryInspectAchievements(WorldPacket & recv_data)
|
||||
if (!recv_data.readPackGUID(guid))
|
||||
return;
|
||||
|
||||
Player *player = objmgr.GetPlayer(guid);
|
||||
Player *player = sObjectMgr.GetPlayer(guid);
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
||||
|
||||
// get the destination map entry, not the current one, this will fix homebind and reset greeting
|
||||
MapEntry const* mEntry = sMapStore.LookupEntry(loc.GetMapId());
|
||||
InstanceTemplate const* mInstance = objmgr.GetInstanceTemplate(loc.GetMapId());
|
||||
InstanceTemplate const* mInstance = sObjectMgr.GetInstanceTemplate(loc.GetMapId());
|
||||
|
||||
// reset instance validity, except if going to an instance inside an instance
|
||||
if (GetPlayer()->m_InstanceValid == false && !mInstance)
|
||||
@@ -157,7 +157,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
||||
{
|
||||
if (mapDiff->resetTime)
|
||||
{
|
||||
if (uint32 timeReset = sInstanceSaveManager.GetResetTimeFor(mEntry->MapID,diff))
|
||||
if (uint32 timeReset = sInstanceSaveMgr.GetResetTimeFor(mEntry->MapID,diff))
|
||||
{
|
||||
uint32 timeleft = timeReset - time(NULL);
|
||||
GetPlayer()->SendInstanceResetWarning(mEntry->MapID, diff, timeleft);
|
||||
|
||||
@@ -179,7 +179,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle)
|
||||
valid = false;
|
||||
break;
|
||||
}
|
||||
if (spellmgr.IsPrimaryProfessionFirstRankSpell(tSpell->learnedSpell[i]))
|
||||
if (sSpellMgr.IsPrimaryProfessionFirstRankSpell(tSpell->learnedSpell[i]))
|
||||
primary_prof_first_rank = true;
|
||||
}
|
||||
if (!valid)
|
||||
@@ -203,7 +203,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle)
|
||||
{
|
||||
if (!tSpell->learnedSpell[i])
|
||||
continue;
|
||||
if (SpellChainNode const* chain_node = spellmgr.GetSpellChainNode(tSpell->learnedSpell[i]))
|
||||
if (SpellChainNode const* chain_node = sSpellMgr.GetSpellChainNode(tSpell->learnedSpell[i]))
|
||||
{
|
||||
if (chain_node->prev)
|
||||
{
|
||||
@@ -213,7 +213,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle)
|
||||
}
|
||||
if (maxReq == 3)
|
||||
break;
|
||||
SpellsRequiringSpellMapBounds spellsRequired = spellmgr.GetSpellsRequiredForSpellBounds(tSpell->learnedSpell[i]);
|
||||
SpellsRequiringSpellMapBounds spellsRequired = sSpellMgr.GetSpellsRequiredForSpellBounds(tSpell->learnedSpell[i]);
|
||||
for (SpellsRequiringSpellMap::const_iterator itr2 = spellsRequired.first; itr2 != spellsRequired.second && maxReq < 3; ++itr2)
|
||||
{
|
||||
data << uint32(itr2->second);
|
||||
@@ -421,7 +421,7 @@ void WorldSession::SendSpiritResurrect()
|
||||
WorldSafeLocsEntry const *corpseGrave = NULL;
|
||||
Corpse *corpse = _player->GetCorpse();
|
||||
if (corpse)
|
||||
corpseGrave = objmgr.GetClosestGraveYard(
|
||||
corpseGrave = sObjectMgr.GetClosestGraveYard(
|
||||
corpse->GetPositionX(), corpse->GetPositionY(), corpse->GetPositionZ(), corpse->GetMapId(), _player->GetTeam());
|
||||
|
||||
// now can spawn bones
|
||||
@@ -430,7 +430,7 @@ void WorldSession::SendSpiritResurrect()
|
||||
// teleport to nearest from corpse graveyard, if different from nearest to player ghost
|
||||
if (corpseGrave)
|
||||
{
|
||||
WorldSafeLocsEntry const *ghostGrave = objmgr.GetClosestGraveYard(
|
||||
WorldSafeLocsEntry const *ghostGrave = sObjectMgr.GetClosestGraveYard(
|
||||
_player->GetPositionX(), _player->GetPositionY(), _player->GetPositionZ(), _player->GetMapId(), _player->GetTeam());
|
||||
|
||||
if (corpseGrave != ghostGrave)
|
||||
@@ -673,7 +673,7 @@ void WorldSession::HandleUnstablePet(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
CreatureInfo const* creatureInfo = objmgr.GetCreatureTemplate(creature_id);
|
||||
CreatureInfo const* creatureInfo = sObjectMgr.GetCreatureTemplate(creature_id);
|
||||
if (!creatureInfo || !creatureInfo->isTameable(_player->CanTameExoticPets()))
|
||||
{
|
||||
// if problem in exotic pet
|
||||
@@ -791,7 +791,7 @@ void WorldSession::HandleStableSwapPet(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
CreatureInfo const* creatureInfo = objmgr.GetCreatureTemplate(creature_id);
|
||||
CreatureInfo const* creatureInfo = sObjectMgr.GetCreatureTemplate(creature_id);
|
||||
if (!creatureInfo || !creatureInfo->isTameable(_player->CanTameExoticPets()))
|
||||
{
|
||||
// if problem in exotic pet
|
||||
@@ -860,7 +860,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data)
|
||||
uint32 GuildId = _player->GetGuildId();
|
||||
if (!GuildId)
|
||||
return;
|
||||
Guild *pGuild = objmgr.GetGuildById(GuildId);
|
||||
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
|
||||
if (!pGuild)
|
||||
return;
|
||||
pGuild->LogBankEvent(GUILD_BANK_LOG_REPAIR_MONEY, 0, _player->GetGUIDLow(), TotalCost);
|
||||
|
||||
@@ -571,7 +571,7 @@ void WorldSession::HandlePetRename(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
if (objmgr.IsReservedName(name))
|
||||
if (sObjectMgr.IsReservedName(name))
|
||||
{
|
||||
SendPetNameInvalid(PET_NAME_RESERVED, name, NULL);
|
||||
return;
|
||||
|
||||
@@ -147,12 +147,12 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
|
||||
|
||||
if (type == 9)
|
||||
{
|
||||
if (objmgr.GetGuildByName(name))
|
||||
if (sObjectMgr.GetGuildByName(name))
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, name, ERR_GUILD_NAME_EXISTS_S);
|
||||
return;
|
||||
}
|
||||
if (objmgr.IsReservedName(name) || !ObjectMgr::IsValidCharterName(name))
|
||||
if (sObjectMgr.IsReservedName(name) || !ObjectMgr::IsValidCharterName(name))
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, name, ERR_GUILD_NAME_INVALID);
|
||||
return;
|
||||
@@ -160,19 +160,19 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (objmgr.GetArenaTeamByName(name))
|
||||
if (sObjectMgr.GetArenaTeamByName(name))
|
||||
{
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_EXISTS_S);
|
||||
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);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ItemPrototype const *pProto = objmgr.GetItemPrototype(charterid);
|
||||
ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(charterid);
|
||||
if (!pProto)
|
||||
{
|
||||
_player->SendBuyError(BUY_ERR_CANT_FIND_ITEM, NULL, charterid, 0);
|
||||
@@ -397,12 +397,12 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data)
|
||||
|
||||
if (type == 9)
|
||||
{
|
||||
if (objmgr.GetGuildByName(newname))
|
||||
if (sObjectMgr.GetGuildByName(newname))
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, newname, ERR_GUILD_NAME_EXISTS_S);
|
||||
return;
|
||||
}
|
||||
if (objmgr.IsReservedName(newname) || !ObjectMgr::IsValidCharterName(newname))
|
||||
if (sObjectMgr.IsReservedName(newname) || !ObjectMgr::IsValidCharterName(newname))
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, newname, ERR_GUILD_NAME_INVALID);
|
||||
return;
|
||||
@@ -410,12 +410,12 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (objmgr.GetArenaTeamByName(newname))
|
||||
if (sObjectMgr.GetArenaTeamByName(newname))
|
||||
{
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, newname, "", ERR_ARENA_TEAM_NAME_EXISTS_S);
|
||||
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);
|
||||
return;
|
||||
@@ -467,7 +467,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
|
||||
// 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)
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED);
|
||||
@@ -532,7 +532,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
|
||||
SendPacket(&data);
|
||||
|
||||
// update for owner if online
|
||||
if (Player *owner = objmgr.GetPlayer(ownerguid))
|
||||
if (Player *owner = sObjectMgr.GetPlayer(ownerguid))
|
||||
owner->GetSession()->SendPacket(&data);
|
||||
return;
|
||||
}
|
||||
@@ -555,7 +555,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
|
||||
// item->SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1+1, signs);
|
||||
|
||||
// update for owner if online
|
||||
if (Player *owner = objmgr.GetPlayer(ownerguid))
|
||||
if (Player *owner = sObjectMgr.GetPlayer(ownerguid))
|
||||
owner->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
@@ -576,7 +576,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recv_data)
|
||||
Field *fields = result->Fetch();
|
||||
ownerguid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||
|
||||
Player *owner = objmgr.GetPlayer(ownerguid);
|
||||
Player *owner = sObjectMgr.GetPlayer(ownerguid);
|
||||
if (owner) // petition owner online
|
||||
{
|
||||
WorldPacket data(MSG_PETITION_DECLINE, 8);
|
||||
@@ -770,7 +770,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
|
||||
|
||||
if (type == 9)
|
||||
{
|
||||
if (objmgr.GetGuildByName(name))
|
||||
if (sObjectMgr.GetGuildByName(name))
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, name, ERR_GUILD_NAME_EXISTS_S);
|
||||
return;
|
||||
@@ -778,7 +778,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (objmgr.GetArenaTeamByName(name))
|
||||
if (sObjectMgr.GetArenaTeamByName(name))
|
||||
{
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_EXISTS_S);
|
||||
return;
|
||||
@@ -805,7 +805,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// register guild and add guildmaster
|
||||
objmgr.AddGuild(guild);
|
||||
sObjectMgr.AddGuild(guild);
|
||||
|
||||
// add members
|
||||
for (uint8 i = 0; i < signs; ++i)
|
||||
@@ -831,7 +831,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
|
||||
at->SetEmblem(backgroud, icon, iconcolor, border, bordercolor);
|
||||
|
||||
// register team and add captain
|
||||
objmgr.AddArenaTeam(at);
|
||||
sObjectMgr.AddArenaTeam(at);
|
||||
sLog.outDebug("PetitonsHandler: arena team added to objmrg");
|
||||
|
||||
// add members
|
||||
|
||||
@@ -127,7 +127,7 @@ void WorldSession::HandleNameQueryOpcode(WorldPacket & recv_data)
|
||||
|
||||
recv_data >> guid;
|
||||
|
||||
Player *pChar = objmgr.GetPlayer(guid);
|
||||
Player *pChar = sObjectMgr.GetPlayer(guid);
|
||||
|
||||
if (pChar)
|
||||
SendNameQueryOpcode(pChar);
|
||||
@@ -156,7 +156,7 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data)
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
CreatureInfo const *ci = objmgr.GetCreatureTemplate(entry);
|
||||
CreatureInfo const *ci = sObjectMgr.GetCreatureTemplate(entry);
|
||||
if (ci)
|
||||
{
|
||||
|
||||
@@ -167,7 +167,7 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data)
|
||||
int loc_idx = GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
CreatureLocale const *cl = objmgr.GetCreatureLocale(entry);
|
||||
CreatureLocale const *cl = sObjectMgr.GetCreatureLocale(entry);
|
||||
if (cl)
|
||||
{
|
||||
if (cl->Name.size() > size_t(loc_idx) && !cl->Name[loc_idx].empty())
|
||||
@@ -222,7 +222,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recv_data)
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
const GameObjectInfo *info = objmgr.GetGameObjectInfo(entryID);
|
||||
const GameObjectInfo *info = sObjectMgr.GetGameObjectInfo(entryID);
|
||||
if (info)
|
||||
{
|
||||
std::string Name;
|
||||
@@ -236,7 +236,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recv_data)
|
||||
int loc_idx = GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
GameObjectLocale const *gl = objmgr.GetGameObjectLocale(entryID);
|
||||
GameObjectLocale const *gl = sObjectMgr.GetGameObjectLocale(entryID);
|
||||
if (gl)
|
||||
{
|
||||
if (gl->Name.size() > size_t(loc_idx) && !gl->Name[loc_idx].empty())
|
||||
@@ -335,7 +335,7 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recv_data)
|
||||
recv_data >> guid;
|
||||
GetPlayer()->SetUInt64Value(UNIT_FIELD_TARGET, guid);
|
||||
|
||||
GossipText const* pGossip = objmgr.GetGossipText(textID);
|
||||
GossipText const* pGossip = sObjectMgr.GetGossipText(textID);
|
||||
|
||||
WorldPacket data(SMSG_NPC_TEXT_UPDATE, 100); // guess size
|
||||
data << textID;
|
||||
@@ -368,7 +368,7 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recv_data)
|
||||
int loc_idx = GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
NpcTextLocale const *nl = objmgr.GetNpcTextLocale(textID);
|
||||
NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textID);
|
||||
if (nl)
|
||||
{
|
||||
for (int i = 0; i < 8; ++i)
|
||||
@@ -439,7 +439,7 @@ void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recv_data)
|
||||
int loc_idx = GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
PageTextLocale const *pl = objmgr.GetPageTextLocale(pageID);
|
||||
PageTextLocale const *pl = sObjectMgr.GetPageTextLocale(pageID);
|
||||
if (pl)
|
||||
{
|
||||
if (pl->Text.size() > size_t(loc_idx) && !pl->Text[loc_idx].empty())
|
||||
@@ -497,7 +497,7 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data)
|
||||
|
||||
if (questOk)
|
||||
{
|
||||
QuestPOIVector const *POI = objmgr.GetQuestPOIVector(questId);
|
||||
QuestPOIVector const *POI = sObjectMgr.GetQuestPOIVector(questId);
|
||||
|
||||
if (POI)
|
||||
{
|
||||
|
||||
@@ -133,7 +133,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
Quest const* qInfo = objmgr.GetQuestTemplate(quest);
|
||||
Quest const* qInfo = sObjectMgr.GetQuestTemplate(quest);
|
||||
if (qInfo)
|
||||
{
|
||||
// prevent cheating
|
||||
@@ -243,7 +243,7 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
Quest const* pQuest = objmgr.GetQuestTemplate(quest);
|
||||
Quest const* pQuest = sObjectMgr.GetQuestTemplate(quest);
|
||||
if (pQuest)
|
||||
{
|
||||
if (pQuest->IsAutoAccept() && _player->CanAddQuest(pQuest, true))
|
||||
@@ -266,7 +266,7 @@ void WorldSession::HandleQuestQueryOpcode(WorldPacket & recv_data)
|
||||
recv_data >> 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)
|
||||
{
|
||||
_player->PlayerTalkClass->SendQuestQueryResponse(pQuest);
|
||||
@@ -297,7 +297,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data)
|
||||
if (!pObject->hasInvolvedQuest(quest))
|
||||
return;
|
||||
|
||||
Quest const *pQuest = objmgr.GetQuestTemplate(quest);
|
||||
Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest);
|
||||
if (pQuest)
|
||||
{
|
||||
if (_player->CanRewardQuest(pQuest, reward, true))
|
||||
@@ -350,7 +350,7 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recv_data)
|
||||
if (_player->GetQuestStatus(quest) != QUEST_STATUS_COMPLETE)
|
||||
return;
|
||||
|
||||
if (Quest const *pQuest = objmgr.GetQuestTemplate(quest))
|
||||
if (Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest))
|
||||
_player->PlayerTalkClass->SendQuestGiverOfferReward(pQuest, guid, true);
|
||||
}
|
||||
|
||||
@@ -388,7 +388,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data)
|
||||
if (!_player->TakeQuestSourceItem(quest, true))
|
||||
return; // can't un-equip some items, reject quest cancel
|
||||
|
||||
if (const Quest *pQuest = objmgr.GetQuestTemplate(quest))
|
||||
if (const Quest *pQuest = sObjectMgr.GetQuestTemplate(quest))
|
||||
{
|
||||
if (pQuest->HasFlag(QUEST_TRINITY_FLAGS_TIMED))
|
||||
_player->RemoveTimedQuest(quest);
|
||||
@@ -412,7 +412,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data)
|
||||
|
||||
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))
|
||||
return;
|
||||
@@ -451,7 +451,7 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recv_data)
|
||||
|
||||
sLog.outDebug("WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u",uint32(GUID_LOPART(guid)),quest);
|
||||
|
||||
Quest const *pQuest = objmgr.GetQuestTemplate(quest);
|
||||
Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest);
|
||||
if (pQuest)
|
||||
{
|
||||
// TODO: need a virtual function
|
||||
@@ -489,7 +489,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
|
||||
|
||||
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())
|
||||
{
|
||||
@@ -572,14 +572,14 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32
|
||||
{
|
||||
case TYPEID_GAMEOBJECT:
|
||||
{
|
||||
qir = &objmgr.mGOQuestInvolvedRelations;
|
||||
qr = &objmgr.mGOQuestRelations;
|
||||
qir = &sObjectMgr.mGOQuestInvolvedRelations;
|
||||
qr = &sObjectMgr.mGOQuestRelations;
|
||||
break;
|
||||
}
|
||||
case TYPEID_UNIT:
|
||||
{
|
||||
qir = &objmgr.mCreatureQuestInvolvedRelations;
|
||||
qr = &objmgr.mCreatureQuestRelations;
|
||||
qir = &sObjectMgr.mCreatureQuestInvolvedRelations;
|
||||
qr = &sObjectMgr.mCreatureQuestRelations;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -592,7 +592,7 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32
|
||||
{
|
||||
uint32 result2 = 0;
|
||||
uint32 quest_id = i->second;
|
||||
Quest const *pQuest = objmgr.GetQuestTemplate(quest_id);
|
||||
Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest_id);
|
||||
if (!pQuest) continue;
|
||||
|
||||
QuestStatus status = pPlayer->GetQuestStatus(quest_id);
|
||||
@@ -615,7 +615,7 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32
|
||||
{
|
||||
uint32 result2 = 0;
|
||||
uint32 quest_id = i->second;
|
||||
Quest const *pQuest = objmgr.GetQuestTemplate(quest_id);
|
||||
Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest_id);
|
||||
if (!pQuest)
|
||||
continue;
|
||||
|
||||
|
||||
@@ -358,7 +358,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
|
||||
// auto-selection buff level base at target level (in spellInfo)
|
||||
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 (actualSpellInfo)
|
||||
@@ -527,7 +527,7 @@ void WorldSession::HandleSpellClick(WorldPacket & recv_data)
|
||||
if (!unit->IsInWorld())
|
||||
return;
|
||||
|
||||
SpellClickInfoMapBounds clickPair = objmgr.GetSpellClickInfoMapBounds(unit->GetEntry());
|
||||
SpellClickInfoMapBounds clickPair = sObjectMgr.GetSpellClickInfoMapBounds(unit->GetEntry());
|
||||
for (SpellClickInfoMap::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr)
|
||||
{
|
||||
if (itr->second.IsFitToRequirements(_player, unit))
|
||||
|
||||
@@ -51,7 +51,7 @@ void WorldSession::SendTaxiStatus(uint64 guid)
|
||||
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
|
||||
if (curloc == 0)
|
||||
@@ -96,7 +96,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recv_data)
|
||||
void WorldSession::SendTaxiMenu(Creature* unit)
|
||||
{
|
||||
// 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)
|
||||
return;
|
||||
@@ -136,7 +136,7 @@ void WorldSession::SendDoFlight(uint32 mountDisplayId, uint32 path, uint32 pathN
|
||||
bool WorldSession::SendLearnNewTaxiNode(Creature* unit)
|
||||
{
|
||||
// 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)
|
||||
return true; // `true` send to avoid WorldSession::SendTaxiMenu call with one more curlock seartch with same false result.
|
||||
@@ -257,10 +257,10 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data)
|
||||
|
||||
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;
|
||||
objmgr.GetTaxiPath(sourcenode, destinationnode, path, cost);
|
||||
sObjectMgr.GetTaxiPath(sourcenode, destinationnode, path, cost);
|
||||
|
||||
if (path && mountDisplayId)
|
||||
SendDoFlight(mountDisplayId, path, 1); // skip start fly node
|
||||
|
||||
@@ -33,7 +33,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
if (GM_Ticket *ticket = objmgr.GetGMTicketByPlayer(GetPlayer()->GetGUID()))
|
||||
if (GM_Ticket *ticket = sObjectMgr.GetGMTicketByPlayer(GetPlayer()->GetGUID()))
|
||||
{
|
||||
WorldPacket data(SMSG_GMTICKET_CREATE, 4);
|
||||
data << uint32(1); // 1 - You already have GM ticket
|
||||
@@ -57,7 +57,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data)
|
||||
|
||||
GM_Ticket *ticket = new GM_Ticket;
|
||||
ticket->name = GetPlayer()->GetName();
|
||||
ticket->guid = objmgr.GenerateGMTicketId();
|
||||
ticket->guid = sObjectMgr.GenerateGMTicketId();
|
||||
ticket->playerGuid = GetPlayer()->GetGUID();
|
||||
ticket->message = ticketText;
|
||||
ticket->createtime = time(NULL);
|
||||
@@ -70,7 +70,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data)
|
||||
ticket->assignedToGM = 0;
|
||||
ticket->comment = "";
|
||||
|
||||
objmgr.AddOrUpdateGMTicket(*ticket, true);
|
||||
sObjectMgr.AddOrUpdateGMTicket(*ticket, true);
|
||||
|
||||
data << uint32(2);
|
||||
SendPacket(&data);
|
||||
@@ -86,7 +86,7 @@ void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket & recv_data)
|
||||
std::string message;
|
||||
recv_data >> message;
|
||||
|
||||
GM_Ticket *ticket = objmgr.GetGMTicketByPlayer(GetPlayer()->GetGUID());
|
||||
GM_Ticket *ticket = sObjectMgr.GetGMTicketByPlayer(GetPlayer()->GetGUID());
|
||||
if (!ticket)
|
||||
{
|
||||
data << uint32(1);
|
||||
@@ -97,7 +97,7 @@ void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket & recv_data)
|
||||
ticket->message = message;
|
||||
ticket->timestamp = time(NULL);
|
||||
|
||||
objmgr.AddOrUpdateGMTicket(*ticket);
|
||||
sObjectMgr.AddOrUpdateGMTicket(*ticket);
|
||||
|
||||
data << uint32(2);
|
||||
SendPacket(&data);
|
||||
@@ -108,7 +108,7 @@ void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::HandleGMTicketDeleteOpcode(WorldPacket & /*recv_data*/)
|
||||
{
|
||||
GM_Ticket* ticket = objmgr.GetGMTicketByPlayer(GetPlayer()->GetGUID());
|
||||
GM_Ticket* ticket = sObjectMgr.GetGMTicketByPlayer(GetPlayer()->GetGUID());
|
||||
|
||||
if (ticket)
|
||||
{
|
||||
@@ -117,7 +117,7 @@ void WorldSession::HandleGMTicketDeleteOpcode(WorldPacket & /*recv_data*/)
|
||||
SendPacket(&data);
|
||||
|
||||
sWorld.SendGMText(LANG_COMMAND_TICKETPLAYERABANDON, GetPlayer()->GetName(), ticket->guid);
|
||||
objmgr.RemoveGMTicket(ticket, GetPlayer()->GetGUID(), false);
|
||||
sObjectMgr.RemoveGMTicket(ticket, GetPlayer()->GetGUID(), false);
|
||||
SendGMTicketGetTicket(0x0A, 0);
|
||||
}
|
||||
}
|
||||
@@ -126,7 +126,7 @@ void WorldSession::HandleGMTicketGetTicketOpcode(WorldPacket & /*recv_data*/)
|
||||
{
|
||||
SendQueryTimeResponse();
|
||||
|
||||
GM_Ticket *ticket = objmgr.GetGMTicketByPlayer(GetPlayer()->GetGUID());
|
||||
GM_Ticket *ticket = sObjectMgr.GetGMTicketByPlayer(GetPlayer()->GetGUID());
|
||||
if (ticket)
|
||||
SendGMTicketGetTicket(0x06, ticket->message.c_str());
|
||||
else
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
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),
|
||||
_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), m_playerSave(false),
|
||||
m_latency(0), m_TutorialsChanged(false), m_timeOutTime(0)
|
||||
{
|
||||
@@ -407,7 +407,7 @@ void WorldSession::LogoutPlayer(bool Save)
|
||||
HandleMoveWorldportAckOpcode();
|
||||
|
||||
///- If the player is in a guild, update the guild roster and broadcast a logout message to other guild members
|
||||
Guild *guild = objmgr.GetGuildById(_player->GetGuildId());
|
||||
Guild *guild = sObjectMgr.GetGuildById(_player->GetGuildId());
|
||||
if (guild)
|
||||
{
|
||||
guild->SetMemberStats(_player->GetGUID());
|
||||
@@ -527,7 +527,7 @@ void WorldSession::SendNotification(int32 string_id,...)
|
||||
|
||||
const char * WorldSession::GetTrinityString(int32 entry) const
|
||||
{
|
||||
return objmgr.GetTrinityString(entry,GetSessionDbLocaleIndex());
|
||||
return sObjectMgr.GetTrinityString(entry,GetSessionDbLocaleIndex());
|
||||
}
|
||||
|
||||
void WorldSession::Handle_NULL(WorldPacket& recvPacket)
|
||||
|
||||
@@ -117,7 +117,7 @@ void LoadSkillDiscoveryTable()
|
||||
}
|
||||
else if (reqSkillOrSpell == 0) // skill case
|
||||
{
|
||||
SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(spellId);
|
||||
SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spellId);
|
||||
|
||||
if (bounds.first == bounds.second)
|
||||
{
|
||||
@@ -166,7 +166,7 @@ uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player)
|
||||
if (tab == SkillDiscoveryStore.end())
|
||||
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;
|
||||
|
||||
float full_chance = 0;
|
||||
|
||||
@@ -616,7 +616,7 @@ int32 AuraEffect::CalculateAmount(Unit * caster)
|
||||
amount+=caster->ApplyEffectModifiers(m_spellProto,m_effIndex,int32(((mwb_min+mwb_max)/2+ap*mws/14000)*0.2f));
|
||||
// "If used while your target is above 75% health, Rend does 35% more damage."
|
||||
// as for 3.1.3 only ranks above 9 (wrong tooltip?)
|
||||
if (spellmgr.GetSpellRank(m_spellProto->Id) >= 9)
|
||||
if (sSpellMgr.GetSpellRank(m_spellProto->Id) >= 9)
|
||||
{
|
||||
if (GetBase()->GetUnitOwner()->HasAuraState(AURA_STATE_HEALTH_ABOVE_75_PERCENT, m_spellProto, caster))
|
||||
amount += int32(amount * SpellMgr::CalculateSpellEffectAmount(m_spellProto, 2, caster) / 100.0f);
|
||||
@@ -968,7 +968,7 @@ void AuraEffect::ApplySpellMod(Unit * target, bool apply)
|
||||
Aura * aura = iter->second->GetBase();
|
||||
// only passive auras-active auras should have amount set on spellcast and not be affected
|
||||
// if aura is casted by others, it will not be affected
|
||||
if (aura->IsPassive() && aura->GetCasterGUID() == guid && spellmgr.IsAffectedByMod(aura->GetSpellProto(), m_spellmod))
|
||||
if (aura->IsPassive() && aura->GetCasterGUID() == guid && sSpellMgr.IsAffectedByMod(aura->GetSpellProto(), m_spellmod))
|
||||
{
|
||||
if (GetMiscValue() == SPELLMOD_ALL_EFFECTS)
|
||||
{
|
||||
@@ -3092,7 +3092,7 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode,
|
||||
}
|
||||
else
|
||||
{
|
||||
CreatureInfo const * ci = objmgr.GetCreatureTemplate(GetMiscValue());
|
||||
CreatureInfo const * ci = sObjectMgr.GetCreatureTemplate(GetMiscValue());
|
||||
if (!ci)
|
||||
{
|
||||
target->SetDisplayId(16358); // pig pink ^_^
|
||||
@@ -3166,14 +3166,14 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode,
|
||||
if (!target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).empty())
|
||||
{
|
||||
uint32 cr_id = target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).front()->GetMiscValue();
|
||||
if (CreatureInfo const* ci = objmgr.GetCreatureTemplate(cr_id))
|
||||
if (CreatureInfo const* ci = sObjectMgr.GetCreatureTemplate(cr_id))
|
||||
{
|
||||
uint32 team = 0;
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
team = target->ToPlayer()->GetTeam();
|
||||
|
||||
uint32 display_id = objmgr.ChooseDisplayId(team,ci);
|
||||
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
|
||||
uint32 display_id = sObjectMgr.ChooseDisplayId(team,ci);
|
||||
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
|
||||
if (minfo)
|
||||
display_id = minfo->modelid;
|
||||
|
||||
@@ -3599,7 +3599,7 @@ void AuraEffect::HandleAuraMounted(AuraApplication const * aurApp, uint8 mode, b
|
||||
|
||||
if (apply)
|
||||
{
|
||||
CreatureInfo const* ci = objmgr.GetCreatureTemplate(GetMiscValue());
|
||||
CreatureInfo const* ci = sObjectMgr.GetCreatureTemplate(GetMiscValue());
|
||||
if (!ci)
|
||||
{
|
||||
sLog.outErrorDb("AuraMounted: `creature_template`='%u' not found in database (only need it modelid)",GetMiscValue());
|
||||
@@ -3610,8 +3610,8 @@ void AuraEffect::HandleAuraMounted(AuraApplication const * aurApp, uint8 mode, b
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
team = target->ToPlayer()->GetTeam();
|
||||
|
||||
uint32 display_id = objmgr.ChooseDisplayId(team,ci);
|
||||
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
|
||||
uint32 display_id = sObjectMgr.ChooseDisplayId(team,ci);
|
||||
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
|
||||
if (minfo)
|
||||
display_id = minfo->modelid;
|
||||
|
||||
@@ -6039,7 +6039,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo
|
||||
if (mode & AURA_EFFECT_HANDLE_REAL)
|
||||
{
|
||||
// pet auras
|
||||
if (PetAura const* petSpell = spellmgr.GetPetAura(GetId(), m_effIndex))
|
||||
if (PetAura const* petSpell = sSpellMgr.GetPetAura(GetId(), m_effIndex))
|
||||
{
|
||||
if (apply)
|
||||
target->AddPetAura(petSpell);
|
||||
@@ -6171,7 +6171,7 @@ void AuraEffect::HandleAuraEmpathy(AuraApplication const * aurApp, uint8 mode, b
|
||||
return;
|
||||
}
|
||||
|
||||
CreatureInfo const * ci = objmgr.GetCreatureTemplate(target->GetEntry());
|
||||
CreatureInfo const * ci = sObjectMgr.GetCreatureTemplate(target->GetEntry());
|
||||
if (ci && ci->type == CREATURE_TYPE_BEAST)
|
||||
target->ApplyModUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_SPECIALINFO, apply);
|
||||
}
|
||||
|
||||
@@ -506,7 +506,7 @@ void Aura::UpdateTargetMap(Unit * caster, bool apply)
|
||||
for (Unit::AuraApplicationMap::iterator iter = itr->first->GetAppliedAuras().begin(); iter != itr->first->GetAppliedAuras().end(); ++iter)
|
||||
{
|
||||
Aura const * aura = iter->second->GetBase();
|
||||
if (!spellmgr.CanAurasStack(GetSpellProto(), aura->GetSpellProto(), aura->GetCasterGUID() == GetCasterGUID()))
|
||||
if (!sSpellMgr.CanAurasStack(GetSpellProto(), aura->GetSpellProto(), aura->GetCasterGUID() == GetCasterGUID()))
|
||||
{
|
||||
addUnit = false;
|
||||
break;
|
||||
@@ -844,7 +844,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster,
|
||||
Unit * target = aurApp->GetTarget();
|
||||
AuraRemoveMode removeMode = aurApp->GetRemoveMode();
|
||||
// spell_area table
|
||||
SpellAreaForAreaMapBounds saBounds = spellmgr.GetSpellAreaForAuraMapBounds(GetId());
|
||||
SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAuraMapBounds(GetId());
|
||||
if (saBounds.first != saBounds.second)
|
||||
{
|
||||
uint32 zone, area;
|
||||
@@ -867,9 +867,9 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster,
|
||||
if (apply)
|
||||
{
|
||||
// Apply linked auras (On first aura apply)
|
||||
if (spellmgr.GetSpellCustomAttr(GetId()) & SPELL_ATTR_CU_LINK_AURA)
|
||||
if (sSpellMgr.GetSpellCustomAttr(GetId()) & SPELL_ATTR_CU_LINK_AURA)
|
||||
{
|
||||
if (const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(GetId() + SPELL_LINK_AURA))
|
||||
if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(GetId() + SPELL_LINK_AURA))
|
||||
for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
|
||||
{
|
||||
if (*itr < 0)
|
||||
@@ -1057,11 +1057,11 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster,
|
||||
// Remove Linked Auras
|
||||
if (removeMode != AURA_REMOVE_BY_STACK && removeMode != AURA_REMOVE_BY_DEATH)
|
||||
{
|
||||
if (uint32 customAttr = spellmgr.GetSpellCustomAttr(GetId()))
|
||||
if (uint32 customAttr = sSpellMgr.GetSpellCustomAttr(GetId()))
|
||||
{
|
||||
if (customAttr & SPELL_ATTR_CU_LINK_REMOVE)
|
||||
{
|
||||
if (const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(-(int32)GetId()))
|
||||
if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(-(int32)GetId()))
|
||||
for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
|
||||
{
|
||||
if (*itr < 0)
|
||||
@@ -1072,7 +1072,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster,
|
||||
}
|
||||
if (customAttr & SPELL_ATTR_CU_LINK_AURA)
|
||||
{
|
||||
if (const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(GetId() + SPELL_LINK_AURA))
|
||||
if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(GetId() + SPELL_LINK_AURA))
|
||||
for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
|
||||
{
|
||||
if (*itr < 0)
|
||||
|
||||
@@ -334,10 +334,10 @@ void SpellCastTargets::write (WorldPacket * data)
|
||||
}
|
||||
|
||||
Spell::Spell(Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID, Spell** triggeringContainer, bool skipCheck)
|
||||
: m_spellInfo(spellmgr.GetSpellForDifficultyFromSpell(info, Caster)), m_spellValue(new SpellValue(m_spellInfo))
|
||||
: m_spellInfo(sSpellMgr.GetSpellForDifficultyFromSpell(info, Caster)), m_spellValue(new SpellValue(m_spellInfo))
|
||||
, m_caster(Caster)
|
||||
{
|
||||
m_customAttr = spellmgr.GetSpellCustomAttr(m_spellInfo->Id);
|
||||
m_customAttr = sSpellMgr.GetSpellCustomAttr(m_spellInfo->Id);
|
||||
m_skipCheck = skipCheck;
|
||||
m_selfContainer = NULL;
|
||||
m_triggeringContainer = triggeringContainer;
|
||||
@@ -619,7 +619,7 @@ void Spell::SelectSpellTargets()
|
||||
case SPELL_EFFECT_SUMMON_PLAYER:
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->GetSelection())
|
||||
{
|
||||
Player* target = objmgr.GetPlayer(m_caster->ToPlayer()->GetSelection());
|
||||
Player* target = sObjectMgr.GetPlayer(m_caster->ToPlayer()->GetSelection());
|
||||
if (target)
|
||||
AddUnitTarget(target, i);
|
||||
}
|
||||
@@ -899,7 +899,7 @@ void Spell::AddUnitTarget(Unit* pVictim, uint32 effIndex)
|
||||
ihit->scaleAura = false;
|
||||
if (m_auraScaleMask && ihit->effectMask == m_auraScaleMask && m_caster != pVictim)
|
||||
{
|
||||
SpellEntry const * auraSpell = sSpellStore.LookupEntry(spellmgr.GetFirstSpellInChain(m_spellInfo->Id));
|
||||
SpellEntry const * auraSpell = sSpellStore.LookupEntry(sSpellMgr.GetFirstSpellInChain(m_spellInfo->Id));
|
||||
if ((pVictim->getLevel() + 10) >= auraSpell->spellLevel)
|
||||
ihit->scaleAura = true;
|
||||
}
|
||||
@@ -920,7 +920,7 @@ void Spell::AddUnitTarget(Unit* pVictim, uint32 effIndex)
|
||||
target.scaleAura = false;
|
||||
if (m_auraScaleMask && target.effectMask == m_auraScaleMask && m_caster != pVictim)
|
||||
{
|
||||
SpellEntry const * auraSpell = sSpellStore.LookupEntry(spellmgr.GetFirstSpellInChain(m_spellInfo->Id));
|
||||
SpellEntry const * auraSpell = sSpellStore.LookupEntry(sSpellMgr.GetFirstSpellInChain(m_spellInfo->Id));
|
||||
if ((pVictim->getLevel() + 10) >= auraSpell->spellLevel)
|
||||
target.scaleAura = true;
|
||||
}
|
||||
@@ -1406,7 +1406,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool
|
||||
int32 basePoints[3];
|
||||
if (scaleAura)
|
||||
{
|
||||
aurSpellInfo = spellmgr.SelectAuraRankForPlayerLevel(m_spellInfo,unitTarget->getLevel());
|
||||
aurSpellInfo = sSpellMgr.SelectAuraRankForPlayerLevel(m_spellInfo,unitTarget->getLevel());
|
||||
ASSERT (aurSpellInfo);
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
@@ -1528,7 +1528,7 @@ void Spell::DoTriggersOnSpellHit(Unit *unit)
|
||||
|
||||
if (m_customAttr & SPELL_ATTR_CU_LINK_HIT)
|
||||
{
|
||||
if (const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(m_spellInfo->Id + SPELL_LINK_HIT))
|
||||
if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(m_spellInfo->Id + SPELL_LINK_HIT))
|
||||
for (std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i)
|
||||
if (*i < 0)
|
||||
unit->RemoveAurasDueToSpell(-(*i));
|
||||
@@ -2196,7 +2196,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
|
||||
switch(cur)
|
||||
{
|
||||
case TARGET_DST_DB:
|
||||
if (SpellTargetPosition const* st = spellmgr.GetSpellTargetPosition(m_spellInfo->Id))
|
||||
if (SpellTargetPosition const* st = sSpellMgr.GetSpellTargetPosition(m_spellInfo->Id))
|
||||
{
|
||||
//TODO: fix this check
|
||||
if (m_spellInfo->Effect[0] == SPELL_EFFECT_TELEPORT_UNITS
|
||||
@@ -3198,7 +3198,7 @@ void Spell::cast(bool skipCheck)
|
||||
|
||||
if (m_customAttr & SPELL_ATTR_CU_LINK_CAST)
|
||||
{
|
||||
if (const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(m_spellInfo->Id))
|
||||
if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(m_spellInfo->Id))
|
||||
for (std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i)
|
||||
if (*i < 0)
|
||||
m_caster->RemoveAurasDueToSpell(-(*i));
|
||||
@@ -3714,7 +3714,7 @@ void Spell::SendCastResult(Player* caster, SpellEntry const* spellInfo, uint8 ca
|
||||
for (int8 x=0;x < 3;x++)
|
||||
if (spellInfo->EffectItemType[x])
|
||||
item = spellInfo->EffectItemType[x];
|
||||
ItemPrototype const *pProto = objmgr.GetItemPrototype(item);
|
||||
ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(item);
|
||||
if (pProto && pProto->ItemLimitCategory)
|
||||
data << uint32(pProto->ItemLimitCategory);
|
||||
break;
|
||||
@@ -3894,7 +3894,7 @@ void Spell::WriteAmmoToPacket(WorldPacket * data)
|
||||
uint32 ammoID = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID);
|
||||
if (ammoID)
|
||||
{
|
||||
ItemPrototype const *pProto = objmgr.GetItemPrototype(ammoID);
|
||||
ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(ammoID);
|
||||
if (pProto)
|
||||
{
|
||||
ammoDisplayID = pProto->DisplayInfoID;
|
||||
@@ -4541,14 +4541,14 @@ void Spell::HandleThreatSpells(uint32 spellId)
|
||||
if (!m_targets.getUnitTarget()->CanHaveThreatList())
|
||||
return;
|
||||
|
||||
uint16 threat = spellmgr.GetSpellThreat(spellId);
|
||||
uint16 threat = sSpellMgr.GetSpellThreat(spellId);
|
||||
|
||||
if (!threat)
|
||||
return;
|
||||
|
||||
m_targets.getUnitTarget()->AddThreat(m_caster, float(threat));
|
||||
|
||||
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)
|
||||
@@ -4719,7 +4719,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (!m_IsTriggeredSpell && target == m_caster && m_spellInfo->AttributesEx & SPELL_ATTR_EX_CANT_TARGET_SELF)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
bool non_caster_target = target != m_caster && !spellmgr.IsSpellWithCasterSourceTargetsOnly(m_spellInfo);
|
||||
bool non_caster_target = target != m_caster && !sSpellMgr.IsSpellWithCasterSourceTargetsOnly(m_spellInfo);
|
||||
|
||||
if (non_caster_target)
|
||||
{
|
||||
@@ -4894,7 +4894,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
uint32 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->GetTypeId() == TYPEID_PLAYER ? m_caster->ToPlayer() : NULL);
|
||||
if (locRes != SPELL_CAST_OK)
|
||||
return locRes;
|
||||
@@ -4928,8 +4928,8 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
m_spellInfo->EffectImplicitTargetA[j] == TARGET_DST_NEARBY_ENTRY ||
|
||||
m_spellInfo->EffectImplicitTargetB[j] == TARGET_DST_NEARBY_ENTRY)
|
||||
{
|
||||
SpellScriptTarget::const_iterator lower = spellmgr.GetBeginSpellScriptTarget(m_spellInfo->Id);
|
||||
SpellScriptTarget::const_iterator upper = spellmgr.GetEndSpellScriptTarget(m_spellInfo->Id);
|
||||
SpellScriptTarget::const_iterator lower = sSpellMgr.GetBeginSpellScriptTarget(m_spellInfo->Id);
|
||||
SpellScriptTarget::const_iterator upper = sSpellMgr.GetEndSpellScriptTarget(m_spellInfo->Id);
|
||||
if (lower == upper)
|
||||
sLog.outErrorDb("Spell (ID: %u) has effect EffectImplicitTargetA/EffectImplicitTargetB = TARGET_UNIT_NEARBY_ENTRY or TARGET_DST_NEARBY_ENTRY, but does not have record in `spell_script_target`",m_spellInfo->Id);
|
||||
|
||||
@@ -5377,7 +5377,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (!m_caster->ToPlayer()->GetSelection())
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
Player* target = objmgr.GetPlayer(m_caster->ToPlayer()->GetSelection());
|
||||
Player* target = sObjectMgr.GetPlayer(m_caster->ToPlayer()->GetSelection());
|
||||
if (!target || m_caster->ToPlayer() == target || !target->IsInSameRaidWith(m_caster->ToPlayer()))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
@@ -5388,7 +5388,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
InstanceTemplate const* instance = ObjectMgr::GetInstanceTemplate(pMap->GetId());
|
||||
if (!instance)
|
||||
return SPELL_FAILED_TARGET_NOT_IN_INSTANCE;
|
||||
if (!target->Satisfy(objmgr.GetAccessRequirement(pMap->GetId(), pMap->GetDifficulty()), pMap->GetId()))
|
||||
if (!target->Satisfy(sObjectMgr.GetAccessRequirement(pMap->GetId(), pMap->GetDifficulty()), pMap->GetId()))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
break;
|
||||
@@ -5548,7 +5548,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
|
||||
// Ignore map check if spell have AreaId. AreaId already checked and this prevent special mount spells
|
||||
bool AllowMount = !m_caster->GetMap()->IsDungeon() || m_caster->GetMap()->IsBattlegroundOrArena();
|
||||
InstanceTemplate const *it = objmgr.GetInstanceTemplate(m_caster->GetMapId());
|
||||
InstanceTemplate const *it = sObjectMgr.GetInstanceTemplate(m_caster->GetMapId());
|
||||
if (it)
|
||||
AllowMount = it->allowMount;
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && !AllowMount && !m_IsTriggeredSpell && !m_spellInfo->AreaGroupId)
|
||||
@@ -6112,7 +6112,7 @@ SpellCastResult Spell::CheckItems()
|
||||
uint8 msg = p_caster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, m_spellInfo->EffectItemType[i], 1);
|
||||
if (msg != EQUIP_ERR_OK)
|
||||
{
|
||||
ItemPrototype const *pProto = objmgr.GetItemPrototype(m_spellInfo->EffectItemType[i]);
|
||||
ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(m_spellInfo->EffectItemType[i]);
|
||||
// TODO: Needs review
|
||||
if (pProto && !(pProto->ItemLimitCategory))
|
||||
{
|
||||
@@ -6297,7 +6297,7 @@ SpellCastResult Spell::CheckItems()
|
||||
return SPELL_FAILED_NO_AMMO;
|
||||
}
|
||||
|
||||
ItemPrototype const *ammoProto = objmgr.GetItemPrototype(ammo);
|
||||
ItemPrototype const *ammoProto = sObjectMgr.GetItemPrototype(ammo);
|
||||
if (!ammoProto)
|
||||
return SPELL_FAILED_NO_AMMO;
|
||||
|
||||
@@ -6333,7 +6333,7 @@ SpellCastResult Spell::CheckItems()
|
||||
case SPELL_EFFECT_CREATE_MANA_GEM:
|
||||
{
|
||||
uint32 item_id = m_spellInfo->EffectItemType[i];
|
||||
ItemPrototype const *pProto = objmgr.GetItemPrototype(item_id);
|
||||
ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(item_id);
|
||||
|
||||
if (!pProto)
|
||||
return SPELL_FAILED_ITEM_AT_MAX_CHARGES;
|
||||
|
||||
@@ -1890,7 +1890,7 @@ void Spell::EffectDummy(uint32 i)
|
||||
}
|
||||
|
||||
// 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);
|
||||
return;
|
||||
@@ -2782,7 +2782,7 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype)
|
||||
Player* player = (Player*)unitTarget;
|
||||
|
||||
uint32 newitemid = itemtype;
|
||||
ItemPrototype const *pProto = objmgr.GetItemPrototype(newitemid);
|
||||
ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(newitemid);
|
||||
if (!pProto)
|
||||
{
|
||||
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
|
||||
@@ -2944,7 +2944,7 @@ void Spell::EffectPersistentAA(uint32 i)
|
||||
if (!caster->IsInWorld())
|
||||
return;
|
||||
DynamicObject* dynObj = new DynamicObject;
|
||||
if (!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo->Id, m_targets.m_dstPos, radius, false))
|
||||
if (!dynObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo->Id, m_targets.m_dstPos, radius, false))
|
||||
{
|
||||
delete dynObj;
|
||||
return;
|
||||
@@ -3028,10 +3028,10 @@ void Spell::EffectEnergize(uint32 i)
|
||||
{
|
||||
uint32 spell_id = itr->second->GetBase()->GetId();
|
||||
if (!guardianFound)
|
||||
if (spellmgr.IsSpellMemberOfSpellGroup(spell_id, SPELL_GROUP_ELIXIR_GUARDIAN))
|
||||
if (sSpellMgr.IsSpellMemberOfSpellGroup(spell_id, SPELL_GROUP_ELIXIR_GUARDIAN))
|
||||
guardianFound = true;
|
||||
if (!battleFound)
|
||||
if (spellmgr.IsSpellMemberOfSpellGroup(spell_id, SPELL_GROUP_ELIXIR_BATTLE))
|
||||
if (sSpellMgr.IsSpellMemberOfSpellGroup(spell_id, SPELL_GROUP_ELIXIR_BATTLE))
|
||||
battleFound = true;
|
||||
if (battleFound && guardianFound)
|
||||
break;
|
||||
@@ -3040,17 +3040,17 @@ void Spell::EffectEnergize(uint32 i)
|
||||
// get all available elixirs by mask and spell level
|
||||
std::set<uint32> avalibleElixirs;
|
||||
if (!guardianFound)
|
||||
spellmgr.GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_GUARDIAN, avalibleElixirs);
|
||||
sSpellMgr.GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_GUARDIAN, avalibleElixirs);
|
||||
if (!battleFound)
|
||||
spellmgr.GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_BATTLE, avalibleElixirs);
|
||||
sSpellMgr.GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_BATTLE, avalibleElixirs);
|
||||
for (std::set<uint32>::iterator itr = avalibleElixirs.begin(); itr != avalibleElixirs.end() ;)
|
||||
{
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(*itr);
|
||||
if (spellInfo->spellLevel < m_spellInfo->spellLevel || spellInfo->spellLevel > unitTarget->getLevel())
|
||||
avalibleElixirs.erase(itr++);
|
||||
else if (spellmgr.IsSpellMemberOfSpellGroup(*itr, SPELL_GROUP_ELIXIR_SHATTRATH))
|
||||
else if (sSpellMgr.IsSpellMemberOfSpellGroup(*itr, SPELL_GROUP_ELIXIR_SHATTRATH))
|
||||
avalibleElixirs.erase(itr++);
|
||||
else if (spellmgr.IsSpellMemberOfSpellGroup(*itr, SPELL_GROUP_ELIXIR_UNSTABLE))
|
||||
else if (sSpellMgr.IsSpellMemberOfSpellGroup(*itr, SPELL_GROUP_ELIXIR_UNSTABLE))
|
||||
avalibleElixirs.erase(itr++);
|
||||
else
|
||||
++itr;
|
||||
@@ -3750,7 +3750,7 @@ void Spell::EffectAddFarsight(uint32 i)
|
||||
if (!m_caster->IsInWorld())
|
||||
return;
|
||||
DynamicObject* dynObj = new DynamicObject;
|
||||
if (!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, m_targets.m_dstPos, radius, true))
|
||||
if (!dynObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, m_targets.m_dstPos, radius, true))
|
||||
{
|
||||
delete dynObj;
|
||||
return;
|
||||
@@ -4203,7 +4203,7 @@ void Spell::EffectSummonPet(uint32 i)
|
||||
pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
|
||||
|
||||
// generate new name for summon pet
|
||||
std::string new_name=objmgr.GeneratePetName(petentry);
|
||||
std::string new_name=sObjectMgr.GeneratePetName(petentry);
|
||||
if (!new_name.empty())
|
||||
pet->SetName(new_name);
|
||||
}
|
||||
@@ -4639,7 +4639,7 @@ void Spell::EffectSummonObjectWild(uint32 i)
|
||||
|
||||
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))
|
||||
{
|
||||
delete pGameObj;
|
||||
@@ -4688,7 +4688,7 @@ void Spell::EffectSummonObjectWild(uint32 i)
|
||||
if (uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry())
|
||||
{
|
||||
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))
|
||||
{
|
||||
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
|
||||
@@ -5727,7 +5727,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
||||
{
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT || !unitTarget->ToCreature()->isPet())
|
||||
return;
|
||||
CreatureInfo const * ci = objmgr.GetCreatureTemplate(unitTarget->GetEntry());
|
||||
CreatureInfo const * ci = sObjectMgr.GetCreatureTemplate(unitTarget->GetEntry());
|
||||
switch (ci->family)
|
||||
{
|
||||
case CREATURE_FAMILY_SUCCUBUS:
|
||||
@@ -6105,7 +6105,7 @@ void Spell::EffectDuel(uint32 i)
|
||||
uint32 gameobject_id = m_spellInfo->EffectMiscValue[i];
|
||||
|
||||
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(),
|
||||
m_caster->GetPositionX()+(unitTarget->GetPositionX()-m_caster->GetPositionX())/2 ,
|
||||
m_caster->GetPositionY()+(unitTarget->GetPositionY()-m_caster->GetPositionY())/2 ,
|
||||
@@ -6416,7 +6416,7 @@ void Spell::EffectSummonObject(uint32 i)
|
||||
m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE);
|
||||
|
||||
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))
|
||||
{
|
||||
delete pGameObj;
|
||||
@@ -6550,7 +6550,7 @@ void Spell::EffectReputation(uint32 i)
|
||||
if (!factionEntry)
|
||||
return;
|
||||
|
||||
if (RepRewardRate const * repData = objmgr.GetRepRewardRate(faction_id))
|
||||
if (RepRewardRate const * repData = sObjectMgr.GetRepRewardRate(faction_id))
|
||||
{
|
||||
rep_change = (float)rep_change * repData->spell_rate;
|
||||
}
|
||||
@@ -6748,7 +6748,7 @@ void Spell::EffectQuestClear(uint32 i)
|
||||
|
||||
uint32 quest_id = m_spellInfo->EffectMiscValue[i];
|
||||
|
||||
Quest const* pQuest = objmgr.GetQuestTemplate(quest_id);
|
||||
Quest const* pQuest = sObjectMgr.GetQuestTemplate(quest_id);
|
||||
|
||||
if (!pQuest)
|
||||
return;
|
||||
@@ -6940,7 +6940,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
||||
{
|
||||
uint32 name_id = m_spellInfo->EffectMiscValue[effIndex];
|
||||
|
||||
GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(name_id);
|
||||
GameObjectInfo const* goinfo = sObjectMgr.GetGameObjectInfo(name_id);
|
||||
|
||||
if (!goinfo)
|
||||
{
|
||||
@@ -6991,7 +6991,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
||||
|
||||
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))
|
||||
{
|
||||
delete pGameObj;
|
||||
@@ -7055,7 +7055,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
||||
if (uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry())
|
||||
{
|
||||
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))
|
||||
{
|
||||
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
|
||||
@@ -7294,7 +7294,7 @@ void Spell::EffectQuestStart(uint32 i)
|
||||
return;
|
||||
|
||||
Player * player = unitTarget->ToPlayer();
|
||||
if (Quest const* qInfo = objmgr.GetQuestTemplate(m_spellInfo->EffectMiscValue[i]))
|
||||
if (Quest const* qInfo = sObjectMgr.GetQuestTemplate(m_spellInfo->EffectMiscValue[i]))
|
||||
{
|
||||
if (player->CanTakeQuest(qInfo, false) && player->CanAddQuest(qInfo, false))
|
||||
{
|
||||
@@ -7638,7 +7638,7 @@ void Spell::EffectRechargeManaGem(uint32 /*i*/)
|
||||
|
||||
uint32 item_id = m_spellInfo->EffectItemType[0];
|
||||
|
||||
ItemPrototype const *pProto = objmgr.GetItemPrototype(item_id);
|
||||
ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(item_id);
|
||||
if (!pProto)
|
||||
{
|
||||
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
|
||||
@@ -7664,7 +7664,7 @@ void Spell::EffectBind(uint32 i)
|
||||
WorldLocation loc;
|
||||
if (m_spellInfo->EffectImplicitTargetA[i] == TARGET_DST_DB || m_spellInfo->EffectImplicitTargetB[i] == TARGET_DST_DB)
|
||||
{
|
||||
SpellTargetPosition const* st = spellmgr.GetSpellTargetPosition(m_spellInfo->Id);
|
||||
SpellTargetPosition const* st = sSpellMgr.GetSpellTargetPosition(m_spellInfo->Id);
|
||||
if (!st)
|
||||
{
|
||||
sLog.outError( "Spell::EffectBind - unknown teleport coordinates for spell ID %u", m_spellInfo->Id );
|
||||
|
||||
@@ -364,7 +364,7 @@ bool IsAutocastableSpell(uint32 spellId)
|
||||
|
||||
bool IsHigherHankOfSpell(uint32 spellId_1, uint32 spellId_2)
|
||||
{
|
||||
return spellmgr.GetSpellRank(spellId_1)<spellmgr.GetSpellRank(spellId_2);
|
||||
return sSpellMgr.GetSpellRank(spellId_1)<sSpellMgr.GetSpellRank(spellId_2);
|
||||
}
|
||||
|
||||
uint32 CalculatePowerCost(SpellEntry const * spellInfo, Unit const * caster, SpellSchoolMask schoolMask)
|
||||
@@ -540,7 +540,7 @@ SpellSpecific GetSpellSpecific(SpellEntry const * spellInfo)
|
||||
// scrolls effects
|
||||
else
|
||||
{
|
||||
uint32 firstSpell = spellmgr.GetFirstSpellInChain(spellInfo->Id);
|
||||
uint32 firstSpell = sSpellMgr.GetFirstSpellInChain(spellInfo->Id);
|
||||
switch (firstSpell)
|
||||
{
|
||||
case 8118: // Strength
|
||||
@@ -981,7 +981,7 @@ bool IsPositiveSpell(uint32 spellId)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(spellId)) // non-existing spells
|
||||
return false;
|
||||
return !(spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE);
|
||||
return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE);
|
||||
}
|
||||
|
||||
bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
|
||||
@@ -991,9 +991,9 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
|
||||
switch(effIndex)
|
||||
{
|
||||
default:
|
||||
case 0: return !(spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF0);
|
||||
case 1: return !(spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF1);
|
||||
case 2: return !(spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF2);
|
||||
case 0: return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF0);
|
||||
case 1: return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF1);
|
||||
case 2: return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1225,7 +1225,7 @@ void SpellMgr::LoadSpellTargetPositions()
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
// if (!spellmgr.GetSpellTargetPosition(i))
|
||||
// if (!sSpellMgr.GetSpellTargetPosition(i))
|
||||
// sLog.outDebug("Spell (ID: %u) does not have record in `spell_target_position`", i);
|
||||
}
|
||||
}
|
||||
@@ -1701,7 +1701,7 @@ bool SpellMgr::canStackSpellRanks(SpellEntry const *spellInfo)
|
||||
if (IsProfessionOrRidingSpell(spellInfo->Id))
|
||||
return false;
|
||||
|
||||
if (spellmgr.IsSkillBonusSpell(spellInfo->Id))
|
||||
if (sSpellMgr.IsSkillBonusSpell(spellInfo->Id))
|
||||
return false;
|
||||
|
||||
// All stance spells. if any better way, change it.
|
||||
@@ -2229,7 +2229,7 @@ bool LoadPetDefaultSpells_helper(CreatureInfo const* cInfo, PetDefaultSpellsEntr
|
||||
return false;
|
||||
|
||||
// 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 (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
{
|
||||
@@ -2527,7 +2527,7 @@ void SpellMgr::LoadSpellAreas()
|
||||
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);
|
||||
continue;
|
||||
@@ -2535,7 +2535,7 @@ void SpellMgr::LoadSpellAreas()
|
||||
|
||||
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);
|
||||
continue;
|
||||
@@ -2683,7 +2683,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
|
||||
}
|
||||
|
||||
// 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)
|
||||
{
|
||||
for (SpellAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
|
||||
|
||||
@@ -1420,5 +1420,5 @@ class SpellMgr
|
||||
SpellDifficultySearcherMap mSpellDifficultySearcherMap;
|
||||
};
|
||||
|
||||
#define spellmgr SpellMgr::Instance()
|
||||
#define sSpellMgr SpellMgr::Instance()
|
||||
#endif
|
||||
|
||||
@@ -384,7 +384,7 @@ void fixNULLfields(std::string &line)
|
||||
|
||||
DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, std::string name, uint32 guid)
|
||||
{
|
||||
uint32 charcount = accmgr.GetCharactersCount(account);
|
||||
uint32 charcount = sAccountMgr.GetCharactersCount(account);
|
||||
if (charcount >= 10)
|
||||
return DUMP_TOO_MANY_CHARS;
|
||||
|
||||
@@ -397,15 +397,15 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
||||
|
||||
// make sure the same guid doesn't already exist and is safe to use
|
||||
bool incHighest = true;
|
||||
if (guid != 0 && guid < objmgr.m_hiCharGuid)
|
||||
if (guid != 0 && guid < sObjectMgr.m_hiCharGuid)
|
||||
{
|
||||
result = CharacterDatabase.PQuery("SELECT 1 FROM characters WHERE guid = '%d'", guid);
|
||||
if (result)
|
||||
guid = objmgr.m_hiCharGuid; // use first free if exists
|
||||
guid = sObjectMgr.m_hiCharGuid; // use first free if exists
|
||||
else incHighest = false;
|
||||
}
|
||||
else
|
||||
guid = objmgr.m_hiCharGuid;
|
||||
guid = sObjectMgr.m_hiCharGuid;
|
||||
|
||||
// normalize the name if specified and check if it exists
|
||||
if (!normalizePlayerName(name))
|
||||
@@ -425,7 +425,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
||||
|
||||
snprintf(newguid, 20, "%d", guid);
|
||||
snprintf(chraccount, 20, "%d", account);
|
||||
snprintf(newpetid, 20, "%d", objmgr.GeneratePetNumber());
|
||||
snprintf(newpetid, 20, "%d", sObjectMgr.GeneratePetNumber());
|
||||
snprintf(lastpetid, 20, "%s", "");
|
||||
|
||||
std::map<uint32,uint32> items;
|
||||
@@ -540,16 +540,16 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
||||
if (!changenth(line, 1, newguid)) // character_inventory.guid update
|
||||
ROLLBACK(DUMP_FILE_BROKEN);
|
||||
|
||||
if (!changeGuid(line, 2, items, objmgr.m_hiItemGuid, true))
|
||||
if (!changeGuid(line, 2, items, sObjectMgr.m_hiItemGuid, true))
|
||||
ROLLBACK(DUMP_FILE_BROKEN); // character_inventory.bag update
|
||||
if (!changeGuid(line, 4, items, objmgr.m_hiItemGuid))
|
||||
if (!changeGuid(line, 4, items, sObjectMgr.m_hiItemGuid))
|
||||
ROLLBACK(DUMP_FILE_BROKEN); // character_inventory.item update
|
||||
break;
|
||||
}
|
||||
case DTT_ITEM:
|
||||
{
|
||||
// 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); // item_instance.guid update
|
||||
if (!changenth(line, 2, newguid)) // item_instance.owner_guid update
|
||||
ROLLBACK(DUMP_FILE_BROKEN);
|
||||
@@ -559,7 +559,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
||||
{
|
||||
if (!changenth(line, 1, newguid)) // character_gifts.guid update
|
||||
ROLLBACK(DUMP_FILE_BROKEN);
|
||||
if (!changeGuid(line, 2, items, objmgr.m_hiItemGuid))
|
||||
if (!changeGuid(line, 2, items, sObjectMgr.m_hiItemGuid))
|
||||
ROLLBACK(DUMP_FILE_BROKEN); // character_gifts.item_guid update
|
||||
break;
|
||||
}
|
||||
@@ -570,7 +570,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
||||
if (strlen(lastpetid) == 0) snprintf(lastpetid, 20, "%s", currpetid);
|
||||
if (strcmp(lastpetid,currpetid) != 0)
|
||||
{
|
||||
snprintf(newpetid, 20, "%d", objmgr.GeneratePetNumber());
|
||||
snprintf(newpetid, 20, "%d", sObjectMgr.GeneratePetNumber());
|
||||
snprintf(lastpetid, 20, "%s", currpetid);
|
||||
}
|
||||
|
||||
@@ -606,7 +606,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
||||
}
|
||||
case DTT_MAIL: // mail
|
||||
{
|
||||
if (!changeGuid(line, 1, mails, objmgr.m_mailid))
|
||||
if (!changeGuid(line, 1, mails, sObjectMgr.m_mailid))
|
||||
ROLLBACK(DUMP_FILE_BROKEN); // mail.id update
|
||||
if (!changenth(line, 6, newguid)) // mail.receiver update
|
||||
ROLLBACK(DUMP_FILE_BROKEN);
|
||||
@@ -614,9 +614,9 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
||||
}
|
||||
case DTT_MAIL_ITEM: // mail_items
|
||||
{
|
||||
if (!changeGuid(line, 1, mails, objmgr.m_mailid))
|
||||
if (!changeGuid(line, 1, mails, sObjectMgr.m_mailid))
|
||||
ROLLBACK(DUMP_FILE_BROKEN); // mail_items.id
|
||||
if (!changeGuid(line, 2, items, objmgr.m_hiItemGuid))
|
||||
if (!changeGuid(line, 2, items, sObjectMgr.m_hiItemGuid))
|
||||
ROLLBACK(DUMP_FILE_BROKEN); // mail_items.item_guid
|
||||
if (!changenth(line, 4, newguid)) // mail_items.receiver
|
||||
ROLLBACK(DUMP_FILE_BROKEN);
|
||||
@@ -635,11 +635,11 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
||||
|
||||
CharacterDatabase.CommitTransaction();
|
||||
|
||||
objmgr.m_hiItemGuid += items.size();
|
||||
objmgr.m_mailid += mails.size();
|
||||
sObjectMgr.m_hiItemGuid += items.size();
|
||||
sObjectMgr.m_mailid += mails.size();
|
||||
|
||||
if (incHighest)
|
||||
++objmgr.m_hiCharGuid;
|
||||
++sObjectMgr.m_hiCharGuid;
|
||||
|
||||
fclose(fin);
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ void WeatherMgr::LoadWeatherData()
|
||||
}
|
||||
}
|
||||
|
||||
wzc.ScriptId = objmgr.GetScriptId(fields[13].GetString());
|
||||
wzc.ScriptId = sObjectMgr.GetScriptId(fields[13].GetString());
|
||||
|
||||
++count;
|
||||
}
|
||||
|
||||
+120
-120
@@ -1233,7 +1233,7 @@ void World::SetInitialWorldSettings()
|
||||
LoadConfigSettings();
|
||||
|
||||
///- 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.
|
||||
if (!MapManager::ExistMapAndVMap(0,-6240.32f, 331.033f)
|
||||
@@ -1252,7 +1252,7 @@ void World::SetInitialWorldSettings()
|
||||
///- Loading strings. Getting no records means core load has to be canceled because no error message can be output.
|
||||
sLog.outString();
|
||||
sLog.outString("Loading Trinity strings...");
|
||||
if (!objmgr.LoadTrinityStrings())
|
||||
if (!sObjectMgr.LoadTrinityStrings())
|
||||
exit(1); // Error message displayed in function already
|
||||
|
||||
///- Update the realm entry in the database with the realm type from the config file
|
||||
@@ -1272,73 +1272,73 @@ void World::SetInitialWorldSettings()
|
||||
DetectDBCLang();
|
||||
|
||||
sLog.outString("Loading Script Names...");
|
||||
objmgr.LoadScriptNames();
|
||||
sObjectMgr.LoadScriptNames();
|
||||
|
||||
sLog.outString("Loading Instance Template...");
|
||||
objmgr.LoadInstanceTemplate();
|
||||
sObjectMgr.LoadInstanceTemplate();
|
||||
|
||||
sLog.outString("Loading SkillLineAbilityMultiMap Data...");
|
||||
spellmgr.LoadSkillLineAbilityMap();
|
||||
sSpellMgr.LoadSkillLineAbilityMap();
|
||||
|
||||
///- Clean up and pack 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...");
|
||||
sInstanceSaveManager.PackInstances();
|
||||
sInstanceSaveMgr.PackInstances();
|
||||
|
||||
sLog.outString("Loading Localization strings...");
|
||||
objmgr.LoadCreatureLocales();
|
||||
objmgr.LoadGameObjectLocales();
|
||||
objmgr.LoadItemLocales();
|
||||
objmgr.LoadItemSetNameLocales();
|
||||
objmgr.LoadQuestLocales();
|
||||
objmgr.LoadNpcTextLocales();
|
||||
objmgr.LoadPageTextLocales();
|
||||
objmgr.LoadGossipMenuItemsLocales();
|
||||
objmgr.LoadPointOfInterestLocales();
|
||||
objmgr.SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts)
|
||||
sObjectMgr.LoadCreatureLocales();
|
||||
sObjectMgr.LoadGameObjectLocales();
|
||||
sObjectMgr.LoadItemLocales();
|
||||
sObjectMgr.LoadItemSetNameLocales();
|
||||
sObjectMgr.LoadQuestLocales();
|
||||
sObjectMgr.LoadNpcTextLocales();
|
||||
sObjectMgr.LoadPageTextLocales();
|
||||
sObjectMgr.LoadGossipMenuItemsLocales();
|
||||
sObjectMgr.LoadPointOfInterestLocales();
|
||||
sObjectMgr.SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts)
|
||||
sLog.outString(">>> Localization strings loaded");
|
||||
sLog.outString();
|
||||
|
||||
sLog.outString("Loading Page Texts...");
|
||||
objmgr.LoadPageTexts();
|
||||
sObjectMgr.LoadPageTexts();
|
||||
|
||||
sLog.outString("Loading Game Object Templates..."); // must be after LoadPageTexts
|
||||
objmgr.LoadGameobjectInfo();
|
||||
sObjectMgr.LoadGameobjectInfo();
|
||||
|
||||
sLog.outString("Loading Spell Rank Data...");
|
||||
spellmgr.LoadSpellRanks();
|
||||
sSpellMgr.LoadSpellRanks();
|
||||
|
||||
sLog.outString("Loading Spell Required Data...");
|
||||
spellmgr.LoadSpellRequired();
|
||||
sSpellMgr.LoadSpellRequired();
|
||||
|
||||
sLog.outString("Loading Spell Group types...");
|
||||
spellmgr.LoadSpellGroups();
|
||||
sSpellMgr.LoadSpellGroups();
|
||||
|
||||
sLog.outString("Loading Spell Learn Skills...");
|
||||
spellmgr.LoadSpellLearnSkills(); // must be after LoadSpellRanks
|
||||
sSpellMgr.LoadSpellLearnSkills(); // must be after LoadSpellRanks
|
||||
|
||||
sLog.outString("Loading Spell Learn Spells...");
|
||||
spellmgr.LoadSpellLearnSpells();
|
||||
sSpellMgr.LoadSpellLearnSpells();
|
||||
|
||||
sLog.outString("Loading Spell Proc Event conditions...");
|
||||
spellmgr.LoadSpellProcEvents();
|
||||
sSpellMgr.LoadSpellProcEvents();
|
||||
|
||||
sLog.outString("Loading Spell Bonus Data...");
|
||||
spellmgr.LoadSpellBonusess();
|
||||
sSpellMgr.LoadSpellBonusess();
|
||||
|
||||
sLog.outString("Loading Aggro Spells Definitions...");
|
||||
spellmgr.LoadSpellThreats();
|
||||
sSpellMgr.LoadSpellThreats();
|
||||
|
||||
sLog.outString("Loading Spell Group Stack Rules...");
|
||||
spellmgr.LoadSpellGroupStackRules();
|
||||
sSpellMgr.LoadSpellGroupStackRules();
|
||||
|
||||
sLog.outString("Loading NPC Texts...");
|
||||
objmgr.LoadGossipText();
|
||||
sObjectMgr.LoadGossipText();
|
||||
|
||||
sLog.outString("Loading Enchant Spells Proc datas...");
|
||||
spellmgr.LoadSpellEnchantProcData();
|
||||
sSpellMgr.LoadSpellEnchantProcData();
|
||||
|
||||
sLog.outString("Loading Item Random Enchantments Table...");
|
||||
LoadRandomEnchantmentsTable();
|
||||
@@ -1347,144 +1347,144 @@ void World::SetInitialWorldSettings()
|
||||
sDisableMgr.LoadDisables(); // must be before loading quests and items
|
||||
|
||||
sLog.outString("Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts
|
||||
objmgr.LoadItemPrototypes();
|
||||
sObjectMgr.LoadItemPrototypes();
|
||||
|
||||
sLog.outString("Loading Item set names..."); // must be after LoadItemPrototypes
|
||||
objmgr.LoadItemSetNames();
|
||||
sObjectMgr.LoadItemSetNames();
|
||||
|
||||
sLog.outString("Loading Creature Model Based Info Data...");
|
||||
objmgr.LoadCreatureModelInfo();
|
||||
sObjectMgr.LoadCreatureModelInfo();
|
||||
|
||||
sLog.outString("Loading Equipment templates...");
|
||||
objmgr.LoadEquipmentTemplates();
|
||||
sObjectMgr.LoadEquipmentTemplates();
|
||||
|
||||
sLog.outString("Loading Creature templates...");
|
||||
objmgr.LoadCreatureTemplates();
|
||||
sObjectMgr.LoadCreatureTemplates();
|
||||
|
||||
sLog.outString("Loading Reputation Reward Rates...");
|
||||
objmgr.LoadReputationRewardRate();
|
||||
sObjectMgr.LoadReputationRewardRate();
|
||||
|
||||
sLog.outString("Loading Creature Reputation OnKill Data...");
|
||||
objmgr.LoadReputationOnKill();
|
||||
sObjectMgr.LoadReputationOnKill();
|
||||
|
||||
sLog.outString( "Loading Reputation Spillover Data..." );
|
||||
objmgr.LoadReputationSpilloverTemplate();
|
||||
sObjectMgr.LoadReputationSpilloverTemplate();
|
||||
|
||||
sLog.outString("Loading Points Of Interest Data...");
|
||||
objmgr.LoadPointsOfInterest();
|
||||
sObjectMgr.LoadPointsOfInterest();
|
||||
|
||||
sLog.outString("Loading Creature Base Stats...");
|
||||
objmgr.LoadCreatureClassLevelStats();
|
||||
sObjectMgr.LoadCreatureClassLevelStats();
|
||||
|
||||
sLog.outString("Loading Creature Data...");
|
||||
objmgr.LoadCreatures();
|
||||
sObjectMgr.LoadCreatures();
|
||||
|
||||
sLog.outString("Loading Creature Linked Respawn...");
|
||||
objmgr.LoadCreatureLinkedRespawn(); // must be after LoadCreatures()
|
||||
sObjectMgr.LoadCreatureLinkedRespawn(); // must be after LoadCreatures()
|
||||
|
||||
sLog.outString("Loading pet levelup spells...");
|
||||
spellmgr.LoadPetLevelupSpellMap();
|
||||
sSpellMgr.LoadPetLevelupSpellMap();
|
||||
|
||||
sLog.outString("Loading pet default spell additional to levelup spells...");
|
||||
spellmgr.LoadPetDefaultSpells();
|
||||
sSpellMgr.LoadPetDefaultSpells();
|
||||
|
||||
sLog.outString("Loading Creature Template Addon Data...");
|
||||
objmgr.LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures()
|
||||
sObjectMgr.LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures()
|
||||
|
||||
sLog.outString("Loading Vehicle Accessories...");
|
||||
objmgr.LoadVehicleAccessories(); // must be after LoadCreatureTemplates()
|
||||
sObjectMgr.LoadVehicleAccessories(); // must be after LoadCreatureTemplates()
|
||||
|
||||
sLog.outString("Loading Creature Respawn Data..."); // must be after PackInstances()
|
||||
objmgr.LoadCreatureRespawnTimes();
|
||||
sObjectMgr.LoadCreatureRespawnTimes();
|
||||
|
||||
sLog.outString("Loading Gameobject Data...");
|
||||
objmgr.LoadGameobjects();
|
||||
sObjectMgr.LoadGameobjects();
|
||||
|
||||
sLog.outString("Loading Gameobject Respawn Data..."); // must be after PackInstances()
|
||||
objmgr.LoadGameobjectRespawnTimes();
|
||||
sObjectMgr.LoadGameobjectRespawnTimes();
|
||||
|
||||
sLog.outString("Loading Objects Pooling Data...");
|
||||
poolhandler.LoadFromDB();
|
||||
sPoolMgr.LoadFromDB();
|
||||
|
||||
sLog.outString("Loading Game Event Data...");
|
||||
gameeventmgr.LoadFromDB();
|
||||
sGameEventMgr.LoadFromDB();
|
||||
|
||||
sLog.outString("Loading Weather Data...");
|
||||
sWeatherMgr.LoadWeatherData();
|
||||
|
||||
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("Checking Quest Disables");
|
||||
sDisableMgr.CheckQuestDisables(); // must be after loading quests
|
||||
|
||||
sLog.outString("Loading Quest POI");
|
||||
objmgr.LoadQuestPOI();
|
||||
sObjectMgr.LoadQuestPOI();
|
||||
|
||||
sLog.outString("Loading Quests Relations...");
|
||||
objmgr.LoadQuestRelations(); // must be after quest load
|
||||
sObjectMgr.LoadQuestRelations(); // must be after quest load
|
||||
|
||||
sLog.outString("Loading UNIT_NPC_FLAG_SPELLCLICK Data...");
|
||||
objmgr.LoadNPCSpellClickSpells();
|
||||
sObjectMgr.LoadNPCSpellClickSpells();
|
||||
|
||||
sLog.outString("Loading SpellArea Data..."); // must be after quest load
|
||||
spellmgr.LoadSpellAreas();
|
||||
sSpellMgr.LoadSpellAreas();
|
||||
|
||||
sLog.outString("Loading AreaTrigger definitions...");
|
||||
objmgr.LoadAreaTriggerTeleports();
|
||||
sObjectMgr.LoadAreaTriggerTeleports();
|
||||
|
||||
sLog.outString("Loading Access Requirements...");
|
||||
objmgr.LoadAccessRequirements(); // must be after item template load
|
||||
sObjectMgr.LoadAccessRequirements(); // must be after item template load
|
||||
|
||||
sLog.outString("Loading Quest Area Triggers...");
|
||||
objmgr.LoadQuestAreaTriggers(); // must be after LoadQuests
|
||||
sObjectMgr.LoadQuestAreaTriggers(); // must be after LoadQuests
|
||||
|
||||
sLog.outString("Loading Tavern Area Triggers...");
|
||||
objmgr.LoadTavernAreaTriggers();
|
||||
sObjectMgr.LoadTavernAreaTriggers();
|
||||
|
||||
sLog.outString("Loading AreaTrigger script names...");
|
||||
objmgr.LoadAreaTriggerScripts();
|
||||
sObjectMgr.LoadAreaTriggerScripts();
|
||||
|
||||
sLog.outString("Loading Graveyard-zone links...");
|
||||
objmgr.LoadGraveyardZones();
|
||||
sObjectMgr.LoadGraveyardZones();
|
||||
|
||||
sLog.outString("Loading Spell target coordinates...");
|
||||
spellmgr.LoadSpellTargetPositions();
|
||||
sSpellMgr.LoadSpellTargetPositions();
|
||||
|
||||
sLog.outString("Loading spell pet auras...");
|
||||
spellmgr.LoadSpellPetAuras();
|
||||
sSpellMgr.LoadSpellPetAuras();
|
||||
|
||||
sLog.outString("Loading spell extra attributes...");
|
||||
spellmgr.LoadSpellCustomAttr();
|
||||
sSpellMgr.LoadSpellCustomAttr();
|
||||
|
||||
sLog.outString("Loading enchant custom attributes...");
|
||||
spellmgr.LoadEnchantCustomAttr();
|
||||
sSpellMgr.LoadEnchantCustomAttr();
|
||||
|
||||
sLog.outString("Loading linked spells...");
|
||||
spellmgr.LoadSpellLinked();
|
||||
sSpellMgr.LoadSpellLinked();
|
||||
|
||||
sLog.outString("Loading Player Create Data...");
|
||||
objmgr.LoadPlayerInfo();
|
||||
sObjectMgr.LoadPlayerInfo();
|
||||
|
||||
sLog.outString("Loading Exploration BaseXP Data...");
|
||||
objmgr.LoadExplorationBaseXP();
|
||||
sObjectMgr.LoadExplorationBaseXP();
|
||||
|
||||
sLog.outString("Loading Pet Name Parts...");
|
||||
objmgr.LoadPetNames();
|
||||
sObjectMgr.LoadPetNames();
|
||||
|
||||
CharacterDatabaseCleaner::CleanDatabase();
|
||||
|
||||
sLog.outString("Loading the max pet number...");
|
||||
objmgr.LoadPetNumber();
|
||||
sObjectMgr.LoadPetNumber();
|
||||
|
||||
sLog.outString("Loading pet level stats...");
|
||||
objmgr.LoadPetLevelInfo();
|
||||
sObjectMgr.LoadPetLevelInfo();
|
||||
|
||||
sLog.outString("Loading Player Corpses...");
|
||||
objmgr.LoadCorpses();
|
||||
sObjectMgr.LoadCorpses();
|
||||
|
||||
sLog.outString("Loading Player level dependent mail rewards...");
|
||||
objmgr.LoadMailLevelRewards();
|
||||
sObjectMgr.LoadMailLevelRewards();
|
||||
|
||||
// Loot tables
|
||||
LoadLootTables();
|
||||
@@ -1496,64 +1496,64 @@ void World::SetInitialWorldSettings()
|
||||
LoadSkillExtraItemTable();
|
||||
|
||||
sLog.outString("Loading Skill Fishing base level requirements...");
|
||||
objmgr.LoadFishingBaseSkillLevel();
|
||||
sObjectMgr.LoadFishingBaseSkillLevel();
|
||||
|
||||
sLog.outString("Loading Achievements...");
|
||||
achievementmgr.LoadAchievementReferenceList();
|
||||
sAchievementMgr.LoadAchievementReferenceList();
|
||||
sLog.outString("Loading Achievement Criteria Lists...");
|
||||
achievementmgr.LoadAchievementCriteriaList();
|
||||
sAchievementMgr.LoadAchievementCriteriaList();
|
||||
sLog.outString("Loading Achievement Criteria Data...");
|
||||
achievementmgr.LoadAchievementCriteriaData();
|
||||
sAchievementMgr.LoadAchievementCriteriaData();
|
||||
sLog.outString("Loading Achievement Rewards...");
|
||||
achievementmgr.LoadRewards();
|
||||
sAchievementMgr.LoadRewards();
|
||||
sLog.outString("Loading Achievement Reward Locales...");
|
||||
achievementmgr.LoadRewardLocales();
|
||||
sAchievementMgr.LoadRewardLocales();
|
||||
sLog.outString("Loading Completed Achievements...");
|
||||
achievementmgr.LoadCompletedAchievements();
|
||||
sAchievementMgr.LoadCompletedAchievements();
|
||||
|
||||
///- Load dynamic data tables from the database
|
||||
sLog.outString("Loading Item Auctions...");
|
||||
auctionmgr.LoadAuctionItems();
|
||||
sAuctionMgr.LoadAuctionItems();
|
||||
sLog.outString("Loading Auctions...");
|
||||
auctionmgr.LoadAuctions();
|
||||
sAuctionMgr.LoadAuctions();
|
||||
|
||||
sLog.outString("Loading Guilds...");
|
||||
objmgr.LoadGuilds();
|
||||
sObjectMgr.LoadGuilds();
|
||||
|
||||
sLog.outString("Loading ArenaTeams...");
|
||||
objmgr.LoadArenaTeams();
|
||||
sObjectMgr.LoadArenaTeams();
|
||||
|
||||
sLog.outString("Loading Groups...");
|
||||
objmgr.LoadGroups();
|
||||
sObjectMgr.LoadGroups();
|
||||
|
||||
sLog.outString("Loading ReservedNames...");
|
||||
objmgr.LoadReservedPlayersNames();
|
||||
sObjectMgr.LoadReservedPlayersNames();
|
||||
|
||||
sLog.outString("Loading GameObjects for quests...");
|
||||
objmgr.LoadGameObjectForQuests();
|
||||
sObjectMgr.LoadGameObjectForQuests();
|
||||
|
||||
sLog.outString("Loading BattleMasters...");
|
||||
sBattlegroundMgr.LoadBattleMastersEntry();
|
||||
|
||||
sLog.outString("Loading GameTeleports...");
|
||||
objmgr.LoadGameTele();
|
||||
sObjectMgr.LoadGameTele();
|
||||
|
||||
sLog.outString("Loading Npc Text Id...");
|
||||
objmgr.LoadNpcTextId(); // must be after load Creature and NpcText
|
||||
sObjectMgr.LoadNpcTextId(); // must be after load Creature and NpcText
|
||||
|
||||
objmgr.LoadGossipScripts(); // must be before gossip menu options
|
||||
sObjectMgr.LoadGossipScripts(); // must be before gossip menu options
|
||||
|
||||
sLog.outString("Loading Gossip menu...");
|
||||
objmgr.LoadGossipMenu();
|
||||
sObjectMgr.LoadGossipMenu();
|
||||
|
||||
sLog.outString("Loading Gossip menu options...");
|
||||
objmgr.LoadGossipMenuItems();
|
||||
sObjectMgr.LoadGossipMenuItems();
|
||||
|
||||
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...");
|
||||
objmgr.LoadTrainerSpell(); // must be after load CreatureTemplate
|
||||
sObjectMgr.LoadTrainerSpell(); // must be after load CreatureTemplate
|
||||
|
||||
sLog.outString("Loading Waypoints...");
|
||||
sWaypointMgr->Load();
|
||||
@@ -1565,14 +1565,14 @@ void World::SetInitialWorldSettings()
|
||||
sConditionMgr.LoadConditions();
|
||||
|
||||
sLog.outString("Loading GM tickets...");
|
||||
objmgr.LoadGMTickets();
|
||||
sObjectMgr.LoadGMTickets();
|
||||
|
||||
sLog.outString("Loading client addons...");
|
||||
sAddonMgr.LoadFromDB();
|
||||
|
||||
///- Handle outdated emails (delete/return)
|
||||
sLog.outString("Returning old mails...");
|
||||
objmgr.ReturnOrDeleteOldMails(false);
|
||||
sObjectMgr.ReturnOrDeleteOldMails(false);
|
||||
|
||||
sLog.outString("Loading Autobroadcasts...");
|
||||
LoadAutobroadcasts();
|
||||
@@ -1580,35 +1580,35 @@ void World::SetInitialWorldSettings()
|
||||
///- Load and initialize scripts
|
||||
sLog.outString("Loading Scripts...");
|
||||
sLog.outString();
|
||||
objmgr.LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
|
||||
objmgr.LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
|
||||
objmgr.LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
objmgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
objmgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
objmgr.LoadWaypointScripts();
|
||||
sObjectMgr.LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
|
||||
sObjectMgr.LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
|
||||
sObjectMgr.LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
sObjectMgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
sObjectMgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
sObjectMgr.LoadWaypointScripts();
|
||||
sLog.outString(">>> Scripts loaded");
|
||||
sLog.outString();
|
||||
|
||||
sLog.outString("Loading Scripts text locales..."); // must be after Load*Scripts calls
|
||||
objmgr.LoadDbScriptStrings();
|
||||
sObjectMgr.LoadDbScriptStrings();
|
||||
|
||||
sLog.outString("Loading CreatureEventAI Texts...");
|
||||
CreatureEAI_Mgr.LoadCreatureEventAI_Texts();
|
||||
sEventAIMgr.LoadCreatureEventAI_Texts();
|
||||
|
||||
sLog.outString("Loading CreatureEventAI Summons...");
|
||||
CreatureEAI_Mgr.LoadCreatureEventAI_Summons();
|
||||
sEventAIMgr.LoadCreatureEventAI_Summons();
|
||||
|
||||
sLog.outString("Loading CreatureEventAI Scripts...");
|
||||
CreatureEAI_Mgr.LoadCreatureEventAI_Scripts();
|
||||
sEventAIMgr.LoadCreatureEventAI_Scripts();
|
||||
|
||||
sLog.outString("Loading spell script names...");
|
||||
objmgr.LoadSpellScriptNames();
|
||||
sObjectMgr.LoadSpellScriptNames();
|
||||
|
||||
sLog.outString("Initializing Scripts...");
|
||||
sScriptMgr.Initialize();
|
||||
|
||||
sLog.outString("Validating spell scripts...");
|
||||
objmgr.ValidateSpellScripts();
|
||||
sObjectMgr.ValidateSpellScripts();
|
||||
|
||||
///- Initialize game time and timers
|
||||
sLog.outDebug("DEBUG:: Initialize game time and timers");
|
||||
@@ -1658,14 +1658,14 @@ void World::SetInitialWorldSettings()
|
||||
sMapMgr.Initialize();
|
||||
|
||||
sLog.outString("Starting Game Event system...");
|
||||
uint32 nextGameEvent = gameeventmgr.Initialize();
|
||||
uint32 nextGameEvent = sGameEventMgr.Initialize();
|
||||
m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event
|
||||
|
||||
// Delete all characters which have been deleted X days before
|
||||
Player::DeleteOldCharacters();
|
||||
|
||||
sLog.outString("Starting Arena Season...");
|
||||
gameeventmgr.StartArenaSeason();
|
||||
sGameEventMgr.StartArenaSeason();
|
||||
|
||||
sLog.outString("Loading World States..."); // must be loaded before battleground and outdoor PvP
|
||||
LoadWorldStates();
|
||||
@@ -1702,7 +1702,7 @@ void World::SetInitialWorldSettings()
|
||||
InitRandomBGResetTime();
|
||||
|
||||
sLog.outString("Starting objects Pooling system...");
|
||||
poolhandler.Initialize();
|
||||
sPoolMgr.Initialize();
|
||||
|
||||
// possibly enable db logging; avoid massive startup spam by doing it here.
|
||||
if (sLog.GetLogDBLater())
|
||||
@@ -1877,11 +1877,11 @@ void World::Update(uint32 diff)
|
||||
if (++mail_timer > mail_timer_expires)
|
||||
{
|
||||
mail_timer = 0;
|
||||
objmgr.ReturnOrDeleteOldMails(true);
|
||||
sObjectMgr.ReturnOrDeleteOldMails(true);
|
||||
}
|
||||
|
||||
///- Handle expired auctions
|
||||
auctionmgr.Update();
|
||||
sAuctionMgr.Update();
|
||||
}
|
||||
|
||||
/// <li> Handle session updates when the timer has passed
|
||||
@@ -1967,13 +1967,13 @@ void World::Update(uint32 diff)
|
||||
if (m_timers[WUPDATE_EVENTS].Passed())
|
||||
{
|
||||
m_timers[WUPDATE_EVENTS].Reset(); // to give time for Update() to be processed
|
||||
uint32 nextGameEvent = gameeventmgr.Update();
|
||||
uint32 nextGameEvent = sGameEventMgr.Update();
|
||||
m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent);
|
||||
m_timers[WUPDATE_EVENTS].Reset();
|
||||
}
|
||||
|
||||
// update the instance reset times
|
||||
sInstanceSaveManager.Update();
|
||||
sInstanceSaveMgr.Update();
|
||||
|
||||
// And last, but not least handle the issued cli commands
|
||||
ProcessCliCommands();
|
||||
@@ -1984,7 +1984,7 @@ void World::Update(uint32 diff)
|
||||
void World::ForceGameEventUpdate()
|
||||
{
|
||||
m_timers[WUPDATE_EVENTS].Reset(); // to give time for Update() to be processed
|
||||
uint32 nextGameEvent = gameeventmgr.Update();
|
||||
uint32 nextGameEvent = sGameEventMgr.Update();
|
||||
m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent);
|
||||
m_timers[WUPDATE_EVENTS].Reset();
|
||||
}
|
||||
@@ -2033,7 +2033,7 @@ namespace Trinity
|
||||
explicit WorldWorldTextBuilder(int32 textId, va_list* args = NULL) : i_textId(textId), i_args(args) {}
|
||||
void operator()(WorldPacketList& data_list, int32 loc_idx)
|
||||
{
|
||||
char const* text = objmgr.GetTrinityString(i_textId,loc_idx);
|
||||
char const* text = sObjectMgr.GetTrinityString(i_textId,loc_idx);
|
||||
|
||||
if (i_args)
|
||||
{
|
||||
@@ -2258,9 +2258,9 @@ bool World::RemoveBanAccount(BanMode mode, std::string nameOrIP)
|
||||
{
|
||||
uint32 account = 0;
|
||||
if (mode == BAN_ACCOUNT)
|
||||
account = accmgr.GetId (nameOrIP);
|
||||
account = sAccountMgr.GetId (nameOrIP);
|
||||
else if (mode == BAN_CHARACTER)
|
||||
account = objmgr.GetPlayerAccountIdByPlayerName (nameOrIP);
|
||||
account = sObjectMgr.GetPlayerAccountIdByPlayerName (nameOrIP);
|
||||
|
||||
if (!account)
|
||||
return false;
|
||||
|
||||
@@ -131,7 +131,7 @@ bool ChatHandler::HandleAccountDeleteCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 account_id = accmgr.GetId(account_name);
|
||||
uint32 account_id = sAccountMgr.GetId(account_name);
|
||||
if(!account_id)
|
||||
{
|
||||
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
|
||||
@@ -145,7 +145,7 @@ bool ChatHandler::HandleAccountDeleteCommand(const char* args)
|
||||
if(HasLowerSecurityAccount (NULL,account_id,true))
|
||||
return false;
|
||||
|
||||
AccountOpResult result = accmgr.DeleteAccount(account_id);
|
||||
AccountOpResult result = sAccountMgr.DeleteAccount(account_id);
|
||||
switch(result)
|
||||
{
|
||||
case AOR_OK:
|
||||
@@ -208,7 +208,7 @@ bool ChatHandler::GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::s
|
||||
info.accountId = fields[2].GetUInt32();
|
||||
|
||||
// account name will be empty for not existed account
|
||||
accmgr.GetName(info.accountId, info.accountName);
|
||||
sAccountMgr.GetName(info.accountId, info.accountName);
|
||||
|
||||
info.deleteDate = time_t(fields[3].GetUInt64());
|
||||
|
||||
@@ -331,14 +331,14 @@ void ChatHandler::HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo
|
||||
}
|
||||
|
||||
// check character count
|
||||
uint32 charcount = accmgr.GetCharactersCount(delInfo.accountId);
|
||||
uint32 charcount = sAccountMgr.GetCharactersCount(delInfo.accountId);
|
||||
if (charcount >= 10)
|
||||
{
|
||||
PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId);
|
||||
return;
|
||||
}
|
||||
|
||||
if (objmgr.GetPlayerGUIDByName(delInfo.name))
|
||||
if (sObjectMgr.GetPlayerGUIDByName(delInfo.name))
|
||||
{
|
||||
PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId);
|
||||
return;
|
||||
@@ -403,7 +403,7 @@ bool ChatHandler::HandleCharacterDeletedRestoreCommand(const char* args)
|
||||
if (newAccount && newAccount != delInfo.accountId)
|
||||
{
|
||||
delInfo.accountId = newAccount;
|
||||
accmgr.GetName(newAccount, delInfo.accountName);
|
||||
sAccountMgr.GetName(newAccount, delInfo.accountName);
|
||||
}
|
||||
|
||||
HandleCharacterDeletedRestoreHelper(delInfo);
|
||||
@@ -498,7 +498,7 @@ bool ChatHandler::HandleCharacterEraseCommand(const char* args){
|
||||
uint64 character_guid;
|
||||
uint32 account_id;
|
||||
|
||||
Player *player = objmgr.GetPlayer(character_name.c_str());
|
||||
Player *player = sObjectMgr.GetPlayer(character_name.c_str());
|
||||
if(player)
|
||||
{
|
||||
character_guid = player->GetGUID();
|
||||
@@ -507,7 +507,7 @@ bool ChatHandler::HandleCharacterEraseCommand(const char* args){
|
||||
}
|
||||
else
|
||||
{
|
||||
character_guid = objmgr.GetPlayerGUIDByName(character_name);
|
||||
character_guid = sObjectMgr.GetPlayerGUIDByName(character_name);
|
||||
if(!character_guid)
|
||||
{
|
||||
PSendSysMessage(LANG_NO_PLAYER,character_name.c_str());
|
||||
@@ -515,11 +515,11 @@ bool ChatHandler::HandleCharacterEraseCommand(const char* args){
|
||||
return false;
|
||||
}
|
||||
|
||||
account_id = objmgr.GetPlayerAccountIdByGUID(character_guid);
|
||||
account_id = sObjectMgr.GetPlayerAccountIdByGUID(character_guid);
|
||||
}
|
||||
|
||||
std::string account_name;
|
||||
accmgr.GetName (account_id,account_name);
|
||||
sAccountMgr.GetName (account_id,account_name);
|
||||
|
||||
Player::DeleteFromDB(character_guid, account_id, true, true);
|
||||
PSendSysMessage(LANG_CHARACTER_DELETED,character_name.c_str(),GUID_LOPART(character_guid),account_name.c_str(), account_id);
|
||||
@@ -592,11 +592,11 @@ bool ChatHandler::HandleAccountCreateCommand(const char* args)
|
||||
if(!szAcc || !szPassword)
|
||||
return false;
|
||||
|
||||
// normalized in accmgr.CreateAccount
|
||||
// normalized in sAccountMgr.CreateAccount
|
||||
std::string account_name = szAcc;
|
||||
std::string password = szPassword;
|
||||
|
||||
AccountOpResult result = accmgr.CreateAccount(account_name, password);
|
||||
AccountOpResult result = sAccountMgr.CreateAccount(account_name, password);
|
||||
switch(result)
|
||||
{
|
||||
case AOR_OK:
|
||||
|
||||
@@ -97,20 +97,20 @@ int ns1__executeCommand(soap* soap, char* command, char** result)
|
||||
return 401;
|
||||
}
|
||||
|
||||
uint32 accountId = accmgr.GetId(soap->userid);
|
||||
uint32 accountId = sAccountMgr.GetId(soap->userid);
|
||||
if(!accountId)
|
||||
{
|
||||
sLog.outDebug("TCSoap: Client used invalid username '%s'", soap->userid);
|
||||
return 401;
|
||||
}
|
||||
|
||||
if(!accmgr.CheckPassword(accountId, soap->passwd))
|
||||
if(!sAccountMgr.CheckPassword(accountId, soap->passwd))
|
||||
{
|
||||
sLog.outDebug("TCSoap: invalid password for account '%s'", soap->userid);
|
||||
return 401;
|
||||
}
|
||||
|
||||
if(accmgr.GetSecurity(accountId) < SEC_ADMINISTRATOR)
|
||||
if(sAccountMgr.GetSecurity(accountId) < SEC_ADMINISTRATOR)
|
||||
{
|
||||
sLog.outDebug("TCSoap: %s's gmlevel is too low", soap->userid);
|
||||
return 403;
|
||||
|
||||
Reference in New Issue
Block a user