PDA

View Full Version : Merchant Temp Items


provocating
10-19-2014, 11:27 PM
What determines what actually shows on the temporary merchant list? I am looking at the table, the slots, etc and when I see the merchants actual inventory in game it only shows a small portion of what the table shows for that NPCid. This particular merchant even has 4 rows with one the same item with different quantities and only shows one of those rows.

Kingly_Krab
10-19-2014, 11:54 PM
I believe the code in the source just grabs one of them, here's the code for it: void Zone::LoadTempMerchantData() {
LogFile->write(EQEMuLog::Status, "Loading Temporary Merchant Lists...");
std::string query = StringFormat(
"SELECT "
"ml.npcid, "
"ml.slot, "
"ml.charges, "
"ml.itemid "
"FROM "
"merchantlist_temp ml, "
"spawnentry se, "
"spawn2 s2 "
"WHERE "
"ml.npcid = se.npcid "
"AND se.spawngroupid = s2.spawngroupid "
"AND s2.zone = '%s' AND s2.version = %i "
"ORDER BY ml.slot ", GetShortName(), GetInstanceVersion());
auto results = database.QueryDatabase(query);
if (!results.Success()) {
LogFile->write(EQEMuLog::Error, "Error in LoadTempMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
return;
}
std::map<uint32, std::list<TempMerchantList> >::iterator cur;
uint32 npcid = 0;
for (auto row = results.begin(); row != results.end(); ++row) {
TempMerchantList ml;
ml.npcid = atoul(row[0]);
if (npcid != ml.npcid){
cur = tmpmerchanttable.find(ml.npcid);
if (cur == tmpmerchanttable.end()) {
std::list<TempMerchantList> empty;
tmpmerchanttable[ml.npcid] = empty;
cur = tmpmerchanttable.find(ml.npcid);
}
npcid = ml.npcid;
}
ml.slot = atoul(row[1]);
ml.charges = atoul(row[2]);
ml.item = atoul(row[3]);
ml.origslot = ml.slot;
cur->second.push_back(ml);
}
pQueuedMerchantsWorkID = 0;
}

joligario
10-20-2014, 06:00 AM
@prov: How old is your source? I just did some work on perm and temp items.

@krab: Actually it depends on how many perm items the merchant has. They have 80 visible slots. The previous issue was that if the merchant had 79 items it wouldn't grab a temp item as the 80th slot. There is still a sort needed after temp item purchase or a different gap fix.

provocating
10-20-2014, 07:26 AM
My source is very, very new.

This is confusing then, why is that query going after the spawn group and such? It looks like the query is matching only items that are dropped in that zone, and that would make no sense at all. Maybe I just need more coffee and then look at it again.

joligario
10-20-2014, 11:41 AM
Don't ask me, I didn't write the query...

But, no. The query checks if the NPC is a merchant from that zone, not if the item drops from there.

provocating
10-21-2014, 10:46 PM
This is where I am not understanding it. If you look at this NPC, this is in game after I rebooted just to make sure. But actually, the table shows him having 71 items in the temp table. It looks to me when the zone is booting, even though there are entries in the temporary merchant list, it is not loading them like it used to. My rule is set to not clear the merchant list on boot, but it definitely is not loading them.

http://www.chroniclesofnorrath.com/Joomla/images/personal/everquest/caden.jpg

joligario
10-22-2014, 04:41 AM
This could be one of two issues. Either your temp table is getting erased on server boot (which is happening on my test server), or there are slot gaps in the table. Recheck the table after boot-up.

When you say your working very, very new, are you running at least beyond OCT 13 updates?

provocating
10-22-2014, 07:22 AM
October 12

joligario
10-22-2014, 07:28 AM
Update the source to at least include 10/13 and let us know.

provocating
10-22-2014, 08:06 AM
I imagine it is just zone file change, maybe I can get to it this afternoon.

provocating
10-22-2014, 10:55 PM
Yep, that one space fixed it. I see it broke the query because of the order statement not having the space.

Azrealvect
10-15-2015, 10:44 PM
So how was this fixed? Im on akkas repack and I am still having this problem after multiple installs. Clear merchant temp list rule is turned to false, Temp list is populated in heidi however it is not loading. With the repack I dont really have access to the source, and latest install and update was today october 15, 2015. Any ideas would be great! Again it is doing the same thing, sell an item and its there until you leave the merchant screen, immediately click back on merchant and item is gone.

provocating
10-15-2015, 10:49 PM
Mine was just a space in the query, but I would imagine that was fixed way back in January.