root/npc/custom/morroc_raceway.txt @ 1

Revision 1, 5.5 kB (checked in by jinshiro, 17 years ago)
Line 
1//===== eAthena Script =======================================
2//= Morroc Raceway Script
3//===== By: ==================================================
4//= acky (god@acky.com)
5//===== Current Version: =====================================
6//= 1.2
7//===== Compatible With: =====================================
8//= Any eAthena Version
9//===== Description: =========================================
10//= Lets players race around Morroc (pvp_y_1-5)
11//===== Additional Comments: =================================
12//= If there are more than 3 players, at least 3 people
13//= must finish before a new race can be started.
14//=
15//= If there are less than 3 players, at least 1 person
16//= must finish before a new race can be started.
17//=
18//= Removed permanent global variables
19//= 1.2 Removed Duplicates [Silent]
20//============================================================
21
22//Warps you into race way
23morocc,166,105,6        script  Race Girl#01    116,{
24mes "[Race Girl]";
25mes "Would you like to visit ^0000FFMorroc Raceway^000000?";
26next;
27menu "Yes",L_Warp,"No",-;
28mes "[Race Girl]";
29mes "Alright, talk to me again when you want to go.";
30close;
31
32L_Warp:
33warp "pvp_y_1-5",165,256;
34close;
35}
36
37//Warps you out of raceway
38pvp_y_1-5,169,265,5     script  Race Girl#02    116,{
39mes "[Race Girl]";
40mes "Welcome to Morroc Raceway!";
41next;
42menu "Information",-,"Leave",L_Warp,"Cancel",L_Cancel;
43mes "[Race Girl]";
44mes "Someone must click on the Starter NPC to start the race.";
45next;
46mes "[Race Girl]";
47mes "Once the race is started, run around Morroc anti-clockwise.";
48next;
49mes "[Race Girl]";
50mes "You must reach all the checkpoints - No cheating!";
51close;
52
53L_Warp:
54warp "morocc",165,101;
55
56L_Cancel:
57mes "[Race Girl]";
58mes "Come again soon!";
59close;
60}
61
62//Counts down and starts race
63pvp_y_1-5,145,269,5     script  Starter 733,{
64if ($@race != 0) goto L_Started;
65if ($@counting != 0) goto L_Started;
66if ($@racecount == 1) goto L_Started;
67L_Menu:
68mes "[Race Starter]";
69mes "Please stay on the Eastern side of me.";
70menu "Start Race",L_Count,"Cancel",-;
71close;
72
73        L_Count:
74                set $@counting,1;
75                mes "Counting down...";
76                addtimer 1000, "Starter::OnCount1000";
77                addtimer 2000, "Starter::OnCount2000";
78                addtimer 3000, "Starter::OnCount3000";
79                addtimer 4000, "Starter::OnCount4000";
80                announce strcharinfo(0) + "Started a countdown",1;
81                announce "Get ready to race!",1;
82                close;
83
84
85        OnCount1000:
86                announce "[3]",1;
87                end;
88
89        OnCount2000:
90                announce "[2]",1;
91                end;
92
93        OnCount3000:
94                announce "[1]",1;
95                end;
96
97        OnCount4000:
98                emotion 27;
99                specialeffect 267;
100                announce "[GO!]",1;
101                set $@race,1;
102                set $@position,0;
103                set $@counting,0;
104                set $@raceid,rand(100000,999999);
105                end;
106
107
108L_Started:
109if ((getmapusers("pvp_y_1-5") < 3) && ($@position > 0)) goto L_Menu;
110if ($@position > 2) goto L_Menu;
111mes "[Starter]";
112mes "Race in progress";
113close;
114
115OnInit:
116set $@race,0;
117set $@position,0;
118set $@racecount,0;
119end;
120}
121
122//Checkpoint 1
123pvp_y_1-5,144,262,5     script  Check Point 1   111,0,5,{
124end;
125OnTouch:
126if (@raceid != $@raceid) goto L_Started;
127if (@race == 6) goto L_Finished;
128if ($@race == 1) goto L_Started;
129mes "The race has not started, please move back.";
130close;
131L_Started:
132set @race,1;
133set @raceid,$@raceid;
134end;
135L_Finished:
136mes "You have already completed the race.";
137close;
138}
139
140//Checkpoint 2
141pvp_y_1-5,73,247,5      script  Check Point 2   111,6,6,{
142end;
143OnTouch:
144if (@race != 1) goto L_Miss;
145set @race,2;
146announce "[" + strcharinfo(0) +"] has reached Checkpoint [1]",1;
147end;
148L_Miss:
149mes "You have missed a Checkpoint. Please go back.";
150close;
151}
152
153//Checkpoint 3
154pvp_y_1-5,77,44,5       script  Check Point 3   111,6,6,{
155end;
156OnTouch:
157if (@race != 2) goto L_Miss;
158set @race,3;
159announce "[" + strcharinfo(0) +"] has reached Checkpoint [2]",1;
160end;
161L_Miss:
162mes "You have missed a Checkpoint. Please go back.";
163close;
164}
165
166//Checkpoint 3
167pvp_y_1-5,249,60,5      script  Check Point 4   111,6,6,{
168end;
169OnTouch:
170if (@race != 3) goto L_Miss;
171set @race,4;
172announce "[" + strcharinfo(0) +"] has reached Checkpoint [3]",1;
173end;
174L_Miss:
175mes "You have missed a Checkpoint. Please go back.";
176close;
177}
178
179//Checkpoint 4
180pvp_y_1-5,255,256,5     script  Check Point 5   111,6,6,{
181end;
182OnTouch:
183if (@race != 4) goto L_Miss;
184set @race,5;
185announce "[" + strcharinfo(0) +"] has reached Checkpoint [4]",1;
186end;
187L_Miss:
188mes "You have missed a Checkpoint. Please go back.";
189close;
190}
191
192//Finish Line
193pvp_y_1-5,174,244,5     script  Finish Line     111,6,6,{
194end;
195OnTouch:
196if (@raceid != $@raceid) goto L_WrongRace;
197if (@race != 5) goto L_Miss;
198set @race,6;
199set $@position,$@position+1;
200announce "[" + strcharinfo(0) +"] has reached The Finish line! [Position: " + $@position + "]",1;
201end;
202L_Miss:
203mes "You have missed a Checkpoint. Please go back.";
204close;
205L_WrongRace:
206mes "You are not in this race.";
207close;
208}
209
210//Check Point Marker Flags
211pvp_y_1-5,144,267,4     script  Check Point 1#01        722,{
212end;
213}
214pvp_y_1-5,144,257,4     script  Check Point 1#02        722,{
215end;
216}
217pvp_y_1-5,70,252,3      script  Check Point 2#01        722,{
218end;
219}
220pvp_y_1-5,77,243,3      script  Check Point 2#02        722,{
221end;
222}
223pvp_y_1-5,81,48,1       script  Check Point 3#01        722,{
224end;
225}
226pvp_y_1-5,72,40,1       script  Check Point 3#02        722,{
227end;
228}
229pvp_y_1-5,244,65,7      script  Check Point 4#01        722,{
230end;
231}
232pvp_y_1-5,252,57,7      script  Check Point 4#02        722,{
233end;
234}
235pvp_y_1-5,259,260,5     script  Check Point 5#01        722,{
236end;
237}
238pvp_y_1-5,251,252,5     script  Check Point 5#02        722,{
239end;
240}
241pvp_y_1-5,174,249,4     script  Finish Line#01  722,{
242end;
243}
244pvp_y_1-5,174,238,4     script  Finish Line#02  722,{
245end;
246}
Note: See TracBrowser for help on using the browser.