Jump to content

[fix] Extra Attacks and "Reckoning"


pasdVn

Recommended Posts

Hi everybody!

I tried to fix the spell "Reckoning", and discovered the following Problem:

When a normal weapon swing triggers a spell, that adds an extra attack (like Reckoning does) it will only be consumed in the next weapon swing (see Unit::AttackerStateUpdate). Additionally, when you have one unconsumed extraAttack left, the next normal weapon swing can't add a new one, because this is explicitly forbidden in Unit::HandleProcTriggerSpell (what makes sense, otherwise extra attacks could recoursively trigger each other).

In the end you have the effect, that only every second hit will be a double hit with Reckoning (it has 4 charges... but you will need a very fast weapon to consume all in 8 seconds :-P)

My sollution is, not to use this store variable "extraAttacks" in AttackerStateUpdate. If we need it more save. we could also use one, but after the proc calculation of the normal swing (or the meleespellcast).

From 9c145f9b168aa081934a51a45746b5399d46f88e Mon Sep 17 00:00:00 2001
From: [email][email protected][/email]
Date: Sat, 13 Feb 2010 22:36:24 +0100
Subject: fixed extra attacks handling

It is possible now, that extra attacks, that have been added during a proc spell
of a normal autoattack, becomes consumed at the same weapon swing.
---
src/game/Unit.cpp |   10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 6d2574c..74b7dda 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -2305,18 +2305,17 @@ void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool ex
    else
        return;                                             // ignore ranged case

-    uint32 extraAttacks = m_extraAttacks;
-
    // melee attack spell casted at main hand attack only
    if (attType == BASE_ATTACK && m_currentSpells[CURRENT_MELEE_SPELL])
    {
        m_currentSpells[CURRENT_MELEE_SPELL]->cast();

-        // not recent extra attack only at any non extra attack (melee spell case)
-        if(!extra && extraAttacks)
+        // extra attack only at any non extra attack (melee spell case)
+        if(!extra && m_extraAttacks)
        {
            while(m_extraAttacks)
            {
+                // note: extra attacks can't proc spells adding new extra attacks
                AttackerStateUpdate(pVictim, BASE_ATTACK, true);
                if(m_extraAttacks > 0)
                    --m_extraAttacks;
@@ -2348,10 +2347,11 @@ void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool ex
        ((Creature*)pVictim)->AI()->AttackedBy(this);

    // extra attack only at any non extra attack (normal case)
-    if(!extra && extraAttacks)
+    if(!extra && m_extraAttacks)
    {
        while(m_extraAttacks)
        {
+            // note: extra attacks can't proc spells adding new extra attacks
            AttackerStateUpdate(pVictim, BASE_ATTACK, true);
            if(m_extraAttacks > 0)
                --m_extraAttacks;
-- 
1.6.5.1.1367.gcd48

And the sql part for the talent-proc-aura (prox ex on block, on hit, on crit):

/*Reckoning*/
DELETE FROM `spell_proc_event` WHERE entry IN (20177, 20179, 20181, 20180, 20182);
INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES
(20177, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0),
(20179, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0),
(20181, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0),
(20180, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0),
(20182, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0);

Edit: Hmm, SQL not required. Just realized that this should not prox 'onBlock' :-/

Link to comment
Share on other sites

  • 1 year later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use