kvm02.txt 10 KB

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