[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
2023-02-12 23:15:54 -05:00
committed by GitHub
parent efd6d2f9b1
commit bc6efd5f74
4 changed files with 122 additions and 72 deletions
+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);
}
}
}