summaryrefslogtreecommitdiff
path: root/npc/000-1/exit.txt
blob: 2f043e3e235544b41d923a48f22f4b4e00e06ce4 (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
// TMW2 scripts.
// Author:
//    Jesusalva
// Description:
//    Special Soul Menhir which only allows leaving the map.

000-1,22,22,0	script	Emergency Exit	NPC_SOUL_CURSED,2,2,{
OnTouch:
OnTalk:
OnTalkNearby:
    // Switch LOCATION$ and warp to nearest town's Soul Menhir
    .@lx=array_find($@LOCAMASTER_LOC$, LOCATION$);
    debugmes "%d", .@lx;
    if (.@lx >= 0) {
        warp $@LOCMASTER_MAP$[.@lx], $@LOCMASTER_X[.@lx], $@LOCMASTER_Y[.@lx];
        debugmes "%s (%d , %d)", $@LOCMASTER_MAP$[.@lx], $@LOCMASTER_X[.@lx], $@LOCMASTER_Y[.@lx];
        end;
    }

    //if (getsavepoint(0) != "000-1") warp getsavepoint(0), getsavepoint(1), getsavepoint(2);
    if (getsavepoint(0) != "000-1") warp "Save", 0, 0;
    if (getsavepoint(0) != "000-1") end;
    savepoint "002-1", 53, 38;
    warp "002-1", 53, 38;
    end;

OnInit:
    setarray $@LOCMASTER_LOC$, "Candor", "Tulim", "Halin", "Hurns",   "LoF", "Nival"; // 018-5 Lilit 024-1 Frostia
    setarray $@LOCMASTER_MAP$,  "005-1", "003-1", "009-1", "012-1", "017-1", "020-1";
    setarray $@LOCMASTER_X,          34,      40,      26,      86,     119,      56;
    setarray $@LOCMASTER_Y,         101,      49,      30,      69,      87,      62;
    end;

}