summaryrefslogtreecommitdiff
path: root/npc/016-1/captain.txt
blob: 3a7f32dccac72a0d2969607d4a7714311be7d1f1 (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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
// TMW2 scripts.
// Authors:
//    Jesusalva
// Description:
//    Temporary, placeholder.

016-1,19,29,0	script	Captain	NPC_NARD,{
    .@price=2000;
    if (BaseLevel < 20)
        goto L_TooWeak;

    mesn;
    mesq l("Hi @@.", strcharinfo(0));
    next;
    mesq l("You are currently at @@.", LOCATION$);
    mes "";

        menu
            rif(LOCATION$ != "Tulim", l("To Tulimshar.")), L_TTulim,
            rif(LOCATION$ != "Hurns", l("To Hurnscald.")), L_THurns,
            rif(LOCATION$ != "Nival" && is_gm(), l("To Nivalis.")), L_TNival,
            l("No, I'll save my money."), -;

    close;

///// ---------- Tulimshar ----------
L_TTulim:
    .@x=reputation("Tulim");

    if (.@x >= 14)
        .@price-=1850;
    else if (.@x >= 12)
        .@price-=1750;
    else if (.@x >= 10)
        .@price-=1500;
    else if (.@x >= 8)
        .@price-=1000;
    else if (.@x >= 6)
        .@price-=750;
    else if (.@x >= 4)
        .@price-=500;
    else if (.@x >= 2)
        .@price-=250;

    mes "";
    mesn;
    mesq l("It'll cost you @@ GP.", .@price);
    mes "";

    if (Zeny < .@price) {
        mes l("You still need @@ GP to afford it.", (.@price-Zeny));
        close;
    }

    if (askyesno() != ASK_YES)
        close;

    Zeny=Zeny-.@price;
    PC_DEST$="Tulim";
    @timer_navio_running = 1;

    mes "";
    mesn;
    mesq l("Tulimshar, right? The oldest human city-state!");
    next;
    mesq l("I was planning to go there soon, anyway. All aboard!");
    close2;
    goto L_DoWarp;







///// ---------- Hurnscald ----------
L_THurns:
    .@x=reputation("Hurns");

    if (.@x >= 5)
        .@price-=1750;
    else if (.@x >= 4)
        .@price-=1600;
    else if (.@x >= 3)
        .@price-=1200;
    else if (.@x >= 2)
        .@price-=800;
    else if (.@x >= 1)
        .@price-=400;

    mes "";
    mesn;
    mesq l("It'll cost you @@ GP.", .@price);
    mes "";

    if (Zeny < .@price) {
        mes l("You still need @@ GP to afford it.", (.@price-Zeny));
        close;
    }

    if (askyesno() != ASK_YES)
        close;

    Zeny=Zeny-.@price;
    PC_DEST$="Hurns";

    mes "";
    mesn;
    mesq l("Hurnscald? Small farming towns are always nice to visit.");
    next;
    mesq l("I was planning to go there soon, anyway. All aboard!");
    close2;
    goto L_DoWarp;







///// ---------- Nivalis ----------
L_TNival:
    .@x=reputation("Nival");

    if (.@x >= 1)
        .@price-=1000;

    mes "";
    mesn;
    mesq l("It'll cost you @@ GP.", .@price);
    mes "";

    if (Zeny < .@price) {
        mes l("You still need @@ GP to afford it.", (.@price-Zeny));
        close;
    }

    if (askyesno() != ASK_YES)
        close;

    Zeny=Zeny-.@price;
    PC_DEST$="Nival";

    mes "";
    mesn;
    mesq l("Nivalis? It's frozen during the whole year! I hope you have good ice gear and a high level...");
    next;
    mesq l("I was planning to go there soon, anyway. All aboard!");
    close2;
    goto L_DoWarp;







///// ---------------- Core Utils
L_TooWeak:
    mesn;
    mesq l("The sea route I take is very dangerous, and full of pirates. You're too weak to travel with me.");
    close;

L_DoWarp:
    addtimer nard_time(PC_DEST$), "#MarineShip::OnEvent";
    @timer_navio_running = 1;
    warp "016-6", 40, 32;

    // 10% base chance of Pirate Attack!
    // Each level INCREASES this in 0.1%.
    // So for a level 40 player, chances are 14%.
    if (rand(1, 10000) < 1000+(BaseLevel*10))
        addtimer rand(3000,6000), "#MarineShipAttack::OnEvent";
    end;


OnInit:
    .sex = G_MALE;
    .distance = 5;
    end;


OnInterIfInit:
    // Tulim Instance
    .TULIM_INSTID = instance_create("016-1@TulimInst", 0, IOT_NONE);
    instance_attachmap("016-1", .TULIM_INSTID, 0, "016-1@Tulim");
    instance_set_timeout(1000000, 1000000, .TULIM_INSTID);
    instance_init(.TULIM_INSTID);

    // Hurns Instance
    .HURNS_INSTID = instance_create("016-1@HurnsInst", 0, IOT_NONE);
    instance_attachmap("016-1", .HURNS_INSTID, 0, "016-1@Hurns");
    instance_set_timeout(1000000, 1000000, .HURNS_INSTID);
    instance_init(.HURNS_INSTID);

    // Nivalis Instance
    .NIVAL_INSTID = instance_create("016-1@NivalInst", 0, IOT_NONE);
    instance_attachmap("016-1", .NIVAL_INSTID, 0, "016-1@Nival");
    instance_set_timeout(1000000, 1000000, .NIVAL_INSTID);
    instance_init(.NIVAL_INSTID);
    end;

}