InfiniteSpace_merchants.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. //===== rAthena Script =======================================
  2. //= Infinite Space
  3. //===== Description: =========================================
  4. //= [Walkthrough Conversion]
  5. //= Infinite Space related merchants and enchanter
  6. //===== Changelogs: ==========================================
  7. //= 1.0 Initial release [crazyarashi]
  8. //= 1.1 Removed unecessary use of functions [Everade]
  9. //= 1.2 Added warp scroll merchant [Everade]
  10. //============================================================
  11. // Food Merchant
  12. - shop inf_ration -1,512:-1,513:-1,515:-1,516:-1
  13. cmd_fild07,63,268,1 script Emergency Food Merchant#pa0829_01 4_M_BIBI,{
  14. mes "[Emergency Food Merchant]";
  15. mes "I have a lot of stuff over here, of course, not for free.";
  16. close2;
  17. callshop "inf_ration",1;
  18. end;
  19. }
  20. // Warp Scroll Seller
  21. cmd_fild07,375,167,1 script Ruins Black Trader#pa0829_01 4_F_JOB_HUNTER,{
  22. mes "[Ruins Black Trader]";
  23. mes "Hey, isn't it hard to walk in and out of here every time? For just ^0000ff20,000^000000 Zeny, you can have a scroll that will take you directly to the entrance of the ruins, what do you think?";
  24. Purchase:
  25. next;
  26. switch( select( "Give me one", "I don't think so" )) {
  27. case 1:
  28. if (!checkweight(22980,1) || (MaxWeight - Weight) < 1000) {
  29. mes "You can't proceed with the conversation because you have a large quantity of items.";
  30. mes "Please organize your items and try again.";
  31. close;
  32. }
  33. else if (Zeny < 20000) {
  34. mes "[Ruins Black Trader]";
  35. mes "You don't seem to have any more money. A scroll costs 20,000 Zeny.";
  36. close;
  37. }
  38. Zeny -= 20000;
  39. getitem 22980,1;
  40. mes "[Ruins Black Trader]";
  41. mes "It was a good deal. Need more?";
  42. goto Purchase;
  43. case 2:
  44. mes "[Ruins Black Trader]";
  45. mes "Come back anytime";
  46. close;
  47. }
  48. }
  49. // Equipment Shop
  50. cmd_fild07,57,275,5 script Artifact Appraiser#pa0829_01 1_F_02,{
  51. if (!checkweight(1201,1) || (MaxWeight - Weight) < 1000) {
  52. mes "You can't proceed with the conversation because you have a large quantity of items.";
  53. mes "Please organize your items and try again.";
  54. close;
  55. }
  56. .@stone_id = 6905;
  57. mes "[ Artifact Appraiser ]";
  58. mes "Choose the type of equipment that you want to purchase. You can purchase as many as you want, as long as you have " + getitemname(.@stone_id) + ".";
  59. next;
  60. switch (select("Cancel:Weapons:Armors")) {
  61. case 1:
  62. mes "[ Artifact Appraiser ]";
  63. mes "Please come back whenever you want~";
  64. close;
  65. case 2:
  66. setarray .@equip_id,1994,1938,13323,13126,28703,2024,16038,21014,28105,18128;
  67. .@price = 50;
  68. break;
  69. case 3:
  70. setarray .@equip_id,15141,22075,20779,19033;
  71. .@price = 50;
  72. break;
  73. }
  74. .@menu$ = "Cancel:";
  75. for (.@i = 0; .@i < getarraysize(.@equip_id); .@i++)
  76. .@menu$ += getitemname(.@equip_id[.@i]) + ":";
  77. .@s = select(.@menu$) - 1;
  78. switch (.@s) {
  79. case 0:
  80. mes "[ Artifact Appraiser ]";
  81. mes "Please come back whenever you want~";
  82. close;
  83. default:
  84. .@s--;
  85. mes "[ Artifact Appraiser ]";
  86. mes "You need ^0000FF" + .@price + "^000000 " + getitemname(.@stone_id) + " to purchase the " + getitemname(.@equip_id[.@s]) + "~";
  87. next;
  88. if (select("Cancel:Purchase") == 1) {
  89. mes "[ Artifact Appraiser ]";
  90. mes "Please come back whenever you want~";
  91. close;
  92. }
  93. if (countitem(.@stone_id) < .@price) {
  94. mes "[ Artifact Appraiser ]";
  95. mes "You don't have enough " + getitemname(.@stone_id) + " to purchase this item.";
  96. close;
  97. }
  98. mes "[ Artifact Appraiser ]";
  99. mes "Thank you for your trust. Please come back again next time.";
  100. delitem .@stone_id,.@price;
  101. getitem .@equip_id[.@s],1;
  102. close;
  103. }
  104. }
  105. // Equipment Enchanter
  106. cmd_fild07,60,275,3 script Artifact Enhancer#pa0829_01 4_F_JOB_BLACKSMITH,{
  107. if (!checkweight(1201,1) || (MaxWeight - Weight) < 1000) {
  108. mes "You can't proceed with the conversation because you have a large quantity of items.";
  109. mes "Please organize your items and try again.";
  110. close;
  111. }
  112. disable_items;
  113. .@stone_id = 6905;
  114. function equip_check;
  115. mes "[ Artifact Enhancer ]";
  116. mes "If you're looking to strengthen the equipment that you've obtained in the Infinite Space, you have come to the right place.";
  117. mes "Do you have any " + getitemname(.@stone_id) + "?";
  118. next;
  119. switch (select("How do I enchant my equipment?:Enchant equipment.:Initialize equipment's enchant.")) {
  120. case 1:
  121. mes "[ Artifact Enhancer ]";
  122. mes "You'll be able to obtain " + getitemname(.@stone_id) + ", if you explore the space under the Paros Lighthouse.";
  123. next;
  124. mes "[ Artifact Enhancer ]";
  125. mes "For that material, I can reinforce the equipment that you got from the Infinite Space.";
  126. next;
  127. mes "[ Artifact Enhancer ]";
  128. mes "I can only enchant the 3rd and the 4th slot.";
  129. next;
  130. mes "[ Artifact Enhancer ]";
  131. mes "There is no chance of the equipment being destroyed during the enchanting process, but there's a high probability that it will be destroyed when initializing the enchants.";
  132. next;
  133. mes "[ Artifact Enhancer ]";
  134. mes "Then come visit me when you want to enchant the equipment.";
  135. break;
  136. case 2:
  137. .@stone_id = 6905;
  138. .@fee = 20;
  139. mes "[ Artifact Enhancer ]";
  140. mes "Please select the equipment that you want to enchant.";
  141. next;
  142. switch (select("Cancel:Weapon:Armor:Shoes:Garment:Helm")) {
  143. case 1:
  144. mes "[ Artifact Enhancer ]";
  145. mes "Then come visit me when you want to enchant the equipment.";
  146. close;
  147. case 2:
  148. .@part = EQI_HAND_R;
  149. break;
  150. case 3:
  151. .@part = EQI_ARMOR;
  152. break;
  153. case 4:
  154. .@part = EQI_SHOES;
  155. break;
  156. case 5:
  157. .@part = EQI_GARMENT;
  158. break;
  159. case 6:
  160. .@part = EQI_HEAD_TOP;
  161. break;
  162. }
  163. .@equip_id = getequipid(.@part);
  164. .@refine = getequiprefinerycnt(.@part);
  165. equip_check(.@equip_id);
  166. for (.@i = 0;.@i < 4;.@i++) {
  167. .@card[.@i] = getequipcardid(.@part,.@i);
  168. .@check[.@i] = getequipcardid(.@part,.@i);
  169. }
  170. if (.@card[2] > 0) {
  171. mes "[ Artifact Enhancer ]";
  172. mes "I can only enchant up to the third slot. Your equipment can't be further enchanted.";
  173. close;
  174. }
  175. switch (.@part) {
  176. case EQI_HAND_R:
  177. setarray .@enchant$,
  178. "4700,4701:4710,4711:4720,4721",
  179. "4811,4810,4809,4808,4820,4821,4822,4823:4815,4814,4813,4812,4826,4827,4828,4829:4832,4833,4834,4835,4836,4837,4838,4839";
  180. break;
  181. case EQI_ARMOR:
  182. case EQI_SHOES:
  183. setarray .@enchant$,
  184. "4700,4701,4702,4703:4710,4711,4712,4713:4720,4721,4722,4723",
  185. "4795,4796,4797:4870,4871,4800:4870,4871,4800";
  186. break;
  187. case EQI_GARMENT:
  188. case EQI_HEAD_TOP:
  189. setarray .@enchant$,
  190. "4700,4701,4702,4703:4710,4711,4712,4713:4720,4721,4722,4723",
  191. "4861,4862,4867,4868,4900:4861,4862,4867,4868,4900:4861,4862,4867,4868,4900";
  192. break;
  193. }
  194. .@slot = (.@card[3] > 0 ? 2 : 3);
  195. .@index = (.@slot == 3 ? 0 : 1);
  196. mes "[ Artifact Enhancer ]";
  197. mes "You can choose 3 types of enchant, and the enchant fee is " + .@fee + " " + getitemname(.@stone_id) + ".";
  198. mes "I'll make sure it gets enchanted without a problem.";
  199. next;
  200. .@type = select("Quit:Physical:Magical:Range") - 2;
  201. mes "[ Artifact Enhancer ]";
  202. if (.@slot == 3)
  203. mes "Okay, let's begin the first enchantment.";
  204. else
  205. mes "Okay, let's proceed with the second enchantment.";
  206. next;
  207. if (select("I'll return later.:Please proceed.") == 1) {
  208. mes "[ Artifact Enhancer ]";
  209. mes "If you change your mind, just return to me.";
  210. close;
  211. }
  212. if (countitem(.@stone_id) < .@fee) {
  213. mes "[ Artifact Enhancer ]";
  214. mes "Hm. By the way, I don't think you were listening, you don't have enough " + getitemname(.@stone_id) + ".";
  215. close;
  216. }
  217. explode(.@T$,.@enchant$[.@index],":");
  218. explode(.@TT$,.@T$[.@type],",");
  219. .@enchant = atoi(.@TT$[rand(getarraysize(.@TT$))]);
  220. .@card[.@slot] = .@enchant;
  221. delitem .@stone_id,.@fee;
  222. if (callfunc("F_IsEquipIDHack", .@part, .@equip_id) || callfunc("F_IsEquipRefineHack", .@part, .@refine) || callfunc("F_IsEquipCardHack", .@part, .@check[0], .@check[1], .@check[2], .@check[3]))
  223. close;
  224. delequip .@part;
  225. getitem2 .@equip_id,1,1,.@refine,0,.@card[0],.@card[1],.@card[2],.@card[3];
  226. specialeffect2 EF_REPAIRWEAPON;
  227. mes "[ Artifact Enhancer ]";
  228. mes "Hm. It was well done. Check your equipment at once.";
  229. break;
  230. case 3:
  231. .@stone_id = 6905;
  232. .@fee = 30;
  233. .@break_chance = 30;
  234. mes "[ Artifact Enhancer ]";
  235. mes "Please select the equipment that you want to enchant.";
  236. next;
  237. switch (select("Cancel:Weapon:Armor:Shoes:Garment:Helm")) {
  238. case 1:
  239. mes "[ Artifact Enhancer ]";
  240. mes "Then come visit me when you want to enchant the equipment.";
  241. close;
  242. case 2:
  243. .@part = EQI_HAND_R;
  244. break;
  245. case 3:
  246. .@part = EQI_ARMOR;
  247. break;
  248. case 4:
  249. .@part = EQI_SHOES;
  250. break;
  251. case 5:
  252. .@part = EQI_GARMENT;
  253. break;
  254. case 6:
  255. .@part = EQI_HEAD_TOP;
  256. break;
  257. }
  258. .@equip_id = getequipid(.@part);
  259. .@refine = getequiprefinerycnt(.@part);
  260. equip_check(.@equip_id);
  261. for (.@i = 0; .@i < 4; .@i++) {
  262. .@card[.@i] = getequipcardid(.@part,.@i);
  263. .@check[.@i] = .@card[.@i];
  264. }
  265. if (.@card[3] == 0) {
  266. mes "[ Artifact Enhancer ]";
  267. mes "Your equipment doesn't have any enchant on it.";
  268. close;
  269. }
  270. mes "[ Artifact Enhancer ]";
  271. mes "There is a chance that your infinite space equipment will be destroyed on the initializion process. Are you still willing to proceed?";
  272. next;
  273. if (select("Quit:Proceed") == 1) {
  274. mes "[ Artifact Enhancer ]";
  275. mes "If you change your mind, just return to me.";
  276. close;
  277. }
  278. if (countitem(.@stone_id) < .@fee) {
  279. mes "[ Artifact Enhancer ]";
  280. mes "Hm. By the way, I don't think you were listening, you don't have enough " + getitemname(.@stone_id) + ".";
  281. close;
  282. }
  283. delitem .@stone_id,.@fee;
  284. if (callfunc("F_IsEquipIDHack", .@part, .@equip_id) || callfunc("F_IsEquipRefineHack", .@part, .@refine) || callfunc("F_IsEquipCardHack", .@part, .@check[0], .@check[1], .@check[2], .@check[3]))
  285. close;
  286. delequip .@part;
  287. if (rand(1,100) > .@chance) {
  288. getitem2 .@equip_id,1,1,.@refine,0,.@card[0],.@card[1],0,0;
  289. specialeffect2 EF_REPAIRWEAPON;
  290. mes "[ Artifact Enhancer ]";
  291. mes "Hm. It was well done. Check your equipment at once.";
  292. } else {
  293. specialeffect2 EF_REFINEFAIL;
  294. mes "[ Artifact Enhancer ]";
  295. mes "Well, I did warn you. You aren't lucky, eh?";
  296. }
  297. break;
  298. }
  299. close;
  300. function equip_check {
  301. setarray .@equip_id,1994,1938,13323,13126,28703,2024,16038,21014,28105,18128,15141,22075,20779,19033;
  302. if (!getarg(0)) {
  303. mes "[ Artifact Enhancer ]";
  304. mes "Did you take off your equipment?";
  305. close;
  306. }
  307. if (inarray(.@equip_id,getarg(0)) == -1) {
  308. mes "[ Artifact Enhancer ]";
  309. mes "This equipment is not suitable for enchanting. Don't forget that only the infinite equipment series can be enchanted.";
  310. close;
  311. }
  312. return;
  313. }
  314. }