diff options
Diffstat (limited to 'src/server/scripts')
-rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 69 |
1 files changed, 68 insertions, 1 deletions
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index a75294ad6e0..7888588b416 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -59,7 +59,9 @@ enum HunterSpells SPELL_HUNTER_VICIOUS_VIPER = 61609, SPELL_HUNTER_VIPER_ATTACK_SPEED = 60144, SPELL_DRAENEI_GIFT_OF_THE_NAARU = 59543, - SPELL_ROAR_OF_SACRIFICE_TRIGGERED = 67481 + SPELL_ROAR_OF_SACRIFICE_TRIGGERED = 67481, + SPELL_LOCK_AND_LOAD_TRIGGER = 56453, + SPELL_LOCK_AND_LOAD_MARKER = 67544 }; // 13161 - Aspect of the Beast @@ -476,6 +478,70 @@ class spell_hun_last_stand_pet : public SpellScriptLoader } }; +// -56342 - Lock and Load +class spell_hun_lock_and_load : public SpellScriptLoader +{ + public: + spell_hun_lock_and_load() : SpellScriptLoader("spell_hun_lock_and_load") { } + + class spell_hun_lock_and_load_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_lock_and_load_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_LOCK_AND_LOAD_TRIGGER) || + !sSpellMgr->GetSpellInfo(SPELL_LOCK_AND_LOAD_MARKER)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + if (eventInfo.GetActor()->HasAura(SPELL_LOCK_AND_LOAD_MARKER)) + return false; + + return true; + } + + template <uint32 mask> + void HandleProcs(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + if (!(eventInfo.GetTypeMask() & mask)) + return; + + if (!roll_chance_i(aurEff->GetAmount())) + return; + + Unit* caster = eventInfo.GetActor(); + caster->CastSpell(caster, SPELL_LOCK_AND_LOAD_TRIGGER, true); + } + + void ApplyMarker(ProcEventInfo& eventInfo) + { + Unit* caster = eventInfo.GetActor(); + caster->CastSpell(caster, SPELL_LOCK_AND_LOAD_MARKER, true); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_hun_lock_and_load_AuraScript::CheckProc); + + OnEffectProc += AuraEffectProcFn(spell_hun_lock_and_load_AuraScript::HandleProcs<PROC_FLAG_DONE_TRAP_ACTIVATION>, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + OnEffectProc += AuraEffectProcFn(spell_hun_lock_and_load_AuraScript::HandleProcs<PROC_FLAG_DONE_PERIODIC>, EFFECT_1, SPELL_AURA_DUMMY); + + AfterProc += AuraProcFn(spell_hun_lock_and_load_AuraScript::ApplyMarker); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_hun_lock_and_load_AuraScript(); + } +}; + // 53271 - Masters Call class spell_hun_masters_call : public SpellScriptLoader { @@ -1168,6 +1234,7 @@ void AddSC_hunter_spell_scripts() new spell_hun_improved_mend_pet(); new spell_hun_invigoration(); new spell_hun_last_stand_pet(); + new spell_hun_lock_and_load(); new spell_hun_masters_call(); new spell_hun_misdirection(); new spell_hun_misdirection_proc(); |