diff --git a/sql/updates/world/custom/custom_2018_06_26_00_world.sql b/sql/updates/world/custom/custom_2018_06_26_00_world.sql new file mode 100644 index 0000000000..be9fcde1bf --- /dev/null +++ b/sql/updates/world/custom/custom_2018_06_26_00_world.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_proc` WHERE `SpellId`= 76806; +INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES +(76806, 0, 0, 0x0, 0x0, 0x0, 0x0, 1, 2, 0, 32, 0, 0, 0, 0); + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(76806,'spell_rog_main_gauche'); diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 0aa1bf5cfe..17dc9ade30 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -44,6 +44,7 @@ enum RogueSpells SPELL_ROGUE_KILLING_SPREE_TELEPORT = 57840, SPELL_ROGUE_KILLING_SPREE_WEAPON_DMG = 57841, SPELL_ROGUE_KILLING_SPREE_DMG_BUFF = 61851, + SPELL_ROGUE_MAIN_GAUCHE = 86392, SPELL_ROGUE_MASTER_OF_SUBTLETY_DAMAGE_PERCENT = 31665, SPELL_ROGUE_MASTER_OF_SUBTLETY_PASSIVE = 31223, SPELL_ROGUE_MASTER_OF_SUBTLETY_PERIODIC = 31666, @@ -1076,6 +1077,39 @@ class spell_rog_honor_among_thieves : public SpellScriptLoader } }; +// 76806 - Main Gauche +class spell_rog_main_gauche : public AuraScript +{ + PrepareAuraScript(spell_rog_main_gauche); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_ROGUE_MAIN_GAUCHE }); + } + + bool CheckProc(ProcEventInfo& /*eventInfo*/) + { + return roll_chance_i(GetEffect(EFFECT_0)->GetAmount()); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + if (DamageInfo* damage = eventInfo.GetDamageInfo()) + if (Unit* target = GetTarget()) + if (target->getAttackTimer(BASE_ATTACK) > target->getAttackTimer(OFF_ATTACK)) + if (Unit* victim = damage->GetVictim()) + GetTarget()->CastSpell(victim, SPELL_ROGUE_MAIN_GAUCHE, true, nullptr, aurEff); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_rog_main_gauche::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_rog_main_gauche::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } +}; + void AddSC_rogue_spell_scripts() { new spell_rog_blade_flurry(); @@ -1084,6 +1118,7 @@ void AddSC_rogue_spell_scripts() new spell_rog_cut_to_the_chase(); new spell_rog_deadly_poison(); new spell_rog_killing_spree(); + RegisterAuraScript(spell_rog_main_gauche); new spell_rog_master_of_subtlety(); new spell_rog_nerves_of_steel(); new spell_rog_overkill();