summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 27567c3..ca5c427 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -316,6 +316,9 @@ int buildin_shop (struct script_state *st); // [MadCamel]
int buildin_isdead (struct script_state *st); // [Jaxad0127]
int buildin_fakenpcname (struct script_state *st); //[Kage]
int buildin_unequip_by_id (struct script_state *st); // [Freeyorp]
+int buildin_getx (struct script_state *st); // [Kage]
+int buildin_gety (struct script_state *st); // [Kage]
+
void push_val (struct script_stack *stack, int type, int val);
int run_func (struct script_state *st);
@@ -737,6 +740,10 @@ struct
buildin_fakenpcname, "fakenpcname", "ssi"},
{
buildin_unequip_by_id, "unequipbyid", "i"}, // [Freeyorp]
+ {
+ buildin_getx, "getx", "i"}, // [Kage]
+ {
+ buildin_gety, "gety", "i"}, // [Kage]
// End Additions
{
NULL, NULL, NULL},};
@@ -7250,6 +7257,31 @@ int buildin_fakenpcname (struct script_state *st)
return 0;
}
+/*============================
+ * Gets the PC's x pos
+ *----------------------------
+ */
+
+int buildin_getx (struct script_state *st)
+{
+ struct map_session_data *sd = script_rid2sd (st);
+
+ push_val (st->stack, C_INT, sd->bl.x);
+ return 0;
+}
+
+/*============================
+ * Gets the PC's y pos
+ *----------------------------
+ */
+int buildin_gety (struct script_state *st)
+{
+ struct map_session_data *sd = script_rid2sd (st);
+
+ push_val (st->stack, C_INT, sd->bl.y);
+ return 0;
+}
+
//
// 実行部main
//