diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 70 |
1 files changed, 36 insertions, 34 deletions
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index afc1ee056d6..2c134f6a0b8 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -209,50 +209,52 @@ public: class spell_hun_masters_call : public SpellScriptLoader { -public: - spell_hun_masters_call() : SpellScriptLoader("spell_hun_masters_call") { } + public: + spell_hun_masters_call() : SpellScriptLoader("spell_hun_masters_call") { } - class spell_hun_masters_call_SpellScript : public SpellScript - { - PrepareSpellScript(spell_hun_masters_call_SpellScript) - bool Validate(SpellInfo const* spellEntry) + class spell_hun_masters_call_SpellScript : public SpellScript { - if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_MASTERS_CALL_TRIGGERED)) - return false; - if (!sSpellMgr->GetSpellInfo(spellEntry->Effects[EFFECT_0].CalcValue())) - return false; - if (!sSpellMgr->GetSpellInfo(spellEntry->Effects[EFFECT_1].CalcValue())) - return false; - return true; - } + PrepareSpellScript(spell_hun_masters_call_SpellScript) + bool Validate(SpellInfo const* spellEntry) + { + if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_MASTERS_CALL_TRIGGERED)) + return false; + if (!sSpellMgr->GetSpellInfo(spellEntry->Effects[EFFECT_0].CalcValue())) + return false; + if (!sSpellMgr->GetSpellInfo(spellEntry->Effects[EFFECT_1].CalcValue())) + return false; + return true; + } - void HandleScriptEffect(SpellEffIndex /*effIndex*/) - { - if (Unit* target = GetHitUnit()) + void HandleScriptEffect(SpellEffIndex /*effIndex*/) { - target->CastSpell(target, GetEffectValue(), true); - target->CastSpell(target, HUNTER_SPELL_MASTERS_CALL_TRIGGERED, true); - // there is a possibility that this effect should access effect 0 (dummy) target, but i dubt that - // it's more likely that on on retail it's possible to call target selector based on dbc values - // anyways, we're using GetTargetUnit() here and it's ok - if (Unit* ally = GetTargetUnit()) + if (Unit* target = GetHitUnit()) { - target->CastSpell(ally, GetEffectValue(), true); - target->CastSpell(ally, GetSpellInfo()->Effects[EFFECT_0].CalcValue(), true); + // Cannot be processed while pet is dead + TriggerCastFlags castMask = TriggerCastFlags(TRIGGERED_FULL_MASK | ~TRIGGERED_IGNORE_CASTER_AURASTATE); + target->CastSpell(target, GetEffectValue(), castMask); + target->CastSpell(target, HUNTER_SPELL_MASTERS_CALL_TRIGGERED, castMask); + // there is a possibility that this effect should access effect 0 (dummy) target, but i dubt that + // it's more likely that on on retail it's possible to call target selector based on dbc values + // anyways, we're using GetTargetUnit() here and it's ok + if (Unit* ally = GetTargetUnit()) + { + target->CastSpell(ally, GetEffectValue(), castMask); + target->CastSpell(ally, GetSpellInfo()->Effects[EFFECT_0].CalcValue(), castMask); + } } } - } - void Register() + void Register() + { + OnEffect += SpellEffectFn(spell_hun_masters_call_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const { - OnEffect += SpellEffectFn(spell_hun_masters_call_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + return new spell_hun_masters_call_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_hun_masters_call_SpellScript(); - } }; class spell_hun_readiness : public SpellScriptLoader |