ShiroYasha Posted August 30, 2013 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 57 Reputation: 0 Joined: 08/25/13 Last Seen: September 22, 2013 Share Posted August 30, 2013 How can i put all the items in item_db2.txt to a Merchant NPC? Thank You. Quote Link to comment Share on other sites More sharing options...
Euphy Posted August 30, 2013 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted August 30, 2013 I'm assuming you mean in an automated fashion (otherwise it's very simple XD). To do so, you have to use an SQL item_db2 (or have it imported, at the very least). You can then have a script pull all the items from it. Here's an example script - simply send a whisper to "syncshop" on an admin account to refresh your shop with any changes in item_db2. prontera,150,150,0 shop Example Shop 83,512:-1 - script syncshop -1,{ OnWhisperGlobal: if (getgmlevel() < 99) end; dispbottom "Syncing your shop, please wait."; detachrid; OnInit: npcshopitem "Example Shop",512,15; npcshopdelitem "Example Shop",512; set .@count, query_sql("SELECT `id`,`price_buy` FROM `item_db2`",.@id,.@price); for(set .@i,0; .@i<.@count; set .@i,.@i+1) npcshopadditem "Example Shop",.@id[.@i],.@price[.@i]; end; } Quote Link to comment Share on other sites More sharing options...
Stolao Posted August 30, 2013 Group: Developer Topic Count: 48 Topics Per Day: 0.01 Content Count: 1443 Reputation: 344 Joined: 10/17/12 Last Seen: Sunday at 01:58 PM Share Posted August 30, 2013 I'm assuming you mean in an automated fashion (otherwise it's very simple XD). To do so, you have to use an SQL item_db2 (or have it imported, at the very least). You can then have a script pull all the items from it. Here's an example script - simply send a whisper to "syncshop" on an admin account to refresh your shop with any changes in item_db2. prontera,150,150,0 shop Example Shop 83,512:-1 - script syncshop -1,{ OnWhisperGlobal: if (getgmlevel() < 99) end; dispbottom "Syncing your shop, please wait."; detachrid; OnInit: npcshopitem "Example Shop",512,15; npcshopdelitem "Example Shop",512; set .@count, query_sql("SELECT `id`,`price_buy` FROM `item_db2`",.@id,.@price); for(set .@i,0; .@i<.@count; set .@i,.@i+1) npcshopadditem "Example Shop",.@id[.@i],.@price[.@i]; end; } Ive never thought to do this before, neat. Quote Link to comment Share on other sites More sharing options...
ShiroYasha Posted August 30, 2013 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 57 Reputation: 0 Joined: 08/25/13 Last Seen: September 22, 2013 Author Share Posted August 30, 2013 I'm assuming you mean in an automated fashion (otherwise it's very simple XD). To do so, you have to use an SQL item_db2 (or have it imported, at the very least). You can then have a script pull all the items from it. Here's an example script - simply send a whisper to "syncshop" on an admin account to refresh your shop with any changes in item_db2. prontera,150,150,0 shop Example Shop 83,512:-1 - script syncshop -1,{ OnWhisperGlobal: if (getgmlevel() < 99) end; dispbottom "Syncing your shop, please wait."; detachrid; OnInit: npcshopitem "Example Shop",512,15; npcshopdelitem "Example Shop",512; set .@count, query_sql("SELECT `id`,`price_buy` FROM `item_db2`",.@id,.@price); for(set .@i,0; .@i<.@count; set .@i,.@i+1) npcshopadditem "Example Shop",.@id[.@i],.@price[.@i]; end; } I'm sorry i didnt understand this xD where will i put this script? nad how would i send a whisper to it? thank you Quote Link to comment Share on other sites More sharing options...
Question
ShiroYasha
How can i put all the items in item_db2.txt to a Merchant NPC? Thank You.
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.