mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
Core/Spells: Hunter ability Master's Call should not process effects when pet is dead.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
PrepareSpellScript(spell_hun_masters_call_SpellScript)
|
||||
bool Validate(SpellInfo const* spellEntry)
|
||||
{
|
||||
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 (!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())
|
||||
{
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user