diff options
author | Saulc <lucashelaine14@gmail.com> | 2018-01-13 20:50:42 +0100 |
---|---|---|
committer | Saulc <lucashelaine14@gmail.com> | 2018-01-13 20:50:42 +0100 |
commit | 20df2abc1aca00d6aa5dc78347133890f36b32f3 (patch) | |
tree | 4ad4a8bb8b0605473a702e314799a4626347721a /npc/functions/savepoint.txt | |
download | serverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.tar.gz serverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.tar.bz2 serverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.tar.xz serverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.zip |
Initial commit
Diffstat (limited to 'npc/functions/savepoint.txt')
-rw-r--r-- | npc/functions/savepoint.txt | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/npc/functions/savepoint.txt b/npc/functions/savepoint.txt new file mode 100644 index 000000000..0e0b6f908 --- /dev/null +++ b/npc/functions/savepoint.txt @@ -0,0 +1,48 @@ +// Evol functions. +// Authors: +// gumi +// Reid +// 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, +// getarg(1) x's value, +// getarg(2) y's value, +// getarg(3) INN flag. + +function script savepointparticle { + + if (gettimetick(2) - @lastSave < 5) + return; + + .@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), l("Your position has been saved."); + + if (getarg(.@i, NO_INN) == NO_INN) + { + INN_REGISTER = NO_INN; + } + savepoint .@mapname$, .@mapx, .@mapy; + specialeffect(4, SELF, getcharid(3)); + @lastSave = gettimetick(2); + + return; +} |