kvm02.txt 11 KB

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