View Single Post
  #9  
Old 11-07-2012, 08:27 PM
Trackye
Sarnak
 
Join Date: Feb 2008
Posts: 87
Default

Well i was thinking something along the lines of a command that prompts this.

Code:
Void command_Bazload(Client *c, const Seperator *sep)
{
sprintf(query, INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (22, "select max(slot) +1", (SELECT id from items where nodrop =1 AND price > 200 LIMIT 1, 1), 1));
sprintf(query, INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (23, "select max(slot) +1", (SELECT id from items where nodrop =1 AND price > 200 LIMIT 1, 1), 1));
sprintf(query, INSERT into Merchantlist_temp(npcid, slot, itemid, charges) VALUES (24, "select max(slot) +1", (SELECT id from items where nodrop =1 AND price > 200 LIMIT 1, 1), 1));
}
Then have premade Bazaar merchants with ( in this example ) a npcid of 22, 23 and 24.

But as i said earlier i havent worked on server related files in some time and have not worked very much at all on eq related server files so my skills are shall we say extremely rusty. ( so keep in mind that that Query DOES not work correctly. It inserts an item into the list but always the first returned one.)

It seems the problem here is I cannot remember how to make it auto increment the slot id correctly and also make it select the id randomly instead of always returning the first one...

Then it would be a matter of finding in the server coding how to add this into startup, run the query multiple times..say 60 and then when the server restarted it would automatically populate the bazaar vendor with items..

Or you could use the command to do the same instead of putting into the startup automatically.

In response to those people giving me a hard time trying to drum up interest in this.


At least im trying.... It may very well be that I am goldilocks and it is too hard in some respect and easier in others :P

But i am attempting to learn and improve my and others experience.
Reply With Quote