mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
[Bots] Add EVENT_UNEQUIP_ITEM_BOT & EVENT_EQUIP_ITEM_BOT (#2796)
* Initial Commit, need to test. * Add unequip events. * const auto
This commit is contained in:
@@ -5074,6 +5074,13 @@ void Bot::PerformTradeWithClient(int16 begin_slot_id, int16 end_slot_id, Client*
|
||||
|
||||
BotRemoveEquipItem(return_iterator.from_bot_slot);
|
||||
|
||||
const auto export_string = fmt::format(
|
||||
"{} {}",
|
||||
return_iterator.return_item_instance->IsStackable() ? return_iterator.return_item_instance->GetCharges() : 1,
|
||||
return_iterator.from_bot_slot
|
||||
);
|
||||
|
||||
parse->EventBot(EVENT_UNEQUIP_ITEM_BOT, this, nullptr, export_string , return_iterator.return_item_instance->GetID());
|
||||
if (return_instance) {
|
||||
EQ::SayLinkEngine linker;
|
||||
linker.SetLinkType(EQ::saylink::SayLinkItemInst);
|
||||
@@ -5122,6 +5129,15 @@ void Bot::PerformTradeWithClient(int16 begin_slot_id, int16 end_slot_id, Client*
|
||||
|
||||
m_inv.PutItem(trade_iterator.to_bot_slot, *trade_iterator.trade_item_instance);
|
||||
BotAddEquipItem(trade_iterator.to_bot_slot, (trade_iterator.trade_item_instance ? trade_iterator.trade_item_instance->GetID() : 0));
|
||||
|
||||
const auto export_string = fmt::format(
|
||||
"{} {}",
|
||||
trade_iterator.trade_item_instance->IsStackable() ? trade_iterator.trade_item_instance->GetCharges() : 1,
|
||||
trade_iterator.to_bot_slot
|
||||
);
|
||||
|
||||
parse->EventBot(EVENT_EQUIP_ITEM_BOT, this, nullptr, export_string , trade_iterator.trade_item_instance->GetID());
|
||||
|
||||
trade_iterator.trade_item_instance = nullptr; // actual deletion occurs in client delete below
|
||||
|
||||
client->DeleteItemInInventory(trade_iterator.from_client_slot, 0, (trade_iterator.from_client_slot == EQ::invslot::slotCursor));
|
||||
|
||||
Reference in New Issue
Block a user