summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFate <fate-tmw@googlemail.com>2009-05-16 13:54:51 +0000
committerFate <fate-tmw@googlemail.com>2009-05-16 13:54:51 +0000
commit609f20501e891a9200df680f39b0bd40d158b154 (patch)
treeaff2a6d01514f87989ad39ccd46b8196cffa5b9c
parent92ff8019cfa9d5ec4cd825cc0ca944b277fe80b0 (diff)
downloadtmwa-609f20501e891a9200df680f39b0bd40d158b154.tar.gz
tmwa-609f20501e891a9200df680f39b0bd40d158b154.tar.bz2
tmwa-609f20501e891a9200df680f39b0bd40d158b154.tar.xz
tmwa-609f20501e891a9200df680f39b0bd40d158b154.zip
Added sc_check command to determine whether a given status change is active
-rw-r--r--src/map/script.c18
-rw-r--r--src/map/skill.c16
-rw-r--r--src/map/skill.h1
3 files changed, 35 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index a0ab3e0..e3f82d6 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -209,6 +209,7 @@ int buildin_hideonnpc(struct script_state *st);
int buildin_sc_start(struct script_state *st);
int buildin_sc_start2(struct script_state *st);
int buildin_sc_end(struct script_state *st);
+int buildin_sc_check(struct script_state *st);
int buildin_getscrate(struct script_state *st);
int buildin_debugmes(struct script_state *st);
int buildin_resetlvl(struct script_state *st);
@@ -413,6 +414,7 @@ struct {
{buildin_sc_start,"sc_start","iii*"},
{buildin_sc_start2,"sc_start2","iiii*"},
{buildin_sc_end,"sc_end","i"},
+ {buildin_sc_check,"sc_check","i"},
{buildin_getscrate,"getscrate","ii*"},
{buildin_debugmes,"debugmes","s"},
{buildin_resetlvl,"resetlvl","i"},
@@ -4162,6 +4164,22 @@ int buildin_sc_end(struct script_state *st)
// printf("sc_end : %d %d\n",st->rid,type);
return 0;
}
+
+int buildin_sc_check(struct script_state *st)
+{
+ struct block_list *bl;
+ int type;
+ type=conv_num(st,& (st->stack->stack_data[st->start+2]));
+ bl = map_id2bl(st->rid);
+ if(bl->type == BL_PC && ((struct map_session_data *)bl)->state.potionpitcher_flag)
+ bl = map_id2bl(((struct map_session_data *)bl)->skilltarget);
+
+ push_val (st->stack, C_INT,
+ skill_status_change_active(bl, type));
+
+ return 0;
+}
+
/*==========================================
* 状態異常耐性を計算した確率を返す
*------------------------------------------
diff --git a/src/map/skill.c b/src/map/skill.c
index 8a25f64..3099aeb 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -7494,6 +7494,22 @@ int skill_status_change_timer_sub(struct block_list *bl, va_list ap )
* ステータス異常終了
*------------------------------------------
*/
+int skill_status_change_active(struct block_list* bl, int type)
+{
+ struct status_change* sc_data;
+
+ nullpo_retr(0, bl);
+ if(bl->type!=BL_PC && bl->type!=BL_MOB) {
+ if(battle_config.error_log)
+ printf("skill_status_change_active: neither MOB nor PC !\n");
+ return 0;
+ }
+
+ nullpo_retr(0, sc_data = battle_get_sc_data(bl));
+
+ return sc_data[type].timer != -1;
+}
+
int skill_status_change_end(struct block_list* bl, int type, int tid)
{
struct status_change* sc_data;
diff --git a/src/map/skill.h b/src/map/skill.h
index bfbe93e..ea204e0 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -129,6 +129,7 @@ int skill_is_danceskill(int id);
int skill_status_effect(struct block_list *bl,int type,int val1,int val2,int val3,int val4,int tick,int flag, int spell_invocation);
int skill_status_change_start(struct block_list *bl,int type,int val1,int val2,int val3,int val4,int tick,int flag);
int skill_status_change_timer(int tid, unsigned int tick, int id, int data);
+int skill_status_change_active(struct block_list *bl,int type); // [fate]
int skill_encchant_eremental_end(struct block_list *bl, int type);
int skill_status_change_end( struct block_list* bl , int type,int tid );
int skill_status_change_clear(struct block_list *bl,int type);