morroc_raceway.txt 5.3 KB

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