summaryrefslogtreecommitdiff
path: root/npc/custom/etc/morroc_raceway.txt
blob: 745b1d77924624b02ed6aa7ce7f3ee95623b33c4 (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
//===== Hercules Script ======================================
//= Morroc Raceway
//===== By: ==================================================
//= acky
//===== Current Version: =====================================
//= 1.3
//===== Description: =========================================
//= Lets players race around Morroc (pvp_y_1-5)
//===== Additional Comments: =================================
//= If there are more than 3 players, at least 3 people
//= must finish before a new race can be started.
//=
//= If there are less than 3 players, at least 1 person
//= must finish before a new race can be started.
//=
//= Removed permanent global variables
//= 1.2 Removed Duplicates [Silent]
//= 1.3 Replaced effect numerics with constants. [Samuray22]
//============================================================

//Warps you into race way
morocc,166,105,6	script	Race Girl#01	4_F_KAFRA2,{
	mes "[Race Girl]";
	mes "Would you like to visit ^0000FFMorroc Raceway^000000?";
	next;
	if (select("Yes", "No") != 1) {
		mes "[Race Girl]";
		mes "Alright, talk to me again when you want to go.";
		close;
	}
	warp "pvp_y_1-5",165,256;
	close;
}

//Warps you out of raceway
pvp_y_1-5,169,265,5	script	Race Girl#02	4_F_KAFRA2,{
	mes "[Race Girl]";
	mes "Welcome to Morroc Raceway!";
	next;
	switch (select("Information", "Leave", "Cancel")) {
	case 1:
		mes "[Race Girl]";
		mes "Someone must click on the Starter NPC to start the race.";
		next;
		mes "[Race Girl]";
		mes "Once the race is started, run around Morroc anti-clockwise.";
		next;
		mes "[Race Girl]";
		mes "You must reach all the checkpoints - No cheating!";
		close;
	case 2:
		warp "morocc",165,101;
		end;
	case 3:
		mes "[Race Girl]";
		mes "Come again soon!";
		close;
	}
}

//Counts down and starts race
pvp_y_1-5,145,269,5	script	Starter	4_M_JOB_KNIGHT1,{
	if ($@race != 0) goto L_Started;
	if ($@counting != 0) goto L_Started;
	if ($@racecount == 1) goto L_Started;
L_Menu:
	mes "[Race Starter]";
	mes "Please stay on the Eastern side of me.";
	if (select("Start Race", "Cancel") != 1)
		close;
	set $@counting,1;
	mes "Counting down...";
	addtimer 1000, "Starter::OnCount1000";
	addtimer 2000, "Starter::OnCount2000";
	addtimer 3000, "Starter::OnCount3000";
	addtimer 4000, "Starter::OnCount4000";
	announce strcharinfo(PC_NAME) + "Started a countdown",1;
	announce "Get ready to race!",1;
	close;

OnCount1000:
	announce "[3]",1;
	end;
OnCount2000:
	announce "[2]",1;
	end;
OnCount3000:
	announce "[1]",1;
	end;
OnCount4000:
	emotion 27;
	specialeffect EF_CHIMTO;
	announce "[GO!]",1;
	set $@race,1;
	set $@position,0;
	set $@counting,0;
	set $@raceid,rand(100000,999999);
	end;

L_Started:
	if ((getmapusers("pvp_y_1-5") < 3) && ($@position > 0)) goto L_Menu;
	if ($@position > 2) goto L_Menu;
	mes "[Starter]";
	mes "Race in progress";
	close;

OnInit:
	set $@race,0;
	set $@position,0;
	set $@racecount,0;
	end;
}

//Checkpoint 1
pvp_y_1-5,144,262,5	script	Check Point 1	HIDDEN_NPC,0,5,{
	end;
OnTouch:
	if (@raceid != $@raceid) goto L_Started;
	if (@race == 6) goto L_Finished;
	if ($@race == 1) goto L_Started;
	mes "The race has not started, please move back.";
	close;
L_Started:
	set @race,1;
	set @raceid,$@raceid;
	end;
L_Finished:
	mes "You have already completed the race.";
	close;
}

//Checkpoint 2
pvp_y_1-5,73,247,5	script	Check Point 2	HIDDEN_NPC,6,6,{
	end;
OnTouch:
	if (@race != 1) goto L_Miss;
	set @race,2;
	announce "[" + strcharinfo(PC_NAME) +"] has reached Checkpoint [1]",1;
	end;
L_Miss:
	mes "You have missed a Checkpoint. Please go back.";
	close;
}

//Checkpoint 3
pvp_y_1-5,77,44,5	script	Check Point 3	HIDDEN_NPC,6,6,{
	end;
OnTouch:
	if (@race != 2) goto L_Miss;
	set @race,3;
	announce "[" + strcharinfo(PC_NAME) +"] has reached Checkpoint [2]",1;
	end;
L_Miss:
	mes "You have missed a Checkpoint. Please go back.";
	close;
}

//Checkpoint 3
pvp_y_1-5,249,60,5	script	Check Point 4	HIDDEN_NPC,6,6,{
	end;
OnTouch:
	if (@race != 3) goto L_Miss;
	set @race,4;
	announce "[" + strcharinfo(PC_NAME) +"] has reached Checkpoint [3]",1;
	end;
L_Miss:
	mes "You have missed a Checkpoint. Please go back.";
	close;
}

//Checkpoint 4
pvp_y_1-5,255,256,5	script	Check Point 5	HIDDEN_NPC,6,6,{
	end;
OnTouch:
	if (@race != 4) goto L_Miss;
	set @race,5;
	announce "[" + strcharinfo(PC_NAME) +"] has reached Checkpoint [4]",1;
	end;
L_Miss:
	mes "You have missed a Checkpoint. Please go back.";
	close;
}

//Finish Line
pvp_y_1-5,174,244,5	script	Finish Line	HIDDEN_NPC,6,6,{
	end;
OnTouch:
	if (@raceid != $@raceid) goto L_WrongRace;
	if (@race != 5) goto L_Miss;
	set @race,6;
	set $@position,$@position+1;
	announce "[" + strcharinfo(PC_NAME) +"] has reached The Finish line! [Position: " + $@position + "]",1;
	end;
L_Miss:
	mes "You have missed a Checkpoint. Please go back.";
	close;
L_WrongRace:
	mes "You are not in this race.";
	close;
}

//Check Point Marker Flags
pvp_y_1-5,144,267,4	script	Check Point 1#01	GUILD_FLAG,{
	end;
}
pvp_y_1-5,144,257,4	script	Check Point 1#02	GUILD_FLAG,{
	end;
}
pvp_y_1-5,70,252,3	script	Check Point 2#01	GUILD_FLAG,{
	end;
}
pvp_y_1-5,77,243,3	script	Check Point 2#02	GUILD_FLAG,{
	end;
}
pvp_y_1-5,81,48,1	script	Check Point 3#01	GUILD_FLAG,{
	end;
}
pvp_y_1-5,72,40,1	script	Check Point 3#02	GUILD_FLAG,{
	end;
}
pvp_y_1-5,244,65,7	script	Check Point 4#01	GUILD_FLAG,{
	end;
}
pvp_y_1-5,252,57,7	script	Check Point 4#02	GUILD_FLAG,{
	end;
}
pvp_y_1-5,259,260,5	script	Check Point 5#01	GUILD_FLAG,{
	end;
}
pvp_y_1-5,251,252,5	script	Check Point 5#02	GUILD_FLAG,{
	end;
}
pvp_y_1-5,174,249,4	script	Finish Line#01	GUILD_FLAG,{
	end;
}
pvp_y_1-5,174,238,4	script	Finish Line#02	GUILD_FLAG,{
	end;
}