MichaelCrow

Untitled

Jul 22nd, 2019
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. class spell_mage_flame_burst : public SpellScriptLoader
  2. {
  3. public:
  4. spell_mage_flame_burst() : SpellScriptLoader("spell_mage_flame_burst")
  5. {
  6.  
  7. }
  8.  
  9. class spell_mage_flame_burst_SpellScript : public SpellScript
  10. {
  11. PrepareSpellScript(spell_mage_flame_burst_SpellScript);
  12.  
  13. bool Validate(SpellInfo const* spellInfo)
  14. {
  15. return true;
  16. }
  17.  
  18. bool Load()
  19. {
  20. return true;
  21. }
  22.  
  23. void handleMiscOnEffectScriptEffect(SpellEffIndex effectIndex)
  24. {
  25. if (Unit* target = GetExplTargetUnit())
  26. {
  27. // Combusion impact = stun
  28. if (GetCaster())
  29. {
  30. GetCaster()->CastSpell(target, spell_mage_flame_burst_IMPACT);
  31. }
  32.  
  33. // Periodic damages
  34. if (Aura* ignite = target->GetAura(SPELL_MAGE_IGNITE))
  35. {
  36. if (GetCaster() && target)
  37. {
  38. GetCaster()->CastSpell(target, spell_mage_flame_burst_DOT);
  39. Aura* combustionDot = target->GetAura(spell_mage_flame_burst_DOT);
  40. if (combustionDot && ignite)
  41. {
  42. combustionDot->GetEffect(0)->SetAmount(ignite->GetEffect(0)->GetAmount()*0.4);
  43. }
  44. }
  45. }
  46. }
  47. }
  48.  
  49. void Register()
  50. {
  51. OnEffectHitTarget += SpellEffectFn(spell_mage_flame_burst_SpellScript::handleMiscOnEffectScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
  52. }
  53. };
  54.  
  55. SpellScript* GetSpellScript() const
  56. {
  57. return new spell_mage_flame_burst_SpellScript();
  58. }
  59. };
Advertisement
Add Comment
Please, Sign In to add comment