[1] | 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 |
---|
| 23 | morocc,166,105,6 script Race Girl#01 116,{ |
---|
| 24 | mes "[Race Girl]"; |
---|
| 25 | mes "Would you like to visit ^0000FFMorroc Raceway^000000?"; |
---|
| 26 | next; |
---|
| 27 | menu "Yes",L_Warp,"No",-; |
---|
| 28 | mes "[Race Girl]"; |
---|
| 29 | mes "Alright, talk to me again when you want to go."; |
---|
| 30 | close; |
---|
| 31 | |
---|
| 32 | L_Warp: |
---|
| 33 | warp "pvp_y_1-5",165,256; |
---|
| 34 | close; |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | //Warps you out of raceway |
---|
| 38 | pvp_y_1-5,169,265,5 script Race Girl#02 116,{ |
---|
| 39 | mes "[Race Girl]"; |
---|
| 40 | mes "Welcome to Morroc Raceway!"; |
---|
| 41 | next; |
---|
| 42 | menu "Information",-,"Leave",L_Warp,"Cancel",L_Cancel; |
---|
| 43 | mes "[Race Girl]"; |
---|
| 44 | mes "Someone must click on the Starter NPC to start the race."; |
---|
| 45 | next; |
---|
| 46 | mes "[Race Girl]"; |
---|
| 47 | mes "Once the race is started, run around Morroc anti-clockwise."; |
---|
| 48 | next; |
---|
| 49 | mes "[Race Girl]"; |
---|
| 50 | mes "You must reach all the checkpoints - No cheating!"; |
---|
| 51 | close; |
---|
| 52 | |
---|
| 53 | L_Warp: |
---|
| 54 | warp "morocc",165,101; |
---|
| 55 | |
---|
| 56 | L_Cancel: |
---|
| 57 | mes "[Race Girl]"; |
---|
| 58 | mes "Come again soon!"; |
---|
| 59 | close; |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | //Counts down and starts race |
---|
| 63 | pvp_y_1-5,145,269,5 script Starter 733,{ |
---|
| 64 | if ($@race != 0) goto L_Started; |
---|
| 65 | if ($@counting != 0) goto L_Started; |
---|
| 66 | if ($@racecount == 1) goto L_Started; |
---|
| 67 | L_Menu: |
---|
| 68 | mes "[Race Starter]"; |
---|
| 69 | mes "Please stay on the Eastern side of me."; |
---|
| 70 | menu "Start Race",L_Count,"Cancel",-; |
---|
| 71 | close; |
---|
| 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 | |
---|
| 108 | L_Started: |
---|
| 109 | if ((getmapusers("pvp_y_1-5") < 3) && ($@position > 0)) goto L_Menu; |
---|
| 110 | if ($@position > 2) goto L_Menu; |
---|
| 111 | mes "[Starter]"; |
---|
| 112 | mes "Race in progress"; |
---|
| 113 | close; |
---|
| 114 | |
---|
| 115 | OnInit: |
---|
| 116 | set $@race,0; |
---|
| 117 | set $@position,0; |
---|
| 118 | set $@racecount,0; |
---|
| 119 | end; |
---|
| 120 | } |
---|
| 121 | |
---|
| 122 | //Checkpoint 1 |
---|
| 123 | pvp_y_1-5,144,262,5 script Check Point 1 111,0,5,{ |
---|
| 124 | end; |
---|
| 125 | OnTouch: |
---|
| 126 | if (@raceid != $@raceid) goto L_Started; |
---|
| 127 | if (@race == 6) goto L_Finished; |
---|
| 128 | if ($@race == 1) goto L_Started; |
---|
| 129 | mes "The race has not started, please move back."; |
---|
| 130 | close; |
---|
| 131 | L_Started: |
---|
| 132 | set @race,1; |
---|
| 133 | set @raceid,$@raceid; |
---|
| 134 | end; |
---|
| 135 | L_Finished: |
---|
| 136 | mes "You have already completed the race."; |
---|
| 137 | close; |
---|
| 138 | } |
---|
| 139 | |
---|
| 140 | //Checkpoint 2 |
---|
| 141 | pvp_y_1-5,73,247,5 script Check Point 2 111,6,6,{ |
---|
| 142 | end; |
---|
| 143 | OnTouch: |
---|
| 144 | if (@race != 1) goto L_Miss; |
---|
| 145 | set @race,2; |
---|
| 146 | announce "[" + strcharinfo(0) +"] has reached Checkpoint [1]",1; |
---|
| 147 | end; |
---|
| 148 | L_Miss: |
---|
| 149 | mes "You have missed a Checkpoint. Please go back."; |
---|
| 150 | close; |
---|
| 151 | } |
---|
| 152 | |
---|
| 153 | //Checkpoint 3 |
---|
| 154 | pvp_y_1-5,77,44,5 script Check Point 3 111,6,6,{ |
---|
| 155 | end; |
---|
| 156 | OnTouch: |
---|
| 157 | if (@race != 2) goto L_Miss; |
---|
| 158 | set @race,3; |
---|
| 159 | announce "[" + strcharinfo(0) +"] has reached Checkpoint [2]",1; |
---|
| 160 | end; |
---|
| 161 | L_Miss: |
---|
| 162 | mes "You have missed a Checkpoint. Please go back."; |
---|
| 163 | close; |
---|
| 164 | } |
---|
| 165 | |
---|
| 166 | //Checkpoint 3 |
---|
| 167 | pvp_y_1-5,249,60,5 script Check Point 4 111,6,6,{ |
---|
| 168 | end; |
---|
| 169 | OnTouch: |
---|
| 170 | if (@race != 3) goto L_Miss; |
---|
| 171 | set @race,4; |
---|
| 172 | announce "[" + strcharinfo(0) +"] has reached Checkpoint [3]",1; |
---|
| 173 | end; |
---|
| 174 | L_Miss: |
---|
| 175 | mes "You have missed a Checkpoint. Please go back."; |
---|
| 176 | close; |
---|
| 177 | } |
---|
| 178 | |
---|
| 179 | //Checkpoint 4 |
---|
| 180 | pvp_y_1-5,255,256,5 script Check Point 5 111,6,6,{ |
---|
| 181 | end; |
---|
| 182 | OnTouch: |
---|
| 183 | if (@race != 4) goto L_Miss; |
---|
| 184 | set @race,5; |
---|
| 185 | announce "[" + strcharinfo(0) +"] has reached Checkpoint [4]",1; |
---|
| 186 | end; |
---|
| 187 | L_Miss: |
---|
| 188 | mes "You have missed a Checkpoint. Please go back."; |
---|
| 189 | close; |
---|
| 190 | } |
---|
| 191 | |
---|
| 192 | //Finish Line |
---|
| 193 | pvp_y_1-5,174,244,5 script Finish Line 111,6,6,{ |
---|
| 194 | end; |
---|
| 195 | OnTouch: |
---|
| 196 | if (@raceid != $@raceid) goto L_WrongRace; |
---|
| 197 | if (@race != 5) goto L_Miss; |
---|
| 198 | set @race,6; |
---|
| 199 | set $@position,$@position+1; |
---|
| 200 | announce "[" + strcharinfo(0) +"] has reached The Finish line! [Position: " + $@position + "]",1; |
---|
| 201 | end; |
---|
| 202 | L_Miss: |
---|
| 203 | mes "You have missed a Checkpoint. Please go back."; |
---|
| 204 | close; |
---|
| 205 | L_WrongRace: |
---|
| 206 | mes "You are not in this race."; |
---|
| 207 | close; |
---|
| 208 | } |
---|
| 209 | |
---|
| 210 | //Check Point Marker Flags |
---|
| 211 | pvp_y_1-5,144,267,4 script Check Point 1#01 722,{ |
---|
| 212 | end; |
---|
| 213 | } |
---|
| 214 | pvp_y_1-5,144,257,4 script Check Point 1#02 722,{ |
---|
| 215 | end; |
---|
| 216 | } |
---|
| 217 | pvp_y_1-5,70,252,3 script Check Point 2#01 722,{ |
---|
| 218 | end; |
---|
| 219 | } |
---|
| 220 | pvp_y_1-5,77,243,3 script Check Point 2#02 722,{ |
---|
| 221 | end; |
---|
| 222 | } |
---|
| 223 | pvp_y_1-5,81,48,1 script Check Point 3#01 722,{ |
---|
| 224 | end; |
---|
| 225 | } |
---|
| 226 | pvp_y_1-5,72,40,1 script Check Point 3#02 722,{ |
---|
| 227 | end; |
---|
| 228 | } |
---|
| 229 | pvp_y_1-5,244,65,7 script Check Point 4#01 722,{ |
---|
| 230 | end; |
---|
| 231 | } |
---|
| 232 | pvp_y_1-5,252,57,7 script Check Point 4#02 722,{ |
---|
| 233 | end; |
---|
| 234 | } |
---|
| 235 | pvp_y_1-5,259,260,5 script Check Point 5#01 722,{ |
---|
| 236 | end; |
---|
| 237 | } |
---|
| 238 | pvp_y_1-5,251,252,5 script Check Point 5#02 722,{ |
---|
| 239 | end; |
---|
| 240 | } |
---|
| 241 | pvp_y_1-5,174,249,4 script Finish Line#01 722,{ |
---|
| 242 | end; |
---|
| 243 | } |
---|
| 244 | pvp_y_1-5,174,238,4 script Finish Line#02 722,{ |
---|
| 245 | end; |
---|
| 246 | } |
---|