mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +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;
|
||||
}
|
||||
*/
|
||||
|
||||
// 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();
|
||||
blockChance += (GetWeaponSkillValue(attackType) - pVictim->GetMaxSkillValueForLevel() )*0.04;
|
||||
if (roll_chance_f(blockChance))
|
||||
|
|
@ -2257,7 +2263,13 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
|
|||
// Can`t parry
|
||||
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
|
||||
AuraList const& ignore = GetAurasByType(SPELL_AURA_IGNORE_COMBAT_RESULT);
|
||||
for(AuraList::const_iterator i = ignore.begin(); i != ignore.end(); ++i)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue