summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-08 16:56:53 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-08 16:56:53 +0000
commita9c2d623a66f27674ea539963a8738138ca7f6aa (patch)
tree50739b9bd7045cc5618702a486b8eda834f1b2e5 /src/map/script.c
parent1847024eda6075c5637cef48bc14eb3e4958bd34 (diff)
downloadhercules-a9c2d623a66f27674ea539963a8738138ca7f6aa.tar.gz
hercules-a9c2d623a66f27674ea539963a8738138ca7f6aa.tar.bz2
hercules-a9c2d623a66f27674ea539963a8738138ca7f6aa.tar.xz
hercules-a9c2d623a66f27674ea539963a8738138ca7f6aa.zip
- Cleaned up and reorganized status_change_start. Now it also receives the success % rate (0->100)
- Added local function status_get_sc_tick which takes care of reducing the effect duration as need is be. - Modified status_get_sc_def to handle defense against all related statuses, now returns defense on a scale where 10000 is 100%. - Added time2 to pangvoice, it is the player effect's duration while time1 is for the mon's effect. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5227 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 0a88ddfc2..84c5c59e1 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -6066,7 +6066,7 @@ int buildin_sc_start(struct script_state *st)
val4 = 1; //Mark that this was a thrown sc_effect
}
if (bl)
- status_change_start(bl,type,val1,0,0,val4,tick,0);
+ status_change_start(bl,type,100,val1,0,0,val4,tick,0);
return 0;
}
@@ -6093,8 +6093,8 @@ int buildin_sc_start2(struct script_state *st)
val4 = 1;
}
- if(bl && rand()%10000 < per)
- status_change_start(bl,type,val1,0,0,val4,tick,0);
+ if(bl)
+ status_change_start(bl,type,per/100,val1,0,0,val4,tick,0);
return 0;
}
@@ -6124,7 +6124,7 @@ int buildin_sc_start4(struct script_state *st)
tick/=2;
}
if (bl)
- status_change_start(bl,type,val1,val2,val3,val4,tick,0);
+ status_change_start(bl,type,100,val1,val2,val3,val4,tick,0);
return 0;
}
@@ -6153,7 +6153,7 @@ int buildin_sc_end(struct script_state *st)
int buildin_getscrate(struct script_state *st)
{
struct block_list *bl;
- int sc_def,type,rate;
+ int sc_def=0,type,rate;
type=conv_num(st,& (st->stack->stack_data[st->start+2]));
rate=conv_num(st,& (st->stack->stack_data[st->start+3]));
@@ -6162,10 +6162,11 @@ int buildin_getscrate(struct script_state *st)
else
bl = map_id2bl(st->rid);
- sc_def = status_get_sc_def(bl,type);
+ if (bl)
+ sc_def = status_get_sc_def(bl,type);
- rate = rate * sc_def / 100;
- push_val(st->stack,C_INT,rate);
+ rate = rate*(10000-sc_def)/10000;
+ push_val(st->stack,C_INT,rate<0?0:rate);
return 0;