void Player::UpdateDamagePhysical(WeaponAttackType attType) { float mindamage; float maxdamage; CalculateMinMaxDamage(attType, false, true, mindamage, maxdamage); switch (attType) { case BASE_ATTACK: default: SetStatFloatValue(UNIT_FIELD_MIN_DAMAGE, mindamage); SetStatFloatValue(UNIT_FIELD_MAX_DAMAGE, maxdamage); break; case OFF_ATTACK: SetStatFloatValue(UNIT_FIELD_MIN_OFF_HAND_DAMAGE, mindamage); SetStatFloatValue(UNIT_FIELD_MAX_OFF_HAND_DAMAGE, maxdamage); break; case RANGED_ATTACK: SetStatFloatValue(UNIT_FIELD_MIN_RANGED_DAMAGE, mindamage); SetStatFloatValue(UNIT_FIELD_MAX_RANGED_DAMAGE, maxdamage); break; } }
void Unit::UpdateDamagePhysical(WeaponAttackType attType) { float minDamage = 0.0f; float maxDamage = 0.0f; CalculateMinMaxDamage(attType, false, true, minDamage, maxDamage); switch (attType) { case BASE_ATTACK: default: SetStatFloatValue(UNIT_FIELD_MINDAMAGE, minDamage); SetStatFloatValue(UNIT_FIELD_MAXDAMAGE, maxDamage); break; case OFF_ATTACK: SetStatFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, minDamage); SetStatFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, maxDamage); break; case RANGED_ATTACK: SetStatFloatValue(UNIT_FIELD_MINRANGEDDAMAGE, minDamage); SetStatFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, maxDamage); break; } }