Jump to content
  • 0

NPC SHOP for +7 or + 10 items


celeron0134

Question


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  194
  • Reputation:   1
  • Joined:  12/13/16
  • Last Seen:  

prontera,156,181,5    script    jfhdksfjhs    100,{
   mes "select an item to buy";
   next;
   .@s = select( .menu$ ) -1;
   if ( countitem( .itemuse ) < .sellcost[.@s] ) {
       mes "not enough "+ getitemname( .itemuse );
       close;
   }
   delitem .itemuse, .sellcost[.@s];
   getitem2 .sellitem[.@s], 1,1,10,0, 0,0,0,0;
   close;
OnInit:
   setarray .sellitem, 1101, 1201, 1301;
   setarray .sellcost, 10, 20, 30;
   set .itemuse, 674;
   .@size = getarraysize( .sellitem );
   for ( .@i = 0; .@i < .@size; .@i++ )
    .menu$ = .menu$ + getitemname( .sellitem[.@i] )+" +10 [Cost -> "+ .sellcost[.@i] +"]:";
   end;
}
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,1101,1201,1301,1501,1601;
   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

how will i combine this two scripts?? my goal is to have a NPC that sells Refined Equipments for Coins .. but it will open a shop where you can see like +7 pole axe,+8 Shield Etc.

thanks in advance..

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  194
  • Reputation:   1
  • Joined:  12/13/16
  • Last Seen:  

got some part of it..

but is there a way to see the +10 sword on the opened shop?

also.. can you join +10 and +8 or +7 in this shop? like +10 sword +8 axe +7 club + 5 rod

like

  setarray .itemid,+7(1101),+8(1201),+9(1301),+10(1501),1601

refine shop.PNG

Edited by celeron0134
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   76
  • Joined:  06/13/13
  • Last Seen:  

short answer: no, because client limitation!, or you can make mod by using vending system, google this word "Selling Refined Item by NPC as Vending List"

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  194
  • Reputation:   1
  • Joined:  12/13/16
  • Last Seen:  

12 hours ago, HD Scripts said:

maybe command "additem2" ?

ill try this one thanks

On 2/15/2020 at 5:22 PM, Litro Endemic said:

short answer: no, because client limitation!, or you can make mod by using vending system, google this word "Selling Refined Item by NPC as Vending List"

tried but didn't work open_vending i think this script is not supported on rathena

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

as far as I know, by default shop doesn't support refined items.

the only one who I have seen manage to make this mod in the past was @Epoque back in eathena, and the link is no longer available .

or perhaps you could try ask him to update it if he ever have time or interested to do it.

Link to comment
Share on other sites

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.

×
×
  • Create New...