mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-03 03:50:40 +00:00
[Feature] Zone Scripting (#4908)
* [Feature] Add Zone Scripting Capabilities * Push * Update zone.cpp * Fix crashes * Lua * Add other events, finish Lua * Add EVENT_ENTER_ZONE * Final * Push * Push * [Feature] Add Zone Scripting Capabilities * Push * Update zone.cpp * Fix crashes * Add EVENT_ENTER_ZONE * Remove duplicates * Update embparser.cpp
This commit is contained in:
@@ -795,6 +795,11 @@ void Client::CompleteConnect()
|
||||
parse->EventPlayer(EVENT_ENTER_ZONE, this, "", 0);
|
||||
}
|
||||
|
||||
if (parse->ZoneHasQuestSub(EVENT_ENTER_ZONE)) {
|
||||
std::vector<std::any> 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
|
||||
@@ -4709,6 +4714,12 @@ void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app)
|
||||
quest_return = parse->EventPlayer(EVENT_CLICK_DOOR, this, std::to_string(cd->doorid), 0, &args);
|
||||
}
|
||||
|
||||
if (parse->ZoneHasQuestSub(EVENT_CLICK_DOOR)) {
|
||||
std::vector<std::any> args = { currentdoor, this };
|
||||
|
||||
quest_return = parse->EventZone(EVENT_CLICK_DOOR, zone, std::to_string(cd->doorid), 0, &args);
|
||||
}
|
||||
|
||||
if (quest_return == 0) {
|
||||
currentdoor->HandleClick(this, 0);
|
||||
}
|
||||
@@ -4741,6 +4752,11 @@ void Client::Handle_OP_ClickObject(const EQApplicationPacket *app)
|
||||
parse->EventPlayer(EVENT_CLICK_OBJECT, this, std::to_string(click_object->drop_id), GetID(), &args);
|
||||
}
|
||||
|
||||
if (parse->ZoneHasQuestSub(EVENT_CLICK_OBJECT)) {
|
||||
std::vector<std::any> args = { object, this };
|
||||
parse->EventZone(EVENT_CLICK_OBJECT, zone, std::to_string(click_object->drop_id), GetID(), &args);
|
||||
}
|
||||
|
||||
if (IsDevToolsEnabled()) {
|
||||
SetObjectToolEntityId(entity->GetID());
|
||||
ObjectManipulation::CommandHeader(this);
|
||||
@@ -12042,6 +12058,11 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app)
|
||||
parse->EventPlayer(EVENT_POPUP_RESPONSE, this, std::to_string(popup_response->popupid), 0);
|
||||
}
|
||||
|
||||
if (parse->ZoneHasQuestSub(EVENT_POPUP_RESPONSE)) {
|
||||
std::vector<std::any> args = { this };
|
||||
parse->EventZone(EVENT_POPUP_RESPONSE, zone, std::to_string(popup_response->popupid), 0, &args);
|
||||
}
|
||||
|
||||
auto t = GetTarget();
|
||||
if (t) {
|
||||
parse->EventBotMercNPC(EVENT_POPUP_RESPONSE, t, this, [&]() { return std::to_string(popup_response->popupid); });
|
||||
|
||||
Reference in New Issue
Block a user