bg_flavius_01.txt 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. // ==============================================================================
  2. // BattleGround System - Flavius 1
  3. // ==============================================================================
  4. // Registration NPC's
  5. // *********************************************************************
  6. bat_room,253,97,4 script Registration::Fl1R_Guillaume 418,{
  7. end;
  8. OnInit:
  9. waitingroom "Battle Station 10 Players",10,"Flavius_BG1::OnGuillaumeJoin",1;
  10. end;
  11. OnEnterBG:
  12. set $@FlaviusBG1_id1, waitingroom2bg("bat_b01",390,10,"Flavius_BG1::OnGuillaumeQuit","");
  13. end;
  14. }
  15. bat_room,253,74,0 script Registration::Fl1R_Croix 414,{
  16. end;
  17. OnInit:
  18. waitingroom "Battle Station 10 Players",10,"Flavius_BG1::OnCroixJoin",1;
  19. end;
  20. OnEnterBG:
  21. set $@FlaviusBG1_id2, waitingroom2bg("bat_b01",10,290,"Flavius_BG1::OnCroixQuit","");
  22. end;
  23. }
  24. // Battleground Engine
  25. // *********************************************************************
  26. - script Flavius_BG1 -1,{
  27. end;
  28. OnInit:
  29. disablenpc "Guillaume Vintenar#fl1";
  30. disablenpc "Croix Vintenar#fl1";
  31. disablenpc "Therapist in battle#fl11";
  32. disablenpc "Therapist in battle#fl12";
  33. end;
  34. OnGuillaumeQuit:
  35. OnCroixQuit:
  36. set BG_Delay_Tick, gettimetick(2) + 1200;
  37. end;
  38. OnGuillaumeJoin:
  39. OnCroixJoin:
  40. if( $@FlaviusBG1 == 0 )
  41. donpcevent "Flavius_BG1::OnReadyCheck";
  42. end;
  43. OnReadyCheck:
  44. if( $@FlaviusBG1 )
  45. end;
  46. set .@Guillaume, getwaitingroomstate(0,"Fl1R_Guillaume");
  47. set .@Croix, getwaitingroomstate(0,"Fl1R_Croix");
  48. if( .@Guillaume < 10 || .@Croix < 10 )
  49. {
  50. mapannounce "bat_room","Battleground -- Flavius [80-99] G: " + .@Guillaume + "/10, C: " + .@Croix + "/10",1,0x006400;
  51. end;
  52. }
  53. // BG Variables
  54. set $@FlaviusBG1, 1;
  55. set $@FlaviusBG1_Victory, 0;
  56. set .Guillaume_Score, 0;
  57. set .Guillaume_Loss, 0;
  58. set .Croix_Score, 0;
  59. set .Croix_Loss, 0;
  60. set .Match, 0;
  61. // Prepare NPC
  62. donpcevent "#gfl1_respawn::OnBGStart";
  63. donpcevent "#cfl1_respawn::OnBGStart";
  64. enablenpc "Therapist in battle#fl11";
  65. enablenpc "Therapist in battle#fl12";
  66. disablenpc "Guillaume Vintenar#fl1";
  67. disablenpc "Croix Vintenar#fl1";
  68. // Build and Warp Teams
  69. donpcevent "Fl1R_Guillaume::OnEnterBG";
  70. donpcevent "Fl1R_Croix::OnEnterBG";
  71. announce "Battleground -- Flavius [80-99] has started!",0,0x006400;
  72. initnpctimer;
  73. // Start Match!!
  74. OnRoundStart:
  75. sleep 2000;
  76. if( $@FlaviusBG1 != 1 ) end;
  77. areapercentheal "bat_b01",382,2,397,17,100,100;
  78. areapercentheal "bat_b01",2,282,17,297,100,100;
  79. bg_warp $@FlaviusBG1_id1,"bat_b01",311,224;
  80. bg_warp $@FlaviusBG1_id2,"bat_b01",87,75;
  81. sleep 2000;
  82. if( $@FlaviusBG1 != 1 ) end;
  83. set .Match, .Match + 1;
  84. // Crystal Spawn
  85. set .Guillaume_Crystal, bg_monster($@FlaviusBG1_id1,"bat_b01",328,150,"Crystal Guillaume",1914,"Flavius_BG1::OnGuillaumeBreak");
  86. setwall "bat_b01",327,149,2,6,0,"gui_wall1-1";
  87. setwall "bat_b01",329,149,2,0,0,"gui_wall1-2";
  88. setwall "bat_b01",329,151,2,2,0,"gui_wall1-3";
  89. setwall "bat_b01",327,151,2,4,0,"gui_wall1-4";
  90. set .Croix_Crystal, bg_monster($@FlaviusBG1_id2,"bat_b01",62,150,"Crystal Croix",1915,"Flavius_BG1::OnCroixBreak");
  91. setwall "bat_b01",61,149,2,6,0,"cro_wall1-1";
  92. setwall "bat_b01",63,149,2,0,0,"cro_wall1-2";
  93. setwall "bat_b01",63,151,2,2,0,"cro_wall1-3";
  94. setwall "bat_b01",61,151,2,4,0,"cro_wall1-4";
  95. // Guardian Spawns
  96. bg_monster $@FlaviusBG1_id1,"bat_b01",328,160,"Guillaume Guardian",1949,"Flavius_BG1::OnGuiGuardian";
  97. bg_monster $@FlaviusBG1_id1,"bat_b01",328,140,"Guillaume Guardian",1950,"Flavius_BG1::OnGuiGuardian";
  98. set .Guillaume_Guardian, 2;
  99. bg_monster $@FlaviusBG1_id2,"bat_b01",62,160,"Croix Guardian",1949,"Flavius_BG1::OnCroGuardian";
  100. bg_monster $@FlaviusBG1_id2,"bat_b01",61,140,"Croix Guardian",1950,"Flavius_BG1::OnCroGuardian";
  101. set .Croix_Guardian, 2;
  102. // Announces
  103. mapannounce "bat_b01","The Battle of Flavius [ " + .Match + " ] Round has begun!!",1,0x006400;
  104. end;
  105. OnRoundStop:
  106. // Remove Monsters
  107. killmonster "bat_b01","Flavius_BG1::OnGuiGuardian";
  108. killmonster "bat_b01","Flavius_BG1::OnCroGuardian";
  109. delwall "gui_wall1-1";
  110. delwall "gui_wall1-2";
  111. delwall "gui_wall1-3";
  112. delwall "gui_wall1-4";
  113. killmonster "bat_b01","Flavius_BG1::OnGuillaumeBreak";
  114. delwall "cro_wall1-1";
  115. delwall "cro_wall1-2";
  116. delwall "cro_wall1-3";
  117. delwall "cro_wall1-4";
  118. killmonster "bat_b01","Flavius_BG1::OnCroixBreak";
  119. end;
  120. OnGuiGuardian:
  121. if( set(.Guillaume_Guardian, .Guillaume_Guardian - 1) <= 0 )
  122. {
  123. delwall "gui_wall1-1";
  124. delwall "gui_wall1-2";
  125. delwall "gui_wall1-3";
  126. delwall "gui_wall1-4";
  127. mapannounce "bat_b01","The Guillaume Crystal is vulnerable to attack!",1,0x0000FF;
  128. }
  129. end;
  130. OnCroGuardian:
  131. if( set(.Croix_Guardian, .Croix_Guardian - 1) <= 0 )
  132. {
  133. delwall "cro_wall1-1";
  134. delwall "cro_wall1-2";
  135. delwall "cro_wall1-3";
  136. delwall "cro_wall1-4";
  137. mapannounce "bat_b01","The Croix Crystal is vulnerable to attack!",1,0xFF0000;
  138. }
  139. end;
  140. OnGuillaumeBreak:
  141. donpcevent "Flavius_BG1::OnRoundStop";
  142. set .Guillaume_Loss, .Guillaume_Loss + 1;
  143. if( set(.Croix_Score, .Croix_Score + 1) < 2 )
  144. {
  145. bg_updatescore "bat_b01",.Guillaume_Score,.Croix_Score;
  146. mapannounce "bat_b01","The Guillaume Crystal has been destroyed!",1,0x0000FF;
  147. donpcevent "Flavius_BG1::OnRoundStart";
  148. }
  149. else
  150. {
  151. bg_updatescore "bat_b01",.Guillaume_Score,.Croix_Score;
  152. mapannounce "bat_b01","The Croix army has won the Battle of Flavius!",1,0xFF0000;
  153. set $@FlaviusBG1_Victory, 2;
  154. donpcevent "Flavius_BG1::OnMatchEnd";
  155. }
  156. end;
  157. OnCroixBreak:
  158. donpcevent "Flavius_BG1::OnRoundStop";
  159. set .Croix_Loss, .Croix_Loss + 1;
  160. if( set(.Guillaume_Score, .Guillaume_Score + 1) < 2 )
  161. {
  162. bg_updatescore "bat_b01",.Guillaume_Score,.Croix_Score;
  163. mapannounce "bat_b01","The Croix Crystal has been destroyed!",1,0xFF0000;
  164. donpcevent "Flavius_BG1::OnRoundStart";
  165. }
  166. else
  167. {
  168. bg_updatescore "bat_b01",.Guillaume_Score,.Croix_Score;
  169. mapannounce "bat_b01","The Guillaume army has won the Battle of Flavius!",1,0x0000FF;
  170. set $@FlaviusBG1_Victory, 1;
  171. donpcevent "Flavius_BG1::OnMatchEnd";
  172. }
  173. end;
  174. OnTimer2400000:
  175. mapannounce "bat_b01","Battle of Flavius will ends in 5 minutes",1,0x006400;
  176. end;
  177. OnTimer2640000:
  178. mapannounce "bat_b01","Battle of Flavius will ends in 1 minute",1,0x006400;
  179. end;
  180. OnTimer2700000:
  181. if( .Croix_Score > .Guillaume_Score )
  182. {
  183. mapannounce "bat_b01","The Croix army has won the Battle of Flavius!",1,0xFF0000;
  184. set $@FlaviusBG1_Victory, 2;
  185. }
  186. else if( .Croix_Score < .Guillaume_Score )
  187. {
  188. mapannounce "bat_b01","The Guillaume army has won the Battle of Flavius!",1,0x0000FF;
  189. set $@FlaviusBG1_Victory, 1;
  190. }
  191. else
  192. {
  193. mapannounce "bat_b01","The Battle of Flavius is over. The time is out, this is a Tie",1,0x006400;
  194. set $@FlaviusBG1_Victory, 3;
  195. }
  196. OnMatchEnd:
  197. set $@FlaviusBG1, 2;
  198. stopnpctimer;
  199. donpcevent "#gfl1_respawn::OnBGStop";
  200. donpcevent "#cfl1_respawn::OnBGStop";
  201. disablenpc "Therapist in battle#fl11";
  202. disablenpc "Therapist in battle#fl12";
  203. enablenpc "Guillaume Vintenar#fl1";
  204. enablenpc "Croix Vintenar#fl1";
  205. sleep 2000;
  206. bg_warp $@FlaviusBG1_id1,"bat_b01",390,10;
  207. bg_warp $@FlaviusBG1_id2,"bat_b01",10,290;
  208. sleep 3000;
  209. mapannounce "bat_b01","Battle of Flavius will close in 1 minute!",1,0x006400;
  210. initnpctimer;
  211. end;
  212. OnTimer30000:
  213. if( $@FlaviusBG1 == 2 )
  214. mapannounce "bat_b01","Battle of Flavius will close in 30 seconds!",1,0x006400;
  215. end;
  216. OnTimer50000:
  217. if( $@FlaviusBG1 == 2 )
  218. mapannounce "bat_b01","Battle of Flavius will close in 10 seconds!",1,0x006400;
  219. end;
  220. OnTimer60000:
  221. if( $@FlaviusBG1 != 2 )
  222. end;
  223. OnReset:
  224. stopnpctimer;
  225. donpcevent "Flavius_BG1::OnRoundStop";
  226. set .Guillaume_Score, 0;
  227. set .Guillaume_Crystal, 0;
  228. set .Guillaume_Loss, 0;
  229. set .Croix_Score, 0;
  230. set .Croix_Crystal, 0;
  231. set .Croix_Loss, 0;
  232. set .Match, 0;
  233. set $@FlaviusBG1_Victory, 0;
  234. // NPC's
  235. disablenpc "Guillaume Vintenar#fl1";
  236. disablenpc "Croix Vintenar#fl1";
  237. disablenpc "Therapist in battle#fl11";
  238. disablenpc "Therapist in battle#fl12";
  239. if( $@FlaviusBG1_id1 ) { bg_destroy $@FlaviusBG1_id1; set $@FlaviusBG1_id1, 0; }
  240. if( $@FlaviusBG1_id2 ) { bg_destroy $@FlaviusBG1_id2; set $@FlaviusBG1_id2, 0; }
  241. sleep 1000;
  242. mapwarp "bat_b01","bat_room",155,150;
  243. sleep 2000;
  244. maprespawnguildid "bat_b01",0,3; // Just in case someone else
  245. sleep 2000;
  246. bg_updatescore "bat_b01",0,0;
  247. set $@FlaviusBG1, 0;
  248. donpcevent "Flavius_BG1::OnReadyCheck";
  249. end;
  250. }
  251. // Battleground rewards
  252. // *********************************************************************
  253. bat_b01,390,13,5 script Guillaume Vintenar#fl1 419,{
  254. if( $@FlaviusBG1_Victory )
  255. {
  256. if( $@FlaviusBG1_Victory == Bat_Team )
  257. { // Victory
  258. mes "[Swandery]";
  259. mes "Blessed Guillaume!!";
  260. mes "Let's enjoy our glorious victory!";
  261. mes "" + strcharinfo(0) + ", its a sign reflecting victory";
  262. close2;
  263. set .@Reward, 9;
  264. }
  265. else
  266. { //
  267. mes "[Swandery]";
  268. mes "You lost, but you're dedicated to this battle.";
  269. mes "This is a reward for your great dedication by Guillaume Marollo!";
  270. mes "Just take this defeat a lesson, and later you would definitely learn.";
  271. close2;
  272. set .@Reward, 3;
  273. }
  274. set Flavius_BG_Tick, gettimetick(2) + 300;
  275. getitem 7829, .@Reward;
  276. bg_leave;
  277. warp "bat_room",155,150;
  278. end;
  279. }
  280. end;
  281. }
  282. bat_b01,10,293,5 script Croix Vintenar#fl1 415,{
  283. if( $@FlaviusBG1_Victory )
  284. {
  285. if( $@FlaviusBG1_Victory == Bat_Team )
  286. { // Victory
  287. mes "[Swandery]";
  288. mes "Blessed Croax!!";
  289. mes "Let's enjoy our glorious victory!";
  290. mes "" + strcharinfo(0) + ", its a sign reflecting victory";
  291. close2;
  292. set .@Reward, 9;
  293. }
  294. else
  295. { //
  296. mes "[Swandery]";
  297. mes "Oh, " + strcharinfo(0) + ". Don't be sad.";
  298. mes "Even though we didn't win, we did our best.";
  299. mes "This is a Royal gift from Croix, and please don't forget this battle. We can win the next.";
  300. close2;
  301. set .@Reward, 3;
  302. }
  303. set Flavius_BG_Tick, gettimetick(2) + 300;
  304. getitem 7829, .@Reward;
  305. bg_leave;
  306. warp "bat_room",155,150;
  307. end;
  308. }
  309. end;
  310. }
  311. // Battleground Therapist
  312. // *********************************************************************
  313. bat_b01,390,13,5 script Therapist in battle#fl12 95,{
  314. mes "[Therapist in battle]";
  315. mes "Just close your eyes, and take a deep breathe.";
  316. mes "You can be free from pain.";
  317. specialeffect2 312;
  318. close;
  319. }
  320. bat_b01,10,293,5 script Therapist in battle#fl11 95,{
  321. mes "[Therapist in battle]";
  322. mes "Just close your eyes, and take a deep breathe.";
  323. mes "You can be free from pain.";
  324. specialeffect2 312;
  325. close;
  326. }
  327. // Battleground Respawn
  328. // *********************************************************************
  329. bat_b01,390,10,0 script #gfl1_respawn 139,{
  330. end;
  331. OnBGStart:
  332. initnpctimer;
  333. end;
  334. OnBGStop:
  335. stopnpctimer;
  336. end;
  337. OnTimer24000:
  338. misceffect 83;
  339. end;
  340. OnTimer25000:
  341. areapercentheal "bat_b01",382,2,397,17,100,100;
  342. areawarp "bat_b01",382,2,397,17,"bat_b01",311,224;
  343. initnpctimer;
  344. end;
  345. }
  346. bat_b01,10,290,0 script #cfl1_respawn 139,{
  347. end;
  348. OnBGStart:
  349. initnpctimer;
  350. end;
  351. OnBGStop:
  352. stopnpctimer;
  353. end;
  354. OnTimer24000:
  355. misceffect 83;
  356. end;
  357. OnTimer25000:
  358. areapercentheal "bat_b01",2,282,17,297,100,100;
  359. areawarp "bat_b01",2,282,17,297,"bat_b01",87,75;
  360. initnpctimer;
  361. end;
  362. }
  363. // Flags
  364. // *********************************************************************
  365. bat_b01,304,231,1 duplicate(Guillaume camp#bat) Guillaume camp#bat1 973
  366. bat_b01,319,231,1 duplicate(Guillaume camp#bat) Guillaume camp#bat2 973
  367. bat_b01,304,218,1 duplicate(Guillaume camp#bat) Guillaume camp#bat3 973
  368. bat_b01,319,218,1 duplicate(Guillaume camp#bat) Guillaume camp#bat4 973
  369. bat_b01,304,231,1 duplicate(Guillaume camp#bat) Guillaume camp#bat5 973
  370. bat_b01,304,231,1 duplicate(Guillaume camp#bat) Guillaume camp#bat6 973
  371. bat_b01,335,142,1 duplicate(Guillaume camp#bat) Guillaume camp#bat7 973
  372. bat_b01,335,157,1 duplicate(Guillaume camp#bat) Guillaume camp#bat8 973
  373. bat_b01,390,16,1 duplicate(Guillaume camp#bat) Guillaume camp#bat9 973
  374. bat_b01,292,163,1 duplicate(Guillaume camp#bat) Guillaume camp#bat19 973
  375. bat_b01,292,136,1 duplicate(Guillaume camp#bat) Guillaume camp#bat20 973
  376. bat_b01,241,185,1 duplicate(Guillaume camp#bat) Guillaume camp#bat21 973
  377. bat_b01,247,179,1 duplicate(Guillaume camp#bat) Guillaume camp#bat22 973
  378. bat_b01,96,81,1 duplicate(Croix camp#bat) Croix camp#bat1 974
  379. bat_b01,96,68,1 duplicate(Croix camp#bat) Croix camp#bat2 974
  380. bat_b01,79,81,1 duplicate(Croix camp#bat) Croix camp#bat3 974
  381. bat_b01,79,68,1 duplicate(Croix camp#bat) Croix camp#bat4 974
  382. bat_b01,96,81,1 duplicate(Croix camp#bat) Croix camp#bat5 974
  383. bat_b01,96,81,1 duplicate(Croix camp#bat) Croix camp#bat6 974
  384. bat_b01,59,164,1 duplicate(Croix camp#bat) Croix camp#bat7 974
  385. bat_b01,59,137,1 duplicate(Croix camp#bat) Croix camp#bat8 974
  386. bat_b01,10,296,1 duplicate(Croix camp#bat) Croix camp#bat9 974
  387. bat_b01,110,162,1 duplicate(Croix camp#bat) Croix camp#bat18 974
  388. bat_b01,110,137,1 duplicate(Croix camp#bat) Croix camp#bat19 974
  389. bat_b01,152,120,1 duplicate(Croix camp#bat) Croix camp#bat20 974
  390. bat_b01,158,114,1 duplicate(Croix camp#bat) Croix camp#bat21 974
  391. // MapFlags
  392. // *********************************************************************
  393. bat_b01 mapflag battleground 2
  394. bat_b01 mapflag nomemo
  395. bat_b01 mapflag nosave SavePoint
  396. bat_b01 mapflag noteleport
  397. bat_b01 mapflag nowarp
  398. bat_b01 mapflag nowarpto
  399. bat_b01 mapflag noreturn
  400. bat_b01 mapflag nobranch
  401. bat_b01 mapflag nopenalty