Jump to content
  • 0

Shop that item used instead of zeny?


Question

2 answers to this question

Recommended Posts

Posted

feels like want to update this script

prontera,156,172,5    script    market    100,{
   dispbottom "You currently have "+ countitem(.itemuse) +" "+ getitemname(.itemuse);
   callshop "market2#hidden", 1;
   end;
OnBuyItem:
   if ( !@bought_quantity ) end;
   .@size = getarraysize( @bought_nameid );
   while ( .@i < .@size ) {
       .@j = 0;
       while ( @bought_nameid[.@i] != .itemid[.@j] && .@j < .shop_size ) .@j++;
       .@itemcost = .@itemcost + .itemcost[.@j] * @bought_quantity[.@i];
       .@i++;
   }
   if ( .@itemcost > countitem(.itemuse) ) {
       mes "you don't have enough "+ getitemname(.itemuse);
       close;
   }
   delitem .itemuse, .@itemcost;
   for ( set .@i,0; .@i < .@size; set .@i, .@i +1 )
       getitem @bought_nameid[.@i], @bought_quantity[.@i];
   deletearray @bought_nameid;
   deletearray @bought_quantity;
   end;
OnInit:
   setarray .itemid,512,513,514,515,516;
   setarray .itemcost,10,20,30,40,50;
   set .itemuse, 674;

   .shop_size = getarraysize(.itemid);
   npcshopdelitem "market2#hidden", 512;
   for ( .@i = 0; .@i < .shop_size; .@i++ )
       npcshopadditem "market2#hidden", .itemid[.@i], .itemcost[.@i];
   npcshopattach "market2#hidden";
   end;
}

-    shop    market2#hidden    -1,512:10000

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...