Advertisement
Guest User

Untitled

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