kvm01.txt 11 KB

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