From 066497bb4daa433d0f4f714f10ca7ee8049ef682 Mon Sep 17 00:00:00 2001 From: scottnice Date: Mon, 14 Aug 2023 01:48:43 -0400 Subject: [PATCH] Fix ravager axe not properly proccing deep wounds, weapon enchants etc on bladestorm hits, fixed ravager axe issue where channeling would stop when target died, extra attacks generated while channeling will now be applied after channelling is complete, this matches behaviour of classic. Fix issue with ravager bladestorm where its whirlwind hits could not reproc blade storm. --- sql/migrations/20230814003800_world.sql | 19 +++++++++++++++++++ src/game/Objects/SpellCaster.cpp | 2 ++ src/game/Objects/Unit.cpp | 3 +++ src/game/Spells/Spell.cpp | 5 +++++ 4 files changed, 29 insertions(+) create mode 100644 sql/migrations/20230814003800_world.sql diff --git a/sql/migrations/20230814003800_world.sql b/sql/migrations/20230814003800_world.sql new file mode 100644 index 000000000000..f3d675856767 --- /dev/null +++ b/sql/migrations/20230814003800_world.sql @@ -0,0 +1,19 @@ +DROP PROCEDURE IF EXISTS add_migration; +delimiter ?? +CREATE PROCEDURE `add_migration`() +BEGIN +DECLARE v INT DEFAULT 1; +SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20230814003800'); +IF v=0 THEN +INSERT INTO `migrations` VALUES ('20230814003800'); +-- Add your query below. + +-- Allow Ravager whirlwind to proc other things by setting AttributesEx3 to SPELL_ATTR_EX3_CAN_PROC_FROM_PROCS +INSERT INTO `spell_mod` (`Id`, `procChance`, `procFlags`, `procCharges`, `DurationIndex`, `Category`, `CastingTimeIndex`, `StackAmount`, `SpellIconID`, `activeIconID`, `manaCost`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `Custom`, `InterruptFlags`, `AuraInterruptFlags`, `ChannelInterruptFlags`, `Dispel`, `Stances`, `StancesNot`, `SpellVisual`, `ManaCostPercentage`, `StartRecoveryCategory`, `StartRecoveryTime`, `MaxAffectedTargets`, `MaxTargetLevel`, `DmgClass`, `rangeIndex`, `RecoveryTime`, `CategoryRecoveryTime`, `SpellFamilyName`, `SpellFamilyFlags`, `Mechanic`, `EquippedItemClass`, `Comment`) VALUES (9633, 101, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 'Ravager Whirlwind weapon procs'); + +-- End of migration. +END IF; +END?? +delimiter ; +CALL add_migration(); +DROP PROCEDURE IF EXISTS add_migration; diff --git a/src/game/Objects/SpellCaster.cpp b/src/game/Objects/SpellCaster.cpp index 193e08aacd98..3005c38524a3 100644 --- a/src/game/Objects/SpellCaster.cpp +++ b/src/game/Objects/SpellCaster.cpp @@ -1937,6 +1937,8 @@ SpellCastResult SpellCaster::CastSpell(SpellCaster* pTarget, SpellEntry const* s // as soon as the target dies or leaves the area of the effect if (spellInfo->Targets & TARGET_FLAG_DEST_LOCATION) targets.setDestination(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()); + // handle specific case of weapons that apply positive auras on hit like Ravager and Bonereaver's Edge + else if (spellInfo->Targets == TARGET_FLAG_SELF && spellInfo->Custom & SPELL_CUSTOM_POSITIVE) {} else if (Unit* pUnitTarget = pTarget->ToUnit()) targets.setUnitTarget(pUnitTarget); else if (GameObject* pGoTarget = pTarget->ToGameObject()) diff --git a/src/game/Objects/Unit.cpp b/src/game/Objects/Unit.cpp index fb8d050b8bc7..5ffb82833465 100644 --- a/src/game/Objects/Unit.cpp +++ b/src/game/Objects/Unit.cpp @@ -330,6 +330,9 @@ AutoAttackCheckResult Unit::CanAutoAttackTarget(Unit const* pVictim) const if (HasUnitState(UNIT_STAT_CAN_NOT_REACT) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED)) return ATTACK_RESULT_CANT_ATTACK; + if (IsPlayer() && m_currentSpells[CURRENT_CHANNELED_SPELL]) + return ATTACK_RESULT_CANT_ATTACK; + if (!pVictim->IsAlive() || !IsAlive()) return ATTACK_RESULT_DEAD; diff --git a/src/game/Spells/Spell.cpp b/src/game/Spells/Spell.cpp index 92fc4023163d..e3791b3a8493 100644 --- a/src/game/Spells/Spell.cpp +++ b/src/game/Spells/Spell.cpp @@ -1499,6 +1499,11 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) (m_spellInfo->IsFitToFamilyMask() && m_spellInfo->SpellIconID == 25)) triggerWeaponProcs = true; } + // Ravager Whirlwind procs weapon attacks + else if (m_spellInfo->Id == 9633) + { + triggerWeaponProcs = true; + } } pCaster->DealSpellDamage(&damageInfo, true);