Jump to content

[9456][small fix] proxEx bug


pasdVn

Recommended Posts

Imagine the following problem:

A proctrigger aura has procflagsEx = PROC_EX_NORMAL_HIT | PROC_EX_BLOCK. When an attack gets blocked by 100%, there won't be triggered anything, because of a bug in SpellMgr::IsSpellProcEventCanTriggeredBy(...).

Don't know, if there are spells with such procExs currently, but at least there have been some in earlier versions.

From 8c47039bf1a3d33cbeb98c04d6516d0606e1f9f1 Mon Sep 17 00:00:00 2001
From: pasdVn <[email protected]>
Date: Wed, 7 Oct 2009 14:21:00 +0200
Subject: [PATCH] fix proc bug with multiple proxEx flags

Allow spells with multiple procEx flags to trigger also with 0 dmg, if current
procExtra is no normal hit (e.g. block and normal hit as flags -> all dmg blocked).
---
src/game/SpellMgr.cpp |    2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 37fb5a0..7ea4d0a 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -1153,7 +1153,7 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const * spellP
        if (procEvent_procEx & PROC_EX_EX_TRIGGER_ALWAYS)
            return true;
        // Passive spells can`t trigger if need hit
-        if ((procEvent_procEx & PROC_EX_NORMAL_HIT) && !active)
+        if ((procEvent_procEx & PROC_EX_NORMAL_HIT & procExtra)&& !active)
            return false;
        // Check Extra Requirement like (hit/crit/miss/resist/parry/dodge/block/immune/reflect/absorb and other)
        if (procEvent_procEx & procExtra)
-- 
1.6.5.1.1367.gcd48

Link to comment
Share on other sites

i was used other patch for a long time... but forgot who is the author :/

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 21434ab..fbe37e2 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -1331,6 +1331,8 @@ void Unit::CalculateMeleeDamage(Unit *pVictim, uint32 damage, CalcDamageInfo *da
                damageInfo->TargetState = VICTIMSTATE_BLOCKS;
                damageInfo->blocked_amount = damageInfo->damage;
            }
+            else
+                damageInfo->procEx|=PROC_EX_NORMAL_HIT;     // Partial blocks can still cause attacker procs
            damageInfo->damage      -= damageInfo->blocked_amount;
            damageInfo->cleanDamage += damageInfo->blocked_amount;
            break;

Link to comment
Share on other sites

Ah nice! That is also a thing that does not work correctly :) (or how is this handled at official servers?.. partly blocked also a normal hit!?).

Problem that is fixed by my patch is, the problem, when damage is blocked by 100% and so 'active' is false in IsSpellProcEventCanTriggeredBy(...).

Link to comment
Share on other sites

Hmm, not clear?

My Patch:

Just makes it possible, that triggerauras with multiple procEx flags (those, that are defined in spell_proc_event) - that means PROC_EX_NORMAL_HIT and anything else like PROC_EX_DODGE, PROC_EX_BLOCK - are abled to proc a spell. Currently we have the case that it is possible that they do not trigger because of 0 damage (-> active is false in IsSpellProcEventCanTriggeredBy). For example imgine a completly blocked attack.

Other solution is maybe just to remove this whole line, but don't know if this is correct. If this patch is such a problem just ignore it^^ I thought it is quite evident :-/

The one of KAPATEJIb does something else:

Just adds PROC_EX_NORMAL_HIT to spells that are are blocked or absorbed, but not completly. For example it makes possible that this spell can even trigger if you block a part of the damage.

By the way, this & PROC_EX_NORMAL_HIT & procExtra

makes my eyes bleed...

Hmm, I can't find anything bad in masking a value multiple times :confused:
Link to comment
Share on other sites

×
×
  • 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