summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-10-02 21:36:51 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-10-02 21:36:51 +0000
commit3286a16fe958ce6aa85ddb07958aca9e2467efac (patch)
tree7e131cac868794aae0eac8b8fb2dac595ae3c18d /src/map/status.c
parent99f61d4e885129cafec8b3abb66283816bc19f7f (diff)
downloadhercules-3286a16fe958ce6aa85ddb07958aca9e2467efac.tar.gz
hercules-3286a16fe958ce6aa85ddb07958aca9e2467efac.tar.bz2
hercules-3286a16fe958ce6aa85ddb07958aca9e2467efac.tar.xz
hercules-3286a16fe958ce6aa85ddb07958aca9e2467efac.zip
- Modified item-granded status resistance reduction to behave as explained by Vicious (Ragnarok Monthly magazine)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8921 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/map/status.c b/src/map/status.c
index bdb44c7a4..b5dc06b07 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -4479,13 +4479,15 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
return 0;
}
- //Item defenses do not reduce duration, so they go out of the function.
- if(sd && SC_COMMON_MIN<=type && type<=SC_COMMON_MAX
- && sd->reseff[type-SC_COMMON_MIN] > 0)
- def += sd->reseff[type-SC_COMMON_MIN];
-
- if (def && !(flag&8))
- rate -= rate*def/10000;
+ if (!(flag&8)) {
+ if (def) //Natural resistance
+ rate -= rate*def/10000;
+
+ //Item resistance (only applies to rate%)
+ if(sd && SC_COMMON_MIN<=type && type<=SC_COMMON_MAX
+ && sd->reseff[type-SC_COMMON_MIN] > 0)
+ rate -= rate*sd->reseff[type-SC_COMMON_MIN]/10000;
+ }
if (!(rand()%10000 < rate))
return 0;