[Quest API] (Performance) Check equip or scale item events exist before export and execute (#2898)

* [Quest API] Optional parse equip and scale item events

# Notes
- Optionally parse `EVENT_SCALE_CALC`, `EVENT_ITEM_ENTER_ZONE`, `EVENT_UNEQUIP_ITEM_BOT`, `EVENT_EQUIP_ITEM_BOT`, `EVENT_EQUIP_ITEM`, `EVENT_UNEQUIP_ITEM`, `EVENT_EQUIP_ITEM_CLIENT`, `EVENT_UNEQUIP_ITEM_CLIENT`

* Cleanup
This commit is contained in:
Alex King authored and GitHub committed 2023-02-12 22:15:54 -06:00
1 parent efd6d2f9b1
commit bc6efd5f74
4 files changed
+122 -72

No files matched your search

+9 -9
View File
@@ -9405,17 +9405,17 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
)
);
const auto export_string = fmt::format(
"{} {}",
inst->IsStackable() ? inst->GetCharges() : 1,
slot_id
);
if (parse->BotHasQuestSub(EVENT_UNEQUIP_ITEM_BOT)) {
const auto& export_string = fmt::format(
"{} {}",
inst->IsStackable() ? inst->GetCharges() : 1,
slot_id
);
std::vector<std::any> args;
std::vector<std::any> args = { inst };
args.emplace_back(inst);
parse->EventBot(EVENT_UNEQUIP_ITEM_BOT, my_bot, nullptr, export_string, inst->GetID(), &args);
parse->EventBot(EVENT_UNEQUIP_ITEM_BOT, my_bot, nullptr, export_string, inst->GetID(), &args);
}
}
}