Skip to content

Commit

Permalink
[6946] Use blizzlike formula for armor reduction damage
Browse files Browse the repository at this point in the history
Implement use CR_ARMOR_PENETRATION rating

Signed-off-by: DiSlord <dislord@nomail.com>
  • Loading branch information
DiSlord committed Dec 25, 2008
1 parent 1740979 commit 8362a0d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions src/game/Unit.cpp
Expand Up @@ -1478,15 +1478,18 @@ uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage)
// Ignore enemy armor by SPELL_AURA_MOD_TARGET_RESISTANCE aura
armor += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, SPELL_SCHOOL_MASK_NORMAL);

if (armor<0.0f) armor=0.0f;

float tmpvalue = 0.0f;
if(getLevel() <= 59) //Level 1-59
tmpvalue = armor / (armor + 400.0f + 85.0f * getLevel());
else if(getLevel() < 70) //Level 60-69
tmpvalue = armor / (armor - 22167.5f + 467.5f * getLevel());
else //Level 70+
tmpvalue = armor / (armor + 10557.5f);
// Apply Player CR_ARMOR_PENETRATION rating
if (GetTypeId()==TYPEID_PLAYER)
armor *= 1.0f - ((Player*)this)->GetRatingBonusValue(CR_ARMOR_PENETRATION) / 100.0f;

if (armor < 0.0f) armor=0.0f;

float levelModifier = getLevel();
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)
tmpvalue = 0.0f;
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 "6945"
#define REVISION_NR "6946"
#endif // __REVISION_NR_H__

0 comments on commit 8362a0d

Please sign in to comment.