kvm03.txt 10 KB

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