yuhsing

Untitled

May 28th, 2013
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.54 KB | None | 0 0
  1. // (c) 2008 - 2012 eAmod Project; Andres Garbanzo / Zephyrus
  2. //
  3. // - Skype: Zephyrus_cr
  4. // - Site: http://dev.terra-gaming.com
  5. //
  6. // This file is NOT public - you are not allowed to distribute it.
  7. // Authorized Server List : http://dev.terra-gaming.com/index.php?/topic/72-authorized-eamod-servers/
  8. // eAmod is a non Free, extended version of eAthena Ragnarok Private Server.
  9.  
  10. // ==============================================================================
  11. // BattleGround System - Common NPCs
  12. // ==============================================================================
  13.  
  14. // Battleground Queue Admin
  15. // *********************************************************************
  16. - script BG_Queue_Join -1,{
  17. end;
  18.  
  19. OnInit:
  20. // Configuration
  21. // *****************************************************
  22. // Battleground Rotation - Main NPC name
  23. setarray .BG_Arenas$[0],"Flavius_TD","Conquest","Rush";
  24. // Battleground Arena Name - for announcements
  25. setarray .BG_Names$[0],"Death Match","Conquest","Rush";
  26. // Minimum Players to start the BG
  27. setarray .BG_Min[0],3,3,3;
  28. // Maximum Players per Team
  29. setarray .BG_Max[0],35,35,35;
  30. // BG Message Colors
  31. setarray .BG_Color$[0],"0xC12283","0x348017","0xE42217";
  32. // Team Building Mode : 0 = Lineal | 1 = Random | 2 = Class Priority | 3 = Faction Mode | 4 = Team Color ( by script set Bat_Team,N; )
  33. set .TeamMode, 0;
  34. // Main Code
  35. // *****************************************************
  36. set .BG_Count, getarraysize(.BG_Arenas$);
  37. set .BG_Queue, bg_queue_create("Battleground Arena","BG_Queue_Join::OnJoinEvent",80);
  38. set .VS_Queue, bg_queue_create("Free For All Arena","BG_Queue_Join::OnVersusJoin",80);
  39. // Move to Next Arena
  40. if( $BG_Index >= .BG_Count ) set $BG_Index,0; // Restart Rotation
  41. set .BG_Arena$,.BG_Arenas$[$BG_Index];
  42. set .Ready, 1;
  43. donpcevent "BG_Queue_Join::OnDoHappyHour";
  44. initnpctimer; // Rotation if BG don't start... Comment if you don't want to use this method
  45.  
  46. // Comment the next two lines if you don't want to allow @joinbg and @leavebg commands.
  47. bindatcmd "joinbg","BG_Queue_Join::OnDoJoin",0,99;
  48. bindatcmd "leavebg","BG_Queue_Join::OnDoLeave",0,99;
  49. end;
  50.  
  51. OnDoJoin: // @joinbg
  52. if( gettime(4) == 0 && gettime(3) >= 16 && gettime(3) < 18 ){
  53. if( BaseLevel < 255 && bg_logincount() > 0 ){
  54. dispbottom "[Battlegrounds] Min required level to join a battleground is 255.";
  55. }
  56. if( checkquest(8506,PLAYTIME) == 2 ){
  57. erasequest 8506;
  58. }else if( checkquest(8506,PLAYTIME) != -1 ){
  59. dispbottom "[You are a Deserter. You can't participate until the indicator goes off]";
  60. }
  61. bg_queue_join .BG_Queue;
  62. }else{
  63. dispbottom "Only available at Sunday 4pm ~ 6pm";
  64. }
  65. end;
  66.  
  67. OnDoLeave: // @leavebg
  68. if( gettime(4) == 0 && gettime(3) >= 16 && gettime(3) < 18 ){
  69. bg_queue_leave .BG_Queue;
  70. }else{
  71. dispbottom "Only available at Sunday 4pm ~ 6pm";
  72. }
  73. end;
  74.  
  75. OnRotate:
  76. OnTimer600000: // Rotation if BG don't start... Comment if you don't want to use this method. 120 = 2 Minutes
  77. set $@BG_Status, 0;
  78. // Warps Teams
  79. bg_warp $@BG_Team1,"volterra",115,174;
  80. bg_warp $@BG_Team2,"volterra",115,174;
  81. bg_warp $@BG_Team3,"volterra",115,174;
  82. // Destroy Teams
  83. bg_destroy $@BG_Team1; set $@BG_Team1, 0;
  84. bg_destroy $@BG_Team2; set $@BG_Team2, 0;
  85. bg_destroy $@BG_Team3; set $@BG_Team3, 0;
  86.  
  87. // Move to Next Arena
  88. if( set($BG_Index,$BG_Index + 1) >= .BG_Count )
  89. set $BG_Index,0; // Restart Rotation
  90.  
  91. set .BG_Arena$,.BG_Arenas$[$BG_Index];
  92. initnpctimer; // Rotation if BG don't start... Comment if you don't want to use this method
  93.  
  94. // Trigger the Event - Maybe people is waiting...
  95. OnJoinEvent:
  96. if( $@BG_Status == 2 )
  97. end; // BG Ending... Must wait until OnRotate is called
  98.  
  99. set .@Queue_Count, bg_queue_data(.BG_Queue,0);
  100. switch( $@BG_Status )
  101. {
  102. case 0: // Idle - Ready to Start
  103. if( .BG_Arena$ == "Tierra_TI" )
  104. set .@Req, .BG_Min[$BG_Index] * 3;
  105. else
  106. set .@Req, .BG_Min[$BG_Index] * 2;
  107.  
  108. if( bg_queue_checkstart(.BG_Queue,.TeamMode,( (.BG_Arena$ == "Tierra_TI") ? 3 : 2 ),.BG_Min[$BG_Index]) )
  109. {
  110. donpcevent .BG_Arena$ + "::OnBuildTeams";
  111.  
  112. // Fill Teams with Queue Members
  113. if( .BG_Arenas$[$BG_Index] == "Tierra_TI" )
  114. bg_queue2teams .BG_Queue,.BG_Min[$BG_Index],.BG_Max[$BG_Index],.TeamMode,$@BG_Team1,$@BG_Team2,$@BG_Team3;
  115. else
  116. bg_queue2teams .BG_Queue,.BG_Min[$BG_Index],.BG_Max[$BG_Index],.TeamMode,$@BG_Team1,$@BG_Team2;
  117.  
  118. stopnpctimer; // Rotation if BG don't start... Comment if you don't want to use this method
  119.  
  120. set $@BG_Status,1;
  121. set .@msg$, "Battleground -- " + .BG_Names$[$BG_Index] + " -- Begining";
  122. bgannounce .@msg$,.BG_Color$[$BG_Index];
  123.  
  124. donpcevent .BG_Arena$ + "::OnReady";
  125. }
  126. else
  127. {
  128. set .@msg$, "Battleground -- " + .BG_Names$[$BG_Index] + " -- " + (.@Req - .@Queue_Count) + " more players to start (@joinbg) if you want to join.";
  129. announce .@msg$,0,.BG_Color$[$BG_Index];
  130. }
  131. break;
  132. case 1: // Running - Others can join
  133. if( .@Queue_Count > 0 )
  134. {
  135. if( .BG_Arena$ == "Tierra_TI" )
  136. {
  137. bg_balance_teams .BG_Queue,.BG_Max[$BG_Index],.TeamMode,$@BG_Team1,$@BG_Team2,$@BG_Team3;
  138. set .@BG_Count1, bg_get_data($@BG_Team1,0);
  139. set .@BG_Count2, bg_get_data($@BG_Team2,0);
  140. set .@BG_Count3, bg_get_data($@BG_Team3,0);
  141. set .@msg$, "Battleground -- " + .BG_Names$[$BG_Index] + " -- B: " + .@BG_Count1 + "/" + .BG_Max[$BG_Index] + ", R: " + .@BG_Count2 + "/" + .BG_Max[$BG_Index] + ", G: " + .@BG_Count3 + "/" + .BG_Max[$BG_Index] + " (Playing)";
  142. }
  143. else
  144. {
  145. bg_balance_teams .BG_Queue,.BG_Max[$BG_Index],.TeamMode,$@BG_Team1,$@BG_Team2;
  146. set .@BG_Count1, bg_get_data($@BG_Team1,0);
  147. set .@BG_Count2, bg_get_data($@BG_Team2,0);
  148. set .@msg$, "Battleground -- " + .BG_Names$[$BG_Index] + " -- B: " + .@BG_Count1 + "/" + .BG_Max[$BG_Index] + ", R: " + .@BG_Count2 + "/" + .BG_Max[$BG_Index] + " (Playing)";
  149. }
  150.  
  151. bgannounce .@msg$,.BG_Color$[$BG_Index];
  152. }
  153. break;
  154. }
  155. end;
  156.  
  157. OnVersusJoin:
  158. if( $@VS_Status != 0 )
  159. end;
  160.  
  161. set .@Queue_Count, bg_queue_data(.VS_Queue,0);
  162. if( .@Queue_Count >= 10 )
  163. {
  164. donpcevent "FFA_Arena::OnBuildTeams";
  165. bg_queue2teams .VS_Queue,1,1,0,$@VS_Team[0],$@VS_Team[1],$@VS_Team[2],$@VS_Team[3],$@VS_Team[4],$@VS_Team[5],$@VS_Team[6],$@VS_Team[7],$@VS_Team[8],$@VS_Team[9];
  166. set $@VS_Status,1;
  167. announce "Battleground -- Free For All -- Begining",0,0x483D8B;
  168. donpcevent "FFA_Arena::OnReady";
  169. }
  170. else
  171. announce "Battleground -- Free For All -- " + (10 - .@Queue_Count) + " more players to start",0,0x483D8B;
  172. end;
  173.  
  174. OnFri0600: // Friday, 6 a.m.
  175. rankreset 1; // Ranking Reset
  176. end;
  177.  
  178. // BattleGround Happy Hour
  179. OnDoHappyHour:
  180. switch( gettime(4) )
  181. {
  182. case 1:
  183. case 3:
  184. case 5:
  185. if( gettime(3) >= 20 && gettime(3) < 22 )
  186. {
  187. announce "-- Battleground Happy Hour has begun | Ranked Arena Mode --",0,0x00FF00;
  188. setbattleflag "bg_reward_rates",200; // +20% Reward Rates
  189. setbattleflag "bg_ranked_mode",1;
  190. end;
  191. }
  192.  
  193. if( gettime(3) == 22 )
  194. {
  195. announce "-- Battleground Happy Hour is over | Regular Arena Mode --",0,0x00BFFF;
  196. setbattleflag "bg_reward_rates",100; // Normal Rates
  197. setbattleflag "bg_ranked_mode",0;
  198. end;
  199. }
  200. break;
  201. case 2:
  202. case 4:
  203. case 6:
  204. if( gettime(3) >= 16 && gettime(3) < 18 )
  205. {
  206. announce "-- Battleground Happy Hour has begun | Ranked Arena Mode --",0,0x00FF00;
  207. setbattleflag "bg_reward_rates",120; // +20% Reward Rates
  208. setbattleflag "bg_ranked_mode",1;
  209. end;
  210. }
  211.  
  212. if( gettime(3) == 18 )
  213. {
  214. announce "-- Battleground Happy Hour is over | Regular Arena Mode --",0,0x00BFFF;
  215. setbattleflag "bg_reward_rates",100; // Normal Rates
  216. setbattleflag "bg_ranked_mode",0;
  217. end;
  218. }
  219. break;
  220. }
  221. end;
  222. }
  223.  
  224. // Registration NPC
  225. // *********************************************************************
  226. - script BG_Register -1,{
  227.  
  228. if( getvariableofnpc(.Ready,"BG_Queue_Join") == 0 )
  229. donpcevent "BG_Queue_Join::OnInit";
  230.  
  231. mes "[^FFA500Battle Recruiter^000000]";
  232. mes "This is the Battleground Information and Registration service.";
  233. mes "What do you want to do?";
  234. next;
  235. switch( select("^FFA500Battleground Arenas^000000:^0000FFFree For All Arena^000000") )
  236. {
  237. case 1:
  238. mes "[^FFA500Battle Recruiter^000000]";
  239. mes "Battlegrounds Arena are different kinds of games where Teams fight for victory.";
  240. mes "What do you want to do?";
  241. next;
  242. switch( select("Register:Party Register:Leave Queue:Battleground Help") )
  243. {
  244. case 1:
  245. if( BaseLevel < 255 && bg_logincount() > 0 )
  246. {
  247. mes "[^FFA500Battle Recruiter^000000]";
  248. mes "Min required level to join a battleground is 255.";
  249. close;
  250. }
  251. if( checkquest(8506,PLAYTIME) == 2 )
  252. erasequest 8506;
  253. if( checkquest(8506,PLAYTIME) != -1 )
  254. {
  255. mes "[^FFA500Battle Recruiter^000000]";
  256. mes "You are a Deserter. You can't participate until the indicator goes off";
  257. close;
  258. }
  259.  
  260. mes "[^FFA500Battle Recruiter^000000]";
  261. mes "Let's proceed with the registration...";
  262. mes "You must wait on any City until BG starts.";
  263. mes "Close this window to continue...";
  264. close2;
  265. bg_queue_join getvariableofnpc(.BG_Queue,"BG_Queue_Join");
  266. end;
  267. case 2:
  268. if( getcharid(1) == 0 )
  269. {
  270. mes "[^FFA500Battle Recruiter^000000]";
  271. mes "You are not on a Party.";
  272. close;
  273. }
  274.  
  275. mes "[^FFA500Battle Recruiter^000000]";
  276. mes "Let's proceed with the registration...";
  277. mes "You must wait on any City until BG starts.";
  278. mes "Close this window to continue...";
  279. close2;
  280. bg_queue_partyjoin getcharid(1),getvariableofnpc(.BG_Queue,"BG_Queue_Join");
  281. end;
  282. case 3:
  283. mes "[^FFA500Battle Recruiter^000000]";
  284. mes "If you are registered, you will be removed.";
  285. mes "Are you sure?";
  286. next;
  287. if( select("Yes, leave queue:No, I will stay") == 2 )
  288. {
  289. mes "[^FFA500Battle Recruiter^000000]";
  290. mes "Ok, nothing to change.";
  291. close;
  292. }
  293.  
  294. mes "[^FFA500Battle Recruiter^000000]";
  295. mes "Close this window to continue...";
  296. close2;
  297. bg_queue_leave getvariableofnpc(.BG_Queue,"BG_Queue_Join");
  298. end;
  299. case 4:
  300. mes "[^FFA500Battle Recruiter^000000]";
  301. mes "Tell me... what battleground you don't understand?";
  302. next;
  303. switch( select("Death Match:Triple Inferno:Conquest:Rush") )
  304. {
  305. case 1:
  306. mes "[^FFA500Battle Recruiter^000000]";
  307. mes "Kill all the enemy players to let their Team without points.";
  308. mes "Protect our army.";
  309. break;
  310. case 2:
  311. mes "[^FFA500Battle Recruiter^000000]";
  312. mes "There are 3 teams in the battlefield, your team and other 2 enemies.";
  313. next;
  314. mes "[^FFA500Battle Recruiter^000000]";
  315. mes "Kill the enemy players, collect the skulls and bring then to the Sacrifice Totem to win points.";
  316. next;
  317. mes "[^FFA500Battle Recruiter^000000]";
  318. mes "You can collect your own team skulls and bring then to your Sacrifice Totem to avoid other teams to score.";
  319. next;
  320. mes "[^FFA500Battle Recruiter^000000]";
  321. mes "If you get killed all your skulls will be drop to the floor, including your own skull. First Team to get 80 points wins the battle.";
  322. break;
  323. case 3:
  324. mes "[^FFA500Battle Recruiter^000000]";
  325. mes "If you are Attacking, destroy the enemy defenses and it's Flag.";
  326. next;
  327. mes "[^FFA500Battle Recruiter^000000]";
  328. mes "If you are Defending, protect your castle defenses and the Flag.";
  329. break;
  330. case 4:
  331. mes "[^FFA500Battle Recruiter^000000]";
  332. mes "Fight to capture the Castle and organize your team to defend it.";
  333. next;
  334. mes "[^FFA500Battle Recruiter^000000]";
  335. mes "If you fail on the first capture, kill the defender and take it for your team.";
  336. break;
  337. }
  338. break;
  339. }
  340. close;
  341. case 2:
  342. mes "[^FFA500Battle Recruiter^000000]";
  343. mes "Free For All Arena is a Duel between 10 players with No Teams.";
  344. mes "The target is to kill 25 players.";
  345. mes "What do you want to do?";
  346. next;
  347. switch( select("Register:Leave Queue") )
  348. {
  349. case 1:
  350. if( BaseLevel < 255 && bg_logincount() > 0 )
  351. {
  352. mes "[^FFA500Battle Recruiter^000000]";
  353. mes "Min required level to join a battleground is 255.";
  354. close;
  355. }
  356. if( checkquest(8506,PLAYTIME) == 2 )
  357. erasequest 8506;
  358. if( checkquest(8506,PLAYTIME) != -1 )
  359. {
  360. mes "[^FFA500Battle Recruiter^000000]";
  361. mes "You are a Deserter. You can't participate until the indicator goes off";
  362. close;
  363. }
  364.  
  365. mes "[^FFA500Battle Recruiter^000000]";
  366. mes "Let's proceed with the registration...";
  367. mes "You must wait on any City until BG starts.";
  368. mes "Close this window to continue...";
  369. close2;
  370. bg_queue_join getvariableofnpc(.VS_Queue,"BG_Queue_Join");
  371. end;
  372. case 2:
  373. mes "[^FFA500Battle Recruiter^000000]";
  374. mes "If you are registered, you will be removed.";
  375. mes "Are you sure?";
  376. next;
  377. if( select("Yes, leave queue:No, I will stay") == 2 )
  378. {
  379. mes "[^FFA500Battle Recruiter^000000]";
  380. mes "Ok, nothing to change.";
  381. close;
  382. }
  383.  
  384. mes "[^FFA500Battle Recruiter^000000]";
  385. mes "Close this window to continue...";
  386. close2;
  387. bg_queue_leave getvariableofnpc(.VS_Queue,"BG_Queue_Join");
  388. end;
  389. }
  390. end;
  391. case 3:
  392. mes "[^FFA500Battle Recruiter^000000]";
  393. mes "May the War God bless you.";
  394. close2;
  395. warp "volterra",115,174;
  396. end;
  397. }
  398. end;
  399. }
  400.  
  401. //bat_room,160,150,3 duplicate(BG_Register) Battle Recruiter#bat 728
  402. // prontera,155,180,4 duplicate(BG_Register) Battle Recruiter#prt 728
  403.  
  404. /**
  405. // General Guillaume
  406. // *********************************************************************
  407. bat_room,160,159,3 script General Guillaume 420,{
  408. cutin "bat_kiyom2",2;
  409. mes "[General Guillaume]";
  410. mes "Hot-blooded adventurer, we need your ability to win this battle.";
  411. next;
  412. cutin "bat_kiyom1",2;
  413. mes "[General Guillaume]";
  414. mes "Our great king, Marcel Marollo VII, is very sick lately. His Majesty has declared that he chosen either me or Prince Croix as the next king amongst his 9 sons.";
  415. next;
  416. mes "[General Guillaume]";
  417. mes "Two kings can't share a nation!";
  418. mes "Only the one victorious from His Majesty's appointed battle will be enthroned.";
  419. next;
  420. mes "[General Guillaume]";
  421. mes "This is however, not just a battle between us. This battle will determine the future of this country. I pledge on my honor to prove that I'm the one who can protect this Maroll from outside threats.";
  422. next;
  423. switch( select("Join the Blue Team","Join the Green Team","End Conversation") )
  424. {
  425. case 1:
  426. cutin "bat_kiyom2",2;
  427. mes "[General Guillaume]";
  428. mes "Welcome to my army, comrade.";
  429. mes "Your eyes tell me that you're a soldier that I can trust.";
  430. set Bat_Team,1;
  431. next;
  432. mes "[General Guillaume]";
  433. mes "Now, go upstairs and apply for battle with your comrades. I'm sure they'll welcome you whole-heartedly!";
  434. break;
  435. case 2:
  436. cutin "bat_kiyom2",2;
  437. mes "[General Guillaume]";
  438. mes "So you will take this fight as your own...";
  439. mes "Then you are my enemy.";
  440. set Bat_Team,0;
  441. next;
  442. mes "[General Guillaume]";
  443. mes "Go now, We will meet again in the Battlefield.";
  444. break;
  445. case 3:
  446. mes "[General Guillaume]";
  447. mes "I'll be the one who will capture the flag!";
  448. break;
  449. }
  450.  
  451. close2;
  452. cutin "",255;
  453. end;
  454. }
  455.  
  456. // General Croix
  457. // *********************************************************************
  458. bat_room,160,140,3 script Prince Croix 416,{
  459. cutin "bat_crua1",2;
  460. mes "[Prince Croix]";
  461. mes "Wise adventurer, why don't you lend us your power for victory?";
  462. next;
  463. cutin "bat_crua2",2;
  464. mes "[Prince Croix]";
  465. mes "I do not wish to shed blood, but I have no choice but to fight for the possibility of peace and for the sake of my people.";
  466. next;
  467. mes "[Prince Croix]";
  468. mes "General Guillaume may have an advantage in this battle as he is the great general of Maroll, but that doesn't automatically mean he'll win. I want to win this battle so that I can grant a better future for my people.";
  469. next;
  470.  
  471. switch( select("Join the Red Team","Join the Green Team","End Conversation") )
  472. {
  473. case 1:
  474. mes "[Prince Croix]";
  475. mes "Thank you so much. I feel like I can win with the help of adventurers like you. Now, please go downstairs and join your comrades in sharpening their skills to fight the enemy!";
  476. set Bat_Team,2;
  477. break;
  478. case 2:
  479. mes "[Prince Croix]";
  480. mes "So you will take this fight as your own...";
  481. mes "Then you are my enemy.";
  482. set Bat_Team,0;
  483. next;
  484. mes "[Prince Croix]";
  485. mes "Go now, We will meet again in the Battlefield.";
  486. break;
  487. case 3:
  488. mes "[Prince Croix]";
  489. mes "For Maroll!";
  490. break;
  491. }
  492.  
  493. close2;
  494. cutin "",255;
  495. end;
  496. }
  497.  
  498. // Guard Dummy
  499. // *********************************************************************
  500.  
  501. bat_room,161,141,3 script Prince Croix's Aid::bat_aid 415,{ end; }
  502. bat_room,161,139,3 duplicate(bat_aid) Prince Croix's Aid::bat_aid2 415
  503. bat_room,161,160,3 duplicate(bat_aid) General Guillaume's Aid::bat_aid3 419
  504. bat_room,161,158,3 duplicate(bat_aid) General Guillaume's Aid::bat_aid4 419
  505. **/
  506. // Flags
  507. // *********************************************************************
  508.  
  509. - script Base Flag#bg -1,{ end; }
  510.  
  511. // BattleGround Warper - Exit
  512. // *********************************************************************
  513. /*
  514. bat_room,148,150,4 script Teleporter#bat 124,{
  515. mes "[Teleporter]";
  516. mes "Do you wish to leave the battlefield? Use my service to return to town.";
  517. next;
  518. if( select("Leave:Don't Leave") == 2 )
  519. {
  520. mes "[Teleporter]";
  521. mes "I'll be here whenever you're in need of my service.";
  522. close;
  523. }
  524.  
  525. switch( @ArenaPVP_out )
  526. {
  527. // Rune Midgard Republic
  528. case 1: warp "prontera",149,92; break;
  529. case 2: warp "payon",165,98; break;
  530. case 3: warp "morocc",153,94; break;
  531. case 4: warp "umbala",121,143; break;
  532. case 5: warp "comodo",196,140; break;
  533. case 6: warp "niflheim",214,193; break;
  534. case 7: warp "aldebaran",143,111; break;
  535. case 8: warp "geffen",107,53; break;
  536. // Schwarzard Republic
  537. case 9: warp "yuno",151,177; break;
  538. case 10: warp "hugel",99,143; break;
  539. case 11: warp "lighthalzen",167,93; break;
  540. case 12: warp "einbroch",70,194; break;
  541. case 13: warp "einbech",168,130; break;
  542. // Arunafelz Republic
  543. case 14: warp "rachel",118,114; break;
  544. case 15: warp "veins",207,122; break;
  545. // Islands
  546. case 16: warp "nameless_n",161,179; break;
  547. case 17: warp "louyang",213,106; break;
  548. case 18: warp "gonryun",154,111; break;
  549. case 19: warp "ayothaya",148,109; break;
  550. case 20: warp "moscovia",229,195; break;
  551. case 21: warp "xmas",151,127; break;
  552. case 22: warp "amatsu",203,107; break;
  553. case 23: warp "izlude",126,114; break;
  554. case 24: warp "brasilis",195,211; break;
  555. case 25: warp "manuk",279,214; break;
  556. case 26: warp "splendide",200,174; break;
  557. // Anyplace else
  558. default:
  559. set .@spoint$, getsavepoint(0);
  560. set .@x, getsavepoint(1);
  561. set .@y, getsavepoint(2);
  562. mes "[Teleporter]";
  563. mes "You will be sent back to " + .@spoint$ + ".";
  564. close2;
  565. warp .@spoint$, .@x, .@y;
  566. break;
  567. }
  568.  
  569. set @ArenaPVP_out, 0;
  570. end;
  571. }
  572.  
  573. // Kafra
  574. // *********************************************************************
  575. bat_room,148,147,4 script Kafra Staff::kaf_bat 861,{
  576. cutin "kafra_09",2;
  577. callfunc "F_KafSetPront";
  578. mes "[Kafra Employee]";
  579. mes "Welcome to the";
  580. mes "Kafra Corporation~";
  581. mes "The Kafra Services are";
  582. mes "always here to support";
  583. mes "you. So how can I be";
  584. mes "of service today?";
  585. callfunc "F_Kafra",5,0,0,40,800;
  586.  
  587. M_Save:
  588. savepoint "bat_room",153,149;
  589. callfunc "F_KafEnd",0,1,"in the city of Prontera";
  590. }
  591. */
  592. // Badges Exchange
  593. // *********************************************************************
  594.  
  595. volterra,117,180,3 script Telma 701,{
  596. mes "[Telma]";
  597. mes "Welcome, mighty warrior.";
  598. mes "Do you need supply for your battles?";
  599. mes "I can exchange you a nice amount for your badges or open the normal StrikeRO Supply Store for you.";
  600. next;
  601. switch( select("^0000FFBattleground Exclusive^000000:^FF0000War of Emperium Exclusive^000000") )
  602. {
  603. case 1: // BG Supply
  604. setarray .@Items[0],607,12028,678,12020,12114,12115,12116,12117,12118,12119,12120,12121,12072,12087,12082,12077,12092,12097;
  605. setarray .@Amount[0],100,100,50,50,50,50,50,50,30,30,30,30,10,10,10,10,10,10;
  606. setarray .@Value[0],3,3,3,2,2,2,2,2,2,2,2,2,5,5,5,5,5,5;
  607. set .@cID, getbattleflag("bg_reserved_char_id");
  608. set .@Tarjet$, "Battleground";
  609. break;
  610. case 2: // WoE Supply Boxs
  611. setarray .@Items[0],607,12028,678,12020,12114,12115,12116,12117,12118,12119,12120,12121,12202,12203,12204,12205,12206,12207,14287,14288;
  612. setarray .@Amount[0],100,100,50,50,50,50,50,50,30,30,30,30,1,1,1,1,1,1,5,5;
  613. setarray .@Value[0],7,7,7,4,4,4,4,4,4,4,4,4,8,8,8,8,8,8,15,15;
  614. set .@cID, getbattleflag("woe_reserved_char_id");
  615. set .@Tarjet$, "War of Emperium";
  616. break;
  617. }
  618.  
  619. set .@Menu$, "";
  620. for( set .@i, 0; .@i < getarraysize(.@Items); set .@i, .@i + 1 )
  621. set .@Menu$, .@Menu$ + .@Amount[.@i] + " " + getitemname(.@Items[.@i]) + " (" + .@Value[.@i] + " badges):";
  622. set .@j, select(.@Menu$) - 1;
  623.  
  624. mes "[Telma]";
  625. mes "^0000FF" + .@Amount[.@j] + " " + getitemname(.@Items[.@j]) + "^000000";
  626. mes "It will cost you " + .@Value[.@j] + " badges per pack.";
  627. mes "Remember this can only be used on " + .@Tarjet$ + ".";
  628. next;
  629.  
  630. mes "[Telma]";
  631. mes "But tell me first, where do you want to receive the items?";
  632. next;
  633. set .@Destiny, select("Here, in my Inventory:Direct to my Storage") - 1;
  634.  
  635. mes "[Telma]";
  636. mes "How many packets do you want to buy? (1..50)";
  637. next;
  638.  
  639. input .@total;
  640. if( .@total < 1 || .@total > 50 )
  641. {
  642. mes "[Telma]";
  643. mes "I am sorry, please input a value from 1 to 50.";
  644. mes "Talk to me again when you do your selections.";
  645. close;
  646. }
  647.  
  648. set .@vtotal, .@total * .@Value[.@j]; // Value of all Packages
  649. set .@total, .@total * .@Amount[.@j]; // Total Amount of Items
  650.  
  651. if( .@Destiny )
  652. { // Check Storage Space Limit
  653. if( .@cID )
  654. {
  655. if( checkspace(.@Items[.@j],.@total,1,0,0,254,0,.@cID&0xffff,(.@cID>>16)&0xffff) == 0 )
  656. {
  657. mes "[Telma]";
  658. mes "It's seen your storage cannot accept more items.";
  659. mes "Go to your store and check the free space.";
  660. close;
  661. }
  662. }
  663. else
  664. {
  665. if( checkspace(.@Items[.@j],.@total,1,0,0,0,0,0,0) == 0 )
  666. {
  667. mes "[Telma]";
  668. mes "It's seen your storage cannot accept more items.";
  669. mes "Go to your store and check the free space.";
  670. close;
  671. }
  672. }
  673. }
  674. else
  675. { // Check Weight Limit
  676. if( checkweight(.@Items[.@j],.@total) == 0 )
  677. {
  678. mes "[Telma]";
  679. mes "It's seen you can't carry the stuff you want to buy.";
  680. mes "Go and store some items on your Kafra Storage.";
  681. close;
  682. }
  683. }
  684.  
  685. if( countitem(7828) + countitem(7829) + countitem(7773) < .@vtotal )
  686. {
  687. mes "[Telma]";
  688. mes "Required Badges: ^0000FF" + .@vtotal + "^000000";
  689. mes "You do not have enough badges. Sorry...";
  690. mes "Participate in Battleground arenas to receive it.";
  691. close;
  692. }
  693. set .@vcount, .@vtotal;
  694. set .@i7828, 0;
  695. set .@i7829, 0;
  696. set .@i7773, 0;
  697.  
  698. // Bravery Badges
  699. if( countitem(7828) > 0 )
  700. {
  701. mes "[Telma]";
  702. mes "Required Badges: ^0000FF" + .@vcount + "^000000";
  703. mes "Bravery Badges to expend:";
  704. next;
  705. input .@i7828;
  706. if( .@i7828 < 0 || .@i7828 > countitem(7828) )
  707. {
  708. mes "[Telma]";
  709. mes "Invalid number... Sorry.";
  710. close;
  711. }
  712.  
  713. if( .@i7828 > .@vcount ) set .@i7828,.@vcount;
  714. set .@vcount, .@vcount - .@i7828;
  715. }
  716.  
  717. // Valor Badges
  718. if( .@vcount && countitem(7829) > 0 )
  719. {
  720. mes "[Telma]";
  721. mes "Required Badges: ^0000FF" + .@vcount + "^000000";
  722. mes "Valor Badges to expend:";
  723. next;
  724. input .@i7829;
  725. if( .@i7829 < 0 || .@i7829 > countitem(7829) )
  726. {
  727. mes "[Telma]";
  728. mes "Invalid number... Sorry.";
  729. close;
  730. }
  731.  
  732. if( .@i7829 > .@vcount ) set .@i7829,.@vcount;
  733. set .@vcount, .@vcount - .@i7829;
  734. }
  735.  
  736. // Heroism Badges
  737. if( .@vcount && countitem(7773) > 0 )
  738. {
  739. mes "[Telma]";
  740. mes "Required Badges: ^0000FF" + .@vcount + "^000000";
  741. mes "Heroism Badges to expend:";
  742. next;
  743. input .@i7773;
  744. if( .@i7773 < 0 || .@i7773 > countitem(7773) )
  745. {
  746. mes "[Telma]";
  747. mes "Invalid number... Sorry.";
  748. close;
  749. }
  750.  
  751. if( .@i7773 > .@vcount ) set .@i7773, .@vcount;
  752. set .@vcount, .@vcount - .@i7773;
  753. }
  754.  
  755. // Final Checks
  756. if( .@vcount != 0 )
  757. {
  758. mes "[Telma]";
  759. mes "Sorry, not enough badges to pay the total value.";
  760. close;
  761. }
  762.  
  763. mes "[Telma]";
  764. mes "Are you ready to pay and receive your items?";
  765. mes "Your payment details:";
  766. mes "^0000FF" + .@i7828 + "^000000 Bravery Badges";
  767. mes "^0000FF" + .@i7829 + "^000000 Valor Badges";
  768. mes "^0000FF" + .@i7773 + "^000000 Heroism Badges";
  769. next;
  770.  
  771. if( select("Yes, let's do it:I am sorry... not this time") == 2 )
  772. {
  773. mes "[Telma]";
  774. mes "Ok, come again if you change your mind.";
  775. close;
  776. }
  777.  
  778. if( .@Destiny )
  779. { // Check Storage Space Limit
  780. if( .@cID )
  781. {
  782. if( checkspace(.@Items[.@j],.@total,1,0,0,254,0,.@cID&0xffff,(.@cID>>16)&0xffff) == 0 )
  783. {
  784. mes "[Telma]";
  785. mes "It's seen your storage cannot accept more items.";
  786. mes "Go to your store and check the free space.";
  787. close;
  788. }
  789. }
  790. else
  791. {
  792. if( checkspace(.@Items[.@j],.@total,1,0,0,0,0,0,0) == 0 )
  793. {
  794. mes "[Telma]";
  795. mes "It's seen your storage cannot accept more items.";
  796. mes "Go to your store and check the free space.";
  797. close;
  798. }
  799. }
  800. }
  801. else
  802. { // Check Weight Limit
  803. if( checkweight(.@Items[.@j],.@total) == 0 )
  804. {
  805. mes "[Telma]";
  806. mes "It's seen you can't carry the stuff you want to buy.";
  807. mes "Go and store some items on your Kafra Storage.";
  808. close;
  809. }
  810. }
  811.  
  812. if( .@i7828 > countitem(7828) || .@i7829 > countitem(7829) || .@i7773 > countitem(7773) )
  813. {
  814. mes "[Telma]";
  815. mes "What!?, are you a magician or a thief? What did you do with your badges!?";
  816. mes "Get out of here!";
  817. close;
  818. }
  819.  
  820. delitem 7828,.@i7828;
  821. delitem 7829,.@i7829;
  822. delitem 7773,.@i7773;
  823.  
  824. if( .@cID )
  825. {
  826. if( .@Destiny )
  827. storeitem2 .@Items[.@j],.@total,1,0,0,254,0,.@cID&0xffff,(.@cID>>16)&0xffff;
  828. else
  829. getitem2 .@Items[.@j],.@total,1,0,0,254,0,.@cID&0xffff,(.@cID>>16)&0xffff;
  830. }
  831. else
  832. {
  833. if( .@Destiny )
  834. storeitem .@Items[.@j],.@total;
  835. else
  836. getitem .@Items[.@j],.@total;
  837. }
  838.  
  839. mes "[Telma]";
  840. mes "Here it is... Now take care and fight for the honor and glory of your prince.";
  841. close;
  842. }
  843.  
  844. volterra,1,1,3,7828 sshop BraveryExchanger 111,4709:1250,4719:1250,4729:1250,4739:1250,4749:1250,4759:1250
  845. volterra,1,1,3,7829 sshop ValorExchanger 111,20060:1000,20061:1000,20062:1000,20063:1000,20064:1000,20065:1000
  846. volterra,1,1,3,7773 sshop HeroismExchanger 111,1309:2000,13414:2000,1224:4000,1225:4000,1228:5000,1230:5000
  847.  
  848. volterra,113,180,3 script Battlegrounds Shop 109,{
  849. mes "[Erundek]";
  850. mes "Welcome, mighty warrior.";
  851. mes "What can I do for you today ?";
  852. next;
  853. switch( select("Bravery Badges Shop","Valor Badges Shop","Battle Badges Shop","Hmm, nothing I guess.") )
  854. {
  855. case 4:
  856. mes "[Erundek]";
  857. mes "As you wish.";
  858. mes "See you later.";
  859. close;
  860. case 1: // Bravery Badges
  861. mes "[Erundek]";
  862. mes "So you want to exchange ^0000FFBravery Badges^000000 from the Battle of Tierra Valley.";
  863. mes "Close this window to open shop.";
  864. close2;
  865. callshop "BraveryExchanger",0;
  866. end;
  867. case 2: // Valor Badges
  868. mes "[Erundek]";
  869. mes "So you want to exchange ^FF0000Valor Badges^000000 from the Battle of Flavius.";
  870. mes "Close this window to open shop.";
  871. close2;
  872. callshop "ValorExchanger",0;
  873. end;
  874. case 3: // Heroism Badges
  875. mes "[Erundek]";
  876. mes "So you want to exchange ^FFA500Heroism Badges^000000 from the Battle of Kriger Von Midgard.";
  877. mes "Close this window to open shop.";
  878. close2;
  879. callshop "HeroismExchanger",0;
  880. end;
  881. }
  882. }
Advertisement
Add Comment
Please, Sign In to add comment