summaryrefslogtreecommitdiff
path: root/npc/config/location.txt
blob: a094075fd266d267bc9d31b7a889213e384a582a (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Moubootaur Legends Script
// Author: Jesusalva
// Location Config

-	script	loc_config	32767,{
    end;

OnInit:
    // TODO: Migglemire, Westport... As this is only used for ship right now, meh
    setarray $@LOCMASTER_TP,  TP_ARTIS, TP_TULIM, TP_HURNS, TP_CANDOR, TP_ARGAES;
    setarray $@LOCMASTER_LOC$, "Artis", "Tulim" , "Hurns" , "Candor" , "Argaes" ;
    setarray $@LOCMASTER_MAP$, "001-1", "020-1" , "008-1" , "012-1"  , "008-1-1";
    setarray $@LOCMASTER_X,        203,      209,      326,        63,        33;
    setarray $@LOCMASTER_Y,         85,      143,      104,       133,        63;
    end;

OnInterIfInit:
    // Create ship instances
    /* La Marine's Ship */
    // Tulim Instance
    .TULIM_INSTID = instance_create("marine@TulimInst", 0, IOT_NONE);
    instance_attachmap("marine", .TULIM_INSTID, 0, "marine@Tulim");
    instance_set_timeout(0, 0, .TULIM_INSTID);
    instance_init(.TULIM_INSTID);

    // Hurns Instance
    .HURNS_INSTID = instance_create("marine@HurnsInst", 0, IOT_NONE);
    instance_attachmap("marine", .HURNS_INSTID, 0, "marine@Hurns");
    instance_set_timeout(0, 0, .HURNS_INSTID);
    instance_init(.HURNS_INSTID);

    // Candor Instance
    .CANDOR_INSTID = instance_create("marine@CandorInst", 0, IOT_NONE);
    instance_attachmap("marine", .CANDOR_INSTID, 0, "marine@Candor");
    instance_set_timeout(0, 0, .CANDOR_INSTID);
    instance_init(.CANDOR_INSTID);

    // Artis Instance (Frigate Gema IV)
    .ARTIS_INSTID = instance_create("marine@ArtisInst", 0, IOT_NONE);
    instance_attachmap("marine", .ARTIS_INSTID, 0, "marine@Artis");
    instance_set_timeout(0, 0, .ARTIS_INSTID);
    instance_init(.ARTIS_INSTID);

    /* Other instances */
    .GALI_INSTID = instance_create("008-1-1@galimatia", 0, IOT_NONE);
    instance_attachmap("008-1-1", .GALI_INSTID, 0, "gali@matia");
    instance_set_timeout(0, 0, .GALI_INSTID);
    instance_init(.GALI_INSTID);
    end;
}

// Warps you to last visited town
function	script	ReturnLastTown	{
    PC_DEST$ = "";
    @timer_navio_running = 0;
    .@i=array_find($@LOCMASTER_LOC$, LOCATION$);
    warp $@LOCMASTER_MAP$[.@i], $@LOCMASTER_X[.@i], $@LOCMASTER_Y[.@i];
    return;
}

// Upon entering a town, save it to LOCATION$
// EnterTown( LocName{, warp=False} )
function	script	EnterTown	{
    // Fill variable
    .@v$=getarg(0);

    // Validade variable
    if (array_find($@LOCMASTER_LOC$, .@v$) < 0) {
        consolemes(CONSOLEMES_ERROR, "Invalid location passed to EnterTown: "+.@v$);
        if (getarg(1, false))
            ReturnLastTown();
        return;
    }

    // Save location
    LOCATION$=.@v$;

    // If "warp" is true
    if (getarg(1, false))
        ReturnLastTown();
    return;
}