mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
[Quest API] Add EVENT_EQUIP_ITEM_CLIENT and EVENT_UNEQUIP_ITEM_CLIENT to Perl/Lua. (#2015)
- These events allow more customization beyond forcing operators to use a script file for each and every item they want to have some sort of functionality for these events. - Perl event exports $item_id, $item_quantity, and $slot_id. - Lua event exports item_id, item_quantity, slot_id, and item.
This commit is contained in:
@@ -2205,20 +2205,52 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
if (src_slot_id <= EQ::invslot::EQUIPMENT_END) {
|
||||
if(src_inst) {
|
||||
parse->EventItem(EVENT_UNEQUIP_ITEM, this, src_inst, nullptr, "", src_slot_id);
|
||||
|
||||
std::string export_string = fmt::format(
|
||||
"{} {}",
|
||||
src_inst->IsStackable() ? src_inst->GetCharges() : 1,
|
||||
src_slot_id
|
||||
);
|
||||
|
||||
parse->EventPlayer(EVENT_UNEQUIP_ITEM_CLIENT, this, export_string, src_inst->GetItem()->ID);
|
||||
}
|
||||
|
||||
if(dst_inst) {
|
||||
parse->EventItem(EVENT_EQUIP_ITEM, this, dst_inst, nullptr, "", src_slot_id);
|
||||
|
||||
std::string export_string = fmt::format(
|
||||
"{} {}",
|
||||
dst_inst->IsStackable() ? dst_inst->GetCharges() : 1,
|
||||
src_slot_id
|
||||
);
|
||||
|
||||
parse->EventPlayer(EVENT_EQUIP_ITEM_CLIENT, this, export_string, dst_inst->GetItem()->ID);
|
||||
}
|
||||
}
|
||||
|
||||
if (dst_slot_id <= EQ::invslot::EQUIPMENT_END) {
|
||||
if(dst_inst) {
|
||||
parse->EventItem(EVENT_UNEQUIP_ITEM, this, dst_inst, nullptr, "", dst_slot_id);
|
||||
|
||||
std::string export_string = fmt::format(
|
||||
"{} {}",
|
||||
dst_inst->IsStackable() ? dst_inst->GetCharges() : 1,
|
||||
dst_slot_id
|
||||
);
|
||||
|
||||
parse->EventPlayer(EVENT_UNEQUIP_ITEM_CLIENT, this, export_string, dst_inst->GetItem()->ID);
|
||||
}
|
||||
|
||||
if(src_inst) {
|
||||
parse->EventItem(EVENT_EQUIP_ITEM, this, src_inst, nullptr, "", dst_slot_id);
|
||||
|
||||
std::string export_string = fmt::format(
|
||||
"{} {}",
|
||||
src_inst->IsStackable() ? src_inst->GetCharges() : 1,
|
||||
dst_slot_id
|
||||
);
|
||||
|
||||
parse->EventPlayer(EVENT_EQUIP_ITEM_CLIENT, this, export_string, src_inst->GetItem()->ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user