LearningRO Posted June 8, 2018 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
0 K1NGRAFFY Posted June 8, 2018 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
0 crazyarashi Posted June 8, 2018 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
0 LearningRO Posted June 8, 2018 Author 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
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 ??
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.