mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
Switched NPC::QueryLoot() from ItemData model to ServerLootItem model (allows saylinks with augments)
This commit is contained in:
parent
aa56e8aac4
commit
aabf7b9b5a
15
zone/npc.cpp
15
zone/npc.cpp
@ -525,19 +525,22 @@ void NPC::QueryLoot(Client* to)
|
||||
|
||||
int x = 0;
|
||||
for (auto cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++x) {
|
||||
const EQEmu::ItemData* item = database.GetItem((*cur)->item_id);
|
||||
if (item == nullptr) {
|
||||
Log.Out(Logs::General, Logs::Error, "Database error, invalid item");
|
||||
if (!(*cur)) {
|
||||
Log.Out(Logs::General, Logs::Error, "NPC::QueryLoot() - ItemList error, null item");
|
||||
continue;
|
||||
}
|
||||
if (!(*cur)->item_id || !database.GetItem((*cur)->item_id)) {
|
||||
Log.Out(Logs::General, Logs::Error, "NPC::QueryLoot() - Database error, invalid item");
|
||||
continue;
|
||||
}
|
||||
|
||||
EQEmu::SayLinkEngine linker;
|
||||
linker.SetLinkType(EQEmu::saylink::SayLinkItemData);
|
||||
linker.SetItemData(item);
|
||||
linker.SetLinkType(EQEmu::saylink::SayLinkLootItem);
|
||||
linker.SetLootData(*cur);
|
||||
|
||||
auto item_link = linker.GenerateLink();
|
||||
|
||||
to->Message(0, "%s, ID: %u, Level: (min: %u, max: %u)", item_link.c_str(), item->ID, (*cur)->min_level, (*cur)->max_level);
|
||||
to->Message(0, "%s, ID: %u, Level: (min: %u, max: %u)", item_link.c_str(), (*cur)->item_id, (*cur)->min_level, (*cur)->max_level);
|
||||
}
|
||||
|
||||
to->Message(0, "%i items on %s.", x, GetName());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user