kvm03.txt 10 KB

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