[Quest API] Add EVENT_DESTROY_ITEM_CLIENT to Perl/Lua. (#2871)

* [Quest API] Add EVENT_DESTROY_ITEM_CLIENT to Perl/Lua.

- Add `EVENT_DESTROY_ITEM_CLIENT`, exports `$item_id`, `$item_name`, `$quantity`, and `$item`.

- Add `event_destroy_item_client`, exports `e.item_id`, `e.item_name`, `e.quantity`, and `e.item`.

- Allows operators to use player scripts for item destroys.

* Update lua_parser_events.h

* Update inventory.cpp
This commit is contained in:
Alex King
2023-02-13 00:58:27 -05:00
committed by GitHub
parent 24de1d948a
commit d4afc78982
7 changed files with 83 additions and 6 deletions
+3 -1
View File
@@ -161,7 +161,8 @@ const char *LuaEvents[_LargestEventID] = {
"event_damage_given",
"event_damage_taken",
"event_item_click_client",
"event_item_click_cast_client"
"event_item_click_cast_client",
"event_destroy_item_client"
};
extern Zone *zone;
@@ -284,6 +285,7 @@ LuaParser::LuaParser() {
PlayerArgumentDispatch[EVENT_DAMAGE_TAKEN] = handle_player_damage;
PlayerArgumentDispatch[EVENT_ITEM_CLICK_CAST_CLIENT] = handle_player_item_click;
PlayerArgumentDispatch[EVENT_ITEM_CLICK_CLIENT] = handle_player_item_click;
PlayerArgumentDispatch[EVENT_DESTROY_ITEM_CLIENT] = handle_player_destroy_item;
ItemArgumentDispatch[EVENT_ITEM_CLICK] = handle_item_click;
ItemArgumentDispatch[EVENT_ITEM_CLICK_CAST] = handle_item_click;