kvm03.txt 11 KB

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