viewing paste Unknown #24967 | Text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297
//= If you enable this function make sure you set the appropiate +x Level in your refine_db.txt
//= to 100 and adjust the .@safe Value in the Script to your desired max. Safe Level.
//= Otherwise it won't work .
//============================================================
function    script  refinemain  {
    set .@features,getarg(1);
    mes "[" + getarg(0) + "]";
    mes "I'm the Armsmith.";
    mes "I can refine all kinds of weapons, armor and equipment, so let me";
    mes "know what you want me to refine.";
    next;
    setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
    set .@menu$,"";
    for( set .@i,1; .@i <= 10; set .@i,.@i+1 )
    {
        if( getequipisequiped(.@i) )
            set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";
        set .@menu$, .@menu$ + ":";
    }
    set .@part,select(.@menu$);
    if(!getequipisequiped(.@part)) {
        mes "[" + getarg(0) + "]";
        mes "You're not wearing";
        mes "anything there that";
        mes "I can refine.";
        emotion 6;
        close;
    }
    //Check if the item is refinable...
    if(!getequipisenableref(.@part)) {
        mes "[" + getarg(0) + "]";
        mes "I don't think I can";
        mes "refine this item at all...";
        close;
    }
    //Check if the item is identified... (Don't know why this is in here... but kept it anyway)
    if(!getequipisidentify(.@part)) {
        mes "[" + getarg(0) + "]";
        mes "You can't refine this";
        mes "if you haven't appraised";
        mes "it first. Make sure your";
        mes "stuff is identified before";
        mes "I can refine it.";
        close;
    }
    //Check to see if the items is already +10
    if(getequiprefinerycnt(.@part) >= 10) {
        mes "[" + getarg(0) + "]";
        mes "I can't refine this";
        mes "any more. This is as";
        mes "refined as it gets!";
        close;
    }
    set .@refineitemid, getequipid(.@part); // save id of the item
    set .@refinerycnt, getequiprefinerycnt(.@part); //save refinery count
    switch(getequipweaponlv(.@part)){
    case 0:  //Refine Armor
        set .@price,2000;
        set .@material,985;
        set .@safe,7;
        break;
    case 1:  //Refine Level 1 Weapon
        set .@price,50;
        set .@material,1010;
        set .@safe,7;
        break;
    case 2:  //Refine Level 2 Weapon
        set .@price,200;
        set .@material,1011;
        set .@safe,7;
        break;
    case 3:  //Refine Level 3 Weapon
        set .@price,5000;
        set .@material,984;
        set .@safe,7;
        break;
    case 4:  //Refine Level 4 Weapon
        set .@price,20000;
        set .@material,984;
        set .@safe,7;
        break;
    case 5:  //Refine other stuff?
        set .@price,2000;
        set .@material,985;
        set .@safe,7;
        break;
    }
    if(.@features != 1) {
        mes "[" + getarg(0) + "]";
        mes "To refine this I need";
        mes "one ^003366"+getitemname(.@material)+"^000000 and";
        mes "a service fee of " + .@price + " Zeny.";
        mes "Do you really wish to continue?";
        next;
        if(select("Yes:No") == 2){
            mes "[" + getarg(0) + "]";
            mes "Yeah...";
            mes "There's no need to";
            mes "rush. Take your time.";
            close;
        }
        if(getequippercentrefinery(.@part) < 100) {
            mes "[" + getarg(0) + "]";
            mes "Oh no! If I continue to";
            mes "refine this, there's a risk it could";
            switch(.@material) {
            case 985:
                mes "be destroyed! That means that ^FF0000this equipment^000000, and ^FF0000any cards^000000 or special properties added to this armor, ^FF0000will be gone^000000.";
                break;
            default:
                mes "be destroyed, and you'd ^FF0000lose the weapon^000000, any ^FF0000cards in the weapon^000000,";
                mes "or any added special properties.";
                break;
            }
            next;
            mes "["+getarg(0)+"]";
            mes "I can't make it any clearer.";
            mes "Once a weapon is destroyed,";
            mes "there's no getting it back.";
            mes "You really have a chance to";
            mes "^FF0000lose this weapon^000000 forever.";
            mes "Do you still want to refine?";
            next;
            if(select("Yes:No") == 2){
                mes "[" + getarg(0) + "]";
                mes "I completely agree...";
                mes "I might be a great refiner, but sometimes even I make mistakes.";
                close;
            }
        }
        if((countitem(.@material) < 1) || (Zeny < .@price)) {
            mes "[" + getarg(0) + "]";
            mes "You don't seem to have";
            mes "enough Zeny or "+getitemname(.@material)+"...";
            mes "Go get some more. I'll be";
            mes "here all day if you need me.";
            close;
        }
        set Zeny,Zeny-.@price;
        delitem .@material,1;
        if(getequipisequiped(.@part) == 0) { // hacker has removed the item (not changed, why?)
            mes "[" + getarg(0) + "]";
            mes "Look here... you don't have any Items on...";
            close;
        }
        if(getequiprefinerycnt(.@part) != .@refinerycnt || getequipid(.@part) != .@refineitemid) { // hacker has changed the item
            mes "[" + getarg(0) + "]";
            Emotion e_an;
            mes "Wait a second...";
            mes "Do you think I'm stupid?!";
            mes "You switched the item while I wasn't looking! Get out of here!";
            close;
        }
        if(getequippercentrefinery(.@part) <= rand(100)) {
            failedrefitem .@part;
            mes "[" + getarg(0) + "]";
            set .@emo,rand(1,5);
            if (.@emo == 1) {
                Emotion e_cash;
            } else {
                Emotion e_swt;
            }
            set .@lose,rand(1,3);
            if (.@lose == 1) {
                mes "OH! MY GOD!";
                mes "Damn it! Not again!";
                mes "I'm terribly sorry, but you know practice does make perfect.";
                mes "Um, right? Heh heh...";
            } else if(.@lose == 2) {
                mes "Nooooooo!";
                mes "It broke!";
                mes "I-I'm sorry!";
            } else {
                mes "Crap!";
                mes "It couldn't take";
                mes "much more tempering!";
                mes "Sorry about this...";
            }
            close;
        }
        mes "["+getarg(0)+"]";
        successrefitem .@part;
        Emotion e_heh;
        set .@win,rand(1,3);
        if (.@win == 1) {
            mes "Perfect!";
            mes "Heh heh!";
            mes "Once again,";
            mes "flawless work";
            mes "from the master~";
        } else if(.@win == 2) {
            mes "Success...!";
            mes "Yet again, my amazing";
            mes "talent truly dazzles";
            mes "and shines today.";
        } else {
            mes "Heh heh!";
            mes "I'm all done.";
            mes "No doubt, my work is";
            mes "to your satisfaction.";
            mes "Sheer, utter perfection~";
        }
        close;
    }
// New Refining Functions ========================
    if(getequiprefinerycnt(.@part) < .@safe) {
        mes "[" + getarg(0) + "]";
        mes "I can refine this to the safe limit or a desired number of times... it's your choice...";
        next;
        set .@menu2,select("To the safe limit please.","I'll decide how many times.","I've changed my mind...");
    } else set .@menu2,2;
    switch(.@menu2){
    case 1:
        set .@refinecnt,.@safe - getequiprefinerycnt(.@part);
        break;
    case 2:
        next;
        mes "[" + getarg(0) + "]";
        mes "So how many times would you like me to refine your item?";
        next;
        input .@refinecnt;
        set .@refinecheck,.@refinecnt + getequiprefinerycnt(.@part);
        if (.@refinecnt < 1 || .@refinecheck > 10) {
            mes "[" + getarg(0) + "]";
            mes "I can't refine this item that many times.";
            close;
        }
        if(.@refinecheck > .@safe) {
            set .@refinecheck,.@refinecheck - .@safe;
            mes "[" + getarg(0) + "]";
            mes "This will try to refine the equipment " + .@refinecheck + " times past the safe limit. Your equipment may be destroyed... is that ok?";
            next;
            if(select("Yes...","No...") == 2){
                mes "[" + getarg(0) + "]";
                mes "You said so..Hmm so be it...";
                close;
            }
        }
        break;
    case 3:
        next;
        mes "[" + getarg(0) + "]";
        mes "You said so..Hmm so be it...";
        close;
    }
    set .@fullprice,.@price * .@refinecnt;
    mes "[" + getarg(0) + "]";
    mes "That will cost you " + .@refinecnt + " " + getitemname(.@material) + " and " + .@fullprice + " Zeny. Is that ok?";
    next;
    if(select("Yes","No...") == 2){
        mes "[" + getarg(0) + "]";
        mes "You said so..Hmm so be it...";
        close;
    }
    if(countitem(.@material) < .@refinecnt || Zeny < .@fullprice) {
        mes "[" + getarg(0) + "]";
        mes "Is that all you got? Unfortunately I can't work for you at a lower price. Try putting yourself in my shoes.";
        close;
    }
    set Zeny,Zeny - .@fullprice;
    delitem .@material,.@refinecnt;
    while(.@refinecnt){
        if (getequipisequiped(.@part) == 0) {
            mes "[" + getarg(0) + "]";
            mes "Look here... you don't have any Items on...";
            close;
        }
        if (getequipid(.@part) != .@refineitemid || (.@menu2 == 1 && getequippercentrefinery(.@part) < 100)) {
            mes "[" + getarg(0) + "]";
            mes "Clan... No, but Did you imagine I could be so stupid !?!";
            mes "You have changed it...";
            mes "Go out before I stun you with my Hammer!!!";
            close;
        }
        mes "Clang, clang!!!";
        if(.@menu2 == 2 && getequippercentrefinery(.@part) <= rand(100)) {
            failedrefitem .@part;
            emotion 23;
            mes "[" + getarg(0) + "]";
            mes "WAHHHH!!! I'm so sorry... I warned you this could happen...";
            set .@refinecnt,.@refinecnt - 1;
            if(.@refinecnt == 0) close;
            mes "Here's the unused Zeny and Material back...";
            getitem .@material,.@refinecnt;
            set .@fullprice,.@refinecnt * .@price;
            set Zeny,Zeny + .@fullprice;
            close;
        }
        successrefitem .@part;
        emotion 21;
        set .@refinecnt,.@refinecnt - 1;
        next;
    }
    mes "[" + getarg(0) + "]";
    mes "All finished... Come again soon.";
    close;
}
Viewed 919 times, submitted by Guest.