mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-10 02:08:20 +00:00
Script for aborting a wbl zone transfer (#766)
This commit is contained in:
parent
26f2eb409f
commit
14d4bf3cc5
@ -247,6 +247,7 @@ set(DSCRIPT_SOURCES "ActivityManager.cpp"
|
||||
"WaveBossHammerling.cpp"
|
||||
"WaveBossHorsemen.cpp"
|
||||
"WaveBossSpiderling.cpp"
|
||||
"WblGenericZone.cpp"
|
||||
"WhFans.cpp"
|
||||
"WildAmbients.cpp"
|
||||
"WishingWellServer.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<std::string, CppScripts::Script*> 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;
|
||||
|
10
dScripts/WblGenericZone.cpp
Normal file
10
dScripts/WblGenericZone.cpp
Normal file
@ -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<Player*>(sender);
|
||||
if (player) player->SendToZone(m_WblMainZone);
|
||||
}
|
||||
}
|
10
dScripts/WblGenericZone.h
Normal file
10
dScripts/WblGenericZone.h
Normal file
@ -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";
|
||||
};
|
Loading…
Reference in New Issue
Block a user