kvm01.txt 11 KB

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