Organize dScripts (#814)

* Organize dScripts

whitespace

Remove parent scope

Remove parent scope from initial setter

Remove debug

Remove helper programs

* Fix NtImagimeterVisibility script

Co-authored-by: aronwk-aaron <aronwk.aaron@gmail.com>
This commit is contained in:
David Markowitz
2022-11-03 10:57:54 -07:00
committed by GitHub
parent b974eed8f5
commit 8d37d9b681
567 changed files with 886 additions and 252 deletions

View File

@@ -0,0 +1,13 @@
set(DSCRIPTS_SOURCES_02_SERVER_MAP_NS
"NsConcertChoiceBuildManager.cpp"
"NsLegoClubDoor.cpp"
"NsLupTeleport.cpp"
"NsTokenConsoleServer.cpp")
add_subdirectory(Waves)
foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_NS_WAVES})
set(DSCRIPTS_SOURCES_02_SERVER_MAP_NS ${DSCRIPTS_SOURCES_02_SERVER_MAP_NS} "Waves/${file}")
endforeach()
set(DSCRIPTS_SOURCES_02_SERVER_MAP_NS ${DSCRIPTS_SOURCES_02_SERVER_MAP_NS} PARENT_SCOPE)

View File

@@ -0,0 +1,64 @@
#include "NsConcertChoiceBuildManager.h"
#include "EntityManager.h"
const std::vector<Crate> NsConcertChoiceBuildManager::crates{
{ "laser", 11203, 5.0, "Concert_Laser_QB_" },
{ "rocket", 11204, 3.0, "Concert_Rocket_QB_" },
{ "speaker", 11205, 5.0, "Concert_Speaker_QB_" },
{ "spotlight", 11206, 5.0, "Concert_Spotlight_QB_" }
};
void NsConcertChoiceBuildManager::OnStartup(Entity* self) {
NsConcertChoiceBuildManager::SpawnCrate(self);
}
void NsConcertChoiceBuildManager::SpawnCrate(Entity* self) {
const auto spawnNumber = self->GetVar<uint32_t>(u"spawnNumber") % crates.size();
const auto crate = crates[spawnNumber];
const auto groups = self->GetGroups();
if (groups.empty())
return;
// Groups are of the form CB_1, CB_2, etc.
auto group = groups.at(0);
const auto splitGroup = GeneralUtils::SplitString(group, '_');
if (splitGroup.size() < 2)
return;
const auto groupNumber = std::stoi(splitGroup.at(1));
EntityInfo info{};
info.lot = crate.lot;
info.pos = self->GetPosition();
info.rot = self->GetRotation();
info.spawnerID = self->GetObjectID();
info.settings = {
new LDFData<bool>(u"startsQBActivator", true),
new LDFData<std::string>(u"grpNameQBShowBricks", crate.group + std::to_string(groupNumber)),
new LDFData<std::u16string>(u"groupID", GeneralUtils::ASCIIToUTF16("Crate_" + group)),
new LDFData<float>(u"crateTime", crate.time),
};
auto* spawnedCrate = EntityManager::Instance()->CreateEntity(info);
EntityManager::Instance()->ConstructEntity(spawnedCrate);
spawnedCrate->AddDieCallback([self]() {
self->CancelAllTimers(); // Don't switch if the crate was smashed
self->SetVar<LWOOBJID>(u"currentCrate", LWOOBJID_EMPTY);
});
self->SetVar<uint32_t>(u"spawnNumber", spawnNumber + 1);
self->SetVar<float>(u"currentTimer", crate.time);
self->SetVar<LWOOBJID>(u"currentCrate", spawnedCrate->GetObjectID());
// Timer that rotates the crates
self->AddCallbackTimer(crate.time, [self]() {
auto crateID = self->GetVar<LWOOBJID>(u"currentCrate");
if (crateID != LWOOBJID_EMPTY) {
EntityManager::Instance()->DestroyEntity(crateID);
self->SetVar<LWOOBJID>(u"currentCrate", LWOOBJID_EMPTY);
}
SpawnCrate(self);
});
}

View File

@@ -0,0 +1,17 @@
#pragma once
#include "CppScripts.h"
struct Crate {
std::string name;
LOT lot;
float time;
std::string group;
};
class NsConcertChoiceBuildManager : public CppScripts::Script {
public:
void OnStartup(Entity* self) override;
static void SpawnCrate(Entity* self);
private:
static const std::vector<Crate> crates;
};

View File

@@ -0,0 +1,152 @@
#include "NsLegoClubDoor.h"
#include "dZoneManager.h"
#include "GameMessages.h"
#include "AMFFormat.h"
void NsLegoClubDoor::OnStartup(Entity* self) {
self->SetVar(u"currentZone", (int32_t)dZoneManager::Instance()->GetZoneID().GetMapID());
self->SetVar(u"choiceZone", m_ChoiceZoneID);
self->SetVar(u"teleportAnim", m_TeleportAnim);
self->SetVar(u"teleportString", m_TeleportString);
self->SetVar(u"spawnPoint", m_SpawnPoint);
args = {};
AMFStringValue* callbackClient = new AMFStringValue();
callbackClient->SetStringValue(std::to_string(self->GetObjectID()));
args.InsertValue("callbackClient", callbackClient);
AMFStringValue* strIdentifier = new AMFStringValue();
strIdentifier->SetStringValue("choiceDoor");
args.InsertValue("strIdentifier", strIdentifier);
AMFStringValue* title = new AMFStringValue();
title->SetStringValue("%[UI_CHOICE_DESTINATION]");
args.InsertValue("title", title);
AMFArrayValue* choiceOptions = new AMFArrayValue();
{
AMFArrayValue* nsArgs = new AMFArrayValue();
AMFStringValue* image = new AMFStringValue();
image->SetStringValue("textures/ui/zone_thumnails/Nimbus_Station.dds");
nsArgs->InsertValue("image", image);
AMFStringValue* caption = new AMFStringValue();
caption->SetStringValue("%[UI_CHOICE_NS]");
nsArgs->InsertValue("caption", caption);
AMFStringValue* identifier = new AMFStringValue();
identifier->SetStringValue("zoneID_1200");
nsArgs->InsertValue("identifier", identifier);
AMFStringValue* tooltipText = new AMFStringValue();
tooltipText->SetStringValue("%[UI_CHOICE_NS_HOVER]");
nsArgs->InsertValue("tooltipText", tooltipText);
choiceOptions->PushBackValue(nsArgs);
}
{
AMFArrayValue* ntArgs = new AMFArrayValue();
AMFStringValue* image = new AMFStringValue();
image->SetStringValue("textures/ui/zone_thumnails/Nexus_Tower.dds");
ntArgs->InsertValue("image", image);
AMFStringValue* caption = new AMFStringValue();
caption->SetStringValue("%[UI_CHOICE_NT]");
ntArgs->InsertValue("caption", caption);
AMFStringValue* identifier = new AMFStringValue();
identifier->SetStringValue("zoneID_1900");
ntArgs->InsertValue("identifier", identifier);
AMFStringValue* tooltipText = new AMFStringValue();
tooltipText->SetStringValue("%[UI_CHOICE_NT_HOVER]");
ntArgs->InsertValue("tooltipText", tooltipText);
choiceOptions->PushBackValue(ntArgs);
}
options = choiceOptions;
args.InsertValue("options", choiceOptions);
}
void NsLegoClubDoor::OnUse(Entity* self, Entity* user) {
auto* player = user;
if (CheckChoice(self, player)) {
AMFArrayValue* multiArgs = new AMFArrayValue();
AMFStringValue* callbackClient = new AMFStringValue();
callbackClient->SetStringValue(std::to_string(self->GetObjectID()));
multiArgs->InsertValue("callbackClient", callbackClient);
AMFStringValue* strIdentifier = new AMFStringValue();
strIdentifier->SetStringValue("choiceDoor");
multiArgs->InsertValue("strIdentifier", strIdentifier);
AMFStringValue* title = new AMFStringValue();
title->SetStringValue("%[UI_CHOICE_DESTINATION]");
multiArgs->InsertValue("title", title);
multiArgs->InsertValue("options", options);
GameMessages::SendUIMessageServerToSingleClient(player, player->GetSystemAddress(), "QueueChoiceBox", multiArgs);
} else if (self->GetVar<int32_t>(u"currentZone") != m_ChoiceZoneID) {
AMFArrayValue* multiArgs = new AMFArrayValue();
AMFStringValue* state = new AMFStringValue();
state->SetStringValue("Lobby");
multiArgs->InsertValue("state", state);
AMFArrayValue* context = new AMFArrayValue();
AMFStringValue* user = new AMFStringValue();
user->SetStringValue(std::to_string(player->GetObjectID()));
context->InsertValue("user", user);
AMFStringValue* callbackObj = new AMFStringValue();
callbackObj->SetStringValue(std::to_string(self->GetObjectID()));
context->InsertValue("callbackObj", callbackObj);
AMFStringValue* helpVisible = new AMFStringValue();
helpVisible->SetStringValue("show");
context->InsertValue("HelpVisible", helpVisible);
AMFStringValue* type = new AMFStringValue();
type->SetStringValue("Lego_Club_Valid");
context->InsertValue("type", type);
multiArgs->InsertValue("context", context);
GameMessages::SendUIMessageServerToSingleClient(player, player->GetSystemAddress(), "pushGameState", multiArgs);
} else {
BaseOnUse(self, player);
}
}
void NsLegoClubDoor::OnMessageBoxResponse(Entity* self, Entity* sender, int32_t button, const std::u16string& identifier, const std::u16string& userData) {
std::u16string strIdentifier = identifier;
if (strIdentifier == u"PlayButton" || strIdentifier == u"CloseButton") {
strIdentifier = u"TransferBox";
}
BaseOnMessageBoxResponse(self, sender, button, strIdentifier, userData);
}
void NsLegoClubDoor::OnChoiceBoxResponse(Entity* self, Entity* sender, int32_t button, const std::u16string& buttonIdentifier, const std::u16string& identifier) {
BaseChoiceBoxRespond(self, sender, button, buttonIdentifier, identifier);
}
void NsLegoClubDoor::OnTimerDone(Entity* self, std::string timerName) {
BaseOnTimerDone(self, timerName);
}
void NsLegoClubDoor::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) {
BaseOnFireEventServerSide(self, sender, args, param1, param2, param3);
}

View File

@@ -0,0 +1,23 @@
#pragma once
#include "CppScripts.h"
#include "ChooseYourDestinationNsToNt.h"
#include "BaseConsoleTeleportServer.h"
class NsLegoClubDoor : public CppScripts::Script, ChooseYourDestinationNsToNt, BaseConsoleTeleportServer
{
public:
void OnStartup(Entity* self) override;
void OnUse(Entity* self, Entity* user) override;
void OnMessageBoxResponse(Entity* self, Entity* sender, int32_t button, const std::u16string& identifier, const std::u16string& userData) override;
void OnChoiceBoxResponse(Entity* self, Entity* sender, int32_t button, const std::u16string& buttonIdentifier, const std::u16string& identifier) override;
void OnTimerDone(Entity* self, std::string timerName) override;
void OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) override;
private:
int32_t m_ChoiceZoneID = 1700;
std::string m_SpawnPoint = "NS_LEGO_Club";
std::u16string m_TeleportAnim = u"lup-teleport";
std::u16string m_TeleportString = u"ROCKET_TOOLTIP_USE_THE_GATEWAY_TO_TRAVEL_TO_LUP_WORLD";
AMFArrayValue args = {};
AMFArrayValue* options = {};
};

View File

@@ -0,0 +1,100 @@
#include "NsLupTeleport.h"
#include "dZoneManager.h"
#include "GameMessages.h"
#include "AMFFormat.h"
void NsLupTeleport::OnStartup(Entity* self) {
self->SetVar(u"currentZone", (int32_t)dZoneManager::Instance()->GetZoneID().GetMapID());
self->SetVar(u"choiceZone", m_ChoiceZoneID);
self->SetVar(u"teleportAnim", m_TeleportAnim);
self->SetVar(u"teleportString", m_TeleportString);
self->SetVar(u"spawnPoint", m_SpawnPoint);
args = {};
AMFStringValue* callbackClient = new AMFStringValue();
callbackClient->SetStringValue(std::to_string(self->GetObjectID()));
args.InsertValue("callbackClient", callbackClient);
AMFStringValue* strIdentifier = new AMFStringValue();
strIdentifier->SetStringValue("choiceDoor");
args.InsertValue("strIdentifier", strIdentifier);
AMFStringValue* title = new AMFStringValue();
title->SetStringValue("%[UI_CHOICE_DESTINATION]");
args.InsertValue("title", title);
AMFArrayValue* choiceOptions = new AMFArrayValue();
{
AMFArrayValue* nsArgs = new AMFArrayValue();
AMFStringValue* image = new AMFStringValue();
image->SetStringValue("textures/ui/zone_thumnails/Nimbus_Station.dds");
nsArgs->InsertValue("image", image);
AMFStringValue* caption = new AMFStringValue();
caption->SetStringValue("%[UI_CHOICE_NS]");
nsArgs->InsertValue("caption", caption);
AMFStringValue* identifier = new AMFStringValue();
identifier->SetStringValue("zoneID_1200");
nsArgs->InsertValue("identifier", identifier);
AMFStringValue* tooltipText = new AMFStringValue();
tooltipText->SetStringValue("%[UI_CHOICE_NS_HOVER]");
nsArgs->InsertValue("tooltipText", tooltipText);
choiceOptions->PushBackValue(nsArgs);
}
{
AMFArrayValue* ntArgs = new AMFArrayValue();
AMFStringValue* image = new AMFStringValue();
image->SetStringValue("textures/ui/zone_thumnails/Nexus_Tower.dds");
ntArgs->InsertValue("image", image);
AMFStringValue* caption = new AMFStringValue();
caption->SetStringValue("%[UI_CHOICE_NT]");
ntArgs->InsertValue("caption", caption);
AMFStringValue* identifier = new AMFStringValue();
identifier->SetStringValue("zoneID_1900");
ntArgs->InsertValue("identifier", identifier);
AMFStringValue* tooltipText = new AMFStringValue();
tooltipText->SetStringValue("%[UI_CHOICE_NT_HOVER]");
ntArgs->InsertValue("tooltipText", tooltipText);
choiceOptions->PushBackValue(ntArgs);
}
args.InsertValue("options", choiceOptions);
}
void NsLupTeleport::OnUse(Entity* self, Entity* user) {
auto* player = user;
if (CheckChoice(self, player)) {
GameMessages::SendUIMessageServerToSingleClient(player, player->GetSystemAddress(), "QueueChoiceBox", &args);
} else {
BaseOnUse(self, player);
}
}
void NsLupTeleport::OnMessageBoxResponse(Entity* self, Entity* sender, int32_t button, const std::u16string& identifier, const std::u16string& userData) {
BaseOnMessageBoxResponse(self, sender, button, identifier, userData);
}
void NsLupTeleport::OnChoiceBoxResponse(Entity* self, Entity* sender, int32_t button, const std::u16string& buttonIdentifier, const std::u16string& identifier) {
BaseChoiceBoxRespond(self, sender, button, buttonIdentifier, identifier);
}
void NsLupTeleport::OnTimerDone(Entity* self, std::string timerName) {
BaseOnTimerDone(self, timerName);
}
void NsLupTeleport::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) {
BaseOnFireEventServerSide(self, sender, args, param1, param2, param3);
}

View File

@@ -0,0 +1,22 @@
#pragma once
#include "CppScripts.h"
#include "ChooseYourDestinationNsToNt.h"
#include "BaseConsoleTeleportServer.h"
class NsLupTeleport : public CppScripts::Script, ChooseYourDestinationNsToNt, BaseConsoleTeleportServer
{
public:
void OnStartup(Entity* self) override;
void OnUse(Entity* self, Entity* user) override;
void OnMessageBoxResponse(Entity* self, Entity* sender, int32_t button, const std::u16string& identifier, const std::u16string& userData) override;
void OnChoiceBoxResponse(Entity* self, Entity* sender, int32_t button, const std::u16string& buttonIdentifier, const std::u16string& identifier) override;
void OnTimerDone(Entity* self, std::string timerName) override;
void OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) override;
private:
int32_t m_ChoiceZoneID = 1600;
std::string m_SpawnPoint = "NS_LW";
std::u16string m_TeleportAnim = u"lup-teleport";
std::u16string m_TeleportString = u"UI_TRAVEL_TO_LUP_STATION";
AMFArrayValue args = {};
};

View File

@@ -0,0 +1,61 @@
#include "NsTokenConsoleServer.h"
#include "InventoryComponent.h"
#include "GameMessages.h"
#include "Character.h"
#include "MissionComponent.h"
#include "RebuildComponent.h"
void NsTokenConsoleServer::OnStartup(Entity* self) {
}
void NsTokenConsoleServer::OnUse(Entity* self, Entity* user) {
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
if (rebuildComponent == nullptr) {
return;
}
if (rebuildComponent->GetState() != REBUILD_COMPLETED) {
return;
}
auto* inventoryComponent = user->GetComponent<InventoryComponent>();
auto* missionComponent = user->GetComponent<MissionComponent>();
auto* character = user->GetCharacter();
if (inventoryComponent == nullptr || missionComponent == nullptr || character == nullptr) {
return;
}
if (inventoryComponent->GetLotCount(6194) < 25) {
return;
}
inventoryComponent->RemoveItem(6194, 25);
const auto useSound = self->GetVar<std::string>(u"sound1");
if (!useSound.empty()) {
GameMessages::SendPlayNDAudioEmitter(self, UNASSIGNED_SYSTEM_ADDRESS, useSound);
}
// Player must be in faction to interact with this entity.
LOT tokenLOT = 0;
if (character->GetPlayerFlag(46)) {
tokenLOT = 8321;
} else if (character->GetPlayerFlag(47)) {
tokenLOT = 8318;
} else if (character->GetPlayerFlag(48)) {
tokenLOT = 8320;
} else if (character->GetPlayerFlag(49)) {
tokenLOT = 8319;
}
inventoryComponent->AddItem(tokenLOT, 5, eLootSourceType::LOOT_SOURCE_NONE);
missionComponent->ForceProgressTaskType(863, 1, 1, false);
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
}

View File

@@ -0,0 +1,9 @@
#pragma once
#include "CppScripts.h"
class NsTokenConsoleServer : public CppScripts::Script
{
public:
void OnStartup(Entity* self) override;
void OnUse(Entity* self, Entity* user) override;
};

View File

@@ -0,0 +1,3 @@
set(DSCRIPTS_SOURCES_02_SERVER_MAP_NS_WAVES
"ZoneNsWaves.cpp"
PARENT_SCOPE)

View File

@@ -0,0 +1,500 @@
#include "ZoneNsWaves.h"
WaveConstants ZoneNsWaves::GetConstants() {
return {
60,
2,
6,
2,
"surprise",
"intro"
};
}
std::vector<std::string> ZoneNsWaves::GetSpawnerNames() {
return {
"Base_MobA",
"Base_MobB",
"Base_MobC",
"MobA_01",
"MobB_01",
"MobC_01",
"MobA_02",
"MobB_02",
"MobC_02",
"MobA_03",
"MobB_03",
"MobC_03",
"Reward_01",
"Base_Reward",
"Obstacle_01",
"Boss",
"Ape_Boss",
"Geyser_01",
"Treasure_01",
"Cavalry_Boss",
"Horseman_01",
"Horseman_02",
"Horseman_03",
"Horseman_04"
};
}
std::vector<WaveMission> ZoneNsWaves::GetWaveMissions() {
return {
{190, 7, 1242},
{240, 7, 1226},
{450, 15, 1243},
{600, 15, 1227},
{720, 22, 1244},
{840, 22, 1228},
{1080, 29, 1245},
{1200, 29, 1229},
};
}
std::vector<Wave> ZoneNsWaves::GetWaves() {
return {
// Wave 1
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::stromling_minifig, 8, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::stromling_minifig, 2, GetSpawnerName(SpawnerName::ag_A) },
{ SpawnLOTS::stromling_minifig, 2, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::stromling_minifig, 2, GetSpawnerName(SpawnerName::gf_A) },
}
},
// Wave 2
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::stromling, 8, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::stromling, 2, GetSpawnerName(SpawnerName::ag_A) },
{ SpawnLOTS::stromling, 2, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::stromling, 2, GetSpawnerName(SpawnerName::gf_A) },
}
},
// Wave 3
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::stromling, 4, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::mech, 2, GetSpawnerName(SpawnerName::interior_B) },
{ SpawnLOTS::stromling, 3, GetSpawnerName(SpawnerName::ag_A) },
{ SpawnLOTS::stromling, 3, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::stromling, 3, GetSpawnerName(SpawnerName::gf_A) },
},
},
// Wave 4
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::stromling, 3, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::mech, 1, GetSpawnerName(SpawnerName::interior_B) },
{ SpawnLOTS::stromling, 2, GetSpawnerName(SpawnerName::ag_A) },
{ SpawnLOTS::mech, 1, GetSpawnerName(SpawnerName::ag_B) },
{ SpawnLOTS::stromling, 2, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::mech, 1, GetSpawnerName(SpawnerName::concert_B) },
{ SpawnLOTS::stromling, 2, GetSpawnerName(SpawnerName::gf_A) },
{ SpawnLOTS::mech, 1, GetSpawnerName(SpawnerName::gf_B) },
}
},
// Wave 5
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::stromling, 2, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::spiderling, 1, GetSpawnerName(SpawnerName::interior_C) },
{ SpawnLOTS::hammerling_melee, 2, GetSpawnerName(SpawnerName::ag_A) },
{ SpawnLOTS::mech, 1, GetSpawnerName(SpawnerName::ag_B) },
{ SpawnLOTS::stromling, 1, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::mech, 1, GetSpawnerName(SpawnerName::concert_B) },
{ SpawnLOTS::stromling, 1, GetSpawnerName(SpawnerName::gf_A) },
{ SpawnLOTS::mech, 1, GetSpawnerName(SpawnerName::gf_B) },
}
},
// Wave 6
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::hammerling_melee, 1, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::mech, 2, GetSpawnerName(SpawnerName::interior_B) },
{ SpawnLOTS::spiderling, 1, GetSpawnerName(SpawnerName::interior_C) },
{ SpawnLOTS::hammerling_melee, 2, GetSpawnerName(SpawnerName::ag_A) },
{ SpawnLOTS::mech, 1, GetSpawnerName(SpawnerName::ag_B) },
{ SpawnLOTS::spiderling, 1, GetSpawnerName(SpawnerName::ag_C) },
{ SpawnLOTS::stromling, 2, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::mech, 1, GetSpawnerName(SpawnerName::concert_B) },
{ SpawnLOTS::stromling, 2, GetSpawnerName(SpawnerName::gf_A) },
{ SpawnLOTS::mech, 1, GetSpawnerName(SpawnerName::gf_B) },
}
},
// Wave 7
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::stromling_boss, 1, GetSpawnerName(SpawnerName::Boss) },
},
{1885},
{},
"Stromling_Boss",
5.0f
},
// Wave 8
Wave {
std::vector<MobDefinition> {
{SpawnLOTS::mushroom, 6, GetSpawnerName(SpawnerName::Reward_01) },
{SpawnLOTS::mushroom, 3, GetSpawnerName(SpawnerName::interior_Reward) },
}, {}, {}, "", -1.0f,
25,
},
// Wave 9
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::pirate, 4, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::gf_A) },
{ SpawnLOTS::admiral, 1, GetSpawnerName(SpawnerName::gf_B) },
}
},
// Wave 10
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::pirate, 4, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::mech, 2, GetSpawnerName(SpawnerName::interior_B) },
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::ag_A) },
{ SpawnLOTS::mech, 1, GetSpawnerName(SpawnerName::ag_B) },
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::mech, 1, GetSpawnerName(SpawnerName::concert_B) },
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::gf_A) },
{ SpawnLOTS::admiral, 2, GetSpawnerName(SpawnerName::gf_B) },
}
},
// Wave 11
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::pirate, 4, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::spiderling, 2, GetSpawnerName(SpawnerName::interior_C) },
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::ag_A) },
{ SpawnLOTS::spiderling, 1, GetSpawnerName(SpawnerName::ag_C) },
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::spiderling, 1, GetSpawnerName(SpawnerName::concert_C) },
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::gf_A) },
{ SpawnLOTS::spiderling, 1, GetSpawnerName(SpawnerName::gf_C) },
}
},
// Wave 12
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::pirate, 4, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::hammerling, 2, GetSpawnerName(SpawnerName::interior_B) },
{ SpawnLOTS::spiderling, 2, GetSpawnerName(SpawnerName::interior_C) },
{ SpawnLOTS::mech, 2, GetSpawnerName(SpawnerName::ag_B) },
{ SpawnLOTS::spiderling, 1, GetSpawnerName(SpawnerName::ag_C) },
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::admiral, 1, GetSpawnerName(SpawnerName::concert_C) },
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::gf_A) },
{ SpawnLOTS::admiral, 1, GetSpawnerName(SpawnerName::gf_C) },
}
},
// Wave 13
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::pirate, 3, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::admiral, 2, GetSpawnerName(SpawnerName::interior_B) },
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::ag_A) },
{ SpawnLOTS::admiral, 1, GetSpawnerName(SpawnerName::ag_B) },
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::admiral, 1, GetSpawnerName(SpawnerName::concert_B) },
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::gf_A) },
{ SpawnLOTS::admiral, 1, GetSpawnerName(SpawnerName::gf_B) },
}
},
// Wave 14
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::admiral, 2, GetSpawnerName(SpawnerName::interior_B) },
{ SpawnLOTS::mech, 2, GetSpawnerName(SpawnerName::interior_C) },
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::ag_A) },
{ SpawnLOTS::admiral, 1, GetSpawnerName(SpawnerName::ag_B) },
{ SpawnLOTS::mech, 1, GetSpawnerName(SpawnerName::ag_C) },
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::admiral, 1, GetSpawnerName(SpawnerName::concert_B) },
{ SpawnLOTS::mech, 1, GetSpawnerName(SpawnerName::concert_C) },
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::gf_A) },
{ SpawnLOTS::admiral, 1, GetSpawnerName(SpawnerName::gf_B) },
{ SpawnLOTS::mech, 1, GetSpawnerName(SpawnerName::gf_C) },
}
},
// Wave 15
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::ape_boss, 1, GetSpawnerName(SpawnerName::Ape_Boss) },
},
{1886},
{},
"Gorilla_Boss",
5.0f
},
// Wave 16
Wave {
std::vector<MobDefinition> {
{SpawnLOTS::outhouse, 3, GetSpawnerName(SpawnerName::interior_Reward) },
{SpawnLOTS::mushroom, 6, GetSpawnerName(SpawnerName::Reward_01) },
}, {}, {}, "", -1.0f,
25,
},
// Wave 17
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::hammerling_melee, 2, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::hammerling_melee, 2, GetSpawnerName(SpawnerName::interior_B) },
{ SpawnLOTS::hammerling_melee, 1, GetSpawnerName(SpawnerName::ag_A) },
{ SpawnLOTS::hammerling_melee, 2, GetSpawnerName(SpawnerName::ag_B) },
{ SpawnLOTS::hammerling_melee, 1, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::hammerling_melee, 2, GetSpawnerName(SpawnerName::concert_B) },
{ SpawnLOTS::hammerling_melee, 1, GetSpawnerName(SpawnerName::gf_A) },
{ SpawnLOTS::hammerling_melee, 2, GetSpawnerName(SpawnerName::gf_B) },
}
},
// Wave 18
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::hammerling_melee, 4, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::hammerling, 2, GetSpawnerName(SpawnerName::interior_B) },
{ SpawnLOTS::hammerling_melee, 2, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::hammerling, 1, GetSpawnerName(SpawnerName::concert_B) },
{ SpawnLOTS::hammerling_melee, 2, GetSpawnerName(SpawnerName::ag_A) },
{ SpawnLOTS::hammerling, 1, GetSpawnerName(SpawnerName::ag_B) },
{ SpawnLOTS::hammerling_melee, 2, GetSpawnerName(SpawnerName::gf_A) },
{ SpawnLOTS::hammerling, 1, GetSpawnerName(SpawnerName::gf_B) },
}
},
// Wave 19
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::hammerling, 4, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::sentry, 2, GetSpawnerName(SpawnerName::interior_B) },
{ SpawnLOTS::hammerling, 2, GetSpawnerName(SpawnerName::ag_A) },
{ SpawnLOTS::sentry, 1, GetSpawnerName(SpawnerName::ag_B) },
{ SpawnLOTS::hammerling, 2, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::sentry, 1, GetSpawnerName(SpawnerName::concert_B) },
{ SpawnLOTS::hammerling, 2, GetSpawnerName(SpawnerName::gf_A) },
{ SpawnLOTS::sentry, 1, GetSpawnerName(SpawnerName::gf_B) },
}
},
// Wave 20
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::ronin, 3, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::sentry, 2, GetSpawnerName(SpawnerName::interior_B) },
{ SpawnLOTS::spiderling_ve, 1, GetSpawnerName(SpawnerName::interior_C) },
{ SpawnLOTS::hammerling, 1, GetSpawnerName(SpawnerName::ag_A) },
{ SpawnLOTS::sentry, 1, GetSpawnerName(SpawnerName::ag_B) },
{ SpawnLOTS::spiderling_ve, 1, GetSpawnerName(SpawnerName::ag_C) },
{ SpawnLOTS::hammerling, 1, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::sentry, 1, GetSpawnerName(SpawnerName::concert_B) },
{ SpawnLOTS::spiderling_ve, 1, GetSpawnerName(SpawnerName::concert_C) },
{ SpawnLOTS::hammerling, 1, GetSpawnerName(SpawnerName::gf_A) },
{ SpawnLOTS::sentry, 1, GetSpawnerName(SpawnerName::gf_B) },
{ SpawnLOTS::spiderling_ve, 1, GetSpawnerName(SpawnerName::gf_C) },
}
},
// Wave 21
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::admiral, 2, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::ronin, 2, GetSpawnerName(SpawnerName::interior_B) },
{ SpawnLOTS::spiderling_ve, 2, GetSpawnerName(SpawnerName::interior_C) },
{ SpawnLOTS::admiral, 1, GetSpawnerName(SpawnerName::ag_A) },
{ SpawnLOTS::ronin, 1, GetSpawnerName(SpawnerName::ag_B) },
{ SpawnLOTS::spiderling_ve, 1, GetSpawnerName(SpawnerName::ag_C) },
{ SpawnLOTS::admiral, 1, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::ronin, 1, GetSpawnerName(SpawnerName::concert_B) },
{ SpawnLOTS::spiderling_ve, 1, GetSpawnerName(SpawnerName::concert_C) },
{ SpawnLOTS::admiral, 1, GetSpawnerName(SpawnerName::gf_A) },
{ SpawnLOTS::ronin, 1, GetSpawnerName(SpawnerName::gf_B) },
{ SpawnLOTS::spiderling_ve, 1, GetSpawnerName(SpawnerName::gf_C) },
}
},
// Wave 22
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::spiderling_boss, 1, GetSpawnerName(SpawnerName::Cavalry_Boss) },
},
{1887},
{},
"Spiderling_Boss",
5.0f
},
// Wave 23
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::outhouse, 6, GetSpawnerName(SpawnerName::Reward_01) },
{ SpawnLOTS::outhouse, 3, GetSpawnerName(SpawnerName::interior_Reward) },
{ SpawnLOTS::maelstrom_chest, 4, GetSpawnerName(SpawnerName::Obstacle) },
}, {}, {}, "", -1.0f,
25,
},
// Wave 24
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::gf_A) },
{ SpawnLOTS::pirate, 2, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::pirate, 3, GetSpawnerName(SpawnerName::ag_A) },
{ SpawnLOTS::ronin, 3, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::ronin, 2, GetSpawnerName(SpawnerName::interior_B) },
}
},
// Wave 25
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::cavalry, 2, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::cavalry, 1, GetSpawnerName(SpawnerName::interior_B) },
{ SpawnLOTS::admiral_cp, 1, GetSpawnerName(SpawnerName::ag_B) },
{ SpawnLOTS::admiral_cp, 1, GetSpawnerName(SpawnerName::gf_B) },
{ SpawnLOTS::admiral_cp, 1, GetSpawnerName(SpawnerName::concert_B) },
{ SpawnLOTS::spiderling, 2, GetSpawnerName(SpawnerName::gf_A) },
{ SpawnLOTS::spiderling, 2, GetSpawnerName(SpawnerName::concert_A) },
{ SpawnLOTS::spiderling, 1, GetSpawnerName(SpawnerName::ag_A) },
}
},
// Wave 26
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::ronin, 3, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::ronin, 3, GetSpawnerName(SpawnerName::interior_B) },
{ SpawnLOTS::spiderling_ve, 1, GetSpawnerName(SpawnerName::ag_B) },
{ SpawnLOTS::spiderling_ve, 1, GetSpawnerName(SpawnerName::gf_B) },
{ SpawnLOTS::spiderling_ve, 1, GetSpawnerName(SpawnerName::concert_B) },
{ SpawnLOTS::admiral_cp, 2, GetSpawnerName(SpawnerName::gf_C) },
{ SpawnLOTS::admiral_cp, 2, GetSpawnerName(SpawnerName::ag_C) },
{ SpawnLOTS::admiral_cp, 1, GetSpawnerName(SpawnerName::concert_C) },
}
},
// Wave 27
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::ronin, 5, GetSpawnerName(SpawnerName::interior_A) },
{ SpawnLOTS::ronin, 4, GetSpawnerName(SpawnerName::interior_B) },
{ SpawnLOTS::cavalry, 1, GetSpawnerName(SpawnerName::ag_C) },
{ SpawnLOTS::cavalry, 1, GetSpawnerName(SpawnerName::gf_C) },
{ SpawnLOTS::cavalry, 1, GetSpawnerName(SpawnerName::concert_C) },
{ SpawnLOTS::admiral_cp, 1, GetSpawnerName(SpawnerName::ag_B) },
{ SpawnLOTS::admiral_cp, 1, GetSpawnerName(SpawnerName::gf_B) },
{ SpawnLOTS::admiral_cp, 1, GetSpawnerName(SpawnerName::concert_B) },
}
},
// Wave 28
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::dragon_statue, 12, GetSpawnerName(SpawnerName::Reward_01) },
}, {}, {}, "", -1.0f,
30,
},
// Wave 29
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::horseman_boss01, 1, GetSpawnerName(SpawnerName::Horseman_01) },
{ SpawnLOTS::horseman_boss02, 1, GetSpawnerName(SpawnerName::Horseman_02) },
{ SpawnLOTS::horseman_boss03, 1, GetSpawnerName(SpawnerName::Horseman_03) },
{ SpawnLOTS::horseman_boss04, 1, GetSpawnerName(SpawnerName::Horseman_04) },
},
{1888},
{1236, 1237, 1249},
"Horsemen_Boss",
5.0f
},
// Wave 30 (treasure)
Wave {
std::vector<MobDefinition> {
{ SpawnLOTS::treasure_chest, 1, GetSpawnerName(SpawnerName::Treasure_01) },
}, {}, {},
"Treasure_Camera",
5.0f,
(uint32_t)-1,
true,
30,
},
};
}
std::string ZoneNsWaves::GetSpawnerName(SpawnerName spawnerName) {
switch (spawnerName) {
case interior_A:
return "Base_MobA";
case interior_B:
return "Base_MobB";
case interior_C:
return "Base_MobC";
case gf_A:
return "MobA_01";
case gf_B:
return "MobB_01";
case gf_C:
return "MobC_01";
case concert_A:
return "MobA_02";
case concert_B:
return "MobB_02";
case concert_C:
return "MobC_02";
case ag_A:
return "MobA_03";
case ag_B:
return "MobB_03";
case ag_C:
return "MobC_03";
case Reward_01:
return "Reward_01";
case interior_Reward:
return "Base_Reward";
case Obstacle:
return "Obstacle_01";
case Boss:
return "Boss";
case Ape_Boss:
return "Ape_Boss";
case Geyser:
return "Geyser_01";
case Treasure_01:
return "Treasure_01";
case Cavalry_Boss:
return "Cavalry_Boss";
case Horseman_01:
return "Horseman_01";
case Horseman_02:
return "Horseman_02";
case Horseman_03:
return "Horseman_03";
case Horseman_04:
return "Horseman_04";
default:
return "";
}
}

View File

@@ -0,0 +1,69 @@
#pragma once
#include "BaseWavesServer.h"
enum SpawnerName {
interior_A,
interior_B,
interior_C,
gf_A,
gf_B,
gf_C,
concert_A,
concert_B,
concert_C,
ag_A,
ag_B,
ag_C,
Reward_01,
interior_Reward,
Obstacle,
Boss,
Ape_Boss,
Geyser,
Treasure_01,
Cavalry_Boss,
Horseman_01,
Horseman_02,
Horseman_03,
Horseman_04,
};
enum SpawnLOTS : LOT {
stromling = 12586,
mech = 12587,
spiderling = 12588,
pirate = 12589,
admiral = 12590,
ape_boss = 12591,
stromling_boss = 12600,
hammerling = 12602,
sentry = 12604,
spiderling_ve = 12605,
spiderling_boss = 12609,
ronin = 12610,
cavalry = 12611,
dragon_boss = 12612,
stromling_minifig = 12586,
mushroom = 12614,
maelstrom_chest = 4894,
outhouse = 12616,
dragon_statue = 12617,
treasure_chest = 12423,
hammerling_melee = 12653,
maelstrom_geyser = 10314,
ronin_statue = 12611,
horseman_boss01 = 11999,
horseman_boss02 = 12467,
horseman_boss03 = 12468,
horseman_boss04 = 12469,
admiral_cp = 13523,
};
class ZoneNsWaves : public BaseWavesServer {
WaveConstants GetConstants() override;
std::vector<std::string> GetSpawnerNames() override;
std::vector<WaveMission> GetWaveMissions() override;
std::vector<Wave> GetWaves() override;
private:
static std::string GetSpawnerName(SpawnerName spawnerName);
};