viewing paste Unknown #24760 | 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
prontera,133,151,3      script  Costume Trader  805,{
        mes .name$;
        mes "You currently have "+countitem(.COSTUME_SHOP)+" Costume Coins.";
        mes "Remember that you must have enough Costume Coin to buy this items";
        next;
        mes .name$;
        mes "Would you like to look at the event shop?";
        next;
        if(select("Yes:No") == 2) close;
        close2;
        callshop "COSTUME_SHOP",1;
        npcshopattach "COSTUME_SHOP";
        dispbottom "You currently have "+countitem(.COSTUME_SHOP)+" Costume Coins.";
        end;
 
OnBuyItem:
        for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) {
                for(set @j,0; @j < getarraysize(.COSTUME_SHOPS); set @j,@j+2) {
                        if(.COSTUME_SHOPS[@j] == @bought_nameid[@i]) {
                                set @itemcost,(.COSTUME_SHOPS[(@j+1)]*@bought_quantity[@i]);
                                set @totalcost,(@totalcost+@itemcost);
                                break;
                        }
                }
        }
 
 
        if(@totalcost > countitem(.COSTUME_SHOP)) dispbottom "Costume Coins.";
        else {
                for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) {
                        getitem @bought_nameid[@i],@bought_quantity[@i];
                }
        delitem .COSTUME_SHOP,@totalcost;
        dispbottom "Thank you for shopping.";
        dispbottom "You now have "+countitem(.COSTUME_SHOP)+" Costume Coins left.";
        }
 
        set @totalcost,0;
        deletearray @bought_nameid[0],128;
        deletearray @bought_quantity[0],128;
        end;
 
OnInit:
npcshopdelitem "COSTUME_SHOP",909;                   // Don't touch this
set .name$,"[Event Shop]";
set .COSTUME_SHOP,7606;                               // Coin ID
setarray
.COSTUME_SHOPS[0],30565,1,30564,1,30560,1,30559,1,30558,1,30557,1,22283,2,22284,2,22285,2,22286,2,22287,2,22289,5,22290,5,22291,5,22292,5,22293,5;      //(item::price)
                     
                       
                       
for(set .@i,0; .@i < getarraysize(.COSTUME_SHOPS); set .@i,.@i+2) {
npcshopadditem "COSTUME_SHOP",.COSTUME_SHOPS[.@i],.COSTUME_SHOPS[(.@i+1)];
}
}
 
-       shop    COSTUME_SHOP    139,909:1
Viewed 547 times, submitted by unknown.