Advertisement
Guest User

Enchant and Socket NPC

a guest
Jul 6th, 2015
2,206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.69 KB | None | 0 0
  1. // Enchant and Socket NPC
  2. //============================================================
  3. glast_01,212,273,4 script Hugin's Magic Master 66,{
  4. disable_items;
  5. if (MaxWeight - Weight < 1000) {
  6. mes "Your bag is too heavy. Reduce some weight and come back.";
  7. close;
  8. }
  9. mes "[Hugin's Magic Master]";
  10. mes "So you came to enchant the Temporal Boots. Be aware that Boots with sockets cannot be enchanted, and this upgrade is only possible for the boots you are wearing.";
  11. next;
  12. if (select("How does the enchanting work?","Give effect to my Temporal Boots") == 1) {
  13. mes "[Hugin's Magic Master]";
  14. mes "You can keep obtain ^0000FFCoagulated Spell^000000 through your travel times.";
  15. next;
  16. mes "[Hugin's Magic Master]";
  17. mes "I can enchant your Temporal Boots items depands on the amount of that item. ^0000FFNot normal type boots^000000. Only possible for those 6 expanded version boots.";
  18. next;
  19. mes "[Hugin's Magic Master]";
  20. mes "But, once you put a socket into the item, you cannot enchant it. Make sure to remember that.";
  21. next;
  22. mes "[Hugin's Magic Master]";
  23. mes "I don't give out effect randomly. You can pick which effect you want for the item.";
  24. next;
  25. mes "[Hugin's Magic Master]";
  26. mes "Of course it is for 4th slot only. You can have small effect at the start, and then the effect gets stronger.";
  27. next;
  28. mes "[Hugin's Magic Master]";
  29. mes "To get to the final option upgrade, it will require way more Coagulated Spell items. Don't forget that.";
  30. next;
  31. mes "[Hugin's Magic Master]";
  32. mes "Once the 4th slot completes the best option, you get to have a random bonus effect to the 3rd slot. With.. certain payment~";
  33. next;
  34. mes "[Hugin's Magic Master]";
  35. mes "Also, you don't lose the item even if the enchant fails, we also guarantee keeping card and refine rate. But we can't initialize enchanting.";
  36. next;
  37. mes "[Hugin's Magic Master]";
  38. mes "Phew...";
  39. mes "Anyways, that's all for basic enchant information. Now you should see for yourself.";
  40. close;
  41. }
  42. set .@part,EQI_SHOES;
  43. if (!getequipisequiped(.@part)) {
  44. mes "[Hugin's Magic Master]";
  45. mes "Are you wearing the item?";
  46. close;
  47. }
  48. set .@equip_id,getequipid(.@part);
  49. set .@equip_name$,getequipname(.@part);
  50. set .@card3,getequipcardid(.@part,3);
  51. setarray .@enchant1st[0],4808,4832,4814,4741,4869,4752; //Fighting_Spirit4,Expert_Archer1,Spell2,Vitality2,DelayafterAttack1Lv,Luck3
  52. setarray .@enchant2nd[0],4820,4833,4813,4742,4872,4753; //Fighting_Spirit5,Expert_Archer2,Spell3,Vitality3,DelayafterAttack2Lv,Luck4
  53. setarray .@enchant3rd[0],4821,4834,4812,4861,4873,4754; //Fighting_Spirit6,Expert_Archer3,Spell4,MHP1,DelayafterAttack3Lv,Luck5
  54. setarray .@enchant4th[0],4822,4835,4826,4862,4881,4755; //Fighting_Spirit7,Expert_Archer4,Spell5,MHP2,DelayafterAttack4Lv,Luck6
  55. setarray .@enchant_cost[0],1,4,15,30,10;
  56. switch (.@equip_id) {
  57. case 22000: //Temporal_Str_Boots
  58. case 22001: //Temporal_Int_Boots
  59. case 22002: //Temporal_Agi_Boots
  60. case 22003: //Temporal_Vit_Boots
  61. case 22004: //Temporal_Dex_Boots
  62. case 22005: //Temporal_Luk_Boots
  63. if (!.@card3) { //4th slot 1st try enchanting
  64. set .@cost,.@enchant_cost[0];
  65. set .@number,1;
  66. mes "[Hugin's Magic Master]";
  67. mes "Want to enchant ^0000FF"+.@equip_name$+"^000000?";
  68. mes "For the "+.@number+"st enchanting, you need ^0000FF"+.@cost+"^000000 Coagulated Spell items.";
  69. next;
  70. set .@select,select("Quit","Fighting Spirit","Archery","Spell","Vitality","Attack Speed","Lucky");
  71. switch (.@select) {
  72. case 1:
  73. mes "[Hugin's Magic Master]";
  74. mes "Ok, come back when you are ready.";
  75. close;
  76. case 2:
  77. set .@enchant,.@enchant1st[.@select-2];
  78. break;
  79. case 3:
  80. set .@enchant,.@enchant1st[.@select-2];
  81. break;
  82. case 4:
  83. set .@enchant,.@enchant1st[.@select-2];
  84. break;
  85. case 5:
  86. set .@enchant,.@enchant1st[.@select-2];
  87. break;
  88. case 6:
  89. set .@enchant,.@enchant1st[.@select-2];
  90. break;
  91. case 7:
  92. set .@enchant,.@enchant1st[.@select-2];
  93. break;
  94. }
  95. } else {
  96. if (.@card3 == .@enchant1st[0] || .@card3 == .@enchant1st[1] || .@card3 == .@enchant1st[2] ||
  97. .@card3 == .@enchant1st[3] || .@card3 == .@enchant1st[4] || .@card3 == .@enchant1st[5]) {
  98. set .@cost,.@enchant_cost[1];
  99. set .@number,2;
  100. } else if (.@card3 == .@enchant2nd[0] || .@card3 == .@enchant2nd[1] || .@card3 == .@enchant2nd[2] ||
  101. .@card3 == .@enchant2nd[3] || .@card3 == .@enchant2nd[4] || .@card3 == .@enchant2nd[5]) {
  102. set .@cost,.@enchant_cost[2];
  103. set .@number,3;
  104. } else if (.@card3 == .@enchant3rd[0] || .@card3 == .@enchant3rd[1] || .@card3 == .@enchant3rd[2] ||
  105. .@card3 == .@enchant3rd[3] || .@card3 == .@enchant3rd[4] || .@card3 == .@enchant3rd[5]) {
  106. set .@cost,.@enchant_cost[3];
  107. set .@number,4;
  108. } else if (.@card3 == .@enchant4th[0] || .@card3 == .@enchant4th[1] || .@card3 == .@enchant4th[2] ||
  109. .@card3 == .@enchant4th[3] || .@card3 == .@enchant4th[4] || .@card3 == .@enchant4th[5]) {
  110. set .@card2,getequipcardid(.@part,2);
  111. set .@cost,.@enchant_cost[4];
  112. if (.@card2) {
  113. mes "[Hugin's Magic Master]"; //Custom text
  114. mes "Your shoes have reached the maximum option to enchant.";
  115. mes "Please bring me a new one if you want me to enchant again.";
  116. close;
  117. }
  118. //3rd slot random enchanting
  119. switch (.@card3) {
  120. case 4822: //Fighting_Spirit7
  121. case 4835: //Expert_Archer4
  122. case 4826: //Spell5
  123. case 4862: //MHP2
  124. case 4881: //DelayafterAttack4Lv
  125. case 4755: //Luck6
  126. set .@enchant,callfunc("F_Rand",4875,4876,4877,4878,4879,4880); //Bear's_Power,Runaway_Magic,Speed_Of_Light,Muscle_Fool,Hawkeye,Lucky_Day
  127. mes "[Hugin's Magic Master]"; //Custom text
  128. mes "Seems you already completed the best upgrade option in your 4th slot.";
  129. mes "For that I can give a random bonus effect to your 3rd slot. And of course, with certain payment...";
  130. next;
  131. mes "[Hugin's Magic Master]";
  132. mes "Enchanting ^0000FF"+.@equip_name$+"^000000's 3rd slot for obtaining a random bonus effect. Requires ^0000FF"+.@cost+"^000000 Coagulated Spell items.";
  133. next;
  134. if (select("Quit","Effect Upgrade!") == 1) {
  135. mes "[Hugin's Magic Master]";
  136. mes "Ok, come back when you are ready.";
  137. close;
  138. }
  139. if (countitem(6608) < .@cost) {
  140. mes "[Hugin's Magic Master]";
  141. mes "Hmm, you are missing "+(.@cost - countitem(6608))+" Coagulated Spell items. Go get more, and then we can talk about more enchants.";
  142. close;
  143. }
  144. specialeffect2 EF_REPAIRWEAPON;
  145. set .@equip_refine,getequiprefinerycnt(.@part);
  146. delitem 6608,.@cost; //Coagulated_Spell
  147. delequip .@part;
  148. mes "[Hugin's Magic Master]";
  149. mes "This is it! This special stone is now yours.";
  150. mes "Hahaha... I am really the only master of these things.";
  151. mes "Thank you for believing in me.";
  152. getitem2 .@equip_id,1,1,.@equip_refine,0,0,0,.@enchant,.@card3;
  153. close;
  154. }
  155. }
  156. //4th slot 2nd try enchanting
  157. if (.@card3 == .@enchant1st[0])
  158. set .@enchant,.@enchant2nd[0];
  159. else if (.@card3 == .@enchant1st[1])
  160. set .@enchant,.@enchant2nd[1];
  161. else if (.@card3 == .@enchant1st[2])
  162. set .@enchant,.@enchant2nd[2];
  163. else if (.@card3 == .@enchant1st[3])
  164. set .@enchant,.@enchant2nd[3];
  165. else if (.@card3 == .@enchant1st[4])
  166. set .@enchant,.@enchant2nd[4];
  167. else if (.@card3 == .@enchant1st[5])
  168. set .@enchant,.@enchant2nd[5];
  169. //4th slot 3rd try enchanting
  170. if (.@card3 == .@enchant2nd[0])
  171. set .@enchant,.@enchant3rd[0];
  172. else if (.@card3 == .@enchant2nd[1])
  173. set .@enchant,.@enchant3rd[1];
  174. else if (.@card3 == .@enchant2nd[2])
  175. set .@enchant,.@enchant3rd[2];
  176. else if (.@card3 == .@enchant2nd[3])
  177. set .@enchant,.@enchant3rd[3];
  178. else if (.@card3 == .@enchant2nd[4])
  179. set .@enchant,.@enchant3rd[4];
  180. else if (.@card3 == .@enchant2nd[5])
  181. set .@enchant,.@enchant3rd[5];
  182. //4th slot 4th try enchanting
  183. if (.@card3 == .@enchant3rd[0])
  184. set .@enchant,.@enchant4th[0];
  185. else if (.@card3 == .@enchant3rd[1])
  186. set .@enchant,.@enchant4th[1];
  187. else if (.@card3 == .@enchant3rd[2])
  188. set .@enchant,.@enchant4th[2];
  189. else if (.@card3 == .@enchant3rd[3])
  190. set .@enchant,.@enchant4th[3];
  191. else if (.@card3 == .@enchant3rd[4])
  192. set .@enchant,.@enchant4th[4];
  193. else if (.@card3 == .@enchant3rd[5])
  194. set .@enchant,.@enchant4th[5];
  195. mes "[Hugin's Magic Master]";
  196. mes "Enchanting ^0000FF"+.@equip_name$+"^000000's 4th slot as ^0000FF"+.@number+"^000000 level effect. Requires ^0000FF"+.@cost+"^000000 Coagulated Spell items.";
  197. next;
  198. if (select("Quit","Effect Upgrade!") == 1) {
  199. mes "[Hugin's Magic Master]";
  200. mes "Ok, come back when you are ready.";
  201. close;
  202. }
  203. if (countitem(6608) < .@cost) {
  204. mes "[Hugin's Magic Master]";
  205. mes "Hmm, you are missing "+(.@cost - countitem(6608))+" Coagulated Spell items. Go get more, and then we can talk about more enchants.";
  206. close;
  207. }
  208. }
  209. break;
  210. default:
  211. mes "[Hugin's Magic Master]";
  212. mes "This is not the right item for this enchant.";
  213. mes "Remember, only those 6 types of Temporal Boots are available for enchanting.";
  214. close;
  215. }
  216. specialeffect2 EF_REPAIRWEAPON;
  217. set .@equip_refine,getequiprefinerycnt(.@part);
  218. delitem 6608,.@cost; //Coagulated_Spell
  219. delequip .@part;
  220. mes "[Hugin's Magic Master]";
  221. mes "Trying for enchant number ^630000"+.@number+"^000000.";
  222. getitem2 .@equip_id,1,1,.@equip_refine,0,0,0,0,.@enchant;
  223. close;
  224. }
  225.  
  226. glast_01,210,270,8 script Hugin's Craftsman 726,{
  227. disable_items;
  228. if (MaxWeight - Weight < 1000) {
  229. mes "Your bag is too heavy. Reduce some weight and come back.";
  230. close;
  231. }
  232. mes "[Hugin's Craftsman]";
  233. mes "That Magic Master always says that enchanting Temporal Boots is the best. But, I think quite different.";
  234. next;
  235. mes "[Hugin's Craftsman]";
  236. mes "I think putting a slot into the item would be the best. Even with some risk of failing.";
  237. next;
  238. mes "[Hugin's Craftsman]";
  239. mes "Bring me ^0000FF5 Temporal Crystals^000000, and I will try to put a slot into your advanced Temporal Boots. But, it's possible to ^FF0000fail and break the item^000000. Is that ok?";
  240. next;
  241. if (select("Cancel","Take the risk and try to add a slot") == 1) {
  242. mes "[Hugin's Craftsman]";
  243. mes "Ok, come back anytime you want.";
  244. close;
  245. }
  246. set .@part,EQI_SHOES;
  247. if (!getequipisequiped(.@part)) {
  248. mes "[Hugin's Craftsman]";
  249. mes "Are you sure you are wearing the item?";
  250. close;
  251. }
  252. set .@equip_id,getequipid(.@part);
  253. switch (.@equip_id) {
  254. case 22000: //Temporal_Str_Boots
  255. case 22001: //Temporal_Int_Boots
  256. case 22002: //Temporal_Agi_Boots
  257. case 22003: //Temporal_Vit_Boots
  258. case 22004: //Temporal_Dex_Boots
  259. case 22005: //Temporal_Luk_Boots
  260. mes "[Hugin's Craftsman]";
  261. mes "And ^FF0000all enchant or refine rates will be lost if you fail this.^000000";
  262. mes "Still want to risk it?";
  263. next;
  264. if (select("Cancel","I am ok with it!") == 1) {
  265. mes "[Hugin's Craftsman]";
  266. mes "Ok, come back anytime you want.";
  267. close;
  268. }
  269. mes "[Hugin's Craftsman]";
  270. mes "Once again, ^FF0000That Magic Master won't enchant any item with a slot.^000000";
  271. mes "Still want to proceed?";
  272. next;
  273. if (select("Cancel","I understand. Try to slot it.") == 1) {
  274. mes "[Hugin's Craftsman]";
  275. mes "Ok, come back anytime you want.";
  276. close;
  277. }
  278. if (countitem(6607) < 5) {
  279. mes "[Hugin's Craftsman]";
  280. mes "You must bring ^0000FF5 Temporal Crystal items^000000. Nothing is free you know...";
  281. close;
  282. }
  283. set .@random,rand(1,100);
  284. if (.@random <= 80) { //Custom rates
  285. mes "[Hugin's Craftsman]";
  286. mes "Arrggg, we failed. Better luck next time.";
  287. specialeffect2 EF_PHARMACY_FAIL;
  288. delitem 6607,5; //Temporal_Crystal
  289. delequip .@part;
  290. close;
  291. }
  292. mes "[Hugin's Craftsman]"; //Custom text
  293. mes "Yuhuu~ we succeed. Here you are...";
  294. mes "A slot has been added to your advanced Temporal Boots.";
  295. mes "Thank you for believing in me.";
  296. specialeffect2 EF_PHARMACY_OK;
  297. delitem 6607,5; //Temporal_Crystal
  298. delequip .@part;
  299. if (.@equip_id == 22000) {
  300. getitem 22006,1; //Temporal_Str_Boots_
  301. } else if (.@equip_id == 22001) {
  302. getitem 22009,1; //Temporal_Int_Boots_
  303. } else if (.@equip_id == 22002) {
  304. getitem 22010,1; //Temporal_Agi_Boots_
  305. } else if (.@equip_id == 22003) {
  306. getitem 22007,1; //Temporal_Vit_Boots_
  307. } else if (.@equip_id == 22004) {
  308. getitem 22008,1; //Temporal_Dex_Boots_
  309. } else if (.@equip_id == 22005) {
  310. getitem 22011,1; //Temporal_Luk_Boots_
  311. }
  312. close;
  313. default:
  314. mes "[Hugin's Craftsman]";
  315. mes "This is not it! We need ^0000FFAdvanced Temporal Boots^000000 items! The item ^0000FFwith a stat effect and without a slot^000000!";
  316. close;
  317. }
  318. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement