[Quest API] Add EVENT_AA_BUY and EVENT_AA_GAIN to Perl/Lua. (#2504)

# Perl
- Add EVENT_AA_BUY to Perl.
  - Exports `$aa_cost`, `$aa_id`, `$aa_previous_id`, and `$aa_next_id`
- Add EVENT_AA_GAIN to Perl.
  - Exports `$aa_gained`
- Add quest::getaaname(aa_id) to Perl.

# Lua
- Add event_aa_buy to Lua.
  - Exports `e.aa_cost`, `e.aa_id`, `e.aa_previous_id`, and `e.aa_next_id`
- Add event_aa_gain to Lua.
  - Exports `e.aa_gained`
- Add eq.get_aa_name(aa_id) to Lua.
This commit is contained in:
Kinglykrab
2022-11-05 11:09:47 -04:00
committed by GitHub
parent a3928ec504
commit f6dbdf5db8
14 changed files with 263 additions and 27 deletions
+20
View File
@@ -898,4 +898,24 @@ void handle_player_merchant(QuestInterface* parse, lua_State* L, Client* client,
lua_setfield(L, -2, "item_cost");
}
void handle_player_aa_buy(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, "aa_cost");
lua_pushinteger(L, std::stoi(sep.arg[1]));
lua_setfield(L, -2, "aa_id");
lua_pushinteger(L, std::stoi(sep.arg[2]));
lua_setfield(L, -2, "aa_previous_id");
lua_pushinteger(L, std::stoi(sep.arg[3]));
lua_setfield(L, -2, "aa_next_id");
}
void handle_player_aa_gain(QuestInterface* parse, lua_State* L, Client* client, std::string data, uint32 extra_data, std::vector<std::any>* extra_pointers) {
lua_pushinteger(L, std::stoi(data));
lua_setfield(L, -2, "aa_gained");
}
#endif