mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
Merge remote-tracking branch 'upstream/main' into first-draft-leaderboard-re-write
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;
|
||||
};
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#include "BaseConsoleTeleportServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "Player.h"
|
||||
#include "eTerminateType.h"
|
||||
#include "eStateChangeType.h"
|
||||
|
||||
void BaseConsoleTeleportServer::BaseOnUse(Entity* self, Entity* user) {
|
||||
auto* player = user;
|
||||
@@ -52,7 +54,7 @@ void BaseConsoleTeleportServer::BaseOnMessageBoxResponse(Entity* self, Entity* s
|
||||
GameMessages::SendDisplayZoneSummary(playerID, player->GetSystemAddress(), false, false, self->GetObjectID());
|
||||
});
|
||||
} else if (button == -1 || button == 0) {
|
||||
GameMessages::SendTerminateInteraction(player->GetObjectID(), FROM_INTERACTION, player->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, player->GetObjectID());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +90,7 @@ void BaseConsoleTeleportServer::TransferPlayer(Entity* self, Entity* player, int
|
||||
true, true, true, true, true, true, true
|
||||
);
|
||||
|
||||
GameMessages::SendTerminateInteraction(player->GetObjectID(), FROM_INTERACTION, player->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, player->GetObjectID());
|
||||
|
||||
const auto& teleportZone = self->GetVar<std::u16string>(u"transferZoneID");
|
||||
|
||||
|
@@ -127,7 +127,7 @@ void BasePropertyServer::BasePlayerLoaded(Entity* self, Entity* player) {
|
||||
if (player->GetObjectID() != propertyOwner)
|
||||
return;
|
||||
} else {
|
||||
const auto defeatedFlag = player->GetCharacter()->GetPlayerFlag(self->GetVar<uint32_t>(defeatedProperyFlag));
|
||||
const auto defeatedFlag = player->GetCharacter()->GetPlayerFlag(self->GetVar<int32_t>(defeatedProperyFlag));
|
||||
|
||||
self->SetNetworkVar(UnclaimedVariable, true);
|
||||
self->SetVar<LWOOBJID>(PlayerIDVariable, player->GetObjectID());
|
||||
@@ -274,7 +274,7 @@ void BasePropertyServer::RequestDie(Entity* self, Entity* other) {
|
||||
if (destroyable == nullptr)
|
||||
return;
|
||||
|
||||
destroyable->Smash(other->GetObjectID(), SILENT);
|
||||
destroyable->Smash(other->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
|
||||
void BasePropertyServer::ActivateSpawner(const std::string& spawnerName) {
|
||||
@@ -464,7 +464,7 @@ void BasePropertyServer::HandleOrbsTimer(Entity* self) {
|
||||
if (player != nullptr) {
|
||||
auto* character = player->GetCharacter();
|
||||
if (character != nullptr) {
|
||||
character->SetPlayerFlag(self->GetVar<uint32_t>(defeatedProperyFlag), true);
|
||||
character->SetPlayerFlag(self->GetVar<int32_t>(defeatedProperyFlag), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include "ChooseYourDestinationNsToNt.h"
|
||||
#include "Character.h"
|
||||
#include "GameMessages.h"
|
||||
#include "eTerminateType.h"
|
||||
|
||||
bool ChooseYourDestinationNsToNt::CheckChoice(Entity* self, Entity* player) {
|
||||
const auto choiceZoneID = self->GetVar<int32_t>(u"choiceZone");
|
||||
@@ -59,6 +60,6 @@ void ChooseYourDestinationNsToNt::BaseChoiceBoxRespond(Entity* self, Entity* sen
|
||||
|
||||
GameMessages::SendDisplayMessageBox(sender->GetObjectID(), true, self->GetObjectID(), u"TransferBox", 0, strText, u"", sender->GetSystemAddress());
|
||||
} else {
|
||||
GameMessages::SendTerminateInteraction(sender->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(sender->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
}
|
||||
}
|
||||
|
@@ -8,6 +8,8 @@ class User;
|
||||
class Entity;
|
||||
class NiPoint3;
|
||||
enum class eMissionState : int32_t;
|
||||
enum class ePetTamingNotifyType : uint32_t;
|
||||
enum class eRebuildState : uint32_t;
|
||||
|
||||
namespace CppScripts {
|
||||
/**
|
||||
@@ -269,7 +271,7 @@ namespace CppScripts {
|
||||
*
|
||||
* Equivalent to 'function onNotifyPetTamingMinigame(self, msg)'
|
||||
*/
|
||||
virtual void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) {};
|
||||
virtual void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) {};
|
||||
|
||||
/**
|
||||
* Invoked when a player responded to a message box.
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "DestroyableComponent.h"
|
||||
#include "ControllablePhysicsComponent.h"
|
||||
#include "EntityManager.h"
|
||||
#include "eStateChangeType.h"
|
||||
|
||||
void PersonalFortress::OnStartup(Entity* self) {
|
||||
auto* owner = self->GetOwner();
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include "StunImmunity.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "ControllablePhysicsComponent.h"
|
||||
#include "eStateChangeType.h"
|
||||
|
||||
void StunImmunity::OnStartup(Entity* self) {
|
||||
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||
|
@@ -12,7 +12,7 @@ void NPCAddRemoveItem::OnMissionDialogueOK(Entity* self, Entity* target, int mis
|
||||
for (const auto& itemSetting : missionSetting.second) {
|
||||
for (const auto& lot : itemSetting.items) {
|
||||
if (itemSetting.add && (missionState == eMissionState::AVAILABLE || missionState == eMissionState::COMPLETE_AVAILABLE)) {
|
||||
inventory->AddItem(lot, 1, eLootSourceType::LOOT_SOURCE_NONE);
|
||||
inventory->AddItem(lot, 1, eLootSourceType::NONE);
|
||||
} else if (itemSetting.remove && (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE)) {
|
||||
inventory->RemoveItem(lot, 1);
|
||||
}
|
||||
|
@@ -6,6 +6,8 @@
|
||||
#include "MissionComponent.h"
|
||||
#include "eMissionState.h"
|
||||
#include "eReplicaComponentType.h"
|
||||
#include "eCinematicEvent.h"
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
void NtFactionSpyServer::OnStartup(Entity* self) {
|
||||
SetVariables(self);
|
||||
@@ -77,14 +79,14 @@ void NtFactionSpyServer::OnCinematicUpdate(Entity* self, Entity* sender, eCinema
|
||||
|
||||
// Make sure we're listening to the root we're interested in
|
||||
if (pathRoot == cinematicRoot) {
|
||||
if (event == STARTED && pathIndex >= 0 && pathIndex < dialogueTable.size()) {
|
||||
if (event == eCinematicEvent::STARTED && pathIndex >= 0 && pathIndex < dialogueTable.size()) {
|
||||
|
||||
// If the cinematic started, show part of the conversation
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), m_SpyDialogueNotification, 0,
|
||||
0, ParamObjectForConversationID(self, dialogueTable.at(pathIndex).conversationID),
|
||||
dialogueTable.at(pathIndex).token, sender->GetSystemAddress());
|
||||
|
||||
} else if (event == ENDED && pathIndex >= dialogueTable.size() - 1) {
|
||||
} else if (event == eCinematicEvent::ENDED && pathIndex >= dialogueTable.size() - 1) {
|
||||
auto spyData = self->GetVar<SpyData>(m_SpyDataVariable);
|
||||
auto* character = sender->GetCharacter();
|
||||
if (character != nullptr) {
|
||||
|
@@ -7,7 +7,7 @@ struct SpyDialogue {
|
||||
};
|
||||
|
||||
struct SpyData {
|
||||
uint32_t flagID;
|
||||
int32_t flagID;
|
||||
LOT itemID;
|
||||
uint32_t missionID;
|
||||
};
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "EntityManager.h"
|
||||
#include "PetComponent.h"
|
||||
#include "EntityInfo.h"
|
||||
#include "eTerminateType.h"
|
||||
|
||||
void SpawnPetBaseServer::OnStartup(Entity* self) {
|
||||
SetVariables(self);
|
||||
@@ -43,7 +44,7 @@ void SpawnPetBaseServer::OnUse(Entity* self, Entity* user) {
|
||||
GameMessages::SendPlayCinematic(user->GetObjectID(), spawnCinematic, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
}
|
||||
|
||||
bool SpawnPetBaseServer::CheckNumberOfPets(Entity* self, Entity* user) {
|
||||
|
@@ -9,7 +9,7 @@ void ActMine::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
void ActMine::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == eRebuildState::REBUILD_COMPLETED) {
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
auto* rebuild = self->GetComponent<RebuildComponent>();
|
||||
if (rebuild) {
|
||||
auto* builder = rebuild->GetBuilder();
|
||||
|
@@ -40,7 +40,7 @@ void ActVehicleDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
|
||||
|
@@ -37,7 +37,7 @@ void BaseFootRaceManager::OnFireEventServerSide(Entity* self, Entity* sender, st
|
||||
if (character != nullptr) {
|
||||
character->SetPlayerFlag(115, false);
|
||||
if (param2 != -1) // Certain footraces set a flag
|
||||
character->SetPlayerFlag(param2, true);
|
||||
character->SetPlayerFlag(static_cast<uint32_t>(param2), true);
|
||||
}
|
||||
|
||||
StopActivity(self, player->GetObjectID(), 0, param1);
|
||||
|
@@ -5,113 +5,55 @@
|
||||
#include "eReplicaComponentType.h"
|
||||
|
||||
void AgJetEffectServer::OnUse(Entity* self, Entity* user) {
|
||||
if (inUse) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (inUse || self->GetLOT() != 6859) return;
|
||||
GameMessages::SendNotifyClientObject(
|
||||
self->GetObjectID(),
|
||||
u"isInUse",
|
||||
0,
|
||||
0,
|
||||
LWOOBJID_EMPTY,
|
||||
"",
|
||||
UNASSIGNED_SYSTEM_ADDRESS
|
||||
self->GetObjectID(), u"toggleInUse", 1, 0, LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS
|
||||
);
|
||||
|
||||
inUse = true;
|
||||
|
||||
auto entities = EntityManager::Instance()->GetEntitiesInGroup("Jet_FX");
|
||||
|
||||
if (entities.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto* effect = entities[0];
|
||||
|
||||
GameMessages::SendPlayFXEffect(effect, 641, u"create", "radarDish", LWOOBJID_EMPTY, 1, 1, true);
|
||||
|
||||
self->AddTimer("radarDish", 2);
|
||||
self->AddTimer("CineDone", 9);
|
||||
if (entities.empty()) return;
|
||||
GameMessages::SendPlayFXEffect(entities.at(0), 641, u"create", "radarDish", LWOOBJID_EMPTY, 1, 1, true);
|
||||
self->AddTimer("radarDish", 2.0f);
|
||||
self->AddTimer("PlayEffect", 2.5f);
|
||||
self->AddTimer("CineDone", 7.5f + 5.0f); // 7.5f is time the cinematic takes to play
|
||||
}
|
||||
|
||||
void AgJetEffectServer::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
if (self->GetLOT() != 6209) return;
|
||||
auto entities = EntityManager::Instance()->GetEntitiesInGroup("Jet_FX");
|
||||
if (entities.empty()) return;
|
||||
GameMessages::SendPlayAnimation(entities.at(0), u"jetFX");
|
||||
|
||||
if (entities.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto* effect = entities[0];
|
||||
|
||||
auto groups = self->GetGroups();
|
||||
|
||||
if (groups.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// So we can give kill credit to person who build this
|
||||
builder = target->GetObjectID();
|
||||
|
||||
const auto group = groups[0];
|
||||
|
||||
GameMessages::SendPlayAnimation(effect, u"jetFX");
|
||||
|
||||
self->AddTimer("PlayEffect", 2.5f);
|
||||
|
||||
if (group == "Base_Radar") {
|
||||
self->AddTimer("CineDone", 5);
|
||||
auto groups = self->GetGroups();
|
||||
if (!groups.empty() && groups.at(0) == "Base_Radar") {
|
||||
self->AddTimer("PlayEffect", 2.5f);
|
||||
self->AddTimer("CineDone", 7.5f + 5.0f); // 7.5f is time the cinematic takes to play
|
||||
}
|
||||
}
|
||||
|
||||
void AgJetEffectServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "radarDish") {
|
||||
GameMessages::SendStopFXEffect(self, true, "radarDish");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (timerName == "PlayEffect") {
|
||||
} else if (timerName == "PlayEffect") {
|
||||
auto entities = EntityManager::Instance()->GetEntitiesInGroup("mortarMain");
|
||||
if (entities.empty()) return;
|
||||
|
||||
if (entities.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto size = entities.size();
|
||||
|
||||
if (size == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto selected = GeneralUtils::GenerateRandomNumber<int>(0, size - 1);
|
||||
|
||||
auto* mortar = entities[selected];
|
||||
|
||||
Game::logger->Log("AgJetEffectServer", "Mortar (%i) (&d)", mortar->GetLOT(), mortar->HasComponent(eReplicaComponentType::SKILL));
|
||||
const auto selected = GeneralUtils::GenerateRandomNumber<int>(0, entities.size() - 1);
|
||||
auto* mortar = entities.at(selected);
|
||||
|
||||
// so we give proper credit to the builder for the kills from this skill
|
||||
mortar->SetOwnerOverride(builder);
|
||||
|
||||
SkillComponent* skillComponent;
|
||||
if (!mortar->TryGetComponent(eReplicaComponentType::SKILL, skillComponent)) {
|
||||
return;
|
||||
}
|
||||
|
||||
skillComponent->CalculateBehavior(318, 3727, LWOOBJID_EMPTY, true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (timerName == "CineDone") {
|
||||
auto* skillComponent = mortar->GetComponent<SkillComponent>();
|
||||
if (skillComponent) skillComponent->CastSkill(318);
|
||||
} else if (timerName == "CineDone") {
|
||||
GameMessages::SendNotifyClientObject(
|
||||
self->GetObjectID(),
|
||||
u"toggleInUse",
|
||||
-1,
|
||||
0,
|
||||
LWOOBJID_EMPTY,
|
||||
"",
|
||||
UNASSIGNED_SYSTEM_ADDRESS
|
||||
self->GetObjectID(), u"toggleInUse", -1, 0, LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS
|
||||
);
|
||||
|
||||
inUse = false;
|
||||
}
|
||||
}
|
||||
|
@@ -2,9 +2,10 @@
|
||||
#include "Loot.h"
|
||||
#include "GameMessages.h"
|
||||
#include "Entity.h"
|
||||
#include "eTerminateType.h"
|
||||
|
||||
void AgPicnicBlanket::OnUse(Entity* self, Entity* user) {
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
if (self->GetVar<bool>(u"active"))
|
||||
return;
|
||||
self->SetVar<bool>(u"active", true);
|
||||
|
@@ -49,7 +49,7 @@ void AgQbElevator::OnTimerDone(Entity* self, std::string timerName) {
|
||||
} else if (timerName == "startKillTimer") {
|
||||
killTimerStartup(self);
|
||||
} else if (timerName == "KillTimer") {
|
||||
self->Smash(self->GetObjectID(), VIOLENT);
|
||||
self->Smash(self->GetObjectID(), eKillType::VIOLENT);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#include "AgShipPlayerShockServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "eTerminateType.h"
|
||||
|
||||
void AgShipPlayerShockServer::OnUse(Entity* self, Entity* user) {
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
|
@@ -1,9 +1,10 @@
|
||||
#include "ActNinjaTurret.h"
|
||||
#include "eRebuildState.h"
|
||||
|
||||
void ActNinjaTurret::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == eRebuildState::REBUILD_COMPLETED) {
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
self->SetVar(u"AmBuilt", true);
|
||||
} else if (state == eRebuildState::REBUILD_RESETTING) {
|
||||
} else if (state == eRebuildState::RESETTING) {
|
||||
self->SetVar(u"AmBuilt", false);
|
||||
}
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ void ActParadoxPipeFix::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
|
||||
auto* rebuildComponent = object->GetComponent<RebuildComponent>();
|
||||
|
||||
if (rebuildComponent->GetState() == REBUILD_COMPLETED) {
|
||||
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
||||
indexCount++;
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ void ActParadoxPipeFix::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
}
|
||||
|
||||
void ActParadoxPipeFix::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == REBUILD_RESETTING) {
|
||||
if (state == eRebuildState::RESETTING) {
|
||||
const auto refinery = EntityManager::Instance()->GetEntitiesInGroup("Paradox");
|
||||
|
||||
if (!refinery.empty()) {
|
||||
|
@@ -61,8 +61,8 @@ void FvBrickPuzzleServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "reset") {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
|
||||
if (rebuildComponent != nullptr && rebuildComponent->GetState() == REBUILD_OPEN) {
|
||||
self->Smash(self->GetObjectID(), SILENT);
|
||||
if (rebuildComponent != nullptr && rebuildComponent->GetState() == eRebuildState::OPEN) {
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#include "FvConsoleLeftQuickbuild.h"
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "eTerminateType.h"
|
||||
#include "eRebuildState.h"
|
||||
|
||||
void FvConsoleLeftQuickbuild::OnStartup(Entity* self) {
|
||||
self->SetVar(u"IAmBuilt", false);
|
||||
@@ -8,7 +10,7 @@ void FvConsoleLeftQuickbuild::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
void FvConsoleLeftQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == REBUILD_COMPLETED) {
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
self->SetVar(u"IAmBuilt", true);
|
||||
|
||||
const auto objects = EntityManager::Instance()->GetEntitiesInGroup("Facility");
|
||||
@@ -16,7 +18,7 @@ void FvConsoleLeftQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState s
|
||||
if (!objects.empty()) {
|
||||
objects[0]->NotifyObject(self, "ConsoleLeftUp");
|
||||
}
|
||||
} else if (state == REBUILD_RESETTING) {
|
||||
} else if (state == eRebuildState::RESETTING) {
|
||||
self->SetVar(u"IAmBuilt", false);
|
||||
self->SetVar(u"AmActive", false);
|
||||
|
||||
@@ -43,5 +45,5 @@ void FvConsoleLeftQuickbuild::OnUse(Entity* self, Entity* user) {
|
||||
}
|
||||
}
|
||||
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
}
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#include "FvConsoleRightQuickbuild.h"
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "eTerminateType.h"
|
||||
#include "eRebuildState.h"
|
||||
|
||||
void FvConsoleRightQuickbuild::OnStartup(Entity* self) {
|
||||
self->SetVar(u"IAmBuilt", false);
|
||||
@@ -8,7 +10,7 @@ void FvConsoleRightQuickbuild::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
void FvConsoleRightQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == REBUILD_COMPLETED) {
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
self->SetVar(u"IAmBuilt", true);
|
||||
|
||||
const auto objects = EntityManager::Instance()->GetEntitiesInGroup("Facility");
|
||||
@@ -16,7 +18,7 @@ void FvConsoleRightQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState
|
||||
if (!objects.empty()) {
|
||||
objects[0]->NotifyObject(self, "ConsoleRightUp");
|
||||
}
|
||||
} else if (state == REBUILD_RESETTING) {
|
||||
} else if (state == eRebuildState::RESETTING) {
|
||||
self->SetVar(u"IAmBuilt", false);
|
||||
self->SetVar(u"AmActive", false);
|
||||
|
||||
@@ -43,5 +45,5 @@ void FvConsoleRightQuickbuild::OnUse(Entity* self, Entity* user) {
|
||||
}
|
||||
}
|
||||
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include "FvDragonSmashingGolemQb.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "eRebuildState.h"
|
||||
|
||||
void FvDragonSmashingGolemQb::OnStartup(Entity* self) {
|
||||
self->AddTimer("GolemBreakTimer", 10.5f);
|
||||
@@ -13,7 +14,7 @@ void FvDragonSmashingGolemQb::OnTimerDone(Entity* self, std::string timerName) {
|
||||
}
|
||||
|
||||
void FvDragonSmashingGolemQb::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == eRebuildState::REBUILD_COMPLETED) {
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
GameMessages::SendPlayAnimation(self, u"dragonsmash");
|
||||
|
||||
const auto dragonId = self->GetVar<LWOOBJID>(u"Dragon");
|
||||
|
@@ -56,7 +56,7 @@ void FvFacilityBrick::OnNotifyObject(Entity* self, Entity* sender, const std::st
|
||||
object = EntityManager::Instance()->GetEntitiesInGroup("Canister")[0];
|
||||
|
||||
if (object != nullptr) {
|
||||
object->Smash(self->GetObjectID(), SILENT);
|
||||
object->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
|
||||
canisterSpawner->Reset();
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include "FvPandaServer.h"
|
||||
#include "PetComponent.h"
|
||||
#include "Character.h"
|
||||
#include "ePetTamingNotifyType.h"
|
||||
|
||||
void FvPandaServer::OnStartup(Entity* self) {
|
||||
const auto* petComponent = self->GetComponent<PetComponent>();
|
||||
@@ -10,12 +11,12 @@ void FvPandaServer::OnStartup(Entity* self) {
|
||||
}
|
||||
}
|
||||
|
||||
void FvPandaServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) {
|
||||
if (type == NOTIFY_TYPE_BEGIN) {
|
||||
void FvPandaServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) {
|
||||
if (type == ePetTamingNotifyType::BEGIN) {
|
||||
self->CancelAllTimers();
|
||||
} else if (type == NOTIFY_TYPE_QUIT || type == NOTIFY_TYPE_FAILED) {
|
||||
} else if (type == ePetTamingNotifyType::QUIT || type == ePetTamingNotifyType::FAILED) {
|
||||
self->Smash();
|
||||
} else if (type == NOTIFY_TYPE_SUCCESS) {
|
||||
} else if (type == ePetTamingNotifyType::SUCCESS) {
|
||||
// TODO: Remove from groups
|
||||
|
||||
auto* character = tamer->GetCharacter();
|
||||
@@ -29,7 +30,7 @@ void FvPandaServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "killSelf") {
|
||||
const auto* petComponent = self->GetComponent<PetComponent>();
|
||||
if (petComponent != nullptr && petComponent->GetOwner() == nullptr) {
|
||||
self->Smash(self->GetObjectID(), SILENT);
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -3,6 +3,6 @@
|
||||
|
||||
class FvPandaServer : public CppScripts::Script {
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) override;
|
||||
void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
};
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "Player.h"
|
||||
#include "Character.h"
|
||||
#include "dServer.h"
|
||||
#include "eTerminateType.h"
|
||||
|
||||
void InstanceExitTransferPlayerToLastNonInstance::OnUse(Entity* self, Entity* user) {
|
||||
auto transferText = self->GetVar<std::u16string>(u"transferText");
|
||||
|
@@ -11,7 +11,7 @@ void LegoDieRoll::OnStartup(Entity* self) {
|
||||
|
||||
void LegoDieRoll::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "DoneRolling") {
|
||||
self->Smash(self->GetObjectID(), SILENT);
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
} else if (timerName == "ThrowDice") {
|
||||
int dieRoll = GeneralUtils::GenerateRandomNumber<int>(1, 6);
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include "GfJailWalls.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "GeneralUtils.h"
|
||||
#include "eRebuildState.h"
|
||||
|
||||
void GfJailWalls::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
|
||||
@@ -15,7 +16,7 @@ void GfJailWalls::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
}
|
||||
|
||||
void GfJailWalls::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state != eRebuildState::REBUILD_RESETTING) return;
|
||||
if (state != eRebuildState::RESETTING) return;
|
||||
|
||||
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
|
||||
|
||||
|
@@ -46,6 +46,6 @@ void PetDigBuild::OnDie(Entity* self, Entity* killer) {
|
||||
|
||||
// If the quick build expired and the treasure was not collected, hide the treasure
|
||||
if (!treasure->GetIsDead()) {
|
||||
treasure->Smash(self->GetObjectID(), SILENT);
|
||||
treasure->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
}
|
||||
|
@@ -2,12 +2,13 @@
|
||||
#include "Character.h"
|
||||
#include "eMissionState.h"
|
||||
#include "Entity.h"
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
void PirateRep::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
|
||||
if (missionID == m_PirateRepMissionID && missionState >= eMissionState::READY_TO_COMPLETE) {
|
||||
auto* character = target->GetCharacter();
|
||||
if (character) {
|
||||
character->SetPlayerFlag(ePlayerFlags::GF_PIRATE_REP, true);
|
||||
character->SetPlayerFlag(ePlayerFlag::GF_PIRATE_REP, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -15,6 +15,7 @@
|
||||
#include "InventoryComponent.h"
|
||||
#include "eMissionTaskType.h"
|
||||
#include "eReplicaComponentType.h"
|
||||
#include "eGameActivity.h"
|
||||
|
||||
void SGCannon::OnStartup(Entity* self) {
|
||||
Game::logger->Log("SGCannon", "OnStartup");
|
||||
@@ -102,7 +103,7 @@ void SGCannon::OnActivityStateChangeRequest(Entity* self, LWOOBJID senderID, int
|
||||
|
||||
if (characterComponent != nullptr) {
|
||||
characterComponent->SetIsRacing(true);
|
||||
characterComponent->SetCurrentActivity(2);
|
||||
characterComponent->SetCurrentActivity(eGameActivity::SHOOTING_GALLERY);
|
||||
auto possessor = player->GetComponent<PossessorComponent>();
|
||||
if (possessor) {
|
||||
possessor->SetPossessable(self->GetObjectID());
|
||||
@@ -570,7 +571,7 @@ 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::LOOT_SOURCE_ACTIVITY, eInventoryType::MODELS);
|
||||
inventory->AddItem(rewardLot, 1, eLootSourceType::ACTIVITY, eInventoryType::MODELS);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,7 @@ void NsConcertInstrument::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
void NsConcertInstrument::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == REBUILD_RESETTING || state == REBUILD_OPEN) {
|
||||
if (state == eRebuildState::RESETTING || state == eRebuildState::OPEN) {
|
||||
self->SetVar<LWOOBJID>(u"activePlayer", LWOOBJID_EMPTY);
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@ void NsConcertInstrument::OnTimerDone(Entity* self, std::string name) {
|
||||
if (rebuildComponent != nullptr)
|
||||
rebuildComponent->ResetRebuild(false);
|
||||
|
||||
self->Smash(self->GetObjectID(), VIOLENT);
|
||||
self->Smash(self->GetObjectID(), eKillType::VIOLENT);
|
||||
self->SetVar<LWOOBJID>(u"activePlayer", LWOOBJID_EMPTY);
|
||||
} else if (activePlayer != nullptr && name == "achievement") {
|
||||
auto* missionComponent = activePlayer->GetComponent<MissionComponent>();
|
||||
@@ -199,7 +199,7 @@ void NsConcertInstrument::EquipInstruments(Entity* self, Entity* player) {
|
||||
// Equip the left hand instrument
|
||||
const auto leftInstrumentLot = instrumentLotLeft.find(GetInstrumentLot(self))->second;
|
||||
if (leftInstrumentLot != LOT_NULL) {
|
||||
inventory->AddItem(leftInstrumentLot, 1, eLootSourceType::LOOT_SOURCE_NONE, TEMP_ITEMS, {}, LWOOBJID_EMPTY, false);
|
||||
inventory->AddItem(leftInstrumentLot, 1, eLootSourceType::NONE, TEMP_ITEMS, {}, LWOOBJID_EMPTY, false);
|
||||
auto* leftInstrument = inventory->FindItemByLot(leftInstrumentLot, TEMP_ITEMS);
|
||||
leftInstrument->Equip();
|
||||
}
|
||||
@@ -207,7 +207,7 @@ void NsConcertInstrument::EquipInstruments(Entity* self, Entity* player) {
|
||||
// Equip the right hand instrument
|
||||
const auto rightInstrumentLot = instrumentLotRight.find(GetInstrumentLot(self))->second;
|
||||
if (rightInstrumentLot != LOT_NULL) {
|
||||
inventory->AddItem(rightInstrumentLot, 1, eLootSourceType::LOOT_SOURCE_NONE, TEMP_ITEMS, {}, LWOOBJID_EMPTY, false);
|
||||
inventory->AddItem(rightInstrumentLot, 1, eLootSourceType::NONE, TEMP_ITEMS, {}, LWOOBJID_EMPTY, false);
|
||||
auto* rightInstrument = inventory->FindItemByLot(rightInstrumentLot, TEMP_ITEMS);
|
||||
rightInstrument->Equip();
|
||||
}
|
||||
|
@@ -58,7 +58,7 @@ void NsConcertQuickBuild::OnStartup(Entity* self) {
|
||||
// Destroys the quick build after a while if it wasn't built
|
||||
self->AddCallbackTimer(resetActivatorTime, [self]() {
|
||||
self->SetNetworkVar<float>(u"startEffect", -1.0f);
|
||||
self->Smash(self->GetObjectID(), SILENT);
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "MissionComponent.h"
|
||||
#include "Character.h"
|
||||
#include "eReplicaComponentType.h"
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
void NsGetFactionMissionServer::OnRespondToMission(Entity* self, int missionID, Entity* player, int reward) {
|
||||
if (missionID != 474) return;
|
||||
@@ -10,7 +11,7 @@ void NsGetFactionMissionServer::OnRespondToMission(Entity* self, int missionID,
|
||||
if (reward != LOT_NULL) {
|
||||
std::vector<int> factionMissions;
|
||||
int celebrationID = -1;
|
||||
int flagID = -1;
|
||||
int32_t flagID = -1;
|
||||
|
||||
if (reward == 6980) {
|
||||
// Venture League
|
||||
@@ -41,7 +42,7 @@ void NsGetFactionMissionServer::OnRespondToMission(Entity* self, int missionID,
|
||||
}
|
||||
|
||||
if (flagID != -1) {
|
||||
player->GetCharacter()->SetPlayerFlag(ePlayerFlags::JOINED_A_FACTION, true);
|
||||
player->GetCharacter()->SetPlayerFlag(ePlayerFlag::JOINED_A_FACTION, true);
|
||||
player->GetCharacter()->SetPlayerFlag(flagID, true);
|
||||
}
|
||||
|
||||
|
@@ -11,6 +11,6 @@ void SpecialCoinSpawner::OnProximityUpdate(Entity* self, Entity* entering, const
|
||||
auto character = entering->GetCharacter();
|
||||
if (!character) return;
|
||||
GameMessages::SendPlayFXEffect(self, -1, u"pickup", "", LWOOBJID_EMPTY, 1, 1, true);
|
||||
character->SetCoins(character->GetCoins() + this->m_CurrencyDenomination, eLootSourceType::LOOT_SOURCE_CURRENCY);
|
||||
character->SetCoins(character->GetCoins() + this->m_CurrencyDenomination, eLootSourceType::CURRENCY);
|
||||
self->Smash(entering->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
class WildNinjaBricks : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self);
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1 = 0, int32_t param2 = 0) override;
|
||||
};
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
class WildNinjaStudent : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self);
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1 = 0, int32_t param2 = 0) override;
|
||||
};
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#include "CrabServer.h"
|
||||
#include "PetComponent.h"
|
||||
#include "ePetTamingNotifyType.h"
|
||||
|
||||
void CrabServer::OnStartup(Entity* self) {
|
||||
auto* petComponent = self->GetComponent<PetComponent>();
|
||||
@@ -23,16 +24,16 @@ void CrabServer::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 CrabServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) {
|
||||
if (type == NOTIFY_TYPE_BEGIN) {
|
||||
void CrabServer::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 CrabServer : 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