ShiroYasha Posted August 30, 2013 Posted August 30, 2013 How can i put all the items in item_db2.txt to a Merchant NPC? Thank You. Quote
Euphy Posted August 30, 2013 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
Stolao Posted August 30, 2013 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
ShiroYasha Posted August 30, 2013 Author 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
Question
ShiroYasha
How can i put all the items in item_db2.txt to a Merchant NPC? Thank You.
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.