aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-02-05 15:38:24 -0600
committermegamage <none@none>2009-02-05 15:38:24 -0600
commit2aff5260eada5a9a03a56ebce91f775105d7c92b (patch)
tree7721dc143492f4504de6d617d0954ebc07383b68 /src
parent649ab47d5467dde5ee5f749dad742fd0ca349a4d (diff)
*Allow scripts to override SQL and DBC data.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/ScriptMgr.cpp7
-rw-r--r--src/bindings/scripts/include/sc_creature.cpp21
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp1
-rw-r--r--src/game/ObjectMgr.cpp10
-rw-r--r--src/game/ObjectMgr.h2
6 files changed, 40 insertions, 5 deletions
diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp
index 0936c77617e..1dd7be1a8fb 100644
--- a/src/bindings/scripts/ScriptMgr.cpp
+++ b/src/bindings/scripts/ScriptMgr.cpp
@@ -64,6 +64,8 @@ uint32 EAI_ErrorLevel;
//*** End EventAI data ***
void FillSpellSummary();
+void LoadOverridenSQLData();
+void LoadOverridenDBCData();
// -- Scripts to be added --
@@ -1816,6 +1818,11 @@ void ScriptsInit()
// -------------------
outstring_log(">> Loaded %i C++ Scripts.", num_sc_scripts);
+
+ outstring_log(">> Load Overriden SQL Data.");
+ LoadOverridenSQLData();
+ outstring_log(">> Load Overriden DBC Data.");
+ LoadOverridenDBCData();
}
//*********************************
diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp
index f9f9e04235e..6ffa4261488 100644
--- a/src/bindings/scripts/include/sc_creature.cpp
+++ b/src/bindings/scripts/include/sc_creature.cpp
@@ -8,6 +8,7 @@
#include "precompiled.h"
#include "Item.h"
#include "Spell.h"
+#include "ObjectMgr.h"
// Spell summary for ScriptedAI::SelectSpell
struct TSpellSummary {
@@ -828,3 +829,23 @@ void Scripted_NoMovementAI::AttackStart(Unit* who)
DoStartNoMovement(who);
}
}
+
+void LoadOverridenSQLData()
+{
+ GameObjectInfo *goInfo;
+
+ // Sunwell Plateau : Kalecgos : Spectral Rift
+ goInfo = const_cast<GameObjectInfo*>(GetGameObjectInfo(187055));
+ if(goInfo && goInfo->type == GAMEOBJECT_TYPE_GOOBER)
+ goInfo->goober.lockId = 1714; // need LOCKTYPE_QUICK_OPEN
+}
+
+void LoadOverridenDBCData()
+{
+ SpellEntry *spellInfo;
+
+ // Black Temple : Illidan : Parasitic Shadowfiend Passive
+ spellInfo = const_cast<SpellEntry*>(GetSpellStore()->LookupEntry(41913));
+ if(spellInfo)
+ spellInfo->EffectApplyAuraName[0] = 4; // proc debuff, and summon infinite fiends
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp
index da50249b920..b104dba5807 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp
@@ -365,10 +365,6 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
pInstance = ((ScriptedInstance*)c->GetInstanceData());
m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true);
Reset();
-
- SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SHADOWFIEND_PASSIVE);
- if(TempSpell)
- TempSpell->EffectApplyAuraName[0] = 4; // proc debuff, and summon infinite fiends
}
ScriptedInstance* pInstance;
diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp
index 2141d8dcb2e..edcf0c09c13 100644
--- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp
+++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp
@@ -24,7 +24,6 @@ EndScriptData */
#include "precompiled.h"
#include "def_magisters_terrace.h"
#include "WorldPacket.h"
-#include "ObjectMgr.h"
#define SAY_AGGRO -1585023 //This yell should be done when the room is cleared. For now, set it as aggro yell.
#define SAY_PHOENIX -1585024
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index e62e7af0617..08fcc059b8b 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -7553,6 +7553,16 @@ ObjectMgr::ScriptNameMap & GetScriptNames()
return objmgr.GetScriptNames();
}
+GameObjectInfo const *GetGameObjectInfo(uint32 id)
+{
+ return objmgr.GetGameObjectInfo(id);
+}
+
+CreatureInfo const *GetCreatureInfo(uint32 id)
+{
+ return objmgr.GetCreatureTemplate(id);
+}
+
void ObjectMgr::LoadTransportEvents()
{
diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h
index cf1659cac42..a6c2ecbbdf2 100644
--- a/src/game/ObjectMgr.h
+++ b/src/game/ObjectMgr.h
@@ -944,5 +944,7 @@ TRINITY_DLL_SPEC bool LoadTrinityStrings(DatabaseType& db, char const* table,int
TRINITY_DLL_SPEC uint32 GetAreaTriggerScriptId(uint32 trigger_id);
TRINITY_DLL_SPEC uint32 GetScriptId(const char *name);
TRINITY_DLL_SPEC ObjectMgr::ScriptNameMap& GetScriptNames();
+TRINITY_DLL_SPEC GameObjectInfo const *GetGameObjectInfo(uint32 id);
+TRINITY_DLL_SPEC CreatureInfo const *GetCreatureInfo(uint32 id);
#endif