kvm03.txt 11 KB

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