diff --git a/dScripts/CMakeLists.txt b/dScripts/CMakeLists.txt index 66e3b65b..0a907a05 100644 --- a/dScripts/CMakeLists.txt +++ b/dScripts/CMakeLists.txt @@ -247,6 +247,7 @@ set(DSCRIPT_SOURCES "ActivityManager.cpp" "WaveBossHammerling.cpp" "WaveBossHorsemen.cpp" "WaveBossSpiderling.cpp" + "WblGenericZone.cpp" "WhFans.cpp" "WildAmbients.cpp" "WishingWellServer.cpp" diff --git a/dScripts/CppScripts.cpp b/dScripts/CppScripts.cpp index 7d114cd3..d313f2f9 100644 --- a/dScripts/CppScripts.cpp +++ b/dScripts/CppScripts.cpp @@ -288,6 +288,9 @@ #include "RockHydrantBroken.h" #include "WhFans.h" +// WBL scripts +#include "WblGenericZone.h" + //Big bad global bc this is a namespace and not a class: InvalidScript* invalidToReturn = new InvalidScript(); std::map m_Scripts; @@ -834,12 +837,17 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr script = new BuccaneerValiantShip(); else if (scriptName == "scripts\\EquipmentScripts\\FireFirstSkillonStartup.lua") script = new FireFirstSkillonStartup(); + // FB else if (scriptName == "scripts\\ai\\NS\\WH\\L_ROCKHYDRANT_BROKEN.lua") script = new RockHydrantBroken(); else if (scriptName == "scripts\\ai\\NS\\L_NS_WH_FANS.lua") script = new WhFans(); + // WBL + else if (scriptName == "scripts\\zone\\LUPs\\WBL_generic_zone.lua") + script = new WblGenericZone(); + //Ignore these scripts: else if (scriptName == "scripts\\02_server\\Enemy\\General\\L_SUSPEND_LUA_AI.lua") script = invalidToReturn; diff --git a/dScripts/WblGenericZone.cpp b/dScripts/WblGenericZone.cpp new file mode 100644 index 00000000..5a670d8e --- /dev/null +++ b/dScripts/WblGenericZone.cpp @@ -0,0 +1,10 @@ +#include "WblGenericZone.h" +#include "Player.h" + +void WblGenericZone::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) { + if (args == m_WblAbortMsg) { + if (!sender) return; + auto player = dynamic_cast(sender); + if (player) player->SendToZone(m_WblMainZone); + } +} diff --git a/dScripts/WblGenericZone.h b/dScripts/WblGenericZone.h new file mode 100644 index 00000000..55b66e81 --- /dev/null +++ b/dScripts/WblGenericZone.h @@ -0,0 +1,10 @@ +#pragma once +#include "CppScripts.h" +class WblGenericZone : public CppScripts::Script +{ +public: + void OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) override; +private: + const LWOMAPID m_WblMainZone = 1600; + const std::string m_WblAbortMsg = "AbortWBLZone"; +};