Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class spell_mage_flame_burst : public SpellScriptLoader
- {
- public:
- spell_mage_flame_burst() : SpellScriptLoader("spell_mage_flame_burst")
- {
- }
- class spell_mage_flame_burst_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_mage_flame_burst_SpellScript);
- bool Validate(SpellInfo const* spellInfo)
- {
- return true;
- }
- bool Load()
- {
- return true;
- }
- void handleMiscOnEffectScriptEffect(SpellEffIndex effectIndex)
- {
- if (Unit* target = GetExplTargetUnit())
- {
- // Combusion impact = stun
- if (GetCaster())
- {
- GetCaster()->CastSpell(target, spell_mage_flame_burst_IMPACT);
- }
- // Periodic damages
- if (Aura* ignite = target->GetAura(SPELL_MAGE_IGNITE))
- {
- if (GetCaster() && target)
- {
- GetCaster()->CastSpell(target, spell_mage_flame_burst_DOT);
- Aura* combustionDot = target->GetAura(spell_mage_flame_burst_DOT);
- if (combustionDot && ignite)
- {
- combustionDot->GetEffect(0)->SetAmount(ignite->GetEffect(0)->GetAmount()*0.4);
- }
- }
- }
- }
- }
- void Register()
- {
- OnEffectHitTarget += SpellEffectFn(spell_mage_flame_burst_SpellScript::handleMiscOnEffectScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
- }
- };
- SpellScript* GetSpellScript() const
- {
- return new spell_mage_flame_burst_SpellScript();
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment