kvm03.txt 11 KB

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