summaryrefslogtreecommitdiff
path: root/world/map/npc/functions/travelers.txt
blob: c1b7f3fd748ae49f7642e3365b6e7d141884f2a8 (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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
// Travelers
// Authors: Wombat, Wushin

// Multiple Travelers
// Cannot access until found (Player Bitmask)
// Costs Zeny

// Contains all warp points to find
017-9,27,28,0|script|#TravelConfig|32767
{
    end;

OnInit:
    // TravelFound
    set $@tut_bit, (1 << 2);
    //set $@druid_tree_bit, (1 << 3);
    set $@graveyard_bit, (1 << 4);
    set $@magic_house_bit, (1 << 5);
    set $@terranite_cave_bit, (1 << 6);
    set $@tulimshar_bit, (1 << 7);
    set $@blue_sage_bit, (1 << 8);
    set $@hurnscald_bit, (1 << 9);
    set $@nivalis_bit, (1 << 10);
    //set $@tul_mine_bit, (1 << 11);
    set $@pachua_bit, (1 << 12);
    set $@barbarians_bit, (1 << 14);
    set $@hurns_farms_bit, (1 << 15);
    set $@candor_bit, (1 << 16);
    // Travel Base Cost
    set $@tulimshar_cost, 100;
    set $@hurnscald_cost, 100;
    set $@nivalis_cost, 100;
    //set $@druid_tree_cost, 150;
    //set $@tul_mine_cost, 150;
    set $@pachua_cost, 200;
    set $@graveyard_cost, 200;
    set $@magic_house_cost, 150;
    set $@terranite_cave_cost, 200;
    set $@blue_sage_cost, 200;
    set $@barbarians_cost, 150;
    set $@hurns_farms_cost, 150;
    set $@candor_cost, 200;
    end;
}

function|script|Traveler
{
    if(@npcname$ == "") set @npcname$, strnpcinfo(1);
    mes "["+@npcname$+"]";
    mes "\"Greetings. I am "+@npcname$+" the Traveler.\"";
    next;

    if (TravelFound & $@tut_bit)
        goto L_Main;
    goto L_TravelTut;

L_Main:
    if (TravelFound & @NpcTravelBit)
        goto L_BitTravelSet;
    goto L_SetTravelBit;

L_BitTravelSet:
    set @Cost, 10;
    if (BaseLevel < 45)
        set @Cost, 5;
    goto L_Start;

L_TravelTut:
    mes "["+@npcname$+"]";
    mes "\"We travelers are found all over the world. Once you have found a traveler at a certain location, you can be sent back there instantly by another traveler.\"";
    next;
    if (TravelFound & $@tut_bit)
        goto L_Main;
    goto L_SetBit;

L_SetBit:
    set TravelFound, TravelFound | $@tut_bit;
    goto L_Main;

L_SetTravelBit:
    mes "["+@npcname$+"]";
    mes "\"Uplink set. You can now return to this spot for a fee.\"";
    next;
    set TravelFound, TravelFound | @NpcTravelBit;
    goto L_BitTravelSet;

L_Start:
    mes "\"Where would you like to go?\"";
    menu
        "Tonori - Tulimshar (" + (@Cost * $@tulimshar_cost) + " GP)", L_TravelTulimshar,
        "Argeas - Hurnscald (" + (@Cost * $@hurnscald_cost) + " GP)", L_TravelHurnscald,
        "Kaizei - Nivalis (" + (@Cost * $@nivalis_cost) + " GP)", L_TravelNivalis,
        "Tonori - Pachua's Village (" + (@Cost * $@pachua_cost) + " GP)", L_TravelPachua,
        "Argeas - Candor (" + (@Cost * $@candor_cost) + " GP)", L_TravelCandor,
        "Argeas - Magic House (" + (@Cost * $@magic_house_cost) + " GP)", L_TravelMagicHouse,
        "Argeas - Farmsteads (" + (@Cost * $@hurns_farms_cost) + " GP)", L_TravelHurnsFarms,
        "Argeas - Graveyard (" + (@Cost * $@graveyard_cost) + " GP)", L_TravelGraveyard,
        "Argeas - Terranite Cave (" + (@Cost * $@terranite_cave_cost) + " GP)", L_TravelTerranite,
        "Kaizei - Barbarian Village (" + (@Cost * $@barbarians_cost) + " GP)", L_TravelBarbarians,
        "Kaizei - Sage Nikolai's Mansion (" + (@Cost * $@blue_sage_cost) + " GP)", L_TravelBlueSage,
        "Who are the Travelers?", L_TravelTut,
        "I'm not interested.", L_TravelNo;

L_TravelChecks:
    if (@NpcTravelBit == @NextLocationBit)
        goto L_AlreadyThere;
    if (!(TravelFound & @NextLocationBit))
        goto L_NoFound;
    if (Zeny < @NextLocationCost)
        goto L_NoMoney;
    goto L_TravelPlayer;

L_TravelPlayer:
    mes "["+@npcname$+"]";
    mes "\"Be fearless!\"";
    close2;
    set Zeny, Zeny - @NextLocationCost;
    warp @NextLocationMap$,@NextLocationX,@NextLocationY;
    goto L_Clearvars;

L_TravelGraveyard:
    set @NextLocationBit, $@graveyard_bit;
    set @NextLocationCost, (@Cost * $@graveyard_cost);
    set @NextLocationMap$, "026-1";
    set @NextLocationX, 49;
    set @NextLocationY, 45;
    goto L_TravelChecks;

L_TravelMagicHouse:
    set @NextLocationBit, $@magic_house_bit;
    set @NextLocationCost, (@Cost * $@magic_house_cost);
    set @NextLocationMap$, "013-1";
    set @NextLocationX, 120;
    set @NextLocationY, 93;
    goto L_TravelChecks;

L_TravelTerranite:
    set @NextLocationBit, $@terranite_cave_bit;
    set @NextLocationCost, (@Cost * $@terranite_cave_cost);
    set @NextLocationMap$, "012-3";
    set @NextLocationX, 445;
    set @NextLocationY, 65;
    goto L_TravelChecks;

L_TravelTulimshar:
    set @NextLocationBit, $@tulimshar_bit;
    set @NextLocationCost, (@Cost * $@tulimshar_cost);
    set @NextLocationMap$, "002-1";
    set @NextLocationX, 60;
    set @NextLocationY, 42;
    goto L_TravelChecks;

L_TravelBlueSage:
    set @NextLocationBit, $@blue_sage_bit;
    set @NextLocationCost, (@Cost  * $@blue_sage_cost);
    set @NextLocationMap$, "048-2";
    set @NextLocationX, 26;
    set @NextLocationY, 47;
    goto L_TravelChecks;

L_TravelHurnscald:
    set @NextLocationBit, $@hurnscald_bit;
    set @NextLocationCost, (@Cost * $@hurnscald_cost);
    set @NextLocationMap$, "008-1";
    set @NextLocationX, 79;
    set @NextLocationY, 84;
    goto L_TravelChecks;

L_TravelNivalis:
    set @NextLocationBit, $@nivalis_bit;
    set @NextLocationCost, (@Cost * $@nivalis_cost);
    set @NextLocationMap$, "020-1";
    set @NextLocationX, 53;
    set @NextLocationY, 122;
    goto L_TravelChecks;

L_TravelPachua:
    set @NextLocationBit, $@pachua_bit;
    set @NextLocationCost, (@Cost * $@pachua_cost);
    set @NextLocationMap$, "006-1";
    set @NextLocationX, 28;
    set @NextLocationY, 97;
    if(QUEST_MIRIAM_start != 0) goto L_Cheat;
    goto L_TravelChecks;

L_Cheat:
    set QUEST_MIRIAM_cheat, 1;
    set QUEST_MIRIAM_run, gettimetick(2) - QUEST_MIRIAM_start;
    set QUEST_MIRIAM_start, 0;
    goto L_TravelChecks;

L_TravelBarbarians:
    set @NextLocationBit, $@barbarians_bit;
    set @NextLocationCost, (@Cost * $@barbarians_cost);
    set @NextLocationMap$, "033-1";
    set @NextLocationX, 66;
    set @NextLocationY, 33;
    goto L_TravelChecks;

L_TravelHurnsFarms:
    set @NextLocationBit, $@hurns_farms_bit;
    set @NextLocationCost, (@Cost * $@hurns_farms_cost);
    set @NextLocationMap$, "055-1";
    set @NextLocationX, 135;
    set @NextLocationY, 60;
    goto L_TravelChecks;

L_TravelCandor:
    set @NextLocationBit, $@candor_bit;
    set @NextLocationCost, (@Cost * $@candor_cost);
    set @NextLocationMap$, "029-1";
    set @NextLocationX, 69;
    set @NextLocationY, 69;
    goto L_TravelChecks;

L_TravelNo:
    mes "["+@npcname$+"]";
    mes "\"Perhaps you will have the courage to help us some day.\"";
    close2;
    goto L_Clearvars;

L_NoMoney:
    mes "["+@npcname$+"]";
    mes "\"I'm sorry, but you don't have enough money. Maybe next time.\"";
    close2;
    goto L_Clearvars;

L_NoFound:
    mes "["+@npcname$+"]";
    mes "\"Sorry, but you haven't visited a traveler yet at that location. You should find and talk to a traveler there so you can quickly return to that location in the future.\"";
    close2;
    goto L_Clearvars;

L_AlreadyThere:
    mes "["+@npcname$+"]";
    mes "\"Uh... You're already here. Are you sure you know where you are going?\"";
    close2;
    goto L_Clearvars;

L_Clearvars:
    set @npcname$, "";
    set @Cost, 0;
    set @NextLocationBit, 0;
    set @NextLocationCost, 0;
    set @NextLocationMap$, "";
    set @NextLocationX, 0;
    set @NextLocationY, 0;
    return;
}