mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-01 15:32:25 +00:00
[Quest API] Export $item to Client/Bot Equip Events in Perl (#2860)
* [Quest API] Add $item Export to Client/Bot Equip Events # Notes - Adds `$item` export to `EVENT_ITEM_EQUIP_CLIENT`, `EVENT_ITEM_UNEQUIP_CLIENT`, `EVENT_ITEM_EQUIP_BOT`, and `EVENT_UNEQUIP_ITEM_BOT`. * Update bot.cpp * Update embparser.cpp
This commit is contained in:
parent
a1251bdda8
commit
a3bb7e7741
12
zone/bot.cpp
12
zone/bot.cpp
@ -5080,7 +5080,11 @@ void Bot::PerformTradeWithClient(int16 begin_slot_id, int16 end_slot_id, Client*
|
|||||||
return_iterator.from_bot_slot
|
return_iterator.from_bot_slot
|
||||||
);
|
);
|
||||||
|
|
||||||
parse->EventBot(EVENT_UNEQUIP_ITEM_BOT, this, nullptr, export_string , return_iterator.return_item_instance->GetID());
|
std::vector<std::any> args;
|
||||||
|
|
||||||
|
args.emplace_back(return_iterator.return_item_instance);
|
||||||
|
|
||||||
|
parse->EventBot(EVENT_UNEQUIP_ITEM_BOT, this, nullptr, export_string , return_iterator.return_item_instance->GetID(), &args);
|
||||||
if (return_instance) {
|
if (return_instance) {
|
||||||
EQ::SayLinkEngine linker;
|
EQ::SayLinkEngine linker;
|
||||||
linker.SetLinkType(EQ::saylink::SayLinkItemInst);
|
linker.SetLinkType(EQ::saylink::SayLinkItemInst);
|
||||||
@ -5136,7 +5140,11 @@ void Bot::PerformTradeWithClient(int16 begin_slot_id, int16 end_slot_id, Client*
|
|||||||
trade_iterator.to_bot_slot
|
trade_iterator.to_bot_slot
|
||||||
);
|
);
|
||||||
|
|
||||||
parse->EventBot(EVENT_EQUIP_ITEM_BOT, this, nullptr, export_string , trade_iterator.trade_item_instance->GetID());
|
std::vector<std::any> args;
|
||||||
|
|
||||||
|
args.emplace_back(trade_iterator.trade_item_instance);
|
||||||
|
|
||||||
|
parse->EventBot(EVENT_EQUIP_ITEM_BOT, this, nullptr, export_string, trade_iterator.trade_item_instance->GetID(), &args);
|
||||||
|
|
||||||
trade_iterator.trade_item_instance = nullptr; // actual deletion occurs in client delete below
|
trade_iterator.trade_item_instance = nullptr; // actual deletion occurs in client delete below
|
||||||
|
|
||||||
|
|||||||
@ -9484,7 +9484,11 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
|
|||||||
slot_id
|
slot_id
|
||||||
);
|
);
|
||||||
|
|
||||||
parse->EventBot(EVENT_UNEQUIP_ITEM_BOT, my_bot, nullptr, export_string, inst->GetID());
|
std::vector<std::any> args;
|
||||||
|
|
||||||
|
args.emplace_back(inst);
|
||||||
|
|
||||||
|
parse->EventBot(EVENT_UNEQUIP_ITEM_BOT, my_bot, nullptr, export_string, inst->GetID(), &args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1727,6 +1727,7 @@ void PerlembParser::ExportEventVariables(
|
|||||||
ExportVar(package_name.c_str(), "item_id", item->GetID());
|
ExportVar(package_name.c_str(), "item_id", item->GetID());
|
||||||
ExportVar(package_name.c_str(), "item_name", item->GetItem()->Name);
|
ExportVar(package_name.c_str(), "item_name", item->GetItem()->Name);
|
||||||
ExportVar(package_name.c_str(), "spell_id", item->GetItem()->Click.Effect);
|
ExportVar(package_name.c_str(), "spell_id", item->GetItem()->Click.Effect);
|
||||||
|
ExportVar(package_name.c_str(), "item", "QuestItem", item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1924,6 +1925,9 @@ void PerlembParser::ExportEventVariables(
|
|||||||
ExportVar(package_name.c_str(), "item_id", extradata);
|
ExportVar(package_name.c_str(), "item_id", extradata);
|
||||||
ExportVar(package_name.c_str(), "item_quantity", sep.arg[0]);
|
ExportVar(package_name.c_str(), "item_quantity", sep.arg[0]);
|
||||||
ExportVar(package_name.c_str(), "slot_id", sep.arg[1]);
|
ExportVar(package_name.c_str(), "slot_id", sep.arg[1]);
|
||||||
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
|
ExportVar(package_name.c_str(), "item", "QuestItem", std::any_cast<EQ::ItemInstance*>(extra_pointers->at(0)));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1933,6 +1937,9 @@ void PerlembParser::ExportEventVariables(
|
|||||||
ExportVar(package_name.c_str(), "item_id", extradata);
|
ExportVar(package_name.c_str(), "item_id", extradata);
|
||||||
ExportVar(package_name.c_str(), "item_quantity", sep.arg[0]);
|
ExportVar(package_name.c_str(), "item_quantity", sep.arg[0]);
|
||||||
ExportVar(package_name.c_str(), "slot_id", sep.arg[1]);
|
ExportVar(package_name.c_str(), "slot_id", sep.arg[1]);
|
||||||
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
|
ExportVar(package_name.c_str(), "item", "QuestItem", std::any_cast<EQ::ItemInstance*>(extra_pointers->at(0)));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2248,7 +2248,11 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
|||||||
dst_slot_id
|
dst_slot_id
|
||||||
);
|
);
|
||||||
|
|
||||||
parse->EventPlayer(EVENT_UNEQUIP_ITEM_CLIENT, this, export_string, dst_inst->GetItem()->ID);
|
std::vector<std::any> args;
|
||||||
|
|
||||||
|
args.emplace_back(dst_inst);
|
||||||
|
|
||||||
|
parse->EventPlayer(EVENT_UNEQUIP_ITEM_CLIENT, this, export_string, dst_inst->GetItem()->ID, &args);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(src_inst) {
|
if(src_inst) {
|
||||||
@ -2260,7 +2264,11 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
|||||||
dst_slot_id
|
dst_slot_id
|
||||||
);
|
);
|
||||||
|
|
||||||
parse->EventPlayer(EVENT_EQUIP_ITEM_CLIENT, this, export_string, src_inst->GetItem()->ID);
|
std::vector<std::any> args;
|
||||||
|
|
||||||
|
args.emplace_back(src_inst);
|
||||||
|
|
||||||
|
parse->EventPlayer(EVENT_EQUIP_ITEM_CLIENT, this, export_string, src_inst->GetItem()->ID, &args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user