diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 9 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 44 |
2 files changed, 43 insertions, 10 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index fc3a9efb908..ef695bb1eea 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6235,15 +6235,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { switch (dummySpell->SpellIconID) { - case 267: // Improved Mend Pet - { - int32 chance = triggeredByAura->GetSpellInfo()->Effects[triggeredByAura->GetEffIndex()].CalcValue(); - if (!roll_chance_i(chance)) - return false; - - triggered_spell_id = 24406; - break; - } case 2236: // Thrill of the Hunt { if (!procSpell) diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 98ba9babb63..aca46c252da 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -39,6 +39,7 @@ enum HunterSpells SPELL_HUNTER_CHIMERA_SHOT_VIPER = 53358, SPELL_HUNTER_CHIMERA_SHOT_SCORPID = 53359, SPELL_HUNTER_GLYPH_OF_ASPECT_OF_THE_VIPER = 56851, + SPELL_HUNTER_IMPROVED_MEND_PET = 24406, SPELL_HUNTER_INVIGORATION_TRIGGERED = 53398, SPELL_HUNTER_MASTERS_CALL_TRIGGERED = 62305, SPELL_HUNTER_MISDIRECTION_PROC = 35079, @@ -50,7 +51,7 @@ enum HunterSpells SPELL_HUNTER_READINESS = 23989, SPELL_HUNTER_SNIPER_TRAINING_R1 = 53302, SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1 = 64418, - SPELL_DRAENEI_GIFT_OF_THE_NAARU = 59543, + SPELL_DRAENEI_GIFT_OF_THE_NAARU = 59543 }; // 13161 - Aspect of the Beast @@ -270,6 +271,46 @@ class spell_hun_disengage : public SpellScriptLoader } }; +// -19572 - Improved Mend Pet +class spell_hun_improved_mend_pet : public SpellScriptLoader +{ + public: + spell_hun_improved_mend_pet() : SpellScriptLoader("spell_hun_improved_mend_pet") { } + + class spell_hun_improved_mend_pet_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_improved_mend_pet_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_IMPROVED_MEND_PET)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& /*eventInfo*/) + { + return roll_chance_i(GetEffect(EFFECT_0)->GetAmount()); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->CastSpell(GetTarget(), SPELL_HUNTER_IMPROVED_MEND_PET, true, NULL, aurEff); + } + + void Register() OVERRIDE + { + DoCheckProc += AuraCheckProcFn(spell_hun_improved_mend_pet_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_hun_improved_mend_pet_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_hun_improved_mend_pet_AuraScript(); + } +}; // 53412 - Invigoration class spell_hun_invigoration : public SpellScriptLoader { @@ -808,6 +849,7 @@ void AddSC_hunter_spell_scripts() new spell_hun_ascpect_of_the_viper(); new spell_hun_chimera_shot(); new spell_hun_disengage(); + new spell_hun_improved_mend_pet(); new spell_hun_invigoration(); new spell_hun_last_stand_pet(); new spell_hun_masters_call(); |