yuhsing

Untitled

Dec 9th, 2012
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.03 KB | None | 0 0
  1.  
  2.  
  3. - script Mercenary -1,{
  4. function rent_mercenary;
  5.  
  6. OnBowmanMerc: rent_mercenary( 0 ); close;
  7. OnSpearmanMerc: rent_mercenary( 1 ); close;
  8. OnSwordmanMerc: rent_mercenary( 2 ); close;
  9.  
  10. function rent_mercenary {
  11. .@type = getarg(0);
  12.  
  13. if( .@type == 0 ) .@name$ = "Archer";
  14. else if( .@type == 1 ) .@name$ = "Spearman";
  15. else .@name$ = "Swordman";
  16.  
  17. .@faith = mercenary_get_faith( .@type );
  18.  
  19. mes "[Mercenary Manager]";
  20. mes "Welcome to the";
  21. mes .@name$+" Mercenary Guild.";
  22. mes "What can I do for you?";
  23. next;
  24. .@option = select("Hire Mercenary:Mercenary Info:Nothing:10th Grade Mercenaries");
  25. mes "[Mercenary Manager]";
  26. switch( .@option ){
  27. Case 1:
  28. mes "You want to hire a";
  29. mes .@name$+" Mercenary?";
  30. mes "Which Grade were you";
  31. mes "interested in hiring?";
  32. next;
  33.  
  34. .@menu$ = "";
  35. for( .@i = 1; .@i < 10; .@i++ )
  36. .@menu$ = .@menu$ + ( ( .@i == 1 )?"1st":( .@i == 2 )?"2nd":( .@i == 3 )?"3rd": .@i+"th" ) +" Grade "+.@name$+" Mercenary" +":";
  37. .@Grade = select( .@menu$ );
  38.  
  39. .@BaseLevel = ( 5 + ( .@Grade * 10 ) );
  40. if( .@BaseLevel > 90 ) .@BaseLevel = 90;
  41.  
  42. .@ZenyCost = ( 7 * .@Grade );
  43.  
  44. if( .@Grade == 7 ) .@FaithCost = 50;
  45. else if( .@Grade == 8 ) .@FaithCost = 100;
  46. else if( .@Grade == 9 ) .@FaithCost = 300;
  47. else .@FaithCost = 0;
  48.  
  49. mes "[Mercenary Manager]";
  50. mes "So you want to hire a "+( ( .@Grade == 1 )?"1st":( .@Grade == 2 )?"2nd":( .@Grade == 3 )?"3rd":.@Grade+"th" );
  51. mes "Grade "+.@name$+" Mercenary?";
  52. mes "You need to have attained";
  53. mes "Base Level " + .@BaseLevel + " or higher, and";
  54. mes "must pay the " + .@ZenyCost + ",000 zeny fee.";
  55. next;
  56.  
  57. .@option = select("Yes:No");
  58. mes "[Mercenary Manager]";
  59.  
  60. if( .@option == 2 ){
  61. mes "Oh, really? Well, now";
  62. mes "might not be a good time";
  63. mes "for you to consider hiring";
  64. mes "a Mercenary, but please feel";
  65. mes "free to come back if your";
  66. mes "needs change. Thank you~";
  67. }else if( .@FaithCost && .@faith < .@FaithCost ){
  68. mes "Oh... Your Loyalty rating";
  69. mes "with the "+.@name$+" Mercenary";
  70. mes "Guild isn't high enough to";
  71. mes "hire this Mercenary. Please";
  72. mes "come back after you earn";
  73. mes "" + .@FaithCost + " or more Loyalty with us.";
  74. }else if( BaseLevel < .@BaseLevel ){
  75. mes "I'm sorry, but your Base";
  76. mes "Level isn't high enough";
  77. mes "to hire this Mercenary.";
  78. mes "Please come back to me";
  79. mes "once you reach Base Level " + .@BaseLevel + ".";
  80. }else if( Zeny < .@ZenyCost * 1000 ){
  81. mes "I'm sorry, but you";
  82. mes "don't have enough zeny";
  83. mes "to hire this Mercenary.";
  84. mes "The hiring fee is " + .@ZenyCost + ",000 zeny.";
  85. }else{
  86. mes "Great! Our Mercenaries";
  87. mes "are sincere and devoted";
  88. mes "to protecting their clients.";
  89. mes "Summoned Mercenaries will";
  90. mes "offer their support to you for";
  91. mes "30 minutes. Take care now.";
  92. set Zeny, Zeny - (.@ZenyCost * 1000);
  93.  
  94. if( .@type == 0 ) getitem ( 12152 + .@Grade ),1;
  95. else if( .@type == 1 ) getitem ( 12172 + .@Grade ),1;
  96. else getitem ( 12162 + .@Grade ),1;
  97. }
  98. break;
  99. Case 2:
  100. mes "Mercenaries are soldiers";
  101. mes "that will fight at your side";
  102. mes "on the battlefield, but there";
  103. mes "are a few terms and conditions";
  104. mes "you must fulfill to hire them.";
  105. next;
  106. mes "[Mercenary Manager]";
  107. mes "You must fulfill a level";
  108. mes "requirement and pay a zeny";
  109. mes "fee to hire a Mercenary.";
  110. mes "Higher grade Mercenaries";
  111. mes "will also require that you";
  112. mes "build a Loyalty rating with us.";
  113. next;
  114. mes "[Mercenary Manager]";
  115. mes "Mercenary contracts can't be";
  116. mes "transferred to other people,";
  117. mes "and we only allow a 5 Base Level difference between the Mercenary";
  118. mes "and client so you can't hire one much stronger than you.";
  119. next;
  120. mes "[Mercenary Manager]";
  121. mes "Well, you can figure out the";
  122. mes "details when you actually form";
  123. mes "a contract with one of our";
  124. mes "Mercenaries, and receive";
  125. mes "the Summon Scroll that will";
  126. mes "call a Mercenary to your side.";
  127. next;
  128. mes "[Mercenary Manager]";
  129. mes "You can't give this scroll";
  130. mes "to anyone else, and the";
  131. mes "Mercenary will only remain";
  132. mes "with you for 30 minutes after";
  133. mes "you summon him. Don't forget";
  134. mes "about the time limit, okay?";
  135. close;
  136. Case 3:
  137. mes "No? You didn't need any";
  138. mes "help? Well, feel free to";
  139. mes "ask me if you have any";
  140. mes "questions about Mercenaries.";
  141. close;
  142. Case 4:
  143. mes "10th Grade Mercenaries are";
  144. mes "the best we have to offer,";
  145. mes "and we use different criteria";
  146. mes "for our clients to hire them.";
  147. mes "There's no zeny fee, but you";
  148. mes "must have 500 Loyalty.";
  149. next;
  150. mes "[Mercenary Manager]";
  151. mes "Once you make a contract";
  152. mes "with a 10th Grade Mercenary,";
  153. mes "your Loyalty rating will be";
  154. mes "decreased by 400. In other";
  155. mes "words, you pay 400 Loyalty";
  156. mes "to hire a 10th Grade Mercenary.";
  157. next;
  158. mes "[Mercenary Manager]";
  159. mes "You must also be at";
  160. mes "Base Level 90 or higher to";
  161. mes "hire a 10th Grade Mercenary.";
  162. mes "Are you still interested in";
  163. mes "forming this contract?";
  164. next;
  165.  
  166. .@option = select("Yes:No");
  167. mes "[Mercenary Manager]";
  168.  
  169. if( .@option == 2 ){
  170. mes "I understand... It takes";
  171. mes "hard work and sacrifice to";
  172. mes "even reach the point where";
  173. mes "you can hire a 10th Grade";
  174. mes "Mercenary. Have you considered";
  175. mes "hiring a lower grade Mercenary?";
  176. }else if( .@faith < 500 ){
  177. mes "I'm sorry, but your";
  178. mes "Loyalty rating is too";
  179. mes "low to hire a 10th Grade";
  180. mes "Mercenary. You must have";
  181. mes "500 or more Loyalty to";
  182. mes "form a contract with one.";
  183. }else if( BaseLevel < 90 ){
  184. mes "I'm sorry, but you must";
  185. mes "be at Base Level 90 or";
  186. mes "higher to form a contract";
  187. mes "with a 10th Grade Mercenary.";
  188. }else{
  189. mes "Congratulations! It looks";
  190. mes "like you're planning in taking";
  191. mes "on some very dangerous work";
  192. mes "since you're hiring a 10th";
  193. mes "Grade Mercenary. I wish you";
  194. mes "the best of luck with him.";
  195.  
  196. mercenary_set_faith .@type,-400;
  197.  
  198. if( .@type == 0 ) getitem 12162,1;
  199. else if( .@type == 1 ) getitem 12182,1;
  200. else getitem 12172,1;
  201.  
  202. }
  203. break;
  204. }
  205. return;
  206. }
  207.  
  208. }
  209.  
  210.  
  211. // NPC for each Mercenary Guilds...
  212. prontera,41,337,5 script Mercenary Manager#Spear 105,{
  213. doevent "Mercenary::OnSpearmanMerc";
  214. }
  215. pay_arche,99,167,4 script Mercenary Manager#Bow 732,{
  216. doevent "Mercenary::OnBowmanMerc";
  217. }
  218.  
  219. izlude,47,169,5 script Mercenary Manager#Sword 892,{
  220. doevent "Mercenary::OnSwordmanMerc";
  221. }
  222.  
  223.  
  224.  
  225.  
  226. // Mercenary Merchant NPCs
  227. //============================================================
  228. - script MercMerchant -1,{
  229. mes "[Mercenary Goods Merchant]";
  230. mes "Hello, I sell goods";
  231. mes "that Mercenaries can";
  232. mes "use. Is there anything";
  233. mes "in particular that";
  234. mes "you're looking for?";
  235. next;
  236.  
  237. .@menu$ = "";
  238. for( .@i = 0; .@i < .item_size; .@i++ )
  239. .@menu$ = .@menu$ + getitemname( .merc_items[.@i] ) + ":";
  240. .@i = select( .@menu$ ) - 1 ;
  241.  
  242. mes "[Mercenary Goods Merchant]";
  243. mes "^0055FF ~ "+getitemname( .merc_items[.@i] )+"^000000";
  244. mes "each cost ^FF0000"+.merc_costs[.@i]+"^000000 zeny.";
  245. mes "How many would you like?";
  246. input .@input,0,10000;
  247. if( !.@input ){
  248. mes "[Mercenary Goods Merchant]";
  249. mes "You changed your mind?";
  250. mes "Alright, feel free to come";
  251. mes "back to me whenever you want";
  252. mes "to buy any "+getitemname( .merc_items[.@i] )+".";
  253. }else if( set( .@total_po, .@input * .merc_costs[.@i] ) > Zeny ){
  254. mes "[Mercenary Goods Merchant]";
  255. mes "I'm sorry, but you don't";
  256. mes "have enough zeny for this";
  257. mes "many. Well, I'll be";
  258. mes "be here when you're ready";
  259. mes "to purchase something";
  260. mes "for your Mercenaries.";
  261. }else if( checkweight( .merc_items[.@i], .@input ) == 0 ){
  262. mes "[Mercenary Goods Merchant]";
  263. mes "If I gave you that many";
  264. mes "potions, you wouldn't be";
  265. mes "able to carry them with you.";
  266. mes "Please come back after";
  267. mes "you free up some space";
  268. mes "in your Inventory.";
  269. }else{
  270. mes "Here you are, this is exactly";
  271. mes .@input+" "+getitemname( .merc_items[.@i] )+".";
  272. mes "Thank you, and please come";
  273. mes "again when you need more";
  274. mes "for your Mercenaries.";
  275. Zeny -= .@total_po;
  276. getitem getarg(0), .@input;
  277. }
  278. close;
  279.  
  280. OnInit:
  281. setarray .merc_items[0],12184,12185,12241,12242,12243;
  282. setarray .merc_costs[0],1750,3000,560,1050,2100;
  283. .item_size = getarraysize( .merc_items );
  284. end;
  285. }
  286.  
  287. // NPC for each Mercenary Merchant...
  288. prontera,30,337,4 duplicate(MercMerchant) Mercenary Merchant#Spear 700
  289. pay_arche,102,167,5 duplicate(MercMerchant) Mercenary Merchant#Bow 879
  290. izlude,56,169,4 duplicate(MercMerchant) Mercenary Merchant#Sword 892
Advertisement
Add Comment
Please, Sign In to add comment