From f1de64ee185e85b5998ad25be25b0b86e1db92e8 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Sat, 23 Jun 2018 18:30:28 +0200 Subject: [PATCH] Core/Spells: fixed and updated Bladeflurry proc --- .../world/custom/custom_2018_06_23_00_world.sql | 6 ++++++ src/server/scripts/Spells/spell_rogue.cpp | 14 ++++---------- 2 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 sql/updates/world/custom/custom_2018_06_23_00_world.sql diff --git a/sql/updates/world/custom/custom_2018_06_23_00_world.sql b/sql/updates/world/custom/custom_2018_06_23_00_world.sql new file mode 100644 index 0000000000..89937dd8eb --- /dev/null +++ b/sql/updates/world/custom/custom_2018_06_23_00_world.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_proc` WHERE `spellId` IN (13877, 33735, 51211, 65956); +INSERT INTO `spell_proc` (`SpellId`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`) VALUES +(13877, 0, 0, 0, 0, 0x00000014, 0x1, 0x2, 0x0, 0x0), +(33735, 0, 0, 0, 0, 0x00000014, 0x1, 0x2, 0x0, 0x0), +(51211, 0, 0, 0, 0, 0x00000014, 0x1, 0x2, 0x0, 0x0), +(65956, 0, 0, 0, 0, 0x00000014, 0x1, 0x2, 0x0, 0x0); diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index b16b722897..0aa1bf5cfe 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -80,28 +80,22 @@ class spell_rog_blade_flurry : public SpellScriptLoader return ValidateSpellInfo({ SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK }); } - bool CheckProc(ProcEventInfo& eventInfo) - { - _procTarget = GetTarget()->SelectNearbyTarget(eventInfo.GetProcTarget()); - return _procTarget && eventInfo.GetDamageInfo(); - } - void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - GetTarget()->CastCustomSpell(SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK, SPELLVALUE_BASE_POINT0, eventInfo.GetDamageInfo()->GetDamage(), _procTarget, true, nullptr, aurEff); + if (DamageInfo* damageInfo = eventInfo.GetDamageInfo()) + if (Unit* procTarget = damageInfo->GetVictim()) + if (Unit* target = GetTarget()->SelectNearbyTarget(procTarget, GetTarget()->GetFloatValue(UNIT_FIELD_COMBATREACH))) + GetTarget()->CastCustomSpell(SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK, SPELLVALUE_BASE_POINT0, damageInfo->GetDamage(), target, true, nullptr, aurEff); } void Register() override { - DoCheckProc += AuraCheckProcFn(spell_rog_blade_flurry_AuraScript::CheckProc); if (m_scriptSpellId == SPELL_ROGUE_BLADE_FLURRY) OnEffectProc += AuraEffectProcFn(spell_rog_blade_flurry_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_MOD_POWER_REGEN_PERCENT); else OnEffectProc += AuraEffectProcFn(spell_rog_blade_flurry_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_MOD_MELEE_HASTE); } - - Unit* _procTarget = nullptr; }; AuraScript* GetAuraScript() const override