summaryrefslogtreecommitdiff
path: root/npc/002-3/doors.txt
blob: 4bf062b160d875935bf1f88961a7b2ee54486895 (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// TMW2 Scripts.
// Author:
//    Jesusalva
// Description:
//    Doors NPCs.
//    The third value of the .@nard variable has been removed for the beta2, it'll then be re-added for the Aurora release.
// Variable:
//    0 ShipQUests_Nard
//    1 ShipQuests_Julia
// Values:
//    Nard:
//    00   Introduction of the boxes and Nard. This is displayed when the player never spoke to Nard or his box.
//    01   Nard spoke and gave access to the outdoor of the ship.
//    02   Completed the Gugli quest.
//    03   ChefGado Quest accepted.
//    04   ChefGado Quest completed and "Introduction" chapter finalized.
//    05   Reward taken from the box.
//    10   Has not talked to Julia
//    11   Need to see Julia
//    12   Has been registered by Julia

002-3,30,28,0	script	AreaNPC#doors4	NPC_HIDDEN,0,0,{

OnTouch:
    .@nard = getq(ShipQuests_Nard);

    if (LOCATION$ == "Candor")
    {
        warp "005-1", 42, 107;
        close;
    }
    if (LOCATION$ == "Tulim")
    {
        warp "003-1", 81, 68;
        close;
    }

    // None of these checks will ever return positive, but were kept when delay is applied.
    if (.@nard == 4) goto L_GotoNard;
    if (.@nard == 5) goto L_End;

    setcamnpc "Julia";
    mesn "Julia";
    mesq l("The captain has locked the door, you should go see him.");
    next;

    mesn "Narrator";
    mes col(l("Captain Nard is in the room to your right."), 9);
    next;
    restorecam;

    close;

L_GotoNard:
    setcamnpc "Julia";
    mesn "Julia";
    mesq l("The captain is waiting for you! Hurry up.");
    next;
    restorecam;

    close;

L_End:
    mesn "Narrator";
    mesq col(l("This door is locked."), 9);
    setcamnpc "Julia";
    next;
    mesn "Julia";
    mesq l("We're soon leaving that island, please return to your cabine.");
    next;
    restorecam;
   
    close;


OnInterIfInit:

    // Candor Instance (we do all tests for debugmes here)
    .CANDOR_INSTID = instance_create("002-1@CandorInst", 0, IOT_NONE);
    if (.CANDOR_INSTID < 0) debugmes "Error: No instance ID";
    else {
        debugmes "created new instance id: " + str(.CANDOR_INSTID);
        .CANDOR1$=instance_attachmap("002-1", .CANDOR_INSTID, 0, "002-1@Candor");
        if (.CANDOR1$ == "") debugmes "Error: Map 002-1 CANDY failed";

        .CANDOR3$=instance_attachmap("002-3", .CANDOR_INSTID, 0, "002-3@Candor");
        if (.CANDOR3$ == "") debugmes "Error: Map 002-3 CANDY failed";

        .CANDOR4$=instance_attachmap("002-4", .CANDOR_INSTID, 0, "002-4@Candor");
        if (.CANDOR4$ == "") debugmes "Error: Map 002-4 CANDY failed";

        debugmes "Nard's Ship in Candor instance is set.";
        instance_set_timeout(1000000, 1000000, .CANDOR_INSTID);
        instance_init(.CANDOR_INSTID);
    }

    // Tulim Instance
    .TULIM_INSTID = instance_create("002-1@TulimInst", 0, IOT_NONE);
    instance_attachmap("002-1", .TULIM_INSTID, 0, "002-1@Tulim");
    instance_attachmap("002-3", .TULIM_INSTID, 0, "002-3@Tulim");
    instance_attachmap("002-4", .TULIM_INSTID, 0, "002-4@Tulim");
    instance_set_timeout(1000000, 1000000, .TULIM_INSTID);
    instance_init(.TULIM_INSTID);
    end;
}

002-3,44,28,0	script	AreaNPC#doors5	NPC_HIDDEN,0,0,{

OnTouch:
    .@julia = getq(ShipQuests_Julia);
    if (.@julia >= 2) goto L_Warp;
    close;

L_Warp:
    if (LOCATION$ == "") 
        warp "002-4", 20, 27;
    else
        warp "002-4@"+LOCATION$, 20, 27;
    close;
}

002-3,42,25,0	script	AreaNPC#002-3d	NPC_HIDDEN,0,0,{

OnTouch:
    if (LOCATION$ == "") 
        warp "002-1", 72, 29;
    else
        warp "002-1@"+LOCATION$, 72, 29;
    close;
}