aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-09-02 18:40:27 -0500
committermegamage <none@none>2009-09-02 18:40:27 -0500
commit09974f0598ddac3bc9ae954cd4ff68950c280cb5 (patch)
tree54ffc537cac5e07c9126c049919001e8e9d1eda2 /src/game/Unit.cpp
parent4d94b923ef1d8af84b9a078f9aa7d021abe86d04 (diff)
[8455] Do not disband guild, if guild ranks are not defined for that guild, removed obsolete comment.
Do not allow to delete guild rank, when there are only 5 or less ranks defined. Signed-off-by: Triply <triply@getmangos.com> --HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index eba87182585..8cd2fc5c0d6 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -1615,6 +1615,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellEnt
{
uint32 newdamage = 0;
float armor = pVictim->GetArmor();
+
// Ignore enemy armor by SPELL_AURA_MOD_TARGET_RESISTANCE aura
armor += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, SPELL_SCHOOL_MASK_NORMAL);
@@ -1679,19 +1680,24 @@ uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellEnt
armor -= armorPen;
}
- if (armor < 0.0f) armor=0.0f;
+ // Ignore enemy armor by SPELL_AURA_MOD_TARGET_ARMOR_PCT
+ //armor *= 1.0f - GetTotalAuraModifier(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT) / 100.0f;
+
+ if (armor < 0.0f)
+ armor = 0.0f;
float levelModifier = getLevel();
- if ( levelModifier > 59 )
+ if (levelModifier > 59)
levelModifier = levelModifier + (4.5f * (levelModifier-59));
float tmpvalue = 0.1f * armor / (8.5f * levelModifier + 40);
tmpvalue = tmpvalue/(1.0f + tmpvalue);
- if(tmpvalue < 0.0f)
+ if (tmpvalue < 0.0f)
tmpvalue = 0.0f;
- if(tmpvalue > 0.75f)
+ if (tmpvalue > 0.75f)
tmpvalue = 0.75f;
+
newdamage = uint32(damage - (damage * tmpvalue));
return (newdamage > 1) ? newdamage : 1;