diff options
| author | Shauren <shauren.trinity@gmail.com> | 2023-05-24 22:10:04 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2023-05-24 22:10:04 +0200 |
| commit | 092119058ba11e6d9d0b929787693c70032aebe1 (patch) | |
| tree | cd5d7e1ff5a667f5d2ad7fc25f6441ca2673872e /src/server/scripts/Spells | |
| parent | db55a034fd689929404e3155424a9a7caff93232 (diff) | |
Scripts/Spells: Added proc requirements to a few auras that have SPELL_ATTR3_CAN_PROC_FROM_PROCS attribute
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_azerite.cpp | 61 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 81 |
2 files changed, 142 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_azerite.cpp b/src/server/scripts/Spells/spell_azerite.cpp index ffcbe6f1678..826ca9f3071 100644 --- a/src/server/scripts/Spells/spell_azerite.cpp +++ b/src/server/scripts/Spells/spell_azerite.cpp @@ -534,6 +534,41 @@ class spell_item_conflict_wearer_on_stun_proc : public AuraScript } }; +// 305723 - Strife (Azerite Essence) +class spell_item_conflict_rank3 : public AuraScript +{ + PrepareAuraScript(spell_item_conflict_rank3); + + bool CheckProc(ProcEventInfo& eventInfo) + { + if (eventInfo.GetHitMask() & (PROC_HIT_INTERRUPT | PROC_HIT_DISPEL)) + return true; + + Spell const* procSpell = eventInfo.GetProcSpell(); + if (!procSpell) + return false; + + bool isCrowdControl = procSpell->GetSpellInfo()->HasAura(SPELL_AURA_MOD_CONFUSE) + || procSpell->GetSpellInfo()->HasAura(SPELL_AURA_MOD_FEAR) + || procSpell->GetSpellInfo()->HasAura(SPELL_AURA_MOD_STUN) + || procSpell->GetSpellInfo()->HasAura(SPELL_AURA_MOD_PACIFY) + || procSpell->GetSpellInfo()->HasAura(SPELL_AURA_MOD_ROOT) + || procSpell->GetSpellInfo()->HasAura(SPELL_AURA_MOD_SILENCE) + || procSpell->GetSpellInfo()->HasAura(SPELL_AURA_MOD_PACIFY_SILENCE) + || procSpell->GetSpellInfo()->HasAura(SPELL_AURA_MOD_ROOT_2); + + if (!isCrowdControl) + return false; + + return eventInfo.GetActionTarget()->HasAura([&](Aura const* aura) { return aura->GetCastId() == procSpell->m_castId; }); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_item_conflict_rank3::CheckProc); + } +}; + // 277253 - Heart of Azeroth class spell_item_heart_of_azeroth : public AuraScript { @@ -568,6 +603,29 @@ class spell_item_heart_of_azeroth : public AuraScript } }; +// 315176 - Grasping Tendrils +class spell_item_corruption_grasping_tendrils : public AuraScript +{ + PrepareAuraScript(spell_item_corruption_grasping_tendrils); + + bool Load() override + { + return GetUnitOwner()->IsPlayer(); + } + + void CalcAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated) + { + Player* player = GetUnitOwner()->ToPlayer(); + amount = std::clamp(10.0f + player->GetRatingBonusValue(CR_CORRUPTION) - player->GetRatingBonusValue(CR_CORRUPTION_RESISTANCE), 0.0f, 99.0f); + canBeRecalculated = false; + } + + void Register() override + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_item_corruption_grasping_tendrils::CalcAmount, EFFECT_0, SPELL_AURA_MOD_DECREASE_SPEED); + } +}; + void AddSC_azerite_item_spell_scripts() { RegisterSpellScript(spell_azerite_gen_aura_calc_from_2nd_effect_triggered_spell); @@ -588,6 +646,9 @@ void AddSC_azerite_item_spell_scripts() RegisterSpellScript(spell_item_echoing_blades_damage); RegisterSpellScript(spell_item_hour_of_reaping); RegisterSpellScript(spell_item_conflict_wearer_on_stun_proc); + RegisterSpellScript(spell_item_conflict_rank3); RegisterSpellScript(spell_item_heart_of_azeroth); + + RegisterSpellScript(spell_item_corruption_grasping_tendrils); } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 9a360b6a152..6c16d72b086 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -4763,6 +4763,83 @@ class spell_item_zanjir_scaleguard_greatcloak : public AuraScript } }; +enum ShiverVenomSpell : uint32 +{ + SPELL_SHIVER_VENOM = 301624, + SPELL_SHIVERING_BOLT = 303559, + SPELL_VENOMOUS_LANCE = 303562 +}; + +// 303358 Venomous Bolt +// 303361 Shivering Lance +class spell_item_shiver_venom_weapon_proc : public AuraScript +{ + PrepareAuraScript(spell_item_shiver_venom_weapon_proc); + +public: + spell_item_shiver_venom_weapon_proc(ShiverVenomSpell additionalProcSpellId) : _additionalProcSpellId(additionalProcSpellId) { } + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_SHIVER_VENOM, _additionalProcSpellId }); + } + + void HandleAdditionalProc(AuraEffect* aurEff, ProcEventInfo& procInfo) + { + if (procInfo.GetProcTarget()->HasAura(SPELL_SHIVER_VENOM)) + procInfo.GetActor()->CastSpell(procInfo.GetProcTarget(), _additionalProcSpellId, CastSpellExtraArgs(aurEff) + .AddSpellMod(SPELLVALUE_BASE_POINT0, aurEff->GetAmount()) + .SetTriggeringSpell(procInfo.GetProcSpell())); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_shiver_venom_weapon_proc::HandleAdditionalProc, EFFECT_1, SPELL_AURA_DUMMY); + } + +private: + ShiverVenomSpell _additionalProcSpellId; +}; + +// 302774 - Arcane Tempest +class spell_item_phial_of_the_arcane_tempest_damage : public SpellScript +{ + PrepareSpellScript(spell_item_phial_of_the_arcane_tempest_damage); + + void ModifyStacks() + { + if (GetUnitTargetCountForEffect(EFFECT_0) != 1 || !GetTriggeringSpell()) + return; + + if (AuraEffect* aurEff = GetCaster()->GetAuraEffect(GetTriggeringSpell()->Id, EFFECT_0)) + { + aurEff->GetBase()->ModStackAmount(1, AURA_REMOVE_NONE, false); + aurEff->CalculatePeriodic(GetCaster(), false); + } + } + + void Register() override + { + AfterCast += SpellCastFn(spell_item_phial_of_the_arcane_tempest_damage::ModifyStacks); + } +}; + +// 302769 - Arcane Tempest +class spell_item_phial_of_the_arcane_tempest_periodic : public AuraScript +{ + PrepareAuraScript(spell_item_phial_of_the_arcane_tempest_periodic); + + void CalculatePeriod(AuraEffect const* /*aurEff*/, bool& /*isPeriodic*/, int32& period) + { + period -= (GetStackAmount() - 1) * 300; + } + + void Register() override + { + DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_item_phial_of_the_arcane_tempest_periodic::CalculatePeriod, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + void AddSC_item_spell_scripts() { // 23074 Arcanite Dragonling @@ -4913,4 +4990,8 @@ void AddSC_item_spell_scripts() RegisterSpellScript(spell_item_seeping_scourgewing_aoe_check); RegisterSpellScript(spell_item_grips_of_forsaken_sanity); RegisterSpellScript(spell_item_zanjir_scaleguard_greatcloak); + RegisterSpellScriptWithArgs(spell_item_shiver_venom_weapon_proc, "spell_item_shiver_venom_crossbow", SPELL_SHIVERING_BOLT); + RegisterSpellScriptWithArgs(spell_item_shiver_venom_weapon_proc, "spell_item_shiver_venom_lance", SPELL_VENOMOUS_LANCE); + RegisterSpellScript(spell_item_phial_of_the_arcane_tempest_damage); + RegisterSpellScript(spell_item_phial_of_the_arcane_tempest_periodic); } |
