aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAqua Deus <95978183+aquadeus@users.noreply.github.com>2025-05-04 23:18:37 +0200
committerGitHub <noreply@github.com>2025-05-04 23:18:37 +0200
commitfc362147f9613baf7ffcec12d8ea90b6aa9eb2ab (patch)
treef81686788cbb51f5bb72fd3f7166d7afd058ef49
parentbec4308385cd83e3616e26562c94f0b133dd227f (diff)
Scripts/Spells: Implement hunter talent Wilderness Medicine (#30848)
-rw-r--r--sql/updates/world/master/2025_05_04_01_world.sql3
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp43
2 files changed, 46 insertions, 0 deletions
diff --git a/sql/updates/world/master/2025_05_04_01_world.sql b/sql/updates/world/master/2025_05_04_01_world.sql
new file mode 100644
index 00000000000..6ac836768d5
--- /dev/null
+++ b/sql/updates/world/master/2025_05_04_01_world.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_hun_wilderness_medicine';
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(136,'spell_hun_wilderness_medicine');
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index 65becbcbdc2..e009140bde7 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -77,6 +77,8 @@ enum HunterSpells
SPELL_HUNTER_STEADY_SHOT_FOCUS = 77443,
SPELL_HUNTER_T9_4P_GREATNESS = 68130,
SPELL_HUNTER_T29_2P_MARKSMANSHIP_DAMAGE = 394371,
+ SPELL_HUNTER_WILDERNESS_MEDICINE_TALENT = 343242,
+ SPELL_HUNTER_WILDERNESS_MEDICINE_DISPEL = 384784,
SPELL_ROAR_OF_SACRIFICE_TRIGGERED = 67481
};
@@ -1004,6 +1006,46 @@ class spell_hun_t29_2p_marksmanship_bonus : public AuraScript
}
};
+// Called by 136 - Mend Pet
+class spell_hun_wilderness_medicine : public AuraScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_HUNTER_WILDERNESS_MEDICINE_TALENT, SPELL_HUNTER_WILDERNESS_MEDICINE_DISPEL });
+ }
+
+ bool Load() override
+ {
+ Unit const* caster = GetCaster();
+ if (!caster)
+ return false;
+
+ AuraEffect const* wildernessMedicine = GetCaster()->GetAuraEffect(SPELL_HUNTER_WILDERNESS_MEDICINE_TALENT, EFFECT_1);
+ if (!wildernessMedicine)
+ return false;
+
+ _dispelChance = wildernessMedicine->GetAmount();
+ return true;
+ }
+
+ void OnPeriodic(AuraEffect const* aurEff) const
+ {
+ if (Unit* caster = GetCaster())
+ if (roll_chance_i(_dispelChance))
+ caster->CastSpell(GetTarget(), SPELL_HUNTER_WILDERNESS_MEDICINE_DISPEL, CastSpellExtraArgsInit{
+ .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
+ .TriggeringAura = aurEff
+ });
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_hun_wilderness_medicine::OnPeriodic, EFFECT_0, SPELL_AURA_OBS_MOD_HEALTH);
+ }
+
+ int32 _dispelChance = 0;
+};
+
void AddSC_hunter_spell_scripts()
{
RegisterSpellScript(spell_hun_a_murder_of_crows);
@@ -1039,4 +1081,5 @@ void AddSC_hunter_spell_scripts()
RegisterSpellScript(spell_hun_tame_beast);
RegisterSpellScript(spell_hun_t9_4p_bonus);
RegisterSpellScript(spell_hun_t29_2p_marksmanship_bonus);
+ RegisterSpellScript(spell_hun_wilderness_medicine);
}