From 30f5a677644fc34fc7e8b3493f7af42056c3285f Mon Sep 17 00:00:00 2001 From: Roderic Morris Date: Sun, 27 Jul 2008 20:43:39 +0000 Subject: account for weapon skills in damage calculation. --- src/game-server/character.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp index 3fb938c8..b2420c31 100644 --- a/src/game-server/character.cpp +++ b/src/game-server/character.cpp @@ -95,11 +95,12 @@ void Character::perform() int type = ic ? ic->getModifiers().getValue(MOD_WEAPON_TYPE) : WPNTYPE_NONE; Damage damage; - damage.base = getModifiedAttribute(BASE_ATTR_PHY_ATK_MIN); + damage.base = getModifiedAttribute(BASE_ATTR_PHY_ATK_MIN) + + (rand() % getModifiedAttribute(CHAR_SKILL_WEAPON_BEGIN + type)); damage.delta = getModifiedAttribute(BASE_ATTR_PHY_ATK_DELTA); damage.type = DAMAGE_PHYSICAL; - damage.cth = getModifiedAttribute(BASE_ATTR_HIT) - + getModifiedAttribute(CHAR_SKILL_WEAPON_BEGIN + type); + damage.cth = getModifiedAttribute(BASE_ATTR_HIT) + + getModifiedAttribute(CHAR_SKILL_WEAPON_BEGIN + type); damage.usedSkill = CHAR_SKILL_WEAPON_BEGIN + type; if (type) { -- cgit v1.2.3-70-g09d2