kvm01.txt 10 KB

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