Skip to content

Commit

Permalink
[9456] Fixed spell proc code for mixed proc event cases.
Browse files Browse the repository at this point in the history
* 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).

* Also allow proc at hit as result partly block. This fix case from unknown author
  prepered by KAPATEJIb.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
  • Loading branch information
pasdVn authored and VladimirMangos committed Feb 25, 2010
1 parent ee01f89 commit f04146b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/game/SpellMgr.cpp
Expand Up @@ -1154,8 +1154,8 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const * spellP
// Exist req for PROC_EX_EX_TRIGGER_ALWAYS
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)
// Passive spells can`t trigger if need hit (exclude cases when procExtra include non-active flags)
((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)
Expand Down
3 changes: 3 additions & 0 deletions src/game/Unit.cpp
Expand Up @@ -1494,6 +1494,9 @@ void Unit::CalculateMeleeDamage(Unit *pVictim, uint32 damage, CalcDamageInfo *da
damageInfo->blocked_amount = damageInfo->damage;
damageInfo->procEx |= PROC_EX_FULL_BLOCK;
}
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;
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9455"
#define REVISION_NR "9456"
#endif // __REVISION_NR_H__

3 comments on commit f04146b

@przemratajczak
Copy link

Choose a reason for hiding this comment

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

((procEvent_procEx & PROC_EX_NORMAL_HIT & procExtra) && !active) typo?

@pasdVn
Copy link
Contributor

@pasdVn pasdVn commented on f04146b Feb 26, 2010

Choose a reason for hiding this comment

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

I don't think so. At least this is what I suggested.

@VladimirMangos
Copy link

Choose a reason for hiding this comment

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

fixed already in next commit

Please sign in to comment.