mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 15:00:25 +00:00
[Quest API] Add Merchant Events to Perl/Lua. (#2452)
- Add EVENT_ALT_CURRENCY_MERCHANT_BUY to Perl/Lua. - Add EVENT_ALT_CURRENCY_MERCHANT_SELL to Perl/Lua. - Add EVENT_MERCHANT_BUY to Perl/Lua. - Add EVENT_MERCHANT_SELL to Perl/Lua. This will allow server operators to track or do specific stuff based on if a person buys X item from Y NPC or whatever.
This commit is contained in:
@@ -855,4 +855,40 @@ void handle_player_language_skill_up(QuestInterface* parse, lua_State* L, Client
|
||||
lua_setfield(L, -2, "skill_max");
|
||||
}
|
||||
|
||||
void handle_player_alt_currency_merchant(QuestInterface* parse, lua_State* L, Client* client, std::string data, uint32 extra_data, std::vector<std::any>* extra_pointers) {
|
||||
Seperator sep(data.c_str());
|
||||
lua_pushinteger(L, std::stoi(sep.arg[0]));
|
||||
lua_setfield(L, -2, "currency_id");
|
||||
|
||||
lua_pushinteger(L, std::stoi(sep.arg[1]));
|
||||
lua_setfield(L, -2, "npc_id");
|
||||
|
||||
lua_pushinteger(L, std::stoi(sep.arg[2]));
|
||||
lua_setfield(L, -2, "merchant_id");
|
||||
|
||||
lua_pushinteger(L, std::stoi(sep.arg[3]));
|
||||
lua_setfield(L, -2, "item_id");
|
||||
|
||||
lua_pushinteger(L, std::stoi(sep.arg[4]));
|
||||
lua_setfield(L, -2, "item_cost");
|
||||
}
|
||||
|
||||
void handle_player_merchant(QuestInterface* parse, lua_State* L, Client* client, std::string data, uint32 extra_data, std::vector<std::any>* extra_pointers) {
|
||||
Seperator sep(data.c_str());
|
||||
lua_pushinteger(L, std::stoi(sep.arg[0]));
|
||||
lua_setfield(L, -2, "npc_id");
|
||||
|
||||
lua_pushinteger(L, std::stoi(sep.arg[1]));
|
||||
lua_setfield(L, -2, "merchant_id");
|
||||
|
||||
lua_pushinteger(L, std::stoi(sep.arg[2]));
|
||||
lua_setfield(L, -2, "item_id");
|
||||
|
||||
lua_pushinteger(L, std::stoi(sep.arg[3]));
|
||||
lua_setfield(L, -2, "item_quantity");
|
||||
|
||||
lua_pushinteger(L, std::stoi(sep.arg[4]));
|
||||
lua_setfield(L, -2, "item_cost");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user