mercenary_rent.txt 9.7 KB

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