diff options
| author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-30 21:54:16 +0200 |
|---|---|---|
| committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-30 21:54:16 +0200 |
| commit | d50eafad6d213437c60fce2009e6485b3024ec10 (patch) | |
| tree | a2eb5199e32adab0893dd21e7896dd1296ef5e57 /src/server/scripts/Spells | |
| parent | 7cb1b21f5ec579f174e1adc5b5f526e047e6a7be (diff) | |
Core/Spells: Fix hunter "Cobra Shot"
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index e2686eab3ac..9456dc8fdcb 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -35,6 +35,7 @@ enum HunterSpells SPELL_HUNTER_BESTIAL_WRATH = 19574, SPELL_HUNTER_CHIMERA_SHOT_HEAL = 53353, SPELL_HUNTER_FIRE = 82926, + SPELL_HUNTER_GENERIC_ENERGIZE_FOCUS = 91954, SPELL_HUNTER_IMPROVED_MEND_PET = 24406, SPELL_HUNTER_INVIGORATION_TRIGGERED = 53398, SPELL_HUNTER_LOCK_AND_LOAD = 56453, @@ -73,6 +74,11 @@ class spell_hun_chimera_shot : public SpellScriptLoader return true; } + bool Load() OVERRIDE + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + void HandleScriptEffect(SpellEffIndex /*effIndex*/) { GetCaster()->CastSpell(GetCaster(), SPELL_HUNTER_CHIMERA_SHOT_HEAL, true); @@ -93,6 +99,52 @@ class spell_hun_chimera_shot : public SpellScriptLoader } }; +// 77767 - Cobra Shot +class spell_hun_cobra_shot : public SpellScriptLoader +{ + public: + spell_hun_cobra_shot() : SpellScriptLoader("spell_hun_cobra_shot") { } + + class spell_hun_cobra_shot_SpellScript : public SpellScript + { + PrepareSpellScript(spell_hun_cobra_shot_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_GENERIC_ENERGIZE_FOCUS) || + !sSpellMgr->GetSpellInfo(SPELL_HUNTER_SERPENT_STING)) + return false; + return true; + } + + bool Load() OVERRIDE + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetCaster(), SPELL_HUNTER_GENERIC_ENERGIZE_FOCUS, true); + + if (Aura* aur = GetHitUnit()->GetAura(SPELL_HUNTER_SERPENT_STING, GetCaster()->GetGUID())) + { + int32 newDuration = aur->GetDuration() + GetEffectValue() * IN_MILLISECONDS; + aur->SetDuration(std::min(newDuration, aur->GetMaxDuration()), true); + } + } + + void Register() OVERRIDE + { + OnEffectHitTarget += SpellEffectFn(spell_hun_cobra_shot_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_hun_cobra_shot_SpellScript(); + } +}; + // 781 - Disengage class spell_hun_disengage : public SpellScriptLoader { @@ -932,7 +984,6 @@ class spell_hun_thrill_of_the_hunt : public SpellScriptLoader } }; - // -56333 - T.N.T. class spell_hun_tnt : public SpellScriptLoader { @@ -977,6 +1028,7 @@ class spell_hun_tnt : public SpellScriptLoader void AddSC_hunter_spell_scripts() { new spell_hun_chimera_shot(); + new spell_hun_cobra_shot(); new spell_hun_disengage(); new spell_hun_fire(); new spell_hun_improved_mend_pet(); |
