diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2016-11-19 03:05:44 -0300 |
|---|---|---|
| committer | ariel- <ariel-@users.noreply.github.com> | 2016-11-19 03:05:44 -0300 |
| commit | 5b56c94e6d9510fb9cd835216dde7181371a2454 (patch) | |
| tree | 061b0b26294a6598b43fc076b03b5b40ebe650b2 /src/server/scripts/Pet | |
| parent | 503259e6fe0a1e6328090a5a2e88832b6a017516 (diff) | |
Core/Spell: restore old proc system behaviour on auras self proc.
- Use Spell::m_triggeredByAuraSpell and compare against trigger aura, it requires scripts to set triggeredByAura parameter.
- Fixed existing scripts lacking it
DB/Spell: Anger Capacitor (Tiny Abomination in a Jar) proc
Closes #18269
Diffstat (limited to 'src/server/scripts/Pet')
| -rw-r--r-- | src/server/scripts/Pet/pet_hunter.cpp | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/src/server/scripts/Pet/pet_hunter.cpp b/src/server/scripts/Pet/pet_hunter.cpp index a155dbc36c4..7092300af4d 100644 --- a/src/server/scripts/Pet/pet_hunter.cpp +++ b/src/server/scripts/Pet/pet_hunter.cpp @@ -42,6 +42,10 @@ enum PetSpellsMisc SPELL_PET_GUARD_DOG_HAPPINESS = 54445, SPELL_PET_SILVERBACK_RANK_1 = 62800, SPELL_PET_SILVERBACK_RANK_2 = 62801, + + SPELL_PET_SWOOP = 52825, + SPELL_PET_CHARGE = 61685, + PET_ICON_ID_GROWL = 201, PET_ICON_ID_CLAW = 262, PET_ICON_ID_BITE = 1680, @@ -162,10 +166,29 @@ class spell_pet_charge : public SpellScriptLoader { PrepareAuraScript(spell_pet_charge_AuraScript); - void HandleDummy(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_PET_SWOOP) || + !sSpellMgr->GetSpellInfo(SPELL_PET_CHARGE)) + return false; + return true; + } + + void HandleDummy(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) { // Prevent console log PreventDefaultAction(); + + // Remove +% AP aura + Unit* pet = eventInfo.GetActor(); + Aura* aura = pet->GetAura(SPELL_PET_SWOOP, pet->GetGUID()); + if (!aura) + aura = pet->GetAura(SPELL_PET_CHARGE, pet->GetGUID()); + + if (!aura) + return; + + aura->DropCharge(AURA_REMOVE_BY_EXPIRE); } void Register() override @@ -213,7 +236,7 @@ class spell_pet_guard_dog : public SpellScriptLoader PreventDefaultAction(); Unit* caster = eventInfo.GetActor(); - caster->CastSpell((Unit*)nullptr, SPELL_PET_GUARD_DOG_HAPPINESS, true); + caster->CastSpell((Unit*)nullptr, SPELL_PET_GUARD_DOG_HAPPINESS, true, nullptr, aurEff); float addThreat = CalculatePct(ASSERT_NOTNULL(eventInfo.GetSpellInfo())->Effects[EFFECT_0].CalcValue(caster), aurEff->GetAmount()); eventInfo.GetProcTarget()->AddThreat(caster, addThreat); @@ -260,14 +283,14 @@ class spell_pet_silverback : public SpellScriptLoader return true; } - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { static uint32 const triggerSpell[2] = { SPELL_PET_SILVERBACK_RANK_1, SPELL_PET_SILVERBACK_RANK_2 }; PreventDefaultAction(); uint32 spellId = triggerSpell[GetSpellInfo()->GetRank() - 1]; - eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true); + eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true, nullptr, aurEff); } void Register() override |
