mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-12-31 08:59:39 -06:00
Compare commits
2 Commits
stupid-fea
...
unique-ptr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90e2b5c6b7 | ||
|
|
42367deeca |
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +1,6 @@
|
||||
[submodule "thirdparty/cpp-httplib"]
|
||||
path = thirdparty/cpp-httplib
|
||||
url = https://github.com/yhirose/cpp-httplib
|
||||
[submodule "thirdparty/tinyxml2"]
|
||||
path = thirdparty/tinyxml2
|
||||
url = https://github.com/leethomason/tinyxml2
|
||||
|
||||
@@ -247,6 +247,7 @@ include_directories(
|
||||
"thirdparty/recastnavigation"
|
||||
"thirdparty/SQLite"
|
||||
"thirdparty/cpplinq"
|
||||
"thirdparty/cpp-httplib"
|
||||
"thirdparty/MD5"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
PROJECT_VERSION_MAJOR=3
|
||||
PROJECT_VERSION_MINOR=0
|
||||
PROJECT_VERSION_MAJOR=2
|
||||
PROJECT_VERSION_MINOR=3
|
||||
PROJECT_VERSION_PATCH=0
|
||||
|
||||
# Debugging
|
||||
|
||||
50
README.md
50
README.md
@@ -32,8 +32,6 @@ Darkflame Universe is a server emulator and does not distribute any LEGO® Unive
|
||||
* To connect to the server, either delete the file `boot.cfg` which is found in your LEGO Universe client, rename the file `boot.cfg` to something else or follow the steps [here](#allowing-a-user-to-connect-to-your-server) if you wish to keep the file.
|
||||
* When shutting down the server, it is highly recommended to click the `MasterServer.exe` window and hold `ctrl` while pressing `c` to stop the server.
|
||||
* We are working on a way to make it so when you close the game, the server stops automatically alongside when you open the game, the server starts automatically.
|
||||
* If you are not setting a server up on mac, you can ignore this note
|
||||
* Note: you'll need to allow through System Preferences `AuthServer`, `ChatServer`, `MasterServer`, `WorldServer` and `libmariadbcpp.dylib` to run. The initial pop-up will block it due to the binaries being unsigned, after allowing them to run the servers will run as normal.
|
||||
|
||||
<font size="32">**If you are not planning on hosting a server for others, working in the codebase or wanting to use MariaDB for a database, you can stop reading here.**</font>
|
||||
|
||||
@@ -70,12 +68,6 @@ git clone --recursive https://github.com/DarkflameUniverse/DarkflameServer
|
||||
|
||||
## Install dependencies
|
||||
|
||||
### Required compiler versions
|
||||
- g++11 or greater
|
||||
- MSVC unchecked
|
||||
- clang unchecked
|
||||
- appleclang unchecked
|
||||
|
||||
### Windows packages
|
||||
Ensure that you have either the [MSVC C++ compiler](https://visualstudio.microsoft.com/vs/features/cplusplus/) (recommended) or the [Clang compiler](https://github.com/llvm/llvm-project/releases/) installed.
|
||||
You'll also need to download and install [CMake](https://cmake.org/download/) (version <font size="4">**CMake version 3.25**</font> or later!).
|
||||
@@ -210,7 +202,6 @@ If you would like to build the server faster, append `-j<number>` where number i
|
||||
### Notes
|
||||
Depending on your operating system, you may need to adjust some pre-processor defines in [CMakeVariables.txt](./CMakeVariables.txt) before building:
|
||||
* If you are on MacOS, ensure OPENSSL_ROOT_DIR is pointing to the openssl root directory.
|
||||
* By default it should be set to the correct directory.
|
||||
* If you are using a Darkflame Universe client, ensure `client_net_version` in `build/sharedconfig.ini` is changed to 171023.
|
||||
|
||||
## Configuring your server
|
||||
@@ -233,41 +224,28 @@ Navigate to `build/sharedconfig.ini` and fill in the following fields:
|
||||
* `chatconfig.ini` contains a port option.
|
||||
* `masterconfig.ini` contains options related to permissions you want to run your servers with.
|
||||
* `sharedconfig.ini` contains several options that are shared across all servers
|
||||
* `worldconfig.ini` contains several options to turn on Quality of Life improvements should you want them. If you would like the most vanilla experience possible, you will need to turn some of these settings off.
|
||||
* `worldconfig.ini` contains several options to turn on QOL improvements should you want them. If you would like the most vanilla experience possible, you will need to turn some of these settings off.
|
||||
|
||||
## Verify your setup
|
||||
Your build directory should contain at a minimum all of the following files.
|
||||
All listed files are required for a server to start.
|
||||
`ini` files can be located at the environment variable `DLU_CONFIG_DIR` and do not need to be located in this directory.
|
||||
(windows will have .exe at the end of the executables):
|
||||
* sharedconfig.ini
|
||||
* AuthServer(.exe)
|
||||
Your build directory should now look like this:
|
||||
* AuthServer
|
||||
* ChatServer
|
||||
* MasterServer
|
||||
* WorldServer
|
||||
* authconfig.ini
|
||||
* ChatServer(.exe)
|
||||
* chatconfig.ini
|
||||
* MasterServer(.exe)
|
||||
* masterconfig.ini
|
||||
* WorldServer(.exe)
|
||||
* sharedconfig.ini
|
||||
* worldconfig.ini
|
||||
* blocklist.dcf
|
||||
* migrations
|
||||
* vanity
|
||||
* navmeshes
|
||||
* 1 of the following lists based on platform
|
||||
* windows
|
||||
* libmariadb.dll
|
||||
* mariadbcpp.dll
|
||||
* zlib.dll
|
||||
* MacOS
|
||||
* libmariadbcpp.dylib
|
||||
* *nix
|
||||
* libmariadbcpp.so
|
||||
* ...
|
||||
|
||||
## Running the server
|
||||
If everything has been configured correctly you should now be able to run the `MasterServer` binary which is located in the `build` directory. Darkflame Universe utilizes port numbers under 1024, so under Linux you have to give the `AuthServer` binary network permissions by running the following command:
|
||||
If everything has been configured correctly you should now be able to run the `MasterServer` binary which is located in the `build` directory. Darkflame Universe utilizes port numbers under 1024, so under Linux you either have to give the `AuthServer` binary network permissions or run it under sudo.
|
||||
To give `AuthServer` network permissions and not require sudo, run the following command
|
||||
```bash
|
||||
sudo setcap 'cap_net_bind_service=+ep' AuthServer
|
||||
```
|
||||
and then go to `build/masterconfig.ini` and change `use_sudo_auth` to 0.
|
||||
|
||||
### Linux Service
|
||||
If you are running this on a linux based system, it will use your terminal to run the program interactively, preventing you using it for other tasks and requiring it to be open to run the server.
|
||||
@@ -330,14 +308,8 @@ To connect to a server follow these steps:
|
||||
* Replace the contents after to `:` and the following `,` with what you configured as the server's public facing IP. For example `AUTHSERVERIP=0:localhost` for locally hosted servers
|
||||
* Next locate the line `UGCUSE3DSERVICES=7:`
|
||||
* Ensure the number after the 7 is a `0`
|
||||
* Alternatively, remove the line with `UGCUSE3DSERVICES` altogether
|
||||
* Launch `legouniverse.exe`, through `wine` if on a Unix-like operating system
|
||||
* Note that if you are on WSL2, you will need to configure the public IP in the server and client to be the IP of the WSL2 instance and not localhost, which can be found by running `ifconfig` in the terminal. Windows defaults to WSL1, so this will not apply to most users.
|
||||
As an example, here is what the boot.cfg is required to contain for a server with the ip 12.34.56.78
|
||||
```cfg
|
||||
AUTHSERVERIP=0:12.34.56.78,
|
||||
UGCUSE3DSERVICES=7:0
|
||||
```
|
||||
|
||||
## Updating your server
|
||||
To update your server to the latest version navigate to your cloned directory
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "Game.h"
|
||||
#include "Server.h"
|
||||
|
||||
|
||||
namespace Game {
|
||||
Logger* logger = nullptr;
|
||||
dServer* server = nullptr;
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
add_executable(AuthServer "AuthServer.cpp")
|
||||
|
||||
target_link_libraries(AuthServer ${COMMON_LIBRARIES} dServer)
|
||||
|
||||
target_include_directories(AuthServer PRIVATE ${PROJECT_SOURCE_DIR}/dServer)
|
||||
|
||||
add_compile_definitions(AuthServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"")
|
||||
|
||||
@@ -2,25 +2,16 @@
|
||||
#include <string>
|
||||
|
||||
//For reading null-terminated strings
|
||||
template<typename StringType>
|
||||
StringType ReadString(std::istream& instream) {
|
||||
StringType toReturn{};
|
||||
typename StringType::value_type buffer{};
|
||||
std::string BinaryIO::ReadString(std::istream& instream) {
|
||||
std::string toReturn;
|
||||
char buffer;
|
||||
|
||||
BinaryIO::BinaryRead(instream, buffer);
|
||||
|
||||
while (buffer != 0x00) {
|
||||
toReturn += buffer;
|
||||
BinaryIO::BinaryRead(instream, buffer);
|
||||
BinaryRead(instream, buffer);
|
||||
}
|
||||
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
std::string BinaryIO::ReadString(std::istream& instream) {
|
||||
return ::ReadString<std::string>(instream);
|
||||
}
|
||||
|
||||
std::u8string BinaryIO::ReadU8String(std::istream& instream) {
|
||||
return ::ReadString<std::u8string>(instream);
|
||||
}
|
||||
|
||||
@@ -65,8 +65,6 @@ namespace BinaryIO {
|
||||
|
||||
std::string ReadString(std::istream& instream);
|
||||
|
||||
std::u8string ReadU8String(std::istream& instream);
|
||||
|
||||
inline bool DoesFileExist(const std::string& name) {
|
||||
std::ifstream f(name.c_str());
|
||||
return f.good();
|
||||
|
||||
@@ -65,14 +65,13 @@ int64_t FdbToSqlite::Convert::ReadInt64(std::istream& cdClientBuffer) {
|
||||
return value;
|
||||
}
|
||||
|
||||
// cdclient is encoded in latin1
|
||||
std::string FdbToSqlite::Convert::ReadString(std::istream& cdClientBuffer) {
|
||||
int32_t prevPosition = SeekPointer(cdClientBuffer);
|
||||
|
||||
const auto readString = BinaryIO::ReadU8String(cdClientBuffer);
|
||||
auto readString = BinaryIO::ReadString(cdClientBuffer);
|
||||
|
||||
cdClientBuffer.seekg(prevPosition);
|
||||
return GeneralUtils::Latin1ToUTF8(readString);
|
||||
return readString;
|
||||
}
|
||||
|
||||
int32_t FdbToSqlite::Convert::SeekPointer(std::istream& cdClientBuffer) {
|
||||
|
||||
@@ -167,15 +167,6 @@ std::u16string GeneralUtils::ASCIIToUTF16(const std::string_view string, const s
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string GeneralUtils::Latin1ToUTF8(const std::u8string_view string, const size_t size) {
|
||||
std::string toReturn{};
|
||||
|
||||
for (const auto u : string) {
|
||||
PushUTF8CodePoint(toReturn, u);
|
||||
}
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
//! Converts a (potentially-ill-formed) UTF-16 string to UTF-8
|
||||
//! See: <http://simonsapin.github.io/wtf-8/#decoding-ill-formed-utf-16>
|
||||
std::string GeneralUtils::UTF16ToWTF8(const std::u16string_view string, const size_t size) {
|
||||
@@ -184,9 +175,9 @@ std::string GeneralUtils::UTF16ToWTF8(const std::u16string_view string, const si
|
||||
ret.reserve(newSize);
|
||||
|
||||
for (size_t i = 0; i < newSize; ++i) {
|
||||
const auto u = string[i];
|
||||
const char16_t u = string[i];
|
||||
if (IsLeadSurrogate(u) && (i + 1) < newSize) {
|
||||
const auto next = string[i + 1];
|
||||
const char16_t next = string[i + 1];
|
||||
if (IsTrailSurrogate(next)) {
|
||||
i += 1;
|
||||
const char32_t cp = 0x10000
|
||||
@@ -300,12 +291,11 @@ std::u16string GeneralUtils::ReadWString(RakNet::BitStream& inStream) {
|
||||
|
||||
std::vector<std::string> GeneralUtils::GetSqlFileNamesFromFolder(const std::string_view folder) {
|
||||
// Because we dont know how large the initial number before the first _ is we need to make it a map like so.
|
||||
std::map<uint32_t, std::string> filenames{};
|
||||
std::map<uint32_t, std::string> filenames{};
|
||||
for (const auto& t : std::filesystem::directory_iterator(folder)) {
|
||||
if (t.is_directory() || t.is_symlink()) continue;
|
||||
auto filename = t.path().filename().string();
|
||||
const auto index = std::stoi(GeneralUtils::SplitString(filename, '_').at(0));
|
||||
filenames.emplace(index, std::move(filename));
|
||||
auto filename = t.path().filename().string();
|
||||
const auto index = std::stoi(GeneralUtils::SplitString(filename, '_').at(0));
|
||||
filenames.emplace(index, std::move(filename));
|
||||
}
|
||||
|
||||
// Now sort the map by the oldest migration.
|
||||
|
||||
@@ -51,14 +51,6 @@ namespace GeneralUtils {
|
||||
bool _NextUTF8Char(std::string_view& slice, uint32_t& out);
|
||||
}
|
||||
|
||||
//! Converts a Latin1 string to a UTF-8 string
|
||||
/*!
|
||||
\param string The string to convert
|
||||
\param size A size to trim the string to. Default is SIZE_MAX (No trimming)
|
||||
\return An UTF-8 representation of the string
|
||||
*/
|
||||
std::string Latin1ToUTF8(const std::u8string_view string, const size_t size = SIZE_MAX);
|
||||
|
||||
//! Converts a UTF-16 string to a UTF-8 string
|
||||
/*!
|
||||
\param string The string to convert
|
||||
|
||||
@@ -957,7 +957,6 @@ namespace MessageType {
|
||||
MODIFY_PLAYER_ZONE_STATISTIC = 1046,
|
||||
APPLY_EXTERNAL_FORCE = 1049,
|
||||
GET_APPLIED_EXTERNAL_FORCE = 1050,
|
||||
ACTIVITY_NOTIFY = 1051,
|
||||
ITEM_EQUIPPED = 1052,
|
||||
ACTIVITY_STATE_CHANGE_REQUEST = 1053,
|
||||
OVERRIDE_FRICTION = 1054,
|
||||
@@ -1254,7 +1253,6 @@ namespace MessageType {
|
||||
VEHICLE_NOTIFY_HIT_EXPLODER = 1385,
|
||||
CHECK_NEAREST_ROCKET_LAUNCH_PRE_CONDITIONS = 1386,
|
||||
REQUEST_NEAREST_ROCKET_LAUNCH_PRE_CONDITIONS = 1387,
|
||||
CONFIGURE_RACING_CONTROL = 1388,
|
||||
CONFIGURE_RACING_CONTROL_CLIENT = 1389,
|
||||
NOTIFY_RACING_CLIENT = 1390,
|
||||
RACING_PLAYER_HACK_CAR = 1391,
|
||||
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
uint32_t lastPlayedTimestamp{};
|
||||
float primaryScore{};
|
||||
float secondaryScore{};
|
||||
float tertiaryScore{};
|
||||
uint32_t tertiaryScore{};
|
||||
uint32_t numWins{};
|
||||
uint32_t numTimesPlayed{};
|
||||
uint32_t ranking{};
|
||||
|
||||
@@ -56,7 +56,6 @@ std::optional<IProperty::PropertyEntranceResult> MySQLDatabase::GetProperties(co
|
||||
params.playerId
|
||||
);
|
||||
if (count->next()) {
|
||||
if (!result) result = IProperty::PropertyEntranceResult();
|
||||
result->totalEntriesMatchingQuery = count->getUInt("count");
|
||||
}
|
||||
} else {
|
||||
@@ -110,13 +109,11 @@ std::optional<IProperty::PropertyEntranceResult> MySQLDatabase::GetProperties(co
|
||||
params.playerSort
|
||||
);
|
||||
if (count->next()) {
|
||||
if (!result) result = IProperty::PropertyEntranceResult();
|
||||
result->totalEntriesMatchingQuery = count->getUInt("count");
|
||||
}
|
||||
}
|
||||
|
||||
while (properties->next()) {
|
||||
if (!result) result = IProperty::PropertyEntranceResult();
|
||||
auto& entry = result->entries.emplace_back();
|
||||
entry.id = properties->getUInt64("id");
|
||||
entry.ownerId = properties->getUInt64("owner_id");
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "dConfig.h"
|
||||
#include "Logger.h"
|
||||
#include "dPlatforms.h"
|
||||
#include "BinaryPathFinder.h"
|
||||
|
||||
// Static Variables
|
||||
|
||||
@@ -18,14 +17,7 @@ namespace {
|
||||
void SQLiteDatabase::Connect() {
|
||||
LOG("Using SQLite database");
|
||||
con = new CppSQLite3DB();
|
||||
const auto path = BinaryPathFinder::GetBinaryDir() / Game::config->GetValue("sqlite_database_path");
|
||||
|
||||
if (!std::filesystem::exists(path)) {
|
||||
LOG("Creating sqlite path %s", path.string().c_str());
|
||||
std::filesystem::create_directories(path.parent_path());
|
||||
}
|
||||
|
||||
con->open(path.string().c_str());
|
||||
con->open(Game::config->GetValue("sqlite_database_path").c_str());
|
||||
isConnected = true;
|
||||
|
||||
// Make sure wal is enabled for the database.
|
||||
|
||||
@@ -296,12 +296,6 @@ void Character::SaveXMLToDatabase() {
|
||||
flags->LinkEndChild(s);
|
||||
}
|
||||
|
||||
if (GetPlayerFlag(ePlayerFlag::EQUPPED_TRIAL_FACTION_GEAR)) {
|
||||
auto* s = m_Doc.NewElement("s");
|
||||
s->SetAttribute("si", ePlayerFlag::EQUPPED_TRIAL_FACTION_GEAR);
|
||||
flags->LinkEndChild(s);
|
||||
}
|
||||
|
||||
SaveXmlRespawnCheckpoints();
|
||||
|
||||
//Call upon the entity to update our xmlDoc:
|
||||
@@ -363,62 +357,49 @@ void Character::SetPlayerFlag(const uint32_t flagId, const bool value) {
|
||||
}
|
||||
}
|
||||
|
||||
if (flagId == EQUPPED_TRIAL_FACTION_GEAR || flagId == IS_NEWS_SCREEN_VISIBLE) {
|
||||
if (value) m_SessionFlags.insert(flagId);
|
||||
else m_SessionFlags.erase(flagId);
|
||||
} else {
|
||||
// Calculate the index first
|
||||
auto flagIndex = uint32_t(std::floor(flagId / 64));
|
||||
// Calculate the index first
|
||||
auto flagIndex = uint32_t(std::floor(flagId / 64));
|
||||
|
||||
const auto shiftedValue = 1ULL << flagId % 64;
|
||||
const auto shiftedValue = 1ULL << flagId % 64;
|
||||
|
||||
auto it = m_PlayerFlags.find(flagIndex);
|
||||
auto it = m_PlayerFlags.find(flagIndex);
|
||||
|
||||
// Check if flag index exists
|
||||
if (it != m_PlayerFlags.end()) {
|
||||
// Update the value
|
||||
if (value) {
|
||||
it->second |= shiftedValue;
|
||||
} else {
|
||||
it->second &= ~shiftedValue;
|
||||
}
|
||||
// Check if flag index exists
|
||||
if (it != m_PlayerFlags.end()) {
|
||||
// Update the value
|
||||
if (value) {
|
||||
it->second |= shiftedValue;
|
||||
} else {
|
||||
if (value) {
|
||||
// Otherwise, insert the value
|
||||
uint64_t flagValue = 0;
|
||||
it->second &= ~shiftedValue;
|
||||
}
|
||||
} else {
|
||||
if (value) {
|
||||
// Otherwise, insert the value
|
||||
uint64_t flagValue = 0;
|
||||
|
||||
flagValue |= shiftedValue;
|
||||
flagValue |= shiftedValue;
|
||||
|
||||
m_PlayerFlags.insert(std::make_pair(flagIndex, flagValue));
|
||||
}
|
||||
m_PlayerFlags.insert(std::make_pair(flagIndex, flagValue));
|
||||
}
|
||||
}
|
||||
|
||||
// Notify the client that a flag has changed server-side
|
||||
GameMessages::SendNotifyClientFlagChange(m_ObjectID, flagId, value, m_ParentUser->GetSystemAddress());
|
||||
}
|
||||
|
||||
bool Character::GetPlayerFlag(const uint32_t flagId) const {
|
||||
using enum ePlayerFlag;
|
||||
// Calculate the index first
|
||||
const auto flagIndex = uint32_t(std::floor(flagId / 64));
|
||||
|
||||
bool toReturn = false; //by def, return false.
|
||||
const auto shiftedValue = 1ULL << flagId % 64;
|
||||
|
||||
// TODO make actual session flag checker using flags table in database.
|
||||
if (flagId == EQUPPED_TRIAL_FACTION_GEAR || flagId == IS_NEWS_SCREEN_VISIBLE) {
|
||||
toReturn = m_SessionFlags.contains(flagId);
|
||||
} else {
|
||||
// Calculate the index first
|
||||
const auto flagIndex = uint32_t(std::floor(flagId / 64));
|
||||
|
||||
const auto shiftedValue = 1ULL << flagId % 64;
|
||||
|
||||
auto it = m_PlayerFlags.find(flagIndex);
|
||||
if (it != m_PlayerFlags.end()) {
|
||||
// Don't set the data if we don't have to
|
||||
toReturn = (it->second & shiftedValue) != 0;
|
||||
}
|
||||
auto it = m_PlayerFlags.find(flagIndex);
|
||||
if (it != m_PlayerFlags.end()) {
|
||||
// Don't set the data if we don't have to
|
||||
return (it->second & shiftedValue) != 0;
|
||||
}
|
||||
|
||||
return toReturn;
|
||||
return false; //by def, return false.
|
||||
}
|
||||
|
||||
void Character::SetRetroactiveFlags() {
|
||||
|
||||
@@ -620,12 +620,6 @@ private:
|
||||
*/
|
||||
uint64_t m_LastLogin{};
|
||||
|
||||
/**
|
||||
* Flags only set for the duration of a session
|
||||
*
|
||||
*/
|
||||
std::set<uint32_t> m_SessionFlags;
|
||||
|
||||
/**
|
||||
* The gameplay flags this character has (not just true values)
|
||||
*/
|
||||
|
||||
@@ -386,9 +386,6 @@ void Entity::Initialize() {
|
||||
if (m_Character) {
|
||||
comp->LoadFromXml(m_Character->GetXMLDoc());
|
||||
} else {
|
||||
// extraInfo overrides. Client ORs the database smashable and the luz smashable.
|
||||
comp->SetIsSmashable(comp->GetIsSmashable() | isSmashable);
|
||||
|
||||
if (componentID > 0) {
|
||||
std::vector<CDDestructibleComponent> destCompData = destCompTable->Query([=](CDDestructibleComponent entry) { return (entry.id == componentID); });
|
||||
|
||||
@@ -423,6 +420,9 @@ void Entity::Initialize() {
|
||||
comp->SetMinCoins(currencyValues[0].minvalue);
|
||||
comp->SetMaxCoins(currencyValues[0].maxvalue);
|
||||
}
|
||||
|
||||
// extraInfo overrides. Client ORs the database smashable and the luz smashable.
|
||||
comp->SetIsSmashable(comp->GetIsSmashable() | isSmashable);
|
||||
}
|
||||
} else {
|
||||
comp->SetHealth(1);
|
||||
@@ -775,12 +775,6 @@ void Entity::Initialize() {
|
||||
// Hacky way to trigger these when the object has had a chance to get constructed
|
||||
AddCallbackTimer(0, [this]() {
|
||||
this->GetScript()->OnStartup(this);
|
||||
if (this->m_ParentEntity) {
|
||||
GameMessages::ChildLoaded childLoaded;
|
||||
childLoaded.childID = this->m_ObjectID;
|
||||
childLoaded.templateID = this->GetLOT();
|
||||
this->m_ParentEntity->OnChildLoaded(childLoaded);
|
||||
}
|
||||
});
|
||||
|
||||
if (!m_Character && Game::entityManager->GetGhostingEnabled()) {
|
||||
@@ -860,9 +854,6 @@ void Entity::Subscribe(LWOOBJID scriptObjId, CppScripts::Script* scriptToAdd, co
|
||||
auto* destroyableComponent = GetComponent<DestroyableComponent>();
|
||||
if (!destroyableComponent) return;
|
||||
destroyableComponent->Subscribe(scriptObjId, scriptToAdd);
|
||||
} else if (notificationName == "PlayerResurrectionFinished") {
|
||||
LOG("Subscribing to PlayerResurrectionFinished");
|
||||
m_Subscriptions[scriptObjId][notificationName] = scriptToAdd;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -871,9 +862,6 @@ void Entity::Unsubscribe(LWOOBJID scriptObjId, const std::string& notificationNa
|
||||
auto* destroyableComponent = GetComponent<DestroyableComponent>();
|
||||
if (!destroyableComponent) return;
|
||||
destroyableComponent->Unsubscribe(scriptObjId);
|
||||
} else if (notificationName == "PlayerResurrectionFinished") {
|
||||
LOG("Unsubscribing from PlayerResurrectionFinished");
|
||||
m_Subscriptions[scriptObjId].erase(notificationName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1505,34 +1493,13 @@ void Entity::OnChoiceBoxResponse(Entity* sender, int32_t button, const std::u16s
|
||||
GetScript()->OnChoiceBoxResponse(this, sender, button, buttonIdentifier, identifier);
|
||||
}
|
||||
|
||||
void Entity::OnActivityNotify(GameMessages::ActivityNotify& notify) {
|
||||
GetScript()->OnActivityNotify(this, notify);
|
||||
}
|
||||
|
||||
void Entity::OnShootingGalleryFire(GameMessages::ShootingGalleryFire& fire) {
|
||||
GetScript()->OnShootingGalleryFire(*this, fire);
|
||||
}
|
||||
|
||||
void Entity::OnChildLoaded(GameMessages::ChildLoaded& childLoaded) {
|
||||
GetScript()->OnChildLoaded(*this, childLoaded);
|
||||
}
|
||||
|
||||
void Entity::NotifyPlayerResurrectionFinished(GameMessages::PlayerResurrectionFinished& msg) {
|
||||
for (const auto& [id, scriptList] : m_Subscriptions) {
|
||||
auto it = scriptList.find("PlayerResurrectionFinished");
|
||||
if (it == scriptList.end()) continue;
|
||||
|
||||
it->second->NotifyPlayerResurrectionFinished(*this, msg);
|
||||
}
|
||||
}
|
||||
|
||||
void Entity::RequestActivityExit(Entity* sender, LWOOBJID player, bool canceled) {
|
||||
GetScript()->OnRequestActivityExit(sender, player, canceled);
|
||||
}
|
||||
|
||||
CppScripts::Script* const Entity::GetScript() {
|
||||
auto* scriptComponent = GetComponent<ScriptComponent>();
|
||||
auto* script = scriptComponent ? scriptComponent->GetScript() : CppScripts::GetInvalidScript();
|
||||
auto* script = scriptComponent ? scriptComponent->GetScript() : &CppScripts::GetInvalidScript();
|
||||
DluAssert(script != nullptr);
|
||||
return script;
|
||||
}
|
||||
@@ -1565,7 +1532,7 @@ void Entity::Kill(Entity* murderer, const eKillType killType) {
|
||||
|
||||
m_DieCallbacks.clear();
|
||||
|
||||
//お前はもう死んでいる
|
||||
//OMAI WA MOU, SHINDERIU
|
||||
|
||||
GetScript()->OnDie(this, murderer);
|
||||
|
||||
|
||||
@@ -13,13 +13,6 @@
|
||||
#include "eKillType.h"
|
||||
#include "Observable.h"
|
||||
|
||||
namespace GameMessages {
|
||||
struct ActivityNotify;
|
||||
struct ShootingGalleryFire;
|
||||
struct ChildLoaded;
|
||||
struct PlayerResurrectionFinished;
|
||||
};
|
||||
|
||||
namespace Loot {
|
||||
class Info;
|
||||
};
|
||||
@@ -217,10 +210,6 @@ public:
|
||||
void OnZonePropertyModelRemoved(Entity* player);
|
||||
void OnZonePropertyModelRemovedWhileEquipped(Entity* player);
|
||||
void OnZonePropertyModelRotated(Entity* player);
|
||||
void OnActivityNotify(GameMessages::ActivityNotify& notify);
|
||||
void OnShootingGalleryFire(GameMessages::ShootingGalleryFire& notify);
|
||||
void OnChildLoaded(GameMessages::ChildLoaded& childLoaded);
|
||||
void NotifyPlayerResurrectionFinished(GameMessages::PlayerResurrectionFinished& msg);
|
||||
|
||||
void OnMessageBoxResponse(Entity* sender, int32_t button, const std::u16string& identifier, const std::u16string& userData);
|
||||
void OnChoiceBoxResponse(Entity* sender, int32_t button, const std::u16string& buttonIdentifier, const std::u16string& identifier);
|
||||
@@ -374,9 +363,6 @@ protected:
|
||||
* Collision
|
||||
*/
|
||||
std::vector<LWOOBJID> m_TargetsInPhantom;
|
||||
|
||||
// objectID of receiver and map of notification name to script
|
||||
std::map<LWOOBJID, std::map<std::string, CppScripts::Script*>> m_Subscriptions;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -95,7 +95,7 @@ void QueryToLdf(Leaderboard& leaderboard, const std::vector<ILeaderboard::Entry>
|
||||
// Score:1
|
||||
entry.push_back(new LDFData<int32_t>(u"Streak", leaderboardEntry.secondaryScore));
|
||||
// Streak:1
|
||||
entry.push_back(new LDFData<float>(u"HitPercentage", leaderboardEntry.tertiaryScore));
|
||||
entry.push_back(new LDFData<float>(u"HitPercentage", (leaderboardEntry.tertiaryScore / 100.0f)));
|
||||
// HitPercentage:3 between 0 and 1
|
||||
break;
|
||||
case Racing:
|
||||
@@ -199,9 +199,9 @@ std::vector<ILeaderboard::Entry> FilterFriends(const std::vector<ILeaderboard::E
|
||||
std::vector<ILeaderboard::Entry> friendsLeaderboard;
|
||||
for (const auto& entry : leaderboard) {
|
||||
const auto res = std::ranges::find_if(friendOfPlayer, [&entry, relatedPlayer](const FriendData& data) {
|
||||
return entry.charId == data.friendID;
|
||||
return entry.charId == data.friendID || entry.charId == relatedPlayer;
|
||||
});
|
||||
if (res != friendOfPlayer.cend() || entry.charId == relatedPlayer) {
|
||||
if (res != friendOfPlayer.cend()) {
|
||||
friendsLeaderboard.push_back(entry);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ set(DGAME_DCOMPONENTS_SOURCES
|
||||
"BuildBorderComponent.cpp"
|
||||
"CharacterComponent.cpp"
|
||||
"CollectibleComponent.cpp"
|
||||
"Component.cpp"
|
||||
"ControllablePhysicsComponent.cpp"
|
||||
"DestroyableComponent.cpp"
|
||||
"DonationVendorComponent.cpp"
|
||||
|
||||
34
dGame/dComponents/Component.cpp
Normal file
34
dGame/dComponents/Component.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#include "Component.h"
|
||||
|
||||
|
||||
Component::Component(Entity* parent) {
|
||||
m_Parent = parent;
|
||||
}
|
||||
|
||||
Component::~Component() {
|
||||
|
||||
}
|
||||
|
||||
Entity* Component::GetParent() const {
|
||||
return m_Parent;
|
||||
}
|
||||
|
||||
void Component::Update(float deltaTime) {
|
||||
|
||||
}
|
||||
|
||||
void Component::OnUse(Entity* originator) {
|
||||
|
||||
}
|
||||
|
||||
void Component::UpdateXml(tinyxml2::XMLDocument& doc) {
|
||||
|
||||
}
|
||||
|
||||
void Component::LoadFromXml(const tinyxml2::XMLDocument& doc) {
|
||||
|
||||
}
|
||||
|
||||
void Component::Serialize(RakNet::BitStream& outBitStream, bool isConstruction) {
|
||||
|
||||
}
|
||||
@@ -1,12 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace tinyxml2 {
|
||||
class XMLDocument;
|
||||
}
|
||||
|
||||
namespace RakNet {
|
||||
class BitStream;
|
||||
}
|
||||
#include "tinyxml2.h"
|
||||
|
||||
class Entity;
|
||||
|
||||
@@ -15,40 +9,40 @@ class Entity;
|
||||
*/
|
||||
class Component {
|
||||
public:
|
||||
Component(Entity* parent) : m_Parent{ parent } {}
|
||||
virtual ~Component() = default;
|
||||
Component(Entity* parent);
|
||||
virtual ~Component();
|
||||
|
||||
/**
|
||||
* Gets the owner of this component
|
||||
* @return the owner of this component
|
||||
*/
|
||||
Entity* GetParent() const { return m_Parent; }
|
||||
Entity* GetParent() const;
|
||||
|
||||
/**
|
||||
* Updates the component in the game loop
|
||||
* @param deltaTime time passed since last update
|
||||
*/
|
||||
virtual void Update(float deltaTime) {}
|
||||
virtual void Update(float deltaTime);
|
||||
|
||||
/**
|
||||
* Event called when this component is being used, e.g. when some entity interacted with it
|
||||
* @param originator
|
||||
*/
|
||||
virtual void OnUse(Entity* originator) {}
|
||||
virtual void OnUse(Entity* originator);
|
||||
|
||||
/**
|
||||
* Save data from this componennt to character XML
|
||||
* @param doc the document to write data to
|
||||
*/
|
||||
virtual void UpdateXml(tinyxml2::XMLDocument& doc) {}
|
||||
virtual void UpdateXml(tinyxml2::XMLDocument& doc);
|
||||
|
||||
/**
|
||||
* Load base data for this component from character XML
|
||||
* @param doc the document to read data from
|
||||
*/
|
||||
virtual void LoadFromXml(const tinyxml2::XMLDocument& doc) {}
|
||||
virtual void LoadFromXml(const tinyxml2::XMLDocument& doc);
|
||||
|
||||
virtual void Serialize(RakNet::BitStream& outBitStream, bool isConstruction) {}
|
||||
virtual void Serialize(RakNet::BitStream& outBitStream, bool isConstruction);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -69,10 +69,9 @@ InventoryComponent::InventoryComponent(Entity* parent) : Component(parent) {
|
||||
auto slot = 0u;
|
||||
|
||||
for (const auto& item : items) {
|
||||
if (!Inventory::IsValidItem(item.itemid)) continue;
|
||||
AddItem(item.itemid, item.count);
|
||||
|
||||
if (!item.equip) continue;
|
||||
if (!item.equip || !Inventory::IsValidItem(item.itemid)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const LWOOBJID id = ObjectIDManager::GenerateObjectID();
|
||||
|
||||
@@ -939,11 +938,8 @@ void InventoryComponent::EquipScripts(Item* equippedItem) {
|
||||
if (scriptComponentID > -1) {
|
||||
CDScriptComponentTable* scriptCompTable = CDClientManager::GetTable<CDScriptComponentTable>();
|
||||
CDScriptComponent scriptCompData = scriptCompTable->GetByID(scriptComponentID);
|
||||
auto* itemScript = CppScripts::GetScript(m_Parent, scriptCompData.script_name);
|
||||
if (!itemScript) {
|
||||
LOG("null script?");
|
||||
}
|
||||
itemScript->OnFactionTriggerItemEquipped(m_Parent, equippedItem->GetId());
|
||||
auto& itemScript = CppScripts::GetScript(m_Parent, scriptCompData.script_name);
|
||||
itemScript.OnFactionTriggerItemEquipped(m_Parent, equippedItem->GetId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -954,11 +950,8 @@ void InventoryComponent::UnequipScripts(Item* unequippedItem) {
|
||||
if (scriptComponentID > -1) {
|
||||
CDScriptComponentTable* scriptCompTable = CDClientManager::GetTable<CDScriptComponentTable>();
|
||||
CDScriptComponent scriptCompData = scriptCompTable->GetByID(scriptComponentID);
|
||||
auto* itemScript = CppScripts::GetScript(m_Parent, scriptCompData.script_name);
|
||||
if (!itemScript) {
|
||||
LOG("null script?");
|
||||
}
|
||||
itemScript->OnFactionTriggerItemUnequipped(m_Parent, unequippedItem->GetId());
|
||||
auto& itemScript = CppScripts::GetScript(m_Parent, scriptCompData.script_name);
|
||||
itemScript.OnFactionTriggerItemUnequipped(m_Parent, unequippedItem->GetId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -265,7 +265,6 @@ void MovementAIComponent::PullToPoint(const NiPoint3& point) {
|
||||
|
||||
void MovementAIComponent::SetPath(std::vector<PathWaypoint> path) {
|
||||
if (path.empty()) return;
|
||||
while (!m_CurrentPath.empty()) m_CurrentPath.pop();
|
||||
std::for_each(path.rbegin(), path.rend() - 1, [this](const PathWaypoint& point) {
|
||||
this->m_CurrentPath.push(point);
|
||||
});
|
||||
|
||||
@@ -524,7 +524,7 @@ void PetComponent::NotifyTamingBuildSuccess(NiPoint3 position) {
|
||||
|
||||
GameMessages::SendRegisterPetDBID(m_Tamer, petSubKey, tamer->GetSystemAddress());
|
||||
|
||||
inventoryComponent->AddItem(m_Parent->GetLOT(), 1, eLootSourceType::INVENTORY, eInventoryType::MODELS, {}, LWOOBJID_EMPTY, true, false, petSubKey);
|
||||
inventoryComponent->AddItem(m_Parent->GetLOT(), 1, eLootSourceType::ACTIVITY, eInventoryType::MODELS, {}, LWOOBJID_EMPTY, true, false, petSubKey);
|
||||
auto* item = inventoryComponent->FindItemBySubKey(petSubKey, MODELS);
|
||||
|
||||
if (item == nullptr) {
|
||||
|
||||
@@ -84,10 +84,6 @@ dpEntity* PhysicsComponent::CreatePhysicsEntity(eReplicaComponentType type) {
|
||||
} else if (info->physicsAsset == "env\\env_won_fv_gas-blocking-volume.hkx") {
|
||||
toReturn = new dpEntity(m_Parent->GetObjectID(), 390.496826f, 111.467964f, 600.821534f, true);
|
||||
m_Position.y -= (111.467964f * m_Parent->GetDefaultScale()) / 2;
|
||||
} else if (info->physicsAsset == "env\\GFTrack_DeathVolume1_CaveExit.hkx") {
|
||||
toReturn = new dpEntity(m_Parent->GetObjectID(), 112.416870f, 50.363434f, 87.679268f);
|
||||
} else if (info->physicsAsset == "env\\GFTrack_DeathVolume2_RoadGaps.hkx") {
|
||||
toReturn = new dpEntity(m_Parent->GetObjectID(), 48.386536f, 50.363434f, 259.361755f);
|
||||
} else {
|
||||
// LOG_DEBUG("This one is supposed to have %s", info->physicsAsset.c_str());
|
||||
|
||||
|
||||
@@ -65,7 +65,14 @@ void QuickBuildComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsIni
|
||||
|
||||
outBitStream.Write(false);
|
||||
}
|
||||
|
||||
// If build state is completed and we've already serialized once in the completed state,
|
||||
// don't serializing this component anymore as this will cause the build to jump again.
|
||||
// If state changes, serialization will begin again.
|
||||
if (!m_StateDirty && m_State == eQuickBuildState::COMPLETED) {
|
||||
outBitStream.Write0();
|
||||
outBitStream.Write0();
|
||||
return;
|
||||
}
|
||||
// BEGIN Scripted Activity
|
||||
outBitStream.Write1();
|
||||
|
||||
@@ -83,27 +90,26 @@ void QuickBuildComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsIni
|
||||
}
|
||||
// END Scripted Activity
|
||||
|
||||
outBitStream.Write(m_StateDirty || bIsInitialUpdate);
|
||||
if (m_StateDirty || bIsInitialUpdate) {
|
||||
outBitStream.Write(m_State);
|
||||
outBitStream.Write1();
|
||||
|
||||
outBitStream.Write(m_ShowResetEffect);
|
||||
outBitStream.Write(m_Activator != nullptr);
|
||||
outBitStream.Write(m_State);
|
||||
|
||||
outBitStream.Write(m_Timer);
|
||||
outBitStream.Write(m_TimerIncomplete);
|
||||
outBitStream.Write(m_ShowResetEffect);
|
||||
outBitStream.Write(m_Activator != nullptr);
|
||||
|
||||
if (bIsInitialUpdate) {
|
||||
outBitStream.Write(false); // IsChoiceBuild
|
||||
outBitStream.Write(m_ActivatorPosition);
|
||||
outBitStream.Write(m_RepositionPlayer);
|
||||
}
|
||||
m_StateDirty = false;
|
||||
outBitStream.Write(m_Timer);
|
||||
outBitStream.Write(m_TimerIncomplete);
|
||||
|
||||
if (bIsInitialUpdate) {
|
||||
outBitStream.Write(false);
|
||||
outBitStream.Write(m_ActivatorPosition);
|
||||
outBitStream.Write(m_RepositionPlayer);
|
||||
}
|
||||
m_StateDirty = false;
|
||||
}
|
||||
|
||||
void QuickBuildComponent::Update(float deltaTime) {
|
||||
SetActivator(GetActivator());
|
||||
m_Activator = GetActivator();
|
||||
|
||||
// Serialize the quickbuild every so often, fixes the odd bug where the quickbuild is not buildable
|
||||
/*if (m_SoftTimer > 0.0f) {
|
||||
@@ -124,13 +130,12 @@ void QuickBuildComponent::Update(float deltaTime) {
|
||||
const bool isSmashGroup = spawner != nullptr ? spawner->GetIsSpawnSmashGroup() : false;
|
||||
|
||||
if (isSmashGroup) {
|
||||
ModifyIncompleteTimer(deltaTime);
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
m_TimerIncomplete += deltaTime;
|
||||
|
||||
// For reset times < 0 this has to be handled manually
|
||||
if (m_TimeBeforeSmash > 0) {
|
||||
if (m_TimerIncomplete >= m_TimeBeforeSmash - 4.0f) {
|
||||
SetShowResetEffect(true);
|
||||
m_ShowResetEffect = true;
|
||||
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
}
|
||||
@@ -148,20 +153,21 @@ void QuickBuildComponent::Update(float deltaTime) {
|
||||
break;
|
||||
}
|
||||
case eQuickBuildState::COMPLETED: {
|
||||
ModifyTimer(deltaTime);
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
m_Timer += deltaTime;
|
||||
|
||||
// For reset times < 0 this has to be handled manually
|
||||
if (m_ResetTime > 0) {
|
||||
if (m_Timer >= m_ResetTime - 4.0f) {
|
||||
SetShowResetEffect(true);
|
||||
if (!m_ShowResetEffect) {
|
||||
m_ShowResetEffect = true;
|
||||
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_Timer >= m_ResetTime) {
|
||||
|
||||
GameMessages::SendDieNoImplCode(m_Parent, LWOOBJID_EMPTY, LWOOBJID_EMPTY, eKillType::VIOLENT, u"", 0.0f, 0.0f, 7.0f, false, true);
|
||||
GameMessages::SendDieNoImplCode(m_Parent, LWOOBJID_EMPTY, LWOOBJID_EMPTY, eKillType::VIOLENT, u"", 0.0f, 0.0f, 0.0f, false, true);
|
||||
|
||||
ResetQuickBuild(false);
|
||||
}
|
||||
@@ -179,9 +185,9 @@ void QuickBuildComponent::Update(float deltaTime) {
|
||||
}
|
||||
|
||||
m_TimeBeforeDrain -= deltaTime;
|
||||
ModifyTimer(deltaTime);
|
||||
SetIncompleteTimer(0.0f);
|
||||
SetShowResetEffect(false);
|
||||
m_Timer += deltaTime;
|
||||
m_TimerIncomplete = 0;
|
||||
m_ShowResetEffect = false;
|
||||
|
||||
if (m_TimeBeforeDrain <= 0.0f) {
|
||||
m_TimeBeforeDrain = m_CompleteTime / static_cast<float>(m_TakeImagination);
|
||||
@@ -209,13 +215,12 @@ void QuickBuildComponent::Update(float deltaTime) {
|
||||
break;
|
||||
}
|
||||
case eQuickBuildState::INCOMPLETE: {
|
||||
ModifyIncompleteTimer(deltaTime);
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
m_TimerIncomplete += deltaTime;
|
||||
|
||||
// For reset times < 0 this has to be handled manually
|
||||
if (m_TimeBeforeSmash > 0) {
|
||||
if (m_TimerIncomplete >= m_TimeBeforeSmash - 4.0f) {
|
||||
SetShowResetEffect(true);
|
||||
m_ShowResetEffect = true;
|
||||
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
}
|
||||
@@ -255,7 +260,7 @@ void QuickBuildComponent::SpawnActivator() {
|
||||
info.spawnerID = m_Parent->GetObjectID();
|
||||
info.pos = m_ActivatorPosition == NiPoint3Constant::ZERO ? m_Parent->GetPosition() : m_ActivatorPosition;
|
||||
|
||||
SetActivator(Game::entityManager->CreateEntity(info, nullptr, m_Parent));
|
||||
m_Activator = Game::entityManager->CreateEntity(info, nullptr, m_Parent);
|
||||
if (m_Activator) {
|
||||
m_ActivatorId = m_Activator->GetObjectID();
|
||||
Game::entityManager->ConstructEntity(m_Activator);
|
||||
@@ -272,7 +277,7 @@ void QuickBuildComponent::DespawnActivator() {
|
||||
|
||||
m_Activator->ScheduleKillAfterUpdate();
|
||||
|
||||
SetActivator(nullptr);
|
||||
m_Activator = nullptr;
|
||||
|
||||
m_ActivatorId = LWOOBJID_EMPTY;
|
||||
}
|
||||
@@ -400,7 +405,8 @@ void QuickBuildComponent::StartQuickBuild(Entity* const user) {
|
||||
GameMessages::SendQuickBuildNotifyState(m_Parent, m_State, eQuickBuildState::BUILDING, user->GetObjectID());
|
||||
GameMessages::SendEnableQuickBuild(m_Parent, true, false, false, eQuickBuildFailReason::NOT_GIVEN, 0.0f, user->GetObjectID());
|
||||
|
||||
SetState(eQuickBuildState::BUILDING);
|
||||
m_State = eQuickBuildState::BUILDING;
|
||||
m_StateDirty = true;
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
|
||||
auto* movingPlatform = m_Parent->GetComponent<MovingPlatformComponent>();
|
||||
@@ -438,8 +444,9 @@ void QuickBuildComponent::CompleteQuickBuild(Entity* const user) {
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, m_Parent->GetObjectID());
|
||||
|
||||
|
||||
SetState(eQuickBuildState::COMPLETED);
|
||||
SetTimer(0.0f);
|
||||
m_State = eQuickBuildState::COMPLETED;
|
||||
m_StateDirty = true;
|
||||
m_Timer = 0.0f;
|
||||
m_DrainedImagination = 0;
|
||||
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
@@ -519,10 +526,11 @@ void QuickBuildComponent::ResetQuickBuild(const bool failed) {
|
||||
|
||||
GameMessages::SendQuickBuildNotifyState(m_Parent, m_State, eQuickBuildState::RESETTING, LWOOBJID_EMPTY);
|
||||
|
||||
SetState(eQuickBuildState::RESETTING);
|
||||
SetTimer(0.0f);
|
||||
SetIncompleteTimer(0.0f);
|
||||
SetShowResetEffect(false);
|
||||
m_State = eQuickBuildState::RESETTING;
|
||||
m_StateDirty = true;
|
||||
m_Timer = 0.0f;
|
||||
m_TimerIncomplete = 0.0f;
|
||||
m_ShowResetEffect = false;
|
||||
m_DrainedImagination = 0;
|
||||
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
@@ -555,7 +563,8 @@ void QuickBuildComponent::CancelQuickBuild(Entity* const entity, const eQuickBui
|
||||
GameMessages::SendTerminateInteraction(m_Parent->GetObjectID(), eTerminateType::FROM_INTERACTION, m_Parent->GetObjectID());
|
||||
|
||||
// Now update the component itself
|
||||
SetState(eQuickBuildState::INCOMPLETE);
|
||||
m_State = eQuickBuildState::INCOMPLETE;
|
||||
m_StateDirty = true;
|
||||
|
||||
// Notify scripts and possible subscribers
|
||||
m_Parent->GetScript()->OnQuickBuildNotifyState(m_Parent, m_State);
|
||||
|
||||
@@ -218,48 +218,6 @@ public:
|
||||
* @param skipChecks whether or not to skip the check for the quickbuild not being completed
|
||||
*/
|
||||
void CancelQuickBuild(Entity* const builder, const eQuickBuildFailReason failReason, const bool skipChecks = false);
|
||||
|
||||
void SetState(const eQuickBuildState state) {
|
||||
if (m_State == state) return;
|
||||
m_State = state;
|
||||
m_StateDirty = true;
|
||||
}
|
||||
|
||||
void SetShowResetEffect(const bool value) {
|
||||
if (m_ShowResetEffect == value) return;
|
||||
m_ShowResetEffect = value;
|
||||
m_StateDirty = true;
|
||||
}
|
||||
|
||||
void SetActivator(Entity* const activator) {
|
||||
if (m_Activator == activator) return;
|
||||
m_Activator = activator;
|
||||
m_StateDirty = true;
|
||||
}
|
||||
|
||||
void SetTimer(const float value) {
|
||||
if (m_Timer == value) return;
|
||||
m_Timer = value;
|
||||
m_StateDirty = true;
|
||||
}
|
||||
|
||||
void ModifyTimer(const float value) {
|
||||
if (value == 0.0f) return;
|
||||
m_Timer += value;
|
||||
m_StateDirty = true;
|
||||
}
|
||||
|
||||
void SetIncompleteTimer(const float value) {
|
||||
if (m_TimerIncomplete == value) return;
|
||||
m_TimerIncomplete = value;
|
||||
m_StateDirty = true;
|
||||
}
|
||||
|
||||
void ModifyIncompleteTimer(const float value) {
|
||||
if (value == 0.0f) return;
|
||||
m_TimerIncomplete += value;
|
||||
m_StateDirty = true;
|
||||
}
|
||||
private:
|
||||
/**
|
||||
* Whether or not the quickbuild state has been changed since we last serialized it.
|
||||
|
||||
@@ -35,8 +35,7 @@
|
||||
RacingControlComponent::RacingControlComponent(Entity* parent)
|
||||
: Component(parent) {
|
||||
m_PathName = u"MainPath";
|
||||
m_NumberOfLaps = 3;
|
||||
m_RemainingLaps = m_NumberOfLaps;
|
||||
m_RemainingLaps = 3;
|
||||
m_LeadingPlayer = LWOOBJID_EMPTY;
|
||||
m_RaceBestTime = 0;
|
||||
m_RaceBestLap = 0;
|
||||
@@ -285,7 +284,7 @@ void RacingControlComponent::OnRacingClientReady(Entity* player) {
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
}
|
||||
|
||||
void RacingControlComponent::OnRequestDie(Entity* player, const std::u16string& deathType) {
|
||||
void RacingControlComponent::OnRequestDie(Entity* player) {
|
||||
// Sent by the client when they collide with something which should smash
|
||||
// them.
|
||||
|
||||
@@ -301,9 +300,8 @@ void RacingControlComponent::OnRequestDie(Entity* player, const std::u16string&
|
||||
|
||||
if (!racingPlayer.noSmashOnReload) {
|
||||
racingPlayer.smashedTimes++;
|
||||
LOG("Death type %s", GeneralUtils::UTF16ToWTF8(deathType).c_str());
|
||||
GameMessages::SendDie(vehicle, vehicle->GetObjectID(), LWOOBJID_EMPTY, true,
|
||||
eKillType::VIOLENT, deathType, 0, 0, 90.0f, false, true, 0);
|
||||
eKillType::VIOLENT, u"", 0, 0, 90.0f, false, true, 0);
|
||||
|
||||
auto* destroyableComponent = vehicle->GetComponent<DestroyableComponent>();
|
||||
uint32_t respawnImagination = 0;
|
||||
@@ -660,9 +658,23 @@ void RacingControlComponent::Update(float deltaTime) {
|
||||
}
|
||||
}
|
||||
|
||||
GameMessages::ZoneLoadedInfo zoneLoadInfo{};
|
||||
zoneLoadInfo.maxPlayers = m_LoadedPlayers;
|
||||
m_Parent->GetScript()->OnZoneLoadedInfo(m_Parent, zoneLoadInfo);
|
||||
// Spawn imagination pickups
|
||||
auto* minSpawner = Game::zoneManager->GetSpawnersByName(
|
||||
"ImaginationSpawn_Min")[0];
|
||||
auto* medSpawner = Game::zoneManager->GetSpawnersByName(
|
||||
"ImaginationSpawn_Med")[0];
|
||||
auto* maxSpawner = Game::zoneManager->GetSpawnersByName(
|
||||
"ImaginationSpawn_Max")[0];
|
||||
|
||||
minSpawner->Activate();
|
||||
|
||||
if (m_LoadedPlayers > 2) {
|
||||
medSpawner->Activate();
|
||||
}
|
||||
|
||||
if (m_LoadedPlayers > 4) {
|
||||
maxSpawner->Activate();
|
||||
}
|
||||
|
||||
// Reset players to their start location, without smashing them
|
||||
for (auto& player : m_RacingPlayers) {
|
||||
@@ -752,7 +764,7 @@ void RacingControlComponent::Update(float deltaTime) {
|
||||
// new checkpoint
|
||||
uint32_t respawnIndex = 0;
|
||||
for (const auto& waypoint : path->pathWaypoints) {
|
||||
if (player.lap == m_NumberOfLaps) {
|
||||
if (player.lap == 3) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -823,7 +835,7 @@ void RacingControlComponent::Update(float deltaTime) {
|
||||
// Progress lap time tasks
|
||||
missionComponent->Progress(eMissionTaskType::RACING, lapTime.count(), static_cast<LWOOBJID>(eRacingTaskParam::LAP_TIME));
|
||||
|
||||
if (player.lap == m_NumberOfLaps) {
|
||||
if (player.lap == 3) {
|
||||
m_Finished++;
|
||||
player.finished = m_Finished;
|
||||
|
||||
@@ -870,20 +882,3 @@ void RacingControlComponent::Update(float deltaTime) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RacingControlComponent::MsgConfigureRacingControl(const GameMessages::ConfigureRacingControl& msg) {
|
||||
for (const auto& dataUnique : msg.racingSettings) {
|
||||
if (!dataUnique) continue;
|
||||
const auto* const data = dataUnique.get();
|
||||
if (data->GetKey() == u"Race_PathName" && data->GetValueType() == LDF_TYPE_UTF_16) {
|
||||
m_PathName = static_cast<const LDFData<std::u16string>*>(data)->GetValue();
|
||||
} else if (data->GetKey() == u"activityID" && data->GetValueType() == LDF_TYPE_S32) {
|
||||
m_ActivityID = static_cast<const LDFData<int32_t>*>(data)->GetValue();
|
||||
} else if (data->GetKey() == u"Number_of_Laps" && data->GetValueType() == LDF_TYPE_S32) {
|
||||
m_NumberOfLaps = static_cast<const LDFData<int32_t>*>(data)->GetValue();
|
||||
m_RemainingLaps = m_NumberOfLaps;
|
||||
} else if (data->GetKey() == u"Minimum_Players_for_Group_Achievements" && data->GetValueType() == LDF_TYPE_S32) {
|
||||
m_MinimumPlayersForGroupAchievements = static_cast<const LDFData<int32_t>*>(data)->GetValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
/**
|
||||
* Invoked when the client says it should be smashed.
|
||||
*/
|
||||
void OnRequestDie(Entity* player, const std::u16string& deathType = u"");
|
||||
void OnRequestDie(Entity* player);
|
||||
|
||||
/**
|
||||
* Invoked when the player has finished respawning.
|
||||
@@ -152,8 +152,6 @@ public:
|
||||
*/
|
||||
RacingPlayerInfo* GetPlayerData(LWOOBJID playerID);
|
||||
|
||||
void MsgConfigureRacingControl(const GameMessages::ConfigureRacingControl& msg);
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
@@ -163,13 +161,11 @@ private:
|
||||
|
||||
/**
|
||||
* The paths that are followed for the camera scenes
|
||||
* Configurable in the ConfigureRacingControl msg with the key `Race_PathName`.
|
||||
*/
|
||||
std::u16string m_PathName;
|
||||
|
||||
/**
|
||||
* The ID of the activity for participating in this race
|
||||
* Configurable in the ConfigureRacingControl msg with the key `activityID`.
|
||||
*/
|
||||
uint32_t m_ActivityID;
|
||||
|
||||
@@ -249,20 +245,5 @@ private:
|
||||
* Value for message box response to know if we are exiting the race via the activity dialogue
|
||||
*/
|
||||
const int32_t m_ActivityExitConfirm = 1;
|
||||
|
||||
bool m_AllPlayersReady = false;
|
||||
|
||||
/**
|
||||
* @brief The number of laps in this race. Configurable in the ConfigureRacingControl msg
|
||||
* with the key `Number_of_Laps`.
|
||||
*
|
||||
*/
|
||||
int32_t m_NumberOfLaps{ 3 };
|
||||
|
||||
/**
|
||||
* @brief The minimum number of players required to progress group achievements.
|
||||
* Configurable with the ConfigureRacingControl msg with the key `Minimum_Players_for_Group_Achievements`.
|
||||
*
|
||||
*/
|
||||
int32_t m_MinimumPlayersForGroupAchievements{ 2 };
|
||||
};
|
||||
|
||||
@@ -48,5 +48,5 @@ CppScripts::Script* const ScriptComponent::GetScript() {
|
||||
void ScriptComponent::SetScript(const std::string& scriptName) {
|
||||
// Scripts are managed by the CppScripts class and are effecitvely singletons
|
||||
// and they may also be used by other script components so DON'T delete them.
|
||||
m_Script = CppScripts::GetScript(m_Parent, scriptName);
|
||||
m_Script = &CppScripts::GetScript(m_Parent, scriptName);
|
||||
}
|
||||
|
||||
@@ -123,11 +123,6 @@ void SkillComponent::SyncPlayerProjectile(const LWOOBJID projectileId, RakNet::B
|
||||
behavior->Handle(sync_entry.context, bitStream, branch);
|
||||
|
||||
this->m_managedProjectiles.erase(this->m_managedProjectiles.begin() + index);
|
||||
|
||||
GameMessages::ActivityNotify notify;
|
||||
notify.notification.push_back( std::make_unique<LDFData<int32_t>>(u"shot_done", sync_entry.skillId));
|
||||
|
||||
m_Parent->OnActivityNotify(notify);
|
||||
}
|
||||
|
||||
void SkillComponent::RegisterPlayerProjectile(const LWOOBJID projectileId, BehaviorContext* context, const BehaviorBranchContext& branch, const LOT lot) {
|
||||
@@ -137,7 +132,6 @@ void SkillComponent::RegisterPlayerProjectile(const LWOOBJID projectileId, Behav
|
||||
entry.branchContext = branch;
|
||||
entry.lot = lot;
|
||||
entry.id = projectileId;
|
||||
entry.skillId = context->skillID;
|
||||
|
||||
this->m_managedProjectiles.push_back(entry);
|
||||
}
|
||||
|
||||
@@ -40,8 +40,6 @@ struct ProjectileSyncEntry {
|
||||
|
||||
BehaviorBranchContext branchContext{ 0, 0 };
|
||||
|
||||
int32_t skillId{ 0 };
|
||||
|
||||
explicit ProjectileSyncEntry();
|
||||
};
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System
|
||||
}
|
||||
|
||||
case MessageType::Game::PLAYER_LOADED: {
|
||||
GameMessages::SendPlayerReady(entity, sysAddr);
|
||||
GameMessages::SendRestoreToPostLoadStats(entity, sysAddr);
|
||||
entity->SetPlayerReadyForUpdates();
|
||||
|
||||
auto* ghostComponent = entity->GetComponent<GhostComponent>();
|
||||
@@ -135,8 +135,6 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System
|
||||
}
|
||||
}
|
||||
|
||||
GameMessages::SendRestoreToPostLoadStats(entity, sysAddr);
|
||||
|
||||
auto* destroyable = entity->GetComponent<DestroyableComponent>();
|
||||
destroyable->SetImagination(destroyable->GetImagination());
|
||||
Game::entityManager->SerializeEntity(entity);
|
||||
@@ -184,6 +182,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System
|
||||
LOG("Player %s (%llu) loaded.", entity->GetCharacter()->GetName().c_str(), entity->GetObjectID());
|
||||
|
||||
// After we've done our thing, tell the client they're ready
|
||||
GameMessages::SendPlayerReady(entity, sysAddr);
|
||||
GameMessages::SendPlayerReady(Game::zoneManager->GetZoneControlObject(), sysAddr);
|
||||
|
||||
if (Game::config->GetValue("allow_players_to_skip_cinematics") != "1"
|
||||
@@ -704,12 +703,6 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System
|
||||
case MessageType::Game::UPDATE_INVENTORY_GROUP_CONTENTS:
|
||||
GameMessages::HandleUpdateInventoryGroupContents(inStream, entity, sysAddr);
|
||||
break;
|
||||
case MessageType::Game::SHOOTING_GALLERY_FIRE: {
|
||||
GameMessages::ShootingGalleryFire fire{};
|
||||
fire.Deserialize(inStream);
|
||||
fire.Handle(*entity, sysAddr);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
LOG_DEBUG("Received Unknown GM with ID: %4i, %s", messageID, StringifiedEnum::ToString(messageID).data());
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
#include <chrono>
|
||||
#include "RakString.h"
|
||||
|
||||
#include "httplib.h" //sorry not sorry.
|
||||
|
||||
//CDB includes:
|
||||
#include "CDClientManager.h"
|
||||
#include "CDEmoteTable.h"
|
||||
@@ -843,10 +845,8 @@ void GameMessages::SendDieNoImplCode(Entity* entity, const LWOOBJID& killerID, c
|
||||
|
||||
bitStream.Write(entity->GetObjectID());
|
||||
bitStream.Write(MessageType::Game::DIE);
|
||||
|
||||
bitStream.Write(bClientDeath);
|
||||
bitStream.Write(bSpawnLoot);
|
||||
bitStream.Write<uint32_t>(deathType.size());
|
||||
bitStream.Write(deathType);
|
||||
bitStream.Write(directionRelative_AngleXZ);
|
||||
bitStream.Write(directionRelative_AngleY);
|
||||
@@ -856,10 +856,7 @@ void GameMessages::SendDieNoImplCode(Entity* entity, const LWOOBJID& killerID, c
|
||||
if (killType != eKillType::VIOLENT) bitStream.Write(killType);
|
||||
|
||||
bitStream.Write(killerID);
|
||||
bitStream.Write(lootOwnerID != LWOOBJID_EMPTY);
|
||||
if (lootOwnerID != LWOOBJID_EMPTY) {
|
||||
bitStream.Write(lootOwnerID);
|
||||
}
|
||||
bitStream.Write(lootOwnerID);
|
||||
|
||||
SEND_PACKET_BROADCAST;
|
||||
}
|
||||
@@ -971,8 +968,6 @@ void GameMessages::SendResurrect(Entity* entity) {
|
||||
// and just make sure the client has time to be ready.
|
||||
constexpr float respawnTime = 3.66700005531311f + 0.5f;
|
||||
entity->AddCallbackTimer(respawnTime, [=]() {
|
||||
GameMessages::PlayerResurrectionFinished msg;
|
||||
entity->NotifyPlayerResurrectionFinished(msg);
|
||||
auto* destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyableComponent != nullptr && entity->GetLOT() == 1) {
|
||||
@@ -6400,35 +6395,4 @@ namespace GameMessages {
|
||||
bitStream.Write(targetPosition.y);
|
||||
bitStream.Write(targetPosition.z);
|
||||
}
|
||||
|
||||
void SetModelToBuild::Serialize(RakNet::BitStream& bitStream) const {
|
||||
bitStream.Write(modelLot != -1);
|
||||
if (modelLot != -1) bitStream.Write(modelLot);
|
||||
}
|
||||
|
||||
void SpawnModelBricks::Serialize(RakNet::BitStream& bitStream) const {
|
||||
bitStream.Write(amount != 0.0f);
|
||||
if (amount != 0.0f) bitStream.Write(amount);
|
||||
bitStream.Write(position != NiPoint3Constant::ZERO);
|
||||
if (position != NiPoint3Constant::ZERO) {
|
||||
bitStream.Write(position.x);
|
||||
bitStream.Write(position.y);
|
||||
bitStream.Write(position.z);
|
||||
}
|
||||
}
|
||||
|
||||
bool ShootingGalleryFire::Deserialize(RakNet::BitStream& bitStream) {
|
||||
if (!bitStream.Read(target.x)) return false;
|
||||
if (!bitStream.Read(target.y)) return false;
|
||||
if (!bitStream.Read(target.z)) return false;
|
||||
if (!bitStream.Read(rotation.w)) return false;
|
||||
if (!bitStream.Read(rotation.x)) return false;
|
||||
if (!bitStream.Read(rotation.y)) return false;
|
||||
if (!bitStream.Read(rotation.z)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void ShootingGalleryFire::Handle(Entity& entity, const SystemAddress& sysAddr) {
|
||||
entity.OnShootingGalleryFire(*this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,8 +54,6 @@ namespace GameMessages {
|
||||
virtual ~GameMsg() = default;
|
||||
void Send(const SystemAddress& sysAddr) const;
|
||||
virtual void Serialize(RakNet::BitStream& bitStream) const {}
|
||||
virtual bool Deserialize(RakNet::BitStream& bitStream) { return true; }
|
||||
virtual void Handle(Entity& entity, const SystemAddress& sysAddr) {};
|
||||
MessageType::Game msgId;
|
||||
LWOOBJID target{ LWOOBJID_EMPTY };
|
||||
};
|
||||
@@ -719,56 +717,6 @@ namespace GameMessages {
|
||||
NiPoint3 targetPosition{};
|
||||
void Serialize(RakNet::BitStream& bitStream) const override;
|
||||
};
|
||||
|
||||
struct ZoneLoadedInfo : public GameMsg {
|
||||
ZoneLoadedInfo() : GameMsg(MessageType::Game::ZONE_LOADED_INFO) {}
|
||||
int32_t maxPlayers{};
|
||||
};
|
||||
|
||||
struct ConfigureRacingControl : public GameMsg {
|
||||
ConfigureRacingControl() : GameMsg(MessageType::Game::CONFIGURE_RACING_CONTROL) {}
|
||||
std::vector<std::unique_ptr<LDFBaseData>> racingSettings{};
|
||||
};
|
||||
|
||||
struct SetModelToBuild : public GameMsg {
|
||||
SetModelToBuild() : GameMsg(MessageType::Game::SET_MODEL_TO_BUILD) {}
|
||||
void Serialize(RakNet::BitStream& bitStream) const override;
|
||||
LOT modelLot{ -1 };
|
||||
};
|
||||
|
||||
struct SpawnModelBricks : public GameMsg {
|
||||
SpawnModelBricks() : GameMsg(MessageType::Game::SPAWN_MODEL_BRICKS) {}
|
||||
void Serialize(RakNet::BitStream& bitStream) const override;
|
||||
|
||||
float amount{ 0.0f };
|
||||
NiPoint3 position{ NiPoint3Constant::ZERO };
|
||||
};
|
||||
|
||||
struct ActivityNotify : public GameMsg {
|
||||
ActivityNotify() : GameMsg(MessageType::Game::ACTIVITY_NOTIFY) {}
|
||||
|
||||
std::vector<std::unique_ptr<LDFBaseData>> notification{};
|
||||
};
|
||||
|
||||
struct ShootingGalleryFire : public GameMsg {
|
||||
ShootingGalleryFire() : GameMsg(MessageType::Game::SHOOTING_GALLERY_FIRE) {}
|
||||
bool Deserialize(RakNet::BitStream& bitStream) override;
|
||||
void Handle(Entity& entity, const SystemAddress& sysAddr) override;
|
||||
|
||||
NiPoint3 target{};
|
||||
NiQuaternion rotation{};
|
||||
};
|
||||
|
||||
struct ChildLoaded : public GameMsg {
|
||||
ChildLoaded() : GameMsg(MessageType::Game::CHILD_LOADED) {}
|
||||
|
||||
LOT templateID{};
|
||||
LWOOBJID childID{};
|
||||
};
|
||||
|
||||
struct PlayerResurrectionFinished : public GameMsg {
|
||||
PlayerResurrectionFinished() : GameMsg(MessageType::Game::PLAYER_RESURRECTION_FINISHED) {}
|
||||
};
|
||||
};
|
||||
|
||||
#endif // GAMEMESSAGES_H
|
||||
|
||||
@@ -84,24 +84,6 @@ int main(int argc, char** argv) {
|
||||
Server::SetupLogger("MasterServer");
|
||||
if (!Game::logger) return EXIT_FAILURE;
|
||||
|
||||
auto folders = { "navmeshes", "migrations", "vanity" };
|
||||
|
||||
for (const auto folder : folders) {
|
||||
if (!std::filesystem::exists(BinaryPathFinder::GetBinaryDir() / folder)) {
|
||||
std::string msg = "The (" +
|
||||
std::string(folder) +
|
||||
") folder was not copied to the binary directory. Please copy the (" +
|
||||
std::string(folder) +
|
||||
") folder from your download to the binary directory or re-run cmake.";
|
||||
LOG("%s", msg.c_str());
|
||||
// toss an error box up for windows users running the download
|
||||
#ifdef DARKFLAME_PLATFORM_WIN32
|
||||
MessageBoxA(nullptr, msg.c_str(), "Missing Folder", MB_OK | MB_ICONERROR);
|
||||
#endif
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!dConfig::Exists("authconfig.ini")) LOG("Could not find authconfig.ini, using default settings");
|
||||
if (!dConfig::Exists("chatconfig.ini")) LOG("Could not find chatconfig.ini, using default settings");
|
||||
if (!dConfig::Exists("masterconfig.ini")) LOG("Could not find masterconfig.ini, using default settings");
|
||||
@@ -195,7 +177,7 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
// Run migrations should any need to be run.
|
||||
MigrationRunner::RunSQLiteMigrations();
|
||||
MigrationRunner::RunSQLiteMigrations();
|
||||
|
||||
//If the first command line argument is -a or --account then make the user
|
||||
//input a username and password, with the password being hidden.
|
||||
|
||||
@@ -4,146 +4,68 @@
|
||||
#include "Game.h"
|
||||
#include "BinaryPathFinder.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <handleapi.h>
|
||||
#include <processthreadsapi.h>
|
||||
|
||||
namespace {
|
||||
const auto startup = STARTUPINFOW{
|
||||
.cb = sizeof(STARTUPINFOW),
|
||||
.lpReserved = nullptr,
|
||||
.lpDesktop = nullptr,
|
||||
.lpTitle = nullptr,
|
||||
.dwX = 0,
|
||||
.dwY = 0,
|
||||
.dwXSize = 0,
|
||||
.dwYSize = 0,
|
||||
.dwXCountChars = 0,
|
||||
.dwYCountChars = 0,
|
||||
.dwFillAttribute = 0,
|
||||
.dwFlags = 0,
|
||||
.wShowWindow = 0,
|
||||
.cbReserved2 = 0,
|
||||
.lpReserved2 = nullptr,
|
||||
.hStdInput = INVALID_HANDLE_VALUE,
|
||||
.hStdOutput = INVALID_HANDLE_VALUE,
|
||||
.hStdError = INVALID_HANDLE_VALUE,
|
||||
};
|
||||
}
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
uint32_t StartChatServer() {
|
||||
void StartChatServer() {
|
||||
if (Game::ShouldShutdown()) {
|
||||
LOG("Currently shutting down. Chat will not be restarted.");
|
||||
return 0;
|
||||
}
|
||||
auto chat_path = BinaryPathFinder::GetBinaryDir() / "ChatServer";
|
||||
#ifdef _WIN32
|
||||
chat_path.replace_extension(".exe");
|
||||
auto chat_startup = startup;
|
||||
auto chat_info = PROCESS_INFORMATION{};
|
||||
if (!CreateProcessW(chat_path.wstring().data(), chat_path.wstring().data(),
|
||||
nullptr, nullptr, false, 0, nullptr, nullptr,
|
||||
&chat_startup, &chat_info))
|
||||
{
|
||||
LOG("Failed to launch ChatServer");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// get pid and close unused handles
|
||||
auto chat_pid = chat_info.dwProcessId;
|
||||
CloseHandle(chat_info.hProcess);
|
||||
CloseHandle(chat_info.hThread);
|
||||
#else // *nix systems
|
||||
const auto chat_pid = fork();
|
||||
if (chat_pid < 0) {
|
||||
LOG("Failed to launch ChatServer");
|
||||
return 0;
|
||||
} else if (chat_pid == 0) {
|
||||
// We are the child process
|
||||
execl(chat_path.string().c_str(), chat_path.string().c_str(), nullptr);
|
||||
return;
|
||||
}
|
||||
#ifdef __APPLE__
|
||||
//macOS doesn't need sudo to run on ports < 1024
|
||||
auto result = system(((BinaryPathFinder::GetBinaryDir() / "ChatServer").string() + "&").c_str());
|
||||
#elif _WIN32
|
||||
auto result = system(("start /B " + (BinaryPathFinder::GetBinaryDir() / "ChatServer.exe").string()).c_str());
|
||||
#else
|
||||
if (std::atoi(Game::config->GetValue("use_sudo_chat").c_str())) {
|
||||
auto result = system(("sudo " + (BinaryPathFinder::GetBinaryDir() / "ChatServer").string() + "&").c_str());
|
||||
} else {
|
||||
auto result = system(((BinaryPathFinder::GetBinaryDir() / "ChatServer").string() + "&").c_str());
|
||||
}
|
||||
#endif
|
||||
LOG("ChatServer PID is %d", chat_pid);
|
||||
return chat_pid;
|
||||
}
|
||||
|
||||
uint32_t StartAuthServer() {
|
||||
void StartAuthServer() {
|
||||
if (Game::ShouldShutdown()) {
|
||||
LOG("Currently shutting down. Auth will not be restarted.");
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
auto auth_path = BinaryPathFinder::GetBinaryDir() / "AuthServer";
|
||||
#ifdef _WIN32
|
||||
auth_path.replace_extension(".exe");
|
||||
auto auth_startup = startup;
|
||||
auto auth_info = PROCESS_INFORMATION{};
|
||||
if (!CreateProcessW(auth_path.wstring().data(), auth_path.wstring().data(),
|
||||
nullptr, nullptr, false, 0, nullptr, nullptr,
|
||||
&auth_startup, &auth_info))
|
||||
{
|
||||
LOG("Failed to launch AuthServer");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// get pid and close unused handles
|
||||
auto auth_pid = auth_info.dwProcessId;
|
||||
CloseHandle(auth_info.hProcess);
|
||||
CloseHandle(auth_info.hThread);
|
||||
#else // *nix systems
|
||||
const auto auth_pid = fork();
|
||||
if (auth_pid < 0) {
|
||||
LOG("Failed to launch AuthServer");
|
||||
return 0;
|
||||
} else if (auth_pid == 0) {
|
||||
// We are the child process
|
||||
execl(auth_path.string().c_str(), auth_path.string().c_str(), nullptr);
|
||||
}
|
||||
#endif
|
||||
LOG("AuthServer PID is %d", auth_pid);
|
||||
return auth_pid;
|
||||
}
|
||||
|
||||
uint32_t StartWorldServer(LWOMAPID mapID, uint16_t port, LWOINSTANCEID lastInstanceID, int maxPlayers, LWOCLONEID cloneID) {
|
||||
auto world_path = BinaryPathFinder::GetBinaryDir() / "WorldServer";
|
||||
#ifdef _WIN32
|
||||
world_path.replace_extension(".exe");
|
||||
auto cmd = world_path.wstring() + L" -zone " + std::to_wstring(mapID) + L" -port " + std::to_wstring(port) +
|
||||
L" -instance " + std::to_wstring(lastInstanceID) + L" -maxclients " + std::to_wstring(maxPlayers) +
|
||||
L" -clone " + std::to_wstring(cloneID);
|
||||
|
||||
auto world_startup = startup;
|
||||
auto world_info = PROCESS_INFORMATION{};
|
||||
if (!CreateProcessW(world_path.wstring().data(), cmd.data(),
|
||||
nullptr, nullptr, false, 0, nullptr, nullptr,
|
||||
&world_startup, &world_info))
|
||||
{
|
||||
LOG("Failed to launch WorldServer");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// get pid and close unused handles
|
||||
auto world_pid = world_info.dwProcessId;
|
||||
CloseHandle(world_info.hProcess);
|
||||
CloseHandle(world_info.hThread);
|
||||
#ifdef __APPLE__
|
||||
auto result = system(((BinaryPathFinder::GetBinaryDir() / "AuthServer").string() + "&").c_str());
|
||||
#elif _WIN32
|
||||
auto result = system(("start /B " + (BinaryPathFinder::GetBinaryDir() / "AuthServer.exe").string()).c_str());
|
||||
#else
|
||||
const auto world_pid = fork();
|
||||
if (world_pid < 0) {
|
||||
LOG("Failed to launch WorldServer");
|
||||
return 0;
|
||||
} else if (world_pid == 0) {
|
||||
// We are the child process
|
||||
execl(world_path.string().c_str(), world_path.string().c_str(),
|
||||
"-zone", std::to_string(mapID).c_str(),
|
||||
"-port", std::to_string(port).c_str(),
|
||||
"-instance", std::to_string(lastInstanceID).c_str(),
|
||||
"-maxclients", std::to_string(maxPlayers).c_str(),
|
||||
"-clone", std::to_string(cloneID).c_str(), nullptr);
|
||||
if (std::atoi(Game::config->GetValue("use_sudo_auth").c_str())) {
|
||||
auto result = system(("sudo " + (BinaryPathFinder::GetBinaryDir() / "AuthServer").string() + "&").c_str());
|
||||
} else {
|
||||
auto result = system(((BinaryPathFinder::GetBinaryDir() / "AuthServer").string() + "&").c_str());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void StartWorldServer(LWOMAPID mapID, uint16_t port, LWOINSTANCEID lastInstanceID, int maxPlayers, LWOCLONEID cloneID) {
|
||||
#ifdef _WIN32
|
||||
std::string cmd = "start /B " + (BinaryPathFinder::GetBinaryDir() / "WorldServer.exe").string() + " -zone ";
|
||||
#else
|
||||
std::string cmd;
|
||||
if (std::atoi(Game::config->GetValue("use_sudo_world").c_str())) {
|
||||
cmd = "sudo " + (BinaryPathFinder::GetBinaryDir() / "WorldServer").string() + " -zone ";
|
||||
} else {
|
||||
cmd = (BinaryPathFinder::GetBinaryDir() / "WorldServer").string() + " -zone ";
|
||||
}
|
||||
#endif
|
||||
LOG("WorldServer PID is %d", world_pid);
|
||||
return world_pid;
|
||||
|
||||
cmd.append(std::to_string(mapID));
|
||||
cmd.append(" -port ");
|
||||
cmd.append(std::to_string(port));
|
||||
cmd.append(" -instance ");
|
||||
cmd.append(std::to_string(lastInstanceID));
|
||||
cmd.append(" -maxclients ");
|
||||
cmd.append(std::to_string(maxPlayers));
|
||||
cmd.append(" -clone ");
|
||||
cmd.append(std::to_string(cloneID));
|
||||
|
||||
#ifndef _WIN32
|
||||
cmd.append("&"); //Sends our next process to the background on Linux
|
||||
#endif
|
||||
|
||||
auto ret = system(cmd.c_str());
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include "dCommonVars.h"
|
||||
|
||||
uint32_t StartAuthServer();
|
||||
uint32_t StartChatServer();
|
||||
uint32_t StartWorldServer(LWOMAPID mapID, uint16_t port, LWOINSTANCEID lastInstanceID, int maxPlayers, LWOCLONEID cloneID);
|
||||
void StartAuthServer();
|
||||
void StartChatServer();
|
||||
void StartWorldServer(LWOMAPID mapID, uint16_t port, LWOINSTANCEID lastInstanceID, int maxPlayers, LWOCLONEID cloneID);
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "MessageType/Server.h"
|
||||
#include "MessageType/Master.h"
|
||||
|
||||
#include "BinaryPathFinder.h"
|
||||
#include "BitStreamUtils.h"
|
||||
#include "MasterPackets.h"
|
||||
#include "ZoneInstanceManager.h"
|
||||
@@ -69,16 +68,7 @@ dServer::dServer(const std::string& ip, int port, int instanceID, int maxConnect
|
||||
LOG("%s Server is listening on %s:%i with encryption: %i", StringifiedEnum::ToString(serverType).data(), ip.c_str(), port, int(useEncryption));
|
||||
else
|
||||
LOG("%s Server is listening on %s:%i with encryption: %i, running zone %i / %i", StringifiedEnum::ToString(serverType).data(), ip.c_str(), port, int(useEncryption), zoneID, instanceID);
|
||||
} else {
|
||||
LOG("FAILED TO START SERVER ON IP/PORT: %s:%i", ip.c_str(), port);
|
||||
#ifdef DARKFLAME_PLATFORM_LINUX
|
||||
if (mServerType == ServerType::Auth) {
|
||||
const auto cwd = BinaryPathFinder::GetBinaryDir();
|
||||
LOG("Try running the following command before launching again:\n sudo setcap 'cap_net_bind_service=+ep' \"%s/AuthServer\"", cwd.string().c_str());
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
} else { LOG("FAILED TO START SERVER ON IP/PORT: %s:%i", ip.c_str(), port); return; }
|
||||
|
||||
mLogger->SetLogToConsole(prevLogSetting);
|
||||
|
||||
@@ -119,23 +109,20 @@ Packet* dServer::ReceiveFromMaster() {
|
||||
if (packet) {
|
||||
if (packet->length < 1) { mMasterPeer->DeallocatePacket(packet); return nullptr; }
|
||||
|
||||
switch (packet->data[0]) {
|
||||
case ID_DISCONNECTION_NOTIFICATION:
|
||||
[[fallthrough]];
|
||||
case ID_CONNECTION_LOST: {
|
||||
if (packet->data[0] == ID_DISCONNECTION_NOTIFICATION || packet->data[0] == ID_CONNECTION_LOST) {
|
||||
LOG("Lost our connection to master, shutting DOWN!");
|
||||
mMasterConnectionActive = false;
|
||||
// ConnectToMaster(); // We'll just shut down now
|
||||
break;
|
||||
//ConnectToMaster(); //We'll just shut down now
|
||||
}
|
||||
case ID_CONNECTION_REQUEST_ACCEPTED: {
|
||||
|
||||
if (packet->data[0] == ID_CONNECTION_REQUEST_ACCEPTED) {
|
||||
LOG("Established connection to master, zone (%i), instance (%i)", this->GetZoneID(), this->GetInstanceID());
|
||||
mMasterConnectionActive = true;
|
||||
mMasterSystemAddress = packet->systemAddress;
|
||||
MasterPackets::SendServerInfo(this, packet);
|
||||
break;
|
||||
}
|
||||
case ID_USER_PACKET_ENUM: {
|
||||
|
||||
if (packet->data[0] == ID_USER_PACKET_ENUM) {
|
||||
if (static_cast<eConnectionType>(packet->data[1]) == eConnectionType::MASTER) {
|
||||
switch (static_cast<MessageType::Master>(packet->data[3])) {
|
||||
case MessageType::Master::REQUEST_ZONE_TRANSFER_RESPONSE: {
|
||||
@@ -146,13 +133,12 @@ Packet* dServer::ReceiveFromMaster() {
|
||||
*mShouldShutdown = -2;
|
||||
break;
|
||||
|
||||
// When we handle these packets in World instead dServer, we just return the packet's pointer.
|
||||
//When we handle these packets in World instead dServer, we just return the packet's pointer.
|
||||
default:
|
||||
|
||||
return packet;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
mMasterPeer->DeallocatePacket(packet);
|
||||
|
||||
@@ -64,22 +64,21 @@ void AmSkullkinTower::SpawnLegs(Entity* self, const std::string& loc) {
|
||||
|
||||
info.rot = NiQuaternion::LookAt(info.pos, self->GetPosition());
|
||||
|
||||
auto* entity = Game::entityManager->CreateEntity(info, nullptr, self);
|
||||
auto* entity = Game::entityManager->CreateEntity(info);
|
||||
|
||||
Game::entityManager->ConstructEntity(entity);
|
||||
|
||||
OnChildLoaded(self, entity);
|
||||
}
|
||||
|
||||
void AmSkullkinTower::OnChildLoaded(Entity& self, GameMessages::ChildLoaded& childLoaded) {
|
||||
auto legTable = self.GetVar<std::vector<LWOOBJID>>(u"legTable");
|
||||
void AmSkullkinTower::OnChildLoaded(Entity* self, Entity* child) {
|
||||
auto legTable = self->GetVar<std::vector<LWOOBJID>>(u"legTable");
|
||||
|
||||
legTable.push_back(childLoaded.childID);
|
||||
legTable.push_back(child->GetObjectID());
|
||||
|
||||
self.SetVar(u"legTable", legTable);
|
||||
self->SetVar(u"legTable", legTable);
|
||||
|
||||
const auto selfID = self.GetObjectID();
|
||||
auto* const child = Game::entityManager->GetEntity(childLoaded.childID);
|
||||
|
||||
if (!child) return;
|
||||
const auto selfID = self->GetObjectID();
|
||||
|
||||
child->AddDieCallback([this, selfID, child]() {
|
||||
auto* self = Game::entityManager->GetEntity(selfID);
|
||||
|
||||
@@ -8,7 +8,7 @@ public:
|
||||
|
||||
void SpawnLegs(Entity* self, const std::string& loc);
|
||||
|
||||
void OnChildLoaded(Entity& self, GameMessages::ChildLoaded& childLoaded) override;
|
||||
void OnChildLoaded(Entity* self, Entity* child);
|
||||
|
||||
void NotifyDie(Entity* self, Entity* other, Entity* killer);
|
||||
|
||||
|
||||
@@ -77,6 +77,8 @@ void QbSpawner::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
auto* child = Game::entityManager->CreateEntity(info, nullptr, self);
|
||||
Game::entityManager->ConstructEntity(child);
|
||||
|
||||
OnChildLoaded(self, child);
|
||||
} else {
|
||||
auto* mob = Game::entityManager->GetEntity(mobTable[i]);
|
||||
AggroTargetObject(self, mob);
|
||||
@@ -86,19 +88,16 @@ void QbSpawner::OnTimerDone(Entity* self, std::string timerName) {
|
||||
}
|
||||
}
|
||||
|
||||
void QbSpawner::OnChildLoaded(Entity& self, GameMessages::ChildLoaded& childLoaded) {
|
||||
auto* const child = Game::entityManager->GetEntity(childLoaded.childID);
|
||||
if (!child) return;
|
||||
|
||||
auto mobTable = self.GetVar<std::vector<LWOOBJID>>(u"mobTable");
|
||||
void QbSpawner::OnChildLoaded(Entity* self, Entity* child) {
|
||||
auto mobTable = self->GetVar<std::vector<LWOOBJID>>(u"mobTable");
|
||||
auto tableLoc = child->GetVar<int>(u"mobTableLoc");
|
||||
|
||||
mobTable[tableLoc] = child->GetObjectID();
|
||||
self.SetVar<std::vector<LWOOBJID>>(u"mobTable", mobTable);
|
||||
self->SetVar<std::vector<LWOOBJID>>(u"mobTable", mobTable);
|
||||
|
||||
AggroTargetObject(&self, child);
|
||||
AggroTargetObject(self, child);
|
||||
|
||||
const auto selfID = self.GetObjectID();
|
||||
const auto selfID = self->GetObjectID();
|
||||
|
||||
child->AddDieCallback([this, selfID, child]() {
|
||||
auto* self = Game::entityManager->GetEntity(selfID);
|
||||
|
||||
@@ -6,7 +6,7 @@ public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
void OnChildLoaded(Entity& self, GameMessages::ChildLoaded& childLoaded) override;
|
||||
void OnChildLoaded(Entity* self, Entity* child);
|
||||
void OnChildRemoved(Entity* self, Entity* child);
|
||||
void AggroTargetObject(Entity* self, Entity* enemy);
|
||||
private:
|
||||
|
||||
@@ -91,7 +91,7 @@ void NtCombatChallengeServer::SpawnTargetDummy(Entity* self) {
|
||||
info.rot = self->GetRotation();
|
||||
info.settings = { new LDFData<std::string>(u"custom_script_server", "scripts\\02_server\\Map\\NT\\L_NT_COMBAT_CHALLENGE_DUMMY.lua") };
|
||||
|
||||
auto* dummy = Game::entityManager->CreateEntity(info, nullptr, self);
|
||||
auto* dummy = Game::entityManager->CreateEntity(info);
|
||||
|
||||
dummy->SetVar(u"challengeObjectID", self->GetObjectID());
|
||||
|
||||
@@ -104,18 +104,26 @@ void NtCombatChallengeServer::SetAttackImmunity(LWOOBJID objID, bool bTurnOn) {
|
||||
|
||||
}
|
||||
|
||||
void NtCombatChallengeServer::OnChildLoaded(Entity& self, GameMessages::ChildLoaded& childLoaded) {
|
||||
auto* const child = Game::entityManager->GetEntity(childLoaded.childID);
|
||||
void NtCombatChallengeServer::OnChildLoaded(Entity* self, Entity* child) {
|
||||
auto targetNumber = self->GetVar<int32_t>(u"TargetNumber");
|
||||
if (targetNumber == 0) targetNumber = 1;
|
||||
self->SetVar(u"TargetNumber", targetNumber + 1);
|
||||
|
||||
if (child) {
|
||||
child->SetRotation(NiQuaternion::FromEulerAngles(child->GetRotation().GetEulerAngles() += NiPoint3(0, PI, 0))); // rotate 180 degrees
|
||||
const auto playerID = self->GetVar<LWOOBJID>(u"playerID");
|
||||
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.SetVar(u"currentTargetID", child->GetObjectID());
|
||||
child->SetRotation(NiQuaternion::LookAt(child->GetPosition(), player->GetPosition()));
|
||||
|
||||
self->SetVar(u"currentTargetID", child->GetObjectID());
|
||||
|
||||
Game::entityManager->SerializeEntity(child);
|
||||
|
||||
child->GetGroups().push_back("targets_" + std::to_string(self.GetObjectID()));
|
||||
child->GetGroups().push_back("targets_" + std::to_string(self->GetObjectID()));
|
||||
}
|
||||
|
||||
void NtCombatChallengeServer::ResetGame(Entity* self) {
|
||||
|
||||
@@ -12,7 +12,7 @@ public:
|
||||
void OnMessageBoxResponse(Entity* self, Entity* sender, int32_t button, const std::u16string& identifier, const std::u16string& userData) override;
|
||||
void SpawnTargetDummy(Entity* self);
|
||||
void SetAttackImmunity(LWOOBJID objID, bool bTurnOn);
|
||||
void OnChildLoaded(Entity& self, GameMessages::ChildLoaded& childLoaded) override;
|
||||
void OnChildLoaded(Entity* self, Entity* child);
|
||||
void ResetGame(Entity* self);
|
||||
void OnActivityTimerUpdate(Entity* self, float timeRemaining);
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
|
||||
@@ -12,7 +12,7 @@ void VeBricksampleServer::OnUse(Entity* self, Entity* user) {
|
||||
auto* inventoryComponent = user->GetComponent<InventoryComponent>();
|
||||
|
||||
if (loot && inventoryComponent != nullptr && inventoryComponent->GetLotCount(loot) == 0) {
|
||||
inventoryComponent->AddItem(loot, 1, eLootSourceType::NONE);
|
||||
inventoryComponent->AddItem(loot, 1, eLootSourceType::ACTIVITY);
|
||||
|
||||
for (auto* brickEntity : Game::entityManager->GetEntitiesInGroup("Bricks")) {
|
||||
GameMessages::SendNotifyClientObject(brickEntity->GetObjectID(), u"Pickedup");
|
||||
|
||||
@@ -10,7 +10,7 @@ void VeMissionConsole::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
auto* inventoryComponent = user->GetComponent<InventoryComponent>();
|
||||
if (inventoryComponent != nullptr) {
|
||||
inventoryComponent->AddItem(12547, 1, eLootSourceType::NONE); // Add the panel required for pickup
|
||||
inventoryComponent->AddItem(12547, 1, eLootSourceType::ACTIVITY); // Add the panel required for pickup
|
||||
}
|
||||
|
||||
// The flag to set is 101<number>
|
||||
|
||||
@@ -163,7 +163,7 @@ int32_t ActivityManager::GetGameID(Entity* self) const {
|
||||
|
||||
float_t ActivityManager::ActivityTimerGetRemainingTime(Entity* self, const std::string& timerName) const {
|
||||
auto* timer = GetTimer(timerName);
|
||||
return timer != nullptr ? std::max(timer->stopTime - timer->runTime, 0.0f) : 0.0f;
|
||||
return timer != nullptr ? std::min(timer->stopTime - timer->runTime, 0.0f) : 0.0f;
|
||||
}
|
||||
|
||||
void ActivityManager::ActivityTimerReset(Entity* self, const std::string& timerName) {
|
||||
|
||||
@@ -294,9 +294,6 @@
|
||||
#include "ShardArmor.h"
|
||||
#include "TeslaPack.h"
|
||||
#include "StunImmunity.h"
|
||||
#include "GfRaceServer.h"
|
||||
#include "FvRaceServer.h"
|
||||
#include "VehicleDeathTriggerWaterServer.h"
|
||||
|
||||
// Survival scripts
|
||||
#include "AgSurvivalStromling.h"
|
||||
@@ -333,9 +330,6 @@
|
||||
#include "EnemyClearThreat.h"
|
||||
#include "AgSpiderBossMessage.h"
|
||||
#include "GfRaceInstancer.h"
|
||||
#include "NsRaceServer.h"
|
||||
#include "TrialFactionArmorServer.h"
|
||||
#include "ImaginationBackPack.h"
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
@@ -345,365 +339,359 @@ namespace {
|
||||
// This is in the translation unit instead of the header to prevent weird linker errors
|
||||
InvalidScript InvalidToReturn;
|
||||
std::map<std::string, CppScripts::Script*> g_Scripts;
|
||||
std::map<std::string, std::function<CppScripts::Script* ()>> scriptLoader = {
|
||||
std::map<std::string, std::function<std::unique_ptr<CppScripts::Script> ()>> scriptLoader = {
|
||||
|
||||
//VE / AG
|
||||
{ "scripts\\ai\\AG\\L_AG_SHIP_PLAYER_DEATH_TRIGGER.lua", []() { return new AgShipPlayerDeathTrigger(); } },
|
||||
{"scripts\\ai\\NP\\L_NPC_NP_SPACEMAN_BOB.lua", []() { return new NpcNpSpacemanBob(); } },
|
||||
{"scripts\\ai\\AG\\L_AG_SPACE_STUFF.lua", []() { return new AgSpaceStuff();} },
|
||||
{"scripts\\ai\\AG\\L_AG_SHIP_SHAKE.lua", []() { return new AgShipShake();}},
|
||||
{"scripts\\ai\\AG\\L_AG_SHIP_PLAYER_SHOCK_SERVER.lua", []() { return new AgShipPlayerShockServer();} },
|
||||
{"scripts\\ai\\AG\\L_AG_IMAG_SMASHABLE.lua", []() { return new AgImagSmashable();} },
|
||||
{"scripts\\02_server\\Map\\General\\L_STORY_BOX_INTERACT_SERVER.lua", []() { return new StoryBoxInteractServer();} },
|
||||
{"scripts\\02_server\\Map\\General\\L_BINOCULARS.lua", []() { return new Binoculars();} },
|
||||
{"scripts\\ai\\WILD\\L_ALL_CRATE_CHICKEN.lua", []() { return new AllCrateChicken();} },
|
||||
{ "scripts\\ai\\AG\\L_AG_SHIP_PLAYER_DEATH_TRIGGER.lua", []() { return std::make_unique<AgShipPlayerDeathTrigger>(); } },
|
||||
{"scripts\\ai\\NP\\L_NPC_NP_SPACEMAN_BOB.lua", []() { return std::make_unique<NpcNpSpacemanBob>(); } },
|
||||
{"scripts\\ai\\AG\\L_AG_SPACE_STUFF.lua", []() { return std::make_unique<AgSpaceStuff>();} },
|
||||
{"scripts\\ai\\AG\\L_AG_SHIP_SHAKE.lua", []() { return std::make_unique<AgShipShake>();}},
|
||||
{"scripts\\ai\\AG\\L_AG_SHIP_PLAYER_SHOCK_SERVER.lua", []() { return std::make_unique<AgShipPlayerShockServer>();} },
|
||||
{"scripts\\ai\\AG\\L_AG_IMAG_SMASHABLE.lua", []() { return std::make_unique<AgImagSmashable>();} },
|
||||
{"scripts\\02_server\\Map\\General\\L_STORY_BOX_INTERACT_SERVER.lua", []() { return std::make_unique<StoryBoxInteractServer>();} },
|
||||
{"scripts\\02_server\\Map\\General\\L_BINOCULARS.lua", []() { return std::make_unique<Binoculars>();} },
|
||||
{"scripts\\ai\\WILD\\L_ALL_CRATE_CHICKEN.lua", []() { return std::make_unique<AllCrateChicken>();} },
|
||||
// Broken? (below)
|
||||
{"scripts\\ai\\NS\\WH\\L_ROCKHYDRANT_SMASHABLE.lua", []() { return new RockHydrantSmashable();} },
|
||||
{"scripts\\02_server\\Map\\SS\\L_SS_MODULAR_BUILD_SERVER.lua", []() { return new SsModularBuildServer();} },
|
||||
{"scripts\\02_server\\Map\\Property\\AG_Small\\L_ZONE_AG_PROPERTY.lua", []() { return new ZoneAgProperty();} },
|
||||
{"scripts\\ai\\NS\\WH\\L_ROCKHYDRANT_SMASHABLE.lua", []() { return std::make_unique<RockHydrantSmashable>();} },
|
||||
{"scripts\\02_server\\Map\\SS\\L_SS_MODULAR_BUILD_SERVER.lua", []() { return std::make_unique<SsModularBuildServer>();} },
|
||||
{"scripts\\02_server\\Map\\Property\\AG_Small\\L_ZONE_AG_PROPERTY.lua", []() { return std::make_unique<ZoneAgProperty>();} },
|
||||
// this is done in Entity.cpp, not needed for our implementation (below)
|
||||
{"scripts\\02_server\\Map\\General\\L_POI_MISSION.lua", []() { return new InvalidScript();} },
|
||||
{"scripts\\02_server\\Map\\General\\L_TOUCH_MISSION_UPDATE_SERVER.lua", []() { return new TouchMissionUpdateServer();} },
|
||||
{"scripts\\ai\\AG\\L_ACT_SHARK_PLAYER_DEATH_TRIGGER.lua", []() { return new ActSharkPlayerDeathTrigger();} },
|
||||
{"scripts\\02_server\\Enemy\\General\\L_BASE_ENEMY_MECH.lua", []() { return new BaseEnemyMech();} },
|
||||
{"scripts\\zone\\AG\\L_ZONE_AG_SURVIVAL.lua", []() { return new ZoneAgSurvival();} },
|
||||
{"scripts\\02_server\\Objects\\L_BUFF_STATION_SERVER.lua", []() { return new AgSurvivalBuffStation();} },
|
||||
{"scripts\\ai\\AG\\L_AG_BUS_DOOR.lua", []() { return new AgBusDoor();} },
|
||||
{"scripts\\02_server\\Equipment\\L_MAESTROM_EXTRACTICATOR_SERVER.lua", []() { return new MaestromExtracticatorServer();} },
|
||||
{"scripts\\02_server\\Map\\AG\\L_AG_CAGED_BRICKS_SERVER.lua", []() { return new AgCagedBricksServer();} },
|
||||
{"scripts\\02_server\\Map\\AG\\L_NPC_WISP_SERVER.lua", []() { return new NpcWispServer();} },
|
||||
{"scripts\\02_server\\Map\\AG\\L_NPC_EPSILON_SERVER.lua", []() { return new NpcEpsilonServer();} },
|
||||
{"scripts\\ai\\AG\\L_AG_TURRET.lua", []() {return new AgTurret();}},
|
||||
{"scripts\\ai\\AG\\L_AG_TURRET_FOR_SHIP.lua", []() { return new AgTurret();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L_AG_LASER_SENSOR_SERVER.lua", []() {return new AgLaserSensorServer();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L_AG_MONUMENT_LASER_SERVER.lua", []() {return new AgMonumentLaserServer();}},
|
||||
{"scripts\\ai\\AG\\L_AG_FANS.lua", []() {return new AgFans();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L_AG_MONUMENT_BIRDS.lua", []() {return new AgMonumentBirds();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L_REMOVE_RENTAL_GEAR.lua", []() {return new RemoveRentalGear();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L_NPC_NJ_ASSISTANT_SERVER.lua", []() {return new NpcNjAssistantServer();}},
|
||||
{"scripts\\ai\\AG\\L_AG_SALUTING_NPCS.lua", []() {return new AgSalutingNpcs();}},
|
||||
{"scripts\\ai\\AG\\L_AG_JET_EFFECT_SERVER.lua", []() {return new AgJetEffectServer();}},
|
||||
{"scripts\\02_server\\Enemy\\AG\\L_BOSS_SPIDER_QUEEN_ENEMY_SERVER.lua", []() {return new BossSpiderQueenEnemyServer();}},
|
||||
{"scripts\\02_server\\Map\\Property\\AG_Small\\L_ENEMY_SPIDER_SPAWNER.lua", []() {return new EnemySpiderSpawner();}},
|
||||
{"scripts/02_server/Map/Property/AG_Small/L_ENEMY_SPIDER_SPAWNER.lua", []() {return new EnemySpiderSpawner();}},
|
||||
{"scripts\\ai\\AG\\L_AG_QB_Elevator.lua", []() {return new AgQbElevator();}},
|
||||
{"scripts\\ai\\PROPERTY\\AG\\L_AG_PROP_GUARD.lua", []() {return new AgPropGuard();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L_AG_BUGSPRAYER.lua", []() {return new AgBugsprayer();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L_NPC_AG_COURSE_STARTER.lua", []() {return new NpcAgCourseStarter();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L__AG_MONUMENT_RACE_GOAL.lua", []() {return new AgMonumentRaceGoal();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L__AG_MONUMENT_RACE_CANCEL.lua", []() {return new AgMonumentRaceCancel();}},
|
||||
{"scripts\\02_server\\Map\\AG_Spider_Queen\\L_ZONE_AG_SPIDER_QUEEN.lua", []() {return new ZoneAgSpiderQueen();}},
|
||||
{"scripts\\02_server\\Map\\AG_Spider_Queen\\L_SPIDER_BOSS_TREASURE_CHEST_SERVER.lua", []() {return new SpiderBossTreasureChestServer();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L_NPC_COWBOY_SERVER.lua", []() {return new NpcCowboyServer();}},
|
||||
{"scripts\\02_server\\Map\\Property\\AG_Med\\L_ZONE_AG_MED_PROPERTY.lua", []() {return new ZoneAgMedProperty();}},
|
||||
{"scripts\\ai\\AG\\L_AG_STROMBIE_PROPERTY.lua", []() {return new AgStromlingProperty();}},
|
||||
{"scripts\\ai\\AG\\L_AG_DARKLING_MECH.lua", []() {return new BaseEnemyMech();}},
|
||||
{"scripts\\ai\\AG\\L_AG_DARK_SPIDERLING.lua", []() {return new AgDarkSpiderling();}},
|
||||
{"scripts\\ai\\PROPERTY\\L_PROP_GUARDS.lua", []() {return new AgPropguards();}},
|
||||
{"scripts\\ai\\PROPERTY\\L_PROPERTY_FX_DAMAGE.lua", []() {return new PropertyFXDamage();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L_NPC_PIRATE_SERVER.lua", []() {return new NpcPirateServer();}},
|
||||
{"scripts\\ai\\AG\\L_AG_PICNIC_BLANKET.lua", []() {return new AgPicnicBlanket();}},
|
||||
{"scripts\\02_server\\Map\\Property\\L_PROPERTY_BANK_INTERACT_SERVER.lua", []() {return new PropertyBankInteract();}},
|
||||
{"scripts\\02_server\\Enemy\\VE\\L_VE_MECH.lua", []() {return new VeMech();}},
|
||||
{"scripts\\02_server\\Map\\VE\\L_MISSION_CONSOLE_SERVER.lua", []() {return new VeMissionConsole();}},
|
||||
{"scripts\\02_server\\Map\\VE\\L_EPSILON_SERVER.lua", []() {return new VeEpsilonServer();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_POI_MISSION.lua", []() { return std::make_unique<InvalidScript>();} },
|
||||
{"scripts\\02_server\\Map\\General\\L_TOUCH_MISSION_UPDATE_SERVER.lua", []() { return std::make_unique<TouchMissionUpdateServer>();} },
|
||||
{"scripts\\ai\\AG\\L_ACT_SHARK_PLAYER_DEATH_TRIGGER.lua", []() { return std::make_unique<ActSharkPlayerDeathTrigger>();} },
|
||||
{"scripts\\02_server\\Enemy\\General\\L_BASE_ENEMY_MECH.lua", []() { return std::make_unique<BaseEnemyMech>();} },
|
||||
{"scripts\\zone\\AG\\L_ZONE_AG_SURVIVAL.lua", []() { return std::make_unique<ZoneAgSurvival>();} },
|
||||
{"scripts\\02_server\\Objects\\L_BUFF_STATION_SERVER.lua", []() { return std::make_unique<AgSurvivalBuffStation>();} },
|
||||
{"scripts\\ai\\AG\\L_AG_BUS_DOOR.lua", []() { return std::make_unique<AgBusDoor>();} },
|
||||
{"scripts\\02_server\\Equipment\\L_MAESTROM_EXTRACTICATOR_SERVER.lua", []() { return std::make_unique<MaestromExtracticatorServer>();} },
|
||||
{"scripts\\02_server\\Map\\AG\\L_AG_CAGED_BRICKS_SERVER.lua", []() { return std::make_unique<AgCagedBricksServer>();} },
|
||||
{"scripts\\02_server\\Map\\AG\\L_NPC_WISP_SERVER.lua", []() { return std::make_unique<NpcWispServer>();} },
|
||||
{"scripts\\02_server\\Map\\AG\\L_NPC_EPSILON_SERVER.lua", []() { return std::make_unique<NpcEpsilonServer>();} },
|
||||
{"scripts\\ai\\AG\\L_AG_TURRET.lua", []() {return std::make_unique<AgTurret>();}},
|
||||
{"scripts\\ai\\AG\\L_AG_TURRET_FOR_SHIP.lua", []() { return std::make_unique<AgTurret>();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L_AG_LASER_SENSOR_SERVER.lua", []() {return std::make_unique<AgLaserSensorServer>();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L_AG_MONUMENT_LASER_SERVER.lua", []() {return std::make_unique<AgMonumentLaserServer>();}},
|
||||
{"scripts\\ai\\AG\\L_AG_FANS.lua", []() {return std::make_unique<AgFans>();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L_AG_MONUMENT_BIRDS.lua", []() {return std::make_unique<AgMonumentBirds>();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L_REMOVE_RENTAL_GEAR.lua", []() {return std::make_unique<RemoveRentalGear>();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L_NPC_NJ_ASSISTANT_SERVER.lua", []() {return std::make_unique<NpcNjAssistantServer>();}},
|
||||
{"scripts\\ai\\AG\\L_AG_SALUTING_NPCS.lua", []() {return std::make_unique<AgSalutingNpcs>();}},
|
||||
{"scripts\\ai\\AG\\L_AG_JET_EFFECT_SERVER.lua", []() {return std::make_unique<AgJetEffectServer>();}},
|
||||
{"scripts\\02_server\\Enemy\\AG\\L_BOSS_SPIDER_QUEEN_ENEMY_SERVER.lua", []() {return std::make_unique<BossSpiderQueenEnemyServer>();}},
|
||||
{"scripts\\02_server\\Map\\Property\\AG_Small\\L_ENEMY_SPIDER_SPAWNER.lua", []() {return std::make_unique<EnemySpiderSpawner>();}},
|
||||
{"scripts/02_server/Map/Property/AG_Small/L_ENEMY_SPIDER_SPAWNER.lua", []() {return std::make_unique<EnemySpiderSpawner>();}},
|
||||
{"scripts\\ai\\AG\\L_AG_QB_Elevator.lua", []() {return std::make_unique<AgQbElevator>();}},
|
||||
{"scripts\\ai\\PROPERTY\\AG\\L_AG_PROP_GUARD.lua", []() {return std::make_unique<AgPropGuard>();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L_AG_BUGSPRAYER.lua", []() {return std::make_unique<AgBugsprayer>();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L_NPC_AG_COURSE_STARTER.lua", []() {return std::make_unique<NpcAgCourseStarter>();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L__AG_MONUMENT_RACE_GOAL.lua", []() {return std::make_unique<AgMonumentRaceGoal>();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L__AG_MONUMENT_RACE_CANCEL.lua", []() {return std::make_unique<AgMonumentRaceCancel>();}},
|
||||
{"scripts\\02_server\\Map\\AG_Spider_Queen\\L_ZONE_AG_SPIDER_QUEEN.lua", []() {return std::make_unique<ZoneAgSpiderQueen>();}},
|
||||
{"scripts\\02_server\\Map\\AG_Spider_Queen\\L_SPIDER_BOSS_TREASURE_CHEST_SERVER.lua", []() {return std::make_unique<SpiderBossTreasureChestServer>();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L_NPC_COWBOY_SERVER.lua", []() {return std::make_unique<NpcCowboyServer>();}},
|
||||
{"scripts\\02_server\\Map\\Property\\AG_Med\\L_ZONE_AG_MED_PROPERTY.lua", []() {return std::make_unique<ZoneAgMedProperty>();}},
|
||||
{"scripts\\ai\\AG\\L_AG_STROMBIE_PROPERTY.lua", []() {return std::make_unique<AgStromlingProperty>();}},
|
||||
{"scripts\\ai\\AG\\L_AG_DARKLING_MECH.lua", []() {return std::make_unique<BaseEnemyMech>();}},
|
||||
{"scripts\\ai\\AG\\L_AG_DARK_SPIDERLING.lua", []() {return std::make_unique<AgDarkSpiderling>();}},
|
||||
{"scripts\\ai\\PROPERTY\\L_PROP_GUARDS.lua", []() {return std::make_unique<AgPropguards>();}},
|
||||
{"scripts\\ai\\PROPERTY\\L_PROPERTY_FX_DAMAGE.lua", []() {return std::make_unique<PropertyFXDamage>();}},
|
||||
{"scripts\\02_server\\Map\\AG\\L_NPC_PIRATE_SERVER.lua", []() {return std::make_unique<NpcPirateServer>();}},
|
||||
{"scripts\\ai\\AG\\L_AG_PICNIC_BLANKET.lua", []() {return std::make_unique<AgPicnicBlanket>();}},
|
||||
{"scripts\\02_server\\Map\\Property\\L_PROPERTY_BANK_INTERACT_SERVER.lua", []() {return std::make_unique<PropertyBankInteract>();}},
|
||||
{"scripts\\02_server\\Enemy\\VE\\L_VE_MECH.lua", []() {return std::make_unique<VeMech>();}},
|
||||
{"scripts\\02_server\\Map\\VE\\L_MISSION_CONSOLE_SERVER.lua", []() {return std::make_unique<VeMissionConsole>();}},
|
||||
{"scripts\\02_server\\Map\\VE\\L_EPSILON_SERVER.lua", []() {return std::make_unique<VeEpsilonServer>();}},
|
||||
|
||||
//NS
|
||||
{"scripts\\ai\\NS\\L_NS_MODULAR_BUILD.lua", []() {return new NsModularBuild();}},
|
||||
{"scripts\\ai\\NS\\L_NS_GET_FACTION_MISSION_SERVER.lua", []() {return new NsGetFactionMissionServer();}},
|
||||
{"scripts\\ai\\NS\\L_NS_QB_IMAGINATION_STATUE.lua", []() {return new NsQbImaginationStatue();}},
|
||||
{"scripts\\02_server\\Map\\NS\\CONCERT_CHOICEBUILD_MANAGER_SERVER.lua", []() {return new NsConcertChoiceBuildManager();}},
|
||||
{"scripts\\ai\\NS\\L_NS_CONCERT_CHOICEBUILD.lua", []() {return new NsConcertChoiceBuild();}},
|
||||
{"scripts\\ai\\NS\\L_NS_CONCERT_QUICKBUILD.lua", []() {return new NsConcertQuickBuild();}},
|
||||
{"scripts\\ai\\AG\\L_AG_STAGE_PLATFORMS.lua", []() {return new AgStagePlatforms();}},
|
||||
{"scripts\\ai\\NS\\L_NS_CONCERT_INSTRUMENT_QB.lua", []() {return new NsConcertInstrument();}},
|
||||
{"scripts\\ai\\NS\\L_NS_JONNY_FLAG_MISSION_SERVER.lua", []() {return new NsJohnnyMissionServer();}},
|
||||
{"scripts\\02_server\\Objects\\L_STINKY_FISH_TARGET.lua", []() {return new StinkyFishTarget();}},
|
||||
{"scripts\\zone\\PROPERTY\\NS\\L_ZONE_NS_PROPERTY.lua", []() {return new ZoneNsProperty();}},
|
||||
{"scripts\\02_server\\Map\\Property\\NS_Med\\L_ZONE_NS_MED_PROPERTY.lua", []() {return new ZoneNsMedProperty();}},
|
||||
{"scripts\\02_server\\Map\\NS\\L_NS_TOKEN_CONSOLE_SERVER.lua", []() {return new NsTokenConsoleServer();}},
|
||||
{"scripts\\02_server\\Map\\NS\\L_NS_LUP_TELEPORT.lua", []() {return new NsLupTeleport();}},
|
||||
{"scripts\\02_server\\Map\\NS\\Waves\\L_ZONE_NS_WAVES.lua", []() {return new ZoneNsWaves();}},
|
||||
{"scripts\\02_server\\Enemy\\Waves\\L_WAVES_BOSS_HAMMERLING_ENEMY_SERVER.lua", []() {return new WaveBossHammerling();}},
|
||||
{"scripts\\02_server\\Enemy\\Waves\\L_WAVES_BOSS_APE_ENEMY_SERVER.lua", []() {return new WaveBossApe();}},
|
||||
{"scripts\\02_server\\Enemy\\Waves\\L_WAVES_BOSS_DARK_SPIDERLING_ENEMY_SERVER.lua", []() {return new WaveBossSpiderling();}},
|
||||
{"scripts\\02_server\\Enemy\\Waves\\L_WAVES_BOSS_HORESEMEN_ENEMY_SERVER.lua", []() {return new WaveBossHorsemen();}},
|
||||
{"scripts\\02_server\\Minigame\\General\\L_MINIGAME_TREASURE_CHEST_SERVER.lua", []() {return new MinigameTreasureChestServer();}},
|
||||
{"scripts\\02_server\\Map\\NS\\L_NS_LEGO_CLUB_DOOR.lua", []() {return new NsLegoClubDoor();}},
|
||||
{"scripts/ai/NS/L_CL_RING.lua", []() {return new ClRing();}},
|
||||
{"scripts\\ai\\WILD\\L_WILD_AMBIENTS.lua", []() {return new WildAmbients();}},
|
||||
{"scripts\\ai\\NS\\NS_PP_01\\L_NS_PP_01_TELEPORT.lua", []() {return new PropertyDeathPlane();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_QB_SPAWNER.lua", []() {return new QbSpawner();}},
|
||||
{"scripts\\ai\\AG\\L_AG_QB_Wall.lua", []() {return new AgQbWall();}},
|
||||
{"scripts\\ai\\NS\\L_NS_MODULAR_BUILD.lua", []() {return std::make_unique<NsModularBuild>();}},
|
||||
{"scripts\\ai\\NS\\L_NS_GET_FACTION_MISSION_SERVER.lua", []() {return std::make_unique<NsGetFactionMissionServer>();}},
|
||||
{"scripts\\ai\\NS\\L_NS_QB_IMAGINATION_STATUE.lua", []() {return std::make_unique<NsQbImaginationStatue>();}},
|
||||
{"scripts\\02_server\\Map\\NS\\CONCERT_CHOICEBUILD_MANAGER_SERVER.lua", []() {return std::make_unique<NsConcertChoiceBuildManager>();}},
|
||||
{"scripts\\ai\\NS\\L_NS_CONCERT_CHOICEBUILD.lua", []() {return std::make_unique<NsConcertChoiceBuild>();}},
|
||||
{"scripts\\ai\\NS\\L_NS_CONCERT_QUICKBUILD.lua", []() {return std::make_unique<NsConcertQuickBuild>();}},
|
||||
{"scripts\\ai\\AG\\L_AG_STAGE_PLATFORMS.lua", []() {return std::make_unique<AgStagePlatforms>();}},
|
||||
{"scripts\\ai\\NS\\L_NS_CONCERT_INSTRUMENT_QB.lua", []() {return std::make_unique<NsConcertInstrument>();}},
|
||||
{"scripts\\ai\\NS\\L_NS_JONNY_FLAG_MISSION_SERVER.lua", []() {return std::make_unique<NsJohnnyMissionServer>();}},
|
||||
{"scripts\\02_server\\Objects\\L_STINKY_FISH_TARGET.lua", []() {return std::make_unique<StinkyFishTarget>();}},
|
||||
{"scripts\\zone\\PROPERTY\\NS\\L_ZONE_NS_PROPERTY.lua", []() {return std::make_unique<ZoneNsProperty>();}},
|
||||
{"scripts\\02_server\\Map\\Property\\NS_Med\\L_ZONE_NS_MED_PROPERTY.lua", []() {return std::make_unique<ZoneNsMedProperty>();}},
|
||||
{"scripts\\02_server\\Map\\NS\\L_NS_TOKEN_CONSOLE_SERVER.lua", []() {return std::make_unique<NsTokenConsoleServer>();}},
|
||||
{"scripts\\02_server\\Map\\NS\\L_NS_LUP_TELEPORT.lua", []() {return std::make_unique<NsLupTeleport>();}},
|
||||
{"scripts\\02_server\\Map\\NS\\Waves\\L_ZONE_NS_WAVES.lua", []() {return std::make_unique<ZoneNsWaves>();}},
|
||||
{"scripts\\02_server\\Enemy\\Waves\\L_WAVES_BOSS_HAMMERLING_ENEMY_SERVER.lua", []() {return std::make_unique<WaveBossHammerling>();}},
|
||||
{"scripts\\02_server\\Enemy\\Waves\\L_WAVES_BOSS_APE_ENEMY_SERVER.lua", []() {return std::make_unique<WaveBossApe>();}},
|
||||
{"scripts\\02_server\\Enemy\\Waves\\L_WAVES_BOSS_DARK_SPIDERLING_ENEMY_SERVER.lua", []() {return std::make_unique<WaveBossSpiderling>();}},
|
||||
{"scripts\\02_server\\Enemy\\Waves\\L_WAVES_BOSS_HORESEMEN_ENEMY_SERVER.lua", []() {return std::make_unique<WaveBossHorsemen>();}},
|
||||
{"scripts\\02_server\\Minigame\\General\\L_MINIGAME_TREASURE_CHEST_SERVER.lua", []() {return std::make_unique<MinigameTreasureChestServer>();}},
|
||||
{"scripts\\02_server\\Map\\NS\\L_NS_LEGO_CLUB_DOOR.lua", []() {return std::make_unique<NsLegoClubDoor>();}},
|
||||
{"scripts/ai/NS/L_CL_RING.lua", []() {return std::make_unique<ClRing>();}},
|
||||
{"scripts\\ai\\WILD\\L_WILD_AMBIENTS.lua", []() {return std::make_unique<WildAmbients>();}},
|
||||
{"scripts\\ai\\NS\\NS_PP_01\\L_NS_PP_01_TELEPORT.lua", []() {return std::make_unique<PropertyDeathPlane>();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_QB_SPAWNER.lua", []() {return std::make_unique<QbSpawner>();}},
|
||||
{"scripts\\ai\\AG\\L_AG_QB_Wall.lua", []() {return std::make_unique<AgQbWall>();}},
|
||||
|
||||
//GF
|
||||
{"scripts\\02_server\\Map\\GF\\L_GF_TORCH.lua", []() {return new GfTikiTorch();}},
|
||||
{"scripts\\ai\\GF\\L_SPECIAL_FIREPIT.lua", []() {return new GfCampfire();}},
|
||||
{"scripts\\ai\\GF\\L_GF_ORGAN.lua", []() {return new GfOrgan();}},
|
||||
{"scripts\\ai\\GF\\L_GF_BANANA.lua", []() {return new GfBanana();}},
|
||||
{"scripts\\ai\\GF\\L_GF_BANANA_CLUSTER.lua", []() {return new GfBananaCluster();}},
|
||||
{"scripts/ai/GF/L_GF_JAILKEEP_MISSION.lua", []() {return new GfJailkeepMission();}},
|
||||
{"scripts\\ai\\GF\\L_TRIGGER_AMBUSH.lua", []() {return new TriggerAmbush();}},
|
||||
{"scripts\\02_server\\Map\\GF\\L_GF_CAPTAINS_CANNON.lua", []() {return new GfCaptainsCannon();}},
|
||||
{"scripts\\02_server\\Map\\GF\\L_MAST_TELEPORT.lua", []() {return new MastTeleport();}},
|
||||
{"scripts\\ai\\GF\\L_GF_JAIL_WALLS.lua", []() {return new GfJailWalls();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_QB_ENEMY_STUNNER.lua", []() {return new QbEnemyStunner();}},
|
||||
{"scripts\\02_server\\Map\\GF\\L_GF_TORCH.lua", []() {return std::make_unique<GfTikiTorch>();}},
|
||||
{"scripts\\ai\\GF\\L_SPECIAL_FIREPIT.lua", []() {return std::make_unique<GfCampfire>();}},
|
||||
{"scripts\\ai\\GF\\L_GF_ORGAN.lua", []() {return std::make_unique<GfOrgan>();}},
|
||||
{"scripts\\ai\\GF\\L_GF_BANANA.lua", []() {return std::make_unique<GfBanana>();}},
|
||||
{"scripts\\ai\\GF\\L_GF_BANANA_CLUSTER.lua", []() {return std::make_unique<GfBananaCluster>();}},
|
||||
{"scripts/ai/GF/L_GF_JAILKEEP_MISSION.lua", []() {return std::make_unique<GfJailkeepMission>();}},
|
||||
{"scripts\\ai\\GF\\L_TRIGGER_AMBUSH.lua", []() {return std::make_unique<TriggerAmbush>();}},
|
||||
{"scripts\\02_server\\Map\\GF\\L_GF_CAPTAINS_CANNON.lua", []() {return std::make_unique<GfCaptainsCannon>();}},
|
||||
{"scripts\\02_server\\Map\\GF\\L_MAST_TELEPORT.lua", []() {return std::make_unique<MastTeleport>();}},
|
||||
{"scripts\\ai\\GF\\L_GF_JAIL_WALLS.lua", []() {return std::make_unique<GfJailWalls>();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_QB_ENEMY_STUNNER.lua", []() {return std::make_unique<QbEnemyStunner>();}},
|
||||
//Technically also used once in AG (below)
|
||||
{"scripts\\ai\\GF\\L_GF_PET_DIG_BUILD.lua", []() {return new PetDigBuild();}},
|
||||
{"scripts\\02_server\\Map\\GF\\L_SPAWN_LION_SERVER.lua", []() {return new SpawnLionServer();}},
|
||||
{"scripts\\02_server\\Enemy\\General\\L_BASE_ENEMY_APE.lua", []() {return new BaseEnemyApe();}},
|
||||
{"scripts\\02_server\\Enemy\\General\\L_GF_APE_SMASHING_QB.lua", []() {return new GfApeSmashingQB();}},
|
||||
{"scripts\\zone\\PROPERTY\\GF\\L_ZONE_GF_PROPERTY.lua", []() {return new ZoneGfProperty();}},
|
||||
{"scripts\\ai\\GF\\L_GF_ARCHWAY.lua", []() {return new GfArchway();}},
|
||||
{"scripts\\ai\\GF\\L_GF_MAELSTROM_GEYSER.lua", []() {return new GfMaelstromGeyser();}},
|
||||
{"scripts\\ai\\GF\\L_PIRATE_REP.lua", []() {return new PirateRep();}},
|
||||
{"scripts\\ai\\GF\\L_GF_PARROT_CRASH.lua", []() {return new GfParrotCrash();}},
|
||||
{"scripts\\ai\\GF\\L_GF_PET_DIG_BUILD.lua", []() {return std::make_unique<PetDigBuild>();}},
|
||||
{"scripts\\02_server\\Map\\GF\\L_SPAWN_LION_SERVER.lua", []() {return std::make_unique<SpawnLionServer>();}},
|
||||
{"scripts\\02_server\\Enemy\\General\\L_BASE_ENEMY_APE.lua", []() {return std::make_unique<BaseEnemyApe>();}},
|
||||
{"scripts\\02_server\\Enemy\\General\\L_GF_APE_SMASHING_QB.lua", []() {return std::make_unique<GfApeSmashingQB>();}},
|
||||
{"scripts\\zone\\PROPERTY\\GF\\L_ZONE_GF_PROPERTY.lua", []() {return std::make_unique<ZoneGfProperty>();}},
|
||||
{"scripts\\ai\\GF\\L_GF_ARCHWAY.lua", []() {return std::make_unique<GfArchway>();}},
|
||||
{"scripts\\ai\\GF\\L_GF_MAELSTROM_GEYSER.lua", []() {return std::make_unique<GfMaelstromGeyser>();}},
|
||||
{"scripts\\ai\\GF\\L_PIRATE_REP.lua", []() {return std::make_unique<PirateRep>();}},
|
||||
{"scripts\\ai\\GF\\L_GF_PARROT_CRASH.lua", []() {return std::make_unique<GfParrotCrash>();}},
|
||||
|
||||
//SG
|
||||
{"scripts\\ai\\MINIGAME\\SG_GF\\SERVER\\SG_CANNON.lua", []() {return new SGCannon();}},
|
||||
{"scripts\\ai\\MINIGAME\\SG_GF\\L_ZONE_SG_SERVER.lua", []() {return new ZoneSGServer();}},
|
||||
{"scripts\\ai\\MINIGAME\\SG_GF\\SERVER\\SG_CANNON.lua", []() {return std::make_unique<SGCannon>();}},
|
||||
{"scripts\\ai\\MINIGAME\\SG_GF\\L_ZONE_SG_SERVER.lua", []() {return std::make_unique<ZoneSGServer>();}},
|
||||
|
||||
//PR
|
||||
{"scripts\\client\\ai\\PR\\L_PR_WHISTLE.lua", []() {return new PrWhistle();}},
|
||||
{"scripts\\02_server\\Map\\PR\\L_PR_SEAGULL_FLY.lua", []() {return new PrSeagullFly();}},
|
||||
{"scripts\\ai\\PETS\\L_HYDRANT_SMASHABLE.lua", []() {return new HydrantSmashable();}},
|
||||
{"scripts\\02_server\\map\\PR\\L_HYDRANT_BROKEN.lua", []() {return new HydrantBroken();}},
|
||||
{"scripts\\02_server\\Map\\General\\PET_DIG_SERVER.lua", []() {return new PetDigServer();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_SKELETON_DRAGON_PET_DIG_SERVER.lua", []() {return new PetDigServer();}},
|
||||
//{"scripts\\02_server\\Map\\AM\\L_SKELETON_DRAGON_PET_DIG_SERVER.lua", [](){return new PetDigServer();}},
|
||||
{"scripts\\client\\ai\\PR\\L_CRAB_SERVER.lua", []() {return new CrabServer();}},
|
||||
{"scripts\\02_server\\Pets\\L_PET_FROM_DIG_SERVER.lua", []() {return new PetFromDigServer();}},
|
||||
{"scripts\\02_server\\Pets\\L_PET_FROM_OBJECT_SERVER.lua", []() {return new PetFromObjectServer();}},
|
||||
{"scripts\\02_server\\Pets\\L_DAMAGING_PET.lua", []() {return new DamagingPets();}},
|
||||
{"scripts\\02_server\\Map\\PR\\L_SPAWN_GRYPHON_SERVER.lua", []() {return new SpawnGryphonServer();}},
|
||||
{"scripts\\client\\ai\\PR\\L_PR_WHISTLE.lua", []() {return std::make_unique<PrWhistle>();}},
|
||||
{"scripts\\02_server\\Map\\PR\\L_PR_SEAGULL_FLY.lua", []() {return std::make_unique<PrSeagullFly>();}},
|
||||
{"scripts\\ai\\PETS\\L_HYDRANT_SMASHABLE.lua", []() {return std::make_unique<HydrantSmashable>();}},
|
||||
{"scripts\\02_server\\map\\PR\\L_HYDRANT_BROKEN.lua", []() {return std::make_unique<HydrantBroken>();}},
|
||||
{"scripts\\02_server\\Map\\General\\PET_DIG_SERVER.lua", []() {return std::make_unique<PetDigServer>();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_SKELETON_DRAGON_PET_DIG_SERVER.lua", []() {return std::make_unique<PetDigServer>();}},
|
||||
//{"scripts\\02_server\\Map\\AM\\L_SKELETON_DRAGON_PET_DIG_SERVER.lua", [](){return std::make_unique<PetDigServer>();}},
|
||||
{"scripts\\client\\ai\\PR\\L_CRAB_SERVER.lua", []() {return std::make_unique<CrabServer>();}},
|
||||
{"scripts\\02_server\\Pets\\L_PET_FROM_DIG_SERVER.lua", []() {return std::make_unique<PetFromDigServer>();}},
|
||||
{"scripts\\02_server\\Pets\\L_PET_FROM_OBJECT_SERVER.lua", []() {return std::make_unique<PetFromObjectServer>();}},
|
||||
{"scripts\\02_server\\Pets\\L_DAMAGING_PET.lua", []() {return std::make_unique<DamagingPets>();}},
|
||||
{"scripts\\02_server\\Map\\PR\\L_SPAWN_GRYPHON_SERVER.lua", []() {return std::make_unique<SpawnGryphonServer>();}},
|
||||
|
||||
//FV
|
||||
{"scripts\\02_server\\Map\\FV\\L_ACT_CANDLE.lua", []() {return new FvCandle();}},
|
||||
{"scripts\\02_server\\Map\\FV\\L_ENEMY_RONIN_SPAWNER.lua", []() {return new EnemyRoninSpawner();}},
|
||||
{"scripts\\02_server\\Enemy\\FV\\L_FV_MAELSTROM_CAVALRY.lua", []() {return new FvMaelstromCavalry();}},
|
||||
{"scripts\\ai\\FV\\L_ACT_NINJA_TURRET_1.lua", []() {return new ActNinjaTurret();}},
|
||||
{"scripts\\02_server\\Map\\FV\\L_FV_HORSEMEN_TRIGGER.lua", []() {return new FvHorsemenTrigger();}},
|
||||
{"scripts\\ai\\FV\\L_FV_FLYING_CREVICE_DRAGON.lua", []() {return new FvFlyingCreviceDragon();}},
|
||||
{"scripts\\02_server\\Enemy\\FV\\L_FV_MAELSTROM_DRAGON.lua", []() {return new FvMaelstromDragon();}},
|
||||
{"scripts\\ai\\FV\\L_FV_DRAGON_SMASHING_GOLEM_QB.lua", []() {return new FvDragonSmashingGolemQb();}},
|
||||
{"scripts\\02_server\\Enemy\\General\\L_TREASURE_CHEST_DRAGON_SERVER.lua", []() {return new TreasureChestDragonServer();}},
|
||||
{"scripts\\ai\\GENERAL\\L_INSTANCE_EXIT_TRANSFER_PLAYER_TO_LAST_NON_INSTANCE.lua", []() {return new InstanceExitTransferPlayerToLastNonInstance();}},
|
||||
{"scripts\\ai\\FV\\L_NPC_FREE_GF_NINJAS.lua", []() {return new FvFreeGfNinjas();}},
|
||||
{"scripts\\ai\\FV\\L_FV_PANDA_SPAWNER_SERVER.lua", []() {return new FvPandaSpawnerServer();}},
|
||||
{"scripts\\ai\\FV\\L_FV_PANDA_SERVER.lua", []() {return new FvPandaServer();}},
|
||||
{"scripts\\zone\\PROPERTY\\FV\\L_ZONE_FV_PROPERTY.lua", []() {return new ZoneFvProperty();}},
|
||||
{"scripts\\ai\\FV\\L_FV_BRICK_PUZZLE_SERVER.lua", []() {return new FvBrickPuzzleServer();}},
|
||||
{"scripts\\ai\\FV\\L_FV_CONSOLE_LEFT_QUICKBUILD.lua", []() {return new FvConsoleLeftQuickbuild();}},
|
||||
{"scripts\\ai\\FV\\L_FV_CONSOLE_RIGHT_QUICKBUILD.lua", []() {return new FvConsoleRightQuickbuild();}},
|
||||
{"scripts\\ai\\FV\\L_FV_FACILITY_BRICK.lua", []() {return new FvFacilityBrick();}},
|
||||
{"scripts\\ai\\FV\\L_FV_FACILITY_PIPES.lua", []() {return new FvFacilityPipes();}},
|
||||
{"scripts\\02_server\\Map\\FV\\L_IMG_BRICK_CONSOLE_QB.lua", []() {return new ImgBrickConsoleQB();}},
|
||||
{"scripts\\ai\\FV\\L_ACT_PARADOX_PIPE_FIX.lua", []() {return new ActParadoxPipeFix();}},
|
||||
{"scripts\\ai\\FV\\L_FV_NINJA_GUARDS.lua", []() {return new FvNinjaGuard();}},
|
||||
{"scripts\\ai\\FV\\L_ACT_PASS_THROUGH_WALL.lua", []() {return new FvPassThroughWall();}},
|
||||
{"scripts\\ai\\FV\\L_ACT_BOUNCE_OVER_WALL.lua", []() {return new FvBounceOverWall();}},
|
||||
{"scripts\\02_server\\Map\\FV\\L_NPC_FONG.lua", []() {return new FvFong();}},
|
||||
{"scripts\\ai\\FV\\L_FV_MAELSTROM_GEYSER.lua", []() {return new FvMaelstromGeyser();}},
|
||||
{"scripts\\02_server\\Map\\FV\\Racing\\RACE_SHIP_LAP_COLUMNS_SERVER.lua", []() {return new RaceShipLapColumnsServer();}},
|
||||
{"scripts\\02_server\\Map\\FV\\L_ACT_CANDLE.lua", []() {return std::make_unique<FvCandle>();}},
|
||||
{"scripts\\02_server\\Map\\FV\\L_ENEMY_RONIN_SPAWNER.lua", []() {return std::make_unique<EnemyRoninSpawner>();}},
|
||||
{"scripts\\02_server\\Enemy\\FV\\L_FV_MAELSTROM_CAVALRY.lua", []() {return std::make_unique<FvMaelstromCavalry>();}},
|
||||
{"scripts\\ai\\FV\\L_ACT_NINJA_TURRET_1.lua", []() {return std::make_unique<ActNinjaTurret>();}},
|
||||
{"scripts\\02_server\\Map\\FV\\L_FV_HORSEMEN_TRIGGER.lua", []() {return std::make_unique<FvHorsemenTrigger>();}},
|
||||
{"scripts\\ai\\FV\\L_FV_FLYING_CREVICE_DRAGON.lua", []() {return std::make_unique<FvFlyingCreviceDragon>();}},
|
||||
{"scripts\\02_server\\Enemy\\FV\\L_FV_MAELSTROM_DRAGON.lua", []() {return std::make_unique<FvMaelstromDragon>();}},
|
||||
{"scripts\\ai\\FV\\L_FV_DRAGON_SMASHING_GOLEM_QB.lua", []() {return std::make_unique<FvDragonSmashingGolemQb>();}},
|
||||
{"scripts\\02_server\\Enemy\\General\\L_TREASURE_CHEST_DRAGON_SERVER.lua", []() {return std::make_unique<TreasureChestDragonServer>();}},
|
||||
{"scripts\\ai\\GENERAL\\L_INSTANCE_EXIT_TRANSFER_PLAYER_TO_LAST_NON_INSTANCE.lua", []() {return std::make_unique<InstanceExitTransferPlayerToLastNonInstance>();}},
|
||||
{"scripts\\ai\\FV\\L_NPC_FREE_GF_NINJAS.lua", []() {return std::make_unique<FvFreeGfNinjas>();}},
|
||||
{"scripts\\ai\\FV\\L_FV_PANDA_SPAWNER_SERVER.lua", []() {return std::make_unique<FvPandaSpawnerServer>();}},
|
||||
{"scripts\\ai\\FV\\L_FV_PANDA_SERVER.lua", []() {return std::make_unique<FvPandaServer>();}},
|
||||
{"scripts\\zone\\PROPERTY\\FV\\L_ZONE_FV_PROPERTY.lua", []() {return std::make_unique<ZoneFvProperty>();}},
|
||||
{"scripts\\ai\\FV\\L_FV_BRICK_PUZZLE_SERVER.lua", []() {return std::make_unique<FvBrickPuzzleServer>();}},
|
||||
{"scripts\\ai\\FV\\L_FV_CONSOLE_LEFT_QUICKBUILD.lua", []() {return std::make_unique<FvConsoleLeftQuickbuild>();}},
|
||||
{"scripts\\ai\\FV\\L_FV_CONSOLE_RIGHT_QUICKBUILD.lua", []() {return std::make_unique<FvConsoleRightQuickbuild>();}},
|
||||
{"scripts\\ai\\FV\\L_FV_FACILITY_BRICK.lua", []() {return std::make_unique<FvFacilityBrick>();}},
|
||||
{"scripts\\ai\\FV\\L_FV_FACILITY_PIPES.lua", []() {return std::make_unique<FvFacilityPipes>();}},
|
||||
{"scripts\\02_server\\Map\\FV\\L_IMG_BRICK_CONSOLE_QB.lua", []() {return std::make_unique<ImgBrickConsoleQB>();}},
|
||||
{"scripts\\ai\\FV\\L_ACT_PARADOX_PIPE_FIX.lua", []() {return std::make_unique<ActParadoxPipeFix>();}},
|
||||
{"scripts\\ai\\FV\\L_FV_NINJA_GUARDS.lua", []() {return std::make_unique<FvNinjaGuard>();}},
|
||||
{"scripts\\ai\\FV\\L_ACT_PASS_THROUGH_WALL.lua", []() {return std::make_unique<FvPassThroughWall>();}},
|
||||
{"scripts\\ai\\FV\\L_ACT_BOUNCE_OVER_WALL.lua", []() {return std::make_unique<FvBounceOverWall>();}},
|
||||
{"scripts\\02_server\\Map\\FV\\L_NPC_FONG.lua", []() {return std::make_unique<FvFong>();}},
|
||||
{"scripts\\ai\\FV\\L_FV_MAELSTROM_GEYSER.lua", []() {return std::make_unique<FvMaelstromGeyser>();}},
|
||||
{"scripts\\02_server\\Map\\FV\\Racing\\RACE_SHIP_LAP_COLUMNS_SERVER.lua", []() {return std::make_unique<RaceShipLapColumnsServer>();}},
|
||||
|
||||
//yes we know the lap numbers dont match the file name or anim. Thats what they desgined it as.
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_DRAGON_LAP1_SERVER.lua", []() {return new FvRaceDragon("lap_01", 2);}},
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_DRAGON_LAP2_SERVER.lua", []() {return new FvRaceDragon("lap_02", 0);}},
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_DRAGON_LAP3_SERVER.lua", []() {return new FvRaceDragon("lap_03", 1);}},
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_PILLAR_ABC_SERVER.lua", []() {return new FvRacePillarABCServer();}},
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_PILLAR_D_SERVER.lua", []() {return new FvRacePillarDServer();}},
|
||||
{"scripts\\02_server\\Map\\FV\\Racing\\RACE_FIREBALLS.lua", []() {return new RaceFireballs();}},
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_DRAGON_LAP1_SERVER.lua", []() {return std::make_unique<FvRaceDragon>("lap_01", 2);}},
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_DRAGON_LAP2_SERVER.lua", []() {return std::make_unique<FvRaceDragon>("lap_02", 0);}},
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_DRAGON_LAP3_SERVER.lua", []() {return std::make_unique<FvRaceDragon>("lap_03", 1);}},
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_PILLAR_ABC_SERVER.lua", []() {return std::make_unique<FvRacePillarABCServer>();}},
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_PILLAR_D_SERVER.lua", []() {return std::make_unique<FvRacePillarDServer>();}},
|
||||
{"scripts\\02_server\\Map\\FV\\Racing\\RACE_FIREBALLS.lua", []() {return std::make_unique<RaceFireballs>();}},
|
||||
|
||||
//Misc.
|
||||
{"scripts\\02_server\\Map\\General\\L_EXPLODING_ASSET.lua", []() {return new ExplodingAsset();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_WISHING_WELL_SERVER.lua", []() {return new WishingWellServer();}},
|
||||
{"scripts\\ai\\ACT\\L_ACT_PLAYER_DEATH_TRIGGER.lua", []() {return new ActPlayerDeathTrigger();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_GROWING_FLOWER_SERVER.lua", []() {return new GrowingFlower();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_TOKEN_CONSOLE_SERVER.lua", []() {return new TokenConsoleServer();}},
|
||||
{"scripts\\ai\\ACT\\FootRace\\L_ACT_BASE_FOOT_RACE.lua", []() {return new BaseFootRaceManager();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_PROP_PLATFORM.lua", []() {return new PropertyPlatform();}},
|
||||
{"scripts\\02_server\\Map\\VE\\L_VE_BRICKSAMPLE_SERVER.lua", []() {return new VeBricksampleServer();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_MAIL_BOX_SERVER.lua", []() {return new MailBoxServer();}},
|
||||
{"scripts\\ai\\ACT\\L_ACT_MINE.lua", []() {return new ActMine();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_WANDERING_VENDOR.lua", []() {return new WanderingVendor();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_EXPLODING_ASSET.lua", []() {return std::make_unique<ExplodingAsset>();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_WISHING_WELL_SERVER.lua", []() {return std::make_unique<WishingWellServer>();}},
|
||||
{"scripts\\ai\\ACT\\L_ACT_PLAYER_DEATH_TRIGGER.lua", []() {return std::make_unique<ActPlayerDeathTrigger>();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_GROWING_FLOWER_SERVER.lua", []() {return std::make_unique<GrowingFlower>();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_TOKEN_CONSOLE_SERVER.lua", []() {return std::make_unique<TokenConsoleServer>();}},
|
||||
{"scripts\\ai\\ACT\\FootRace\\L_ACT_BASE_FOOT_RACE.lua", []() {return std::make_unique<BaseFootRaceManager>();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_PROP_PLATFORM.lua", []() {return std::make_unique<PropertyPlatform>();}},
|
||||
{"scripts\\02_server\\Map\\VE\\L_VE_BRICKSAMPLE_SERVER.lua", []() {return std::make_unique<VeBricksampleServer>();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_MAIL_BOX_SERVER.lua", []() {return std::make_unique<MailBoxServer>();}},
|
||||
{"scripts\\ai\\ACT\\L_ACT_MINE.lua", []() {return std::make_unique<ActMine>();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_WANDERING_VENDOR.lua", []() {return std::make_unique<WanderingVendor>();}},
|
||||
|
||||
//Racing
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\RACE_IMAGINE_CRATE_SERVER.lua", []() {return new RaceImagineCrateServer();}},
|
||||
{"scripts\\ai\\ACT\\L_ACT_VEHICLE_DEATH_TRIGGER.lua", []() {return new ActVehicleDeathTrigger();}},
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\RACE_IMAGINE_POWERUP.lua", []() {return new RaceImaginePowerup();}},
|
||||
{"scripts\\02_server\\Map\\FV\\Racing\\RACE_MAELSTROM_GEISER.lua", []() {return new RaceMaelstromGeiser();}},
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_SMASH_EGG_IMAGINE_SERVER.lua", []() {return new FvRaceSmashEggImagineServer();}},
|
||||
{"scripts\\02_server\\Map\\FV\\Racing\\FV_RACING_COLUMNS.lua", []() {return new FvRacingColumns();}},
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\RACE_SMASH_SERVER.lua", []() {return new RaceSmashServer();}},
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\RACE_IMAGINE_CRATE_SERVER.lua", []() {return std::make_unique<RaceImagineCrateServer>();}},
|
||||
{"scripts\\ai\\ACT\\L_ACT_VEHICLE_DEATH_TRIGGER.lua", []() {return std::make_unique<ActVehicleDeathTrigger>();}},
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\RACE_IMAGINE_POWERUP.lua", []() {return std::make_unique<RaceImaginePowerup>();}},
|
||||
{"scripts\\02_server\\Map\\FV\\Racing\\RACE_MAELSTROM_GEISER.lua", []() {return std::make_unique<RaceMaelstromGeiser>();}},
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_SMASH_EGG_IMAGINE_SERVER.lua", []() {return std::make_unique<FvRaceSmashEggImagineServer>();}},
|
||||
{"scripts\\02_server\\Map\\FV\\Racing\\FV_RACING_COLUMNS.lua", []() {return std::make_unique<FvRacingColumns>();}},
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\RACE_SMASH_SERVER.lua", []() {return std::make_unique<RaceSmashServer>();}},
|
||||
|
||||
//NT
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_SENTINELWALKWAY_SERVER.lua", []() {return new NtSentinelWalkwayServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_PARADOXTELE_SERVER.lua", []() {return new NtParadoxTeleServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_DARKITECT_REVEAL_SERVER.lua", []() {return new NtDarkitectRevealServer();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_BANK_INTERACT_SERVER.lua", []() {return new BankInteractServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_VENTURESPEEDPAD_SERVER.lua", []() {return new NtVentureSpeedPadServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_VENTURE_CANNON_SERVER.lua", []() {return new NtVentureCannonServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_COMBAT_CHALLENGE_SERVER.lua", []() {return new NtCombatChallengeServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_COMBAT_CHALLENGE_DUMMY.lua", []() {return new NtCombatChallengeDummy();}},
|
||||
{"scripts\\02_server\\Map\\NT\\\\L_NT_COMBAT_EXPLODING_TARGET.lua", []() {return new NtCombatChallengeExplodingDummy();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_BASE_INTERACT_DROP_LOOT_SERVER.lua", []() {return new BaseInteractDropLootServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_ASSEMBLYTUBE_SERVER.lua", []() {return new NtAssemblyTubeServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_PARADOX_PANEL_SERVER.lua", []() {return new NtParadoxPanelServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_IMAG_BEAM_BUFFER.lua", []() {return new NtImagBeamBuffer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_BEAM_IMAGINATION_COLLECTORS.lua", []() {return new NtBeamImaginationCollectors();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_DIRT_CLOUD_SERVER.lua", []() {return new NtDirtCloudServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_CONSOLE_TELEPORT_SERVER.lua", []() {return new NtConsoleTeleportServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_SPAWN_STEGO_SERVER.lua", []() {return new SpawnStegoServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_SPAWN_SABERCAT_SERVER.lua", []() {return new SpawnSaberCatServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_SPAWN_SHRAKE_SERVER.lua", []() {return new SpawnShrakeServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_DUKE_SERVER.lua", []() {return new NtDukeServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_HAEL_SERVER.lua", []() {return new NtHaelServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_FACTION_SPY_SERVER.lua", []() {return new NtFactionSpyServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_OVERBUILD_SERVER.lua", []() {return new NtOverbuildServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_VANDA_SERVER.lua", []() {return new NtVandaServer();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_FORCE_VOLUME_SERVER.lua", []() {return new ForceVolumeServer();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_FRICTION_VOLUME_SERVER.lua", []() {return new FrictionVolumeServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_XRAY_SERVER.lua", []() {return new NtXRayServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_SLEEPING_GUARD.lua", []() {return new NtSleepingGuard();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_IMAGIMETER_VISIBILITY_SERVER.lua", []() {return new NTImagimeterVisibility();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_PIPE_VISIBILITY_SERVER.lua", []() {return new NTPipeVisibilityServer();}},
|
||||
{"scripts\\ai\\MINIGAME\\Objects\\MINIGAME_BLUE_MARK.lua", []() {return new MinigameBlueMark();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_NAOMI_BREADCRUMB_SERVER.lua", []() {return new NtNaomiBreadcrumbServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_NAOMI_DIRT_SERVER.lua", []() {return new NTNaomiDirtServer();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_SENTINELWALKWAY_SERVER.lua", []() {return std::make_unique<NtSentinelWalkwayServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_PARADOXTELE_SERVER.lua", []() {return std::make_unique<NtParadoxTeleServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_DARKITECT_REVEAL_SERVER.lua", []() {return std::make_unique<NtDarkitectRevealServer>();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_BANK_INTERACT_SERVER.lua", []() {return std::make_unique<BankInteractServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_VENTURESPEEDPAD_SERVER.lua", []() {return std::make_unique<NtVentureSpeedPadServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_VENTURE_CANNON_SERVER.lua", []() {return std::make_unique<NtVentureCannonServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_COMBAT_CHALLENGE_SERVER.lua", []() {return std::make_unique<NtCombatChallengeServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_COMBAT_CHALLENGE_DUMMY.lua", []() {return std::make_unique<NtCombatChallengeDummy>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\\\L_NT_COMBAT_EXPLODING_TARGET.lua", []() {return std::make_unique<NtCombatChallengeExplodingDummy>();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_BASE_INTERACT_DROP_LOOT_SERVER.lua", []() {return std::make_unique<BaseInteractDropLootServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_ASSEMBLYTUBE_SERVER.lua", []() {return std::make_unique<NtAssemblyTubeServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_PARADOX_PANEL_SERVER.lua", []() {return std::make_unique<NtParadoxPanelServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_IMAG_BEAM_BUFFER.lua", []() {return std::make_unique<NtImagBeamBuffer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_BEAM_IMAGINATION_COLLECTORS.lua", []() {return std::make_unique<NtBeamImaginationCollectors>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_DIRT_CLOUD_SERVER.lua", []() {return std::make_unique<NtDirtCloudServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_CONSOLE_TELEPORT_SERVER.lua", []() {return std::make_unique<NtConsoleTeleportServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_SPAWN_STEGO_SERVER.lua", []() {return std::make_unique<SpawnStegoServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_SPAWN_SABERCAT_SERVER.lua", []() {return std::make_unique<SpawnSaberCatServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_SPAWN_SHRAKE_SERVER.lua", []() {return std::make_unique<SpawnShrakeServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_DUKE_SERVER.lua", []() {return std::make_unique<NtDukeServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_HAEL_SERVER.lua", []() {return std::make_unique<NtHaelServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_FACTION_SPY_SERVER.lua", []() {return std::make_unique<NtFactionSpyServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_OVERBUILD_SERVER.lua", []() {return std::make_unique<NtOverbuildServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_VANDA_SERVER.lua", []() {return std::make_unique<NtVandaServer>();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_FORCE_VOLUME_SERVER.lua", []() {return std::make_unique<ForceVolumeServer>();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_FRICTION_VOLUME_SERVER.lua", []() {return std::make_unique<FrictionVolumeServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_XRAY_SERVER.lua", []() {return std::make_unique<NtXRayServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_SLEEPING_GUARD.lua", []() {return std::make_unique<NtSleepingGuard>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_IMAGIMETER_VISIBILITY_SERVER.lua", []() {return std::make_unique<NTImagimeterVisibility>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_PIPE_VISIBILITY_SERVER.lua", []() {return std::make_unique<NTPipeVisibilityServer>();}},
|
||||
{"scripts\\ai\\MINIGAME\\Objects\\MINIGAME_BLUE_MARK.lua", []() {return std::make_unique<MinigameBlueMark>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_NAOMI_BREADCRUMB_SERVER.lua", []() {return std::make_unique<NtNaomiBreadcrumbServer>();}},
|
||||
{"scripts\\02_server\\Map\\NT\\L_NT_NAOMI_DIRT_SERVER.lua", []() {return std::make_unique<NTNaomiDirtServer>();}},
|
||||
|
||||
//AM Crux
|
||||
{"scripts\\02_server\\Map\\AM\\L_AM_CONSOLE_TELEPORT_SERVER.lua", []() {return new AmConsoleTeleportServer();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_RANDOM_SPAWNER_FIN.lua", []() {return new RandomSpawnerFin();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_RANDOM_SPAWNER_PIT.lua", []() {return new RandomSpawnerPit();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_RANDOM_SPAWNER_STR.lua", []() {return new RandomSpawnerStr();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_RANDOM_SPAWNER_ZIP.lua", []() {return new RandomSpawnerZip();}},
|
||||
{"scripts\\02_server\\Enemy\\AM\\L_AM_DARKLING_MECH.lua", []() {return new AmDarklingMech();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_BRIDGE.lua", []() {return new AmBridge();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_DRAW_BRIDGE.lua", []() {return new AmDrawBridge();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_SHIELD_GENERATOR.lua", []() {return new AmShieldGenerator();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_SHIELD_GENERATOR_QUICKBUILD.lua", []() {return new AmShieldGeneratorQuickbuild();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_DROPSHIP_COMPUTER.lua", []() {return new AmDropshipComputer();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_SCROLL_READER_SERVER.lua", []() {return new AmScrollReaderServer();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_TEMPLE_SKILL_VOLUME.lua", []() {return new AmTemplateSkillVolume();}},
|
||||
{"scripts\\02_server\\Enemy\\General\\L_ENEMY_NJ_BUFF.lua", []() {return new EnemyNjBuff();}},
|
||||
{"scripts\\02_server\\Enemy\\AM\\L_AM_SKELETON_ENGINEER.lua", []() {return new AmSkeletonEngineer();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_SKULLKIN_DRILL.lua", []() {return new AmSkullkinDrill();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_SKULLKIN_DRILL_STAND.lua", []() {return new AmSkullkinDrillStand();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_SKULLKIN_TOWER.lua", []() {return new AmSkullkinTower();}},
|
||||
{"scripts\\02_server\\Enemy\\AM\\L_AM_NAMED_DARKLING_DRAGON.lua", []() {return new AmDarklingDragon();}},
|
||||
{"scripts\\02_server\\Enemy\\AM\\L_AM_DARKLING_DRAGON.lua", []() {return new AmDarklingDragon();}},
|
||||
{"scripts\\02_server\\Enemy\\AM\\L_AM_DARKLING_APE.lua", []() {return new BaseEnemyApe();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_BLUE_X.lua", []() {return new AmBlueX();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_TEAPOT_SERVER.lua", []() {return new AmTeapotServer();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_AM_CONSOLE_TELEPORT_SERVER.lua", []() {return std::make_unique<AmConsoleTeleportServer>();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_RANDOM_SPAWNER_FIN.lua", []() {return std::make_unique<RandomSpawnerFin>();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_RANDOM_SPAWNER_PIT.lua", []() {return std::make_unique<RandomSpawnerPit>();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_RANDOM_SPAWNER_STR.lua", []() {return std::make_unique<RandomSpawnerStr>();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_RANDOM_SPAWNER_ZIP.lua", []() {return std::make_unique<RandomSpawnerZip>();}},
|
||||
{"scripts\\02_server\\Enemy\\AM\\L_AM_DARKLING_MECH.lua", []() {return std::make_unique<AmDarklingMech>();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_BRIDGE.lua", []() {return std::make_unique<AmBridge>();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_DRAW_BRIDGE.lua", []() {return std::make_unique<AmDrawBridge>();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_SHIELD_GENERATOR.lua", []() {return std::make_unique<AmShieldGenerator>();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_SHIELD_GENERATOR_QUICKBUILD.lua", []() {return std::make_unique<AmShieldGeneratorQuickbuild>();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_DROPSHIP_COMPUTER.lua", []() {return std::make_unique<AmDropshipComputer>();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_SCROLL_READER_SERVER.lua", []() {return std::make_unique<AmScrollReaderServer>();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_TEMPLE_SKILL_VOLUME.lua", []() {return std::make_unique<AmTemplateSkillVolume>();}},
|
||||
{"scripts\\02_server\\Enemy\\General\\L_ENEMY_NJ_BUFF.lua", []() {return std::make_unique<EnemyNjBuff>();}},
|
||||
{"scripts\\02_server\\Enemy\\AM\\L_AM_SKELETON_ENGINEER.lua", []() {return std::make_unique<AmSkeletonEngineer>();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_SKULLKIN_DRILL.lua", []() {return std::make_unique<AmSkullkinDrill>();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_SKULLKIN_DRILL_STAND.lua", []() {return std::make_unique<AmSkullkinDrillStand>();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_SKULLKIN_TOWER.lua", []() {return std::make_unique<AmSkullkinTower>();}},
|
||||
{"scripts\\02_server\\Enemy\\AM\\L_AM_NAMED_DARKLING_DRAGON.lua", []() {return std::make_unique<AmDarklingDragon>();}},
|
||||
{"scripts\\02_server\\Enemy\\AM\\L_AM_DARKLING_DRAGON.lua", []() {return std::make_unique<AmDarklingDragon>();}},
|
||||
{"scripts\\02_server\\Enemy\\AM\\L_AM_DARKLING_APE.lua", []() {return std::make_unique<BaseEnemyApe>();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_BLUE_X.lua", []() {return std::make_unique<AmBlueX>();}},
|
||||
{"scripts\\02_server\\Map\\AM\\L_TEAPOT_SERVER.lua", []() {return std::make_unique<AmTeapotServer>();}},
|
||||
|
||||
//Ninjago
|
||||
{"scripts\\02_server\\Map\\njhub\\L_GARMADON_CELEBRATION_SERVER.lua", []() {return new NjGarmadonCelebration();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_WU_NPC.lua", []() {return new NjWuNPC();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_SCROLL_CHEST_SERVER.lua", []() {return new NjScrollChestServer();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_COLE_NPC.lua", []() {return new NjColeNPC();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_JAY_MISSION_ITEMS.lua", []() {return new NjJayMissionItems();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_NPC_MISSION_SPINJITZU_SERVER.lua", []() {return new NjNPCMissionSpinjitzuServer();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_ENEMY_SKELETON_SPAWNER.lua", []() {return new EnemySkeletonSpawner();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_NJ_RAIL_SWITCH.lua", []() {return new NjRailSwitch();}},
|
||||
{"scripts\\02_server\\Map\\General\\Ninjago\\L_RAIL_ACTIVATORS_SERVER.lua", []() {return new NjRailActivatorsServer();}},
|
||||
{"scripts\\02_server\\Map\\General\\Ninjago\\L_RAIL_POST_SERVER.lua", []() {return new NjRailPostServer();}},
|
||||
{"scripts\\02_server\\Map\\General\\Ninjago\\L_ICE_RAIL_ACTIVATOR_SERVER.lua", []() {return new NjIceRailActivator();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_FALLING_TILE.lua", []() {return new FallingTile();}},
|
||||
{"scripts\\02_server\\Enemy\\General\\L_ENEMY_NJ_BUFF_STUN_IMMUNITY.lua", []() {return new EnemyNjBuff();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_IMAGINATION_SHRINE_SERVER.lua", []() {return new ImaginationShrineServer();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_LIEUTENANT.lua", []() {return new Lieutenant();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_RAIN_OF_ARROWS.lua", []() {return new RainOfArrows();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_CAVE_PRISON_CAGE.lua", []() {return new CavePrisonCage();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\boss_instance\\L_MONASTERY_BOSS_INSTANCE_SERVER.lua", []() {return new NjMonastryBossInstance();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_CATAPULT_BOUNCER_SERVER.lua", []() {return new CatapultBouncerServer();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_CATAPULT_BASE_SERVER.lua", []() {return new CatapultBaseServer();}},
|
||||
{"scripts\\02_server\\Map\\General\\Ninjago\\L_NJHUB_LAVA_PLAYER_DEATH_TRIGGER.lua", []() {return new NjhubLavaPlayerDeathTrigger();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_MON_CORE_NOOK_DOORS.lua", []() {return new MonCoreNookDoors();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_MON_CORE_SMASHABLE_DOORS.lua", []() {return new MonCoreSmashableDoors();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_MON_CORE_SMASHABLE_DOORS.lua", []() {return new MonCoreSmashableDoors();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_FLAME_JET_SERVER.lua", []() {return new FlameJetServer();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_BURNING_TILE.lua", []() {return new BurningTile();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_SPAWN_EARTH_PET_SERVER.lua", []() {return new NjEarthDragonPetServer();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_EARTH_PET_SERVER.lua", []() {return new NjEarthPetServer();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_DRAGON_EMBLEM_CHEST_SERVER.lua", []() {return new NjDragonEmblemChestServer();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_NYA_MISSION_ITEMS.lua", []() {return new NjNyaMissionitems();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_GARMADON_CELEBRATION_SERVER.lua", []() {return std::make_unique<NjGarmadonCelebration>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_WU_NPC.lua", []() {return std::make_unique<NjWuNPC>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_SCROLL_CHEST_SERVER.lua", []() {return std::make_unique<NjScrollChestServer>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_COLE_NPC.lua", []() {return std::make_unique<NjColeNPC>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_JAY_MISSION_ITEMS.lua", []() {return std::make_unique<NjJayMissionItems>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_NPC_MISSION_SPINJITZU_SERVER.lua", []() {return std::make_unique<NjNPCMissionSpinjitzuServer>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_ENEMY_SKELETON_SPAWNER.lua", []() {return std::make_unique<EnemySkeletonSpawner>();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_NJ_RAIL_SWITCH.lua", []() {return std::make_unique<NjRailSwitch>();}},
|
||||
{"scripts\\02_server\\Map\\General\\Ninjago\\L_RAIL_ACTIVATORS_SERVER.lua", []() {return std::make_unique<NjRailActivatorsServer>();}},
|
||||
{"scripts\\02_server\\Map\\General\\Ninjago\\L_RAIL_POST_SERVER.lua", []() {return std::make_unique<NjRailPostServer>();}},
|
||||
{"scripts\\02_server\\Map\\General\\Ninjago\\L_ICE_RAIL_ACTIVATOR_SERVER.lua", []() {return std::make_unique<NjIceRailActivator>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_FALLING_TILE.lua", []() {return std::make_unique<FallingTile>();}},
|
||||
{"scripts\\02_server\\Enemy\\General\\L_ENEMY_NJ_BUFF_STUN_IMMUNITY.lua", []() {return std::make_unique<EnemyNjBuff>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_IMAGINATION_SHRINE_SERVER.lua", []() {return std::make_unique<ImaginationShrineServer>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_LIEUTENANT.lua", []() {return std::make_unique<Lieutenant>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_RAIN_OF_ARROWS.lua", []() {return std::make_unique<RainOfArrows>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_CAVE_PRISON_CAGE.lua", []() {return std::make_unique<CavePrisonCage>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\boss_instance\\L_MONASTERY_BOSS_INSTANCE_SERVER.lua", []() {return std::make_unique<NjMonastryBossInstance>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_CATAPULT_BOUNCER_SERVER.lua", []() {return std::make_unique<CatapultBouncerServer>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_CATAPULT_BASE_SERVER.lua", []() {return std::make_unique<CatapultBaseServer>();}},
|
||||
{"scripts\\02_server\\Map\\General\\Ninjago\\L_NJHUB_LAVA_PLAYER_DEATH_TRIGGER.lua", []() {return std::make_unique<NjhubLavaPlayerDeathTrigger>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_MON_CORE_NOOK_DOORS.lua", []() {return std::make_unique<MonCoreNookDoors>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_MON_CORE_SMASHABLE_DOORS.lua", []() {return std::make_unique<MonCoreSmashableDoors>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_MON_CORE_SMASHABLE_DOORS.lua", []() {return std::make_unique<MonCoreSmashableDoors>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_FLAME_JET_SERVER.lua", []() {return std::make_unique<FlameJetServer>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_BURNING_TILE.lua", []() {return std::make_unique<BurningTile>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_SPAWN_EARTH_PET_SERVER.lua", []() {return std::make_unique<NjEarthDragonPetServer>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_EARTH_PET_SERVER.lua", []() {return std::make_unique<NjEarthPetServer>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_DRAGON_EMBLEM_CHEST_SERVER.lua", []() {return std::make_unique<NjDragonEmblemChestServer>();}},
|
||||
{"scripts\\02_server\\Map\\njhub\\L_NYA_MISSION_ITEMS.lua", []() {return std::make_unique<NjNyaMissionitems>();}},
|
||||
|
||||
//DLU
|
||||
{"scripts\\02_server\\DLU\\DLUVanityTeleportingObject.lua", []() {return new DLUVanityTeleportingObject();}},
|
||||
{"scripts\\02_server\\DLU\\DLUVanityTeleportingObject.lua", []() {return std::make_unique<DLUVanityTeleportingObject>();}},
|
||||
|
||||
//Survival Minigame
|
||||
{"scripts\\02_server\\Enemy\\Survival\\L_AG_SURVIVAL_STROMBIE.lua", []() {return new AgSurvivalStromling();}},
|
||||
{"scripts\\02_server\\Enemy\\Survival\\L_AG_SURVIVAL_DARKLING_MECH.lua", []() {return new AgSurvivalMech();}},
|
||||
{"scripts\\02_server\\Enemy\\Survival\\L_AG_SURVIVAL_DARK_SPIDERLING.lua", []() {return new AgSurvivalSpiderling();}},
|
||||
{"scripts\\02_server\\Enemy\\Survival\\L_AG_SURVIVAL_STROMBIE.lua", []() {return std::make_unique<AgSurvivalStromling>();}},
|
||||
{"scripts\\02_server\\Enemy\\Survival\\L_AG_SURVIVAL_DARKLING_MECH.lua", []() {return std::make_unique<AgSurvivalMech>();}},
|
||||
{"scripts\\02_server\\Enemy\\Survival\\L_AG_SURVIVAL_DARK_SPIDERLING.lua", []() {return std::make_unique<AgSurvivalSpiderling>();}},
|
||||
|
||||
//Scripted Equipment
|
||||
{"scripts\\EquipmentScripts\\Sunflower.lua", []() {return new Sunflower();}},
|
||||
{"scripts/EquipmentScripts/AnvilOfArmor.lua", []() {return new AnvilOfArmor();}},
|
||||
{"scripts/EquipmentScripts/FountainOfImagination.lua", []() {return new FountainOfImagination();}},
|
||||
{"scripts/EquipmentScripts/CauldronOfLife.lua", []() {return new CauldronOfLife();}},
|
||||
{"scripts\\02_server\\Equipment\\L_BOOTYDIG_SERVER.lua", []() {return new BootyDigServer();}},
|
||||
{"scripts\\EquipmentScripts\\PersonalFortress.lua", []() {return new PersonalFortress();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_PROPERTY_DEVICE.lua", []() {return new PropertyDevice();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_IMAG_BACKPACK_HEALS_SERVER.lua", []() {return new ImaginationBackpackHealServer();}},
|
||||
{"scripts\\ai\\GENERAL\\L_LEGO_DIE_ROLL.lua", []() {return new LegoDieRoll();}},
|
||||
{"scripts\\EquipmentScripts\\BuccaneerValiantShip.lua", []() {return new BuccaneerValiantShip();}},
|
||||
{"scripts\\EquipmentScripts\\FireFirstSkillonStartup.lua", []() {return new FireFirstSkillonStartup();}},
|
||||
{"scripts\\equipmenttriggers\\gempack.lua", []() {return new GemPack();}},
|
||||
{"scripts\\equipmenttriggers\\shardarmor.lua", []() {return new ShardArmor();}},
|
||||
{"scripts\\equipmenttriggers\\coilbackpack.lua", []() {return new TeslaPack();}},
|
||||
{"scripts\\EquipmentScripts\\stunImmunity.lua", []() {return new StunImmunity();}},
|
||||
{"scripts\\EquipmentScripts\\Sunflower.lua", []() {return std::make_unique<Sunflower>();}},
|
||||
{"scripts/EquipmentScripts/AnvilOfArmor.lua", []() {return std::make_unique<AnvilOfArmor>();}},
|
||||
{"scripts/EquipmentScripts/FountainOfImagination.lua", []() {return std::make_unique<FountainOfImagination>();}},
|
||||
{"scripts/EquipmentScripts/CauldronOfLife.lua", []() {return std::make_unique<CauldronOfLife>();}},
|
||||
{"scripts\\02_server\\Equipment\\L_BOOTYDIG_SERVER.lua", []() {return std::make_unique<BootyDigServer>();}},
|
||||
{"scripts\\EquipmentScripts\\PersonalFortress.lua", []() {return std::make_unique<PersonalFortress>();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_PROPERTY_DEVICE.lua", []() {return std::make_unique<PropertyDevice>();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_IMAG_BACKPACK_HEALS_SERVER.lua", []() {return std::make_unique<ImaginationBackpackHealServer>();}},
|
||||
{"scripts\\ai\\GENERAL\\L_LEGO_DIE_ROLL.lua", []() {return std::make_unique<LegoDieRoll>();}},
|
||||
{"scripts\\EquipmentScripts\\BuccaneerValiantShip.lua", []() {return std::make_unique<BuccaneerValiantShip>();}},
|
||||
{"scripts\\EquipmentScripts\\FireFirstSkillonStartup.lua", []() {return std::make_unique<FireFirstSkillonStartup>();}},
|
||||
{"scripts\\equipmenttriggers\\gempack.lua", []() {return std::make_unique<GemPack>();}},
|
||||
{"scripts\\equipmenttriggers\\shardarmor.lua", []() {return std::make_unique<ShardArmor>();}},
|
||||
{"scripts\\equipmenttriggers\\coilbackpack.lua", []() {return std::make_unique<TeslaPack>();}},
|
||||
{"scripts\\EquipmentScripts\\stunImmunity.lua", []() {return std::make_unique<StunImmunity>();}},
|
||||
|
||||
//FB
|
||||
{"scripts\\ai\\NS\\WH\\L_ROCKHYDRANT_BROKEN.lua", []() {return new RockHydrantBroken();}},
|
||||
{"scripts\\ai\\NS\\L_NS_WH_FANS.lua", []() {return new WhFans();}},
|
||||
{"scripts\\ai\\NS\\WH\\L_ROCKHYDRANT_BROKEN.lua", []() {return std::make_unique<RockHydrantBroken>();}},
|
||||
{"scripts\\ai\\NS\\L_NS_WH_FANS.lua", []() {return std::make_unique<WhFans>();}},
|
||||
|
||||
//WBL
|
||||
{"scripts\\zone\\LUPs\\WBL_generic_zone.lua", []() {return new WblGenericZone();}},
|
||||
{"scripts\\zone\\LUPs\\WBL_generic_zone.lua", []() {return std::make_unique<WblGenericZone>();}},
|
||||
|
||||
//Alpha
|
||||
{"scripts\\ai\\FV\\L_TRIGGER_GAS.lua", []() {return new TriggerGas();}},
|
||||
{"scripts\\ai\\FV\\L_ACT_NINJA_SENSEI.lua", []() {return new ActNinjaSensei();}},
|
||||
{"scripts\\ai\\FV\\L_TRIGGER_GAS.lua", []() {return std::make_unique<TriggerGas>();}},
|
||||
{"scripts\\ai\\FV\\L_ACT_NINJA_SENSEI.lua", []() {return std::make_unique<ActNinjaSensei>();}},
|
||||
|
||||
//Pickups
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_1_BRONZE-COIN-SPAWNER.lua", []() {return new SpecialCoinSpawner(1);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_1_GOLD-COIN-SPAWNER.lua", []() {return new SpecialCoinSpawner(10000);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_1_SILVER-COIN-SPAWNER.lua", []() {return new SpecialCoinSpawner(100);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_10_BRONZE-COIN-SPAWNER.lua", []() {return new SpecialCoinSpawner(10);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_10_GOLD-COIN-SPAWNER.lua", []() {return new SpecialCoinSpawner(100000);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_10_SILVER-COIN-SPAWNER.lua", []() {return new SpecialCoinSpawner(1000);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_25_BRONZE-COIN-SPAWNER.lua", []() {return new SpecialCoinSpawner(25);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_25_GOLD-COIN-SPAWNER.lua", []() {return new SpecialCoinSpawner(250000);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_25_SILVER-COIN-SPAWNER.lua", []() {return new SpecialCoinSpawner(2500);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_IMAGINE-POWERUP-SPAWNER.lua", []() {return new SpecialPowerupSpawner(13);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_IMAGINE-POWERUP-SPAWNER-2PT.lua", []() {return new SpecialPowerupSpawner(129);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_LIFE-POWERUP-SPAWNER.lua", []() {return new SpecialPowerupSpawner(5);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_ARMOR-POWERUP-SPAWNER.lua", []() {return new SpecialPowerupSpawner(747);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_SPEED_BUFF_SPAWNER.lua", []() {return new SpecialSpeedBuffSpawner();}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_1_BRONZE-COIN-SPAWNER.lua", []() {return std::make_unique<SpecialCoinSpawner>(1);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_1_GOLD-COIN-SPAWNER.lua", []() {return std::make_unique<SpecialCoinSpawner>(10000);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_1_SILVER-COIN-SPAWNER.lua", []() {return std::make_unique<SpecialCoinSpawner>(100);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_10_BRONZE-COIN-SPAWNER.lua", []() {return std::make_unique<SpecialCoinSpawner>(10);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_10_GOLD-COIN-SPAWNER.lua", []() {return std::make_unique<SpecialCoinSpawner>(100000);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_10_SILVER-COIN-SPAWNER.lua", []() {return std::make_unique<SpecialCoinSpawner>(1000);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_25_BRONZE-COIN-SPAWNER.lua", []() {return std::make_unique<SpecialCoinSpawner>(25);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_25_GOLD-COIN-SPAWNER.lua", []() {return std::make_unique<SpecialCoinSpawner>(250000);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_25_SILVER-COIN-SPAWNER.lua", []() {return std::make_unique<SpecialCoinSpawner>(2500);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_IMAGINE-POWERUP-SPAWNER.lua", []() {return std::make_unique<SpecialPowerupSpawner>(13);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_IMAGINE-POWERUP-SPAWNER-2PT.lua", []() {return std::make_unique<SpecialPowerupSpawner>(129);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_LIFE-POWERUP-SPAWNER.lua", []() {return std::make_unique<SpecialPowerupSpawner>(5);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_ARMOR-POWERUP-SPAWNER.lua", []() {return std::make_unique<SpecialPowerupSpawner>(747);}},
|
||||
{"scripts\\ai\\SPEC\\L_SPECIAL_SPEED_BUFF_SPAWNER.lua", []() {return std::make_unique<SpecialSpeedBuffSpawner>();}},
|
||||
|
||||
//Wild
|
||||
{"scripts\\ai\\WILD\\L_WILD_GF_RAT.lua", []() {return new WildAndScared();}},
|
||||
{"scripts\\ai\\WILD\\L_WILD_GF_SNAIL.lua", []() {return new WildAndScared();}},
|
||||
{"scripts\\ai\\WILD\\L_WILD_GF_GLOWBUG.lua", []() {return new WildGfGlowbug();}},
|
||||
{"scripts\\ai\\WILD\\L_WILD_AMBIENT_CRAB.lua", []() {return new WildAmbientCrab();}},
|
||||
{"scripts\\ai\\WILD\\L_WILD_PANTS.lua", []() {return new WildPants();}},
|
||||
{"scripts\\ai\\WILD\\L_WILD_NINJA_BRICKS.lua", []() {return new WildNinjaBricks();}},
|
||||
{"scripts\\ai\\WILD\\L_WILD_NINJA_STUDENT.lua", []() {return new WildNinjaStudent();}},
|
||||
{"scripts\\ai\\WILD\\L_WILD_NINJA_SENSEI.lua", []() {return new WildNinjaSensei();}},
|
||||
{"scripts\\ai\\WILD\\L_LUP_generic_interact.lua", []() {return new LupGenericInteract();}},
|
||||
{"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenBlue.lua", []() {return new WblRobotCitizen();}},
|
||||
{"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenGreen.lua", []() {return new WblRobotCitizen();}},
|
||||
{"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenOrange.lua", []() {return new WblRobotCitizen();}},
|
||||
{"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenRed.lua", []() {return new WblRobotCitizen();}},
|
||||
{"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenYellow.lua", []() {return new WblRobotCitizen();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_ENEMY_CLEAR_THREAT.lua", []() {return new EnemyClearThreat();}},
|
||||
{"scripts\\ai\\AG\\L_AG_SPIDER_BOSS_MESSAGE.lua", []() {return new AgSpiderBossMessage();}},
|
||||
{"scripts\\ai\\GF\\L_GF_RACE_INSTANCER.lua", []() {return new GfRaceInstancer();}},
|
||||
{"scripts\\ai\\RACING\\TRACK_NS\\NS_RACE_SERVER.lua", []() {return new NsRaceServer();}},
|
||||
{"scripts\\ai\\RACING\\TRACK_GF\\GF_RACE_SERVER.lua", []() {return new GfRaceServer();}},
|
||||
{"scripts\\ai\\RACING\\TRACK_FV\\FV_RACE_SERVER.lua", []() {return new FvRaceServer();}},
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\VEHICLE_DEATH_TRIGGER_WATER_SERVER.lua", []() {return new VehicleDeathTriggerWaterServer();}},
|
||||
{"scripts\\equipmenttriggers\\L_TRIAL_FACTION_ARMOR_SERVER.lua", []() {return new TrialFactionArmorServer();}},
|
||||
{"scripts\\equipmenttriggers\\ImaginationBackPack.lua", []() {return new ImaginationBackPack();}},
|
||||
{"scripts\\ai\\WILD\\L_WILD_GF_RAT.lua", []() {return std::make_unique<WildAndScared>();}},
|
||||
{"scripts\\ai\\WILD\\L_WILD_GF_SNAIL.lua", []() {return std::make_unique<WildAndScared>();}},
|
||||
{"scripts\\ai\\WILD\\L_WILD_GF_GLOWBUG.lua", []() {return std::make_unique<WildGfGlowbug>();}},
|
||||
{"scripts\\ai\\WILD\\L_WILD_AMBIENT_CRAB.lua", []() {return std::make_unique<WildAmbientCrab>();}},
|
||||
{"scripts\\ai\\WILD\\L_WILD_PANTS.lua", []() {return std::make_unique<WildPants>();}},
|
||||
{"scripts\\ai\\WILD\\L_WILD_NINJA_BRICKS.lua", []() {return std::make_unique<WildNinjaBricks>();}},
|
||||
{"scripts\\ai\\WILD\\L_WILD_NINJA_STUDENT.lua", []() {return std::make_unique<WildNinjaStudent>();}},
|
||||
{"scripts\\ai\\WILD\\L_WILD_NINJA_SENSEI.lua", []() {return std::make_unique<WildNinjaSensei>();}},
|
||||
{"scripts\\ai\\WILD\\L_LUP_generic_interact.lua", []() {return std::make_unique<LupGenericInteract>();}},
|
||||
{"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenBlue.lua", []() {return std::make_unique<WblRobotCitizen>();}},
|
||||
{"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenGreen.lua", []() {return std::make_unique<WblRobotCitizen>();}},
|
||||
{"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenOrange.lua", []() {return std::make_unique<WblRobotCitizen>();}},
|
||||
{"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenRed.lua", []() {return std::make_unique<WblRobotCitizen>();}},
|
||||
{"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenYellow.lua", []() {return std::make_unique<WblRobotCitizen>();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_ENEMY_CLEAR_THREAT.lua", []() {return std::make_unique<EnemyClearThreat>();}},
|
||||
{"scripts\\ai\\AG\\L_AG_SPIDER_BOSS_MESSAGE.lua", []() {return std::make_unique<AgSpiderBossMessage>();}},
|
||||
{"scripts\\ai\\GF\\L_GF_RACE_INSTANCER.lua", []() {return std::make_unique<GfRaceInstancer>();}},
|
||||
|
||||
};
|
||||
|
||||
@@ -716,38 +704,29 @@ namespace {
|
||||
"scripts\\empty.lua",
|
||||
"scripts\\zone\\AG\\L_ZONE_AG.lua",
|
||||
"scripts\\zone\\NS\\L_ZONE_NS.lua",
|
||||
"scripts\\ai\\GF\\L_ZONE_GF.lua",
|
||||
"scripts\\zone\\GF\\L_ZONE_GF.lua",
|
||||
"scripts\\ai\\AG\\CONCERT_STAGE.lua",
|
||||
"scripts\\ai\\NS\\L_NS_CAR_MODULAR_BUILD.lua", // In our implementation, this is done in GameMessages.cpp
|
||||
"scripts\\ai\\PETS\\PET_BLOCKER.lua",
|
||||
"scripts\\ai\\PETS\\PET_FLEA_MISSION.lua",
|
||||
"scripts\\ai\\ACT\\L_ACT_PET_INSTANCE_EXIT.lua",
|
||||
"scripts\\ai\\WILD\\L_WILD_GF_FROG.lua",
|
||||
"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_Robotanist.lua",
|
||||
"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_Seperator.lua",
|
||||
"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_InfectedCitizen.lua",
|
||||
"scripts\\ai\\MINIGAME\\SIEGE\\OBJECTS\\ATTACKER_BOUNCER_SERVER.lua",
|
||||
"scripts\\ai\\AG\\L_AG_ZONE_PLAYER.lua",
|
||||
};
|
||||
};
|
||||
|
||||
CppScripts::Script* const CppScripts::GetScript(Entity* parent, const std::string& scriptName) {
|
||||
CppScripts::Script& CppScripts::GetScript(Entity* parent, const std::string& scriptName) {
|
||||
auto itr = g_Scripts.find(scriptName);
|
||||
if (itr != g_Scripts.end()) {
|
||||
return itr->second;
|
||||
return *itr->second;
|
||||
}
|
||||
|
||||
const auto itrTernary = scriptLoader.find(scriptName);
|
||||
Script* script = itrTernary != scriptLoader.cend() ? itrTernary->second() : &InvalidToReturn;
|
||||
auto& script = itrTernary != scriptLoader.cend() ? *itrTernary->second() : InvalidToReturn;
|
||||
|
||||
if (script == &InvalidToReturn && !scriptName.empty() && !g_ExcludedScripts.contains(scriptName)) {
|
||||
if (&script == &InvalidToReturn && !scriptName.empty() && !g_ExcludedScripts.contains(scriptName)) {
|
||||
LOG_DEBUG("LOT %i attempted to load CppScript for '%s', but returned InvalidScript.", parent->GetLOT(), scriptName.c_str());
|
||||
}
|
||||
|
||||
g_Scripts[scriptName] = script;
|
||||
g_Scripts[scriptName] = &script;
|
||||
return script;
|
||||
}
|
||||
|
||||
CppScripts::Script* const CppScripts::GetInvalidScript() {
|
||||
return &InvalidToReturn;
|
||||
CppScripts::Script& CppScripts::GetInvalidScript() {
|
||||
return InvalidToReturn;
|
||||
}
|
||||
|
||||
@@ -186,8 +186,6 @@ namespace CppScripts {
|
||||
*/
|
||||
virtual void NotifyHitOrHealResult(Entity* self, Entity* attacker, int32_t damage) {};
|
||||
|
||||
virtual void NotifyPlayerResurrectionFinished(Entity& self, GameMessages::PlayerResurrectionFinished& msg) {};
|
||||
|
||||
/**
|
||||
* Invoked when a player has responsed to a mission.
|
||||
*
|
||||
@@ -357,38 +355,12 @@ namespace CppScripts {
|
||||
* @param canceled if it was done via the cancel button
|
||||
*/
|
||||
virtual void OnRequestActivityExit(Entity* sender, LWOOBJID player, bool canceled) {};
|
||||
|
||||
virtual void OnZoneLoadedInfo(Entity* self, const GameMessages::ZoneLoadedInfo& info) {};
|
||||
|
||||
/**
|
||||
* @brief Handles notifying when activity data is done
|
||||
*
|
||||
* @param self
|
||||
* @param notify The parameters of the notification
|
||||
*/
|
||||
virtual void OnActivityNotify(Entity* self, GameMessages::ActivityNotify& notify) {};
|
||||
|
||||
/**
|
||||
* @brief handles shooting gallery fire
|
||||
*
|
||||
* @param self
|
||||
* @param fire The firing data
|
||||
*/
|
||||
virtual void OnShootingGalleryFire(Entity& self, GameMessages::ShootingGalleryFire& fire) {};
|
||||
|
||||
/**
|
||||
* @brief Handles when a child is loaded
|
||||
*
|
||||
* @param self
|
||||
* @param fire The child info
|
||||
*/
|
||||
virtual void OnChildLoaded(Entity& self, GameMessages::ChildLoaded& childLoaded) {};
|
||||
};
|
||||
|
||||
Script* const GetScript(Entity* parent, const std::string& scriptName);
|
||||
Script& GetScript(Entity* parent, const std::string& scriptName);
|
||||
|
||||
// Get the invalid script. Would be a static variable of the namespace, but that would be
|
||||
// more cluttery to use. Also this allows us to control where this invalid script is defined and initialized
|
||||
// since we dont want anyone externally modifying it.
|
||||
Script* const GetInvalidScript();
|
||||
Script& GetInvalidScript();
|
||||
};
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
set(DSCRIPTS_SOURCES_EQUIPMENTTRIGGERSSCRIPTS
|
||||
"CoilBackpackBase.cpp"
|
||||
"ImaginationBackPack.cpp"
|
||||
"TrialFactionArmorServer.cpp")
|
||||
"CoilBackpackBase.cpp")
|
||||
|
||||
add_library(dScriptsEquipmentTriggers OBJECT ${DSCRIPTS_SOURCES_EQUIPMENTTRIGGERSSCRIPTS})
|
||||
target_include_directories(dScriptsEquipmentTriggers PUBLIC ".")
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#include "ImaginationBackPack.h"
|
||||
|
||||
#include "SkillComponent.h"
|
||||
|
||||
void ImaginationBackPack::OnFactionTriggerItemEquipped(Entity* itemOwner, LWOOBJID itemObjId) {
|
||||
LOG("Subscribing to PlayerResurrectionFinished");
|
||||
itemOwner->Subscribe(itemObjId, this, "PlayerResurrectionFinished");
|
||||
}
|
||||
|
||||
void ImaginationBackPack::NotifyPlayerResurrectionFinished(Entity& self, GameMessages::PlayerResurrectionFinished& msg) {
|
||||
LOG("PlayerResurrectionFinished");
|
||||
auto* skillComponent = self.GetComponent<SkillComponent>();
|
||||
if (!skillComponent) return;
|
||||
LOG("Casting skill 1334");
|
||||
skillComponent->CastSkill(1334);
|
||||
}
|
||||
|
||||
void ImaginationBackPack::OnFactionTriggerItemUnequipped(Entity* itemOwner, LWOOBJID itemObjId) {
|
||||
LOG("Unsubscribing from PlayerResurrectionFinished");
|
||||
itemOwner->Unsubscribe(itemObjId, "PlayerResurrectionFinished");
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#ifndef IMAGINATIONBACKPACK_H
|
||||
#define IMAGINATIONBACKPACK_H
|
||||
|
||||
#include "CppScripts.h"
|
||||
|
||||
class ImaginationBackPack : public CppScripts::Script {
|
||||
public:
|
||||
void OnFactionTriggerItemEquipped(Entity* itemOwner, LWOOBJID itemObjId) override;
|
||||
void NotifyPlayerResurrectionFinished(Entity& self, GameMessages::PlayerResurrectionFinished& msg) override;
|
||||
void OnFactionTriggerItemUnequipped(Entity* itemOwner, LWOOBJID itemObjId) override;
|
||||
};
|
||||
|
||||
#endif //!IMAGINATIONBACKPACK_H
|
||||
@@ -1,13 +0,0 @@
|
||||
#ifndef __OBYXSHARDPACK__H__
|
||||
#define __OBYXSHARDPACK__H__
|
||||
|
||||
#include "CoilBackpackBase.h"
|
||||
|
||||
class ObyxShardPack : public CoilBackpackBase {
|
||||
public:
|
||||
ObyxShardPack() : CoilBackpackBase(skillId) {};
|
||||
private:
|
||||
static const uint32_t skillId = 1751;
|
||||
};
|
||||
|
||||
#endif //!__OBYXSHARDPACK__H__
|
||||
@@ -1,13 +0,0 @@
|
||||
#ifndef __RUBYSHARDPACK__H__
|
||||
#define __RUBYSHARDPACK__H__
|
||||
|
||||
#include "CoilBackpackBase.h"
|
||||
|
||||
class RubyShardPack : public CoilBackpackBase {
|
||||
public:
|
||||
RubyShardPack() : CoilBackpackBase(skillId) {};
|
||||
private:
|
||||
static const uint32_t skillId = 1750;
|
||||
};
|
||||
|
||||
#endif //!__RUBYSHARDPACK__H__
|
||||
@@ -1,27 +0,0 @@
|
||||
#include "TrialFactionArmorServer.h"
|
||||
|
||||
#include "Character.h"
|
||||
#include "ePlayerFlag.h"
|
||||
#include "DestroyableComponent.h"
|
||||
|
||||
void TrialFactionArmorServer::OnFactionTriggerItemEquipped(Entity* itemOwner, LWOOBJID itemObjId) {
|
||||
auto* character = itemOwner->GetCharacter();
|
||||
if (!character) return;
|
||||
|
||||
auto flag = character->GetPlayerFlag(ePlayerFlag::EQUPPED_TRIAL_FACTION_GEAR);
|
||||
if (!flag) {
|
||||
character->SetPlayerFlag(ePlayerFlag::EQUPPED_TRIAL_FACTION_GEAR, true);
|
||||
|
||||
// technically a TimerWithCancel but our current implementation doesnt support this.
|
||||
itemOwner->AddCallbackTimer(1.0f, [itemOwner]() {
|
||||
auto* destroyableComponent = itemOwner->GetComponent<DestroyableComponent>();
|
||||
if (!destroyableComponent) return;
|
||||
|
||||
destroyableComponent->SetHealth(destroyableComponent->GetMaxHealth());
|
||||
destroyableComponent->SetArmor(destroyableComponent->GetMaxArmor());
|
||||
destroyableComponent->SetImagination(destroyableComponent->GetMaxImagination());
|
||||
|
||||
Game::entityManager->SerializeEntity(itemOwner);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
#ifndef TRIALFACTIONARMORSERVER_
|
||||
#define TRIALFACTIONARMORSERVER_
|
||||
|
||||
#include "CppScripts.h"
|
||||
|
||||
class TrialFactionArmorServer : public CppScripts::Script {
|
||||
public:
|
||||
void OnFactionTriggerItemEquipped(Entity* itemOwner, LWOOBJID itemObjId) override;
|
||||
};
|
||||
|
||||
#endif //!TRIALFACTIONARMORSERVER_
|
||||
@@ -16,8 +16,6 @@
|
||||
#include "eReplicaComponentType.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "eGameActivity.h"
|
||||
#include "Item.h"
|
||||
#include <ranges>
|
||||
|
||||
void SGCannon::OnStartup(Entity* self) {
|
||||
LOG("OnStartup");
|
||||
@@ -83,6 +81,10 @@ void SGCannon::OnActivityStateChangeRequest(Entity* self, LWOOBJID senderID, int
|
||||
auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
if (player != nullptr) {
|
||||
LOG("Player is ready");
|
||||
/*GameMessages::SendSetStunned(player->GetObjectID(), eStateChangeType::PUSH, player->GetSystemAddress(), LWOOBJID_EMPTY,
|
||||
true, true, true, true, true, true, true);*/
|
||||
|
||||
LOG("Sending ActivityEnter");
|
||||
|
||||
GameMessages::SendActivityEnter(self->GetObjectID(), player->GetSystemAddress());
|
||||
|
||||
@@ -101,6 +103,7 @@ void SGCannon::OnActivityStateChangeRequest(Entity* self, LWOOBJID senderID, int
|
||||
auto* characterComponent = player->GetComponent<CharacterComponent>();
|
||||
|
||||
if (characterComponent != nullptr) {
|
||||
characterComponent->SetIsRacing(true);
|
||||
characterComponent->SetCurrentActivity(eGameActivity::SHOOTING_GALLERY);
|
||||
auto possessor = player->GetComponent<PossessorComponent>();
|
||||
if (possessor) {
|
||||
@@ -111,12 +114,20 @@ void SGCannon::OnActivityStateChangeRequest(Entity* self, LWOOBJID senderID, int
|
||||
Game::entityManager->SerializeEntity(player);
|
||||
}
|
||||
|
||||
self->AddCallbackTimer(1.0f, [self, this]() {
|
||||
self->SetNetworkVar<bool>(HideScoreBoardVariable, true);
|
||||
self->SetNetworkVar<bool>(ReSetSuperChargeVariable, true);
|
||||
self->SetNetworkVar<bool>(ShowLoadingUI, true);
|
||||
});
|
||||
self->SetNetworkVar<bool>(HideScoreBoardVariable, true);
|
||||
self->SetNetworkVar<bool>(ReSetSuperChargeVariable, true);
|
||||
self->SetNetworkVar<bool>(ShowLoadingUI, true);
|
||||
|
||||
/*
|
||||
GameMessages::SendTeleport(
|
||||
player->GetObjectID(),
|
||||
{-292.6415710449219, 230.20237731933594, -3.9090466499328613},
|
||||
{0.7067984342575073, -6.527870573336259e-05, 0.707414984703064, 0.00021762956748716533},
|
||||
player->GetSystemAddress(), true
|
||||
);
|
||||
*/
|
||||
|
||||
//GameMessages::SendRequestActivityEnter(self->GetObjectID(), player->GetSystemAddress(), false, player->GetObjectID());
|
||||
} else {
|
||||
LOG("Player not found");
|
||||
}
|
||||
@@ -234,6 +245,14 @@ void SGCannon::GameOverTimerFunc(Entity* self) {
|
||||
|
||||
GameMessages::SendActivityPause(self->GetObjectID(), true, player->GetSystemAddress());
|
||||
|
||||
/*const auto leftoverCannonballs = Game::entityManager->GetEntitiesInGroup("cannonball");
|
||||
if (leftoverCannonballs.empty()) {
|
||||
RecordPlayerScore(self);
|
||||
|
||||
} else {
|
||||
ActivityTimerStart(self, EndGameBufferTimer, 1, leftoverCannonballs.size());
|
||||
}*/
|
||||
|
||||
ActivityTimerStart(self, EndGameBufferTimer, 1, 1);
|
||||
|
||||
TimerToggle(self);
|
||||
@@ -242,51 +261,60 @@ void SGCannon::GameOverTimerFunc(Entity* self) {
|
||||
|
||||
void SGCannon::DoSpawnTimerFunc(Entity* self, const std::string& name) {
|
||||
if (self->GetVar<bool>(GameStartedVariable)) {
|
||||
LOG_DEBUG("time name %s %s", name.c_str(), name.substr(7).c_str());
|
||||
const auto spawnNumber = static_cast<uint32_t>(std::stoi(name.substr(7)));
|
||||
const auto& activeSpawns = self->GetVar<std::vector<SGEnemy>>(ActiveSpawnsVariable);
|
||||
LOG_DEBUG("size %i, %i", activeSpawns.size(), spawnNumber);
|
||||
if (activeSpawns.size() <= spawnNumber) {
|
||||
LOG_DEBUG("Trying to spawn %i when spawns size is only %i", spawnNumber, activeSpawns.size());
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& toSpawn = activeSpawns.at(spawnNumber);
|
||||
const auto pathIndex = GeneralUtils::GenerateRandomNumber<size_t>(0, toSpawn.spawnPaths.size() - 1);
|
||||
LOG_DEBUG("toSpawn %i", toSpawn.spawnPaths.size());
|
||||
const auto pathIndex = GeneralUtils::GenerateRandomNumber<float_t>(0, toSpawn.spawnPaths.size() - 1);
|
||||
LOG_DEBUG("index %f", pathIndex);
|
||||
LOG_DEBUG("%s", toSpawn.spawnPaths.at(pathIndex).c_str());
|
||||
const auto* path = Game::zoneManager->GetZone()->GetPath(toSpawn.spawnPaths.at(pathIndex));
|
||||
if (!path || path->pathWaypoints.empty()) {
|
||||
LOG_DEBUG("Path %s at index %i or has 0 waypoints", toSpawn.spawnPaths.at(pathIndex).c_str(), pathIndex);
|
||||
if (!path) {
|
||||
LOG_DEBUG("Path %s at index %i is null", toSpawn.spawnPaths.at(pathIndex).c_str(), pathIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_DEBUG("%s", path->pathName.c_str());
|
||||
|
||||
auto info = EntityInfo{};
|
||||
info.lot = toSpawn.lot;
|
||||
info.spawnerID = self->GetObjectID();
|
||||
info.pos = path->pathWaypoints[0].position;
|
||||
info.pos = path->pathWaypoints.at(0).position;
|
||||
|
||||
info.settings = {
|
||||
new LDFData<SGEnemy>(u"SpawnData", toSpawn),
|
||||
new LDFData<std::string>(u"custom_script_server", "scripts/ai/ACT/SG_TARGET.lua"), // this script is never loaded
|
||||
new LDFData<std::string>(u"custom_script_server", "scripts/ai/ACT/SG_TARGET.lua"),
|
||||
new LDFData<std::string>(u"custom_script_client", "scripts/client/ai/SG_TARGET_CLIENT.lua"),
|
||||
new LDFData<std::string>(u"attached_path", path->pathName),
|
||||
new LDFData<uint32_t>(u"attached_path_start", 0),
|
||||
new LDFData<std::u16string>(u"groupID", u"SGEnemy"),
|
||||
new LDFData<uint32_t>(u"wave", self->GetVar<uint32_t>(ThisWaveVariable)),
|
||||
new LDFData<std::u16string>(u"groupID", u"SGEnemy")
|
||||
};
|
||||
|
||||
LOG_DEBUG("Spawning enemy %i on path %s", toSpawn.lot, path->pathName.c_str());
|
||||
|
||||
auto* enemy = Game::entityManager->CreateEntity(info, nullptr, self);
|
||||
Game::entityManager->ConstructEntity(enemy);
|
||||
|
||||
auto* movementAI = enemy->AddComponent<MovementAIComponent>(MovementAIInfo{});
|
||||
auto* simplePhysicsComponent = enemy->GetComponent<SimplePhysicsComponent>();
|
||||
if (simplePhysicsComponent) {
|
||||
simplePhysicsComponent->SetPhysicsMotionState(4);
|
||||
}
|
||||
|
||||
Game::entityManager->ConstructEntity(enemy);
|
||||
|
||||
movementAI->SetMaxSpeed(toSpawn.initialSpeed);
|
||||
movementAI->SetCurrentSpeed(toSpawn.initialSpeed);
|
||||
movementAI->SetHaltDistance(0.0f);
|
||||
|
||||
movementAI->SetPath(path->pathWaypoints);
|
||||
std::vector<PathWaypoint> pathWaypoints = path->pathWaypoints;
|
||||
|
||||
if (GeneralUtils::GenerateRandomNumber<float_t>(0, 1) < 0.5f) {
|
||||
std::reverse(pathWaypoints.begin(), pathWaypoints.end());
|
||||
}
|
||||
|
||||
movementAI->SetPath(pathWaypoints);
|
||||
|
||||
enemy->AddDieCallback([this, self, enemy, name]() {
|
||||
RegisterHit(self, enemy, name);
|
||||
@@ -334,10 +362,7 @@ void SGCannon::StartGame(Entity* self) {
|
||||
|
||||
auto rewardObjects = Game::entityManager->GetEntitiesInGroup(constants.rewardModelGroup);
|
||||
for (auto* reward : rewardObjects) {
|
||||
GameMessages::SetModelToBuild modelToBuild{};
|
||||
modelToBuild.modelLot = LOT_NULL;
|
||||
modelToBuild.target = reward->GetObjectID();
|
||||
modelToBuild.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
reward->OnFireEventServerSide(self, ModelToBuildEvent);
|
||||
}
|
||||
|
||||
auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
@@ -375,10 +400,6 @@ void SGCannon::DoGameStartup(Entity* self) {
|
||||
constants.firstWaveStartTime);
|
||||
}
|
||||
|
||||
void SGCannon::OnShootingGalleryFire(Entity& self, GameMessages::ShootingGalleryFire& fire) {
|
||||
self.SetVar<uint32_t>(ShotsFiredVariable, self.GetVar<uint32_t>(ShotsFiredVariable) + 1);
|
||||
}
|
||||
|
||||
void SGCannon::SpawnNewModel(Entity* self) {
|
||||
|
||||
// Add a new reward to the existing rewards
|
||||
@@ -386,7 +407,6 @@ void SGCannon::SpawnNewModel(Entity* self) {
|
||||
if (currentReward != -1) {
|
||||
auto rewards = self->GetVar<std::vector<LOT>>(RewardsVariable);
|
||||
rewards.push_back(currentReward);
|
||||
self->SetVar<std::vector<LOT>>(RewardsVariable, rewards);
|
||||
self->SetNetworkVar<int32_t>(RewardAddedVariable, currentReward);
|
||||
}
|
||||
|
||||
@@ -418,13 +438,9 @@ void SGCannon::SpawnNewModel(Entity* self) {
|
||||
std::unordered_map<LOT, int32_t> toDrop = {};
|
||||
toDrop = Loot::RollLootMatrix(player, lootMatrix);
|
||||
|
||||
for (const auto [lot, count] : toDrop) {
|
||||
GameMessages::SetModelToBuild modelToBuild{};
|
||||
modelToBuild.modelLot = lot;
|
||||
modelToBuild.target = rewardModel->GetObjectID();
|
||||
modelToBuild.Send(player->GetSystemAddress());
|
||||
|
||||
self->SetVar<LOT>(CurrentRewardVariable, lot);
|
||||
for (auto drop : toDrop) {
|
||||
rewardModel->OnFireEventServerSide(self, ModelToBuildEvent, drop.first);
|
||||
self->SetVar<LOT>(CurrentRewardVariable, drop.first);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -498,11 +514,11 @@ void SGCannon::RecordPlayerScore(Entity* self) {
|
||||
const auto currentWave = self->GetVar<uint32_t>(ThisWaveVariable);
|
||||
|
||||
if (currentWave > 0) {
|
||||
auto totalWaveScore = totalScore;
|
||||
auto totalWaveScore = 0;
|
||||
auto playerScores = self->GetVar<std::vector<int32_t>>(PlayerScoresVariable);
|
||||
|
||||
for (const auto& waveScore : playerScores) {
|
||||
totalWaveScore -= waveScore;
|
||||
totalWaveScore += waveScore;
|
||||
}
|
||||
|
||||
if (currentWave >= playerScores.size()) {
|
||||
@@ -510,7 +526,6 @@ void SGCannon::RecordPlayerScore(Entity* self) {
|
||||
} else {
|
||||
playerScores[currentWave] = totalWaveScore;
|
||||
}
|
||||
self->SetVar<std::vector<int32_t>>(PlayerScoresVariable, playerScores);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -532,11 +547,12 @@ void SGCannon::PlaySceneAnimation(Entity* self, const std::u16string& animationN
|
||||
}
|
||||
|
||||
void SGCannon::PauseChargeCannon(Entity* self) {
|
||||
const auto time = std::max(static_cast<uint32_t>(std::ceil(ActivityTimerGetRemainingTime(self, SuperChargeTimer))), static_cast<uint32_t>(1));
|
||||
const auto time = std::max(static_cast<uint32_t>(std::ceil(ActivityTimerGetCurrentTime(self, SuperChargeTimer))), static_cast<uint32_t>(1));
|
||||
|
||||
self->SetVar<bool>(SuperChargePausedVariable, true);
|
||||
self->SetVar<uint32_t>(CurrentSuperChargedTimeVariable, time);
|
||||
self->SetNetworkVar<uint32_t>(ChargeCountingVariable, time);
|
||||
|
||||
ActivityTimerStop(self, SuperChargeTimer);
|
||||
}
|
||||
|
||||
@@ -552,17 +568,14 @@ void SGCannon::StopGame(Entity* self, bool cancel) {
|
||||
|
||||
// The player won, store all the score and send rewards
|
||||
if (!cancel) {
|
||||
float percentage = 0.0f;
|
||||
float misses = self->GetVar<uint32_t>(MissesVariable);
|
||||
float fired = self->GetVar<uint32_t>(ShotsFiredVariable);
|
||||
int32_t percentage = 0.0f;
|
||||
auto misses = self->GetVar<uint32_t>(MissesVariable);
|
||||
auto fired = self->GetVar<uint32_t>(ShotsFiredVariable);
|
||||
|
||||
if (fired > 0.0f) {
|
||||
if (fired > 0) {
|
||||
percentage = misses / fired;
|
||||
}
|
||||
|
||||
percentage = 1.0f - percentage;
|
||||
percentage = std::max(percentage, 0.0f);
|
||||
|
||||
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||
|
||||
if (missionComponent != nullptr) {
|
||||
@@ -583,27 +596,13 @@ void SGCannon::StopGame(Entity* self, bool cancel) {
|
||||
auto* inventory = player->GetComponent<InventoryComponent>();
|
||||
if (inventory != nullptr) {
|
||||
for (const auto rewardLot : self->GetVar<std::vector<LOT>>(RewardsVariable)) {
|
||||
inventory->AddItem(rewardLot, 1, eLootSourceType::NONE, eInventoryType::MODELS);
|
||||
inventory->AddItem(rewardLot, 1, eLootSourceType::ACTIVITY, eInventoryType::MODELS);
|
||||
}
|
||||
}
|
||||
|
||||
const auto& waveScores = self->GetVar<std::vector<int32_t>>(PlayerScoresVariable);
|
||||
std::stringstream stream;
|
||||
|
||||
stream << self->GetVar<int32_t>(TotalScoreVariable) << "_";
|
||||
|
||||
// technically unused in shooting gallery but serialize it regardless.
|
||||
for (const auto& score : waveScores) {
|
||||
stream << score << "_";
|
||||
}
|
||||
auto totalmissed = fired - misses;
|
||||
if (totalmissed < 0) {
|
||||
totalmissed = 0;
|
||||
}
|
||||
|
||||
stream << fired << "_" << totalmissed << "_" << self->GetVar<uint32_t>(MaxStreakVariable);
|
||||
|
||||
self->SetNetworkVar<std::u16string>(u"UI_Rewards", GeneralUtils::ASCIIToUTF16(stream.str()));
|
||||
self->SetNetworkVar<std::u16string>(u"UI_Rewards",
|
||||
GeneralUtils::to_u16string(self->GetVar<int32_t>(TotalScoreVariable)) + u"_0_0_0_0_0_0"
|
||||
);
|
||||
}
|
||||
|
||||
GameMessages::SendActivityStop(self->GetObjectID(), false, cancel, player->GetSystemAddress());
|
||||
@@ -618,42 +617,10 @@ void SGCannon::StopGame(Entity* self, bool cancel) {
|
||||
ResetVars(self);
|
||||
}
|
||||
|
||||
|
||||
void SGCannon::OnActivityNotify(Entity* self, GameMessages::ActivityNotify& notify) {
|
||||
if (!self->GetVar<bool>(GameStartedVariable)) return;
|
||||
|
||||
const auto& params = notify.notification;
|
||||
if (params.empty()) return;
|
||||
|
||||
const auto& param = params[0];
|
||||
if (param->GetValueType() != LDF_TYPE_S32 || param->GetKey() != u"shot_done") return;
|
||||
|
||||
const auto superChargeShotDone = static_cast<LDFData<int32_t>*>(param.get())->GetValue() == GetConstants().cannonSuperChargeSkill;
|
||||
|
||||
const auto& hitTargets = self->GetVar<std::vector<LWOOBJID>>(u"CannonBallKills");
|
||||
|
||||
if (hitTargets.empty() && !superChargeShotDone) {
|
||||
self->SetVar<uint32_t>(u"m_curStreak", 0);
|
||||
self->SetVar<uint32_t>(MissesVariable, self->GetVar<uint32_t>(MissesVariable) + 1);
|
||||
self->SetNetworkVar<bool>(u"HideStreak", true);
|
||||
self->SetNetworkVar<bool>(u"UnMarkAll", true);
|
||||
UpdateStreak(self);
|
||||
} else if (hitTargets.size() > 1) {
|
||||
self->SetNetworkVar<bool>(u"mHit", true);
|
||||
}
|
||||
|
||||
self->SetVar<std::vector<LWOOBJID>>(u"CannonBallKills", {});
|
||||
}
|
||||
|
||||
void SGCannon::RegisterHit(Entity* self, Entity* target, const std::string& timerName) {
|
||||
if (!self->GetVar<bool>(GameStartedVariable)) return;
|
||||
|
||||
auto cannonBallKills = self->GetVar<std::vector<LWOOBJID>>(u"CannonBallKills");
|
||||
cannonBallKills.push_back(target->GetObjectID());
|
||||
self->SetVar<std::vector<LWOOBJID>>(u"CannonBallKills", cannonBallKills);
|
||||
const auto& spawnInfo = target->GetVar<SGEnemy>(u"SpawnData");
|
||||
|
||||
if (spawnInfo.respawns && target->GetVar<uint32_t>(u"wave") == self->GetVar<uint32_t>(ThisWaveVariable)) {
|
||||
if (spawnInfo.respawns) {
|
||||
const auto respawnTime = GeneralUtils::GenerateRandomNumber<float_t>(spawnInfo.minRespawnTime, spawnInfo.maxRespawnTime);
|
||||
|
||||
ActivityTimerStart(self, timerName, respawnTime, respawnTime);
|
||||
@@ -670,7 +637,6 @@ void SGCannon::RegisterHit(Entity* self, Entity* target, const std::string& time
|
||||
} else {
|
||||
if (!self->GetVar<bool>(SuperChargeActiveVariable)) {
|
||||
self->SetVar<uint32_t>(u"m_curStreak", 0);
|
||||
self->SetVar<uint32_t>(MissesVariable, self->GetVar<uint32_t>(MissesVariable) + 1);
|
||||
}
|
||||
|
||||
self->SetNetworkVar<bool>(u"hitFriend", true);
|
||||
@@ -680,6 +646,10 @@ void SGCannon::RegisterHit(Entity* self, Entity* target, const std::string& time
|
||||
|
||||
auto scScore = self->GetVar<int32_t>(TotalScoreVariable) - lastSuperTotal;
|
||||
|
||||
LOG("LastSuperTotal: %i, scScore: %i, constants.chargedPoints: %i",
|
||||
lastSuperTotal, scScore, constants.chargedPoints
|
||||
);
|
||||
|
||||
if (!self->GetVar<bool>(SuperChargeActiveVariable) && scScore >= constants.chargedPoints && score >= 0) {
|
||||
StartChargedCannon(self);
|
||||
self->SetNetworkVar<float>(u"SuperChargeBar", 100.0f);
|
||||
@@ -714,40 +684,6 @@ void SGCannon::RegisterHit(Entity* self, Entity* target, const std::string& time
|
||||
if (missionComponent == nullptr) return;
|
||||
|
||||
missionComponent->Progress(eMissionTaskType::SMASH, spawnInfo.lot, self->GetObjectID());
|
||||
|
||||
auto matrix = self->GetVar<uint32_t>(MatrixVariable);
|
||||
|
||||
float rewardS = 0.0f;
|
||||
float rewardF = 0.0f;
|
||||
if (matrix <= 5) {
|
||||
const auto scoreRewardNum = "Score_Reward_" + std::to_string(matrix);
|
||||
const auto rewardAmountItr = constants.scoreRewards.find(scoreRewardNum);
|
||||
if (rewardAmountItr != constants.scoreRewards.end()) {
|
||||
const float rewardAmount = rewardAmountItr->second / 100 * 3;
|
||||
rewardS = newScore / rewardAmount;
|
||||
rewardF = std::round(rewardS * 3);
|
||||
|
||||
if (rewardF > 100.0f) rewardF = 100.0f;
|
||||
|
||||
self->SetNetworkVar(ModelPercentVariable, rewardF);
|
||||
}
|
||||
}
|
||||
|
||||
if (rewardF > 0.0f && rewardF < 200.0f && matrix <= 5) {
|
||||
const auto rewardModelGroup = Game::entityManager->GetEntitiesInGroup(constants.rewardModelGroup);
|
||||
if (!rewardModelGroup.empty()) {
|
||||
auto* rewardModel = rewardModelGroup[0];
|
||||
GameMessages::SpawnModelBricks spawnBricks{};
|
||||
spawnBricks.target = rewardModel->GetObjectID();
|
||||
spawnBricks.amount = rewardF / 100.0f;
|
||||
spawnBricks.position = target->GetPosition();
|
||||
spawnBricks.Send(player->GetSystemAddress());
|
||||
if (rewardF >= 100.0f) {
|
||||
SpawnNewModel(self);
|
||||
self->SetVar<uint32_t>(MatrixVariable, matrix + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SGCannon::UpdateStreak(Entity* self) {
|
||||
@@ -809,34 +745,41 @@ void SGCannon::ToggleSuperCharge(Entity* self, bool enable) {
|
||||
|
||||
auto* selfInventoryComponent = self->GetComponent<InventoryComponent>();
|
||||
|
||||
// This is a gm in the original script
|
||||
Item* meItem1{};
|
||||
Item* meItem2{};
|
||||
for (const auto item : selfInventoryComponent->GetInventory(eInventoryType::ITEMS)->GetItems() | std::views::values) {
|
||||
if (item->GetSlot() == 0) meItem1 = item;
|
||||
else if (item->GetSlot() == 1) meItem2 = item;
|
||||
}
|
||||
|
||||
if (!meItem1 || !meItem2) {
|
||||
LOG("Cannon does not have the required items equipped");
|
||||
if (inventoryComponent == nullptr) {
|
||||
LOG("Inventory component not found");
|
||||
return;
|
||||
}
|
||||
|
||||
if (enable) {
|
||||
LOG("Player is activating super charge");
|
||||
selfInventoryComponent->EquipItem(meItem1);
|
||||
selfInventoryComponent->EquipItem(meItem2);
|
||||
selfInventoryComponent->UpdateSlot("greeble_r", { ObjectIDManager::GenerateRandomObjectID(), 6505, 1, 0 });
|
||||
selfInventoryComponent->UpdateSlot("greeble_l", { ObjectIDManager::GenerateRandomObjectID(), 6506, 1, 0 });
|
||||
|
||||
// TODO: Equip items
|
||||
skillID = constants.cannonSuperChargeSkill;
|
||||
cooldown = 400;
|
||||
} else {
|
||||
selfInventoryComponent->UnEquipItem(meItem1);
|
||||
selfInventoryComponent->UnEquipItem(meItem2);
|
||||
selfInventoryComponent->UpdateSlot("greeble_r", { ObjectIDManager::GenerateRandomObjectID(), 0, 0, 0 });
|
||||
selfInventoryComponent->UpdateSlot("greeble_l", { ObjectIDManager::GenerateRandomObjectID(), 0, 0, 0 });
|
||||
|
||||
self->SetNetworkVar<float>(u"SuperChargeBar", 0);
|
||||
|
||||
LOG("Player disables super charge");
|
||||
|
||||
// TODO: Unequip items
|
||||
for (const auto& equipped : equippedItems) {
|
||||
if (equipped.first == "special_r" || equipped.first == "special_l") {
|
||||
LOG("Trying to unequip a weapon, %i", equipped.second.lot);
|
||||
|
||||
auto* item = inventoryComponent->FindItemById(equipped.second.id);
|
||||
|
||||
if (item != nullptr) {
|
||||
inventoryComponent->UnEquipItem(item);
|
||||
} else {
|
||||
LOG("Item not found, %i", equipped.second.lot);
|
||||
}
|
||||
}
|
||||
}
|
||||
cooldown = 800;
|
||||
self->SetVar<uint32_t>(NumberOfChargesVariable, 0);
|
||||
}
|
||||
@@ -851,10 +794,10 @@ void SGCannon::ToggleSuperCharge(Entity* self, bool enable) {
|
||||
|
||||
DynamicShootingGalleryParams properties = shootingGalleryComponent->GetDynamicParams();
|
||||
|
||||
properties.cannonFOV = constants.cannonFOV;
|
||||
properties.cannonVelocity = constants.cannonVelocity;
|
||||
properties.cannonFOV = 58.6f;
|
||||
properties.cannonVelocity = 129.0;
|
||||
properties.cannonRefireRate = cooldown;
|
||||
properties.cannonMinDistance = constants.cannonMinDistance;
|
||||
properties.cannonMinDistance = 30;
|
||||
properties.cannonTimeout = -1;
|
||||
|
||||
shootingGalleryComponent->SetDynamicParams(properties);
|
||||
@@ -886,37 +829,21 @@ std::vector<std::vector<SGEnemy>> SGCannon::GetWaves() {
|
||||
1.0, false, true
|
||||
},
|
||||
|
||||
// Sub 1 but for dlu
|
||||
// Sub 1
|
||||
{
|
||||
std::vector<std::string> { "Wave_1_Sub_1", "Wave_1_Sub_2" },
|
||||
6016, 0.0, 2.0, true, 0.0, 2.0,
|
||||
2.0, 1000, false, 0.0, 1.0,
|
||||
1.0, true, true
|
||||
},
|
||||
|
||||
//// Sub 1
|
||||
//{
|
||||
// std::vector<std::string> { "Wave_1_Sub_1", "Wave_1_Sub_2" },
|
||||
// 6016, 0.0, 2.0, true, 0.0, 2.0,
|
||||
// 10.0, 1000, false, 0.0, 1.0,
|
||||
// 1.0, true, true
|
||||
//},
|
||||
|
||||
// Sub 2 but for dlu
|
||||
{
|
||||
std::vector<std::string> { "Wave_2_Sub_1", "Wave_2_Sub_2" },
|
||||
6016, 0.0, 2.0, true, 0.0, 2.0,
|
||||
3.0, 1000, false, 0.0, 1.0,
|
||||
10.0, 1000, false, 0.0, 1.0,
|
||||
1.0, true, true
|
||||
},
|
||||
|
||||
// Sub 2
|
||||
//{
|
||||
// std::vector<std::string> { "Wave_2_Sub_1", "Wave_2_Sub_2" },
|
||||
// 6016, 0.0, 2.0, true, 0.0, 2.0,
|
||||
// 2.0, 1000, false, 0.0, 1.0,
|
||||
// 1.0, true, true
|
||||
//},
|
||||
{
|
||||
std::vector<std::string> { "Wave_2_Sub_1", "Wave_2_Sub_2" },
|
||||
6016, 0.0, 2.0, true, 0.0, 2.0,
|
||||
2.0, 1000, false, 0.0, 1.0,
|
||||
1.0, true, true
|
||||
},
|
||||
|
||||
// Friendly
|
||||
{
|
||||
@@ -970,18 +897,10 @@ std::vector<std::vector<SGEnemy>> SGCannon::GetWaves() {
|
||||
},
|
||||
|
||||
// Sub 2
|
||||
//{
|
||||
// std::vector<std::string> { "Wave_2_Sub_1", "Wave_2_Sub_2" },
|
||||
// 6016, 0.0, 2.0, true, 0.0, 2.0,
|
||||
// 2.0, 1000, false, 0.0, 1.0,
|
||||
// 1.0, true, true
|
||||
//},
|
||||
|
||||
// Sub 2 but for dlu
|
||||
{
|
||||
std::vector<std::string> { "Wave_2_Sub_1", "Wave_2_Sub_2" },
|
||||
6016, 0.0, 2.0, true, 0.0, 2.0,
|
||||
3.0, 1000, false, 0.0, 1.0,
|
||||
2.0, 1000, false, 0.0, 1.0,
|
||||
1.0, true, true
|
||||
},
|
||||
|
||||
@@ -1044,19 +963,11 @@ std::vector<std::vector<SGEnemy>> SGCannon::GetWaves() {
|
||||
1.0, true, true
|
||||
},
|
||||
|
||||
// Sub 2
|
||||
//{
|
||||
// std::vector<std::string> { "Wave_2_Sub_1", "Wave_2_Sub_2" },
|
||||
// 6016, 0.0, 2.0, true, 0.0, 2.0,
|
||||
// 2.0, 1000, false, 0.0, 1.0,
|
||||
// 1.0, true, true
|
||||
//},
|
||||
|
||||
// Sub 2
|
||||
{
|
||||
std::vector<std::string> { "Wave_2_Sub_1", "Wave_2_Sub_2" },
|
||||
6016, 0.0, 2.0, true, 0.0, 2.0,
|
||||
3.0, 1000, false, 0.0, 1.0,
|
||||
2.0, 1000, false, 0.0, 1.0,
|
||||
1.0, true, true
|
||||
},
|
||||
|
||||
@@ -1076,22 +987,14 @@ std::vector<std::vector<SGEnemy>> SGCannon::GetWaves() {
|
||||
1.0, false, true
|
||||
},
|
||||
|
||||
// Ness temp fix for dlu where speeds are set to 7 to match a speed closer to live while we work on movingplatform components.
|
||||
// Ness
|
||||
{
|
||||
std::vector<std::string> { "Wave_1_Ness_1", "Wave_1_Ness_2", "Wave_2_Ness_1" },
|
||||
2565, 10.0, 15.0, true, 10.0, 15.0,
|
||||
7.0, 10000, false, 0.0, 7.0,
|
||||
7.0, true, true
|
||||
2.0, 10000, false, 0.0, 1.0,
|
||||
1.0, true, true
|
||||
},
|
||||
|
||||
// // Ness
|
||||
// {
|
||||
// std::vector<std::string> { "Wave_1_Ness_1", "Wave_1_Ness_2", "Wave_2_Ness_1" },
|
||||
// 2565, 10.0, 15.0, true, 10.0, 15.0,
|
||||
// 2.0, 10000, false, 0.0, 1.0,
|
||||
// 1.0, true, true
|
||||
// },
|
||||
|
||||
// Friendly 1
|
||||
{
|
||||
std::vector<std::string> { "Wave_3_FShip_1", "Wave_3_FShip_2" },
|
||||
@@ -1130,8 +1033,11 @@ void SGCannon::ResetVars(Entity* self) {
|
||||
self->SetVar<int32_t>(TotalScoreVariable, 0);
|
||||
|
||||
self->SetVar<uint32_t>(u"m_curStreak", 0);
|
||||
self->SetNetworkVar<float>(u"SuperChargeBar", 0);
|
||||
self->SetVar<uint32_t>(u"LastSuperTotal", 0);
|
||||
self->SetVar<std::vector<LWOOBJID>>(u"LastHitTarget", {});
|
||||
self->SetNetworkVar<float>(u"SuperChargeBar", 0.0f);
|
||||
self->SetNetworkVar<bool>(u"ShowStreak", 0);
|
||||
self->SetNetworkVar<bool>(u"UnMarkAll", true);
|
||||
|
||||
const_cast<std::vector<SGEnemy>&>(self->GetVar<std::vector<SGEnemy>>(ActiveSpawnsVariable)).clear();
|
||||
self->SetVar<std::vector<SGEnemy>>(ActiveSpawnsVariable, {});
|
||||
@@ -1150,42 +1056,40 @@ void SGCannon::ResetVars(Entity* self) {
|
||||
|
||||
SGConstants SGCannon::GetConstants() {
|
||||
return {
|
||||
.playerStartPosition = Vector3 { -908.542480, 229.773178, -908.542480 },
|
||||
.playerStartRotation = Quaternion { 0.91913521289825, 0, 0.39394217729568, 0 },
|
||||
.cannonLot = 1864,
|
||||
.impactSkillID = 34,
|
||||
.projectileLot = 1822,
|
||||
.playerOffset = Vector3 { 6.652, -2, 1.5 },
|
||||
.rewardModelMatrix = 157,
|
||||
.cannonVelocity = 129.0,
|
||||
.cannonMinDistance = 30.0,
|
||||
.cannonRefireRate = 800.0,
|
||||
.cannonBarrelOffset = Vector3 { 0, 4.3, 9 },
|
||||
.cannonSuperchargedProjectileLot = 6297,
|
||||
.cannonProjectileLot = 1822,
|
||||
.cannonSuperChargeSkill = 249,
|
||||
.cannonSkill = 228,
|
||||
.cannonTimeout = -1,
|
||||
.cannonFOV = 58.6,
|
||||
.useLeaderboards = true,
|
||||
.streakModifier = 2,
|
||||
.chargedTime = 10,
|
||||
.chargedPoints = 25000,
|
||||
.rewardModelGroup = "QBRewardGroup",
|
||||
.activityID = 1864,
|
||||
.scoreRewards = {
|
||||
{"Score_Reward_1", 50000},
|
||||
{"Score_Reward_2", 100000},
|
||||
{"Score_Reward_3", 200000},
|
||||
{"Score_Reward_4", 400000},
|
||||
{"Score_Reward_5", 800000},
|
||||
},
|
||||
.scoreLootMatrix1 = 157,
|
||||
.scoreLootMatrix2 = 187,
|
||||
.scoreLootMatrix3 = 188,
|
||||
.scoreLootMatrix4 = 189,
|
||||
.scoreLootMatrix5 = 190,
|
||||
.firstWaveStartTime = 4.0,
|
||||
.inBetweenWavePause = 7.0
|
||||
Vector3 { -908.542480, 229.773178, -908.542480 },
|
||||
Quaternion { 0.91913521289825, 0, 0.39394217729568, 0 },
|
||||
1864,
|
||||
34,
|
||||
1822,
|
||||
Vector3 { 6.652, -2, 1.5 },
|
||||
157,
|
||||
129.0,
|
||||
30.0,
|
||||
800.0,
|
||||
Vector3 { 0, 4.3, 9 },
|
||||
6297,
|
||||
1822,
|
||||
249,
|
||||
228,
|
||||
-1,
|
||||
58.6,
|
||||
true,
|
||||
2,
|
||||
10,
|
||||
25000,
|
||||
"QBRewardGroup",
|
||||
1864,
|
||||
50000,
|
||||
157,
|
||||
100000,
|
||||
187,
|
||||
200000,
|
||||
188,
|
||||
400000,
|
||||
189,
|
||||
800000,
|
||||
190,
|
||||
4.0,
|
||||
7.0
|
||||
};
|
||||
}
|
||||
|
||||
@@ -44,11 +44,15 @@ struct SGConstants {
|
||||
uint32_t chargedPoints;
|
||||
std::string rewardModelGroup;
|
||||
uint32_t activityID;
|
||||
std::map<std::string, uint32_t> scoreRewards;
|
||||
uint32_t scoreReward1;
|
||||
uint32_t scoreLootMatrix1;
|
||||
uint32_t scoreReward2;
|
||||
uint32_t scoreLootMatrix2;
|
||||
uint32_t scoreReward3;
|
||||
uint32_t scoreLootMatrix3;
|
||||
uint32_t scoreReward4;
|
||||
uint32_t scoreLootMatrix4;
|
||||
uint32_t scoreReward5;
|
||||
uint32_t scoreLootMatrix5;
|
||||
float_t firstWaveStartTime;
|
||||
float_t inBetweenWavePause;
|
||||
@@ -64,8 +68,6 @@ public:
|
||||
void OnActivityTimerDone(Entity* self, const std::string& name) override;
|
||||
void OnActivityTimerUpdate(Entity* self, const std::string& name, float_t timeRemaining, float_t elapsedTime) override;
|
||||
void OnRequestActivityExit(Entity* self, LWOOBJID player, bool canceled) override;
|
||||
void OnActivityNotify(Entity* self, GameMessages::ActivityNotify& notify) override;
|
||||
void OnShootingGalleryFire(Entity& self, GameMessages::ShootingGalleryFire& fire) override;
|
||||
void SuperChargeTimerFunc(Entity* self);
|
||||
void SpawnWaveTimerFunc(Entity* self);
|
||||
void EndWaveTimerFunc(Entity* self);
|
||||
@@ -140,7 +142,6 @@ private:
|
||||
std::u16string CannonBallSkillIDVariable = u"cbskill";
|
||||
std::u16string HideSuperChargeVariable = u"HideSuper";
|
||||
std::u16string AudioFinalWaveDoneVariable = u"Audio_Final_Wave_Done";
|
||||
std::u16string ModelPercentVariable = u"modelPercent";
|
||||
|
||||
std::string SpawnWaveTimer = "SpawnWave";
|
||||
std::string EndWaveTimer = "EndWave";
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
set(DSCRIPTS_SOURCES_AI_RACING
|
||||
"RaceImaginationServer.cpp")
|
||||
set(DSCRIPTS_SOURCES_AI_RACING)
|
||||
|
||||
add_subdirectory(OBJECTS)
|
||||
|
||||
@@ -7,24 +6,6 @@ foreach(file ${DSCRIPTS_SOURCES_AI_RACING_OBJECTS})
|
||||
set(DSCRIPTS_SOURCES_AI_RACING ${DSCRIPTS_SOURCES_AI_RACING} "OBJECTS/${file}")
|
||||
endforeach()
|
||||
|
||||
add_subdirectory(TRACK_NS)
|
||||
|
||||
foreach(file ${DSCRIPTS_SOURCES_AI_RACING_TRACK_NS})
|
||||
set(DSCRIPTS_SOURCES_AI_RACING ${DSCRIPTS_SOURCES_AI_RACING} "TRACK_NS/${file}")
|
||||
endforeach()
|
||||
|
||||
add_subdirectory(TRACK_GF)
|
||||
|
||||
foreach(file ${DSCRIPTS_SOURCES_AI_RACING_TRACK_GF})
|
||||
set(DSCRIPTS_SOURCES_AI_RACING ${DSCRIPTS_SOURCES_AI_RACING} "TRACK_GF/${file}")
|
||||
endforeach()
|
||||
|
||||
add_subdirectory(TRACK_FV)
|
||||
|
||||
foreach(file ${DSCRIPTS_SOURCES_AI_RACING_TRACK_FV})
|
||||
set(DSCRIPTS_SOURCES_AI_RACING ${DSCRIPTS_SOURCES_AI_RACING} "TRACK_FV/${file}")
|
||||
endforeach()
|
||||
|
||||
add_library(dScriptsAiRacing OBJECT ${DSCRIPTS_SOURCES_AI_RACING})
|
||||
target_include_directories(dScriptsAiRacing PUBLIC "." "OBJECTS" "TRACK_NS" "TRACK_GF" "TRACK_FV")
|
||||
target_include_directories(dScriptsAiRacing PUBLIC "." "OBJECTS")
|
||||
target_precompile_headers(dScriptsAiRacing REUSE_FROM dScriptsBase)
|
||||
|
||||
@@ -7,5 +7,4 @@ set(DSCRIPTS_SOURCES_AI_RACING_OBJECTS
|
||||
"FvRacePillarDServer.cpp"
|
||||
"FvRaceSmashEggImagineServer.cpp"
|
||||
"RaceSmashServer.cpp"
|
||||
"VehicleDeathTriggerWaterServer.cpp"
|
||||
PARENT_SCOPE)
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#include "VehicleDeathTriggerWaterServer.h"
|
||||
|
||||
#include "PossessorComponent.h"
|
||||
#include "RacingControlComponent.h"
|
||||
|
||||
void VehicleDeathTriggerWaterServer::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
if (target->IsPlayer() && !target->GetIsDead()) {
|
||||
const std::vector<Entity*> racingControllers = Game::entityManager->GetEntitiesByComponent(RacingControlComponent::ComponentType);
|
||||
for (auto* const racingController : racingControllers) {
|
||||
auto* racingControlComponent = racingController->GetComponent<RacingControlComponent>();
|
||||
if (racingControlComponent) {
|
||||
racingControlComponent->OnRequestDie(target, u"death_water");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
#ifndef VEHICLEDEATHTRIGGERWATERSERVER_H
|
||||
#define VEHICLEDEATHTRIGGERWATERSERVER_H
|
||||
|
||||
#include "CppScripts.h"
|
||||
|
||||
class VehicleDeathTriggerWaterServer : public CppScripts::Script {
|
||||
public:
|
||||
void OnCollisionPhantom(Entity* self, Entity* target) override;
|
||||
};
|
||||
|
||||
#endif //!VEHICLEDEATHTRIGGERWATERSERVER_H
|
||||
@@ -1,19 +0,0 @@
|
||||
#include "RaceImaginationServer.h"
|
||||
#include "dZoneManager.h"
|
||||
|
||||
void StartSpawner(const std::vector<Spawner*>& spawner) {
|
||||
for (auto* const entity : spawner) {
|
||||
entity->Activate();
|
||||
}
|
||||
}
|
||||
|
||||
void RaceImaginationServer::OnZoneLoadedInfo(Entity* self, const GameMessages::ZoneLoadedInfo& info) {
|
||||
// Spawn imagination pickups
|
||||
StartSpawner(Game::zoneManager->GetSpawnersByName("ImaginationSpawn_Min"));
|
||||
if (info.maxPlayers > 2) {
|
||||
StartSpawner(Game::zoneManager->GetSpawnersByName("ImaginationSpawn_Med"));
|
||||
}
|
||||
if (info.maxPlayers > 4) {
|
||||
StartSpawner(Game::zoneManager->GetSpawnersByName("ImaginationSpawn_Max"));
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
#ifndef RACEIMAGINATIONSERVER_H
|
||||
#define RACEIMAGINATIONSERVER_H
|
||||
|
||||
#include "CppScripts.h"
|
||||
|
||||
class RaceImaginationServer : public virtual CppScripts::Script {
|
||||
public:
|
||||
void OnZoneLoadedInfo(Entity* self, const GameMessages::ZoneLoadedInfo& info) override;
|
||||
};
|
||||
|
||||
#endif //!RACEIMAGINATIONSERVER_H
|
||||
@@ -1,3 +0,0 @@
|
||||
set(DSCRIPTS_SOURCES_AI_RACING_TRACK_FV
|
||||
"FvRaceServer.cpp"
|
||||
PARENT_SCOPE)
|
||||
@@ -1,55 +0,0 @@
|
||||
#include "FvRaceServer.h"
|
||||
|
||||
#include "RacingControlComponent.h"
|
||||
#include "Entity.h"
|
||||
|
||||
using std::unique_ptr;
|
||||
using std::make_unique;
|
||||
|
||||
void FvRaceServer::OnStartup(Entity* self) {
|
||||
GameMessages::ConfigureRacingControl config;
|
||||
auto& raceSet = config.racingSettings;
|
||||
|
||||
raceSet.push_back(make_unique<LDFData<std::u16string>>(u"GameType", u"Racing"));
|
||||
raceSet.push_back(make_unique<LDFData<std::u16string>>(u"GameState", u"Starting"));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Number_Of_PlayersPerTeam", 6));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Minimum_Players_to_Start", 2));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Minimum_Players_for_Group_Achievements", 2));
|
||||
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Car_Object", 7703));
|
||||
raceSet.push_back(make_unique<LDFData<std::u16string>>(u"Race_PathName", u"MainPath"));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Current_Lap", 1));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Number_of_Laps", 3));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"activityID", 54));
|
||||
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_1", 100));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_2", 90));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_3", 80));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_4", 70));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_5", 60));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_6", 50));
|
||||
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_1", 15));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_2", 25));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_3", 50));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_4", 85));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_5", 90));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_6", 100));
|
||||
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Number_of_Spawn_Groups", 1));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Spawners", 4847));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Spawners", 4848));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Flag", 4850));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Flag", 4851));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Point", 4846));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Point", 4845));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Mark", 4844));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Mark", 4843));
|
||||
|
||||
const std::vector<Entity*> racingControllers = Game::entityManager->GetEntitiesByComponent(eReplicaComponentType::RACING_CONTROL);
|
||||
for (auto* const racingController : racingControllers) {
|
||||
auto* racingComponent = racingController->GetComponent<RacingControlComponent>();
|
||||
if (racingComponent) racingComponent->MsgConfigureRacingControl(config);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
#ifndef FVRACESERVER_H
|
||||
#define FVRACESERVER_H
|
||||
|
||||
#include "RaceImaginationServer.h"
|
||||
|
||||
class FvRaceServer : public RaceImaginationServer {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
};
|
||||
|
||||
#endif //!FVRACESERVER_H
|
||||
@@ -1,3 +0,0 @@
|
||||
set(DSCRIPTS_SOURCES_AI_RACING_TRACK_GF
|
||||
"GfRaceServer.cpp"
|
||||
PARENT_SCOPE)
|
||||
@@ -1,55 +0,0 @@
|
||||
#include "GfRaceServer.h"
|
||||
|
||||
#include "RacingControlComponent.h"
|
||||
#include "Entity.h"
|
||||
|
||||
using std::unique_ptr;
|
||||
using std::make_unique;
|
||||
|
||||
void GfRaceServer::OnStartup(Entity* self) {
|
||||
GameMessages::ConfigureRacingControl config;
|
||||
auto& raceSet = config.racingSettings;
|
||||
|
||||
raceSet.push_back(make_unique<LDFData<std::u16string>>(u"GameType", u"Racing"));
|
||||
raceSet.push_back(make_unique<LDFData<std::u16string>>(u"GameState", u"Starting"));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Number_Of_PlayersPerTeam", 6));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Minimum_Players_to_Start", 2));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Minimum_Players_for_Group_Achievements", 2));
|
||||
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Car_Object", 7703));
|
||||
raceSet.push_back(make_unique<LDFData<std::u16string>>(u"Race_PathName", u"MainPath"));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Current_Lap", 1));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Number_of_Laps", 3));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"activityID", 39));
|
||||
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_1", 100));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_2", 90));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_3", 80));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_4", 70));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_5", 60));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_6", 50));
|
||||
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_1", 15));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_2", 25));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_3", 50));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_4", 85));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_5", 90));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_6", 100));
|
||||
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Number_of_Spawn_Groups", 1));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Spawners", 4847));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Spawners", 4848));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Flag", 4850));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Flag", 4851));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Point", 4846));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Point", 4845));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Mark", 4844));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Mark", 4843));
|
||||
|
||||
const std::vector<Entity*> racingControllers = Game::entityManager->GetEntitiesByComponent(eReplicaComponentType::RACING_CONTROL);
|
||||
for (auto* const racingController : racingControllers) {
|
||||
auto* racingComponent = racingController->GetComponent<RacingControlComponent>();
|
||||
if (racingComponent) racingComponent->MsgConfigureRacingControl(config);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
#ifndef GFRACESERVER_H
|
||||
#define GFRACESERVER_H
|
||||
|
||||
#include "RaceImaginationServer.h"
|
||||
|
||||
class GfRaceServer : public RaceImaginationServer {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
};
|
||||
|
||||
#endif //!GFRACESERVER_H
|
||||
@@ -1,3 +0,0 @@
|
||||
set(DSCRIPTS_SOURCES_AI_RACING_TRACK_NS
|
||||
"NsRaceServer.cpp"
|
||||
PARENT_SCOPE)
|
||||
@@ -1,54 +0,0 @@
|
||||
#include "NsRaceServer.h"
|
||||
|
||||
#include "RacingControlComponent.h"
|
||||
#include "Entity.h"
|
||||
|
||||
using std::unique_ptr;
|
||||
using std::make_unique;
|
||||
|
||||
void NsRaceServer::OnStartup(Entity* self) {
|
||||
GameMessages::ConfigureRacingControl config;
|
||||
auto& raceSet = config.racingSettings;
|
||||
|
||||
raceSet.push_back(make_unique<LDFData<std::u16string>>(u"GameType", u"Racing"));
|
||||
raceSet.push_back(make_unique<LDFData<std::u16string>>(u"GameState", u"Starting"));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Number_Of_PlayersPerTeam", 6));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Minimum_Players_to_Start", 2));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Minimum_Players_for_Group_Achievements", 2));
|
||||
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Car_Object", 7703));
|
||||
raceSet.push_back(make_unique<LDFData<std::u16string>>(u"Race_PathName", u"MainPath"));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Current_Lap", 1));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Number_of_Laps", 3));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"activityID", 42));
|
||||
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_1", 100));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_2", 90));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_3", 80));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_4", 70));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_5", 60));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_6", 50));
|
||||
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_1", 15));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_2", 25));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_3", 50));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_4", 85));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_5", 90));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_6", 100));
|
||||
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Number_of_Spawn_Groups", 1));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Spawners", 4847));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Spawners", 4848));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Flag", 4850));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Flag", 4851));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Point", 4846));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Point", 4845));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Mark", 4844));
|
||||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Mark", 4843));
|
||||
|
||||
std::vector<Entity*> racingControllers = Game::entityManager->GetEntitiesByComponent(eReplicaComponentType::RACING_CONTROL);
|
||||
for (auto* const racingController : racingControllers) {
|
||||
auto* racingComponent = racingController->GetComponent<RacingControlComponent>();
|
||||
if (racingComponent) racingComponent->MsgConfigureRacingControl(config);
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#ifndef NSRACESERVER_H
|
||||
#define NSRACESERVER_H
|
||||
|
||||
#include "CppScripts.h"
|
||||
#include "RaceImaginationServer.h"
|
||||
|
||||
class NsRaceServer : public RaceImaginationServer {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
};
|
||||
|
||||
#endif //!NSRACESERVER_H
|
||||
@@ -267,31 +267,41 @@ int main(int argc, char** argv) {
|
||||
|
||||
// pre calculate the FDB checksum
|
||||
if (Game::config->GetValue("check_fdb") == "1") {
|
||||
auto cdclient = Game::assetManager->GetFile("cdclient.fdb");
|
||||
if (cdclient) {
|
||||
std::ifstream fileStream;
|
||||
|
||||
const int32_t bufferSize = 1024;
|
||||
MD5 md5;
|
||||
static const std::vector<std::string> aliases = {
|
||||
"CDServers.fdb",
|
||||
"cdserver.fdb",
|
||||
"CDClient.fdb",
|
||||
"cdclient.fdb",
|
||||
};
|
||||
|
||||
char fileStreamBuffer[bufferSize] = {};
|
||||
|
||||
while (!cdclient.eof()) {
|
||||
memset(fileStreamBuffer, 0, bufferSize);
|
||||
cdclient.read(fileStreamBuffer, bufferSize);
|
||||
md5.update(fileStreamBuffer, cdclient.gcount());
|
||||
for (const auto& file : aliases) {
|
||||
fileStream.open(Game::assetManager->GetResPath() / file, std::ios::binary | std::ios::in);
|
||||
if (fileStream.is_open()) {
|
||||
break;
|
||||
}
|
||||
|
||||
const char* nullTerminateBuffer = "\0";
|
||||
md5.update(nullTerminateBuffer, 1); // null terminate the data
|
||||
md5.finalize();
|
||||
databaseChecksum = md5.hexdigest();
|
||||
|
||||
LOG("FDB Checksum calculated as: %s", databaseChecksum.c_str());
|
||||
}
|
||||
if (databaseChecksum.empty()) {
|
||||
LOG("check_fdb is on but no fdb file found.");
|
||||
return EXIT_FAILURE;
|
||||
|
||||
const int32_t bufferSize = 1024;
|
||||
MD5 md5;
|
||||
|
||||
char fileStreamBuffer[1024] = {};
|
||||
|
||||
while (!fileStream.eof()) {
|
||||
memset(fileStreamBuffer, 0, bufferSize);
|
||||
fileStream.read(fileStreamBuffer, bufferSize);
|
||||
md5.update(fileStreamBuffer, fileStream.gcount());
|
||||
}
|
||||
|
||||
fileStream.close();
|
||||
|
||||
const char* nullTerminateBuffer = "\0";
|
||||
md5.update(nullTerminateBuffer, 1); // null terminate the data
|
||||
md5.finalize();
|
||||
databaseChecksum = md5.hexdigest();
|
||||
|
||||
LOG("FDB Checksum calculated as: %s", databaseChecksum.c_str());
|
||||
}
|
||||
|
||||
uint32_t currentFrameDelta = highFrameDelta;
|
||||
@@ -538,115 +548,115 @@ void HandlePacketChat(Packet* packet) {
|
||||
if (packet->data[0] == ID_USER_PACKET_ENUM && packet->length >= 4) {
|
||||
if (static_cast<eConnectionType>(packet->data[1]) == eConnectionType::CHAT) {
|
||||
switch (static_cast<MessageType::Chat>(packet->data[3])) {
|
||||
case MessageType::Chat::WORLD_ROUTE_PACKET: {
|
||||
CINSTREAM_SKIP_HEADER;
|
||||
LWOOBJID playerID;
|
||||
inStream.Read(playerID);
|
||||
case MessageType::Chat::WORLD_ROUTE_PACKET: {
|
||||
CINSTREAM_SKIP_HEADER;
|
||||
LWOOBJID playerID;
|
||||
inStream.Read(playerID);
|
||||
|
||||
auto player = Game::entityManager->GetEntity(playerID);
|
||||
if (!player) return;
|
||||
auto player = Game::entityManager->GetEntity(playerID);
|
||||
if (!player) return;
|
||||
|
||||
auto sysAddr = player->GetSystemAddress();
|
||||
auto sysAddr = player->GetSystemAddress();
|
||||
|
||||
//Write our stream outwards:
|
||||
CBITSTREAM;
|
||||
unsigned char data;
|
||||
while (inStream.Read(data)) {
|
||||
bitStream.Write(data);
|
||||
//Write our stream outwards:
|
||||
CBITSTREAM;
|
||||
unsigned char data;
|
||||
while (inStream.Read(data)) {
|
||||
bitStream.Write(data);
|
||||
}
|
||||
|
||||
SEND_PACKET; //send routed packet to player
|
||||
break;
|
||||
}
|
||||
|
||||
SEND_PACKET; //send routed packet to player
|
||||
break;
|
||||
}
|
||||
case MessageType::Chat::GM_ANNOUNCE: {
|
||||
CINSTREAM_SKIP_HEADER;
|
||||
|
||||
case MessageType::Chat::GM_ANNOUNCE: {
|
||||
CINSTREAM_SKIP_HEADER;
|
||||
std::string title;
|
||||
std::string msg;
|
||||
|
||||
std::string title;
|
||||
std::string msg;
|
||||
uint32_t len;
|
||||
inStream.Read<uint32_t>(len);
|
||||
for (uint32_t i = 0; len > i; i++) {
|
||||
char character;
|
||||
inStream.Read<char>(character);
|
||||
title += character;
|
||||
}
|
||||
|
||||
uint32_t len;
|
||||
inStream.Read<uint32_t>(len);
|
||||
for (uint32_t i = 0; len > i; i++) {
|
||||
char character;
|
||||
inStream.Read<char>(character);
|
||||
title += character;
|
||||
}
|
||||
len = 0;
|
||||
inStream.Read<uint32_t>(len);
|
||||
for (uint32_t i = 0; len > i; i++) {
|
||||
char character;
|
||||
inStream.Read<char>(character);
|
||||
msg += character;
|
||||
}
|
||||
|
||||
len = 0;
|
||||
inStream.Read<uint32_t>(len);
|
||||
for (uint32_t i = 0; len > i; i++) {
|
||||
char character;
|
||||
inStream.Read<char>(character);
|
||||
msg += character;
|
||||
}
|
||||
//Send to our clients:
|
||||
AMFArrayValue args;
|
||||
|
||||
//Send to our clients:
|
||||
AMFArrayValue args;
|
||||
args.Insert("title", title);
|
||||
args.Insert("message", msg);
|
||||
|
||||
args.Insert("title", title);
|
||||
args.Insert("message", msg);
|
||||
|
||||
GameMessages::SendUIMessageServerToAllClients("ToggleAnnounce", args);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case MessageType::Chat::GM_MUTE: {
|
||||
CINSTREAM_SKIP_HEADER;
|
||||
LWOOBJID playerId;
|
||||
time_t expire = 0;
|
||||
inStream.Read(playerId);
|
||||
inStream.Read(expire);
|
||||
|
||||
auto* entity = Game::entityManager->GetEntity(playerId);
|
||||
auto* character = entity != nullptr ? entity->GetCharacter() : nullptr;
|
||||
auto* user = character != nullptr ? character->GetParentUser() : nullptr;
|
||||
if (user) {
|
||||
user->SetMuteExpire(expire);
|
||||
|
||||
entity->GetCharacter()->SendMuteNotice();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case MessageType::Chat::TEAM_GET_STATUS: {
|
||||
CINSTREAM_SKIP_HEADER;
|
||||
|
||||
LWOOBJID teamID = 0;
|
||||
char lootOption = 0;
|
||||
char memberCount = 0;
|
||||
std::vector<LWOOBJID> members;
|
||||
|
||||
inStream.Read(teamID);
|
||||
bool deleteTeam = inStream.ReadBit();
|
||||
|
||||
if (deleteTeam) {
|
||||
TeamManager::Instance()->DeleteTeam(teamID);
|
||||
|
||||
LOG("Deleting team (%llu)", teamID);
|
||||
GameMessages::SendUIMessageServerToAllClients("ToggleAnnounce", args);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
inStream.Read(lootOption);
|
||||
inStream.Read(memberCount);
|
||||
LOG("Updating team (%llu), (%i), (%i)", teamID, lootOption, memberCount);
|
||||
for (char i = 0; i < memberCount; i++) {
|
||||
LWOOBJID member = LWOOBJID_EMPTY;
|
||||
inStream.Read(member);
|
||||
members.push_back(member);
|
||||
case MessageType::Chat::GM_MUTE: {
|
||||
CINSTREAM_SKIP_HEADER;
|
||||
LWOOBJID playerId;
|
||||
time_t expire = 0;
|
||||
inStream.Read(playerId);
|
||||
inStream.Read(expire);
|
||||
|
||||
LOG("Updating team member (%llu)", member);
|
||||
auto* entity = Game::entityManager->GetEntity(playerId);
|
||||
auto* character = entity != nullptr ? entity->GetCharacter() : nullptr;
|
||||
auto* user = character != nullptr ? character->GetParentUser() : nullptr;
|
||||
if (user) {
|
||||
user->SetMuteExpire(expire);
|
||||
|
||||
entity->GetCharacter()->SendMuteNotice();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
TeamManager::Instance()->UpdateTeam(teamID, lootOption, members);
|
||||
case MessageType::Chat::TEAM_GET_STATUS: {
|
||||
CINSTREAM_SKIP_HEADER;
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
LOG("Received an unknown chat: %i", int(packet->data[3]));
|
||||
LWOOBJID teamID = 0;
|
||||
char lootOption = 0;
|
||||
char memberCount = 0;
|
||||
std::vector<LWOOBJID> members;
|
||||
|
||||
inStream.Read(teamID);
|
||||
bool deleteTeam = inStream.ReadBit();
|
||||
|
||||
if (deleteTeam) {
|
||||
TeamManager::Instance()->DeleteTeam(teamID);
|
||||
|
||||
LOG("Deleting team (%llu)", teamID);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
inStream.Read(lootOption);
|
||||
inStream.Read(memberCount);
|
||||
LOG("Updating team (%llu), (%i), (%i)", teamID, lootOption, memberCount);
|
||||
for (char i = 0; i < memberCount; i++) {
|
||||
LWOOBJID member = LWOOBJID_EMPTY;
|
||||
inStream.Read(member);
|
||||
members.push_back(member);
|
||||
|
||||
LOG("Updating team member (%llu)", member);
|
||||
}
|
||||
|
||||
TeamManager::Instance()->UpdateTeam(teamID, lootOption, members);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
LOG("Received an unknown chat: %i", int(packet->data[3]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,5 +7,15 @@ master_server_port=2000
|
||||
# The port number to start world servers on. Will be incremented for each world
|
||||
world_port_start=3000
|
||||
|
||||
# Use sudo when launching the auth server.
|
||||
# Required by default if on Linux as auth runs on port 1001
|
||||
use_sudo_auth=1
|
||||
|
||||
# Use sudo when launching the chat server
|
||||
use_sudo_chat=0
|
||||
|
||||
# Use sudo when launching world servers
|
||||
use_sudo_world=0
|
||||
|
||||
# 0 or 1, should autostart auth, chat, and char servers
|
||||
prestart_servers=1
|
||||
|
||||
@@ -28,8 +28,7 @@ client_location=
|
||||
|
||||
# The maximum outgoing bandwidth in bits. If your clients are having
|
||||
# issues with enemies taking a while to catch up to them, increse this value.
|
||||
# Empty or 0 means no limit
|
||||
maximum_outgoing_bandwidth=0
|
||||
maximum_outgoing_bandwidth=80000
|
||||
|
||||
# The Maximum Translation Unit (MTU) size for packets. If players are
|
||||
# getting stuck at 55% on the loading screen, lower this number to
|
||||
|
||||
1
thirdparty/cpp-httplib
vendored
Submodule
1
thirdparty/cpp-httplib
vendored
Submodule
Submodule thirdparty/cpp-httplib added at 824e7682e4
Reference in New Issue
Block a user