kvm03.txt 11 KB

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