[HELP] with scripting a spell

Hello, I’m looking for a way to script any spell to do some extra damage like for example the same thing as doing .damage xxx ingame to a something or cast another spell when you cast it.

Any Help is Appreciated.


Here is what im working with atm.

#include “ScriptPCH.h”
#include “Player.h”
#include “ScriptMgr.h”
#include “SpellHistory.h”
#include “SpellScript.h”
#include “SpellAuraEffects.h”

class Test_Spell : public SpellScriptLoader
Test_Spell() : SpellScriptLoader(“Test_Spell”) { }

    class Test_Spell_SpellScript : public SpellScript


        void HandleDummy(SpellEffIndex)
                SpellInfo const* spellInfo = GetSpellInfo();
                CleanDamage const* cleanDamage = NULL;
                uint32 damage = 1000;
                Unit* caster = GetCaster();
                Unit* target = GetExplTargetUnit();

            if (!caster || caster->GetTypeId() != TYPEID_PLAYER)

            caster->ToUnit()->DealDamage(target, damage, cleanDamage, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_FIRE, spellInfo, true);

        void Register()
                OnEffectHit += SpellEffectFn(Test_Spell_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_SCHOOL_DAMAGE);


    SpellScript * GetSpellScript() const
            return new Test_Spell_SpellScript();

void AddSC_test_spell_scripts()
new Test_Spell;

Error that i get in worldserver.exe

Spell 133 Effect Index: EFFECT_1 Name: 2 of script Test_Spell did not match dbc effect data - handler bound to hook OnEffectHit of SpellScript won’t be executed

note that it compiles and starts up but just doesnt work

Well, you’ll have to modify game files (which is kinda against the rules of the community) unless you are editing existing spell (which sometimes can also involve game files edition).

What this error is saying is:

[ol][li]Spell ID: 133[/li]
[li]There is a mismatch of the effect in the dbc and effect you’ve added to the spell[/li]