summaryrefslogtreecommitdiff
path: root/src/map/script.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/script.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/script.c')
-rw-r--r--src/map/script.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 0e8a054e7..57e02ff9c 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -4327,8 +4327,7 @@ int buildin_sc_end(struct script_state *st)
int buildin_getscrate(struct script_state *st)
{
struct block_list *bl;
- int sc_def=100,sc_def_mdef2,sc_def_vit2,sc_def_int2,sc_def_luk2;
- int type,rate,luk;
+ int sc_def,type,rate;
type=conv_num(st,& (st->stack->stack_data[st->start+2]));
rate=conv_num(st,& (st->stack->stack_data[st->start+3]));
@@ -4337,22 +4336,9 @@ int buildin_getscrate(struct script_state *st)
else
bl = map_id2bl(st->rid);
- luk = status_get_luk(bl);
- sc_def_mdef2=100 - (3 + status_get_mdef(bl) + luk/3);
- sc_def_vit2=100 - (3 + status_get_vit(bl) + luk/3);
- sc_def_int2=100 - (3 + status_get_int(bl) + luk/3);
- sc_def_luk2=100 - (3 + luk);
-
- if(type==SC_STONE || type==SC_FREEZE)
- sc_def=sc_def_mdef2;
- else if(type==SC_STAN || type==SC_POISON || type==SC_SILENCE)
- sc_def=sc_def_vit2;
- else if(type==SC_SLEEP || type==SC_CONFUSION || type==SC_BLIND)
- sc_def=sc_def_int2;
- else if(type==SC_CURSE)
- sc_def=sc_def_luk2;
-
- rate=rate*sc_def/100;
+ sc_def = status_get_sc_def(bl,type);
+
+ rate = rate * sc_def / 100;
push_val(st->stack,C_INT,rate);
return 0;