diff --git a/sql/updates/world/custom/custom_2020_02_04_00_world.sql b/sql/updates/world/custom/custom_2020_02_04_00_world.sql new file mode 100644 index 0000000000..f7c7a69aff --- /dev/null +++ b/sql/updates/world/custom/custom_2020_02_04_00_world.sql @@ -0,0 +1,16 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` IN +('spell_rog_deadly_momentum', +'spell_rog_slice_and_dice', +'spell_rog_sap'); + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(-79121, 'spell_rog_deadly_momentum'), +(5171, 'spell_rog_slice_and_dice'), +(6770, 'spell_rog_sap'); + +DELETE FROM `spell_proc` WHERE `SpellId` In (84590, -14156, 14177, 58410); +INSERT INTO `spell_proc` (`SpellId`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellPhaseMask`, `HitMask`, `AttributesMask`) VALUES +(84590, 8, 0, 0, 0, 0x00000010 | 0x00001000, 1, 0, 8), +(14177, 8, 0, 0, 0, 0x00000010 | 0x00000100 | 0x00000400 | 0x00001000 | 0x00004000 | 0x00010000, 1, 0, 8), +(-14156, 8, 0x00020000 | 0x00100000 | 0x00080000 | 0x00200000, 0x08000000 | 0x00000008 | 0x00000001, 0, 0, 1, 0, 0), +(58410, 8, 0, 0x00080000, 0, 0, 2, 0, 2); diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 97c8adc30d..5a470ac6d7 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -62,7 +62,8 @@ enum RogueSpells SPELL_ROGUE_TRICKS_OF_THE_TRADE_PROC = 59628, SPELL_ROGUE_SERRATED_BLADES_R1 = 14171, SPELL_ROGUE_RUPTURE = 1943, - SPELL_ROGUE_HONOR_AMONG_THIEVES_TRIGGERED = 51699 + SPELL_ROGUE_HONOR_AMONG_THIEVES_TRIGGERED = 51699, + SPELL_ROGUE_BLACKJACK_R1 = 79123 }; enum RogueSpellIcons @@ -673,11 +674,19 @@ class spell_rog_recuperate : public AuraScript } } + void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + Duration = aurEff->GetBase()->GetDuration(); + } + void Register() override { OnEffectPeriodic += AuraEffectPeriodicFn(spell_rog_recuperate::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_rog_recuperate::CalculateBonus, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); + AfterEffectApply += AuraEffectApplyFn(spell_rog_recuperate::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); } +public: + int32 Duration = 0; }; // -1943 - Rupture @@ -1276,12 +1285,83 @@ class spell_rog_envenom : public SpellScript } }; +// 5171 - Slice and Dice +class spell_rog_slice_and_dice : public AuraScript +{ + PrepareAuraScript(spell_rog_slice_and_dice); + + void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + Duration = aurEff->GetBase()->GetDuration(); + } + + void Register() override + { + AfterEffectApply += AuraEffectApplyFn(spell_rog_slice_and_dice::HandleEffectApply, EFFECT_0, SPELL_AURA_MOD_MELEE_HASTE_3, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + } +public: + int32 Duration = 0; +}; + +// -79121 - Deadly Momentum +class spell_rog_deadly_momentum : public AuraScript +{ + PrepareAuraScript(spell_rog_deadly_momentum); + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + { + Unit* target = GetTarget(); + + // Slice and Dice duration refreshing + if (AuraEffect* slice = target->GetAuraEffect(SPELL_AURA_MOD_MELEE_HASTE_3, SPELLFAMILY_ROGUE, 0x00040000, 0, 0)) + if (spell_rog_slice_and_dice* script = slice->GetBase()->GetScript("spell_rog_slice_and_dice")) + slice->GetBase()->SetDuration(script->Duration); + + // Recuperate duration refreshing + if (AuraEffect* recuperate = target->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_ROGUE, 0, 0x08000000, 0)) + if (spell_rog_recuperate* script = recuperate->GetBase()->GetScript("spell_rog_recuperate")) + recuperate->GetBase()->SetDuration(script->Duration); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_rog_deadly_momentum::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE); + } +}; + +// 6770 - Sap +class spell_rog_sap: public AuraScript +{ + PrepareAuraScript(spell_rog_sap); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_ROGUE_BLACKJACK_R1 }); + } + + void HandleBlackJack(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + if (Aura const* aura = caster->GetAuraOfRankedSpell(SPELL_ROGUE_BLACKJACK_R1)) + caster->CastSpell(GetTarget(), aura->GetSpellInfo()->Id + 1, true); + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_rog_sap::HandleBlackJack, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL); + } +}; + void AddSC_rogue_spell_scripts() { new spell_rog_blade_flurry(); new spell_rog_cheat_death(); new spell_rog_crippling_poison(); new spell_rog_cut_to_the_chase(); + RegisterAuraScript(spell_rog_deadly_momentum); new spell_rog_deadly_poison(); RegisterSpellScript(spell_rog_envenom); RegisterSpellScript(spell_rog_eviscerate); @@ -1296,7 +1376,9 @@ void AddSC_rogue_spell_scripts() RegisterAuraScript(spell_rog_recuperate); new spell_rog_rupture(); new spell_rog_glyph_of_backstab_triggered(); + RegisterAuraScript(spell_rog_sap); new spell_rog_shiv(); + RegisterAuraScript(spell_rog_slice_and_dice); new spell_rog_stealth(); new spell_rog_tricks_of_the_trade(); new spell_rog_tricks_of_the_trade_proc();