mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
Breakout rest of the enums from dCommonVars and clean it up (#1061)
* Breakout rest of the enums from dcommonvars so we don't have to deal with merge conflicts ePlayerFlags is not a scoped enum, yet, due to it's complexity * address feedback * make player flag types consistent * fix typo
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "EntityInfo.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "eAninmationFlags.h"
|
||||
#include "eStateChangeType.h"
|
||||
|
||||
void BaseEnemyApe::OnStartup(Entity* self) {
|
||||
self->SetVar<uint32_t>(u"timesStunned", 2);
|
||||
@@ -15,7 +16,7 @@ void BaseEnemyApe::OnStartup(Entity* self) {
|
||||
void BaseEnemyApe::OnDie(Entity* self, Entity* killer) {
|
||||
auto* anchor = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"QB"));
|
||||
if (anchor != nullptr && !anchor->GetIsDead()) {
|
||||
anchor->Smash(self->GetObjectID(), SILENT);
|
||||
anchor->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -30,7 +30,7 @@ BootyDigServer::OnFireEventServerSide(Entity* self, Entity* sender, std::string
|
||||
return;
|
||||
|
||||
if (args == "ChestReady" && (propertyOwner == std::to_string(LWOOBJID_EMPTY) || player->GetVar<bool>(u"bootyDug"))) {
|
||||
self->Smash(self->GetObjectID(), SILENT);
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
} else if (args == "ChestOpened") {
|
||||
// Make sure players only dig up one booty per instance
|
||||
player->SetVar<bool>(u"bootyDug", true);
|
||||
@@ -49,6 +49,6 @@ BootyDigServer::OnFireEventServerSide(Entity* self, Entity* sender, std::string
|
||||
}
|
||||
}
|
||||
} else if (args == "ChestDead") {
|
||||
self->Smash(player->GetObjectID(), SILENT);
|
||||
self->Smash(player->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Character.h"
|
||||
#include "EntityManager.h"
|
||||
#include "eReplicaComponentType.h"
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
void AgCagedBricksServer::OnUse(Entity* self, Entity* user) {
|
||||
//Tell the client to spawn the baby spiderling:
|
||||
@@ -17,7 +18,7 @@ void AgCagedBricksServer::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
if (!character) return;
|
||||
|
||||
character->SetPlayerFlag(74, true);
|
||||
character->SetPlayerFlag(ePlayerFlag::CAGED_SPIDER, true);
|
||||
|
||||
//Remove the maelstrom cube:
|
||||
auto inv = static_cast<InventoryComponent*>(user->GetComponent(eReplicaComponentType::INVENTORY));
|
||||
|
@@ -18,7 +18,7 @@ void NpcCowboyServer::OnMissionDialogueOK(Entity* self, Entity* target, int miss
|
||||
missionState == eMissionState::AVAILABLE ||
|
||||
missionState == eMissionState::COMPLETE_AVAILABLE) {
|
||||
if (inventoryComponent->GetLotCount(14378) == 0) {
|
||||
inventoryComponent->AddItem(14378, 1, eLootSourceType::LOOT_SOURCE_NONE);
|
||||
inventoryComponent->AddItem(14378, 1, eLootSourceType::NONE);
|
||||
}
|
||||
} else if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
|
||||
inventoryComponent->RemoveItem(14378, 1);
|
||||
|
@@ -10,7 +10,7 @@ void NpcPirateServer::OnMissionDialogueOK(Entity* self, Entity* target, int miss
|
||||
// Add or remove the lucky shovel based on whether the mission was completed or started
|
||||
if ((missionState == eMissionState::AVAILABLE || missionState == eMissionState::COMPLETE_AVAILABLE)
|
||||
&& luckyShovel == nullptr) {
|
||||
inventory->AddItem(14591, 1, eLootSourceType::LOOT_SOURCE_NONE);
|
||||
inventory->AddItem(14591, 1, eLootSourceType::NONE);
|
||||
} else if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
|
||||
inventory->RemoveItem(14591, 1);
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ void NpcWispServer::OnMissionDialogueOK(Entity* self, Entity* target, int missio
|
||||
// For the daily we add the maelstrom vacuum if the player doesn't have it yet
|
||||
if (missionID == 1883 && (missionState == eMissionState::AVAILABLE || missionState == eMissionState::COMPLETE_AVAILABLE)
|
||||
&& maelstromVacuum == nullptr) {
|
||||
inventory->AddItem(maelstromVacuumLot, 1, eLootSourceType::LOOT_SOURCE_NONE);
|
||||
inventory->AddItem(maelstromVacuumLot, 1, eLootSourceType::NONE);
|
||||
} else if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
|
||||
inventory->RemoveItem(maelstromVacuumLot, 1);
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "eMissionState.h"
|
||||
#include "Character.h"
|
||||
#include "eReplicaComponentType.h"
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
/*
|
||||
--------------------------------------------------------------
|
||||
@@ -36,6 +37,6 @@ void RemoveRentalGear::OnMissionDialogueOK(Entity* self, Entity* target, int mis
|
||||
|
||||
//reset the equipment flag
|
||||
auto character = target->GetCharacter();
|
||||
if (character) character->SetPlayerFlag(equipFlag, false);
|
||||
if (character) character->SetPlayerFlag(ePlayerFlag::EQUPPED_TRIAL_FACTION_GEAR, false);
|
||||
}
|
||||
}
|
||||
|
@@ -7,6 +7,5 @@ class RemoveRentalGear : public CppScripts::Script {
|
||||
private:
|
||||
int defaultMission = 768; //mission to remove gearSets on completion
|
||||
std::vector<int> gearSets = { 14359,14321,14353,14315 }; //inventory items to remove
|
||||
int equipFlag = 126; //Set upon wearing trial faction armor for the first time in a session
|
||||
};
|
||||
|
||||
|
@@ -18,7 +18,7 @@ void AmBlueX::OnSkillEventFired(Entity* self, Entity* caster, const std::string&
|
||||
|
||||
auto* character = caster->GetCharacter();
|
||||
if (character != nullptr) {
|
||||
character->SetPlayerFlag(self->GetVar<int32_t>(m_FlagVariable), true);
|
||||
character->SetPlayerFlag(self->GetVar<uint32_t>(m_FlagVariable), true);
|
||||
}
|
||||
|
||||
EntityInfo info{};
|
||||
|
@@ -24,5 +24,5 @@ void AmBridge::OnTimerDone(Entity* self, std::string timerName) {
|
||||
return;
|
||||
}
|
||||
|
||||
self->Smash(self->GetObjectID(), VIOLENT);
|
||||
self->Smash(self->GetObjectID(), eKillType::VIOLENT);
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "SimplePhysicsComponent.h"
|
||||
#include "eTerminateType.h"
|
||||
|
||||
void AmDrawBridge::OnStartup(Entity* self) {
|
||||
self->SetNetworkVar(u"InUse", false);
|
||||
@@ -25,7 +26,7 @@ void AmDrawBridge::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
auto* player = user;
|
||||
|
||||
GameMessages::SendTerminateInteraction(player->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
}
|
||||
|
||||
void AmDrawBridge::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
@@ -12,7 +12,7 @@ void AmDropshipComputer::OnStartup(Entity* self) {
|
||||
void AmDropshipComputer::OnUse(Entity* self, Entity* user) {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
|
||||
if (rebuildComponent == nullptr || rebuildComponent->GetState() != REBUILD_COMPLETED) {
|
||||
if (rebuildComponent == nullptr || rebuildComponent->GetState() != eRebuildState::COMPLETED) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void AmDropshipComputer::OnUse(Entity* self, Entity* user) {
|
||||
return;
|
||||
}
|
||||
|
||||
inventoryComponent->AddItem(m_NexusTalonDataCard, 1, eLootSourceType::LOOT_SOURCE_NONE);
|
||||
inventoryComponent->AddItem(m_NexusTalonDataCard, 1, eLootSourceType::NONE);
|
||||
}
|
||||
|
||||
void AmDropshipComputer::OnDie(Entity* self, Entity* killer) {
|
||||
@@ -76,7 +76,7 @@ void AmDropshipComputer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (timerName == "reset" && rebuildComponent->GetState() == REBUILD_OPEN) {
|
||||
self->Smash(self->GetObjectID(), SILENT);
|
||||
if (timerName == "reset" && rebuildComponent->GetState() == eRebuildState::OPEN) {
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
}
|
||||
|
@@ -176,7 +176,7 @@ void AmShieldGeneratorQuickbuild::BuffPlayers(Entity* self) {
|
||||
void AmShieldGeneratorQuickbuild::EnemyEnteredShield(Entity* self, Entity* intruder) {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
|
||||
if (rebuildComponent == nullptr || rebuildComponent->GetState() != REBUILD_COMPLETED) {
|
||||
if (rebuildComponent == nullptr || rebuildComponent->GetState() != eRebuildState::COMPLETED) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include "ProximityMonitorComponent.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "EntityInfo.h"
|
||||
#include "eStateChangeType.h"
|
||||
|
||||
void AmSkullkinDrill::OnStartup(Entity* self) {
|
||||
self->SetNetworkVar(u"bIsInUse", false);
|
||||
@@ -246,7 +247,7 @@ void AmSkullkinDrill::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t
|
||||
}
|
||||
}
|
||||
|
||||
self->Smash(attacker->GetObjectID(), SILENT);
|
||||
self->Smash(attacker->GetObjectID(), eKillType::SILENT);
|
||||
|
||||
self->CancelAllTimers();
|
||||
|
||||
@@ -264,7 +265,7 @@ void AmSkullkinDrill::OnTimerDone(Entity* self, std::string timerName) {
|
||||
auto* child = EntityManager::Instance()->GetEntity(childID);
|
||||
|
||||
if (child != nullptr) {
|
||||
child->Smash(self->GetObjectID(), SILENT);
|
||||
child->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
|
||||
self->SetNetworkVar(u"bIsInUse", false);
|
||||
|
@@ -2,6 +2,7 @@
|
||||
#include "InventoryComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "Item.h"
|
||||
#include "eTerminateType.h"
|
||||
|
||||
void AmTeapotServer::OnUse(Entity* self, Entity* user) {
|
||||
auto* inventoryComponent = user->GetComponent<InventoryComponent>();
|
||||
@@ -18,5 +19,5 @@ void AmTeapotServer::OnUse(Entity* self, Entity* user) {
|
||||
blueFlowerItem->SetCount(blueFlowerItem->GetCount() - 10);
|
||||
inventoryComponent->AddItem(WU_S_IMAGINATION_TEA, 1);
|
||||
}
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#include "MissionComponent.h"
|
||||
#include "eMissionState.h"
|
||||
#include "InventoryComponent.h"
|
||||
#include "eTerminateType.h"
|
||||
|
||||
int32_t ImgBrickConsoleQB::ResetBricks = 30;
|
||||
int32_t ImgBrickConsoleQB::ResetConsole = 60;
|
||||
@@ -20,7 +21,7 @@ void ImgBrickConsoleQB::OnStartup(Entity* self) {
|
||||
void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
|
||||
if (rebuildComponent->GetState() == REBUILD_COMPLETED) {
|
||||
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
||||
if (!self->GetNetworkVar<bool>(u"used")) {
|
||||
const auto consoles = EntityManager::Instance()->GetEntitiesInGroup("Console");
|
||||
|
||||
@@ -29,7 +30,7 @@ void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) {
|
||||
for (auto* console : consoles) {
|
||||
auto* consoleRebuildComponent = console->GetComponent<RebuildComponent>();
|
||||
|
||||
if (consoleRebuildComponent->GetState() != REBUILD_COMPLETED) {
|
||||
if (consoleRebuildComponent->GetState() != eRebuildState::COMPLETED) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -87,7 +88,7 @@ void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
self->SetNetworkVar(u"used", true);
|
||||
|
||||
GameMessages::SendTerminateInteraction(player->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +114,7 @@ void ImgBrickConsoleQB::SmashCanister(Entity* self) {
|
||||
|
||||
const auto canisters = EntityManager::Instance()->GetEntitiesInGroup("Canister");
|
||||
for (auto* canister : canisters) {
|
||||
canister->Smash(canister->GetObjectID(), VIOLENT);
|
||||
canister->Smash(canister->GetObjectID(), eKillType::VIOLENT);
|
||||
}
|
||||
|
||||
const auto canister = dZoneManager::Instance()->GetSpawnersByName("BrickCanister");
|
||||
@@ -146,7 +147,7 @@ void ImgBrickConsoleQB::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
for (auto* console : consoles) {
|
||||
auto* consoleRebuildComponent = console->GetComponent<RebuildComponent>();
|
||||
|
||||
if (consoleRebuildComponent->GetState() != REBUILD_COMPLETED) {
|
||||
if (consoleRebuildComponent->GetState() != eRebuildState::COMPLETED) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -167,7 +168,7 @@ void ImgBrickConsoleQB::OnDie(Entity* self, Entity* killer) {
|
||||
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
|
||||
if (rebuildComponent->GetState() == REBUILD_COMPLETED) {
|
||||
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
||||
auto offFX = 0;
|
||||
|
||||
const auto location = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"console"));
|
||||
@@ -228,14 +229,14 @@ void ImgBrickConsoleQB::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "reset") {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
|
||||
if (rebuildComponent->GetState() == REBUILD_OPEN) {
|
||||
self->Smash(self->GetObjectID(), SILENT);
|
||||
if (rebuildComponent->GetState() == eRebuildState::OPEN) {
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
} else if (timerName == "Die") {
|
||||
const auto consoles = EntityManager::Instance()->GetEntitiesInGroup("Console");
|
||||
|
||||
for (auto* console : consoles) {
|
||||
console->Smash(console->GetObjectID(), VIOLENT);
|
||||
console->Smash(console->GetObjectID(), eKillType::VIOLENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ void RaceMaelstromGeiser::OnProximityUpdate(Entity* self, Entity* entering, std:
|
||||
}
|
||||
|
||||
|
||||
GameMessages::SendDie(vehicle, self->GetObjectID(), LWOOBJID_EMPTY, true, VIOLENT, u"", 0, 0, 0, true, false, 0);
|
||||
GameMessages::SendDie(vehicle, self->GetObjectID(), LWOOBJID_EMPTY, true, eKillType::VIOLENT, u"", 0, 0, 0, true, false, 0);
|
||||
|
||||
auto* zoneController = dZoneManager::Instance()->GetZoneControlObject();
|
||||
|
||||
|
@@ -2,6 +2,8 @@
|
||||
#include "GameMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "eTerminateType.h"
|
||||
#include "eStateChangeType.h"
|
||||
|
||||
void GfCaptainsCannon::OnUse(Entity* self, Entity* user) {
|
||||
if (self->GetVar<bool>(u"bIsInUse")) {
|
||||
@@ -78,6 +80,6 @@ void GfCaptainsCannon::OnTimerDone(Entity* self, std::string timerName) {
|
||||
missionComponent->ForceProgress(601, 910, 1);
|
||||
}
|
||||
|
||||
GameMessages::SendTerminateInteraction(playerId, FROM_INTERACTION, self->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(playerId, eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
}
|
||||
}
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include "RenderComponent.h"
|
||||
#include "eMissionTaskType.h"
|
||||
#include "eReplicaComponentType.h"
|
||||
#include "eTerminateType.h"
|
||||
|
||||
void GfTikiTorch::OnStartup(Entity* self) {
|
||||
LightTorch(self);
|
||||
@@ -33,7 +34,7 @@ void GfTikiTorch::OnTimerDone(Entity* self, std::string timerName) {
|
||||
Entity* player = EntityManager::Instance()->GetEntity(self->GetI64(u"userID"));
|
||||
|
||||
if (player != nullptr && player->GetCharacter()) {
|
||||
GameMessages::SendTerminateInteraction(player->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
}
|
||||
|
||||
self->SetBoolean(u"isInUse", false);
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Preconditions.h"
|
||||
#include "eEndBehavior.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "eStateChangeType.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define _USE_MATH_DEFINES
|
||||
|
@@ -7,7 +7,7 @@ void NjRailActivatorsServer::OnUse(Entity* self, Entity* user) {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
|
||||
// Only allow use if this is not a quick build or the quick build is built
|
||||
if (rebuildComponent == nullptr || rebuildComponent->GetState() == REBUILD_COMPLETED) {
|
||||
if (rebuildComponent == nullptr || rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
||||
auto* character = user->GetCharacter();
|
||||
if (character != nullptr) {
|
||||
character->SetPlayerFlag(flag, true);
|
||||
|
@@ -19,7 +19,7 @@ void NjRailPostServer::OnNotifyObject(Entity* self, Entity* sender, const std::s
|
||||
}
|
||||
|
||||
void NjRailPostServer::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == REBUILD_COMPLETED) {
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
auto* relatedRail = GetRelatedRail(self);
|
||||
if (relatedRail == nullptr)
|
||||
return;
|
||||
@@ -30,7 +30,7 @@ void NjRailPostServer::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
return;
|
||||
|
||||
self->SetNetworkVar(NetworkNotActiveVariable, false);
|
||||
} else if (state == REBUILD_RESETTING) {
|
||||
} else if (state == eRebuildState::RESETTING) {
|
||||
auto* relatedRail = GetRelatedRail(self);
|
||||
if (relatedRail == nullptr)
|
||||
return;
|
||||
|
@@ -5,5 +5,5 @@ void NjhubLavaPlayerDeathTrigger::OnCollisionPhantom(Entity* self, Entity* targe
|
||||
if (!target->IsPlayer())
|
||||
return;
|
||||
|
||||
target->Smash(self->GetObjectID(), VIOLENT, u"drown");
|
||||
target->Smash(self->GetObjectID(), eKillType::VIOLENT, u"drown");
|
||||
}
|
||||
|
@@ -97,7 +97,7 @@ void PetDigServer::OnDie(Entity* self, Entity* killer) {
|
||||
// Handles smashing leftovers (edge case for the AG X)
|
||||
auto* xObject = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"X"));
|
||||
if (xObject != nullptr) {
|
||||
xObject->Smash(xObject->GetObjectID(), VIOLENT);
|
||||
xObject->Smash(xObject->GetObjectID(), eKillType::VIOLENT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ void PetDigServer::HandleXBuildDig(const Entity* self, Entity* owner, Entity* pe
|
||||
|
||||
auto* player = playerEntity->GetCharacter();
|
||||
const auto groupID = self->GetVar<std::u16string>(u"groupID");
|
||||
auto playerFlag = 0;
|
||||
int32_t playerFlag = 0;
|
||||
|
||||
// The flag that the player dug up
|
||||
if (groupID == u"Flag1") {
|
||||
@@ -136,7 +136,7 @@ void PetDigServer::HandleXBuildDig(const Entity* self, Entity* owner, Entity* pe
|
||||
|
||||
auto* xObject = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"X"));
|
||||
if (xObject != nullptr) {
|
||||
xObject->Smash(xObject->GetObjectID(), VIOLENT);
|
||||
xObject->Smash(xObject->GetObjectID(), eKillType::VIOLENT);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,7 @@ void PropertyPlatform::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
|
||||
void PropertyPlatform::OnUse(Entity* self, Entity* user) {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
if (rebuildComponent != nullptr && rebuildComponent->GetState() == REBUILD_COMPLETED) {
|
||||
if (rebuildComponent != nullptr && rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
||||
// auto* movingPlatform = self->GetComponent<MovingPlatformComponent>();
|
||||
// if (movingPlatform != nullptr) {
|
||||
// movingPlatform->GotoWaypoint(1);
|
||||
|
@@ -3,6 +3,8 @@
|
||||
#include "GameMessages.h"
|
||||
#include "Character.h"
|
||||
#include "eReplicaComponentType.h"
|
||||
#include "eTerminateType.h"
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
//2021-05-03 - max - added script, omitted some parts related to inheritance in lua which we don't need
|
||||
|
||||
@@ -22,15 +24,15 @@ void TokenConsoleServer::OnUse(Entity* self, Entity* user) {
|
||||
if (!character) return;
|
||||
// At this point the player has to be in a faction.
|
||||
LOT tokenLOT = 0;
|
||||
if (character->GetPlayerFlag(ePlayerFlags::VENTURE_FACTION)) //venture
|
||||
if (character->GetPlayerFlag(ePlayerFlag::VENTURE_FACTION)) //venture
|
||||
tokenLOT = 8321;
|
||||
else if (character->GetPlayerFlag(ePlayerFlags::ASSEMBLY_FACTION)) //assembly
|
||||
else if (character->GetPlayerFlag(ePlayerFlag::ASSEMBLY_FACTION)) //assembly
|
||||
tokenLOT = 8318;
|
||||
else if (character->GetPlayerFlag(ePlayerFlags::PARADOX_FACTION)) //paradox
|
||||
else if (character->GetPlayerFlag(ePlayerFlag::PARADOX_FACTION)) //paradox
|
||||
tokenLOT = 8320;
|
||||
else if (character->GetPlayerFlag(ePlayerFlags::SENTINEL_FACTION)) //sentinel
|
||||
else if (character->GetPlayerFlag(ePlayerFlag::SENTINEL_FACTION)) //sentinel
|
||||
tokenLOT = 8319;
|
||||
inv->AddItem(tokenLOT, tokensToGive, eLootSourceType::LOOT_SOURCE_NONE);
|
||||
inv->AddItem(tokenLOT, tokensToGive, eLootSourceType::NONE);
|
||||
}
|
||||
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "GameMessages.h"
|
||||
#include "Loot.h"
|
||||
#include "EntityManager.h"
|
||||
#include "eTerminateType.h"
|
||||
|
||||
void WishingWellServer::OnStartup(Entity* self) {
|
||||
}
|
||||
|
@@ -4,6 +4,8 @@
|
||||
#include "Character.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "eTerminateType.h"
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
void NsTokenConsoleServer::OnStartup(Entity* self) {
|
||||
|
||||
@@ -16,7 +18,7 @@ void NsTokenConsoleServer::OnUse(Entity* self, Entity* user) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (rebuildComponent->GetState() != REBUILD_COMPLETED) {
|
||||
if (rebuildComponent->GetState() != eRebuildState::COMPLETED) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -42,20 +44,18 @@ void NsTokenConsoleServer::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
// Player must be in faction to interact with this entity.
|
||||
LOT tokenLOT = 0;
|
||||
|
||||
if (character->GetPlayerFlag(46)) {
|
||||
if (character->GetPlayerFlag(ePlayerFlag::VENTURE_FACTION)) //venture
|
||||
tokenLOT = 8321;
|
||||
} else if (character->GetPlayerFlag(47)) {
|
||||
else if (character->GetPlayerFlag(ePlayerFlag::ASSEMBLY_FACTION)) //assembly
|
||||
tokenLOT = 8318;
|
||||
} else if (character->GetPlayerFlag(48)) {
|
||||
else if (character->GetPlayerFlag(ePlayerFlag::PARADOX_FACTION)) //paradox
|
||||
tokenLOT = 8320;
|
||||
} else if (character->GetPlayerFlag(49)) {
|
||||
else if (character->GetPlayerFlag(ePlayerFlag::SENTINEL_FACTION)) //sentinel
|
||||
tokenLOT = 8319;
|
||||
}
|
||||
|
||||
inventoryComponent->AddItem(tokenLOT, 5, eLootSourceType::LOOT_SOURCE_NONE);
|
||||
inventoryComponent->AddItem(tokenLOT, 5, eLootSourceType::NONE);
|
||||
|
||||
missionComponent->ForceProgressTaskType(863, 1, 1, false);
|
||||
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
}
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include "eMissionTaskType.h"
|
||||
#include "eMissionState.h"
|
||||
#include "eEndBehavior.h"
|
||||
#include "eStateChangeType.h"
|
||||
|
||||
void NtAssemblyTubeServer::OnStartup(Entity* self) {
|
||||
self->SetProximityRadius(5, "teleport");
|
||||
|
@@ -42,5 +42,5 @@ void NtDirtCloudServer::OnSkillEventFired(Entity* self, Entity* caster, const st
|
||||
|
||||
self->SetVar(u"CloudOn", false);
|
||||
|
||||
self->Smash(self->GetObjectID(), VIOLENT);
|
||||
self->Smash(self->GetObjectID(), eKillType::VIOLENT);
|
||||
}
|
||||
|
@@ -2,12 +2,13 @@
|
||||
#include "InventoryComponent.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "eMissionState.h"
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
void NtDukeServer::SetVariables(Entity* self) {
|
||||
self->SetVar<float_t>(m_SpyProximityVariable, 35.0f);
|
||||
|
||||
self->SetVar<SpyData>(m_SpyDataVariable, {
|
||||
NT_FACTION_SPY_DUKE, 13548, 1319
|
||||
ePlayerFlag::NT_FACTION_SPY_DUKE, 13548, 1319
|
||||
});
|
||||
|
||||
self->SetVar<std::vector<SpyDialogue>>(m_SpyDialogueTableVariable, {
|
||||
@@ -31,7 +32,7 @@ void NtDukeServer::OnMissionDialogueOK(Entity* self, Entity* target, int mission
|
||||
auto lotCount = inventoryComponent->GetLotCount(m_SwordLot);
|
||||
|
||||
if ((state == eMissionState::AVAILABLE || state == eMissionState::ACTIVE) && lotCount < 1) {
|
||||
inventoryComponent->AddItem(m_SwordLot, 1, eLootSourceType::LOOT_SOURCE_NONE);
|
||||
inventoryComponent->AddItem(m_SwordLot, 1, eLootSourceType::NONE);
|
||||
} else if (state == eMissionState::READY_TO_COMPLETE) {
|
||||
inventoryComponent->RemoveItem(m_SwordLot, lotCount);
|
||||
}
|
||||
|
@@ -1,11 +1,12 @@
|
||||
#include "NtHaelServer.h"
|
||||
#include "Entity.h"
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
void NtHaelServer::SetVariables(Entity* self) {
|
||||
self->SetVar<float_t>(m_SpyProximityVariable, 25.0f);
|
||||
|
||||
self->SetVar<SpyData>(m_SpyDataVariable, {
|
||||
NT_FACTION_SPY_HAEL, 13892, 1321
|
||||
ePlayerFlag::NT_FACTION_SPY_HAEL, 13892, 1321
|
||||
});
|
||||
|
||||
self->SetVar<std::vector<SpyDialogue>>(m_SpyDialogueTableVariable, {
|
||||
|
@@ -2,10 +2,11 @@
|
||||
#include "GameMessages.h"
|
||||
#include "Entity.h"
|
||||
#include "Character.h"
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
void NTImagimeterVisibility::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
auto* character = target->GetCharacter();
|
||||
if (character) character->SetPlayerFlag(ePlayerFlags::NT_PLINTH_REBUILD, true);
|
||||
if (character) character->SetPlayerFlag(ePlayerFlag::NT_PLINTH_REBUILD, true);
|
||||
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"PlinthBuilt", 0, 0, LWOOBJID_EMPTY, "", target->GetSystemAddress());
|
||||
}
|
||||
|
@@ -1,11 +1,12 @@
|
||||
#include "NtOverbuildServer.h"
|
||||
#include "EntityManager.h"
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
void NtOverbuildServer::SetVariables(Entity* self) {
|
||||
self->SetVar<float_t>(m_SpyProximityVariable, 30.0f);
|
||||
|
||||
self->SetVar<SpyData>(m_SpyDataVariable, {
|
||||
NT_FACTION_SPY_OVERBUILD, 13891, 1320
|
||||
ePlayerFlag::NT_FACTION_SPY_OVERBUILD, 13891, 1320
|
||||
});
|
||||
|
||||
self->SetVar<std::vector<SpyDialogue>>(m_SpyDialogueTableVariable, {
|
||||
|
@@ -4,6 +4,8 @@
|
||||
#include "EntityManager.h"
|
||||
#include "Character.h"
|
||||
#include "eMissionState.h"
|
||||
#include "eTerminateType.h"
|
||||
#include "eStateChangeType.h"
|
||||
|
||||
void NtParadoxPanelServer::OnUse(Entity* self, Entity* user) {
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"bActive", 1, 0, user->GetObjectID(), "", user->GetSystemAddress());
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "EntityManager.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "eMissionTaskType.h"
|
||||
#include "eStateChangeType.h"
|
||||
|
||||
void NtParadoxTeleServer::OnStartup(Entity* self) {
|
||||
self->SetProximityRadius(5, "teleport");
|
||||
|
@@ -2,6 +2,8 @@
|
||||
#include "GameMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "eEndBehavior.h"
|
||||
#include "eTerminateType.h"
|
||||
#include "eStateChangeType.h"
|
||||
|
||||
void NtVentureCannonServer::OnUse(Entity* self, Entity* user) {
|
||||
auto* player = user;
|
||||
@@ -99,7 +101,7 @@ void NtVentureCannonServer::UnlockCannonPlayer(Entity* self, Entity* player) {
|
||||
|
||||
self->SetNetworkVar(u"bIsInUse", false);
|
||||
|
||||
GameMessages::SendTerminateInteraction(player->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
}
|
||||
|
||||
void NtVentureCannonServer::FirePlayer(Entity* self, Entity* player) {
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "GameMessages.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "eMissionState.h"
|
||||
#include "eTerminateType.h"
|
||||
|
||||
void SpawnGryphonServer::SetVariables(Entity* self) {
|
||||
self->SetVar<LOT>(u"petLOT", 12433);
|
||||
@@ -20,7 +21,7 @@ void SpawnGryphonServer::OnUse(Entity* self, Entity* user) {
|
||||
if (missionComponent != nullptr && inventoryComponent != nullptr
|
||||
&& missionComponent->GetMissionState(1391) == eMissionState::ACTIVE) {
|
||||
inventoryComponent->RemoveItem(12483, inventoryComponent->GetLotCount(12483));
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -413,7 +413,7 @@ void ZoneAgProperty::BaseOnFireEventServerSide(Entity* self, Entity* sender, std
|
||||
if (player == nullptr)
|
||||
return;
|
||||
|
||||
player->GetCharacter()->SetPlayerFlag(self->GetVar<uint32_t>(defeatedProperyFlag), true);
|
||||
player->GetCharacter()->SetPlayerFlag(self->GetVar<int32_t>(defeatedProperyFlag), true);
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"PlayCinematic", 0, 0,
|
||||
LWOOBJID_EMPTY, destroyedCinematic, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
|
@@ -29,8 +29,8 @@ void ZoneNsMedProperty::SetGameVariables(Entity* self) {
|
||||
self->SetVar<std::vector<std::string>>(AmbientFXSpawner, { "Rockets" });
|
||||
self->SetVar<std::vector<std::string>>(BehaviorObjsSpawner, { });
|
||||
|
||||
self->SetVar<uint32_t>(defeatedProperyFlag, 122);
|
||||
self->SetVar<uint32_t>(placedModelFlag, 123);
|
||||
self->SetVar<int32_t>(defeatedProperyFlag, 122);
|
||||
self->SetVar<int32_t>(placedModelFlag, 123);
|
||||
self->SetVar<uint32_t>(guardMissionFlag, 1322);
|
||||
self->SetVar<uint32_t>(brickLinkMissionIDFlag, 1294);
|
||||
self->SetVar<std::string>(passwordFlag, "s3kratK1ttN");
|
||||
|
@@ -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::LOOT_SOURCE_ACTIVITY);
|
||||
inventoryComponent->AddItem(loot, 1, eLootSourceType::ACTIVITY);
|
||||
|
||||
for (auto* brickEntity : EntityManager::Instance()->GetEntitiesInGroup("Bricks")) {
|
||||
GameMessages::SendNotifyClientObject(brickEntity->GetObjectID(), u"Pickedup");
|
||||
|
@@ -5,6 +5,6 @@ class VeEpsilonServer : public CppScripts::Script {
|
||||
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) override;
|
||||
const uint32_t m_ConsoleMissionID = 1220;
|
||||
const uint32_t m_ConsoleRepeatMissionID = 1225;
|
||||
const uint32_t m_ConsoleBaseFlag = 1010;
|
||||
const int32_t m_ConsoleBaseFlag = 1010;
|
||||
const std::string m_ConsoleGroup = "Consoles";
|
||||
};
|
||||
|
@@ -3,18 +3,19 @@
|
||||
#include "Character.h"
|
||||
#include "GameMessages.h"
|
||||
#include "Loot.h"
|
||||
#include "eTerminateType.h"
|
||||
|
||||
void VeMissionConsole::OnUse(Entity* self, Entity* user) {
|
||||
LootGenerator::Instance().DropActivityLoot(user, self, 12551);
|
||||
|
||||
auto* inventoryComponent = user->GetComponent<InventoryComponent>();
|
||||
if (inventoryComponent != nullptr) {
|
||||
inventoryComponent->AddItem(12547, 1, eLootSourceType::LOOT_SOURCE_ACTIVITY); // 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>
|
||||
const auto flagNumber = self->GetVar<std::u16string>(m_NumberVariable);
|
||||
const auto flag = std::stoi("101" + GeneralUtils::UTF16ToWTF8(flagNumber));
|
||||
const int32_t flag = std::stoi("101" + GeneralUtils::UTF16ToWTF8(flagNumber));
|
||||
|
||||
auto* character = user->GetCharacter();
|
||||
if (character != nullptr) {
|
||||
@@ -22,5 +23,5 @@ void VeMissionConsole::OnUse(Entity* self, Entity* user) {
|
||||
}
|
||||
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"");
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
}
|
||||
|
@@ -59,6 +59,6 @@ void CatapultBaseServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
// kill the bouncer
|
||||
GameMessages::SendNotifyClientObject(bouncer->GetObjectID(), u"TimeToDie");
|
||||
bouncer->Smash(self->GetObjectID(), VIOLENT);
|
||||
bouncer->Smash(self->GetObjectID(), eKillType::VIOLENT);
|
||||
}
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ void CavePrisonCage::Setup(Entity* self, Spawner* spawner) {
|
||||
}
|
||||
|
||||
void CavePrisonCage::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state != eRebuildState::REBUILD_RESETTING) {
|
||||
if (state != eRebuildState::RESETTING) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -9,7 +9,7 @@ void ImaginationShrineServer::OnUse(Entity* self, Entity* user) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (rebuildComponent->GetState() == REBUILD_COMPLETED) {
|
||||
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
||||
// Use the shrine
|
||||
BaseUse(self, user);
|
||||
}
|
||||
|
@@ -44,6 +44,6 @@ void NjColeNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID,
|
||||
return;
|
||||
}
|
||||
|
||||
inventoryComponent->AddItem(16644, 1, eLootSourceType::LOOT_SOURCE_NONE);
|
||||
inventoryComponent->AddItem(16644, 1, eLootSourceType::NONE);
|
||||
}
|
||||
}
|
||||
|
@@ -4,11 +4,12 @@
|
||||
#include "Loot.h"
|
||||
#include "Entity.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
void NjDragonEmblemChestServer::OnUse(Entity* self, Entity* user) {
|
||||
auto* character = user->GetCharacter();
|
||||
if (character != nullptr) {
|
||||
character->SetPlayerFlag(NJ_WU_SHOW_DAILY_CHEST, false);
|
||||
character->SetPlayerFlag(ePlayerFlag::NJ_WU_SHOW_DAILY_CHEST, false);
|
||||
}
|
||||
|
||||
auto* destroyable = self->GetComponent<DestroyableComponent>();
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include "NjGarmadonCelebration.h"
|
||||
#include "Character.h"
|
||||
#include "GameMessages.h"
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
void NjGarmadonCelebration::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
auto* character = target->GetCharacter();
|
||||
@@ -9,8 +10,8 @@ void NjGarmadonCelebration::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!character->GetPlayerFlag(ePlayerFlags::NJ_GARMADON_CINEMATIC_SEEN)) {
|
||||
character->SetPlayerFlag(ePlayerFlags::NJ_GARMADON_CINEMATIC_SEEN, true);
|
||||
if (!character->GetPlayerFlag(ePlayerFlag::NJ_GARMADON_CINEMATIC_SEEN)) {
|
||||
character->SetPlayerFlag(ePlayerFlag::NJ_GARMADON_CINEMATIC_SEEN, true);
|
||||
|
||||
GameMessages::SendStartCelebrationEffect(target, target->GetSystemAddress(), GarmadonCelebrationID);
|
||||
}
|
||||
|
@@ -1,12 +1,13 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
#include <map>
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
static std::map<std::u16string, uint32_t> ElementFlags = {
|
||||
{u"earth", ePlayerFlags::NJ_EARTH_SPINJITZU},
|
||||
{u"lightning", ePlayerFlags::NJ_LIGHTNING_SPINJITZU},
|
||||
{u"ice", ePlayerFlags::NJ_ICE_SPINJITZU},
|
||||
{u"fire", ePlayerFlags::NJ_FIRE_SPINJITZU}
|
||||
static std::map<std::u16string, ePlayerFlag> ElementFlags = {
|
||||
{u"earth", ePlayerFlag::NJ_EARTH_SPINJITZU},
|
||||
{u"lightning", ePlayerFlag::NJ_LIGHTNING_SPINJITZU},
|
||||
{u"ice", ePlayerFlag::NJ_ICE_SPINJITZU},
|
||||
{u"fire", ePlayerFlag::NJ_FIRE_SPINJITZU}
|
||||
};
|
||||
|
||||
static std::map<std::u16string, uint32_t> ElementMissions = {
|
||||
|
@@ -12,6 +12,6 @@ void NjScrollChestServer::OnUse(Entity* self, Entity* user) {
|
||||
playerInventory->RemoveItem(keyLOT, 1);
|
||||
|
||||
// Reward the player with the item set
|
||||
playerInventory->AddItem(rewardItemLOT, 1, eLootSourceType::LOOT_SOURCE_NONE);
|
||||
playerInventory->AddItem(rewardItemLOT, 1, eLootSourceType::NONE);
|
||||
}
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "eMissionState.h"
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
void NjWuNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
|
||||
|
||||
@@ -24,7 +25,7 @@ void NjWuNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, e
|
||||
missionComponent->AcceptMission(subMissionID);
|
||||
}
|
||||
|
||||
character->SetPlayerFlag(ePlayerFlags::NJ_WU_SHOW_DAILY_CHEST, false);
|
||||
character->SetPlayerFlag(ePlayerFlag::NJ_WU_SHOW_DAILY_CHEST, false);
|
||||
|
||||
// Hide the chest
|
||||
for (auto* chest : EntityManager::Instance()->GetEntitiesInGroup(m_DragonChestGroup)) {
|
||||
@@ -37,7 +38,7 @@ void NjWuNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, e
|
||||
case eMissionState::READY_TO_COMPLETE:
|
||||
case eMissionState::COMPLETE_READY_TO_COMPLETE:
|
||||
{
|
||||
character->SetPlayerFlag(NJ_WU_SHOW_DAILY_CHEST, true);
|
||||
character->SetPlayerFlag(ePlayerFlag::NJ_WU_SHOW_DAILY_CHEST, true);
|
||||
|
||||
// Show the chest
|
||||
for (auto* chest : EntityManager::Instance()->GetEntitiesInGroup(m_DragonChestGroup)) {
|
||||
|
@@ -225,21 +225,21 @@ void NjMonastryBossInstance::HandleCounterWeightSpawned(Entity* self, Entity* co
|
||||
rebuildComponent->AddRebuildStateCallback([this, self, counterWeight](eRebuildState state) {
|
||||
|
||||
switch (state) {
|
||||
case REBUILD_BUILDING:
|
||||
case eRebuildState::BUILDING:
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification,
|
||||
0, 0, counterWeight->GetObjectID(),
|
||||
BaseCounterweightQB + std::to_string(self->GetVar<uint32_t>(WaveNumberVariable)),
|
||||
UNASSIGNED_SYSTEM_ADDRESS);
|
||||
return;
|
||||
case REBUILD_INCOMPLETE:
|
||||
case eRebuildState::INCOMPLETE:
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), EndCinematicNotification,
|
||||
0, 0, LWOOBJID_EMPTY, "",
|
||||
UNASSIGNED_SYSTEM_ADDRESS);
|
||||
return;
|
||||
case REBUILD_RESETTING:
|
||||
case eRebuildState::RESETTING:
|
||||
ActivityTimerStart(self, SpawnCounterWeightTimer, 0.0f, 0.0f);
|
||||
return;
|
||||
case REBUILD_COMPLETED: {
|
||||
case eRebuildState::COMPLETED: {
|
||||
// TODO: Move the platform?
|
||||
|
||||
// The counterweight is actually a moving platform and we should listen to the last waypoint event here
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "DestroyableComponent.h"
|
||||
#include "BaseCombatAIComponent.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "ePetTamingNotifyType.h"
|
||||
|
||||
void DamagingPets::OnStartup(Entity* self) {
|
||||
|
||||
@@ -33,15 +34,15 @@ void DamagingPets::OnPlayerLoaded(Entity* self, Entity* player) {
|
||||
});
|
||||
}
|
||||
|
||||
void DamagingPets::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) {
|
||||
void DamagingPets::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) {
|
||||
switch (type) {
|
||||
case NOTIFY_TYPE_SUCCESS:
|
||||
case NOTIFY_TYPE_BEGIN:
|
||||
case ePetTamingNotifyType::SUCCESS:
|
||||
case ePetTamingNotifyType::BEGIN:
|
||||
self->CancelAllTimers();
|
||||
ClearEffects(self);
|
||||
break;
|
||||
case NOTIFY_TYPE_FAILED:
|
||||
case NOTIFY_TYPE_QUIT:
|
||||
case ePetTamingNotifyType::FAILED:
|
||||
case ePetTamingNotifyType::QUIT:
|
||||
{
|
||||
self->SetNetworkVar<bool>(u"bIAmTamable", false);
|
||||
self->AddTimer("GoEvil", 1.0f);
|
||||
|
@@ -13,7 +13,7 @@ class DamagingPets : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnTimerDone(Entity* self, std::string message) override;
|
||||
void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) override;
|
||||
void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) override;
|
||||
void OnSkillEventFired(Entity* self, Entity* target, const std::string& message) override;
|
||||
void OnPlayerLoaded(Entity* self, Entity* player) override;
|
||||
private:
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#include "PetFromDigServer.h"
|
||||
#include "PetComponent.h"
|
||||
#include "ePetTamingNotifyType.h"
|
||||
|
||||
void PetFromDigServer::OnStartup(Entity* self) {
|
||||
auto* petComponent = self->GetComponent<PetComponent>();
|
||||
@@ -24,16 +25,16 @@ void PetFromDigServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (petComponent == nullptr || petComponent->GetOwner() != nullptr)
|
||||
return;
|
||||
|
||||
self->Smash(self->GetObjectID(), SILENT);
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
}
|
||||
|
||||
void PetFromDigServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) {
|
||||
if (type == NOTIFY_TYPE_BEGIN) {
|
||||
void PetFromDigServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) {
|
||||
if (type == ePetTamingNotifyType::BEGIN) {
|
||||
self->CancelTimer("killself");
|
||||
} else if (type == NOTIFY_TYPE_QUIT || type == NOTIFY_TYPE_FAILED) {
|
||||
self->Smash(self->GetObjectID(), SILENT);
|
||||
} else if (type == NOTIFY_TYPE_SUCCESS) {
|
||||
} else if (type == ePetTamingNotifyType::QUIT || type == ePetTamingNotifyType::FAILED) {
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
} else if (type == ePetTamingNotifyType::SUCCESS) {
|
||||
auto* petComponent = self->GetComponent<PetComponent>();
|
||||
if (petComponent == nullptr)
|
||||
return;
|
||||
|
@@ -6,5 +6,5 @@ class PetFromDigServer : public CppScripts::Script
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) override;
|
||||
void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) override;
|
||||
};
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#include "PetFromObjectServer.h"
|
||||
#include "PetComponent.h"
|
||||
#include "ePetTamingNotifyType.h"
|
||||
|
||||
void PetFromObjectServer::OnStartup(Entity* self) {
|
||||
self->SetNetworkVar(u"pettamer", std::to_string(self->GetVar<LWOOBJID>(u"tamer")));
|
||||
@@ -11,20 +12,20 @@ void PetFromObjectServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
const auto* petComponent = self->GetComponent<PetComponent>();
|
||||
if (petComponent == nullptr || petComponent->GetOwner() != nullptr)
|
||||
return;
|
||||
self->Smash(self->GetObjectID(), SILENT);
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
}
|
||||
|
||||
void PetFromObjectServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) {
|
||||
void PetFromObjectServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) {
|
||||
switch (type) {
|
||||
case NOTIFY_TYPE_BEGIN:
|
||||
case ePetTamingNotifyType::BEGIN:
|
||||
self->CancelAllTimers();
|
||||
break;
|
||||
case NOTIFY_TYPE_QUIT:
|
||||
case NOTIFY_TYPE_FAILED:
|
||||
self->Smash(self->GetObjectID(), SILENT);
|
||||
case ePetTamingNotifyType::QUIT:
|
||||
case ePetTamingNotifyType::FAILED:
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
break;
|
||||
case NOTIFY_TYPE_SUCCESS:
|
||||
case ePetTamingNotifyType::SUCCESS:
|
||||
// TODO: Remove from groups?
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"UpdateSuccessPicking", 0,
|
||||
0, tamer->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
@@ -5,5 +5,5 @@ class PetFromObjectServer : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) override;
|
||||
void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) override;
|
||||
};
|
||||
|
Reference in New Issue
Block a user