kvm02.txt 11 KB

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