bg_tierra_01.txt 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. // ==============================================================================
  2. // BattleGround System - Tierra Valley 1
  3. // ==============================================================================
  4. // Registration NPC's
  5. // *********************************************************************
  6. bat_room,85,227,4 script Registration::TV1R_Guillaume 418,{
  7. end;
  8. OnInit:
  9. waitingroom "Battle Station 10 Players",10,"Tierra_BG1::OnGuillaumeJoin",1;
  10. end;
  11. OnEnterBG:
  12. set $@TierraBG1_id1, waitingroom2bg("bat_a01",50,374,"Tierra_BG1::OnGuillaumeQuit","");
  13. end;
  14. }
  15. bat_room,85,204,0 script Registration::TV1R_Croix 414,{
  16. end;
  17. OnInit:
  18. waitingroom "Battle Station 10 Players",10,"Tierra_BG1::OnCroixJoin",1;
  19. end;
  20. OnEnterBG:
  21. set $@TierraBG1_id2, waitingroom2bg("bat_a01",42,16,"Tierra_BG1::OnCroixQuit","");
  22. end;
  23. }
  24. // Battleground Engine
  25. // *********************************************************************
  26. - script Tierra_BG1 -1,{
  27. end;
  28. OnInit:
  29. disablenpc "Croix Vintenar#tv1";
  30. disablenpc "Guillaume Vintenar#tv1";
  31. disablenpc "Therapist in battle#tv11";
  32. disablenpc "Therapist in battle#tv12";
  33. end;
  34. OnGuillaumeQuit:
  35. OnCroixQuit:
  36. set BG_Delay_Tick, gettimetick(2) + 1200;
  37. end;
  38. OnGuillaumeJoin:
  39. OnCroixJoin:
  40. if( $@TierraBG1 == 0 )
  41. donpcevent "Tierra_BG1::OnReadyCheck";
  42. end;
  43. OnReadyCheck:
  44. if( $@TierraBG1 )
  45. end;
  46. set .@Guillaume, getwaitingroomstate(0,"TV1R_Guillaume");
  47. set .@Croix, getwaitingroomstate(0,"TV1R_Croix");
  48. if( .@Guillaume < 10 || .@Croix < 10 )
  49. {
  50. mapannounce "bat_room","Battleground -- Tierra Valley [80-99] G: " + .@Guillaume + "/10, C: " + .@Croix + "/10",1,0xFFA500;
  51. end;
  52. }
  53. set $@TierraBG1, 1;
  54. donpcevent "TV1R_Croix::OnEnterBG";
  55. donpcevent "TV1R_Guillaume::OnEnterBG";
  56. donpcevent "Guillaume_TV1B::OnBuild";
  57. donpcevent "Croix_TV1B::OnBuild";
  58. bg_monster $@TierraBG1_id1,"bat_a01",176,345,"Food Depot",1909,"Tierra_BG1::OnGuillaumeBreak";
  59. bg_monster $@TierraBG1_id2,"bat_a01",167,50,"Food Storage",1910,"Tierra_BG1::OnCroixBreak";
  60. bg_monster 0,"bat_a01",273,204,"Neutrality Flag",1911,"Tierra_BG1::OnNeutralBreak";
  61. set .Neutral_Base, 0;
  62. set $@TierraBG1_Victory, 0;
  63. set .Guardian_1, 0;
  64. set .Guardian_2, 0;
  65. set .Guardian_3, 0;
  66. enablenpc "Therapist in battle#tv11";
  67. enablenpc "Therapist in battle#tv12";
  68. disablenpc "Croix Vintenar#tv1";
  69. disablenpc "Guillaume Vintenar#tv1";
  70. // Respawner
  71. donpcevent "#gtv1_respawn::OnBGStart";
  72. donpcevent "#ctv1_respawn::OnBGStart";
  73. donpcevent "#ntv1_respawn::OnBGStart";
  74. // Warp Teams
  75. announce "Battleground -- Tierra Valley [80-99] has started!",0,0xFFA500;
  76. bg_warp $@TierraBG1_id1,"bat_a01",353,344;
  77. bg_warp $@TierraBG1_id2,"bat_a01",353,52;
  78. // Final Messages
  79. sleep 6000;
  80. mapannounce "bat_a01","Guillaume Vintenar Axl Rose : Let's attack to burn down Croix's food storage",1,0x0000FF;
  81. sleep 2000;
  82. mapannounce "bat_a01","Croix Vintenar Swandery : Master of Valhalla! Let us be gifted with unfailing faith and courage",1,0xFF0000;
  83. initnpctimer;
  84. end;
  85. OnNeutralBreak:
  86. if( getcharid(4) == $@TierraBG1_id1 )
  87. {
  88. mapannounce "bat_a01","Guillaume obtained a neurality banner, so they have an advantage.",1,0x0000FF;
  89. bg_team_setxy $@TierraBG1_id2,42,16;
  90. areawarp "bat_a01",52,208,61,217,"bat_a01",42,16;
  91. }
  92. else if( getcharid(4) == $@TierraBG1_id2 )
  93. {
  94. mapannounce "bat_a01","Croix obtained a neutrality banner, so they have an advantage.",1,0xFF0000;
  95. bg_team_setxy $@TierraBG1_id1,50,374;
  96. areawarp "bat_a01",52,208,61,217,"bat_a01",50,374;
  97. }
  98. else end;
  99. set .Neutral_Base, getcharid(4);
  100. bg_team_setxy .Neutral_Base,56,212;
  101. if( .Guardian_1 == 0 )
  102. set .Guardian_1, bg_monster(.Neutral_Base,"bat_a01",280,233,"Guardian",1949,"Tierra_BG1::OnGuardian1");
  103. else
  104. bg_monster_set_team .Guardian_1, .Neutral_Base;
  105. if( .Guardian_2 == 0 )
  106. set .Guardian_2, bg_monster(.Neutral_Base,"bat_a01",287,203,"Guardian",1950,"Tierra_BG1::OnGuardian2");
  107. else
  108. bg_monster_set_team .Guardian_2, .Neutral_Base;
  109. if( .Guardian_3 == 0 )
  110. set .Guardian_3, bg_monster(.Neutral_Base,"bat_a01",268,204,"Guardian",1949,"Tierra_BG1::OnGuardian3");
  111. else
  112. bg_monster_set_team .Guardian_3, .Neutral_Base;
  113. sleep 10000;
  114. if( $@TierraBG1 != 1 ) end;
  115. if( .Neutral_Base == $@TierraBG1_id1 )
  116. bg_monster .Neutral_Base,"bat_a01",273,204,"Guillaume Flag",1912,"Tierra_BG1::OnNeutralBreak";
  117. else if( .Neutral_Base == $@TierraBG1_id2 )
  118. bg_monster .Neutral_Base,"bat_a01",273,204,"Croix Flag",1913,"Tierra_BG1::OnNeutralBreak";
  119. end;
  120. OnGuardian1: set .Guardian_1, 0; end;
  121. OnGuardian2: set .Guardian_2, 0; end;
  122. OnGuardian3: set .Guardian_3, 0; end;
  123. OnGuillaumeBreak:
  124. set $@TierraBG1_Victory, 2;
  125. mapannounce "bat_a01","Croix Vintenar Swandery: We destroyed Guillaume's food storehause. We won that! Wow!",1,0xFF0000;
  126. donpcevent "Tierra_BG1::OnStop";
  127. end;
  128. OnCroixBreak:
  129. set $@TierraBG1_Victory, 1;
  130. mapannounce "bat_a01","Guillaume Vintenar Axl Rose: We destroyed Croix's food storehause. We won that! Wow!",1,0x0000FF;
  131. donpcevent "Tierra_BG1::OnStop";
  132. end;
  133. OnTimer2400000:
  134. mapannounce "bat_a01","Battle of Tierra Gorge will ends in 5 minutes",1,0xFFA500;
  135. end;
  136. OnTimer2640000:
  137. mapannounce "bat_a01","Battle of Tierra Gorge will ends in 1 minute",1,0xFFA500;
  138. end;
  139. OnTimer2700000:
  140. set $@TierraBG1_Victory, 3; // Draw Game
  141. mapannounce "bat_a01","Battle of Tierra Gorge is over. The time is out, this is a Tie",1,0xFFA500;
  142. donpcevent "Tierra_BG1::OnStop";
  143. end;
  144. OnStop:
  145. set $@TierraBG1, 2;
  146. disablenpc "Therapist in battle#tv11";
  147. disablenpc "Therapist in battle#tv12";
  148. donpcevent "#gtv1_respawn::OnBGStop";
  149. donpcevent "#ctv1_respawn::OnBGStop";
  150. donpcevent "#ntv1_respawn::OnBGStop";
  151. enablenpc "Croix Vintenar#tv1";
  152. enablenpc "Guillaume Vintenar#tv1";
  153. killmonster "bat_a01","Tierra_BG1::OnGuillaumeBreak";
  154. killmonster "bat_a01","Tierra_BG1::OnCroixBreak";
  155. killmonster "bat_a01","Tierra_BG1::OnNeutralBreak";
  156. killmonster "bat_a01","Tierra_BG1::OnGuardian1";
  157. killmonster "bat_a01","Tierra_BG1::OnGuardian2";
  158. killmonster "bat_a01","Tierra_BG1::OnGuardian3";
  159. stopnpctimer;
  160. sleep 3000;
  161. bg_warp $@TierraBG1_id1,"bat_a01",50,374;
  162. bg_warp $@TierraBG1_id2,"bat_a01",42,16;
  163. sleep 3000;
  164. mapannounce "bat_a01","Battle of Tierra Gorge will close in 1 minute!",1,0xFFA500;
  165. initnpctimer;
  166. end;
  167. OnTimer30000:
  168. if( $@TierraBG1 == 2 )
  169. mapannounce "bat_a01","Battle of Tierra Valley will close in 30 seconds!",1,0xFFA500;
  170. end;
  171. OnTimer50000:
  172. if( $@TierraBG1 == 2 )
  173. mapannounce "bat_a01","Battle of Tierra Valley will close in 10 seconds!",1,0xFFA500;
  174. end;
  175. OnTimer60000:
  176. if( $@TierraBG1 != 2 )
  177. end;
  178. OnReset:
  179. stopnpctimer;
  180. set .Neutral_Base, 0;
  181. disablenpc "Croix Vintenar#tv1";
  182. disablenpc "Guillaume Vintenar#tv1";
  183. disablenpc "Therapist in battle#tv11";
  184. disablenpc "Therapist in battle#tv12";
  185. donpcevent "#gtv1_respawn::OnBGStop";
  186. donpcevent "#ctv1_respawn::OnBGStop";
  187. donpcevent "#ntv1_respawn::OnBGStop";
  188. killmonster "bat_a01","Tierra_BG1::OnGuillaumeBreak";
  189. killmonster "bat_a01","Tierra_BG1::OnCroixBreak";
  190. killmonster "bat_a01","Tierra_BG1::OnNeutralBreak";
  191. killmonster "bat_a01","Tierra_BG1::OnGuardian1";
  192. killmonster "bat_a01","Tierra_BG1::OnGuardian2";
  193. killmonster "bat_a01","Tierra_BG1::OnGuardian3";
  194. donpcevent "Guillaume_TV1B::OnDestroy";
  195. donpcevent "Croix_TV1B::OnDestroy";
  196. set $@TierraBG1_Victory, 0;
  197. if( $@TierraBG1_id1 ) { bg_destroy $@TierraBG1_id1; set $@TierraBG1_id1, 0; }
  198. if( $@TierraBG1_id2 ) { bg_destroy $@TierraBG1_id2; set $@TierraBG1_id2, 0; }
  199. sleep 1000;
  200. mapwarp "bat_a01","bat_room",155,150;
  201. sleep 2000;
  202. maprespawnguildid "bat_a01",0,3; // Just in case someone else
  203. sleep 2000;
  204. set $@TierraBG1, 0;
  205. donpcevent "Tierra_BG1::OnReadyCheck"; // Maybe a game is ready to start
  206. end;
  207. }
  208. // MapFlags
  209. // *********************************************************************
  210. bat_a01 mapflag battleground
  211. bat_a01 mapflag nomemo
  212. bat_a01 mapflag nosave SavePoint
  213. bat_a01 mapflag noteleport
  214. bat_a01 mapflag nowarp
  215. bat_a01 mapflag nowarpto
  216. bat_a01 mapflag noreturn
  217. bat_a01 mapflag nobranch
  218. bat_a01 mapflag nopenalty
  219. // Other Flags
  220. // *********************************************************************
  221. bat_a01,148,85,1 duplicate(Croix camp#bat) Croix camp#bat10 974
  222. bat_a01,155,85,1 duplicate(Croix camp#bat) Croix camp#bat11 974
  223. bat_a01,357,75,1 duplicate(Croix camp#bat) Croix camp#bat12 974
  224. bat_a01,348,74,1 duplicate(Croix camp#bat) Croix camp#bat13 974
  225. bat_a01,199,49,1 duplicate(Croix camp#bat) Croix camp#bat14 974
  226. bat_a01,168,16,1 duplicate(Croix camp#bat) Croix camp#bat15 974
  227. bat_a01,138,12,1 duplicate(Croix camp#bat) Croix camp#bat16 974
  228. bat_a01,108,35,1 duplicate(Croix camp#bat) Croix camp#bat17 974
  229. bat_a01,164,308,1 duplicate(Guillaume camp#bat) Guillaume camp#bat10 973
  230. bat_a01,157,308,1 duplicate(Guillaume camp#bat) Guillaume camp#bat11 973
  231. bat_a01,359,327,1 duplicate(Guillaume camp#bat) Guillaume camp#bat12 973
  232. bat_a01,350,326,1 duplicate(Guillaume camp#bat) Guillaume camp#bat13 973
  233. bat_a01,209,344,1 duplicate(Guillaume camp#bat) Guillaume camp#bat14 973
  234. bat_a01,173,380,1 duplicate(Guillaume camp#bat) Guillaume camp#bat15 973
  235. bat_a01,150,380,1 duplicate(Guillaume camp#bat) Guillaume camp#bat16 973
  236. bat_a01,118,357,1 duplicate(Guillaume camp#bat) Guillaume camp#bat17 973
  237. bat_a01,119,336,1 duplicate(Guillaume camp#bat) Guillaume camp#bat18 973
  238. // Barricades
  239. // *********************************************************************
  240. - script Guillaume_TV1B -1,{
  241. end;
  242. OnBuild:
  243. for( set .@i, 0; .@i < 16; set .@i, .@i + 1 )
  244. bg_monster 0,"bat_a01",170+.@i,130,"Barricade",1906,"Guillaume_TV1B::OnWall";
  245. setwall "bat_a01",170,130,16,6,1,"bat_a01_g1";
  246. set .MyMobCount,16;
  247. end;
  248. OnDestroy:
  249. killmonster "bat_a01","Guillaume_TV1B::OnWall";
  250. delwall "bat_a01_g1";
  251. set .MyMobCount,0;
  252. end;
  253. OnWall:
  254. if( set(.MyMobCount,.MyMobCount - 1) < 1 )
  255. {
  256. delwall "bat_a01_g1";
  257. mapannounce "bat_a01","South Gate : The Gate has been Destroy!!",1,0xFFA500;
  258. }
  259. end;
  260. }
  261. - script Croix_TV1B -1,{
  262. end;
  263. OnBuild:
  264. for( set .@i, 0; .@i < 16; set .@i, .@i + 1 )
  265. bg_monster 0,"bat_a01",186+.@i,266,"Barricade",1906,"Croix_TV1B::OnWall";
  266. setwall "bat_a01",186,266,16,6,1,"bat_a01_c1";
  267. set .MyMobCount,16;
  268. end;
  269. OnDestroy:
  270. killmonster "bat_a01","Croix_TV1B::OnWall";
  271. delwall "bat_a01_c1";
  272. set .MyMobCount,0;
  273. end;
  274. OnWall:
  275. if( set(.MyMobCount,.MyMobCount - 1) < 1 )
  276. {
  277. delwall "bat_a01_c1";
  278. mapannounce "bat_a01","North Gate : A Gate has been Destroy!!",1,0xFFA500;
  279. }
  280. end;
  281. }
  282. // Battleground rewards
  283. // *********************************************************************
  284. bat_a01,45,19,3 script Croix Vintenar#tv1 415,{
  285. if( $@TierraBG1_Victory )
  286. {
  287. if( $@TierraBG1_Victory == Bat_Team )
  288. { // Victory
  289. set .@Reward, 3;
  290. mes "[Swandery]";
  291. mes "Blessed Croax!!";
  292. mes "Let's enjoy our glorious victory!";
  293. mes "" + strcharinfo(0) + ", its a sign reflecting victory";
  294. close2;
  295. }
  296. else
  297. { //
  298. set .@Reward, 1;
  299. mes "[Swandery]";
  300. mes "Oh, " + strcharinfo(0) + ". Don't be sad.";
  301. mes "Even though we didn't win, we did our best.";
  302. mes "This is a Royal gift from Croix, and please don't forget this battle. We can win the next.";
  303. close2;
  304. }
  305. set Tierra_BG_Tick, gettimetick(2) + 300;
  306. getitem 7828, .@Reward;
  307. bg_leave;
  308. warp "bat_room",155,150;
  309. end;
  310. }
  311. end;
  312. }
  313. bat_a01,53,377,3 script Guillaume Vintenar#tv1 419,{
  314. if( $@TierraBG1_Victory )
  315. {
  316. if( $@TierraBG1_Victory == Bat_Team )
  317. { // Victory
  318. set .@Reward, 3;
  319. mes "[Swandery]";
  320. mes "Blessed Guillaume!!";
  321. mes "Let's enjoy our glorious victory!";
  322. mes "" + strcharinfo(0) + ", its a sign reflecting victory";
  323. close2;
  324. }
  325. else
  326. { //
  327. set .@Reward, 1;
  328. mes "[Swandery]";
  329. mes "You lost, but you're dedicated to this battle.";
  330. mes "This is a reward for your great dedication by Guillaume Marollo!";
  331. mes "Just take this defeat a lesson, and later you would definitely learn.";
  332. close2;
  333. }
  334. set Tierra_BG_Tick, gettimetick(2) + 300;
  335. getitem 7828, .@Reward;
  336. bg_leave;
  337. warp "bat_room",155,150;
  338. end;
  339. }
  340. end;
  341. }
  342. // Battleground Therapist
  343. // *********************************************************************
  344. bat_a01,60,216,3 script Ghost#tv13 950,{
  345. mes "[Ghost in valley]";
  346. mes "Boo...Boo...";
  347. specialeffect2 312;
  348. close;
  349. }
  350. bat_a01,53,377,3 script Therapist in battle#tv12 95,{
  351. mes "[Therapist in battle]";
  352. mes "Just close your eyes, and take a deep breathe.";
  353. mes "You can be free from pain.";
  354. specialeffect2 312;
  355. close;
  356. }
  357. bat_a01,45,18,3 script Therapist in battle#tv11 95,{
  358. mes "[Therapist in battle]";
  359. mes "Just close your eyes, and take a deep breathe.";
  360. mes "You can be free from pain.";
  361. specialeffect2 312;
  362. close;
  363. }
  364. // Battleground Respawn
  365. // *********************************************************************
  366. bat_a01,57,213,0 script #ntv1_respawn 139,{
  367. end;
  368. OnBGStart:
  369. initnpctimer;
  370. end;
  371. OnBGStop:
  372. stopnpctimer;
  373. end;
  374. OnTimer19000:
  375. misceffect 83;
  376. end;
  377. OnTimer20000:
  378. areapercentheal "bat_a01",52,208,61,217,100,100;
  379. areawarp "bat_a01",52,208,61,217,"bat_a01",301,208;
  380. initnpctimer;
  381. end;
  382. }
  383. bat_a01,50,374,0 script #gtv1_respawn 139,{
  384. end;
  385. OnBGStart:
  386. initnpctimer;
  387. end;
  388. OnBGStop:
  389. stopnpctimer;
  390. end;
  391. OnTimer24000:
  392. misceffect 83;
  393. end;
  394. OnTimer25000:
  395. areapercentheal "bat_a01",46,370,54,378,100,100;
  396. areawarp "bat_a01",46,370,54,378,"bat_a01",354,340;
  397. initnpctimer;
  398. end;
  399. }
  400. bat_a01,42,16,0 script #ctv1_respawn 139,{
  401. end;
  402. OnBGStart:
  403. initnpctimer;
  404. end;
  405. OnBGStop:
  406. stopnpctimer;
  407. end;
  408. OnTimer24000:
  409. misceffect 83;
  410. end;
  411. OnTimer25000:
  412. areapercentheal "bat_a01",38,12,47,21,100,100;
  413. areawarp "bat_a01",38,12,47,21,"bat_a01",354,57;
  414. initnpctimer;
  415. end;
  416. }