viewing paste Unknown #56306 | 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
prontera,155,181,3  script  Item Convert    10173,{
 
    mes .name$;
    mes "Hello there!";
    mes "I convert things swiftly and diligently!";
    mes "Is there anything you like to convert?";
    next;
    .@opt = select(.Menu$)-1;
    mes .name$;
    mes "You want to convert ^0055FF"+getitemname(.ItemIDFrom[.@opt])+"^000000 into ^0055FF"+getitemname(.ItemIDTo[.@opt])+"^000000.";
    next;
    .@menu$ = "";
    for(.@i=0;.@i<getarraysize(.Chances);.@i++)
        .@menu$ = .@menu$ + "Exchange ^0055FF"+getitemname(.ItemIDFrom[.@opt])+" for ^0055FF"+getitemname(.ItemIDto[.@i])+"^000000:";
    .@menu$ = .@menu$;
    next;
    .@opt2 = select(.@menu$)-1;
    .@amount = ((.ToAmount[.@opt]*.Chances[.@opt2])/100);
    .@chance = .Chances[.@opt2];
    mes .name$;
    mes "You are about to exchange ^FF55001^000000x "+getitemname(.ItemIDFrom[.@opt])+" into ^FF5500"+.ToAmount+"^000000x "+getitemname(.ItemIDTo[.@opt])+".";
    mes "Would you like to proceed?.";
    next;
    if(select("Yes Please..:Cancel")==2) end;
    if(countitem(.ItemIDFrom[.@opt]) < .@amount){
        mes .name$;
        mes "I'm sorry, but i cannot process your request because you lack of ^0055FF"+getitemname(.ItemIDFrom[.@opt])+"^000000.";
        end;
    }
    mes .name$;
    if(rand(1,100) > .@chance){
        mes "Oh!~ Sorry, too bad~~";
        mes "The conversion has failed miserably.";
        mes "You can try again anytime.";
        end;
    }
    delitem .ItemIDFrom[.@opt],1;
    getitem .ItemIDTo[.@opt],.ToAmount;
    mes "Alright!~";
    mes "The conversion is a success!";
    mes "Hoping that you love my service.";
close;
 
OnInit:
    .name$ = "[ ^FF5500Item Convert^000000 ]";
    //Setup Here
    setarray .ItemIDFrom[0],501,502,503,504,505;
    setarray .ToAmount[0],500,500,500,500,500;
    setarray .ItemIDTo[0],909,909,909,909,909;
 
    //Do not touch without knowing - Just leave it to 100%
    setarray .Chances[0],100;
    
    for(.@i=0;.@i<getarraysize(.ItemIDFrom);.@i++)
        .Menu$ = .Menu$ + getitemname(.ItemIDFrom[.@i])+" to "+getitemname(.ItemIDTo[.@i]) +":";
    .Menu$ = .Menu$ + "Cancel";
    //NOTE: Chance = 100/AmountFrom %;
end;
 
}
Viewed 622 times, submitted by Guest.