View Single Post
  #13  
Old 09-21-2015, 01:44 PM
Trackye
Sarnak
 
Join Date: Feb 2008
Posts: 87
Default

Not sure if anyone used this at all but here is an updated SQL for the current DB versions.

Code:
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.

Code:
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.
Reply With Quote