diff options
author | gumi <mekolat@users.noreply.github.com> | 2016-11-30 12:27:39 -0500 |
---|---|---|
committer | gumi <mekolat@users.noreply.github.com> | 2016-12-03 11:51:42 -0500 |
commit | a99251263c6e968d9ac30cd002966365558e33f3 (patch) | |
tree | 23c796da6318f4437d8e7f8bcf4fce0273056233 | |
parent | 2a8700db3680dd59363230e4fa43b5f33e712e04 (diff) | |
download | serverdata-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
-rw-r--r-- | npc/functions/savepoint.txt | 23 |
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; } |