Revert part of "Core: Removed unused functions (leftovers from sd2, was needed when scripts were built as separate dll)", this part wasnt intended
This reverts commit partly e1bacef346.
This commit is contained in:
@@ -9180,6 +9180,11 @@ 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);
|
||||
}
|
||||
|
||||
CreatureBaseStats const* ObjectMgr::GetCreatureBaseStats(uint8 level, uint8 unitClass)
|
||||
{
|
||||
CreatureBaseStatsMap::const_iterator it = m_creatureBaseStatsMap.find(MAKE_PAIR16(level,unitClass));
|
||||
|
||||
@@ -1421,5 +1421,6 @@ class ObjectMgr
|
||||
|
||||
// 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 GetScriptId(const char *name);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -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 = sObjectMgr->GetScriptId(script->GetName().c_str());
|
||||
uint32 id = GetScriptId(script->GetName().c_str());
|
||||
if (id)
|
||||
{
|
||||
// Try to find an existing script.
|
||||
|
||||
@@ -71,7 +71,7 @@ class boss_bronjahm : public CreatureScript
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != sObjectMgr->GetScriptId(FoSScriptName))
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != 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() != sObjectMgr->GetScriptId(FoSScriptName))
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != 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() != sObjectMgr->GetScriptId(PoSScriptName))
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != 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() != sObjectMgr->GetScriptId(PoSScriptName))
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != 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() != sObjectMgr->GetScriptId(PoSScriptName))
|
||||
if (!_instanceScript || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != 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() != sObjectMgr->GetScriptId(PoSScriptName))
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(PoSScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (instance->GetBossState(DATA_TYRANNUS) != DONE)
|
||||
Reset();
|
||||
|
||||
@@ -377,7 +377,7 @@ CreatureAI* GetIcecrownCitadelAI(Creature* creature)
|
||||
{
|
||||
if (InstanceMap* instance = creature->GetMap()->ToInstanceMap())
|
||||
if (instance->GetInstanceScript())
|
||||
if (instance->GetScriptId() == sObjectMgr->GetScriptId(ICCScriptName))
|
||||
if (instance->GetScriptId() == GetScriptId(ICCScriptName))
|
||||
return new AI(creature);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user