kvm01.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. //===== eAthena Script =======================================
  2. // BattleGround System - KvM 80-99
  3. //===== By: ==================================================
  4. //= ???, L0ne_W0lf
  5. //===== Current Version: =====================================
  6. //= 1.1
  7. //===== Compatible With: =====================================
  8. //= eAthena 1.0
  9. //===== Description: =========================================
  10. //= [AEGIS Conversion]
  11. //= Kreiger Von Midgard Battleground for levels 80 to 99
  12. //= - Winning Team: 5 points
  13. //= - Losing Team: 1 point
  14. //===== Additional Comments: =================================
  15. //= 1.0 First Version.
  16. //= 1.1 Updated using official Aegis files. [L0ne_W0lf]
  17. //============================================================
  18. // Waiting Room NPCs
  19. //============================================================
  20. bat_room,169,226,5 script KVM Waiting Room#a::KvM01R_Guillaume 418,{
  21. end;
  22. OnInit:
  23. waitingroom "Battle Station 5 Players",5,"KvM01_BG::OnGuillaumeJoin",1;
  24. end;
  25. OnEnterBG:
  26. set $@KvM01BG_id1, waitingroom2bg("bat_c01",52,129,"KvM01_BG::OnGuillaumeQuit","KvM01_BG::OnGuillaumeDie");
  27. end;
  28. }
  29. bat_room,169,220,0 warp #kvm801 2,2,bat_room,154,150
  30. bat_room,169,205,3 script KVM Waiting Room#b::KvM01R_Croix 414,{
  31. end;
  32. OnInit:
  33. waitingroom "Battle Station 5 Players",5,"KvM01_BG::OnCroixJoin",1;
  34. end;
  35. OnEnterBG:
  36. set $@KvM01BG_id2, waitingroom2bg("bat_c01",147,55,"KvM01_BG::OnCroixQuit","KvM01_BG::OnCroixDie");
  37. end;
  38. }
  39. bat_room,169,211,0 warp #kvm802 2,2,bat_room,154,150
  40. // Starting Line
  41. //============================================================
  42. - script KVM01::CellEffect -1,{
  43. end;
  44. OnKvM01One:
  45. misceffect EF_CHANGECOLD;
  46. end;
  47. OnKvM01Two:
  48. misceffect EF_CHANGEPOISON;
  49. end;
  50. }
  51. bat_c01,54,124,3 duplicate(CellEffect) #RedcellA1-1 139
  52. bat_c01,55,124,3 duplicate(CellEffect) #RedcellA2-1 139
  53. bat_c01,56,124,3 duplicate(CellEffect) #RedcellA3-1 139
  54. bat_c01,57,124,3 duplicate(CellEffect) #RedcellA4-1 139
  55. bat_c01,57,125,3 duplicate(CellEffect) #RedcellA5-1 139
  56. bat_c01,57,126,3 duplicate(CellEffect) #RedcellA6-1 139
  57. bat_c01,57,127,3 duplicate(CellEffect) #RedcellA7-1 139
  58. bat_c01,145,59,3 duplicate(CellEffect) #RedcellB1-1 139
  59. bat_c01,144,59,3 duplicate(CellEffect) #RedcellB2-1 139
  60. bat_c01,143,59,3 duplicate(CellEffect) #RedcellB3-1 139
  61. bat_c01,142,59,3 duplicate(CellEffect) #RedcellB4-1 139
  62. bat_c01,142,56,3 duplicate(CellEffect) #RedcellB5-1 139
  63. bat_c01,142,57,3 duplicate(CellEffect) #RedcellB6-1 139
  64. bat_c01,142,58,3 duplicate(CellEffect) #RedcellB7-1 139
  65. bat_c01,54,128,3 script #A_camp_start01 139,4,4,{
  66. end;
  67. OnInit:
  68. disablenpc "#A_camp_start01";
  69. end;
  70. OnEnable:
  71. enablenpc "#A_camp_start01";
  72. end;
  73. OnDisable:
  74. disablenpc "#A_camp_start01";
  75. end;
  76. OnTouch:
  77. set Bat_Team,1;
  78. setquest 6025;
  79. end;
  80. }
  81. bat_c01,146,56,3 script #B_camp_start01 139,4,4,{
  82. end;
  83. OnInit:
  84. disablenpc "#B_camp_start01";
  85. end;
  86. OnEnable:
  87. enablenpc "#B_camp_start01";
  88. end;
  89. OnDisable:
  90. disablenpc "#B_camp_start01";
  91. end;
  92. OnTouch:
  93. set Bat_Team,2;
  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. OnGuillaumeJoin:
  110. OnCroixJoin:
  111. donpcevent "KvM01_BG::OnReadyCheck";
  112. end;
  113. OnGuillaumeQuit:
  114. //set BG_Delay_Tick, gettimetick(2) + 1200;
  115. OnGuillaumeDie:
  116. if( $@KvM01BG == 2 )
  117. {
  118. set .Guillaume_Count, .Guillaume_Count - 1;
  119. set .Croix_Score, .Croix_Score + 1;
  120. bg_updatescore "bat_c01",.Guillaume_Score,.Croix_Score;
  121. if( .Guillaume_Count < 1 ) donpcevent "KvM01_BG::OnCroixWin";
  122. else {
  123. mapannounce "bat_c01", "NUmber of Guillaume survivors "+.Guillaume_Count+".",bc_map,"0x00ff00";
  124. mapannounce "bat_c01", "NUmber of Croix survivors "+.Croix_Count+".",bc_map,"0x00ff00";
  125. }
  126. }
  127. end;
  128. OnCroixQuit:
  129. //set BG_Delay_Tick, gettimetick(2) + 1200;
  130. OnCroixDie:
  131. if( $@KvM01BG == 2 )
  132. {
  133. set .Croix_Count, .Croix_Count - 1;
  134. set .Guillaume_Score, .Guillaume_Score + 1;
  135. bg_updatescore "bat_c01",.Guillaume_Score,.Croix_Score;
  136. if( .Croix_Count < 1 ) donpcevent "KvM01_BG::OnGuillaumeWin";
  137. else {
  138. mapannounce "bat_c01", "NUmber of Guillaume survivors "+.Guillaume_Count+".",bc_map,"0x00ff00";
  139. mapannounce "bat_c01", "NUmber of Croix survivors "+.Croix_Count+".",bc_map,"0x00ff00";
  140. }
  141. }
  142. end;
  143. OnReadyCheck:
  144. if( $@KvM01BG )
  145. end;
  146. set .@Guillaume, getwaitingroomstate(0,"KvM01R_Guillaume");
  147. set .@Croix, getwaitingroomstate(0,"KvM01R_Croix");
  148. if( .@Guillaume < 5 || .@Croix < 5 )
  149. end;
  150. set $@KvM01BG, 1; // Starting
  151. donpcevent "KvM01R_Croix::OnEnterBG";
  152. donpcevent "KvM01R_Guillaume::OnEnterBG";
  153. donpcevent "KvM01_BG::OnStart";
  154. end;
  155. OnStart:
  156. disablenpc "KVM Officer#KVM01A";
  157. disablenpc "KVM Officer#KVM01B";
  158. set $@KvM01BG_Victory, 0;
  159. // Warp Teams
  160. bg_warp $@KvM01BG_id1,"bat_c01",53,128;
  161. bg_warp $@KvM01BG_id2,"bat_c01",146,55;
  162. // ScoreBoard
  163. set .Guillaume_Score, 0;
  164. set .Croix_Score, 0;
  165. initnpctimer;
  166. end;
  167. OnTimer1000:
  168. mapannounce "bat_c01", "In 1 minute, KVM will start.",bc_map,"0x00ff00";
  169. end;
  170. OnTimer3000:
  171. mapannounce "bat_c01", "The maximum time for a KVM battle is 5 minutes.",bc_map,"0x00ff00";
  172. end;
  173. OnTimer6000:
  174. mapannounce "bat_c01", "Please prepare for the KVM battle.",bc_map,"0x00ff00";
  175. mapannounce "bat_c01", "You can buff your people.",bc_map,"0x00ff00";
  176. donpcevent "#A_camp_start01::OnEnable";
  177. donpcevent "#B_camp_start01::OnEnable";
  178. end;
  179. OnTimer13000:
  180. donpcevent "#A_camp_start01::OnDisable";
  181. donpcevent "#B_camp_start01::OnDisable";
  182. end;
  183. OnTimer30000:
  184. mapannounce "bat_c01", "30 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
  185. end;
  186. OnTimer45000:
  187. mapannounce "bat_c01", "15 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
  188. donpcevent "::OnKvM01One";
  189. end;
  190. OnTimer50000:
  191. mapannounce "bat_c01", "10 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
  192. donpcevent "::OnKvM01Two";
  193. end;
  194. OnTimer55000:
  195. mapannounce "bat_c01", "5 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
  196. donpcevent "::OnKvM01One";
  197. end;
  198. OnTimer59000:
  199. mapannounce "bat_c01", "KVM is now commencing.",bc_map,"0x00ff00";
  200. donpcevent "::OnKvM01Two";
  201. end;
  202. OnTimer61000:
  203. // Team Members
  204. set .Guillaume_Count, bg_get_data($@KvM01BG_id1, 0);
  205. set .Croix_Count, bg_get_data($@KvM01BG_id2, 0);
  206. if( .Guillaume_Count < 5 || .Croix_Count < 5 )
  207. {
  208. set $@KvM01BG_Victory, 3;
  209. set $@KvM01BG, 3;
  210. mapannounce "bat_c01","There are not enough players to start the battle",1,0x696969;
  211. stopnpctimer;
  212. donpcevent "KvM01_BG::OnStop";
  213. end;
  214. }
  215. set $@KvM01BG, 2; // Playing
  216. areapercentheal "bat_c01",50,123,58,131,100,100;
  217. bg_warp $@KvM01BG_id1,"bat_c01",61,120;
  218. areapercentheal "bat_c01",141,52,149,60,100,100;
  219. bg_warp $@KvM01BG_id2,"bat_c01",138,63;
  220. end;
  221. OnTimer300000:
  222. mapannounce "bat_c01", "KVM will be ending in 1 minute.",bc_map,"0x00ff00";
  223. end;
  224. OnTimer330000:
  225. mapannounce "bat_c01", "KVM will be ending in 30 seconds.",bc_map,"0x00ff00";
  226. end;
  227. OnTimer345000:
  228. mapannounce "bat_c01", "KVM will be ending in 15 seconds.",bc_map,"0x00ff00";
  229. end;
  230. OnTimer350000:
  231. mapannounce "bat_c01", "KVM will be ending in 10 seconds.",bc_map,"0x00ff00";
  232. end;
  233. OnTimer355000:
  234. mapannounce "bat_c01", "KVM will be ending in 5 seconds.",bc_map,"0x00ff00";
  235. end;
  236. OnTimer360000:
  237. mapannounce "bat_c01", "KVM has ended.",bc_map,"0x00ff00";
  238. if( .Croix_Count > .Guillaume_Count )
  239. donpcevent "KvM01_BG::OnCroixWin";
  240. else if( .Croix_Count < .Guillaume_Count )
  241. donpcevent "KvM01_BG::OnGuillaumeWin";
  242. else
  243. { // Draw Game
  244. set $@KvM01BG, 3;
  245. set $@KvM01BG_Victory, 3;
  246. mapannounce "bat_c01", "Number of Guillaume survivors "+.Guillaume_Count+".",bc_map,"0x00ff00";
  247. mapannounce "bat_c01", "Number of Croix survivors "+.Croix_Count+".",bc_map,"0x00ff00";
  248. mapannounce "bat_c01", "Regardless of the outcome of the two camps.",bc_map,"0x00ff00";
  249. donpcevent "KvM01_BG::OnStop";
  250. }
  251. end;
  252. OnGuillaumeWin:
  253. set $@KvM01BG, 3;
  254. set $@KvM01BG_Victory, 1;
  255. mapannounce "bat_c01", "Guillaume camp victory.",bc_map,"0x00ff00";
  256. mapannounce "bat_c01", "Congratulations to all Guillaume members.",bc_map,"0x00ff00";
  257. mapannounce "bat_c01", "All personnel move to the starting zone.",bc_map,"0x00ff00";
  258. donpcevent "KvM01_BG::OnStop";
  259. end;
  260. OnCroixWin:
  261. set $@KvM01BG, 3;
  262. set $@KvM01BG_Victory, 2;
  263. mapannounce "bat_c01", "Croix camp victory.",bc_map,"0x00ff00";
  264. mapannounce "bat_c01", "Congratulations to all Croix members.",bc_map,"0x00ff00";
  265. mapannounce "bat_c01", "All personnel move to the starting zone.",bc_map,"0x00ff00";
  266. donpcevent "KvM01_BG::OnStop";
  267. end;
  268. OnStop:
  269. stopnpctimer;
  270. enablenpc "KVM Officer#KVM01A";
  271. enablenpc "KVM Officer#KVM01B";
  272. // Warp Teams
  273. bg_warp $@KvM01BG_id1,"bat_c01",53,128;
  274. bg_warp $@KvM01BG_id2,"bat_c01",146,55;
  275. donpcevent "KvM01_BG_Out::OnBegin";
  276. end;
  277. OnReset:
  278. set .Croix_Count, 0;
  279. set .Guillaume_Count, 0;
  280. set .Croix_Score, 0;
  281. set .Guillaume_Score, 0;
  282. set $@KvM01BG_Victory, 0;
  283. if( $@KvM01BG_id1 ) { bg_destroy $@KvM01BG_id1; set $@KvM01BG_id1, 0; }
  284. if( $@KvM01BG_id2 ) { bg_destroy $@KvM01BG_id2; set $@KvM01BG_id2, 0; }
  285. disablenpc "KVM Officer#KVM01A";
  286. disablenpc "KVM Officer#KVM01B";
  287. mapwarp "bat_c01","bat_room",154,150;
  288. maprespawnguildid "bat_c01",0,3; // Just in case someone else
  289. bg_updatescore "bat_c01",0,0;
  290. set $@KvM01BG, 0;
  291. donpcevent "KvM01_BG::OnReadyCheck"; // Maybe a game is ready to start
  292. end;
  293. }
  294. - script KvM01_BG_Out -1,{
  295. end;
  296. OnBegin:
  297. initnpctimer;
  298. end;
  299. OnTimer1000:
  300. mapannounce "bat_c01", "Please apply with the Officer to acquire KVM points.",bc_map,"0x00ff00";
  301. end;
  302. OnTimer3000:
  303. mapannounce "bat_c01", "The Officer will grant you the points for 30 seconds.",bc_map,"0x00ff00";
  304. mapannounce "bat_c01", "In 30 seconds, the Officer will be sent away.",bc_map,"0x00ff00";
  305. end;
  306. OnTimer5000:
  307. mapannounce "bat_c01", "If you do not claim your points now, you will not be able to.",bc_map,"0x00ff00";
  308. mapannounce "bat_c01", "Please make sure to collect before the time expires.",bc_map,"0x00ff00";
  309. end;
  310. OnTimer60000:
  311. stopnpctimer;
  312. donpcevent "KvM01_BG::OnReset";
  313. end;
  314. }
  315. // Battleground rewards
  316. //============================================================
  317. bat_c01,51,130,5 script KVM Officer#KVM01A 419,{
  318. if( $@KvM01BG_Victory )
  319. {
  320. if( $@KvM01BG_Victory == Bat_Team )
  321. { // Victory
  322. set kvm_point,kvm_point + 5;
  323. mes "[Swandery]";
  324. mes "Blessed Guillaume!!";
  325. mes "Let's enjoy our glorious victory!";
  326. mes "" + strcharinfo(0) + ", its a sign reflecting victory";
  327. close2;
  328. }
  329. else
  330. { //
  331. set kvm_point,kvm_point + 1;
  332. mes "[Swandery]";
  333. mes "You lost, but you're dedicated to this battle.";
  334. mes "This is a reward for your great dedication by Guillaume Marollo!";
  335. mes "Just take this defeat a lesson, and later you would definitely learn.";
  336. close2;
  337. }
  338. bg_leave;
  339. set Bat_Team,0;
  340. warp "bat_room",154,150;
  341. end;
  342. }
  343. end;
  344. }
  345. bat_c01,148,53,1 script KVM Officer#KVM01B 415,{
  346. if( $@KvM01BG_Victory )
  347. {
  348. if( $@KvM01BG_Victory == Bat_Team )
  349. { // Victory
  350. set kvm_point,kvm_point + 5;
  351. mes "[Swandery]";
  352. mes "Blessed Croax!!";
  353. mes "Let's enjoy our glorious victory!";
  354. mes "" + strcharinfo(0) + ", its a sign reflecting victory";
  355. close2;
  356. }
  357. else
  358. { //
  359. set kvm_point,kvm_point + 1;
  360. mes "[Swandery]";
  361. mes "Oh, " + strcharinfo(0) + ". Don't be sad.";
  362. mes "Even though we didn't win, we did our best.";
  363. mes "This is a Royal gift from Croix, and please don't forget this battle. We can win the next.";
  364. close2;
  365. }
  366. bg_leave;
  367. set Bat_Team,0;
  368. warp "bat_room",154,150;
  369. end;
  370. }
  371. end;
  372. }