morroc_raceway.txt 5.5 KB

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