LearningRO Posted June 8, 2018 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 770 Reputation: 69 Joined: 02/10/12 Last Seen: 26 minutes ago Share Posted June 8, 2018 hi, i want to ask its possible to make npc sell item but only accept specify items like only can sell red potion yellow potion blue potion ?? Quote Link to comment Share on other sites More sharing options...
0 K1NGRAFFY Posted June 8, 2018 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 52 Reputation: 3 Joined: 04/23/17 Last Seen: July 20, 2020 Share Posted June 8, 2018 Of course you can add a specify items in your NPC. Give me your script and I try to fix it. Quote Link to comment Share on other sites More sharing options...
0 crazyarashi Posted June 8, 2018 Group: Developer Topic Count: 50 Topics Per Day: 0.02 Content Count: 763 Reputation: 227 Joined: 02/11/17 Last Seen: September 21, 2023 Share Posted June 8, 2018 (edited) OnSellItem: set .@TotalEarn,0; for(set .@j,0; .@j < getarraysize( .bitem ); set .@j,.@j+1) if( @sold_nameid[.@i] == .bitem[.@j] ) { set .@TotalEarn,.@TotalEarn + ( .bprice[.@j] * @sold_quantity[.@i] ); set Zeny,Zeny + .@TotalEarn; for(set .@i,0; .@i < getarraysize( @sold_nameid ); set .@i,.@i+1) delitem @sold_nameid[.@i],@sold_quantity[.@i]; close; } else { mes "Sorry I dont buy that kind of item"; close; } setarray .bitem[0],501,502; //== Item setarray .bprice[0],1000,2000; //== Item Price [Sell] A Simple One. :)) Edited June 8, 2018 by crazyarashi Quote Link to comment Share on other sites More sharing options...
0 LearningRO Posted June 8, 2018 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 770 Reputation: 69 Joined: 02/10/12 Last Seen: 26 minutes ago Author Share Posted June 8, 2018 2 hours ago, crazyarashi said: OnSellItem: set .@TotalEarn,0; for(set .@j,0; .@j < getarraysize( .bitem ); set .@j,.@j+1) if( @sold_nameid[.@i] == .bitem[.@j] ) { set .@TotalEarn,.@TotalEarn + ( .bprice[.@j] * @sold_quantity[.@i] ); set Zeny,Zeny + .@TotalEarn; for(set .@i,0; .@i < getarraysize( @sold_nameid ); set .@i,.@i+1) delitem @sold_nameid[.@i],@sold_quantity[.@i]; close; } else { mes "Sorry I dont buy that kind of item"; close; } setarray .bitem[0],501,502; //== Item setarray .bprice[0],1000,2000; //== Item Price [Sell] A Simple One. :)) thanks u ill try this Quote Link to comment Share on other sites More sharing options...
Question
LearningRO
hi, i want to ask its possible to make npc sell item but only accept specify items
like only can sell red potion yellow potion blue potion ??
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.