Advertisement
Zydraxy

Untitled

May 10th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.24 KB | None | 0 0
  1. diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
  2. index aa4f3cc..6d26b9e 100644
  3. --- a/src/server/scripts/Spells/spell_warlock.cpp
  4. +++ b/src/server/scripts/Spells/spell_warlock.cpp
  5. @@ -645,6 +645,12 @@ class spell_warl_haunt : public SpellScriptLoader
  6.  
  7.              void HandleAfterHit()
  8.              {
  9. +                if (Unit* target = GetExplTargetUnit())
  10. +                {
  11. +                    if (!target->IsAlive())
  12. +                        GetCaster()->GetSpellHistory()->ResetCooldown(48181, true);
  13. +                }
  14. +
  15.                  if (Aura* aura = GetHitAura())
  16.                      if (AuraEffect* aurEff = aura->GetEffect(EFFECT_1))
  17.                          aurEff->SetAmount(CalculatePct(aurEff->GetAmount(), GetHitDamage()));
  18. @@ -660,25 +666,21 @@ class spell_warl_haunt : public SpellScriptLoader
  19.          {
  20.              PrepareAuraScript(spell_warl_haunt_AuraScript);
  21.  
  22. -            bool Validate(SpellInfo const* /*spellInfo*/) override
  23. -            {
  24. -                if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_HAUNT_HEAL))
  25. -                    return false;
  26. -                return true;
  27. -            }
  28. -
  29.              void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
  30.              {
  31.                  if (Unit* caster = GetCaster())
  32.                  {
  33. -                    int32 amount = aurEff->GetAmount();
  34. -                    GetTarget()->CastCustomSpell(caster, SPELL_WARLOCK_HAUNT_HEAL, &amount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
  35. +                    if (Unit* target = GetTarget())
  36. +                    {
  37. +                        if (!target->IsAlive())
  38. +                            caster->GetSpellHistory()->ResetCooldown(48181, true);
  39. +                    }
  40.                  }
  41.              }
  42.  
  43.              void Register() override
  44.              {
  45. -                OnEffectRemove += AuraEffectApplyFn(spell_warl_haunt_AuraScript::HandleRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
  46. +                OnEffectRemove += AuraEffectApplyFn(spell_warl_haunt_AuraScript::HandleRemove, EFFECT_1, SPELL_AURA_MOD_SCHOOL_MASK_DAMAGE_FROM_CASTER, AURA_EFFECT_HANDLE_REAL);
  47.              }
  48.          };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement