Trackye
11-08-2012, 03:26 PM
Sorry I cannot seem to Edit my post above so i did not have to double post....
Well i figured some stuff out and this works well enough for me until I get some more work done on it.
At the moment What is required is to create 3 Npcs with MerchantIds of 22, 23, 24 ( You can change this in the SQL if you want to)
Then you dump your items table to a SQL and rename it Bazlist. ( Can also be changed in the SQL if you want to )
Then you run this SQL
Delete from Merchantlist where merchantid =22;
Delete from Merchantlist where merchantid =23;
Delete from Merchantlist where merchantid =24;
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 0,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 1,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 2,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 3,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 4,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 5,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 6,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 7,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 8,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 9,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 10,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 11,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 12,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 13,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 14,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 15,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 16,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 17,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (22, 18,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 0,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 1,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 2,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 3,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 4,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 5,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 6,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 7,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 8,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 9,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 10,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 11,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 12,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 13,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 14,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 15,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 16,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 17,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (23, 18,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 0,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 1,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 2,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 3,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 4,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 5,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 6,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 7,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 8,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 9,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 10,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 11,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 12,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 13,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 14,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 15,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 16,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 17,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
INSERT into Merchantlist(merchantid, slot, item, faction_required, level_required, alt_currency_cost) VALUES (24, 18,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), -100, 0, 0);
Running that SQL will populate your 3 vendors with 18 items each RANDOMLY chosen from the bazlist table.
The reason I did this by creating a custom table is that you can add or remove items to this list so that they will also randomly appear or NOT appear on the vendor without editing or changing your items table itself.
The benefit of this for instance is that I removed all no drop, all items over reqlevel 65, all LDON reward items, all no rent items from the Bazlist table which will ensure they do not appear on these merchants however they are not removed from the game.
Please feel free to offer and suggestions and improvements to this idea that are you may have.
You can make a DB trigger to run this query every day or so and it will automatically on the fly update their inventories ( players logged in while they query is ran for some reason seem to have to log out to see changes)
I was attempting to make this into a command that can be used ingame but I cannot atm seem to get a command to run a basic SQL query. I will repost here if and when I get that part figured out.
Trackye
09-21-2015, 01:44 PM
Not sure if anyone used this at all but here is an updated SQL for the current DB versions.
SET @Npcid1 :=999260; /*Edit this to reflect the Npcid for your first Merchant*/
set @Npcid2 :=999261; /*Edit this to reflect the Npcid for your second Merchant*/
set @Npcid3 :=999262; /*Edit this to reflect the Npcid for your third Merchant*/
/*Ensure your CUSTOM items table you copied from items to create the list that this SQL chooses items from is named Bazlist or change Bazlist below*/
Delete from Merchantlist_temp where npcid =@Npcid1;
Delete from Merchantlist_temp where npcid =@Npcid2;
Delete from Merchantlist_temp where npcid =@Npcid3;
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 0,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 1,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 2,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 3,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 4,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 5,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 6,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 7,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 8,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 9,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 10,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 11,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 12,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 13,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 14,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 15,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 16,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 17,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid1, 18,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 0,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 1,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 2,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 3,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 4,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 5,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 6,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 7,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 8,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 9,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 10,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 11,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 12,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 13,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 14,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 15,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 16,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 17,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid2, 18,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 0,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 1,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 2,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 3,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 4,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 5,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 6,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 7,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 8,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 9,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 10,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 11,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 12,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 13,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 14,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 15,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 16,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 17,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (@Npcid3, 18,(SELECT id FROM bazlist ORDER BY RAND() LIMIT 1), 1);
Just set the Npcid's at the top and ensure your custom items table is named Bazlist or change it in the Sqls to reflect the name of yours.
To create the bazlist I copied the Items table in my database then ran these a few Queries. DO NOT RUN THESE ON YOUR NORMAL ITEMS TABLE.
Delete from 'bazlist' where price = 0;
Delete from 'bazlist' where reqlevel > 65;
Delete from 'bazlist' where nodrop = 0;
Delete from 'bazlist' where norent = 0;
Delete from 'bazlist' where ldonprice > 0;
Delete from 'bazlist' where ldonsold >0;
This gives you a table full of droppable pre-level 65 gear that is not from Ldon and has a price at a merchant.
Then the Sql you run will select 60 items from it at random and sell them.
Just like a normal bazaar vendor it will populate with garbage as well (for example 1pp runes and such) so it creates a bit of fun checking them to see what has been added.
Not sure if anyone was using but figured id update since i've been using it for awhile.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.