/* EQEmu: EQEmulator
Copyright (C) 2001-2026 EQEmu Development Team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
#ifdef LUA_EQEMU
#include "lua_parser_events.h"
#include "zone/lua_client.h"
#include "zone/lua_corpse.h"
#include "zone/lua_door.h"
#include "zone/lua_encounter.h"
#include "zone/lua_item.h"
#include "zone/lua_iteminst.h"
#include "zone/lua_mob.h"
#include "zone/lua_npc.h"
#include "zone/lua_object.h"
#include "zone/lua_packet.h"
#include "zone/lua_spell.h"
#include "zone/masterentity.h"
#include "zone/quest_interface.h"
#include "zone/quest_parser_collection.h"
#include "zone/zone.h"
#include "lua.hpp"
#include "luabind/luabind.hpp"
#include "luabind/object.hpp"
//NPC
void handle_npc_event_say(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
npc->DoQuestPause(init);
Lua_Client l_client(reinterpret_cast(init));
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
l_client_o.push(L);
lua_setfield(L, -2, "other");
lua_pushstring(L, data.c_str());
lua_setfield(L, -2, "message");
lua_pushinteger(L, extra_data);
lua_setfield(L, -2, "language");
}
void handle_npc_event_trade(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Lua_NPC l_npc(reinterpret_cast(npc));
luabind::adl::object l_npc_o = luabind::adl::object(L, l_npc);
l_npc_o.push(L);
lua_setfield(L, -2, "self");
Lua_Client l_client(reinterpret_cast(init));
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
l_client_o.push(L);
lua_setfield(L, -2, "other");
lua_createtable(L, 0, 0);
const auto npc_id = npc->GetNPCTypeID();
if (extra_pointers) {
size_t sz = extra_pointers->size();
for (size_t i = 0; i < sz; ++i) {
auto prefix = fmt::format("item{}", i + 1);
auto* inst = std::any_cast(extra_pointers->at(i));
Lua_ItemInst l_inst = inst;
luabind::adl::object l_inst_o = luabind::adl::object(L, l_inst);
l_inst_o.push(L);
lua_setfield(L, -2, prefix.c_str());
}
}
auto money_string = fmt::format("platinum.{}", npc_id);
uint32 money_value = !parse->GetVar(money_string).empty() ? Strings::ToUnsignedInt(parse->GetVar(money_string)) : 0;
lua_pushinteger(L, money_value);
lua_setfield(L, -2, "platinum");
money_string = fmt::format("gold.{}", npc_id);
money_value = !parse->GetVar(money_string).empty() ? Strings::ToUnsignedInt(parse->GetVar(money_string)) : 0;
lua_pushinteger(L, money_value);
lua_setfield(L, -2, "gold");
money_string = fmt::format("silver.{}", npc_id);
money_value = !parse->GetVar(money_string).empty() ? Strings::ToUnsignedInt(parse->GetVar(money_string)) : 0;
lua_pushinteger(L, money_value);
lua_setfield(L, -2, "silver");
money_string = fmt::format("copper.{}", npc_id);
money_value = !parse->GetVar(money_string).empty() ? Strings::ToUnsignedInt(parse->GetVar(money_string)) : 0;
lua_pushinteger(L, money_value);
lua_setfield(L, -2, "copper");
// set a reference to the NPC inside the trade object as well for plugins to process
l_npc_o.push(L);
lua_setfield(L, -2, "self");
// set a reference to the client inside of the trade object as well for plugins to process
l_client_o.push(L);
lua_setfield(L, -2, "other");
lua_setfield(L, -2, "trade");
}
void handle_npc_event_hp(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
if(extra_data == 1) {
lua_pushinteger(L, -1);
lua_setfield(L, -2, "hp_event");
lua_pushinteger(L, Strings::ToInt(data));
lua_setfield(L, -2, "inc_hp_event");
}
else
{
lua_pushinteger(L, Strings::ToInt(data));
lua_setfield(L, -2, "hp_event");
lua_pushinteger(L, -1);
lua_setfield(L, -2, "inc_hp_event");
}
}
void handle_npc_single_mob(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Lua_Mob l_mob(init);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
lua_setfield(L, -2, "other");
}
void handle_npc_single_client(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Lua_Client l_client(reinterpret_cast(init));
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
l_client_o.push(L);
lua_setfield(L, -2, "other");
}
void handle_npc_task_accepted(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Lua_Client l_client(reinterpret_cast(init));
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
l_client_o.push(L);
lua_setfield(L, -2, "other");
lua_pushinteger(L, Strings::ToInt(data));
lua_setfield(L, -2, "task_id");
}
void handle_npc_popup(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Lua_Mob l_mob(init);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
lua_setfield(L, -2, "other");
lua_pushinteger(L, Strings::ToInt(data));
lua_setfield(L, -2, "popup_id");
}
void handle_npc_waypoint(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Lua_Mob l_mob(init);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
lua_setfield(L, -2, "other");
lua_pushinteger(L, Strings::ToInt(data, -1));
lua_setfield(L, -2, "wp");
}
void handle_npc_hate(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Lua_Mob l_mob(init);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
lua_setfield(L, -2, "other");
lua_pushboolean(L, Strings::ToBool(data));
lua_setfield(L, -2, "joined");
}
void handle_npc_signal(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
lua_pushinteger(L, Strings::ToInt(data));
lua_setfield(L, -2, "signal");
}
void handle_npc_payload(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Seperator sep(data.c_str());
lua_pushinteger(L, Strings::ToInt(sep.arg[0]));
lua_setfield(L, -2, "payload_id");
lua_pushstring(L, sep.argplus[1]);
lua_setfield(L, -2, "payload_value");
}
void handle_npc_timer(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
lua_pushstring(L, data.c_str());
lua_setfield(L, -2, "timer");
}
void handle_npc_death(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Seperator sep(data.c_str());
Lua_Mob l_mob(init);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
lua_setfield(L, -2, "other");
lua_pushinteger(L, Strings::ToInt(sep.arg[0]));
lua_setfield(L, -2, "killer_id");
lua_pushinteger(L, Strings::ToInt(sep.arg[1]));
lua_setfield(L, -2, "damage");
const uint32 spell_id = Strings::ToUnsignedInt(sep.arg[2]);
if (IsValidSpell(spell_id)) {
Lua_Spell l_spell(&spells[spell_id]);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
lua_setfield(L, -2, "spell");
} else {
Lua_Spell l_spell(nullptr);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
lua_setfield(L, -2, "spell");
}
lua_pushinteger(L, Strings::ToInt(sep.arg[3]));
lua_setfield(L, -2, "skill_id");
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[4]));
lua_setfield(L, -2, "killed_entity_id");
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[5]));
lua_setfield(L, -2, "combat_start_time");
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[6]));
lua_setfield(L, -2, "combat_end_time");
lua_pushinteger(L, Strings::ToBigInt(sep.arg[7]));
lua_setfield(L, -2, "damage_received");
lua_pushinteger(L, Strings::ToBigInt(sep.arg[8]));
lua_setfield(L, -2, "healing_received");
if (extra_pointers && extra_pointers->size() >= 1) {
Lua_Corpse l_corpse(std::any_cast(extra_pointers->at(0)));
luabind::adl::object l_corpse_o = luabind::adl::object(L, l_corpse);
l_corpse_o.push(L);
lua_setfield(L, -2, "corpse");
}
if (extra_pointers && extra_pointers->size() >= 2) {
Lua_NPC l_npc(std::any_cast(extra_pointers->at(1)));
luabind::adl::object l_npc_o = luabind::adl::object(L, l_npc);
l_npc_o.push(L);
lua_setfield(L, -2, "killed");
}
}
void handle_npc_cast(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Seperator sep(data.c_str());
const uint32 spell_id = Strings::ToUnsignedInt(sep.arg[0]);
Lua_Spell l_spell(IsValidSpell(spell_id) ? &spells[spell_id] : nullptr);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
lua_setfield(L, -2, "spell");
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[1]));
lua_setfield(L, -2, "caster_id");
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[2]));
lua_setfield(L, -2, "caster_level");
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[3]));
lua_setfield(L, -2, "target_id");
if (extra_pointers && extra_pointers->size() == 1) {
Lua_Mob l_mob(std::any_cast(extra_pointers->at(0)));
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
lua_setfield(L, -2, "target");
}
}
void handle_npc_area(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
lua_pushinteger(L, *std::any_cast(extra_pointers->at(0)));
lua_setfield(L, -2, "area_id");
lua_pushinteger(L, *std::any_cast(extra_pointers->at(1)));
lua_setfield(L, -2, "area_type");
}
void handle_npc_null(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
}
void handle_npc_loot_zone(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Lua_Client l_client(reinterpret_cast(init));
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
l_client_o.push(L);
lua_setfield(L, -2, "other");
Lua_ItemInst l_item(std::any_cast(extra_pointers->at(0)));
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
l_item_o.push(L);
lua_setfield(L, -2, "item");
Lua_Corpse l_corpse(std::any_cast(extra_pointers->at(1)));
luabind::adl::object l_corpse_o = luabind::adl::object(L, l_corpse);
l_corpse_o.push(L);
lua_setfield(L, -2, "corpse");
}
void handle_npc_spawn_zone(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Lua_NPC l_npc(std::any_cast(init->CastToNPC()));
luabind::adl::object l_npc_o = luabind::adl::object(L, l_npc);
l_npc_o.push(L);
lua_setfield(L, -2, "other");
}
void handle_npc_despawn_zone(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Lua_Mob l_mob(init);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
lua_setfield(L, -2, "other");
}
void handle_npc_damage(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob* init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Seperator sep(data.c_str());
lua_pushnumber(L, Strings::ToUnsignedInt(sep.arg[0]));
lua_setfield(L, -2, "entity_id");
lua_pushnumber(L, Strings::ToBigInt(sep.arg[1]));
lua_setfield(L, -2, "damage");
lua_pushnumber(L, Strings::ToInt(sep.arg[2]));
lua_setfield(L, -2, "spell_id");
lua_pushnumber(L, Strings::ToInt(sep.arg[3]));
lua_setfield(L, -2, "skill_id");
lua_pushboolean(L, Strings::ToBool(sep.arg[4]));
lua_setfield(L, -2, "is_damage_shield");
lua_pushboolean(L, Strings::ToBool(sep.arg[5]));
lua_setfield(L, -2, "is_avoidable");
lua_pushnumber(L, Strings::ToInt(sep.arg[6]));
lua_setfield(L, -2, "buff_slot");
lua_pushboolean(L, Strings::ToBool(sep.arg[7]));
lua_setfield(L, -2, "is_buff_tic");
lua_pushnumber(L, Strings::ToInt(sep.arg[8]));
lua_setfield(L, -2, "special_attack");
Lua_Mob l_mob(init);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
lua_setfield(L, -2, "other");
}
void handle_npc_loot_added(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob* init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
if (extra_pointers && extra_pointers->size() == 1) {
auto *inst = std::any_cast(extra_pointers->at(0));
auto *item = database.GetItem(inst->GetID());
if (item) {
Lua_Item l_item(item);
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
l_item_o.push(L);
lua_setfield(L, -2, "item");
} else {
Lua_Item l_item(nullptr);
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
l_item_o.push(L);
lua_setfield(L, -2, "item");
}
if (inst) {
lua_pushinteger(L, inst->GetID());
lua_setfield(L, -2, "item_id");
lua_pushstring(L, inst->GetItem()->Name);
lua_setfield(L, -2, "item_name");
lua_pushinteger(L, inst->GetCharges());
lua_setfield(L, -2, "item_charges");
lua_pushinteger(L, inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN));
lua_setfield(L, -2, "augment_one");
lua_pushinteger(L, inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN + 1));
lua_setfield(L, -2, "augment_two");
lua_pushinteger(L, inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN + 2));
lua_setfield(L, -2, "augment_three");
lua_pushinteger(L, inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN + 3));
lua_setfield(L, -2, "augment_four");
lua_pushinteger(L, inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN + 4));
lua_setfield(L, -2, "augment_five");
lua_pushinteger(L, inst->GetAugmentItemID(EQ::invaug::SOCKET_END));
lua_setfield(L, -2, "augment_six");
}
}
}
void handle_npc_timer_pause_resume_start(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Seperator sep(data.c_str());
lua_pushstring(L, sep.arg[0]);
lua_setfield(L, -2, "timer");
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[1]));
lua_setfield(L, -2, "duration");
}
void handle_npc_timer_stop(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
lua_pushstring(L, data.c_str());
lua_setfield(L, -2, "timer");
}
void handle_npc_entity_variable(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
)
{
if (extra_pointers) {
if (extra_pointers->size() == 2) {
lua_pushstring(L, std::any_cast(extra_pointers->at(0)).c_str());
lua_setfield(L, -2, "variable_name");
lua_pushstring(L, std::any_cast(extra_pointers->at(1)).c_str());
lua_setfield(L, -2, "variable_value");
} else if (extra_pointers->size() == 3) {
lua_pushstring(L, std::any_cast(extra_pointers->at(0)).c_str());
lua_setfield(L, -2, "variable_name");
lua_pushstring(L, std::any_cast(extra_pointers->at(1)).c_str());
lua_setfield(L, -2, "old_value");
lua_pushstring(L, std::any_cast(extra_pointers->at(2)).c_str());
lua_setfield(L, -2, "new_value");
}
}
}
void handle_npc_spell_blocked(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
)
{
Seperator sep(data.c_str());
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[0]));
lua_setfield(L, -2, "blocking_spell_id");
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[1]));
lua_setfield(L, -2, "cast_spell_id");
const uint32 blocking_spell_id = Strings::ToUnsignedInt(sep.arg[0]);
Lua_Spell l_spell_one(IsValidSpell(blocking_spell_id) ? &spells[blocking_spell_id] : nullptr);
luabind::adl::object l_spell_one_o = luabind::adl::object(L, l_spell_one);
l_spell_one_o.push(L);
lua_setfield(L, -2, "blocking_spell");
const uint32 cast_spell_id = Strings::ToUnsignedInt(sep.arg[0]);
Lua_Spell l_spell_two(IsValidSpell(cast_spell_id) ? &spells[cast_spell_id] : nullptr);
luabind::adl::object l_spell_two_o = luabind::adl::object(L, l_spell_two);
l_spell_two_o.push(L);
lua_setfield(L, -2, "cast_spell");
}
void handle_npc_pet_command(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
)
{
lua_pushinteger(L, extra_data);
lua_setfield(L, -2, "pet_command");
lua_pushstring(L, data.c_str());
lua_setfield(L, -2, "pet_command_name");
}
// Player
void handle_player_say(
QuestInterface *parse,
lua_State* L,
Client* client,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
lua_pushstring(L, data.c_str());
lua_setfield(L, -2, "message");
lua_pushinteger(L, extra_data);
lua_setfield(L, -2, "language");
}
void handle_player_environmental_damage(
QuestInterface *parse,
lua_State* L,
Client* client,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Seperator sep(data.c_str());
lua_pushinteger(L, Strings::ToInt(sep.arg[0]));
lua_setfield(L, -2, "env_damage");
lua_pushinteger(L, Strings::ToInt(sep.arg[1]));
lua_setfield(L, -2, "env_damage_type");
lua_pushinteger(L, Strings::ToInt(sep.arg[2]));
lua_setfield(L, -2, "env_final_damage");
}
void handle_player_death(
QuestInterface *parse,
lua_State* L,
Client* client,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Seperator sep(data.c_str());
Mob *o = entity_list.GetMobID(Strings::ToInt(sep.arg[0]));
Lua_Mob l_mob(o);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
lua_setfield(L, -2, "other");
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[0]));
lua_setfield(L, -2, "killer_id");
lua_pushinteger(L, Strings::ToInt(sep.arg[1]));
lua_setfield(L, -2, "damage");
const uint32 spell_id = Strings::ToUnsignedInt(sep.arg[2]);
if (IsValidSpell(spell_id)) {
Lua_Spell l_spell(&spells[spell_id]);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
lua_setfield(L, -2, "spell");
} else {
Lua_Spell l_spell(nullptr);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
lua_setfield(L, -2, "spell");
}
lua_pushinteger(L, Strings::ToInt(sep.arg[3]));
lua_setfield(L, -2, "skill");
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[4]));
lua_setfield(L, -2, "killed_entity_id");
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[5]));
lua_setfield(L, -2, "combat_start_time");
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[6]));
lua_setfield(L, -2, "combat_end_time");
lua_pushinteger(L, Strings::ToBigInt(sep.arg[7]));
lua_setfield(L, -2, "damage_received");
lua_pushinteger(L, Strings::ToBigInt(sep.arg[8]));
lua_setfield(L, -2, "healing_received");
}
void handle_player_timer(
QuestInterface *parse,
lua_State* L,
Client* client,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
lua_pushstring(L, data.c_str());
lua_setfield(L, -2, "timer");
}
void handle_player_discover_item(
QuestInterface *parse,
lua_State* L,
Client* client,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
const EQ::ItemData *item = database.GetItem(extra_data);
if(item) {
Lua_Item l_item(item);
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
l_item_o.push(L);
lua_setfield(L, -2, "item");
} else {
Lua_Item l_item(nullptr);
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
l_item_o.push(L);
lua_setfield(L, -2, "item");
}
}
void handle_player_fish_forage_success(
QuestInterface *parse,
lua_State* L,
Client* client,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Lua_ItemInst l_item(std::any_cast(extra_pointers->at(0)));
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
l_item_o.push(L);
lua_setfield(L, -2, "item");
}
void handle_player_click_object(
QuestInterface *parse,
lua_State* L,
Client* client,
std::string data,
uint32 extra_data,
std::vector *extra_pointers
) {
Lua_Object l_object(std::any_cast