viewing paste Unknown #26142 | 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
poring_i02,108,124,4    script  Badge Reward    15030,{
    function chckweight;
 
    mes .n$;
    mes rand(2) ? "I'm tired as always." : "Not slacking, I hope i can still provide good stuffs.";
    mes callfunc("F_Hi");
    mes "I can sell you items reward from Badge Rewards, to your ^0055FF"+ #BADGEPoints +"^000000 Badge Point"+ (#BADGEPoints > 1 ? "s" : "") +".";
    mes " ";
    mes "Would you like to have a look at?";
    next;
    soundeffect "aster_die.wav",0;
    .@menu = select("- Information:- Badge Rewards (^FF0000"+#BADGEPoints+"^000000):- ^777777Close^000000");
    switch(.@menu) {
        case 1:
            mes .n$;
            mes "Here...";
            close;
        break;
        case 2:
            mes "^FF0000Information:^000000";
            mes "^777777 -------------------- ^000000";
            mes "Total Balance : ^0055FF"+ #BADGEPoints +"^000000 Badge Point"+ (#BADGEPoints > 1 ? "s" : "") +"";
            callshop "badge_shop",1;
            npcshopattach "badge_shop";
            dispbottom "Total of : " + #BADGEPoints + " Badge Point"+ (#BADGEPoints > 1 ? "s" : "") +"", 0xffff00;
            end;
        break;
        case 3:
            mes .n$;
            mes "Alright, please come back whenever your ready.";
            close;
        break;
    }
 
    OnBuyItem:
        setarray .@cost, 0;
        for( .@i = 0; .@i < getarraysize(@bought_nameid); .@i++ ) {
            .@cost += .@costs[.@i] += (.items[.@i+1] * @bought_quantity[.@i]);
            
            mes .n$;
            mes "^777777Item: ^ff0000"+ getitemname(@bought_nameid[.@i]) +"^777777";
            mes "^777777Total Quantity: ^ff0000"+ @bought_quantity[.@i] +"^000000";
            mes "^777777Item Price: ^ff0000"+ .@costs[.@i] +"^000000";
            mes "^777777 -------------------- ^000000";
        }
        mes "^777777Total Price: ^009900"+ .@cost +"^000000";
        next;
        if(select("- Purchase:- Cancel") == 1) {
            mes .n$;
            if(.@cost > #BADGEPoints) {
                mes "I'm sorry but you don't have enough Badge Point"+ (#BADGEPoints > 1 ? "s" : "") +".";
            } else {
                for( .@i = 0; .@i < getarraysize(@bought_nameid); .@i++ ) {
                    getitem @bought_nameid[.@i], @bought_quantity[.@i];
                    message strcharinfo(0), "You have purchased "+ @bought_quantity[.@i] +"x "+ getitemname(@bought_nameid[.@i]) +""+ (@bought_quantity[.@i] > 1 ? "s" : "") +".";
                    #BADGEPoints -= .@costs[.@i];
                    mes "^6E6E6EYou have purchased "+ @bought_quantity[.@i] +"x "+ getitemname(@bought_nameid[.@i]) +""+ (@bought_quantity[.@i] > 1 ? "s" : "") +".^000000";
                    mes "^777777 -------------------- ^000000";
                }
                mes "^777777Total Price: ^009900"+ .@cost +"^000000";
                emotion e_cash;
                next;
                mes .n$;
                mes "The deal has successfully completed.";
            }
 
            deletearray @bought_nameid[0], getarraysize(@bought_nameid);
            deletearray @bought_quantity[0], getarraysize(@bought_quantity);
            close;
        } else {
            mes .n$;
            mes "Alright then, come back anytime you want.";
            message strcharinfo(0), "Trade canceled.";
            close;
        }
    end;
 
    function    chckweight  {
        if (!checkweight(getarg(0),1)) {
            mes .n$;
            mes "Your weight is too high.";
            close;
        }
        
        return;
    }
 
    OnInit:
        .n$ = "[ ^BBB6CCBadge Reward^000000 ]";
        .required_ItemID = 7539;
        setarray .items[0],
            12114,2,
            12115,2,
            12116,2,
            12117,2,
            13891,15,
            13892,15,
            13893,15,
            13894,15;
 
        npcshopdelitem "badge_shop",512;
        for( set .@i,0; .@i < getarraysize(.items); set .@i, .@i + 2 )
            npcshopadditem "badge_shop", .items[.@i], .items[ .@i + 1 ];
}
 
-   shop    badge_shop  -1,512:-1
Viewed 952 times, submitted by Guest.