summaryrefslogtreecommitdiff
path: root/npc/functions/savepoint.txt
blob: 2118d8aa59107ea7a9e85ea54b4b594ff356aaa6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// 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;
    }
    if (GSET_SOULMENHIR_MANUAL)
        savepoint .@mapname$, .@mapx, .@mapy;
    specialeffect(4, SELF, getcharid(3));
    @lastSave = gettimetick(2);

    return;
}