aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAqua Deus <95978183+aquadeus@users.noreply.github.com>2025-05-25 14:30:43 +0200
committerGitHub <noreply@github.com>2025-05-25 14:30:43 +0200
commitc9101337f6bc32bf6b21d72280aba4a4ac29453c (patch)
tree2506e8669442b34e5eec26be2c137814bd15081d
parent1c360b8e11a1fb5c165558704407bed3778f104e (diff)
Scripts/Spells: Implement rogue talent Shot in the dark (#30979)
-rw-r--r--sql/updates/world/master/2025_05_25_00_world.sql10
-rw-r--r--src/server/scripts/Spells/spell_rogue.cpp51
2 files changed, 61 insertions, 0 deletions
diff --git a/sql/updates/world/master/2025_05_25_00_world.sql b/sql/updates/world/master/2025_05_25_00_world.sql
new file mode 100644
index 00000000000..cb87437eec5
--- /dev/null
+++ b/sql/updates/world/master/2025_05_25_00_world.sql
@@ -0,0 +1,10 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_rog_shot_in_the_dark', 'spell_rog_shot_in_the_dark_buff');
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(1784, 'spell_rog_shot_in_the_dark'),
+(185313, 'spell_rog_shot_in_the_dark'),
+(185422, 'spell_rog_shot_in_the_dark_buff'),
+(158185, 'spell_rog_shot_in_the_dark_buff');
+
+DELETE FROM `spell_proc` WHERE `SpellId` IN (257506);
+INSERT INTO `spell_proc` (`SpellId`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`SpellFamilyMask3`,`ProcFlags`,`ProcFlags2`,`SpellTypeMask`,`SpellPhaseMask`,`HitMask`,`AttributesMask`,`DisableEffectsMask`,`ProcsPerMinute`,`Chance`,`Cooldown`,`Charges`) VALUES
+(257506,0x00,8,0x00000400,0x00000000,0x00000000,0x00000000,0x0,0x0,0x4,0x2,0x0,0x10,0x0,0,0,0,0); -- Shot in the Dark
diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp
index 6838ded7646..c5055305595 100644
--- a/src/server/scripts/Spells/spell_rogue.cpp
+++ b/src/server/scripts/Spells/spell_rogue.cpp
@@ -84,6 +84,8 @@ enum RogueSpells
SPELL_ROGUE_SHADOW_FOCUS = 108209,
SPELL_ROGUE_SHADOW_FOCUS_EFFECT = 112942,
SPELL_ROGUE_SHIV_NATURE_DAMAGE = 319504,
+ SPELL_ROGUE_SHOT_IN_THE_DARK_TALENT = 257505,
+ SPELL_ROGUE_SHOT_IN_THE_DARK_BUFF = 257506,
SPELL_ROGUE_SLICE_AND_DICE = 315496,
SPELL_ROGUE_SPRINT = 2983,
SPELL_ROGUE_SOOTHING_DARKNESS_TALENT = 393970,
@@ -1046,6 +1048,53 @@ class spell_rog_shadow_focus : public AuraScript
}
};
+// 257505 - Shot in the Dark (attached to 1784 - Stealth and 185313 - Shadow Dance)
+class spell_rog_shot_in_the_dark : public SpellScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_ROGUE_SHOT_IN_THE_DARK_TALENT, SPELL_ROGUE_SHOT_IN_THE_DARK_BUFF });
+ }
+
+ bool Load() override
+ {
+ return GetCaster()->HasAura(SPELL_ROGUE_SHOT_IN_THE_DARK_TALENT);
+ }
+
+ void HandleAfterCast() const
+ {
+ Unit* caster = GetCaster();
+ caster->CastSpell(caster, SPELL_ROGUE_SHOT_IN_THE_DARK_BUFF, CastSpellExtraArgsInit{
+ .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
+ .TriggeringSpell = GetSpell()
+ });
+ }
+
+ void Register() override
+ {
+ AfterCast += SpellCastFn(spell_rog_shot_in_the_dark::HandleAfterCast);
+ }
+};
+
+// 257506 - Shot in the Dark (attached to 185422 - Shadow Dance and 158185 - Stealth)
+class spell_rog_shot_in_the_dark_buff : public AuraScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_ROGUE_SHOT_IN_THE_DARK_BUFF });
+ }
+
+ void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
+ {
+ GetTarget()->RemoveAurasDueToSpell(SPELL_ROGUE_SHOT_IN_THE_DARK_BUFF);
+ }
+
+ void Register() override
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_rog_shot_in_the_dark_buff::HandleEffectRemove, EFFECT_0, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
// 193315 - Sinister Strike
class spell_rog_sinister_strike : public SpellScript
{
@@ -1372,6 +1421,8 @@ void AddSC_rogue_spell_scripts()
RegisterSpellScript(spell_rog_ruthlessness);
RegisterSpellScript(spell_rog_shadowstrike);
RegisterSpellScript(spell_rog_shadow_focus);
+ RegisterSpellScript(spell_rog_shot_in_the_dark);
+ RegisterSpellScript(spell_rog_shot_in_the_dark_buff);
RegisterSpellScript(spell_rog_sinister_strike);
RegisterSpellScript(spell_rog_soothing_darkness);
RegisterSpellScript(spell_rog_stealth);