Core: Removed unused functions (leftovers from sd2, was needed when scripts were built as separate dll)
This commit is contained in:
@@ -392,7 +392,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
me->setFaction(action.set_faction.factionId);
|
||||
else
|
||||
{
|
||||
if (CreatureInfo const* ci = GetCreatureTemplateStore(me->GetEntry()))
|
||||
if (CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(me->GetEntry()))
|
||||
{
|
||||
//if no id provided, assume reset and then use default
|
||||
if (me->getFaction() != ci->faction_A)
|
||||
@@ -408,7 +408,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
//set model based on entry from creature_template
|
||||
if (action.morph.creatureId)
|
||||
{
|
||||
if (CreatureInfo const* ci = GetCreatureTemplateStore(action.morph.creatureId))
|
||||
if (CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(action.morph.creatureId))
|
||||
{
|
||||
uint32 display_id = sObjectMgr->ChooseDisplayId(0,ci);
|
||||
me->SetDisplayId(display_id);
|
||||
@@ -831,7 +831,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
// set model based on entry from creature_template
|
||||
if (action.mount.creatureId)
|
||||
{
|
||||
if (CreatureInfo const* cInfo = GetCreatureTemplateStore(action.mount.creatureId))
|
||||
if (CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(action.mount.creatureId))
|
||||
{
|
||||
uint32 display_id = sObjectMgr->ChooseDisplayId(0, cInfo);
|
||||
me->Mount(display_id);
|
||||
|
||||
@@ -234,7 +234,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CreatureInfo const* ci = GetCreatureTemplateStore((*itr)->ToCreature()->GetEntry()))
|
||||
if (CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate((*itr)->ToCreature()->GetEntry()))
|
||||
{
|
||||
if ((*itr)->ToCreature()->getFaction() != ci->faction_A)
|
||||
{
|
||||
@@ -266,7 +266,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
//set model based on entry from creature_template
|
||||
if (e.action.morphOrMount.creature)
|
||||
{
|
||||
if (CreatureInfo const* ci = GetCreatureTemplateStore(e.action.morphOrMount.creature))
|
||||
if (CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(e.action.morphOrMount.creature))
|
||||
{
|
||||
uint32 display_id = sObjectMgr->ChooseDisplayId(0, ci);
|
||||
(*itr)->ToCreature()->SetDisplayId(display_id);
|
||||
@@ -940,7 +940,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
{
|
||||
if (e.action.morphOrMount.creature > 0)
|
||||
{
|
||||
if (CreatureInfo const* cInfo = GetCreatureTemplateStore(e.action.morphOrMount.creature))
|
||||
if (CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(e.action.morphOrMount.creature))
|
||||
{
|
||||
uint32 display_id = sObjectMgr->ChooseDisplayId(0, cInfo);
|
||||
(*itr)->ToUnit()->Mount(display_id);
|
||||
|
||||
@@ -5646,7 +5646,7 @@ void ObjectMgr::LoadInstanceEncounters()
|
||||
{
|
||||
case ENCOUNTER_CREDIT_KILL_CREATURE:
|
||||
{
|
||||
CreatureInfo const* creatureInfo = GetCreatureInfo(creditEntry);
|
||||
CreatureInfo const* creatureInfo = GetCreatureTemplate(creditEntry);
|
||||
if (!creatureInfo)
|
||||
{
|
||||
sLog->outErrorDb("Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName[0]);
|
||||
@@ -8591,7 +8591,7 @@ void ObjectMgr::LoadMailLevelRewards()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!GetCreatureTemplateStore(senderEntry))
|
||||
if (!GetCreatureTemplate(senderEntry))
|
||||
{
|
||||
sLog->outErrorDb("Table `mail_level_reward` have not existed sender creature entry (%u) for level %u that invalid not include any player races, ignoring.",senderEntry,level);
|
||||
continue;
|
||||
@@ -9167,12 +9167,6 @@ void ObjectMgr::LoadDbScriptStrings()
|
||||
sLog->outErrorDb("Table `db_script_string` has unused string id %u", *itr);
|
||||
}
|
||||
|
||||
// Functions for scripting access
|
||||
uint32 GetAreaTriggerScriptId(uint32 trigger_id)
|
||||
{
|
||||
return sObjectMgr->GetAreaTriggerScriptId(trigger_id);
|
||||
}
|
||||
|
||||
bool LoadTrinityStrings(char const* table, int32 start_value, int32 end_value)
|
||||
{
|
||||
// MAX_DB_SCRIPT_STRING_ID is max allowed negative value for scripts (scrpts can use only more deep negative values
|
||||
@@ -9186,36 +9180,6 @@ bool LoadTrinityStrings(char const* table, int32 start_value, int32 end_value)
|
||||
return sObjectMgr->LoadTrinityStrings(table, start_value, end_value);
|
||||
}
|
||||
|
||||
uint32 GetScriptId(const char *name)
|
||||
{
|
||||
return sObjectMgr->GetScriptId(name);
|
||||
}
|
||||
|
||||
ObjectMgr::ScriptNameMap & GetScriptNames()
|
||||
{
|
||||
return sObjectMgr->GetScriptNames();
|
||||
}
|
||||
|
||||
GameObjectInfo const *GetGameObjectInfo(uint32 id)
|
||||
{
|
||||
return ObjectMgr::GetGameObjectInfo(id);
|
||||
}
|
||||
|
||||
CreatureInfo const *GetCreatureInfo(uint32 id)
|
||||
{
|
||||
return ObjectMgr::GetCreatureTemplate(id);
|
||||
}
|
||||
|
||||
CreatureInfo const* GetCreatureTemplateStore(uint32 entry)
|
||||
{
|
||||
return sCreatureStorage.LookupEntry<CreatureInfo>(entry);
|
||||
}
|
||||
|
||||
Quest const* GetQuestTemplateStore(uint32 entry)
|
||||
{
|
||||
return sObjectMgr->GetQuestTemplate(entry);
|
||||
}
|
||||
|
||||
CreatureBaseStats const* ObjectMgr::GetCreatureBaseStats(uint8 level, uint8 unitClass)
|
||||
{
|
||||
CreatureBaseStatsMap::const_iterator it = m_creatureBaseStatsMap.find(MAKE_PAIR16(level,unitClass));
|
||||
|
||||
@@ -1420,13 +1420,6 @@ class ObjectMgr
|
||||
#define sObjectMgr ACE_Singleton<ObjectMgr, ACE_Null_Mutex>::instance()
|
||||
|
||||
// scripting access functions
|
||||
bool LoadTrinityStrings(char const* table,int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min());
|
||||
uint32 GetAreaTriggerScriptId(uint32 trigger_id);
|
||||
uint32 GetScriptId(const char *name);
|
||||
ObjectMgr::ScriptNameMap& GetScriptNames();
|
||||
GameObjectInfo const *GetGameObjectInfo(uint32 id);
|
||||
CreatureInfo const *GetCreatureInfo(uint32 id);
|
||||
CreatureInfo const* GetCreatureTemplateStore(uint32 entry);
|
||||
Quest const* GetQuestTemplateStore(uint32 entry);
|
||||
bool LoadTrinityStrings(char const* table,int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min());
|
||||
|
||||
#endif
|
||||
|
||||
@@ -853,7 +853,7 @@ bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger)
|
||||
ASSERT(player);
|
||||
ASSERT(trigger);
|
||||
|
||||
GET_SCRIPT_RET(AreaTriggerScript, GetAreaTriggerScriptId(trigger->id), tmpscript, false);
|
||||
GET_SCRIPT_RET(AreaTriggerScript, sObjectMgr->GetAreaTriggerScriptId(trigger->id), tmpscript, false);
|
||||
return tmpscript->OnTrigger(player, trigger);
|
||||
}
|
||||
|
||||
|
||||
@@ -1007,7 +1007,7 @@ class ScriptMgr
|
||||
{
|
||||
// Get an ID for the script. An ID only exists if it's a script that is assigned in the database
|
||||
// through a script name (or similar).
|
||||
uint32 id = GetScriptId(script->GetName().c_str());
|
||||
uint32 id = sObjectMgr->GetScriptId(script->GetName().c_str());
|
||||
if (id)
|
||||
{
|
||||
// Try to find an existing script.
|
||||
|
||||
@@ -203,7 +203,7 @@ void SystemMgr::LoadScriptWaypoints()
|
||||
pTemp.fZ = pFields[4].GetFloat();
|
||||
pTemp.uiWaitTime = pFields[5].GetUInt32();
|
||||
|
||||
CreatureInfo const* pCInfo = GetCreatureTemplateStore(pTemp.uiCreatureEntry);
|
||||
CreatureInfo const* pCInfo = ObjectMgr::GetCreatureTemplate(pTemp.uiCreatureEntry);
|
||||
|
||||
if (!pCInfo)
|
||||
{
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
if (!me->GetEquipmentId())
|
||||
if (const CreatureInfo *info = GetCreatureInfo(28406))
|
||||
if (const CreatureInfo *info = ObjectMgr::GetCreatureTemplate(28406))
|
||||
if (info->equipmentId)
|
||||
const_cast<CreatureInfo*>(me->GetCreatureInfo())->equipmentId = info->equipmentId;
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ class npc_troll_volunteer : public CreatureScript
|
||||
}
|
||||
me->SetDisplayId(trollmodel[urand(0, 39)]);
|
||||
if (player)
|
||||
me->GetMotionMaster()->MoveFollow(player, 5.0f, urand(120, 240));
|
||||
me->GetMotionMaster()->MoveFollow(player, 5.0f, float(rand_norm() + 1.0f) * M_PI / 3.0f * 4.0f);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
|
||||
@@ -71,7 +71,7 @@ class boss_bronjahm : public CreatureScript
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(FoSScriptName))
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != sObjectMgr->GetScriptId(FoSScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
|
||||
@@ -129,7 +129,7 @@ class boss_devourer_of_souls : public CreatureScript
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(FoSScriptName))
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != sObjectMgr->GetScriptId(FoSScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
|
||||
@@ -88,7 +88,7 @@ class boss_garfrost : public CreatureScript
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(PoSScriptName))
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != sObjectMgr->GetScriptId(PoSScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
|
||||
@@ -143,7 +143,7 @@ class boss_ick : public CreatureScript
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(PoSScriptName))
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != sObjectMgr->GetScriptId(PoSScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
@@ -299,7 +299,7 @@ class boss_krick : public CreatureScript
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!_instanceScript || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(PoSScriptName))
|
||||
if (!_instanceScript || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != sObjectMgr->GetScriptId(PoSScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
|
||||
@@ -127,7 +127,7 @@ class boss_tyrannus : public CreatureScript
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(PoSScriptName))
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != sObjectMgr->GetScriptId(PoSScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (instance->GetBossState(DATA_TYRANNUS) != DONE)
|
||||
Reset();
|
||||
|
||||
@@ -176,14 +176,6 @@ class boss_sindragosa : public CreatureScript
|
||||
{
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
@@ -479,7 +471,7 @@ class boss_sindragosa : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_sindragosaAI(creature);
|
||||
return GetIcecrownCitadelAI<boss_sindragosaAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -571,14 +563,6 @@ class npc_spinestalker : public CreatureScript
|
||||
{
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
@@ -676,7 +660,7 @@ class npc_spinestalker : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_spinestalkerAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_spinestalkerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -691,14 +675,6 @@ class npc_rimefang : public CreatureScript
|
||||
{
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
@@ -823,7 +799,7 @@ class npc_rimefang : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_rimefangAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_rimefangAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -377,7 +377,7 @@ CreatureAI* GetIcecrownCitadelAI(Creature* creature)
|
||||
{
|
||||
if (InstanceMap* instance = creature->GetMap()->ToInstanceMap())
|
||||
if (instance->GetInstanceScript())
|
||||
if (instance->GetScriptId() == GetScriptId(ICCScriptName))
|
||||
if (instance->GetScriptId() == sObjectMgr->GetScriptId(ICCScriptName))
|
||||
return new AI(creature);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ class boss_razorscale_controller : public CreatureScript
|
||||
{
|
||||
case EVENT_BUILD_HARPOON_1:
|
||||
DoScriptText(EMOTE_HARPOON, me);
|
||||
if (GameObject* Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_1, PosHarpoon[0].GetPositionX(), PosHarpoon[0].GetPositionY(), PosHarpoon[0].GetPositionZ(), 4.790f, 0.0f, 0.0f, 0.0f, 0.0f, me->GetRespawnTime()))
|
||||
if (GameObject* Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_1, PosHarpoon[0].GetPositionX(), PosHarpoon[0].GetPositionY(), PosHarpoon[0].GetPositionZ(), 4.790f, 0.0f, 0.0f, 0.0f, 0.0f, uint32(me->GetRespawnTime())))
|
||||
{
|
||||
if (GameObject* BrokenHarpoon = Harpoon->FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f)) //only nearest broken harpoon
|
||||
BrokenHarpoon->RemoveFromWorld();
|
||||
@@ -244,7 +244,7 @@ class boss_razorscale_controller : public CreatureScript
|
||||
return;
|
||||
case EVENT_BUILD_HARPOON_2:
|
||||
DoScriptText(EMOTE_HARPOON, me);
|
||||
if (GameObject* Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_2, PosHarpoon[1].GetPositionX(), PosHarpoon[1].GetPositionY(), PosHarpoon[1].GetPositionZ(), 4.659f, 0, 0, 0, 0, me->GetRespawnTime()))
|
||||
if (GameObject* Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_2, PosHarpoon[1].GetPositionX(), PosHarpoon[1].GetPositionY(), PosHarpoon[1].GetPositionZ(), 4.659f, 0, 0, 0, 0, uint32(me->GetRespawnTime())))
|
||||
{
|
||||
if (GameObject* BrokenHarpoon = Harpoon->FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f))
|
||||
BrokenHarpoon->RemoveFromWorld();
|
||||
@@ -253,7 +253,7 @@ class boss_razorscale_controller : public CreatureScript
|
||||
return;
|
||||
case EVENT_BUILD_HARPOON_3:
|
||||
DoScriptText(EMOTE_HARPOON, me);
|
||||
if (GameObject* Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_3, PosHarpoon[2].GetPositionX(), PosHarpoon[2].GetPositionY(), PosHarpoon[2].GetPositionZ(), 5.382f, 0, 0, 0, 0, me->GetRespawnTime()))
|
||||
if (GameObject* Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_3, PosHarpoon[2].GetPositionX(), PosHarpoon[2].GetPositionY(), PosHarpoon[2].GetPositionZ(), 5.382f, 0, 0, 0, 0, uint32(me->GetRespawnTime())))
|
||||
{
|
||||
if (GameObject* BrokenHarpoon = Harpoon->FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f))
|
||||
BrokenHarpoon->RemoveFromWorld();
|
||||
@@ -263,7 +263,7 @@ class boss_razorscale_controller : public CreatureScript
|
||||
return;
|
||||
case EVENT_BUILD_HARPOON_4:
|
||||
DoScriptText(EMOTE_HARPOON, me);
|
||||
if (GameObject* Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_4, PosHarpoon[3].GetPositionX(), PosHarpoon[3].GetPositionY(), PosHarpoon[3].GetPositionZ(), 4.266f, 0, 0, 0, 0, me->GetRespawnTime()))
|
||||
if (GameObject* Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_4, PosHarpoon[3].GetPositionX(), PosHarpoon[3].GetPositionY(), PosHarpoon[3].GetPositionZ(), 4.266f, 0, 0, 0, 0, uint32(me->GetRespawnTime())))
|
||||
{
|
||||
if (GameObject* BrokenHarpoon = Harpoon->FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f))
|
||||
BrokenHarpoon->RemoveFromWorld();
|
||||
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
sLog->outErrorDb("TCSR: Creature template entry %u has ScriptName npc_air_force_bots, but it's not handled by that script", pCreature->GetEntry());
|
||||
else
|
||||
{
|
||||
CreatureInfo const* spawnedTemplate = GetCreatureTemplateStore(m_pSpawnAssoc->m_uiSpawnedCreatureEntry);
|
||||
CreatureInfo const* spawnedTemplate = ObjectMgr::GetCreatureTemplate(m_pSpawnAssoc->m_uiSpawnedCreatureEntry);
|
||||
|
||||
if (!spawnedTemplate)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user