diff options
Diffstat (limited to 'src/game-server')
-rw-r--r-- | src/game-server/being.cpp | 5 | ||||
-rw-r--r-- | src/game-server/character.cpp | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/game-server/being.cpp b/src/game-server/being.cpp index b18914fa..a6ba4023 100644 --- a/src/game-server/being.cpp +++ b/src/game-server/being.cpp @@ -64,21 +64,22 @@ int Being::damage(Object *, Damage const &damage) /* Elemental modifier at 100 means normal damage. At 0, it means immune. And at 200, it means vulnerable (double damage). */ int mod1 = getModifiedAttribute(BASE_ELEM_BEGIN + damage.element); - + HPloss = HPloss * (mod1 / 100); /* Defence is an absolute value which is subtracted from the damage total. */ int mod2 = 0; switch (damage.type) { case DAMAGE_PHYSICAL: mod2 = getModifiedAttribute(BASE_ATTR_PHY_RES); + HPloss = HPloss - mod2; break; case DAMAGE_MAGICAL: mod2 = getModifiedAttribute(BASE_ATTR_MAG_RES); + HPloss = HPloss / (mod2 + 1); break; default: break; } - HPloss = HPloss * (mod1 / 100) - mod2; if (HPloss < 0) HPloss = 0; diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp index b2420c31..46d7f5c5 100644 --- a/src/game-server/character.cpp +++ b/src/game-server/character.cpp @@ -96,7 +96,7 @@ void Character::perform() Damage damage; damage.base = getModifiedAttribute(BASE_ATTR_PHY_ATK_MIN) + - (rand() % getModifiedAttribute(CHAR_SKILL_WEAPON_BEGIN + type)); + (rand() % (getModifiedAttribute(CHAR_SKILL_WEAPON_BEGIN + type) + 1)); damage.delta = getModifiedAttribute(BASE_ATTR_PHY_ATK_DELTA); damage.type = DAMAGE_PHYSICAL; damage.cth = getModifiedAttribute(BASE_ATTR_HIT) + |