kvm01.txt 11 KB

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