kvm01.txt 11 KB

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