Advertisement
johnlol

Perfect Refiner

Aug 9th, 2023
962
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VeriLog 4.26 KB | Gaming | 0 0
  1. //===== rAthena Script =======================================
  2. //= Perfect Refiner
  3. //===== By: ==================================================
  4. //= SoulDestroyer (souldestroyer1030)
  5. //===== Current Version: =====================================
  6. //= 1.0
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= Refine -refinable- items to whatever level (even downgrade)
  11. //===== Additional Comments: =================================
  12. //= N/A
  13. //============================================================
  14.  
  15. prt_in,291,131,4    script  Legendary Blacksmith    813,{
  16.     disable_items;
  17.     set .@action, 0;
  18.     mes "[Legendary Blacksmith]";
  19.     mes "Heya! I'm the best blacksmith in the whole of Midgard!";
  20.     mes "How can I help you?";
  21.     next;
  22.     switch(select("Upgrade Equipment:Downgrade Equipment:Repair Equipment:Maybe next time.")) {
  23.     case 1:
  24.         set .@action,1;
  25.         break;
  26.     case 2:
  27.         set .@action,2;
  28.         break;
  29.     case 3:
  30.         set .@action,3;
  31.         break;
  32.     default:
  33.         mes "[Legendary Blacksmith]";
  34.         mes "Come back if you change your mind!";
  35.         close;
  36.     }
  37.    
  38.     if (.@action == 1 || .@action == 2) {
  39.         next;
  40.         if (.@action == 1) {
  41.             set actionword$,"upgrade";
  42.         } else if (.@action == 2) {
  43.             set actionword$,"downgrade";
  44.         }
  45.         mes "[Legendary Blacksmith]";
  46.         mes "Choose any of the equipment you're wearing that you'd like to " + actionword$ + ".";
  47.         next;
  48.         setarray .@position$[0], "Accessory L","Accessory R","Shoes","Robe","Head Low","Head Mid","Head Top","Armor","Left hand","Right hand";
  49.         set .@menu$,"";
  50.         for(set .@i,1; .@i<=10; set .@i,.@i+1) {
  51.             if(getequipisequiped(.@i)) {
  52.                 set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";
  53.                 set .@equipped,1;
  54.             }
  55.             set .@menu$, .@menu$ + ":";
  56.         }
  57.         if (.@equipped == 0) {
  58.             mes "[Legendary Blacksmith]";
  59.             mes "What? You're not wearing anything there.";
  60.             close;
  61.         }
  62.         set .@part, select(.@menu$);
  63.         next;
  64.        
  65.         //Check if the item is refinable...
  66.         if(!getequipisenableref(.@part)) {
  67.             mes "[Legendary Blacksmith]";
  68.             mes "Even with my exceptional skill,";
  69.             mes "there are things that just cannot be touched";
  70.             mes "by a blacksmith's hammer.";
  71.             close;
  72.         }
  73.        
  74.         mes "[Legendary Blacksmith]";
  75.         mes "By how much do you want me to " + actionword$ + " this item?";
  76.         input .@refineamount;
  77.         next;
  78.        
  79.         if (.@refineamount == 0) {
  80.             mes "[Legendary Blacksmith]";
  81.             mes "Oh, did you change your mind?";
  82.             close;
  83.         }
  84.        
  85.         set .@refineitem, getequipid(.@part); // save id of the item
  86.         set .@refinelevel,getequiprefinerycnt(.@part); // save refine level of the item
  87.         setarray .@equip_card[0], getequipcardid(.@part,0),getequipcardid(.@part,1),getequipcardid(.@part,2),getequipcardid(.@part,3); // get current cards
  88.  
  89.         if(!getequipisequiped(.@part)) { //custom check
  90.             mes "[Legendary Blacksmith]";
  91.             mes "Please equip the gear that you want me to ";
  92.             mes "work on before coming to me!";
  93.             close;
  94.         }
  95.         //Check to see if the items is already maxed out
  96.         if((.@action == 1 && .@refinelevel >= 20) || (.@action == 2 && .@refinelevel <= 0)) {
  97.             mes "[Legendary Blacksmith]";
  98.             mes "I can no longer work on this.";
  99.             mes "Everything in this world has limits, you know!";
  100.             close;
  101.         }
  102.            
  103.         // anti-hack
  104.         if (callfunc("F_IsEquipIDHack", .@part, .@refineitem) ||
  105.             callfunc("F_IsEquipCardHack", .@part, .@equip_card[0], .@equip_card[1], .@equip_card[2], .@equip_card[3])) {
  106.             mes "[Legendary Blacksmith]";
  107.             mes "You switched gears... while I'm working.";
  108.             mes "That disappoints me more than anything. Go away.";
  109.             close;
  110.         }
  111.        
  112.         if (.@action == 1) {
  113.             successrefitem .@part, .@refineamount;
  114.         } else if (.@action == 2) {
  115.             downrefitem .@part, .@refineamount;
  116.         }
  117.         mes "[Legendary Blacksmith]";
  118.         mes "Clang! Clang! Clang!";
  119.         next;
  120.         mes "[Legendary Blacksmith]";
  121.         mes "It's things like these that make me really proud";
  122.         mes "of who and what I am. Perfection!";
  123.         close;
  124.     }
  125.     else if (.@action == 3) {
  126.         next;
  127.         mes "[Legendary Blacksmith]";
  128.         mes "Okay, let me have a look at your equipment...";
  129.         next;
  130.         repairall getcharid(0);
  131.         mes "[Legendary Blacksmith]";
  132.         mes "There you go, I've repaired everything that needs repairing!";
  133.         close;
  134.     }
  135.     close;
  136. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement