mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 13:41:31 +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;
|
int x = 0;
|
||||||
for (auto cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++x) {
|
for (auto cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++x) {
|
||||||
const EQEmu::ItemData* item = database.GetItem((*cur)->item_id);
|
if (!(*cur)) {
|
||||||
if (item == nullptr) {
|
Log.Out(Logs::General, Logs::Error, "NPC::QueryLoot() - ItemList error, null item");
|
||||||
Log.Out(Logs::General, Logs::Error, "Database error, invalid item");
|
continue;
|
||||||
|
}
|
||||||
|
if (!(*cur)->item_id || !database.GetItem((*cur)->item_id)) {
|
||||||
|
Log.Out(Logs::General, Logs::Error, "NPC::QueryLoot() - Database error, invalid item");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::SayLinkEngine linker;
|
EQEmu::SayLinkEngine linker;
|
||||||
linker.SetLinkType(EQEmu::saylink::SayLinkItemData);
|
linker.SetLinkType(EQEmu::saylink::SayLinkLootItem);
|
||||||
linker.SetItemData(item);
|
linker.SetLootData(*cur);
|
||||||
|
|
||||||
auto item_link = linker.GenerateLink();
|
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());
|
to->Message(0, "%i items on %s.", x, GetName());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user