RWC_2012.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. //===== rAthena Script =======================================
  2. //= RWC 2012 Enchants
  3. //===== By: ==================================================
  4. //= Euphy
  5. //===== Current Version: =====================================
  6. //= 1.0
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= [Official Conversion]
  11. //= Adds slots and enchantments to 2012 RWC Memory accessories.
  12. //===== Additional Comments: =================================
  13. //= 1.0 First Version. [Euphy]
  14. //============================================================
  15. prontera,147,61,3 script Driller#pron 87,{
  16. disable_items;
  17. if (checkweight(1201,1) == 0) {
  18. mes "You're carrying too many items in your inventory. Visit Kafra storage and try again.";
  19. close;
  20. }
  21. if (MaxWeight - Weight < 10000) {
  22. mes "You cannot proceed because you're overweight.";
  23. close;
  24. }
  25. set .@part, EQI_ACC_L;
  26. if (!getequipisequiped(.@part)) {
  27. mes "[Driller]";
  28. mes "My job is to drill a card slot into RWC Memorial accessories.";
  29. next;
  30. mes "[Driller]";
  31. mes "I'm sorry but you don't have any item equipped on your right accessory position.";
  32. close;
  33. }
  34. mes "[Driller]";
  35. mes "My job is to drill a card slot into RWC Memorial accessories. Moreover, I only treat ^ff0000pure items^000000, or those which have not been enchanted.";
  36. next;
  37. set .@equip_id, getequipid(.@part);
  38. if (.@equip_id != 2966 && .@equip_id != 2968) {
  39. mes "[Driller]";
  40. mes "However, I can see that the accessory you are wearing on the right side cannot be treated. Please equip a RWC Memorial accessory.";
  41. close;
  42. }
  43. mes "[Driller]";
  44. mes "You should also know that making a card slot it extremely dangerous. ^ff0000Chances to succeed are about 50%.^000000 Do you wish to proceed?";
  45. next;
  46. if(select("Cancel:Let's go!") == 1) {
  47. mes "[Driller]";
  48. mes "See ya then.";
  49. close;
  50. }
  51. if (.@equip_id == 2966) {
  52. set .@slotted, 2967; //RWC_2012_Ring_
  53. set .@name$,"RWC 2012 Memorial Ring";
  54. set .@str$,"ring";
  55. } else if (.@equip_id == 2968) {
  56. set .@slotted, 2969; //RWC_2012_Pendant_
  57. set .@name$,"RWC 2012 Memorial Pendant";
  58. set .@str$,"pendant";
  59. } else {
  60. mes "[Driller]";
  61. mes "I can't identify the accessory item you're wearing on your right hand. I can't work on it.";
  62. close;
  63. }
  64. if (getequipcardid(.@part,3) > 0) {
  65. mes "[Driller]";
  66. mes "This item has already been enchanted. I can't work on this as it is against the rules.";
  67. close;
  68. }
  69. // anti-hack
  70. if (callfunc("F_IsEquipIDHack", .@part, .@equip_id))
  71. close;
  72. delequip .@part;
  73. if (rand(1,10) > 5) {
  74. getitem .@slotted,1;
  75. specialeffect2 EF_REPAIRWEAPON;
  76. mes "[Driller]";
  77. mes "Yay! Success! Your "+.@name$+" now has a card slot. Check it out!";
  78. close;
  79. } else {
  80. specialeffect2 EF_LORD;
  81. mes "[Driller]";
  82. mes "Awww... Damn weak "+.@str$+"... It broke during the procedure. I'm sorry.";
  83. close;
  84. }
  85. }
  86. prontera,147,59,3 script Goldberg#pron 878,{
  87. disable_items;
  88. if (checkweight(1201,1) == 0) {
  89. mes "You are carrying too many items. Come back after you have organized your inventory.";
  90. close;
  91. }
  92. if (MaxWeight - Weight < 10000) {
  93. mes "You cannot proceed because you're overweight.";
  94. close;
  95. }
  96. mes "[Goldberg]";
  97. mes "Hello! I am in charge of enchanting RWC Memorial accessories with some mystic powers.";
  98. next;
  99. set .@part, EQI_ACC_L;
  100. if (!getequipisequiped(.@part)) {
  101. mes "[Goldberg]";
  102. mes "I'm sorry but you don't have any item equipped on your right accessory position.";
  103. close;
  104. }
  105. set .@equip_id, getequipid(.@part);
  106. if (.@equip_id < 2966 || .@equip_id > 2969) {
  107. mes "[Goldberg]";
  108. mes "However, I can see that the accessory you are wearing is not something I can work on. Please equip a RWC Memorial accessory.";
  109. close;
  110. }
  111. set .@select, select("Sorry, not interested.:Please, empower my accessory.:Remove the Enchant.")-1;
  112. if (.@select == 0) {
  113. mes "[Goldberg]";
  114. mes "Alright, then, see you next time...";
  115. close;
  116. }
  117. setarray .@equip_card[0], getequipcardid(.@part,0),getequipcardid(.@part,1),getequipcardid(.@part,2),getequipcardid(.@part,3);
  118. if (.@select == 1) {
  119. switch(getequipid(.@part)) {
  120. case 2966:
  121. setarray .@option[0],2,2,4,4;
  122. break;
  123. case 2967:
  124. setarray .@option[0],0,2,4,4;
  125. break;
  126. case 2968:
  127. setarray .@option[0],1,1,3,3;
  128. break;
  129. case 2969:
  130. setarray .@option[0],0,1,3,3;
  131. break;
  132. default:
  133. mes "[Goldberg]";
  134. mes "I'm sorry, but I cannot work on the accessory you are currently wearing.";
  135. mes "If you have equipped your RWC Memorial accessory on the left side, try to swap it to the right side.";
  136. close;
  137. }
  138. for(set .@i,3; .@i>=0; set .@i,.@i-1) {
  139. if (.@equip_card[.@i] == 0) {
  140. set .@slot, .@i;
  141. set .@op_type, .@option[.@i];
  142. break;
  143. }
  144. }
  145. switch(.@op_type) {
  146. case 4:
  147. mes "[Goldberg]";
  148. mes "Which enchantment would you like to infuse?";
  149. next;
  150. setarray .@enchant_select[0],1,2,3,4;
  151. set .@i, select("Cancel:Fighting Spirit:ATK (%):Max HP:HP")-2;
  152. break;
  153. case 3:
  154. setarray .@enchant_select[0],5,6,7;
  155. set .@i, select("Cancel:Spell:MATK (%):SP")-2;
  156. break;
  157. case 2:
  158. mes "[Goldberg]";
  159. mes "^ff0000Be careful! There is about a 25% chance that the enchantment will fail. If this happens, the item will be destroyed.^000000 Which enchantment would you like to infuse?";
  160. next;
  161. setarray .@enchant_select[0],8,9,10,11,12,13,14;
  162. set .@i, select("Cancel:STR:AGI:VIT:INT:DEX:LUK:SP")-2;
  163. break;
  164. case 1:
  165. mes "[Goldberg]";
  166. mes "^ff0000There is about a 25% chance that the enchantment will fail. If this happens, the item will be destroyed.^000000 Which enchantment would you like to infuse?";
  167. next;
  168. setarray .@enchant_select[0],8,9,10,11,12,13,15,16;
  169. set .@i, select("Cancel:STR:AGI:VIT:INT:DEX:LUK:MHP:HP")-2;
  170. break;
  171. case 0:
  172. mes "[Goldberg]";
  173. mes "Your accessory has received so many enchantments that I can hardly work on it anymore.";
  174. close;
  175. }
  176. if (.@i == -1) {
  177. mes "[Goldberg]";
  178. mes "Alright, then, see you next time.";
  179. close;
  180. }
  181. mes "[Goldberg]";
  182. mes "The power of the enchantment will be randomly chosen. ^ff0000Once infused, the enchantment cannot be removed.^000000 Shall we continue?";
  183. next;
  184. if(select("No, please stop.:Yes, please proceed.") == 1) {
  185. mes "[Goldberg]";
  186. mes "Alright, then, see you next time...";
  187. close;
  188. }
  189. set .@enchant_type, .@enchant_select[.@i];
  190. if (!getequipisequiped(.@part)) {
  191. mes "[Goldberg]";
  192. mes "Do not take off your equipment while I'm working, okay?";
  193. close;
  194. }
  195. switch(.@enchant_type) {
  196. case 1:
  197. setarray .@enc[0],4811,4810,4809; //Fighting_Spirit1,Fighting_Spirit2,Fighting_Spirit3
  198. break;
  199. case 2:
  200. setarray .@enc[0],4819,4766,4767; //Atk1,Atk2,Atk3
  201. break;
  202. case 3:
  203. setarray .@enc[0],4861,4862,4867; //MHP1,MHP2,MHP3
  204. break;
  205. case 4:
  206. setarray .@enc[0],4795,4796,4797; //HP100,HP200,HP300
  207. break;
  208. case 5:
  209. setarray .@enc[0],4760,4761,4806; //Matk1,Matk2,Matk3
  210. break;
  211. case 6:
  212. setarray .@enc[0],4815,4814,4813; //Spell1,Spell2,Spell3
  213. break;
  214. case 7:
  215. setarray .@enc[0],4870,4800,4871; //SP25,SP50,SP75
  216. break;
  217. case 8:
  218. setarray .@enc[0],4700,4701,4702; //Strength1,Strength2,Strength3
  219. break;
  220. case 9:
  221. setarray .@enc[0],4730,4731,4732; //Agility1,Agility2,Agility3
  222. break;
  223. case 10:
  224. setarray .@enc[0],4740,4741,4742; //Vitality1,Vitality2,Vitality3
  225. break;
  226. case 11:
  227. setarray .@enc[0],4710,4711,4712; //Inteligence1,Inteligence2,Inteligence3
  228. break;
  229. case 12:
  230. setarray .@enc[0],4720,4721,4722; //Dexterity1,Dexterity2,Dexterity3
  231. break;
  232. case 13:
  233. setarray .@enc[0],4750,4751,4752; //Luck1,Luck2,Luck3
  234. break;
  235. case 14:
  236. setarray .@enc[0],4870,4800,4871; //SP25,SP50,SP75
  237. break;
  238. case 15:
  239. setarray .@enc[0],4861,4862,4867; //MHP1,MHP2,MHP3
  240. break;
  241. case 16:
  242. setarray .@enc[0],4795,4796,4797; //HP100,HP200,HP300
  243. break;
  244. default:
  245. mes "[Goldberg]";
  246. mes "We have got a problem, let me check it up.";
  247. close;
  248. }
  249. if (.@enchant_type < 8)
  250. set .@i, rand(1,300); // 0% break chance.
  251. else
  252. set .@i, rand(1,400); // 25% break chance.
  253. if (.@i < 151) set .@enchant, .@enc[0];
  254. else if (.@i < 251) set .@enchant, .@enc[1];
  255. else if (.@i < 301) set .@enchant, .@enc[2];
  256. else set .@enchant,9;
  257. // anti-hack
  258. if (callfunc("F_IsEquipIDHack", .@part, .@equip_id) ||
  259. callfunc("F_IsEquipCardHack", .@part, .@equip_card[0], .@equip_card[1], .@equip_card[2], .@equip_card[3]))
  260. close;
  261. set .@equip_card[.@slot], .@enchant;
  262. if (.@slot == 2 && .@enchant == 0) {
  263. set .@equip_card[3],0;
  264. } else if (.@slot == 1 && .@enchant == 0) {
  265. set .@equip_card[2],0;
  266. set .@equip_card[3],0;
  267. } else if (.@slot == 0 && .@enchant == 0) {
  268. set .@equip_card[1],0;
  269. set .@equip_card[2],0;
  270. set .@equip_card[3],0;
  271. }
  272. set .@equip_refine, getequiprefinerycnt(.@part);
  273. delequip .@part;
  274. if (.@enchant == 9) {
  275. mes "[Goldberg]";
  276. mes "Oh gosh!";
  277. mes "The item was not strong enough to bear the enchantment and thus got destroyed. I am sorry.";
  278. specialeffect2 EF_LORD;
  279. close;
  280. }
  281. if (.@enchant == 0) { // Should never happen.
  282. mes "[Goldberg]";
  283. mes "Oh... It looks like there was an instability of some sort between all the powers infused. This caused all the enchantments to vanish. It is a shame, but please try again!";
  284. } else {
  285. mes "[Goldberg]";
  286. mes "Great!";
  287. mes "The enchantment is a success! It will be applied in socket No.^990000"+(.@slot+1)+"^000000.";
  288. specialeffect2 EF_REPAIRWEAPON;
  289. }
  290. // GetNonSlotItemSock2 .@equip_refine .@equip_id .@equip_card[0] .@equip_card[1] .@equip_card[2] .@equip_card[3]
  291. getitem2 .@equip_id,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@equip_card[3];
  292. close;
  293. } else if (.@select == 2) {
  294. mes "[Goldberg]";
  295. mes "I will just initialize the enchant option without doing anything to the slotted card. You wanna continue?";
  296. next;
  297. if(select("I will stop.:Yep, sure, go on.") == 1) {
  298. mes "[Goldberg]";
  299. mes "Come back if you change your mind.";
  300. close;
  301. }
  302. if (countitem(6665) == 0) {
  303. mes "[Goldberg]";
  304. mes "I'm sorry. But you don't have the RWC Initialization coupon. Can you check your inventory?";
  305. close;
  306. }
  307. if (callfunc("F_IsCharm",.@equip_card[3]) == false) {
  308. mes "[Goldberg]";
  309. mes "Hm... this equipment is clean. I cannot initialize it if there's nothing! Check it again.";
  310. close;
  311. }
  312. specialeffect2 EF_REPAIRWEAPON;
  313. mes "[Goldberg]";
  314. mes "The enchant option in your item will be initialized.";
  315. delitem 6665,1; //RWC_Inicializer
  316. delequip .@part;
  317. // GetNonSlotItemSock2 .@equip_refine .@equip_id .@equip_card[0] .@equip_card[1] .@equip_card[2] .@equip_card[3]
  318. for ( .@i = getiteminfo(.@equip_id,10); .@i < MAX_SLOTS; .@i++ ) {
  319. if (callfunc("F_IsCharm",.@equip_card[.@i]) == true)
  320. .@equip_card[.@i] = 0;// Armor Enchant System
  321. }
  322. getitem2 .@equip_id,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@equip_card[3];
  323. close;
  324. }
  325. }