ayothaya,151,171,3 script Drops Trader 403,{
mes .name$;
mes "You currently have "+countitem(.Imagine_item)+" Mithril coin/s.";
mes "Would you like to look at the shop?";
next;
if(select("Yes:No") == 2) {
close;
}
close2;
callshop "Imagine_SHOP",1;
npcshopattach "Imagine_SHOP";
dispbottom "You currently have "+countitem(.Imagine_item)+" Mithril coin/s.";
end;
OnBuyItem:
for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) {
for(set @j,0; @j < getarraysize(.Imagine_ITEMS); set @j,@j+2) {
if(.iMAGINE_ITEMS[@j] == @bought_nameid[@i]) {
set @itemcost,(.IMAGINE_ITEMS[(@j+1)]*@bought_quantity[@i]);
set @totalcost,(@totalcost+@itemcost);
break;
}
}
}
if(@totalcost > countitem(.Imagine_item)) {
dispbottom "You don't have enough coin.";
}
else {
for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) {
getitem @bought_nameid[@i],@bought_quantity[@i];
}
delitem .Imagine_item,@totalcost;
dispbottom "Thank you for shopping.";
dispbottom "You now have "+countitem(.Imagine_item)+" Mithril coin left.";
}
set @totalcost,0;
deletearray @bought_nameid[0],128;
deletearray @bought_quantity[0],128;
end;
OnInit:
npcshopdelitem "Imagine_SHOP",909; // Leave this alone
set .name$,"[DropsTrader]";
set .Imagine_item,674; // Input TCG ID
setarray .Imagine_ITEMS[0],7086,2,7090,2,7091,2,7077,2,7076,2; // Input as many items as you want (item::price)
for(set .@i,0; .@i < getarraysize(.IMAGINE_ITEMS); set .@i,.@i+2) {
npcshopadditem "Imagine_SHOP",.IMAGINE_ITEMS[.@i],.Imagine_ITEMS[(.@i+1)];
}
}
- shop Imagine_SHOP 139,909:1
My server got hacked because of this script.