Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 5.00 KB | None | 0 0
  1. //===== eAthena Script =======================================
  2. //= Advanced Refiner
  3. //===== By: ==================================================
  4. //= L0ne_W0lf
  5. //===== Current Version: =====================================
  6. //= 1.4
  7. //===== Compatible With: =====================================
  8. //= Eathena SVN
  9. //===== Description: =========================================
  10. //= [Aegis Conversion]
  11. //= Refiner that uses Enriched ores to increase upgrade success.
  12. //= After a conversation with Doddler, it's been established that
  13. //= the advanced refiner works similar the the "Bubble Gum" item.
  14. //= The success percentage is not "increased" however, if it fails
  15. //= You get a second try. This tries twice at the same time,
  16. //= effectively giving you a re-roll on your attempt.
  17. //= - Dialog is only partly official to iRO.
  18. //= - Uses the iRO position for this NPC.
  19. //===== Additional Comments: =================================
  20. //= 1.0 First Version. [L0ne_W0lf]
  21. //= 1.1 Fixed a weird carriage return. o_o [L0ne_W0lf]
  22. //= 1.2 Optimizing refine method [Zephyrus]
  23. //= 1.3 Typo fixes [Yommy]
  24. //= 1.4 Removed unnecessary dialogs [Zephyrus]
  25. //============================================================
  26.  
  27. payon,174,138,0 script  Suhnbi#cash 85,{
  28.     mes "[Suhnbi]";
  29.     mes "I am the Armsmith";
  30.     mes "I can refine all kinds of weapons,";
  31.     mes "armor and equipment, so let me";
  32.     mes "know what you want to refine.";
  33.     next;
  34.    
  35.     setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
  36.     set .@menu$,"";
  37.     for( set .@i,1; .@i <= 10; set .@i,.@i+1 )
  38.     {
  39.         if( getequipisequiped(.@i) )
  40.             set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";
  41.  
  42.         set .@menu$, .@menu$ + ":";
  43.     }
  44.     set .@part,select(.@menu$);
  45.  
  46.     if( !getequipisequiped(.@part) )
  47.         close;
  48.  
  49.     if( !getequipisenableref(.@part) )
  50.     {
  51.         mes "[Suhnbi]";
  52.         mes "I don't think I can refine this item at all.";
  53.         close;
  54.     }
  55.     if( !getequipisidentify(.@part) )
  56.     {
  57.         mes "[Suhnbi]";
  58.         mes "This has not been identified. So, it can't be refined...";
  59.         close;
  60.     }
  61.     if( getequiprefinerycnt(.@part) >= 10 )
  62.     {
  63.         mes "[Suhnbi]";
  64.         mes "This item cannot be refined because it has already reached its maximum level...";
  65.         close;
  66.     }
  67.  
  68.     // Make sure you have the neccessary items and Zeny to refine your items
  69.     // Determines chance of failure and verifies that you want to continue.
  70.     switch( getequipweaponlv(.@part) )
  71.     {
  72.         case 1: callsub S_RefineValidate,1,7620,50,.@part; break;
  73.         case 2: callsub S_RefineValidate,2,7620,200,.@part; break;
  74.         case 3: callsub S_RefineValidate,3,7620,5000,.@part; break;
  75.         case 4: callsub S_RefineValidate,4,7620,20000,.@part; break;
  76.         default: callsub S_RefineValidate,0,7619,2000,.@part; break;
  77.     }
  78.  
  79.     if( getequippercentrefinery(.@part) > rand(100) || getequippercentrefinery(.@part) > rand(100) )
  80.     {
  81.         mes "[Suhnbi]";
  82.         mes "Clink! Clank! Clunk!";
  83.         SuccessRefItem .@part;
  84.         next;
  85.         Emotion e_no1;
  86.         mes "[Suhnbi]";
  87.         mes "Here you are! It's done.";
  88.         mes "It's been a while since I've made such a fine weapon. You must be happy because it has become stronger!";
  89.         close;
  90.     }
  91.     else
  92.     {
  93.         mes "[Suhnbi]";
  94.         mes "Clink! Clank! Clunk!";
  95.         FailedRefItem .@part;
  96.         next;
  97.         if (rand(5) == 1)
  98.             Emotion e_cash;
  99.         else
  100.             Emotion e_omg;
  101.         mes "[Suhnbi]";
  102.         mes "Cough!!!!";
  103.         next;
  104.         mes "[Suhnbi]";
  105.         mes "Cough...Cough..";
  106.         mes "What a shame...";
  107.         mes "Your equipment broke during the refining process. I had told you earlier this might happen!";
  108.         close;
  109.     }
  110.  
  111. S_RefineValidate:
  112.     mes "[Suhnbi]";
  113.     if (getarg(0))
  114.         mes "A level " + getarg(0) + " weapon...";
  115.     mes "To refine this I need one ^ff9999" + getitemname(getarg(1)) + "^000000 and a service fee of " + getarg(2) + " Zeny.";
  116.     mes "Do you wish to continue?";
  117.     next;
  118.     if( select("Yes:No") == 1 )
  119.     {
  120.         if( getequippercentrefinery(getarg(3)) < 100 )
  121.         {
  122.             mes "[Suhnbi]";
  123.             mes "Wow!!";
  124.             mes "This weapon, probably";
  125.             mes "looks like it's been refined...";
  126.             mes "many times...";
  127.             mes "It may break if";
  128.             mes "you refine it again.";
  129.             next;
  130.             mes "And if it breaks,";
  131.             mes "you can't use it anymore!";
  132.             mes "All the cards in it and the";
  133.             mes "properties";
  134.             mes "^ff0000will be lost^000000!!";
  135.             mes "^ff0000 besides, the equipment will break!^000000";
  136.             mes " ";
  137.             mes "Are you sure you still want to continue?";
  138.             next;
  139.             if( select("Yes:No") == 2 )
  140.             {
  141.                 mes "[Suhnbi]";
  142.                 mes "I completely agree...";
  143.                 mes "I might be a great refiner, but sometimes even I make mistakes.";
  144.                 close;
  145.             }
  146.         }
  147.         if( countitem(getarg(1)) > 0 && Zeny > getarg(2) )
  148.         {
  149.             delitem getarg(1), 1;
  150.             set Zeny, Zeny - getarg(2);
  151.             return;
  152.         }
  153.         else
  154.         {
  155.             mes "[Suhnbi]";
  156.             mes "You don't seem to have enough Zeny or " + getitemname(getarg(1)) + "...";
  157.             mes "Go get some more. I'll be here all day if you need me.";
  158.             close;
  159.         }
  160.     }
  161.     else
  162.     {
  163.         mes "[Suhnbi]";
  164.         mes "Yeah... There's no need to rush.";
  165.         mes "Take your time.";
  166.         close;
  167.     }
  168. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement