Advertisement
tioguil

Fallen Angel Wing Enchants

Jul 9th, 2018
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.68 KB | None | 0 0
  1. //===== rAthena Script =======================================
  2. //= Ala de Anjo Caído Não Oficial (FAW) Enchants
  3. //===== By: ==================================================
  4. //= Nerfwood
  5. //===== Current Version: =====================================
  6. //= 1.0
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= Encanta FAW conforme as informações da iROWiki
  11. //= Diálogo não é oficial
  12. //===== Additional Comments: =================================
  13. //= 1.0 First Version
  14. //============================================================
  15.  
  16. //Chance de Encantamento Decrescente
  17. // 60% baixo, 30% médio, 10% alto para 1º e 2º encaixe
  18. //40% baixo, 30% médio, 20% alto, 10% especial para o terceiro slot de encantar
  19.  
  20. - script EnchantStat_1 -1,{
  21.  
  22. .chance = rand(1,10);
  23.  
  24. if(@card2 && @card3) { //Para o 4º entalhe aka ó encantar o entalhe
  25.  
  26. if(.chance<5) .x=0;
  27. else if(.chance<7) .x=1;
  28. else if(.chance<9) .x=2;
  29. else .x=3;
  30.  
  31. }
  32. else { //Para o 2º e 3º cartão, também conhecido como 1º e 2º Slots de Encantar
  33.  
  34. if(.chance<7) .x=0;
  35. else if(.chance<10) .x=1;
  36. else .x=2;
  37. }
  38. return getelementofarray(getvariableofnpc( getd(".enc" + getarg(0) ) , "Valkyrie#faw"), .x );
  39.  
  40. }
  41.  
  42.  
  43.  
  44.  
  45. //Equal Chance of Enchanting
  46.  
  47. - script EnchantStat_0 -1,{
  48. if(@card2 && @card3)
  49. return getelementofarray(getvariableofnpc( getd(".enc" + getarg(0) ) , "Valkyrie#faw"), rand(0,3) );
  50. else
  51. return getelementofarray(getvariableofnpc( getd(".enc" + getarg(0) ) , "Valkyrie#faw"), rand(0,2) );
  52.  
  53. }
  54.  
  55.  
  56. //=======MAIN NPC
  57.  
  58. sec_in02,138,153,3 script Valkyrie#faw 403,{
  59. mes .npc$;
  60. mes "Estou aqui para encantar o",
  61. "magnífico ^000099Fallen Angel Wing^000000.",
  62. "Você gostaria de encantar o seu?";
  63. if(countitem(2589)) {
  64. set .@menu$, "Encantar a Asa do Anjo Caída";
  65. }
  66. else .@menu$="";
  67. next;
  68. switch(select("Information:" + .@menu$ + ":Reset Enchantment"))
  69. {
  70. case 1: goto OnInformation;
  71. case 2: goto OnEnchantNow;
  72. case 3: goto OnResetEnchant;
  73. default: close;
  74. }
  75.  
  76. OnInformation:
  77. mes .npc$,
  78. "I can enchant your",
  79. "^000099Fallen Angel Wing^000000 for",
  80. (.cost?callfunc("F_InsertComma",.cost)+"z":"free")+" to give it various.",
  81. "effects. In fact, I can do it",
  82. "twice if its refinement level is",
  83. "+7 ~ +8, and thrice if its",
  84. "+9 and above.";
  85. next;
  86. mes .npc$,
  87. "The 3rd enchantment has a",
  88. "chance to be more powerful",
  89. "than the first two.";
  90. next;
  91. mes .npc$,
  92. "There is no chance to",
  93. "fail, so enchant away",
  94. "as much as you like.";
  95. next;
  96. mes .npc$,
  97. "But if you're not happy",
  98. "with the results, you can",
  99. "reset the enchantments",
  100. "for ^009900"+ callfunc("F_InsertComma",.cost2) + "z^000000.";
  101. next;
  102. mes .npc$,
  103. "That's about everything.";
  104. close;
  105.  
  106. OnEnchantNow:
  107. mes .npc$;
  108. if( (getequipid(EQI_GARMENT)!=2589) ) {
  109. mes "Please equip your",
  110. "^000099Fallen Angel Wing^000000 if",
  111. "you want to have it enchanted.";
  112. if(!.autoequip) close;
  113. next;
  114. if(select("Equip:Don't Equip")==2) close;
  115. equip 2589;
  116. mes .npc$;
  117. }
  118. .@refeq = getequiprefinerycnt(EQI_GARMENT);
  119. if(.@refeq<7) .@refeq2 = 1;
  120. else if(.@refeq>8) .@refeq2 = 3;
  121. else .@refeq2 = 2;
  122.  
  123. mes "You have a ^000099+" +.@refeq + " Fallen Angel Wing^000000.",
  124. "It can have a total of " + .@refeq2 + " enchantment" +( .@refeq2>1?"s.":".")+" Please";
  125. mes "select your preferred","enchantment.";
  126. next;
  127. setd ".@enc$", select("Fighting Enchant:Magic Enchant:Archer Enchant:Critical/Fatal Enchant:Max HP Enchant:Max SP Enchant:ASPD Enchant:STR Enchant:AGI Enchant:DEX Enchant:VIT Enchant:INT Enchant:LUK Enchant");
  128. if(.cost) callsub OnCostlyEnchant;
  129.  
  130. @card1 = getequipcardid(5,0);
  131. @card2 = getequipcardid(5,1);
  132. @card3 = getequipcardid(5,2);
  133. @card4 = getequipcardid(5,3);
  134.  
  135. if( @card2 && @card3 && @card4) {
  136. mes .npc$,
  137. "Hmm.. it seems that all",
  138. "slots have already been enchanted.";
  139. close;
  140. }
  141.  
  142. .@EnStat = callfunc( (.chancetype?"EnchantStat_1":"EnchantStat_0"), .@enc$) ;
  143.  
  144. if(!@card2) callsub OnFawEnchant , .@EnStat , @card3 , @card4 , .@refeq;
  145. else if(!@card3 && .@refeq>6) callsub OnFawEnchant , @card2 , .@EnStat , @card4 , .@refeq;
  146. else if(!@card4 && .@refeq>8) callsub OnFawEnchant , @card2 , @card3 , .@EnStat , .@refeq;
  147. else {
  148. mes .npc$,
  149. "Sorry, but your",
  150. "^000099Fallen Angel Wing^000000's",
  151. "refinement level is too",
  152. "low to continue";
  153. close;
  154. }
  155.  
  156. mes .npc$,
  157. "Your ^000099Fallen Angel Wing^000000 has",
  158. "been enchanted with ^000099"+getitemname(.@EnStat)+"^000000.";
  159. close;
  160.  
  161. OnFawEnchant:
  162. delitem2 2589, 1, 1, getarg(3), 0, @card1, @card2, @card3, @card4;
  163. getitem2 2589, 1, 1, getarg(3) , 0, @card1, getarg(0), getarg(1), getarg(2);
  164. equip 2589;
  165. specialeffect2 1019;
  166. specialeffect2 98;
  167. return;
  168.  
  169.  
  170. OnResetEnchant:
  171. mes .npc$,
  172. "This will cost " + callfunc("F_InsertComma",.cost2) + "z.",
  173. "Are you sure?";
  174. next;
  175. if(select("Yes:No")==2) close;
  176. mes .npc$;
  177. if(Zeny<1000000) {
  178. mes "You don't have enough zeny.";
  179. close;
  180. }
  181. Zeny -= 1000000;
  182. mes "Your ^000099Fallen Angel Wing^000000's",
  183. "enchantments have been reset.";
  184. .@refeq = getequiprefinerycnt(EQI_GARMENT);
  185. @card1 = getequipcardid(5,0);
  186. @card2 = getequipcardid(5,1);
  187. @card3 = getequipcardid(5,2);
  188. @card4 = getequipcardid(5,3);
  189. delitem2 2589, 1, 1, .@refeq, 0, @card1, @card2, @card3, @card4;
  190. getitem2 2589, 1, 1, .@refeq, 0, @card1, 0, 0, 0;
  191. equip 2589;
  192. specialeffect2 261;
  193. specialeffect2 119;
  194. close;
  195.  
  196. //Only called when .cost is defined
  197. OnCostlyEnchant:
  198. if(Zeny<.cost) {
  199.  
  200. mes .npc$,
  201. "You don't have enough zeny.";
  202. close;
  203. }
  204. Zeny -= .cost;
  205. return;
  206.  
  207.  
  208.  
  209.  
  210. OnInit:
  211. .npc$ = "[^AA0000Valkyrie^000000]";
  212. setarray .enc1[0], 4809,4808,4820, 4821; //Fighting 3~5
  213. setarray .enc2[0], 4812,4826,4827, 4828; //Magic 4~6
  214. setarray .enc3[0], 4832,4833,4834, 4835; //Expert Arc 1~3
  215. setarray .enc4[0], 4863,4864,4865, 4866; //Fatal 1~3
  216. setarray .enc5[0], 4861,4862,4867, 4868; //MHPP 1~3%
  217. setarray .enc6[0], 4870,4800,4871, 4801; //MaxSP 25,50,75
  218. setarray .enc7[0], 4869,4872,4873, 4807; //ASPD 1~3
  219. // setarray .enc7[0], 4869,4872,4873, 4881; //ASPD 1~3
  220. setarray .enc8[0], 4702,4703,4704, 4853; //STR 3~5 | Special Str
  221. setarray .enc9[0], 4731,4732,4733, 4854; //AGI 2~4
  222. setarray .enc10[0], 4722,4723,4724, 4857; //DEX 3~5
  223. setarray .enc11[0], 4742,4743,4744, 4855; //VIT 3~5
  224. setarray .enc12[0], 4712,4713,4714, 4856; //INT 3~5
  225. setarray .enc13[0], 4752,4753,4754, 4858; //LUK 3~5
  226. // 1 = 60% low, 30% mid, 10% high for 1st & 2nd enchant slot && 40% low, 30% mid, 20% high, 10% special for 3rd enchant slot
  227. // 0 = Equal Chance
  228. .chancetype = 1;
  229. //Turn on Equip Selection if garment is unequipped? 1 = Yes
  230. .autoequip =1;
  231. //Cost for Enchanting. It's free in iRO
  232. //.cost=0;
  233. //Cost to reset | Costs 1Mz in iRO
  234. .cost2 = 1000000;
  235. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement