Scripts/Spells: Fixed remaining spells with SPELL_ATTR3_CAN_PROC_FROM_PROCS attribute
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "Pet.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum HunterSpells
|
||||
@@ -40,6 +41,10 @@ enum HunterSpells
|
||||
SPELL_HUNTER_EXHILARATION_PET = 128594,
|
||||
SPELL_HUNTER_EXHILARATION_R2 = 231546,
|
||||
SPELL_HUNTER_EXPLOSIVE_SHOT_DAMAGE = 212680,
|
||||
SPELL_HUNTER_LATENT_POISON_STACK = 378015,
|
||||
SPELL_HUNTER_LATENT_POISON_DAMAGE = 378016,
|
||||
SPELL_HUNTER_LATENT_POISON_INJECTORS_STACK = 336903,
|
||||
SPELL_HUNTER_LATENT_POISON_INJECTORS_DAMAGE = 336904,
|
||||
SPELL_HUNTER_LONE_WOLF = 155228,
|
||||
SPELL_HUNTER_MASTERS_CALL_TRIGGERED = 62305,
|
||||
SPELL_HUNTER_MISDIRECTION = 34477,
|
||||
@@ -54,6 +59,7 @@ enum HunterSpells
|
||||
SPELL_HUNTER_RAPID_FIRE_ENERGIZE = 263585,
|
||||
SPELL_HUNTER_STEADY_SHOT_FOCUS = 77443,
|
||||
SPELL_HUNTER_T9_4P_GREATNESS = 68130,
|
||||
SPELL_HUNTER_T29_2P_MARKSMANSHIP_DAMAGE = 394371,
|
||||
SPELL_ROAR_OF_SACRIFICE_TRIGGERED = 67481
|
||||
};
|
||||
|
||||
@@ -130,6 +136,27 @@ class spell_hun_aspect_cheetah : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
// 378750 - Cobra Sting
|
||||
class spell_hun_cobra_sting : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hun_cobra_sting);
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
|
||||
}
|
||||
|
||||
bool RollProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*procInfo*/)
|
||||
{
|
||||
return roll_chance_i(GetEffect(EFFECT_1)->GetAmount());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckEffectProc += AuraCheckEffectProcFn(spell_hun_cobra_sting::RollProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
// 109304 - Exhilaration
|
||||
class spell_hun_exhilaration : public SpellScript
|
||||
{
|
||||
@@ -225,6 +252,104 @@ class spell_hun_last_stand_pet : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
// 378016 - Latent Poison
|
||||
class spell_hun_latent_poison_damage : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_hun_latent_poison_damage);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_LATENT_POISON_STACK });
|
||||
}
|
||||
|
||||
void CalculateDamage()
|
||||
{
|
||||
if (Aura* stack = GetHitUnit()->GetAura(SPELL_HUNTER_LATENT_POISON_STACK, GetCaster()->GetGUID()))
|
||||
{
|
||||
SetHitDamage(GetHitDamage() * stack->GetStackAmount());
|
||||
stack->Remove();
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnHit += SpellHitFn(spell_hun_latent_poison_damage::CalculateDamage);
|
||||
}
|
||||
};
|
||||
|
||||
// 19434 - Aimed Shot
|
||||
// 186270 - Raptor Strike
|
||||
// 217200 - Barbed Shot
|
||||
// 259387 - Mongoose Bite
|
||||
class spell_hun_latent_poison_trigger : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_hun_latent_poison_trigger);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_LATENT_POISON_STACK, SPELL_HUNTER_LATENT_POISON_DAMAGE });
|
||||
}
|
||||
|
||||
void TriggerDamage()
|
||||
{
|
||||
if (GetHitUnit()->HasAura(SPELL_HUNTER_LATENT_POISON_STACK, GetCaster()->GetGUID()))
|
||||
GetCaster()->CastSpell(GetHitUnit(), SPELL_HUNTER_LATENT_POISON_DAMAGE, GetSpell());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterHit += SpellHitFn(spell_hun_latent_poison_trigger::TriggerDamage);
|
||||
}
|
||||
};
|
||||
|
||||
// 336904 - Latent Poison Injectors
|
||||
class spell_hun_latent_poison_injectors_damage : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_hun_latent_poison_injectors_damage);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_LATENT_POISON_INJECTORS_STACK });
|
||||
}
|
||||
|
||||
void CalculateDamage()
|
||||
{
|
||||
if (Aura* stack = GetHitUnit()->GetAura(SPELL_HUNTER_LATENT_POISON_INJECTORS_STACK, GetCaster()->GetGUID()))
|
||||
{
|
||||
SetHitDamage(GetHitDamage() * stack->GetStackAmount());
|
||||
stack->Remove();
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnHit += SpellHitFn(spell_hun_latent_poison_injectors_damage::CalculateDamage);
|
||||
}
|
||||
};
|
||||
|
||||
// 186270 - Raptor Strike
|
||||
// 259387 - Mongoose Bite
|
||||
class spell_hun_latent_poison_injectors_trigger : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_hun_latent_poison_injectors_trigger);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_LATENT_POISON_INJECTORS_STACK, SPELL_HUNTER_LATENT_POISON_INJECTORS_DAMAGE });
|
||||
}
|
||||
|
||||
void TriggerDamage()
|
||||
{
|
||||
if (GetHitUnit()->HasAura(SPELL_HUNTER_LATENT_POISON_INJECTORS_STACK, GetCaster()->GetGUID()))
|
||||
GetCaster()->CastSpell(GetHitUnit(), SPELL_HUNTER_LATENT_POISON_INJECTORS_DAMAGE, GetSpell());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterHit += SpellHitFn(spell_hun_latent_poison_injectors_trigger::TriggerDamage);
|
||||
}
|
||||
};
|
||||
|
||||
// 53271 - Masters Call
|
||||
class spell_hun_masters_call : public SpellScript
|
||||
{
|
||||
@@ -674,14 +799,49 @@ class spell_hun_t9_4p_bonus : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
// 394366 - Find The Mark
|
||||
class spell_hun_t29_2p_marksmanship_bonus : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hun_t29_2p_marksmanship_bonus);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellEffect({ { SPELL_HUNTER_T29_2P_MARKSMANSHIP_DAMAGE, EFFECT_0 } })
|
||||
&& sSpellMgr->AssertSpellInfo(SPELL_HUNTER_T29_2P_MARKSMANSHIP_DAMAGE, DIFFICULTY_NONE)->GetMaxTicks();
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
uint32 ticks = sSpellMgr->AssertSpellInfo(SPELL_HUNTER_T29_2P_MARKSMANSHIP_DAMAGE, DIFFICULTY_NONE)->GetMaxTicks();
|
||||
uint32 damage = CalculatePct(eventInfo.GetDamageInfo()->GetOriginalDamage(), aurEff->GetAmount()) / ticks;
|
||||
|
||||
caster->CastSpell(eventInfo.GetActionTarget(), SPELL_HUNTER_T29_2P_MARKSMANSHIP_DAMAGE, CastSpellExtraArgs(aurEff)
|
||||
.SetTriggeringSpell(eventInfo.GetProcSpell())
|
||||
.AddSpellMod(SPELLVALUE_BASE_POINT0, damage));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_hun_t29_2p_marksmanship_bonus::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_hunter_spell_scripts()
|
||||
{
|
||||
RegisterSpellScript(spell_hun_a_murder_of_crows);
|
||||
RegisterSpellScript(spell_hun_aspect_cheetah);
|
||||
RegisterSpellScript(spell_hun_cobra_sting);
|
||||
RegisterSpellScript(spell_hun_exhilaration);
|
||||
RegisterSpellScript(spell_hun_explosive_shot);
|
||||
RegisterSpellScript(spell_hun_hunting_party);
|
||||
RegisterSpellScript(spell_hun_last_stand_pet);
|
||||
RegisterSpellScript(spell_hun_latent_poison_damage);
|
||||
RegisterSpellScript(spell_hun_latent_poison_trigger);
|
||||
RegisterSpellScript(spell_hun_latent_poison_injectors_damage);
|
||||
RegisterSpellScript(spell_hun_latent_poison_injectors_trigger);
|
||||
RegisterSpellScript(spell_hun_masters_call);
|
||||
RegisterSpellScript(spell_hun_misdirection);
|
||||
RegisterSpellScript(spell_hun_misdirection_proc);
|
||||
@@ -695,4 +855,5 @@ void AddSC_hunter_spell_scripts()
|
||||
RegisterSpellScript(spell_hun_steady_shot);
|
||||
RegisterSpellScript(spell_hun_tame_beast);
|
||||
RegisterSpellScript(spell_hun_t9_4p_bonus);
|
||||
RegisterSpellScript(spell_hun_t29_2p_marksmanship_bonus);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user