kvm01.txt 10 KB

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