mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
Use SPELL_AURA_MOD_MECHANIC_RESISTANCE for melee spells
Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
parent
220aa56fed
commit
b6e7f49887
1 changed files with 18 additions and 0 deletions
|
|
@ -2351,6 +2351,24 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
|
||||||
if (roll < tmp)
|
if (roll < tmp)
|
||||||
return SPELL_MISS_MISS;
|
return SPELL_MISS_MISS;
|
||||||
|
|
||||||
|
// Chance resist mechanic (select max value from every mechanic spell effect)
|
||||||
|
int32 resist_mech = 0;
|
||||||
|
// Get effects mechanic and chance
|
||||||
|
for(int eff = 0; eff < 3; ++eff)
|
||||||
|
{
|
||||||
|
int32 effect_mech = GetEffectMechanic(spell, eff);
|
||||||
|
if (effect_mech)
|
||||||
|
{
|
||||||
|
int32 temp = pVictim->GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_MECHANIC_RESISTANCE, effect_mech);
|
||||||
|
if (resist_mech < temp*100)
|
||||||
|
resist_mech = temp*100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Roll chance
|
||||||
|
tmp += resist_mech;
|
||||||
|
if (roll < tmp)
|
||||||
|
return SPELL_MISS_RESIST;
|
||||||
|
|
||||||
bool canDodge = true;
|
bool canDodge = true;
|
||||||
bool canParry = true;
|
bool canParry = true;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue