diff options
author | QAston <none@none> | 2010-08-24 00:10:49 +0200 |
---|---|---|
committer | QAston <none@none> | 2010-08-24 00:10:49 +0200 |
commit | 07a3a1254b78a42a7836efee99dc3d821c726d28 (patch) | |
tree | a60eea1353da993ef27cef51e6a30cbabd92a47f /src/server/game/Scripting/ScriptMgr.h | |
parent | e581feb551cb54803da1478da04032e260b35937 (diff) |
*Add AuraScript class for scripting aura objects - scripts are registered same way as SpellScripts, bound to SpellScriptNames table. For more details see example_spell.cpp and SpellScript.h
*Rename SpellHandlerScript to SpellScriptLoader, EffectHandlerFn to SpellEffectFn, HitHandlerFn to SpellHitFn, SpellScript::EffectHandlers to SpellScript::OnEffect, these changes were neccesary to prevent namespace collisions, happily you can solve these by simple find and replace
*Make spells 66244 and 5581 example scripts.
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Scripting/ScriptMgr.h')
-rw-r--r-- | src/server/game/Scripting/ScriptMgr.h | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index c8baeddf48d..2bf023babf8 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -42,6 +42,7 @@ class Creature; class CreatureAI; class InstanceScript; class SpellScript; +class AuraScript; class Quest; class Item; class GameObject; @@ -180,32 +181,20 @@ template<class TObject> class UpdatableScript virtual void OnUpdate(TObject* /*obj*/, uint32 /*diff*/) { } }; -class SpellHandlerScript : public ScriptObject +class SpellScriptLoader : public ScriptObject { protected: - SpellHandlerScript(const char* name); + SpellScriptLoader(const char* name); public: bool IsDatabaseBound() const { return true; } // Should return a fully valid SpellScript pointer. - virtual SpellScript* GetSpellScript() const = 0; -}; - -class AuraHandlerScript : public ScriptObject -{ - protected: - - AuraHandlerScript(const char* name); - - public: - - bool IsDatabaseBound() const { return true; } - + virtual SpellScript* GetSpellScript() const { return NULL; }; // Should return a fully valid AuraScript pointer. - // virtual AuraScript* GetAuraScript() const = 0; + virtual AuraScript* GetAuraScript() const { return NULL; }; }; class ServerScript : public ScriptObject @@ -742,15 +731,11 @@ class ScriptMgr void IncrementScriptCount() { ++_scriptCount; } uint32 GetScriptCount() const { return _scriptCount; } - public: /* SpellHandlerScript */ + public: /* SpellScriptLoader */ void CreateSpellScripts(uint32 spell_id, std::list<SpellScript*>& script_vector); - void CreateSpellScripts(uint32 spell_id, std::vector<std::pair<SpellScript*, SpellScriptsMap::iterator> >& script_vector); - - public: /* AuraHandlerScript */ - - // void CreateAuraScripts(uint32 spell_id, std::list<AuraScript*>& script_vector); - // void CreateAuraScripts(uint32 spell_id, std::vector<std::pair<AuraScript*, SpellScriptsMap::iterator> >& script_vector); + void CreateAuraScripts(uint32 spell_id, std::list<AuraScript*>& script_vector); + void CreateSpellScriptLoaders(uint32 spell_id, std::vector<std::pair<SpellScriptLoader*, SpellScriptsMap::iterator> >& script_vector); public: /* ServerScript */ |