summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
author(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-26 11:20:38 +0000
committer(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-26 11:20:38 +0000
commit8ca00fc7e0e1457b1cb1537e2caeefa150344360 (patch)
treeb6818621e3485148c6adf755afd0dae24c1e8575 /src/map/status.c
parent317ba93ee42b32c369f7aa7f669f4acb3ac72e60 (diff)
downloadhercules-8ca00fc7e0e1457b1cb1537e2caeefa150344360.tar.gz
hercules-8ca00fc7e0e1457b1cb1537e2caeefa150344360.tar.bz2
hercules-8ca00fc7e0e1457b1cb1537e2caeefa150344360.tar.xz
hercules-8ca00fc7e0e1457b1cb1537e2caeefa150344360.zip
Added status_get_sc_def for calculating resistance against status abnormalities
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@997 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c61
1 files changed, 60 insertions, 1 deletions
diff --git a/src/map/status.c b/src/map/status.c
index f3c022fe0..35b2baaff 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -2559,6 +2559,65 @@ short *status_get_option(struct block_list *bl)
return 0;
}
+int status_get_sc_def(struct block_list *bl, int type)
+{
+ int sc_def;
+ nullpo_retr(0, bl);
+
+ switch (type)
+ {
+ case SP_MDEF1: // mdef
+ sc_def = 100 - (3 + status_get_mdef(bl) + status_get_luk(bl)/3);
+ break;
+ case SP_MDEF2: // int
+ sc_def = 100 - (3 + status_get_int(bl) + status_get_luk(bl)/3);
+ break;
+ case SP_DEF1: // def
+ sc_def = 100 - (3 + status_get_def(bl) + status_get_luk(bl)/3);
+ break;
+ case SP_DEF2: // vit
+ sc_def = 100 - (3 + status_get_vit(bl) + status_get_luk(bl)/3);
+ break;
+ case SP_LUK: // luck
+ sc_def = 100 - (3 + status_get_luk(bl));
+ break;
+
+ case SC_STONE:
+ case SC_FREEZE:
+ sc_def = 100 - (3 + status_get_mdef(bl) + status_get_luk(bl)/3);
+ break;
+ case SC_STAN:
+ case SC_POISON:
+ case SC_SILENCE:
+ sc_def = 100 - (3 + status_get_vit(bl) + status_get_luk(bl)/3);
+ break;
+ case SC_SLEEP:
+ case SC_CONFUSION:
+ case SC_BLIND:
+ sc_def = 100 - (3 + status_get_int(bl) + status_get_luk(bl)/3);
+ break;
+ case SC_CURSE:
+ sc_def = 100 - (3 + status_get_luk(bl));
+ break;
+
+ default:
+ sc_def = 100;
+ break;
+ }
+
+ if(bl->type == BL_MOB && sc_def < 50)
+ sc_def = 50;
+ else if(bl->type == BL_PC) {
+ struct status_change* sc_data = status_get_sc_data(bl);
+ if (sc_data && sc_data[SC_GOSPEL].timer != -1 &&
+ sc_data[SC_GOSPEL].val4 == BCT_PARTY &&
+ sc_data[SC_GOSPEL].val3 == 3)
+ sc_def -= 25;
+ }
+
+ return (sc_def < 0) ? 0 : sc_def;
+}
+
/*==========================================
* ステータス異常開始
*------------------------------------------
@@ -3077,7 +3136,7 @@ int status_change_start(struct block_list *bl,int type,int val1,int val2,int val
break;
case SC_STAN: /* スタン(val2にミリ秒セット) */
if(!(flag&2)) {
- int sc_def = 100 - (status_get_vit(bl) + status_get_luk(bl)/3);
+ int sc_def = status_get_sc_def_vit(bl);
tick = tick * sc_def / 100;
}
break;