mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[6990] Check creatures flags_extra for disable melee spells block/parry
Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
parent
151e9e7012
commit
f5c4935ec3
2 changed files with 14 additions and 2 deletions
|
|
@ -2163,6 +2163,12 @@ bool Unit::isSpellBlocked(Unit *pVictim, SpellEntry const *spellProto, WeaponAtt
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Check creatures flags_extra for disable block
|
||||||
|
if(pVictim->GetTypeId()==TYPEID_UNIT &&
|
||||||
|
((Creature*)pVictim)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK )
|
||||||
|
return false;
|
||||||
|
|
||||||
float blockChance = GetUnitBlockChance();
|
float blockChance = GetUnitBlockChance();
|
||||||
blockChance += (GetWeaponSkillValue(attackType) - pVictim->GetMaxSkillValueForLevel() )*0.04;
|
blockChance += (GetWeaponSkillValue(attackType) - pVictim->GetMaxSkillValueForLevel() )*0.04;
|
||||||
if (roll_chance_f(blockChance))
|
if (roll_chance_f(blockChance))
|
||||||
|
|
@ -2257,7 +2263,13 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
|
||||||
// Can`t parry
|
// Can`t parry
|
||||||
canParry = false;
|
canParry = false;
|
||||||
}
|
}
|
||||||
|
// Check creatures flags_extra for disable parry
|
||||||
|
if(pVictim->GetTypeId()==TYPEID_UNIT)
|
||||||
|
{
|
||||||
|
uint32 flagEx = ((Creature*)pVictim)->GetCreatureInfo()->flags_extra;
|
||||||
|
if( flagEx & CREATURE_FLAG_EXTRA_NO_PARRY )
|
||||||
|
canParry = false;
|
||||||
|
}
|
||||||
// Ignore combat result aura
|
// Ignore combat result aura
|
||||||
AuraList const& ignore = GetAurasByType(SPELL_AURA_IGNORE_COMBAT_RESULT);
|
AuraList const& ignore = GetAurasByType(SPELL_AURA_IGNORE_COMBAT_RESULT);
|
||||||
for(AuraList::const_iterator i = ignore.begin(); i != ignore.end(); ++i)
|
for(AuraList::const_iterator i = ignore.begin(); i != ignore.end(); ++i)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "6989"
|
#define REVISION_NR "6990"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue