summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorgumi <mekolat@users.noreply.github.com>2016-11-30 12:27:39 -0500
committergumi <mekolat@users.noreply.github.com>2016-12-03 11:51:42 -0500
commita99251263c6e968d9ac30cd002966365558e33f3 (patch)
tree23c796da6318f4437d8e7f8bcf4fce0273056233 /npc/functions
parent2a8700db3680dd59363230e4fa43b5f33e712e04 (diff)
downloadserverdata-a99251263c6e968d9ac30cd002966365558e33f3.tar.gz
serverdata-a99251263c6e968d9ac30cd002966365558e33f3.tar.bz2
serverdata-a99251263c6e968d9ac30cd002966365558e33f3.tar.xz
serverdata-a99251263c6e968d9ac30cd002966365558e33f3.zip
allow `savepointparticle` to inherit map, x, y from the npc that calls it
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/savepoint.txt23
1 files changed, 21 insertions, 2 deletions
diff --git a/npc/functions/savepoint.txt b/npc/functions/savepoint.txt
index ccf1b8b3..39ebb064 100644
--- a/npc/functions/savepoint.txt
+++ b/npc/functions/savepoint.txt
@@ -1,8 +1,13 @@
// Evol functions.
// Author:
// Reid
+// gumi
// Description:
// Adds a new save point location.
+// Usage:
+// savepointparticle;
+// savepointparticle NO_INN;
+// savepointparticle map, x, y, NO_INN;
// Description:
// Save location with arguments:
// getarg(0) map name,
@@ -11,13 +16,27 @@
// getarg(3) INN flag.
function script savepointparticle {
+ .@mapname$ = getarg(0, "");
+ .@mapx = getarg(1, -1);
+ .@mapy = getarg(2, -1);
+ .@i = 3;
+
+ if (.@mapy < 1)
+ {
+ .@npc$ = strnpcinfo(0);
+ .@mapname$ = getvariableofnpc(.map$, .@npc$);
+ .@mapx = getvariableofnpc(.x, .@npc$);
+ .@mapy = getvariableofnpc(.y, .@npc$);
+ .@i = 0;
+ }
+
message strcharinfo(0), "Your position has been saved.";
- if (getarg(3, NO_INN) == NO_INN)
+ if (getarg(.@i, NO_INN) == NO_INN)
{
INN_REGISTER = NO_INN;
}
- savepoint getarg(0), getarg(1), getarg(2);
+ savepoint .@mapname$, .@mapx, .@mapy;
misceffect 4, getcharid(3);
return;
}