kvm02.txt 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. //===== rAthena Script =======================================
  2. //= BattleGround System - KvM 1-59
  3. //===== Description: =========================================
  4. //= [Official Conversion]
  5. //= Kreiger Von Midgard Battleground for levels 1 to 59
  6. //= - Winning Team: 1 point
  7. //= - Losing Team: 0 point
  8. //===== Changelogs: ==========================================
  9. //= 1.0 First Version. [L0ne_W0lf]
  10. //= 1.1 Updated using official Aegis files. [L0ne_W0lf]
  11. //= 1.2 Upated some announces and dialogs from iRO.
  12. //= Changed how the scoreboard works slightly.
  13. //= Removed the areapercentheals, and minor things.
  14. //= 1.3 Fixed wrong names for disablenpc/enablenpc. [Ai4rei]
  15. //= Fixed points in text and actual points differing.
  16. //============================================================
  17. // Waiting Room NPCs
  18. //============================================================
  19. bat_room,197,226,5 script KVM Waiting Room#a2::KvM02R_Guillaume 418,{
  20. end;
  21. OnInit:
  22. waitingroom "Battle Station 5 Players",6,"KvM02_BG_Out::OnGuillaumeJoin",1;
  23. end;
  24. OnEnterBG:
  25. set $@KvM02BG_id1, waitingroom2bg("bat_c02",52,129,"KvM02_BG::OnGuillaumeQuit","KvM02_BG::OnGuillaumeDie");
  26. end;
  27. }
  28. bat_room,197,205,3 script KVM Waiting Room#b2::KvM02R_Croix 414,{
  29. end;
  30. OnInit:
  31. waitingroom "Battle Station 5 Players",6,"KvM02_BG_Out::OnCroixJoin",1;
  32. end;
  33. OnEnterBG:
  34. set $@KvM02BG_id2, waitingroom2bg("bat_c02",147,55,"KvM02_BG::OnCroixQuit","KvM02_BG::OnCroixDie");
  35. end;
  36. }
  37. bat_room,197,220,0 script #kvm601 WARPNPC,2,2,{
  38. OnTouch:
  39. warp "bat_room",154,150;
  40. end;
  41. }
  42. bat_room,197,21,0 duplicate(#kvm601) #kvm602 WARPNPC,2,2
  43. // Starting Line
  44. //============================================================
  45. - script KVM02::CellEffect2 -1,{
  46. end;
  47. OnKvM02One:
  48. specialeffect EF_CHANGECOLD;
  49. end;
  50. OnKvM02Two:
  51. specialeffect EF_CHANGEPOISON;
  52. end;
  53. }
  54. bat_c02,54,124,3 duplicate(CellEffect2) #RedcellA1-2 139
  55. bat_c02,55,124,3 duplicate(CellEffect2) #RedcellA2-2 139
  56. bat_c02,56,124,3 duplicate(CellEffect2) #RedcellA3-2 139
  57. bat_c02,57,124,3 duplicate(CellEffect2) #RedcellA4-2 139
  58. bat_c02,57,125,3 duplicate(CellEffect2) #RedcellA5-2 139
  59. bat_c02,57,126,3 duplicate(CellEffect2) #RedcellA6-2 139
  60. bat_c02,57,127,3 duplicate(CellEffect2) #RedcellA7-2 139
  61. bat_c02,145,59,3 duplicate(CellEffect2) #RedcellB1-2 139
  62. bat_c02,144,59,3 duplicate(CellEffect2) #RedcellB2-2 139
  63. bat_c02,143,59,3 duplicate(CellEffect2) #RedcellB3-2 139
  64. bat_c02,142,59,3 duplicate(CellEffect2) #RedcellB4-2 139
  65. bat_c02,142,56,3 duplicate(CellEffect2) #RedcellB5-2 139
  66. bat_c02,142,57,3 duplicate(CellEffect2) #RedcellB6-2 139
  67. bat_c02,142,58,3 duplicate(CellEffect2) #RedcellB7-2 139
  68. bat_c02,54,128,3 script #A_camp_start02 139,4,4,{
  69. end;
  70. OnInit:
  71. disablenpc "#A_camp_start02";
  72. end;
  73. OnEnable:
  74. enablenpc "#A_camp_start02";
  75. end;
  76. OnDisable:
  77. disablenpc "#A_camp_start03";
  78. end;
  79. OnTouch:
  80. set Bat_Team,1;
  81. setquest 6025;
  82. end;
  83. }
  84. bat_c02,146,56,3 script #B_camp_start02 139,4,4,{
  85. end;
  86. OnInit:
  87. disablenpc "#B_camp_start02";
  88. end;
  89. OnEnable:
  90. enablenpc "#B_camp_start02";
  91. end;
  92. OnDisable:
  93. disablenpc "#B_camp_start02";
  94. end;
  95. OnTouch:
  96. set Bat_Team,2;
  97. setquest 6025;
  98. end;
  99. }
  100. // Battleground Engine
  101. //============================================================
  102. - script KvM02_BG -1,{
  103. end;
  104. OnInit:
  105. setwall "bat_c02",54,122,6,7,0,"batc02wall_a";
  106. setwall "bat_c02",55,122,5,7,0,"batc02wall_b";
  107. setwall "bat_c02",140,56,6,7,0,"batc02wall_c";
  108. setwall "bat_c02",140,57,5,7,0,"batc02wall_d";
  109. disablenpc "KVM Officer#KVM02A";
  110. disablenpc "KVM Officer#KVM02B";
  111. end;
  112. OnGuillaumeQuit:
  113. //set BG_Delay_Tick, gettimetick(2) + 1200;
  114. OnGuillaumeDie:
  115. if( $@KvM02BG == 2 )
  116. {
  117. set .Guillaume_Count, .Guillaume_Count - 1;
  118. bg_updatescore "bat_c02",.Guillaume_Count,.Croix_Count;
  119. if( .Guillaume_Count < 1 ) donpcevent "KvM02_BG::OnCroixWin";
  120. else {
  121. mapannounce "bat_c02", "The number of Guillaumes is "+.Guillaume_Count+".",bc_map,"0x00ff00";
  122. mapannounce "bat_c02", "The number of Croixes is "+.Croix_Count+".",bc_map,"0x00ff00";
  123. }
  124. }
  125. end;
  126. OnCroixQuit:
  127. //set BG_Delay_Tick, gettimetick(2) + 1200;
  128. OnCroixDie:
  129. if( $@KvM02BG == 2 )
  130. {
  131. set .Croix_Count, .Croix_Count - 1;
  132. bg_updatescore "bat_c02",.Guillaume_Count,.Croix_Count;
  133. if( .Croix_Count < 1 ) donpcevent "KvM02_BG::OnGuillaumeWin";
  134. else {
  135. mapannounce "bat_c02", "The number of Guillaumes is "+.Guillaume_Count+".",bc_map,"0x00ff00";
  136. mapannounce "bat_c02", "The number of Croixes is "+.Croix_Count+".",bc_map,"0x00ff00";
  137. }
  138. }
  139. end;
  140. OnStart:
  141. disablenpc "KVM Officer#KVM02A";
  142. disablenpc "KVM Officer#KVM02B";
  143. set $@KvM02BG_Victory, 0;
  144. // Warp Teams
  145. bg_warp $@KvM02BG_id1,"bat_c02",53,128;
  146. bg_warp $@KvM02BG_id2,"bat_c02",146,55;
  147. initnpctimer;
  148. end;
  149. OnTimer1000:
  150. mapannounce "bat_c02", "In 1 minute, KVM will start.",bc_map,"0x00ff00";
  151. end;
  152. OnTimer3000:
  153. mapannounce "bat_c02", "The maximum time for a KVM battle is 5 minutes.",bc_map,"0x00ff00";
  154. end;
  155. OnTimer6000:
  156. mapannounce "bat_c02", "Please prepare for the KVM battle.",bc_map,"0x00ff00";
  157. mapannounce "bat_c02", "You can buff your people.",bc_map,"0x00ff00";
  158. donpcevent "#A_camp_start02::OnEnable";
  159. donpcevent "#B_camp_start02::OnEnable";
  160. end;
  161. OnTimer13000:
  162. donpcevent "#A_camp_start02::OnDisable";
  163. donpcevent "#B_camp_start02::OnDisable";
  164. end;
  165. OnTimer30000:
  166. mapannounce "bat_c02", "30 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
  167. end;
  168. OnTimer45000:
  169. mapannounce "bat_c02", "15 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
  170. donpcevent "::OnKvM02One";
  171. end;
  172. OnTimer50000:
  173. mapannounce "bat_c02", "10 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
  174. donpcevent "::OnKvM02Two";
  175. end;
  176. OnTimer55000:
  177. mapannounce "bat_c02", "5 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
  178. donpcevent "::OnKvM02One";
  179. end;
  180. OnTimer59000:
  181. mapannounce "bat_c02", "KVM is now commencing.",bc_map,"0x00ff00";
  182. donpcevent "::OnKvM02Two";
  183. end;
  184. OnTimer61000:
  185. // Team Members
  186. set .Guillaume_Count, bg_get_data($@KvM02BG_id1, 0);
  187. set .Croix_Count, bg_get_data($@KvM02BG_id2, 0);
  188. if( .Guillaume_Count < 5 || .Croix_Count < 5 )
  189. {
  190. set $@KvM02BG_Victory, 3;
  191. set $@KvM02BG, 3;
  192. mapannounce "bat_c02","There are not enough players to start the battle",1,0x808080;
  193. stopnpctimer;
  194. donpcevent "KvM02_BG::OnStop";
  195. end;
  196. }
  197. set $@KvM02BG, 2; // Playing
  198. bg_warp $@KvM02BG_id1,"bat_c02",62,119;
  199. bg_warp $@KvM02BG_id2,"bat_c02",137,64;
  200. end;
  201. OnTimer300000:
  202. mapannounce "bat_c02", "1 minute remaining to finish the KVM battle.",bc_map,"0x00ff00";
  203. end;
  204. OnTimer330000:
  205. mapannounce "bat_c02", "30 seconds remaining to finish the KVM battle.",bc_map,"0x00ff00";
  206. end;
  207. OnTimer345000:
  208. mapannounce "bat_c02", "15 seconds remaining to finish the KVM battle.",bc_map,"0x00ff00";
  209. end;
  210. OnTimer350000:
  211. mapannounce "bat_c02", "10 seconds remaining to finish the KVM battle.",bc_map,"0x00ff00";
  212. end;
  213. OnTimer355000:
  214. mapannounce "bat_c02", "5 seconds remaining to finish the KVM battle.",bc_map,"0x00ff00";
  215. end;
  216. OnTimer360000:
  217. mapannounce "bat_c02", "The KVM battle is over.",bc_map,"0x00ff00";
  218. if( .Croix_Count > .Guillaume_Count )
  219. donpcevent "KvM02_BG::OnCroixWin";
  220. else if( .Croix_Count < .Guillaume_Count )
  221. donpcevent "KvM02_BG::OnGuillaumeWin";
  222. else
  223. { // Draw Game
  224. set $@KvM02BG, 3;
  225. set $@KvM02BG_Victory, 3;
  226. mapannounce "bat_c02", "The number of Guillaumes is "+.Guillaume_Count+".",bc_map,"0x00ff00";
  227. mapannounce "bat_c02", "The number of Croixes is "+.Croix_Count+".",bc_map,"0x00ff00";
  228. mapannounce "bat_c02", "This battle has ended in a draw.",bc_map,"0x00ff00";
  229. donpcevent "KvM02_BG::OnStop";
  230. }
  231. end;
  232. OnGuillaumeWin:
  233. set $@KvM02BG, 3;
  234. set $@KvM02BG_Victory, 1;
  235. mapannounce "bat_c02", "Guillaume wins!",bc_map,"0x00ff00";
  236. mapannounce "bat_c02", "Congratulations to Guillaume members.",bc_map,"0x00ff00";
  237. mapannounce "bat_c02", "Everyone will be moved to the start point.",bc_map,"0x00ff00";
  238. donpcevent "KvM02_BG::OnStop";
  239. end;
  240. OnCroixWin:
  241. set $@KvM02BG, 3;
  242. set $@KvM02BG_Victory, 2;
  243. mapannounce "bat_c02", "Croix wins!",bc_map,"0x00ff00";
  244. mapannounce "bat_c02", "Congratulations to Croix members.",bc_map,"0x00ff00";
  245. mapannounce "bat_c02", "Everyone will be moved to the start point.",bc_map,"0x00ff00";
  246. donpcevent "KvM02_BG::OnStop";
  247. end;
  248. OnStop:
  249. stopnpctimer;
  250. enablenpc "KVM Officer#KVM02A";
  251. enablenpc "KVM Officer#KVM02B";
  252. // Warp Teams
  253. bg_warp $@KvM02BG_id1,"bat_c02",53,128;
  254. bg_warp $@KvM02BG_id2,"bat_c02",146,55;
  255. donpcevent "KvM02_BG_Out::OnBegin";
  256. end;
  257. }
  258. - script KvM02_BG_Out -1,{
  259. end;
  260. OnBegin:
  261. initnpctimer;
  262. end;
  263. OnTimer1000:
  264. mapannounce "bat_c02", "Please apply with the Officer to acquire KVM points.",bc_map,"0x00ff00";
  265. end;
  266. OnTimer3000:
  267. mapannounce "bat_c02", "The Officer will grant you the points for 30 seconds.",bc_map,"0x00ff00";
  268. mapannounce "bat_c02", "In 30 seconds, the Officer will be sent away.",bc_map,"0x00ff00";
  269. end;
  270. OnTimer5000:
  271. mapannounce "bat_c02", "Unless you talk to the Officer, you cannot gain the points.",bc_map,"0x00ff00";
  272. mapannounce "bat_c02", "Please be careful.",bc_map,"0x00ff00";
  273. end;
  274. OnTimer55000:
  275. mapannounce "bat_c02", "You will be sent back.",bc_map,"0x00ff00";
  276. end;
  277. OnTimer60000:
  278. stopnpctimer;
  279. set getvariableofnpc(.Croix_Count,"KvM02_BG"), 0;
  280. set getvariableofnpc(.Guillaume_Count,"KvM02_BG"), 0;
  281. set $@KvM02BG_Victory, 0;
  282. if( $@KvM02BG_id1 ) { bg_destroy $@KvM02BG_id1; set $@KvM02BG_id1, 0; }
  283. if( $@KvM02BG_id2 ) { bg_destroy $@KvM02BG_id2; set $@KvM02BG_id2, 0; }
  284. disablenpc "KVM Officer#KVM02A";
  285. disablenpc "KVM Officer#KVM02B";
  286. mapwarp "bat_c02","bat_room",154,150;
  287. maprespawnguildid "bat_c02",0,3; // Just in case someone else
  288. bg_updatescore "bat_c02",5,5;
  289. set $@KvM02BG, 0;
  290. OnGuillaumeJoin:
  291. OnCroixJoin:
  292. if( $@KvM02BG )
  293. end;
  294. set .@Guillaume, getwaitingroomstate(0,"KvM02R_Guillaume");
  295. set .@Croix, getwaitingroomstate(0,"KvM02R_Croix");
  296. if( .@Guillaume < 5 || .@Croix < 5 )
  297. end;
  298. set $@KvM02BG, 1; // Starting
  299. donpcevent "KvM02R_Croix::OnEnterBG";
  300. donpcevent "KvM02R_Guillaume::OnEnterBG";
  301. donpcevent "KvM02_BG::OnStart";
  302. end;
  303. }
  304. // Battleground rewards
  305. //============================================================
  306. bat_c02,51,130,5 script KVM Officer#KVM02A 419,{
  307. if( $@KvM02BG_Victory ) {
  308. mes "[KVM Officer]";
  309. if( $@KvM02BG_Victory == Bat_Team ) {
  310. mes "Good Game.";
  311. mes "May the glory of KVM be with you.";
  312. mes "You aquire the winning points: 1";
  313. close2;
  314. set kvm_point,kvm_point + 1;
  315. }
  316. else {
  317. mes "I am so sorry.";
  318. mes "I wish you better luck next time.";
  319. mes "You aquire the losing points: 0";
  320. close2;
  321. }
  322. bg_leave;
  323. set Bat_Team,0;
  324. warp "bat_room",154,150;
  325. end;
  326. }
  327. }
  328. bat_c02,148,53,1 duplicate(KVM Officer#KVM02A) KVM Officer#KVM02B 415