kvm02.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. //===== rAthena Script =======================================
  2. // BattleGround System - KvM 1-59
  3. //===== By: ==================================================
  4. //= ???, L0ne_W0lf
  5. //===== Current Version: =====================================
  6. //= 1.3
  7. //===== Compatible With: =====================================
  8. //= rAthena 1.0
  9. //===== Description: =========================================
  10. //= [AEGIS Conversion]
  11. //= Kreiger Von Midgard Battleground for levels 1 to 59
  12. //= - Winning Team: 1 point
  13. //= - Losing Team: 0 points
  14. //===== Additional Comments: =================================
  15. //= 1.0 First Version.
  16. //= 1.1 Updated using official Aegis files. [L0ne_W0lf]
  17. //= 1.2 Upated some announces and dialogs from iRO.
  18. //= Changed how the scoreboard works slightly.
  19. //= Removed the areapercentheals, and minor things.
  20. //= 1.3 Fixed wrong names for disablenpc/enablenpc. [Ai4rei]
  21. //= Fixed points in text and actual points differing.
  22. //============================================================
  23. // Waiting Room NPCs
  24. //============================================================
  25. bat_room,197,226,5 script KVM Waiting Room#a2::KvM02R_Guillaume 418,{
  26. end;
  27. OnInit:
  28. waitingroom "Battle Station 5 Players",5,"KvM02_BG::OnGuillaumeJoin",1;
  29. end;
  30. OnEnterBG:
  31. set $@KvM02BG_id1, waitingroom2bg("bat_c02",52,129,"KvM02_BG::OnGuillaumeQuit","KvM02_BG::OnGuillaumeDie");
  32. end;
  33. }
  34. bat_room,197,220,0 warp #kvm601 2,2,bat_room,154,150
  35. bat_room,197,205,3 script KVM Waiting Room#b2::KvM02R_Croix 414,{
  36. end;
  37. OnInit:
  38. waitingroom "Battle Station 5 Players",5,"KvM02_BG::OnCroixJoin",1;
  39. end;
  40. OnEnterBG:
  41. set $@KvM02BG_id2, waitingroom2bg("bat_c02",147,55,"KvM02_BG::OnCroixQuit","KvM02_BG::OnCroixDie");
  42. end;
  43. }
  44. bat_room,197,211,0 warp #kvm602 2,2,bat_room,154,150
  45. // Starting Line
  46. //============================================================
  47. - script KVM02::CellEffect2 -1,{
  48. end;
  49. OnKvM02One:
  50. misceffect EF_CHANGECOLD;
  51. end;
  52. OnKvM02Two:
  53. misceffect EF_CHANGEPOISON;
  54. end;
  55. }
  56. bat_c02,54,124,3 duplicate(CellEffect2) #RedcellA1-2 139
  57. bat_c02,55,124,3 duplicate(CellEffect2) #RedcellA2-2 139
  58. bat_c02,56,124,3 duplicate(CellEffect2) #RedcellA3-2 139
  59. bat_c02,57,124,3 duplicate(CellEffect2) #RedcellA4-2 139
  60. bat_c02,57,125,3 duplicate(CellEffect2) #RedcellA5-2 139
  61. bat_c02,57,126,3 duplicate(CellEffect2) #RedcellA6-2 139
  62. bat_c02,57,127,3 duplicate(CellEffect2) #RedcellA7-2 139
  63. bat_c02,145,59,3 duplicate(CellEffect2) #RedcellB1-2 139
  64. bat_c02,144,59,3 duplicate(CellEffect2) #RedcellB2-2 139
  65. bat_c02,143,59,3 duplicate(CellEffect2) #RedcellB3-2 139
  66. bat_c02,142,59,3 duplicate(CellEffect2) #RedcellB4-2 139
  67. bat_c02,142,56,3 duplicate(CellEffect2) #RedcellB5-2 139
  68. bat_c02,142,57,3 duplicate(CellEffect2) #RedcellB6-2 139
  69. bat_c02,142,58,3 duplicate(CellEffect2) #RedcellB7-2 139
  70. bat_c02,54,128,3 script #A_camp_start02 139,4,4,{
  71. end;
  72. OnInit:
  73. disablenpc "#A_camp_start02";
  74. end;
  75. OnEnable:
  76. enablenpc "#A_camp_start02";
  77. end;
  78. OnDisable:
  79. disablenpc "#A_camp_start03";
  80. end;
  81. OnTouch:
  82. set Bat_Team,1;
  83. setquest 6025;
  84. end;
  85. }
  86. bat_c02,146,56,3 script #B_camp_start02 139,4,4,{
  87. end;
  88. OnInit:
  89. disablenpc "#B_camp_start02";
  90. end;
  91. OnEnable:
  92. enablenpc "#B_camp_start02";
  93. end;
  94. OnDisable:
  95. disablenpc "#B_camp_start02";
  96. end;
  97. OnTouch:
  98. set Bat_Team,2;
  99. setquest 6025;
  100. end;
  101. }
  102. // Battleground Engine
  103. //============================================================
  104. - script KvM02_BG -1,{
  105. end;
  106. OnInit:
  107. setwall "bat_c02",54,122,6,7,0,"batc02wall_a";
  108. setwall "bat_c02",55,122,5,7,0,"batc02wall_b";
  109. setwall "bat_c02",140,56,6,7,0,"batc02wall_c";
  110. setwall "bat_c02",140,57,5,7,0,"batc02wall_d";
  111. disablenpc "KVM Officer#KVM02A";
  112. disablenpc "KVM Officer#KVM02B";
  113. end;
  114. OnGuillaumeJoin:
  115. OnCroixJoin:
  116. donpcevent "KvM02_BG::OnReadyCheck";
  117. end;
  118. OnGuillaumeQuit:
  119. //set BG_Delay_Tick, gettimetick(2) + 1200;
  120. OnGuillaumeDie:
  121. if( $@KvM02BG == 2 )
  122. {
  123. set .Guillaume_Count, .Guillaume_Count - 1;
  124. bg_updatescore "bat_c02",.Guillaume_Count,.Croix_Count;
  125. if( .Guillaume_Count < 1 ) donpcevent "KvM02_BG::OnCroixWin";
  126. else {
  127. mapannounce "bat_c02", "The number of Guillaumes is "+.Guillaume_Count+".",bc_map,"0x00ff00";
  128. mapannounce "bat_c02", "The number of Croixes is "+.Croix_Count+".",bc_map,"0x00ff00";
  129. }
  130. }
  131. end;
  132. OnCroixQuit:
  133. //set BG_Delay_Tick, gettimetick(2) + 1200;
  134. OnCroixDie:
  135. if( $@KvM02BG == 2 )
  136. {
  137. set .Croix_Count, .Croix_Count - 1;
  138. bg_updatescore "bat_c02",.Guillaume_Count,.Croix_Count;
  139. if( .Croix_Count < 1 ) donpcevent "KvM02_BG::OnGuillaumeWin";
  140. else {
  141. mapannounce "bat_c02", "The number of Guillaumes is "+.Guillaume_Count+".",bc_map,"0x00ff00";
  142. mapannounce "bat_c02", "The number of Croixes is "+.Croix_Count+".",bc_map,"0x00ff00";
  143. }
  144. }
  145. end;
  146. OnReadyCheck:
  147. if( $@KvM02BG )
  148. end;
  149. set .@Guillaume, getwaitingroomstate(0,"KvM02R_Guillaume");
  150. set .@Croix, getwaitingroomstate(0,"KvM02R_Croix");
  151. if( .@Guillaume < 5 || .@Croix < 5 )
  152. end;
  153. set $@KvM02BG, 1; // Starting
  154. donpcevent "KvM02R_Croix::OnEnterBG";
  155. donpcevent "KvM02R_Guillaume::OnEnterBG";
  156. donpcevent "KvM02_BG::OnStart";
  157. end;
  158. OnStart:
  159. disablenpc "KVM Officer#KVM02A";
  160. disablenpc "KVM Officer#KVM02B";
  161. set $@KvM02BG_Victory, 0;
  162. // Warp Teams
  163. bg_warp $@KvM02BG_id1,"bat_c02",53,128;
  164. bg_warp $@KvM02BG_id2,"bat_c02",146,55;
  165. initnpctimer;
  166. end;
  167. OnTimer1000:
  168. mapannounce "bat_c02", "In 1 minute, KVM will start.",bc_map,"0x00ff00";
  169. end;
  170. OnTimer3000:
  171. mapannounce "bat_c02", "The maximum time for a KVM battle is 5 minutes.",bc_map,"0x00ff00";
  172. end;
  173. OnTimer6000:
  174. mapannounce "bat_c02", "Please prepare for the KVM battle.",bc_map,"0x00ff00";
  175. mapannounce "bat_c02", "You can buff your people.",bc_map,"0x00ff00";
  176. donpcevent "#A_camp_start02::OnEnable";
  177. donpcevent "#B_camp_start02::OnEnable";
  178. end;
  179. OnTimer13000:
  180. donpcevent "#A_camp_start02::OnDisable";
  181. donpcevent "#B_camp_start02::OnDisable";
  182. end;
  183. OnTimer30000:
  184. mapannounce "bat_c02", "30 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
  185. end;
  186. OnTimer45000:
  187. mapannounce "bat_c02", "15 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
  188. donpcevent "::OnKvM01One";
  189. end;
  190. OnTimer50000:
  191. mapannounce "bat_c02", "10 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
  192. donpcevent "::OnKvM01Two";
  193. end;
  194. OnTimer55000:
  195. mapannounce "bat_c02", "5 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
  196. donpcevent "::OnKvM01One";
  197. end;
  198. OnTimer59000:
  199. mapannounce "bat_c02", "KVM is now commencing.",bc_map,"0x00ff00";
  200. donpcevent "::OnKvM01Two";
  201. end;
  202. OnTimer61000:
  203. // Team Members
  204. set .Guillaume_Count, bg_get_data($@KvM02BG_id1, 0);
  205. set .Croix_Count, bg_get_data($@KvM02BG_id2, 0);
  206. if( .Guillaume_Count < 5 || .Croix_Count < 5 )
  207. {
  208. set $@KvM02BG_Victory, 3;
  209. set $@KvM02BG, 3;
  210. mapannounce "bat_c02","There are not enough players to start the battle",1,0x808080;
  211. stopnpctimer;
  212. donpcevent "KvM02_BG::OnStop";
  213. end;
  214. }
  215. set $@KvM02BG, 2; // Playing
  216. bg_warp $@KvM02BG_id1,"bat_c02",62,119;
  217. bg_warp $@KvM02BG_id2,"bat_c02",137,64;
  218. end;
  219. OnTimer300000:
  220. mapannounce "bat_c02", "1 minute remaining to finish the KVM battle.",bc_map,"0x00ff00";
  221. end;
  222. OnTimer330000:
  223. mapannounce "bat_c02", "30 seconds remaining to finish the KVM battle.",bc_map,"0x00ff00";
  224. end;
  225. OnTimer345000:
  226. mapannounce "bat_c02", "15 seconds remaining to finish the KVM battle.",bc_map,"0x00ff00";
  227. end;
  228. OnTimer350000:
  229. mapannounce "bat_c02", "10 seconds remaining to finish the KVM battle.",bc_map,"0x00ff00";
  230. end;
  231. OnTimer355000:
  232. mapannounce "bat_c02", "5 seconds remaining to finish the KVM battle.",bc_map,"0x00ff00";
  233. end;
  234. OnTimer360000:
  235. mapannounce "bat_c02", "The KVM battle is over.",bc_map,"0x00ff00";
  236. if( .Croix_Count > .Guillaume_Count )
  237. donpcevent "KvM02_BG::OnCroixWin";
  238. else if( .Croix_Count < .Guillaume_Count )
  239. donpcevent "KvM02_BG::OnGuillaumeWin";
  240. else
  241. { // Draw Game
  242. set $@KvM02BG, 3;
  243. set $@KvM02BG_Victory, 3;
  244. mapannounce "bat_c02", "The number of Guillaumes is "+.Guillaume_Count+".",bc_map,"0x00ff00";
  245. mapannounce "bat_c02", "The number of Croixes is "+.Croix_Count+".",bc_map,"0x00ff00";
  246. mapannounce "bat_c02", "This battle has ended in a draw.",bc_map,"0x00ff00";
  247. donpcevent "KvM02_BG::OnStop";
  248. }
  249. end;
  250. OnGuillaumeWin:
  251. set $@KvM02BG, 3;
  252. set $@KvM02BG_Victory, 1;
  253. mapannounce "bat_c02", "Guillaume wins!",bc_map,"0x00ff00";
  254. mapannounce "bat_c02", "Congratulations to Guillaume members.",bc_map,"0x00ff00";
  255. mapannounce "bat_c02", "Everyone will be moved to the start point.",bc_map,"0x00ff00";
  256. donpcevent "KvM02_BG::OnStop";
  257. end;
  258. OnCroixWin:
  259. set $@KvM02BG, 3;
  260. set $@KvM02BG_Victory, 2;
  261. mapannounce "bat_c02", "Croix wins!",bc_map,"0x00ff00";
  262. mapannounce "bat_c02", "Congratulations to Croix members.",bc_map,"0x00ff00";
  263. mapannounce "bat_c02", "Everyone will be moved to the start point.",bc_map,"0x00ff00";
  264. donpcevent "KvM02_BG::OnStop";
  265. end;
  266. OnStop:
  267. stopnpctimer;
  268. enablenpc "KVM Officer#KVM02A";
  269. enablenpc "KVM Officer#KVM02B";
  270. // Warp Teams
  271. bg_warp $@KvM02BG_id1,"bat_c02",53,128;
  272. bg_warp $@KvM02BG_id2,"bat_c02",146,55;
  273. donpcevent "KvM02_BG_Out::OnBegin";
  274. end;
  275. OnReset:
  276. set .Croix_Count, 0;
  277. set .Guillaume_Count, 0;
  278. set $@KvM02BG_Victory, 0;
  279. if( $@KvM02BG_id1 ) { bg_destroy $@KvM02BG_id1; set $@KvM02BG_id1, 0; }
  280. if( $@KvM02BG_id2 ) { bg_destroy $@KvM02BG_id2; set $@KvM02BG_id2, 0; }
  281. disablenpc "KVM Officer#KVM02A";
  282. disablenpc "KVM Officer#KVM02B";
  283. mapwarp "bat_c02","bat_room",154,150;
  284. maprespawnguildid "bat_c02",0,3; // Just in case someone else
  285. bg_updatescore "bat_c02",5,5;
  286. set $@KvM02BG, 0;
  287. donpcevent "KvM02_BG::OnReadyCheck"; // Maybe a game is ready to start
  288. end;
  289. }
  290. - script KvM02_BG_Out -1,{
  291. end;
  292. OnBegin:
  293. initnpctimer;
  294. end;
  295. OnTimer1000:
  296. mapannounce "bat_c02", "Please apply with the Officer to acquire KVM points.",bc_map,"0x00ff00";
  297. end;
  298. OnTimer3000:
  299. mapannounce "bat_c02", "The Officer will grant you the points for 30 seconds.",bc_map,"0x00ff00";
  300. mapannounce "bat_c02", "In 30 seconds, the Officer will be sent away.",bc_map,"0x00ff00";
  301. end;
  302. OnTimer5000:
  303. mapannounce "bat_c02", "Unless you talk to the Officer, you cannot gain the points.",bc_map,"0x00ff00";
  304. mapannounce "bat_c02", "Please be careful.",bc_map,"0x00ff00";
  305. end;
  306. OnTimer:55000:
  307. mapannounce "bat_c02", "You will be sent back.",bc_map,"0x00ff00";
  308. end;
  309. OnTimer60000:
  310. stopnpctimer;
  311. donpcevent "KvM02_BG::OnReset";
  312. end;
  313. }
  314. // Battleground rewards
  315. //============================================================
  316. bat_c02,51,130,5 script KVM Officer#KVM02A 419,{
  317. if( $@KvM01BG_Victory )
  318. {
  319. if( $@KvM02BG_Victory == Bat_Team )
  320. { // Victory
  321. set kvm_point,kvm_point + 1;
  322. mes "[KVM Officer]";
  323. mes "Good Game.";
  324. mes "May the glory of KVM be with you.";
  325. mes "You aquire the winning points: 1";
  326. close2;
  327. }
  328. else
  329. { //
  330. mes "[KVM Officer]";
  331. mes "I am so sorry.";
  332. mes "I wish you better luck next time.";
  333. mes "You aquire the losing points: 0";
  334. close2;
  335. }
  336. bg_leave;
  337. set Bat_Team,0;
  338. warp "bat_room",154,150;
  339. end;
  340. }
  341. end;
  342. }
  343. bat_c02,148,53,1 script KVM Officer#KVM02B 415,{
  344. if( $@KvM01BG_Victory )
  345. {
  346. if( $@KvM02BG_Victory == Bat_Team )
  347. { // Victory
  348. set kvm_point,kvm_point + 1;
  349. mes "[KVM Officer]";
  350. mes "Good Game.";
  351. mes "May the glory of KVM be with you.";
  352. mes "You aquire the winning points: 1";
  353. close2;
  354. }
  355. else
  356. { //
  357. mes "[KVM Officer]";
  358. mes "I am so sorry.";
  359. mes "I wish you better luck next time.";
  360. mes "You aquire the losing points: 0";
  361. close2;
  362. }
  363. bg_leave;
  364. set Bat_Team,0;
  365. warp "bat_room",154,150;
  366. end;
  367. }
  368. end;
  369. }