Hey guys, I'm looking for a Dynamic Shop reaaly simple. Like this: trade 200 valor of badge for glorious itens... I just find a complex scripts to do that but I just wanna a simple one.
I got this one but isnt working:
I got this one but isnt working:
Code:
bat_room,150,150,5 script Glorious 756,{
goto EveryThing;
OnInit:
setarray .ItList[0],503,100,504,100,505,200,506,1000; /* [ID,Preço (zeny&item)]*/
setarray .PayType[0],1,909; /* [Tipo,ID do item] [Tipos: 1 = item, 0 = zeny] [Para tipo = 0 ignore o segundo campo]*/
npcshopdelitem "CShop#C",501;
for(set .n,0;.n<getarraysize(.ItList);set .n,.n+2)
npcshopadditem "CShop#C",.ItList[.n],.ItList[(.n+1)];
end;
EveryThing:
if(.PayType[0])
{
dispbottom "Shop de "+getitemname(.PayType[1]);
dispbottom "Você possui "+countitem(.PayType[1])+" "+getitemname(.PayType[1])+"(s)";
if(!countitem(.PayType[1])) end;
}
callshop "CShop#C";
npcshopattach "CShop#C";
end;
OnBuyItem:
for(set @n,0;@n<getarraysize(@bought_nameid);set @n,@n+1)
for(set @a,0;@a<getarraysize(.ItList);set @a,@a+2)
if(@bought_nameid[@n]==.ItList[@a])
{
set @PriceT,.ItList[@a+1]*@bought_quantity[@n];
if(.PayType[0])
{
if(countitem(.PayType[1])<@PriceT) end;
}
else
{
if(Zeny<@PriceT) end;
}
getitem @bought_nameid[@n],@bought_quantity[@n];
if(.PayType[0]) delitem .PayType[1],@PriceT;
else set Zeny,Zeny-@PriceT;
}
close;
}
- shop CShop#C -1,501:-1