Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sweeping strikes like on classic #2650

Open
wants to merge 6 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions sql/migrations/20240609140450_world.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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`='20240413115356');
IF v = 0 THEN
INSERT INTO `migrations` VALUES ('20240609140450');
-- Add your query below.


--Fix Sweeping Strikes flags (always hit, cant be dodged/parried/blocked)
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 (12723, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2359312, -1, 541065344, 262656, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, NULL);
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 (26654, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2359312, -1, 4194432, 262656, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, NULL);


-- End of migration.
END IF;
END??
delimiter ;
CALL add_migration();
DROP PROCEDURE IF EXISTS add_migration;
3 changes: 3 additions & 0 deletions src/game/Objects/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5337,6 +5337,9 @@ bool Unit::IsSpellCrit(Unit const* pVictim, SpellEntry const* spellProto, SpellS
if (spellProto->SpellFamilyName == SPELLFAMILY_POTION ||
(spellProto->IsFitToFamily<SPELLFAMILY_WARLOCK, CF_WARLOCK_HEALTHSTONE>()))
crit_chance = 10.0f;
// flat 5% crit chance for Sweeping Strikes
if (spellProto->Id == 26654)
crit_chance = 5.0f;
else
{
// Wand shoot forced to use ranged crit
Expand Down
18 changes: 15 additions & 3 deletions src/game/UnitAuraProcHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,12 @@ SpellProcEventTriggerCheck Unit::IsTriggeredAtSpellProcEvent(Unit* pVictim, Spel
return SPELL_PROC_TRIGGER_OK;
}
#endif

// Never proc for Rend.
if (spellProto->Id == 12292)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the indentation look wrong

{
if (procSpell->SpellIconID == 245)
return SPELL_PROC_TRIGGER_FAILED;
}
// SHAMAN
// Elemental Mastery
// Do not consume aura if spell did not benefit from crit chance bonus.
Expand Down Expand Up @@ -550,7 +555,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 amount, uint
uint32 triggered_spell_id = 0;
Unit* target = pVictim;
int32 basepoints[MAX_EFFECT_INDEX] = {0, 0, 0};

int8 stacks_left = triggeredByAura->GetHolder()->GetAuraCharges();

switch (dummySpell->SpellFamilyName)
{
Expand Down Expand Up @@ -609,7 +614,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 amount, uint
target = SelectRandomUnfriendlyTarget(pVictim, radius, false, true, false);
#endif
if (!target)
return SPELL_AURA_PROC_FAILED;
return SPELL_AURA_PROC_OK; //Burn charges when solo target

// World of Warcraft Client Patch 1.10.0 (2006-03-28)
// - Execute - This ability will now work with Sweeping Strikes again. If
Expand All @@ -635,6 +640,13 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 amount, uint
triggered_spell_id = 12723; // Note this SS id deals 1 damage by itself (Cannot crit)
}
}
else if (procSpell && procSpell->Id == 1680 && stacks_left > 1) //Whirlwind
{
basepoints[0] = ditheru(amount * 100 / CalcArmorReducedDamage(pVictim, 100));
triggered_spell_id = 12723;
CastSpell(pVictim, 26654, true);
triggeredByAura->GetHolder()->DropAuraCharge();
}
else // Full damage on anything else
#endif
{
Expand Down