aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/SpellMgr.cpp2
-rw-r--r--src/server/scripts/Shadowlands/Torghast/spell_torghast.cpp146
-rw-r--r--src/server/scripts/Shadowlands/shadowlands_script_loader.cpp26
-rw-r--r--src/server/scripts/Shadowlands/spell_covenant.cpp55
-rw-r--r--src/server/scripts/Spells/spell_azerite.cpp61
-rw-r--r--src/server/scripts/Spells/spell_item.cpp81
6 files changed, 370 insertions, 1 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 67c03d45b08..166172dd88a 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -1784,7 +1784,7 @@ void SpellMgr::LoadSpellProcs()
if (spellEffectInfo.IsAura())
{
TC_LOG_ERROR("sql.sql", "Spell Id {} has DBC ProcFlags 0x{:X} 0x{:X}, but it's of non-proc aura type, it probably needs an entry in `spell_proc` table to be handled correctly.",
- spellInfo.Id, spellInfo.ProcFlags[0], spellInfo.ProcFlags[1]);
+ spellInfo.Id, uint32(spellInfo.ProcFlags[0]), uint32(spellInfo.ProcFlags[1]));
break;
}
}
diff --git a/src/server/scripts/Shadowlands/Torghast/spell_torghast.cpp b/src/server/scripts/Shadowlands/Torghast/spell_torghast.cpp
new file mode 100644
index 00000000000..c9c7e681a77
--- /dev/null
+++ b/src/server/scripts/Shadowlands/Torghast/spell_torghast.cpp
@@ -0,0 +1,146 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "ScriptMgr.h"
+#include "SpellAuraEffects.h"
+#include "SpellHistory.h"
+#include "SpellMgr.h"
+#include "SpellScript.h"
+#include "Unit.h"
+
+// 300771 - Blade of the Lifetaker
+class spell_torghast_blade_of_the_lifetaker : public AuraScript
+{
+ PrepareAuraScript(spell_torghast_blade_of_the_lifetaker);
+
+ void HandleProc(AuraEffect* aurEff, ProcEventInfo& procInfo)
+ {
+ PreventDefaultAction();
+
+ procInfo.GetActor()->CastSpell(procInfo.GetProcTarget(), aurEff->GetSpellEffectInfo().TriggerSpell, CastSpellExtraArgs(aurEff)
+ .AddSpellMod(SPELLVALUE_BASE_POINT0, GetTarget()->CountPctFromMaxHealth(aurEff->GetAmount()))
+ .SetTriggeringSpell(procInfo.GetProcSpell()));
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_torghast_blade_of_the_lifetaker::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+};
+
+// 300796 - Touch of the Unseen
+class spell_torghast_touch_of_the_unseen : public AuraScript
+{
+ PrepareAuraScript(spell_torghast_touch_of_the_unseen);
+
+ static constexpr uint32 SPELL_DOOR_OF_SHADOWS = 300728;
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_DOOR_OF_SHADOWS });
+ }
+
+ bool CheckProc(ProcEventInfo& procInfo)
+ {
+ return procInfo.GetSpellInfo() && procInfo.GetSpellInfo()->Id == SPELL_DOOR_OF_SHADOWS;
+ }
+
+ void HandleProc(AuraEffect* aurEff, ProcEventInfo& procInfo)
+ {
+ PreventDefaultAction();
+
+ procInfo.GetActor()->CastSpell(procInfo.GetProcTarget(), aurEff->GetSpellEffectInfo().TriggerSpell, CastSpellExtraArgs(aurEff)
+ .AddSpellMod(SPELLVALUE_BASE_POINT0, GetTarget()->CountPctFromMaxHealth(aurEff->GetAmount()))
+ .SetTriggeringSpell(procInfo.GetProcSpell()));
+ }
+
+ void Register() override
+ {
+ DoCheckProc += AuraCheckProcFn(spell_torghast_touch_of_the_unseen::CheckProc);
+ OnEffectProc += AuraEffectProcFn(spell_torghast_touch_of_the_unseen::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+};
+
+// 305060 - Yel'Shir's Powerglove
+class spell_torghast_yelshirs_powerglove : public SpellScript
+{
+ PrepareSpellScript(spell_torghast_yelshirs_powerglove);
+
+ void HandleEffect(SpellEffIndex /*effIndex*/)
+ {
+ if (SpellInfo const* triggeringSpell = GetTriggeringSpell())
+ if (Aura const* triggerAura = GetCaster()->GetAura(triggeringSpell->Id))
+ SetEffectValue(GetEffectValue() * triggerAura->GetStackAmount());
+ }
+
+ void Register() override
+ {
+ OnEffectLaunchTarget += SpellEffectFn(spell_torghast_yelshirs_powerglove::HandleEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
+ }
+};
+
+// 321706 - Dimensional Blade
+class spell_torghast_dimensional_blade : public SpellScript
+{
+ PrepareSpellScript(spell_torghast_dimensional_blade);
+
+ static constexpr uint32 SPELL_MAGE_BLINK = 1953;
+ static constexpr uint32 SPELL_MAGE_SHIMMER = 212653;
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_MAGE_BLINK, SPELL_MAGE_SHIMMER });
+ }
+
+ void FilterTargets(std::list<WorldObject*>& targets)
+ {
+ if (!targets.empty())
+ {
+ GetCaster()->GetSpellHistory()->RestoreCharge(sSpellMgr->AssertSpellInfo(SPELL_MAGE_BLINK, DIFFICULTY_NONE)->ChargeCategoryId);
+ GetCaster()->GetSpellHistory()->RestoreCharge(sSpellMgr->AssertSpellInfo(SPELL_MAGE_SHIMMER, DIFFICULTY_NONE)->ChargeCategoryId);
+ }
+
+ // filter targets by entry here and not with conditions table because we need to know if any enemy was hit for charge restoration, not just mawrats
+ targets.remove_if([](WorldObject const* target)
+ {
+ switch (target->GetEntry())
+ {
+ case 151353: // Mawrat
+ case 179458: // Protective Mawrat
+ case 154030: // Oddly Large Mawrat
+ case 169871: // Hungry Mawrat
+ return false;
+ default:
+ break;
+ }
+ return true;
+ });
+ }
+
+ void Register() override
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_torghast_dimensional_blade::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY);
+ }
+};
+
+void AddSC_torghast_spell_scripts()
+{
+ RegisterSpellScript(spell_torghast_blade_of_the_lifetaker);
+ RegisterSpellScript(spell_torghast_touch_of_the_unseen);
+ RegisterSpellScript(spell_torghast_yelshirs_powerglove);
+ RegisterSpellScript(spell_torghast_dimensional_blade);
+}
diff --git a/src/server/scripts/Shadowlands/shadowlands_script_loader.cpp b/src/server/scripts/Shadowlands/shadowlands_script_loader.cpp
new file mode 100644
index 00000000000..c6452c75c37
--- /dev/null
+++ b/src/server/scripts/Shadowlands/shadowlands_script_loader.cpp
@@ -0,0 +1,26 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// This is where scripts' loading functions should be declared:
+void AddSC_covenant_spell_scripts();
+void AddSC_torghast_spell_scripts();
+
+void AddShadowlandsScripts()
+{
+ AddSC_covenant_spell_scripts();
+ AddSC_torghast_spell_scripts();
+}
diff --git a/src/server/scripts/Shadowlands/spell_covenant.cpp b/src/server/scripts/Shadowlands/spell_covenant.cpp
new file mode 100644
index 00000000000..e0090db5903
--- /dev/null
+++ b/src/server/scripts/Shadowlands/spell_covenant.cpp
@@ -0,0 +1,55 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "ScriptMgr.h"
+#include "SpellAuraEffects.h"
+#include "SpellScript.h"
+#include "Unit.h"
+
+// 323916 - Sulfuric Emission
+class spell_soulbind_sulfuric_emission : public AuraScript
+{
+ PrepareAuraScript(spell_soulbind_sulfuric_emission);
+
+ static constexpr uint32 SPELL_SULFURIC_EMISSION_COOLDOWN_AURA = 347684;
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_SULFURIC_EMISSION_COOLDOWN_AURA });
+ }
+
+ bool CheckProc(AuraEffect const* aurEff, ProcEventInfo& procInfo)
+ {
+ if (!procInfo.GetProcTarget()->HealthBelowPct(aurEff->GetAmount()))
+ return false;
+
+ if (procInfo.GetProcTarget()->HasAura(SPELL_SULFURIC_EMISSION_COOLDOWN_AURA))
+ return false;
+
+ return true;
+ }
+
+ void Register() override
+ {
+ DoCheckEffectProc += AuraCheckEffectProcFn(spell_soulbind_sulfuric_emission::CheckProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+};
+
+void AddSC_covenant_spell_scripts()
+{
+ RegisterSpellScript(spell_soulbind_sulfuric_emission);
+}
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);
}