kvm02.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  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. if (getbattleflag("feature.bgqueue"))
  105. bg_unbook "bat_c02";
  106. mapwarp "bat_c02","bat_room",154,150;
  107. setwall "bat_c02",54,122,6,7,0,"batc02wall_a";
  108. setwall "bat_c02",55,122,5,7,0,"batc02wall_b";
  109. setwall "bat_c02",140,56,6,7,0,"batc02wall_c";
  110. setwall "bat_c02",140,57,5,7,0,"batc02wall_d";
  111. disablenpc "KVM Officer#KVM02A";
  112. disablenpc "KVM Officer#KVM02B";
  113. end;
  114. OnGuillaumeQuit:
  115. if (getbattleflag("feature.bgqueue"))
  116. bg_desert;
  117. // else
  118. // set BG_Delay_Tick, gettimetick(2) + 1200;
  119. OnGuillaumeDie:
  120. if( $@KvM02BG == 2 )
  121. {
  122. set .Guillaume_Count, .Guillaume_Count - 1;
  123. bg_updatescore "bat_c02",.Guillaume_Count,.Croix_Count;
  124. if( .Guillaume_Count < 1 ) donpcevent "KvM02_BG::OnCroixWin";
  125. else {
  126. mapannounce "bat_c02", "The number of Guillaumes is "+.Guillaume_Count+".",bc_map,"0x00ff00";
  127. mapannounce "bat_c02", "The number of Croixes is "+.Croix_Count+".",bc_map,"0x00ff00";
  128. }
  129. }
  130. end;
  131. OnCroixQuit:
  132. if (getbattleflag("feature.bgqueue"))
  133. bg_desert;
  134. // else
  135. // set BG_Delay_Tick, gettimetick(2) + 1200;
  136. OnCroixDie:
  137. if( $@KvM02BG == 2 )
  138. {
  139. set .Croix_Count, .Croix_Count - 1;
  140. bg_updatescore "bat_c02",.Guillaume_Count,.Croix_Count;
  141. if( .Croix_Count < 1 ) donpcevent "KvM02_BG::OnGuillaumeWin";
  142. else {
  143. mapannounce "bat_c02", "The number of Guillaumes is "+.Guillaume_Count+".",bc_map,"0x00ff00";
  144. mapannounce "bat_c02", "The number of Croixes is "+.Croix_Count+".",bc_map,"0x00ff00";
  145. }
  146. }
  147. end;
  148. OnGuillaumeActive:
  149. warp "bat_c02",62,119;
  150. end;
  151. OnCroixActive:
  152. warp "bat_c02",137,64;
  153. end;
  154. OnStart:
  155. disablenpc "KVM Officer#KVM02A";
  156. disablenpc "KVM Officer#KVM02B";
  157. set $@KvM02BG_Victory, 0;
  158. // Warp Teams
  159. bg_warp $@KvM02BG_id1,"bat_c02",53,128;
  160. bg_warp $@KvM02BG_id2,"bat_c02",146,55;
  161. initnpctimer;
  162. end;
  163. OnTimer1000:
  164. mapannounce "bat_c02", "In 1 minute, KVM will start.",bc_map,"0x00ff00";
  165. end;
  166. OnTimer3000:
  167. mapannounce "bat_c02", "The maximum time for a KVM battle is 5 minutes.",bc_map,"0x00ff00";
  168. end;
  169. OnTimer6000:
  170. mapannounce "bat_c02", "Please prepare for the KVM battle.",bc_map,"0x00ff00";
  171. mapannounce "bat_c02", "You can buff your people.",bc_map,"0x00ff00";
  172. donpcevent "#A_camp_start02::OnEnable";
  173. donpcevent "#B_camp_start02::OnEnable";
  174. end;
  175. OnTimer13000:
  176. donpcevent "#A_camp_start02::OnDisable";
  177. donpcevent "#B_camp_start02::OnDisable";
  178. end;
  179. OnTimer30000:
  180. mapannounce "bat_c02", "30 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
  181. end;
  182. OnTimer45000:
  183. mapannounce "bat_c02", "15 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
  184. donpcevent "::OnKvM02One";
  185. end;
  186. OnTimer50000:
  187. mapannounce "bat_c02", "10 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
  188. donpcevent "::OnKvM02Two";
  189. end;
  190. OnTimer55000:
  191. mapannounce "bat_c02", "5 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
  192. donpcevent "::OnKvM02One";
  193. end;
  194. OnTimer59000:
  195. mapannounce "bat_c02", "KVM is now commencing.",bc_map,"0x00ff00";
  196. donpcevent "::OnKvM02Two";
  197. end;
  198. OnTimer61000:
  199. // Team Members
  200. set .Guillaume_Count, bg_get_data($@KvM02BG_id1, 0);
  201. set .Croix_Count, bg_get_data($@KvM02BG_id2, 0);
  202. if (!getbattleflag("feature.bgqueue")) {
  203. if (.Guillaume_Count < 5 || .Croix_Count < 5) {
  204. set $@KvM02BG_Victory, 3;
  205. set $@KvM02BG, 3;
  206. mapannounce "bat_c02","There are not enough players to start the battle",1,0x808080;
  207. stopnpctimer;
  208. donpcevent "KvM02_BG::OnStop";
  209. end;
  210. }
  211. }
  212. bg_updatescore "bat_c02",.Guillaume_Count,.Croix_Count;
  213. set $@KvM02BG, 2; // Playing
  214. bg_warp $@KvM02BG_id1,"bat_c02",62,119;
  215. bg_warp $@KvM02BG_id2,"bat_c02",137,64;
  216. end;
  217. OnTimer300000:
  218. mapannounce "bat_c02", "1 minute remaining to finish the KVM battle.",bc_map,"0x00ff00";
  219. end;
  220. OnTimer330000:
  221. mapannounce "bat_c02", "30 seconds remaining to finish the KVM battle.",bc_map,"0x00ff00";
  222. end;
  223. OnTimer345000:
  224. mapannounce "bat_c02", "15 seconds remaining to finish the KVM battle.",bc_map,"0x00ff00";
  225. end;
  226. OnTimer350000:
  227. mapannounce "bat_c02", "10 seconds remaining to finish the KVM battle.",bc_map,"0x00ff00";
  228. end;
  229. OnTimer355000:
  230. mapannounce "bat_c02", "5 seconds remaining to finish the KVM battle.",bc_map,"0x00ff00";
  231. end;
  232. OnTimer360000:
  233. mapannounce "bat_c02", "The KVM battle is over.",bc_map,"0x00ff00";
  234. if( .Croix_Count > .Guillaume_Count )
  235. donpcevent "KvM02_BG::OnCroixWin";
  236. else if( .Croix_Count < .Guillaume_Count )
  237. donpcevent "KvM02_BG::OnGuillaumeWin";
  238. else
  239. { // Draw Game
  240. set $@KvM02BG, 3;
  241. set $@KvM02BG_Victory, 3;
  242. mapannounce "bat_c02", "The number of Guillaumes is "+.Guillaume_Count+".",bc_map,"0x00ff00";
  243. mapannounce "bat_c02", "The number of Croixes is "+.Croix_Count+".",bc_map,"0x00ff00";
  244. mapannounce "bat_c02", "This battle has ended in a draw.",bc_map,"0x00ff00";
  245. donpcevent "KvM02_BG::OnStop";
  246. }
  247. end;
  248. OnGuillaumeWin:
  249. set $@KvM02BG, 3;
  250. set $@KvM02BG_Victory, 1;
  251. mapannounce "bat_c02", "Guillaume wins!",bc_map,"0x00ff00";
  252. mapannounce "bat_c02", "Congratulations to Guillaume members.",bc_map,"0x00ff00";
  253. mapannounce "bat_c02", "Everyone will be moved to the start point.",bc_map,"0x00ff00";
  254. donpcevent "KvM02_BG::OnStop";
  255. end;
  256. OnCroixWin:
  257. set $@KvM02BG, 3;
  258. set $@KvM02BG_Victory, 2;
  259. mapannounce "bat_c02", "Croix wins!",bc_map,"0x00ff00";
  260. mapannounce "bat_c02", "Congratulations to Croix members.",bc_map,"0x00ff00";
  261. mapannounce "bat_c02", "Everyone will be moved to the start point.",bc_map,"0x00ff00";
  262. donpcevent "KvM02_BG::OnStop";
  263. end;
  264. OnStop:
  265. stopnpctimer;
  266. enablenpc "KVM Officer#KVM02A";
  267. enablenpc "KVM Officer#KVM02B";
  268. // Warp Teams
  269. bg_warp $@KvM02BG_id1,"bat_c02",53,128;
  270. bg_warp $@KvM02BG_id2,"bat_c02",146,55;
  271. donpcevent "KvM02_BG_Out::OnBegin";
  272. if (getbattleflag("feature.bgqueue"))
  273. bg_reserve "bat_c02", true;
  274. end;
  275. }
  276. - script KvM02_BG_Out -1,{
  277. end;
  278. OnBegin:
  279. initnpctimer;
  280. end;
  281. OnTimer1000:
  282. mapannounce "bat_c02", "Please apply with the Officer to acquire KVM points.",bc_map,"0x00ff00";
  283. end;
  284. OnTimer3000:
  285. mapannounce "bat_c02", "The Officer will grant you the points for 30 seconds.",bc_map,"0x00ff00";
  286. mapannounce "bat_c02", "In 30 seconds, the Officer will be sent away.",bc_map,"0x00ff00";
  287. end;
  288. OnTimer5000:
  289. mapannounce "bat_c02", "Unless you talk to the Officer, you cannot gain the points.",bc_map,"0x00ff00";
  290. mapannounce "bat_c02", "Please be careful.",bc_map,"0x00ff00";
  291. end;
  292. OnTimer55000:
  293. mapannounce "bat_c02", "You will be sent back.",bc_map,"0x00ff00";
  294. end;
  295. OnTimer60000:
  296. stopnpctimer;
  297. if (getbattleflag("feature.bgqueue"))
  298. bg_reserve "bat_c02", true;
  299. mapwarp "bat_c02","bat_room",154,150;
  300. set getvariableofnpc(.Croix_Count,"KvM02_BG"), 0;
  301. set getvariableofnpc(.Guillaume_Count,"KvM02_BG"), 0;
  302. set $@KvM02BG_Victory, 0;
  303. if( $@KvM02BG_id1 ) { bg_destroy $@KvM02BG_id1; set $@KvM02BG_id1, 0; }
  304. if( $@KvM02BG_id2 ) { bg_destroy $@KvM02BG_id2; set $@KvM02BG_id2, 0; }
  305. if (getbattleflag("feature.bgqueue"))
  306. bg_unbook "bat_c02";
  307. disablenpc "KVM Officer#KVM02A";
  308. disablenpc "KVM Officer#KVM02B";
  309. set $@KvM02BG, 0;
  310. end;
  311. OnGuillaumeJoin:
  312. OnCroixJoin:
  313. if( $@KvM02BG )
  314. end;
  315. set .@Guillaume, getwaitingroomstate(0,"KvM02R_Guillaume");
  316. set .@Croix, getwaitingroomstate(0,"KvM02R_Croix");
  317. if( .@Guillaume < 5 || .@Croix < 5 )
  318. end;
  319. set $@KvM02BG, 1; // Starting
  320. donpcevent "KvM02R_Croix::OnEnterBG";
  321. donpcevent "KvM02R_Guillaume::OnEnterBG";
  322. donpcevent "KvM02_BG::OnStart";
  323. end;
  324. }
  325. // Battleground rewards
  326. //============================================================
  327. bat_c02,51,130,5 script KVM Officer#KVM02A 419,{
  328. if( $@KvM02BG_Victory ) {
  329. mes "[KVM Officer]";
  330. if( $@KvM02BG_Victory == Bat_Team ) {
  331. mes "Good Game.";
  332. mes "May the glory of KVM be with you.";
  333. mes "You aquire the winning points: 1";
  334. close2;
  335. set kvm_point,kvm_point + 1;
  336. }
  337. else {
  338. mes "I am so sorry.";
  339. mes "I wish you better luck next time.";
  340. mes "You aquire the losing points: 0";
  341. close2;
  342. }
  343. bg_leave;
  344. set Bat_Team,0;
  345. if (!getbattleflag("feature.bgqueue"))
  346. warp "bat_room",154,150;
  347. }
  348. end;
  349. }
  350. bat_c02,148,53,1 duplicate(KVM Officer#KVM02A) KVM Officer#KVM02B 415
  351. // BG Queue makes these scripts useless
  352. - script BGQueueInit#kvm02 -1,{
  353. end;
  354. OnInit:
  355. if (getbattleflag("feature.bgqueue")) {
  356. unloadnpc "KvM02R_Guillaume";
  357. unloadnpc "KvM02R_Croix";
  358. unloadnpc "#kvm601";
  359. unloadnpc "#kvm602";
  360. }
  361. end;
  362. }