Guest User

Untitled

a guest
Nov 24th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. class spell_tournament_melee : public SpellScriptLoader
  2. {
  3. public:
  4. spell_tournament_melee() : SpellScriptLoader("spell_tournament_melee") { }
  5.  
  6. class spell_tournament_melee_SpellScript : public SpellScript
  7. {
  8. PrepareSpellScript(spell_tournament_melee_SpellScript);
  9.  
  10. void HandleEffectScriptEffect(SpellEffIndex /*effIndex*/)
  11. {
  12. if (Unit* pTarget = GetHitUnit())
  13. {
  14. if (Unit *caster = GetCaster())
  15. {
  16. if (pTarget->GetTypeId() == TYPEID_UNIT && pTarget->ToCreature()->GetEntry() == 33229)
  17. {
  18. // Kill Credit
  19. if (Unit *player = caster->GetCharmerOrOwner())
  20. player->CastSpell(player,62672,true);
  21. }
  22. }
  23. }
  24. }
  25.  
  26. void Register()
  27. {
  28. OnEffect += SpellEffectFn(spell_tournament_melee_SpellScript::HandleEffectScriptEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
  29. }
  30. };
  31.  
  32. SpellScript *GetSpellScript() const
  33. {
  34. return new spell_tournament_melee_SpellScript();
  35. }
  36. };
Add Comment
Please, Sign In to add comment