diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 87b0a747d..a62131b71 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -795,6 +795,11 @@ void Client::CompleteConnect() parse->EventPlayer(EVENT_ENTER_ZONE, this, "", 0); } + if (parse->ZoneHasQuestSub(EVENT_ENTER_ZONE)) { + std::vector args = { this }; + parse->EventZone(EVENT_ENTER_ZONE, zone, "", 0, &args); + } + DeleteEntityVariable(SEE_BUFFS_FLAG); // the way that the client deals with positions during the initial spawn struct diff --git a/zone/embparser.cpp b/zone/embparser.cpp index 98376ac70..e7269047b 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -2512,6 +2512,14 @@ void PerlembParser::ExportEventVariables( break; } + case EVENT_ENTER_ZONE: { + if (extra_pointers && extra_pointers->size() == 1) { + ExportVar(package_name.c_str(), "client", "Client", std::any_cast(extra_pointers->at(0))); + } + + break; + } + default: { break; } diff --git a/zone/lua_parser.cpp b/zone/lua_parser.cpp index 79efbc29d..fbbe4fbdd 100644 --- a/zone/lua_parser.cpp +++ b/zone/lua_parser.cpp @@ -415,6 +415,7 @@ LuaParser::LuaParser() { ZoneArgumentDispatch[EVENT_CLICK_OBJECT] = handle_zone_click_object; ZoneArgumentDispatch[EVENT_DEATH_ZONE] = handle_zone_death; ZoneArgumentDispatch[EVENT_DESPAWN_ZONE] = handle_zone_despawn; + ZoneArgumentDispatch[EVENT_ENTER_ZONE] = handle_zone_enter; ZoneArgumentDispatch[EVENT_LOOT_ZONE] = handle_zone_loot; ZoneArgumentDispatch[EVENT_PAYLOAD] = handle_zone_payload; ZoneArgumentDispatch[EVENT_PLAYER_PICKUP] = handle_zone_pickup; diff --git a/zone/lua_parser_events.cpp b/zone/lua_parser_events.cpp index c7cdb401c..bfa8b44a5 100644 --- a/zone/lua_parser_events.cpp +++ b/zone/lua_parser_events.cpp @@ -3004,6 +3004,20 @@ void handle_zone_despawn( lua_setfield(L, -2, "other"); } +void handle_zone_enter( + QuestInterface *parse, + lua_State* L, + Zone* zone, + std::string data, + uint32 extra_data, + std::vector *extra_pointers +) { + Lua_Client l_client(std::any_cast(extra_pointers->at(0))); + luabind::adl::object l_client_o = luabind::adl::object(L, l_client); + l_client_o.push(L); + lua_setfield(L, -2, "other"); +} + void handle_zone_loot( QuestInterface *parse, lua_State* L, diff --git a/zone/lua_parser_events.h b/zone/lua_parser_events.h index 7629345ae..0adb7ba99 100644 --- a/zone/lua_parser_events.h +++ b/zone/lua_parser_events.h @@ -1325,6 +1325,15 @@ void handle_zone_despawn( std::vector *extra_pointers ); +void handle_zone_enter( + QuestInterface *parse, + lua_State* L, + Zone* zone, + std::string data, + uint32 extra_data, + std::vector *extra_pointers +); + void handle_zone_loot( QuestInterface *parse, lua_State* L,