summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorFate <fate-tmw@googlemail.com>2009-01-10 13:20:28 -0700
committerFate <fate-tmw@googlemail.com>2009-01-10 13:20:28 -0700
commit32dedca10869bcd7b82428857e1866fcc495124e (patch)
treebde7443c809036c859b7a9b2c4b1f9dae342d618 /src/map/script.c
parent43734bbbac5d8d5c107fdc868dff43e70b728e2c (diff)
downloadtmwa-32dedca10869bcd7b82428857e1866fcc495124e.tar.gz
tmwa-32dedca10869bcd7b82428857e1866fcc495124e.tar.bz2
tmwa-32dedca10869bcd7b82428857e1866fcc495124e.tar.xz
tmwa-32dedca10869bcd7b82428857e1866fcc495124e.zip
Added `isat' scripting command
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 57d78f6..1685d21 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -106,6 +106,7 @@ int buildin_menu(struct script_state *st);
int buildin_rand(struct script_state *st);
int buildin_pow(struct script_state *st);
int buildin_warp(struct script_state *st);
+int buildin_isat(struct script_state *st);
int buildin_areawarp(struct script_state *st);
int buildin_heal(struct script_state *st);
int buildin_itemheal(struct script_state *st);
@@ -312,6 +313,7 @@ struct {
{buildin_jobchange,"jobchange","i*"},
{buildin_input,"input","*"},
{buildin_warp,"warp","sii"},
+ {buildin_isat,"isat","sii"},
{buildin_areawarp,"areawarp","siiiisii"},
{buildin_setlook,"setlook","ii"},
{buildin_set,"set","ii"},
@@ -1721,6 +1723,30 @@ int buildin_pow(struct script_state *st)
}
/*==========================================
+ * Check whether the PC is at the specified location
+ *------------------------------------------
+ */
+int buildin_isat(struct script_state *st)
+{
+ int x,y;
+ char *str;
+ struct map_session_data *sd=script_rid2sd(st);
+
+ str=conv_str(st,& (st->stack->stack_data[st->start+2]));
+ x=conv_num(st,& (st->stack->stack_data[st->start+3]));
+ y=conv_num(st,& (st->stack->stack_data[st->start+4]));
+
+ if (!sd)
+ return 1;
+
+ push_val(st->stack, C_INT,
+ (x == sd->bl.x)
+ && (y == sd->bl.y)
+ && (!strcmp(str, map[sd->bl.m].name)));
+
+ return 0;
+}
+/*==========================================
*
*------------------------------------------
*/