mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-19 20:41:33 +00:00
[Quest API] Export $item to EVENT_DISCOVER_ITEM in Perl (#2863)
# Notes - Exports `$item` to `EVENT_DISCOVER_ITEM`.
This commit is contained in:
parent
a3bb7e7741
commit
5a0a1b1ffd
@ -4067,7 +4067,13 @@ void Client::DiscoverItem(uint32 itemid) {
|
|||||||
itemid, GetName(), Admin());
|
itemid, GetName(), Admin());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
|
|
||||||
parse->EventPlayer(EVENT_DISCOVER_ITEM, this, "", itemid);
|
auto* inst = database.CreateItem(itemid);
|
||||||
|
|
||||||
|
std::vector<std::any> args;
|
||||||
|
|
||||||
|
args.emplace_back(inst);
|
||||||
|
|
||||||
|
parse->EventPlayer(EVENT_DISCOVER_ITEM, this, "", itemid, &args);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::UpdateLFP() {
|
void Client::UpdateLFP() {
|
||||||
|
|||||||
@ -1792,6 +1792,9 @@ void PerlembParser::ExportEventVariables(
|
|||||||
|
|
||||||
case EVENT_DISCOVER_ITEM: {
|
case EVENT_DISCOVER_ITEM: {
|
||||||
ExportVar(package_name.c_str(), "itemid", extradata);
|
ExportVar(package_name.c_str(), "itemid", extradata);
|
||||||
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
|
ExportVar(package_name.c_str(), "item", "QuestItem", std::any_cast<EQ::ItemInstance*>(extra_pointers->at(0)));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user