mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
refactor: effects, audio, animation and UI text game messages as structs
Converts PlayAnimation, PlayNDAudioEmitter, PlayEmbeddedEffectOnAllClientsNearObject,
PlayFXEffect, StopFXEffect, BroadcastTextToChatbox, Play2DAmbientSound,
Stop2DAmbientSound, UIMessageServerToSingleClient, UIMessageServerToAllClients,
StartCelebrationEffect, DisplayMessageBox, DisplayChatBubble, ChangeIdleFlags,
SetNameBillboardState, ShowBillboardInteractIcon, PlayCinematic, EndCinematic,
SlashCommandTextFeedback, PlayEmote and SetEmoteLockState (21 old Send
functions, 23 with overloads) and the received MessageBoxRespond,
ChoiceBoxRespond, CinematicUpdate and PlayEmote to NetGameMsgs in
EffectsMessages.{h,cpp}. The high traffic messages get a constructor for their
required fields. UI messages own their AMF arguments. Every caller is switched,
the received messages are registered in GameMessageHandler's map, and the old
functions and switch cases are deleted. Handlers are copied verbatim.
No wire change and no change in recipients: functions that always broadcast
whatever address they were given are sent with Send(UNASSIGNED_SYSTEM_ADDRESS),
functions that only did SEND_PACKET use SendToClient. Quirks are kept and
documented on the structs (PlayAnimation's UTF-8 sized name, the always written
null terminator in BroadcastTextToChatbox, StartCelebrationEffect always
writing celebrationID, SetNameBillboardState having no payload).
Verified byte for byte against a frozen verbatim copy of the old functions over
an input grid, to one client and broadcast; received messages compared with the
old handlers' read sequences and every truncated payload rejected; hand
computed golden bytes; round trips; a deliberate width mutation made the tests
fail. The byte-equality helper gains a Broadcast mode for functions that
ignored their address.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
#include "NpcEpsilonServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void NpcEpsilonServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
|
||||
|
||||
//If we are completing the Nexus Force join mission, play the celebration for it:
|
||||
if (missionID == 1851) {
|
||||
GameMessages::SendStartCelebrationEffect(target, target->GetSystemAddress(), 22);
|
||||
GameMessages::StartCelebrationEffect celebration;
|
||||
celebration.target = target->GetObjectID();
|
||||
celebration.celebrationID = 22;
|
||||
celebration.SendToClient(target->GetSystemAddress());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "EntityManager.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "EntityInfo.h"
|
||||
#include "MovementAIComponent.h"
|
||||
#include "BaseCombatAIComponent.h"
|
||||
@@ -62,7 +63,7 @@ void AmShieldGenerator::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
self->AddTimer("BuffPlayers", 3.0f);
|
||||
} else if (timerName == "PlayFX") {
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 5351, u"generatorOn", "generatorOn");
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 5351, u"generatorOn", "generatorOn").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
self->AddTimer("PlayFX", 1.5f);
|
||||
} else if (timerName == "RefreshEnemies") {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "EntityManager.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "MovementAIComponent.h"
|
||||
#include "BaseCombatAIComponent.h"
|
||||
#include "SkillComponent.h"
|
||||
@@ -82,7 +83,7 @@ void AmShieldGeneratorQuickbuild::OnTimerDone(Entity* self, std::string timerNam
|
||||
|
||||
self->AddTimer("BuffPlayers", 3.0f);
|
||||
} else if (timerName == "PlayFX") {
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 5351, u"generatorOn", "generatorOn");
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 5351, u"generatorOn", "generatorOn").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
self->AddTimer("PlayFX", 1.5f);
|
||||
} else if (timerName == "RefreshEnemies") {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "AmSkullkinDrill.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "MovingPlatformComponent.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "ProximityMonitorComponent.h"
|
||||
@@ -12,7 +13,7 @@ void AmSkullkinDrill::OnStartup(Entity* self) {
|
||||
self->SetNetworkVar(u"bIsInUse", false);
|
||||
self->SetVar(u"bActive", true);
|
||||
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), -1, u"spin", "active");
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), -1, u"spin", "active").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
auto* movingPlatformComponent = self->GetComponent<MovingPlatformComponent>();
|
||||
|
||||
@@ -135,8 +136,8 @@ void AmSkullkinDrill::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
self->SetNetworkVar(u"bIsInUse", true);
|
||||
|
||||
GameMessages::SendPlayFXEffect(user->GetObjectID(), 5499, u"on-anim", "tornado");
|
||||
GameMessages::SendPlayFXEffect(user->GetObjectID(), 5502, u"on-anim", "staff");
|
||||
GameMessages::PlayFXEffect(user->GetObjectID(), 5499, u"on-anim", "tornado").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(user->GetObjectID(), 5502, u"on-anim", "staff").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
const auto userID = user->GetObjectID();
|
||||
|
||||
@@ -174,8 +175,8 @@ void AmSkullkinDrill::OnArrived(Entity* self, uint32_t waypointIndex) {
|
||||
|
||||
if (waypointIndex == 1) {
|
||||
RenderComponent::PlayAnimation(self, u"no-spin");
|
||||
GameMessages::SendStopFXEffect(self, true, "active");
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), -1, u"indicator", "indicator");
|
||||
GameMessages::StopFXEffect(self->GetObjectID(), true, "active").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), -1, u"indicator", "indicator").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
self->SetVar(u"bActive", false);
|
||||
|
||||
@@ -194,8 +195,8 @@ void AmSkullkinDrill::OnArrived(Entity* self, uint32_t waypointIndex) {
|
||||
return;
|
||||
} else {
|
||||
RenderComponent::PlayAnimation(self, u"idle");
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), -1, u"spin", "active");
|
||||
GameMessages::SendStopFXEffect(self, true, "indicator");
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), -1, u"spin", "active").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::StopFXEffect(self->GetObjectID(), true, "indicator").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,7 +213,10 @@ void AmSkullkinDrill::PlayCinematic(Entity* self) {
|
||||
return;
|
||||
}
|
||||
|
||||
GameMessages::SendPlayCinematic(player->GetObjectID(), cine, player->GetSystemAddress());
|
||||
GameMessages::PlayCinematic cinematic;
|
||||
cinematic.target = player->GetObjectID();
|
||||
cinematic.pathName = cine;
|
||||
cinematic.Send(player->GetSystemAddress());
|
||||
}
|
||||
|
||||
void AmSkullkinDrill::PlayAnim(Entity* self, Entity* player, const std::string& animName) {
|
||||
@@ -259,7 +263,7 @@ void AmSkullkinDrill::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t
|
||||
auto* standObj = GetStandObj(self);
|
||||
|
||||
if (standObj != nullptr) {
|
||||
GameMessages::SendPlayFXEffect(standObj->GetObjectID(), 4946, u"explode", "explode");
|
||||
GameMessages::PlayFXEffect(standObj->GetObjectID(), 4946, u"explode", "explode").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,8 +324,8 @@ void AmSkullkinDrill::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
self->SetVar(u"userID", LWOOBJID_EMPTY);
|
||||
|
||||
GameMessages::SendStopFXEffect(player, true, "tornado");
|
||||
GameMessages::SendStopFXEffect(player, true, "staff");
|
||||
GameMessages::StopFXEffect(player->GetObjectID(), true, "tornado").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::StopFXEffect(player->GetObjectID(), true, "staff").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
} else if (data[0] == "TryUnFreezeAgain") {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "AmSkullkinDrillStand.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "dpEntity.h"
|
||||
#include "Entity.h"
|
||||
#include "RenderComponent.h"
|
||||
@@ -31,7 +32,7 @@ void AmSkullkinDrillStand::OnProximityUpdate(Entity* self, Entity* entering, std
|
||||
|
||||
GameMessages::SendKnockback(entering->GetObjectID(), self->GetObjectID(), self->GetObjectID(), 0, newVec);
|
||||
|
||||
GameMessages::SendPlayFXEffect(entering->GetObjectID(), 1378, u"create", "pushBack");
|
||||
GameMessages::PlayFXEffect(entering->GetObjectID(), 1378, u"create", "pushBack").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
RenderComponent::PlayAnimation(entering, u"knockback-recovery");
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "dZoneManager.h"
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "eMissionState.h"
|
||||
#include "InventoryComponent.h"
|
||||
@@ -62,8 +63,8 @@ void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) {
|
||||
const auto& facility = Game::entityManager->GetEntitiesInGroup("FacilityPipes");
|
||||
|
||||
if (!facility.empty()) {
|
||||
GameMessages::SendStopFXEffect(facility[0], true, location + "PipeEnergy");
|
||||
GameMessages::SendPlayFXEffect(facility[0]->GetObjectID(), onFX, u"create", location + "PipeOn");
|
||||
GameMessages::StopFXEffect(facility[0]->GetObjectID(), true, location + "PipeEnergy").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(facility[0]->GetObjectID(), onFX, u"create", location + "PipeOn").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,8 +109,8 @@ void ImgBrickConsoleQB::SpawnBrick(Entity* self) {
|
||||
void ImgBrickConsoleQB::SmashCanister(Entity* self) {
|
||||
const auto brick = Game::entityManager->GetEntitiesInGroup("Imagination");
|
||||
if (!brick.empty()) {
|
||||
GameMessages::SendPlayFXEffect(brick[0]->GetObjectID(), 122, u"create", "bluebrick");
|
||||
GameMessages::SendPlayFXEffect(brick[0]->GetObjectID(), 1034, u"cast", "imaginationexplosion");
|
||||
GameMessages::PlayFXEffect(brick[0]->GetObjectID(), 122, u"create", "bluebrick").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(brick[0]->GetObjectID(), 1034, u"cast", "imaginationexplosion").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
const auto canisters = Game::entityManager->GetEntitiesInGroup("Canister");
|
||||
@@ -138,8 +139,8 @@ void ImgBrickConsoleQB::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
const auto& facility = Game::entityManager->GetEntitiesInGroup("FacilityPipes");
|
||||
|
||||
if (!facility.empty()) {
|
||||
GameMessages::SendStopFXEffect(facility[0], true, location + "PipeOff");
|
||||
GameMessages::SendPlayFXEffect(facility[0]->GetObjectID(), energyFX, u"create", location + "PipeEnergy");
|
||||
GameMessages::StopFXEffect(facility[0]->GetObjectID(), true, location + "PipeOff").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(facility[0]->GetObjectID(), energyFX, u"create", location + "PipeEnergy").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
const auto consoles = Game::entityManager->GetEntitiesInGroup("Console");
|
||||
@@ -182,10 +183,10 @@ void ImgBrickConsoleQB::OnDie(Entity* self, Entity* killer) {
|
||||
const auto& facility = Game::entityManager->GetEntitiesInGroup("FacilityPipes");
|
||||
|
||||
if (!facility.empty()) {
|
||||
GameMessages::SendStopFXEffect(facility[0], true, location + "PipeEnergy");
|
||||
GameMessages::SendStopFXEffect(facility[0], true, location + "PipeOn");
|
||||
GameMessages::SendPlayFXEffect(facility[0]->GetObjectID(), offFX, u"create", location + "PipeOff");
|
||||
GameMessages::SendPlayFXEffect(facility[0]->GetObjectID(), 2750, u"create", location + "imagination_canister");
|
||||
GameMessages::StopFXEffect(facility[0]->GetObjectID(), true, location + "PipeEnergy").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::StopFXEffect(facility[0]->GetObjectID(), true, location + "PipeOn").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(facility[0]->GetObjectID(), offFX, u"create", location + "PipeOff").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(facility[0]->GetObjectID(), 2750, u"create", location + "imagination_canister").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "RaceMaelstromGeiser.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "PossessableComponent.h"
|
||||
#include "PossessorComponent.h"
|
||||
#include "EntityManager.h"
|
||||
@@ -68,7 +69,7 @@ void RaceMaelstromGeiser::OnProximityUpdate(Entity* self, Entity* entering, std:
|
||||
|
||||
void RaceMaelstromGeiser::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "downTime") {
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 4048, u"rebuild_medium", "geiser", LWOOBJID_EMPTY, 1, 1, true);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 4048, u"rebuild_medium", "geiser").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
self->AddTimer("buildUpTime", 1);
|
||||
} else if (timerName == "buildUpTime") {
|
||||
@@ -76,7 +77,7 @@ void RaceMaelstromGeiser::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
self->AddTimer("killTime", 1.5f);
|
||||
} else if (timerName == "killTime") {
|
||||
GameMessages::SendStopFXEffect(self, true, "geiser");
|
||||
GameMessages::StopFXEffect(self->GetObjectID(), true, "geiser").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
self->SetVar(u"AmFiring", false);
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "GfCaptainsCannon.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "RenderComponent.h"
|
||||
@@ -32,7 +33,7 @@ void GfCaptainsCannon::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
RenderComponent::PlayAnimation(user, u"cannon-strike-no-equip");
|
||||
|
||||
GameMessages::SendPlayFXEffect(user->GetObjectID(), 6039, u"hook", "hook", LWOOBJID_EMPTY, 1, 1, true);
|
||||
GameMessages::PlayFXEffect(user->GetObjectID(), 6039, u"hook", "hook").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
self->AddTimer("FireCannon", 1.667f);
|
||||
}
|
||||
@@ -52,7 +53,10 @@ void GfCaptainsCannon::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "FireCannon") {
|
||||
float cinematicTime = 6.3f;
|
||||
|
||||
GameMessages::SendPlayCinematic(playerId, u"Cannon_Cam", player->GetSystemAddress());
|
||||
GameMessages::PlayCinematic cinematic;
|
||||
cinematic.target = playerId;
|
||||
cinematic.pathName = u"Cannon_Cam";
|
||||
cinematic.Send(player->GetSystemAddress());
|
||||
|
||||
self->AddTimer("cinematicTimer", cinematicTime);
|
||||
|
||||
@@ -64,7 +68,10 @@ void GfCaptainsCannon::OnTimerDone(Entity* self, std::string timerName) {
|
||||
RenderComponent::PlayAnimation(shark, u"cannon");
|
||||
}
|
||||
|
||||
GameMessages::SendPlay2DAmbientSound(player, "{7457d85c-4537-4317-ac9d-2f549219ea87}");
|
||||
GameMessages::Play2DAmbientSound ambientSound;
|
||||
ambientSound.target = player->GetObjectID();
|
||||
ambientSound.audioGUID = "{7457d85c-4537-4317-ac9d-2f549219ea87}";
|
||||
ambientSound.SendToClient(player->GetSystemAddress());
|
||||
} else if (timerName == "cinematicTimer") {
|
||||
GameMessages::SendSetStunned(playerId, eStateChangeType::POP, player->GetSystemAddress(),
|
||||
LWOOBJID_EMPTY, true, true, true, true, true, true, true, true
|
||||
@@ -73,7 +80,7 @@ void GfCaptainsCannon::OnTimerDone(Entity* self, std::string timerName) {
|
||||
self->SetVar<bool>(u"bIsInUse", false);
|
||||
self->SetNetworkVar<bool>(u"bIsInUse", false);
|
||||
|
||||
GameMessages::SendStopFXEffect(player, true, "hook");
|
||||
GameMessages::StopFXEffect(player->GetObjectID(), true, "hook").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "MastTeleport.h"
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "Preconditions.h"
|
||||
#include "eEndBehavior.h"
|
||||
#include "DestroyableComponent.h"
|
||||
@@ -49,12 +50,20 @@ void MastTeleport::OnTimerDone(Entity* self, std::string timerName) {
|
||||
const auto leanIn = self->GetVar<float>(u"LeanIn");
|
||||
|
||||
if (!cinematic.empty()) {
|
||||
GameMessages::SendPlayCinematic(playerId, GeneralUtils::ASCIIToUTF16(cinematic), player->GetSystemAddress(),
|
||||
true, true, false, false, eEndBehavior::RETURN, false, leanIn
|
||||
);
|
||||
GameMessages::PlayCinematic playCinematic;
|
||||
playCinematic.target = playerId;
|
||||
playCinematic.pathName = GeneralUtils::ASCIIToUTF16(cinematic);
|
||||
playCinematic.allowGhostUpdates = true;
|
||||
playCinematic.bCloseMultiInteract = true;
|
||||
playCinematic.bSendServerNotify = false;
|
||||
playCinematic.bUseControlledObjectForAudioListener = false;
|
||||
playCinematic.endBehavior = eEndBehavior::RETURN;
|
||||
playCinematic.hidePlayerDuringCine = false;
|
||||
playCinematic.leadIn = leanIn;
|
||||
playCinematic.Send(player->GetSystemAddress());
|
||||
}
|
||||
|
||||
GameMessages::SendPlayFXEffect(playerId, 6039, u"hook", "hook", LWOOBJID_EMPTY, 1, 1, true);
|
||||
GameMessages::PlayFXEffect(playerId, 6039, u"hook", "hook").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
float animationTime = 6.25f;
|
||||
animationTime = RenderComponent::PlayAnimation(player, "crow-swing-no-equip", 4.0f);
|
||||
@@ -63,7 +72,7 @@ void MastTeleport::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
self->AddTimer("PlayerAnimDone", animationTime);
|
||||
} else if (timerName == "PlayerAnimDone") {
|
||||
GameMessages::SendStopFXEffect(player, true, "hook");
|
||||
GameMessages::StopFXEffect(player->GetObjectID(), true, "hook").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
auto forward = QuatUtils::Forward(self->GetRotation());
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "BankInteractServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "Entity.h"
|
||||
#include "Amf3.h"
|
||||
|
||||
@@ -8,7 +9,11 @@ void BankInteractServer::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
args.Insert("state", "bank");
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "pushGameState", args);
|
||||
GameMessages::UIMessageServerToSingleClient uiMessage;
|
||||
uiMessage.target = user->GetObjectID();
|
||||
uiMessage.strMessageName = "pushGameState";
|
||||
uiMessage.args = std::move(args);
|
||||
uiMessage.SendToClient(user->GetSystemAddress());
|
||||
}
|
||||
|
||||
void BankInteractServer::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1,
|
||||
@@ -18,7 +23,11 @@ void BankInteractServer::OnFireEventServerSide(Entity* self, Entity* sender, std
|
||||
|
||||
args.Insert("visible", false);
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(sender, sender->GetSystemAddress(), "ToggleBank", args);
|
||||
GameMessages::UIMessageServerToSingleClient uiMessage;
|
||||
uiMessage.target = sender->GetObjectID();
|
||||
uiMessage.strMessageName = "ToggleBank";
|
||||
uiMessage.args = std::move(args);
|
||||
uiMessage.SendToClient(sender->GetSystemAddress());
|
||||
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"CloseBank", 0, 0, LWOOBJID_EMPTY, "", sender->GetSystemAddress());
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "BaseInteractDropLootServer.h"
|
||||
#include "Loot.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void BaseInteractDropLootServer::OnUse(Entity* self, Entity* user) {
|
||||
BaseUse(self, user);
|
||||
@@ -17,7 +18,7 @@ void BaseInteractDropLootServer::BaseUse(Entity* self, Entity* user) {
|
||||
auto useSound = self->GetVar<std::string>(u"sound1");
|
||||
|
||||
if (!useSound.empty()) {
|
||||
GameMessages::SendPlayNDAudioEmitter(self, user->GetSystemAddress(), useSound);
|
||||
GameMessages::PlayNDAudioEmitter(self->GetObjectID(), useSound).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
self->SetNetworkVar(u"bInUse", true);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "ExplodingAsset.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "eMissionTaskType.h"
|
||||
@@ -59,7 +60,12 @@ void ExplodingAsset::OnHit(Entity* self, Entity* attacker) {
|
||||
self->SetBoolean(u"bIsHit", true);
|
||||
self->SetOwnerOverride(attacker->GetObjectID());
|
||||
|
||||
GameMessages::SendPlayEmbeddedEffectOnAllClientsNearObject(self, u"camshake", self->GetObjectID(), 16);
|
||||
GameMessages::PlayEmbeddedEffectOnAllClientsNearObject embeddedEffect;
|
||||
embeddedEffect.target = self->GetObjectID();
|
||||
embeddedEffect.effectName = u"camshake";
|
||||
embeddedEffect.fromObjectID = self->GetObjectID();
|
||||
embeddedEffect.radius = 16;
|
||||
embeddedEffect.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->Smash(attacker->GetObjectID());
|
||||
|
||||
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||
@@ -92,14 +98,14 @@ void ExplodingAsset::OnProximityUpdate(Entity* self, Entity* entering, std::stri
|
||||
|
||||
if (status == "ENTER") {
|
||||
RenderComponent::PlayAnimation(self, u"bounce");
|
||||
GameMessages::SendPlayFXEffect(self, -1, u"anim", "bouncin", LWOOBJID_EMPTY, 1, 1, true);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), -1, u"anim", "bouncin").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->SetVar(u"playersNearChest", self->GetVar<int32_t>(u"playersNearChest") + 1);
|
||||
} else if (status == "LEAVE") {
|
||||
self->SetVar(u"playersNearChest", self->GetVar<int32_t>(u"playersNearChest") - 1);
|
||||
|
||||
if (self->GetVar<int32_t>(u"playersNearChest") < 1) {
|
||||
RenderComponent::PlayAnimation(self, u"idle");
|
||||
GameMessages::SendStopFXEffect(self, true, "bouncin");
|
||||
GameMessages::StopFXEffect(self->GetObjectID(), true, "bouncin").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->SetVar<int32_t>(u"playersNearChest", 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "MailBoxServer.h"
|
||||
#include "Amf3.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "Entity.h"
|
||||
|
||||
void MailBoxServer::OnUse(Entity* self, Entity* user) {
|
||||
@@ -8,13 +9,21 @@ void MailBoxServer::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
args.Insert("state", "Mail");
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "pushGameState", args);
|
||||
GameMessages::UIMessageServerToSingleClient uiMessage;
|
||||
uiMessage.target = user->GetObjectID();
|
||||
uiMessage.strMessageName = "pushGameState";
|
||||
uiMessage.args = std::move(args);
|
||||
uiMessage.SendToClient(user->GetSystemAddress());
|
||||
}
|
||||
|
||||
void MailBoxServer::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) {
|
||||
if (args == "toggleMail") {
|
||||
AMFArrayValue args;
|
||||
args.Insert("visible", false);
|
||||
GameMessages::SendUIMessageServerToSingleClient(sender, sender->GetSystemAddress(), "ToggleMail", args);
|
||||
GameMessages::UIMessageServerToSingleClient uiMessage;
|
||||
uiMessage.target = sender->GetObjectID();
|
||||
uiMessage.strMessageName = "ToggleMail";
|
||||
uiMessage.args = std::move(args);
|
||||
uiMessage.SendToClient(sender->GetSystemAddress());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "PropertyDevice.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "eMissionState.h"
|
||||
@@ -19,7 +20,7 @@ void PropertyDevice::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
auto* missionComponent = target->GetComponent<MissionComponent>();
|
||||
if (missionComponent != nullptr) {
|
||||
if (missionComponent->GetMissionState(m_PropertyMissionID) == eMissionState::ACTIVE) {
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 641, u"create", "callhome");
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 641, u"create", "callhome").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
missionComponent->ForceProgress(m_PropertyMissionID, 1793, self->GetLOT());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "StoryBoxInteractServer.h"
|
||||
#include "Character.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "dServer.h"
|
||||
#include "Amf3.h"
|
||||
#include "Entity.h"
|
||||
@@ -14,7 +15,11 @@ void StoryBoxInteractServer::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
args.Insert("state", "Story");
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "pushGameState", args);
|
||||
GameMessages::UIMessageServerToSingleClient uiMessage;
|
||||
uiMessage.target = user->GetObjectID();
|
||||
uiMessage.strMessageName = "pushGameState";
|
||||
uiMessage.args = std::move(args);
|
||||
uiMessage.SendToClient(user->GetSystemAddress());
|
||||
}
|
||||
|
||||
user->AddCallbackTimer(0.1f, [user, customText]() {
|
||||
@@ -23,7 +28,11 @@ void StoryBoxInteractServer::OnUse(Entity* self, Entity* user) {
|
||||
args.Insert("visible", true);
|
||||
args.Insert("text", customText);
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "ToggleStoryBox", args);
|
||||
GameMessages::UIMessageServerToSingleClient uiMessage;
|
||||
uiMessage.target = user->GetObjectID();
|
||||
uiMessage.strMessageName = "ToggleStoryBox";
|
||||
uiMessage.args = std::move(args);
|
||||
uiMessage.SendToClient(user->GetSystemAddress());
|
||||
});
|
||||
|
||||
return;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "TokenConsoleServer.h"
|
||||
#include "InventoryComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "Character.h"
|
||||
#include "eReplicaComponentType.h"
|
||||
#include "eTerminateType.h"
|
||||
@@ -18,7 +19,7 @@ void TokenConsoleServer::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
//play sound
|
||||
if (self->HasVar(u"sound1")) {
|
||||
GameMessages::SendPlayNDAudioEmitter(self, user->GetSystemAddress(), self->GetVarAsString(u"sound1"));
|
||||
GameMessages::PlayNDAudioEmitter(self->GetObjectID(), self->GetVarAsString(u"sound1")).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
//figure out which faction the player belongs to:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "WishingWellServer.h"
|
||||
#include "ScriptedActivityComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "Loot.h"
|
||||
#include "EntityManager.h"
|
||||
#include "eTerminateType.h"
|
||||
@@ -18,7 +19,7 @@ void WishingWellServer::OnUse(Entity* self, Entity* user) {
|
||||
const auto audio = self->GetVar<std::string>(u"sound1");
|
||||
|
||||
if (!audio.empty()) {
|
||||
GameMessages::SendPlayNDAudioEmitter(self, user->GetSystemAddress(), audio);
|
||||
GameMessages::PlayNDAudioEmitter(self->GetObjectID(), audio).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
Loot::DropActivityLoot(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "NsLegoClubDoor.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "Amf3.h"
|
||||
|
||||
void NsLegoClubDoor::OnStartup(Entity* self) {
|
||||
@@ -41,7 +42,11 @@ void NsLegoClubDoor::OnUse(Entity* self, Entity* user) {
|
||||
auto* player = user;
|
||||
|
||||
if (CheckChoice(self, player)) {
|
||||
GameMessages::SendUIMessageServerToSingleClient(player, player->GetSystemAddress(), "QueueChoiceBox", teleportArgs);
|
||||
GameMessages::UIMessageServerToSingleClient uiMessage;
|
||||
uiMessage.target = player->GetObjectID();
|
||||
uiMessage.strMessageName = "QueueChoiceBox";
|
||||
uiMessage.args = std::move(teleportArgs);
|
||||
uiMessage.SendToClient(player->GetSystemAddress());
|
||||
} else if (self->GetVar<int32_t>(u"currentZone") != m_ChoiceZoneID) {
|
||||
AMFArrayValue multiArgs;
|
||||
multiArgs.Insert("state", "Lobby");
|
||||
@@ -52,7 +57,11 @@ void NsLegoClubDoor::OnUse(Entity* self, Entity* user) {
|
||||
context->Insert("HelpVisible", "show");
|
||||
context->Insert("type", "Lego_Club_Valid");
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(player, player->GetSystemAddress(), "pushGameState", multiArgs);
|
||||
GameMessages::UIMessageServerToSingleClient uiMessage;
|
||||
uiMessage.target = player->GetObjectID();
|
||||
uiMessage.strMessageName = "pushGameState";
|
||||
uiMessage.args = std::move(multiArgs);
|
||||
uiMessage.SendToClient(player->GetSystemAddress());
|
||||
} else {
|
||||
BaseOnUse(self, player);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "NsLupTeleport.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "Amf3.h"
|
||||
|
||||
void NsLupTeleport::OnStartup(Entity* self) {
|
||||
@@ -41,7 +42,11 @@ void NsLupTeleport::OnUse(Entity* self, Entity* user) {
|
||||
auto* player = user;
|
||||
|
||||
if (CheckChoice(self, player)) {
|
||||
GameMessages::SendUIMessageServerToSingleClient(player, player->GetSystemAddress(), "QueueChoiceBox", args);
|
||||
GameMessages::UIMessageServerToSingleClient uiMessage;
|
||||
uiMessage.target = player->GetObjectID();
|
||||
uiMessage.strMessageName = "QueueChoiceBox";
|
||||
uiMessage.args = std::move(args);
|
||||
uiMessage.SendToClient(player->GetSystemAddress());
|
||||
} else {
|
||||
BaseOnUse(self, player);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "NsTokenConsoleServer.h"
|
||||
#include "InventoryComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "Character.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
@@ -39,7 +40,7 @@ void NsTokenConsoleServer::OnUse(Entity* self, Entity* user) {
|
||||
const auto useSound = self->GetVar<std::string>(u"sound1");
|
||||
|
||||
if (!useSound.empty()) {
|
||||
GameMessages::SendPlayNDAudioEmitter(self, user->GetSystemAddress(), useSound);
|
||||
GameMessages::PlayNDAudioEmitter(self->GetObjectID(), useSound).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
// Player must be in faction to interact with this entity.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "NtAssemblyTubeServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "eMissionTaskType.h"
|
||||
@@ -47,9 +48,19 @@ void NtAssemblyTubeServer::RunAssemblyTube(Entity* self, Entity* player) {
|
||||
|
||||
if (!teleCinematic.empty()) {
|
||||
const auto teleCinematicUname = teleCinematic;
|
||||
GameMessages::SendPlayCinematic(player->GetObjectID(), teleCinematicUname, player->GetSystemAddress(),
|
||||
true, true, true, false, eEndBehavior::RETURN, false, -1, false, true
|
||||
);
|
||||
GameMessages::PlayCinematic cinematic;
|
||||
cinematic.target = player->GetObjectID();
|
||||
cinematic.pathName = teleCinematicUname;
|
||||
cinematic.allowGhostUpdates = true;
|
||||
cinematic.bCloseMultiInteract = true;
|
||||
cinematic.bSendServerNotify = true;
|
||||
cinematic.bUseControlledObjectForAudioListener = false;
|
||||
cinematic.endBehavior = eEndBehavior::RETURN;
|
||||
cinematic.hidePlayerDuringCine = false;
|
||||
cinematic.leadIn = -1;
|
||||
cinematic.leavePlayerLockedWhenFinished = false;
|
||||
cinematic.lockPlayer = true;
|
||||
cinematic.Send(player->GetSystemAddress());
|
||||
}
|
||||
|
||||
RenderComponent::PlayAnimation(player, u"tube-sucker", 4.0f);
|
||||
@@ -104,7 +115,7 @@ void NtAssemblyTubeServer::TeleportPlayer(Entity* self, Entity* player) {
|
||||
const auto useSound = self->GetVar<std::string>(u"sound1");
|
||||
|
||||
if (!useSound.empty()) {
|
||||
GameMessages::SendPlayNDAudioEmitter(player, player->GetSystemAddress(), useSound);
|
||||
GameMessages::PlayNDAudioEmitter(player->GetObjectID(), useSound).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "NtBeamImaginationCollectors.h"
|
||||
#include "GeneralUtils.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void NtBeamImaginationCollectors::OnStartup(Entity* self) {
|
||||
self->AddTimer("PlayFX", GetRandomNum());
|
||||
@@ -23,7 +24,7 @@ void NtBeamImaginationCollectors::OnTimerDone(Entity* self, std::string timerNam
|
||||
return;
|
||||
}
|
||||
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), -1, m_FxName, "Beam");
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), -1, m_FxName, "Beam").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
self->AddTimer("PlayFX", GetRandomNum());
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "EntityManager.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void NtCombatChallengeExplodingDummy::OnDie(Entity* self, Entity* killer) {
|
||||
const auto challengeObjectID = self->GetVar<LWOOBJID>(u"challengeObjectID");
|
||||
@@ -36,6 +37,11 @@ void NtCombatChallengeExplodingDummy::OnHitOrHealResult(Entity* self, Entity* at
|
||||
if (skillComponent != nullptr) {
|
||||
skillComponent->CalculateBehavior(1338, 30875, attacker->GetObjectID());
|
||||
}
|
||||
GameMessages::SendPlayEmbeddedEffectOnAllClientsNearObject(self, u"camshake", self->GetObjectID(), 16.0f);
|
||||
GameMessages::PlayEmbeddedEffectOnAllClientsNearObject embeddedEffect;
|
||||
embeddedEffect.target = self->GetObjectID();
|
||||
embeddedEffect.effectName = u"camshake";
|
||||
embeddedEffect.fromObjectID = self->GetObjectID();
|
||||
embeddedEffect.radius = 16.0f;
|
||||
embeddedEffect.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->Smash(attacker->GetObjectID());
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "NtCombatChallengeServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "ActivityMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "EntityInfo.h"
|
||||
@@ -33,7 +34,7 @@ void NtCombatChallengeServer::OnHitOrHealResult(Entity* self, Entity* attacker,
|
||||
self->SetVar(u"totalDmg", totalDmg);
|
||||
self->SetNetworkVar(u"totalDmg", totalDmg);
|
||||
|
||||
GameMessages::SendPlayNDAudioEmitter(self, attacker->GetSystemAddress(), scoreSound);
|
||||
GameMessages::PlayNDAudioEmitter(self->GetObjectID(), scoreSound).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +56,7 @@ void NtCombatChallengeServer::OnMessageBoxResponse(Entity* self, Entity* sender,
|
||||
inventoryComponent->RemoveItem(3039, 1, eInventoryType::ALL);
|
||||
}
|
||||
|
||||
GameMessages::SendPlayNDAudioEmitter(self, sender->GetSystemAddress(), startSound);
|
||||
GameMessages::PlayNDAudioEmitter(self->GetObjectID(), startSound).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
self->AddTimer("start_delay", 2.0f);
|
||||
|
||||
@@ -164,9 +165,9 @@ void NtCombatChallengeServer::OnActivityTimerUpdate(Entity* self, float timeRema
|
||||
self->SetNetworkVar(u"update_time", std::ceil(timeRemaining));
|
||||
|
||||
if (timeRemaining <= 3) {
|
||||
GameMessages::SendPlayNDAudioEmitter(self, UNASSIGNED_SYSTEM_ADDRESS, timerLowSound);
|
||||
GameMessages::PlayNDAudioEmitter(self->GetObjectID(), timerLowSound).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else {
|
||||
GameMessages::SendPlayNDAudioEmitter(self, UNASSIGNED_SYSTEM_ADDRESS, timerSound);
|
||||
GameMessages::PlayNDAudioEmitter(self->GetObjectID(), timerSound).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,7 +190,7 @@ void NtCombatChallengeServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (gameTick <= 0) {
|
||||
ResetGame(self);
|
||||
|
||||
GameMessages::SendPlayNDAudioEmitter(self, UNASSIGNED_SYSTEM_ADDRESS, stopSound);
|
||||
GameMessages::PlayNDAudioEmitter(self->GetObjectID(), stopSound).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
self->AddTimer("reset_tick", 5);
|
||||
} else {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "NtParadoxPanelServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "EntityManager.h"
|
||||
#include "Character.h"
|
||||
@@ -53,7 +54,7 @@ void NtParadoxPanelServer::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
GameMessages::SendKnockback(user->GetObjectID(), self->GetObjectID(), self->GetObjectID(), 0, { dir.x * 15, 5, dir.z * 15 });
|
||||
|
||||
GameMessages::SendPlayFXEffect(self, 6432, u"create", "console_sparks", LWOOBJID_EMPTY, 1.0, 1.0, true);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 6432, u"create", "console_sparks").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
self->AddCallbackTimer(2, [this, self, playerID]() {
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
@@ -64,7 +65,7 @@ void NtParadoxPanelServer::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"bActive", 0, 0, player->GetObjectID(), "", player->GetSystemAddress());
|
||||
|
||||
GameMessages::SendStopFXEffect(self, true, "console_sparks");
|
||||
GameMessages::StopFXEffect(self->GetObjectID(), true, "console_sparks").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
self->SetVar(u"bActive", false);
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "NtParadoxTeleServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "eMissionTaskType.h"
|
||||
@@ -69,7 +70,10 @@ void NtParadoxTeleServer::TeleportPlayer(Entity* self, Entity* player) {
|
||||
|
||||
if (!teleCinematic.empty()) {
|
||||
const auto teleCinematicUname = teleCinematic;
|
||||
GameMessages::SendPlayCinematic(player->GetObjectID(), teleCinematicUname, player->GetSystemAddress());
|
||||
GameMessages::PlayCinematic cinematic;
|
||||
cinematic.target = player->GetObjectID();
|
||||
cinematic.pathName = teleCinematicUname;
|
||||
cinematic.Send(player->GetSystemAddress());
|
||||
}
|
||||
|
||||
GameMessages::SendTeleport(player->GetObjectID(), destPosition, destRotation, player->GetSystemAddress(), true);
|
||||
@@ -93,7 +97,7 @@ void NtParadoxTeleServer::TeleportPlayer(Entity* self, Entity* player) {
|
||||
const auto useSound = self->GetVar<std::string>(u"sound1");
|
||||
|
||||
if (!useSound.empty()) {
|
||||
GameMessages::SendPlayNDAudioEmitter(player, player->GetSystemAddress(), useSound);
|
||||
GameMessages::PlayNDAudioEmitter(player->GetObjectID(), useSound).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,6 +114,9 @@ void NtParadoxTeleServer::UnlockPlayer(Entity* self, Entity* player) {
|
||||
|
||||
if (!teleCinematic.empty()) {
|
||||
const auto teleCinematicUname = teleCinematic;
|
||||
GameMessages::SendEndCinematic(player->GetObjectID(), teleCinematicUname, player->GetSystemAddress());
|
||||
GameMessages::EndCinematic endCinematic;
|
||||
endCinematic.target = player->GetObjectID();
|
||||
endCinematic.pathName = teleCinematicUname;
|
||||
endCinematic.Send(player->GetSystemAddress());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "NtVentureCannonServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "Entity.h"
|
||||
#include "GeneralUtils.h"
|
||||
@@ -35,9 +36,12 @@ void NtVentureCannonServer::OnUse(Entity* self, Entity* user) {
|
||||
RenderComponent::PlayAnimation(player, u"scale-down", 4.0f);
|
||||
|
||||
const auto enterCinematicUname = enterCinematic;
|
||||
GameMessages::SendPlayCinematic(player->GetObjectID(), enterCinematicUname, player->GetSystemAddress());
|
||||
GameMessages::PlayCinematic cinematic;
|
||||
cinematic.target = player->GetObjectID();
|
||||
cinematic.pathName = enterCinematicUname;
|
||||
cinematic.Send(player->GetSystemAddress());
|
||||
|
||||
GameMessages::SendPlayNDAudioEmitter(player, player->GetSystemAddress(), "{e8bf79ce-7453-4a7d-b872-fee65e97ff15}");
|
||||
GameMessages::PlayNDAudioEmitter(player->GetObjectID(), "{e8bf79ce-7453-4a7d-b872-fee65e97ff15}").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
self->AddCallbackTimer(3, [this, self]() {
|
||||
self->SetNetworkVar(u"bIsInUse", false);
|
||||
@@ -62,9 +66,14 @@ void NtVentureCannonServer::EnterCannonEnded(Entity* self, Entity* player) {
|
||||
if (!cannonEffectGroup.empty()) {
|
||||
auto* cannonEffect = cannonEffectGroup[0];
|
||||
|
||||
GameMessages::SendPlayFXEffect(cannonEffect, 6036, u"create", "cannon_blast", LWOOBJID_EMPTY, 1, 1, true);
|
||||
GameMessages::PlayFXEffect(cannonEffect->GetObjectID(), 6036, u"create", "cannon_blast").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
GameMessages::SendPlayEmbeddedEffectOnAllClientsNearObject(cannonEffect, u"camshake-bridge", cannonEffect->GetObjectID(), 100);
|
||||
GameMessages::PlayEmbeddedEffectOnAllClientsNearObject embeddedEffect;
|
||||
embeddedEffect.target = cannonEffect->GetObjectID();
|
||||
embeddedEffect.effectName = u"camshake-bridge";
|
||||
embeddedEffect.fromObjectID = cannonEffect->GetObjectID();
|
||||
embeddedEffect.radius = 100;
|
||||
embeddedEffect.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
FirePlayer(self, player);
|
||||
@@ -78,9 +87,19 @@ void NtVentureCannonServer::EnterCannonEnded(Entity* self, Entity* player) {
|
||||
}
|
||||
|
||||
const auto exitCinematicUname = exitCinematic;
|
||||
GameMessages::SendPlayCinematic(player->GetObjectID(), exitCinematicUname, player->GetSystemAddress(),
|
||||
true, true, true, false, eEndBehavior::RETURN, false, 0, false, false
|
||||
);
|
||||
GameMessages::PlayCinematic cinematic;
|
||||
cinematic.target = player->GetObjectID();
|
||||
cinematic.pathName = exitCinematicUname;
|
||||
cinematic.allowGhostUpdates = true;
|
||||
cinematic.bCloseMultiInteract = true;
|
||||
cinematic.bSendServerNotify = true;
|
||||
cinematic.bUseControlledObjectForAudioListener = false;
|
||||
cinematic.endBehavior = eEndBehavior::RETURN;
|
||||
cinematic.hidePlayerDuringCine = false;
|
||||
cinematic.leadIn = 0;
|
||||
cinematic.leavePlayerLockedWhenFinished = false;
|
||||
cinematic.lockPlayer = false;
|
||||
cinematic.Send(player->GetSystemAddress());
|
||||
|
||||
self->AddCallbackTimer(1.5f, [this, self, playerID]() {
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "PetMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void HydrantBroken::OnStartup(Entity* self) {
|
||||
self->AddTimer("playEffect", 1);
|
||||
@@ -39,6 +40,6 @@ void HydrantBroken::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
self->Kill();
|
||||
} else if (timerName == "playEffect") {
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 384, u"water", "water", LWOOBJID_EMPTY, 1, 1, true);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 384, u"water", "water").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "EnemySpiderSpawner.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "EntityInfo.h"
|
||||
#include "DestroyableComponent.h"
|
||||
@@ -12,7 +13,7 @@ void EnemySpiderSpawner::OnFireEventServerSide(Entity* self, Entity* sender, std
|
||||
int32_t param2, int32_t param3) {
|
||||
if (args == "prepEgg") {
|
||||
// Highlight eggs about to hatch with Maelstrom effect
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 2856, u"maelstrom", "test", LWOOBJID_EMPTY, 1.0f, 1.0f, true);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 2856, u"maelstrom", "test").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
// Make indestructible
|
||||
auto dest = static_cast<DestroyableComponent*>(self->GetComponent(eReplicaComponentType::DESTROYABLE));
|
||||
@@ -37,7 +38,7 @@ void EnemySpiderSpawner::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "StartSpawnTime") {
|
||||
SpawnSpiderling(self);
|
||||
} else if (timerName == "SpawnSpiderling") {
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 644, u"create", "egg_puff_b", LWOOBJID_EMPTY, 1.0f, 1.0f, true);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 644, u"create", "egg_puff_b").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
//TODO: set the aggro radius larger
|
||||
|
||||
@@ -63,6 +64,6 @@ void EnemySpiderSpawner::OnTimerDone(Entity* self, std::string timerName) {
|
||||
//--------------------------------------------------------------
|
||||
void EnemySpiderSpawner::SpawnSpiderling(Entity* self) {
|
||||
//Initiate the actual spawning
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 2260, u"rebuild_medium", "dropdustmedium", LWOOBJID_EMPTY, 1.0f, 1.0f, true);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 2260, u"rebuild_medium", "dropdustmedium").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->AddTimer("SpawnSpiderling", spawnTime);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "Character.h"
|
||||
#include "Entity.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "MissionComponent.h"
|
||||
@@ -62,7 +63,10 @@ void ZoneAgProperty::OnPlayerLoaded(Entity* self, Entity* player) {
|
||||
}
|
||||
|
||||
if (Game::zoneManager->GetZone()->GetZoneID().GetMapID() == 1102) {
|
||||
GameMessages::SendPlay2DAmbientSound(player, GUIDMaelstrom);
|
||||
GameMessages::Play2DAmbientSound ambientSound;
|
||||
ambientSound.target = player->GetObjectID();
|
||||
ambientSound.audioGUID = GUIDMaelstrom;
|
||||
ambientSound.SendToClient(player->GetSystemAddress());
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"maelstromSkyOn", 0, 0,
|
||||
LWOOBJID_EMPTY, "", player->GetSystemAddress());
|
||||
|
||||
@@ -256,8 +260,15 @@ void ZoneAgProperty::BaseTimerDone(Entity* self, const std::string& timerName) {
|
||||
DestroySpawner(self->GetVar<std::string>(SpiderScreamSpawner));
|
||||
|
||||
for (auto* player : Game::entityManager->GetEntitiesByComponent(eReplicaComponentType::CHARACTER)) {
|
||||
GameMessages::SendStop2DAmbientSound(player, true, GUIDMaelstrom);
|
||||
GameMessages::SendPlay2DAmbientSound(player, GUIDPeaceful);
|
||||
GameMessages::Stop2DAmbientSound stopAmbientSound;
|
||||
stopAmbientSound.target = player->GetObjectID();
|
||||
stopAmbientSound.force = true;
|
||||
stopAmbientSound.audioGUID = GUIDMaelstrom;
|
||||
stopAmbientSound.SendToClient(player->GetSystemAddress());
|
||||
GameMessages::Play2DAmbientSound ambientSound;
|
||||
ambientSound.target = player->GetObjectID();
|
||||
ambientSound.audioGUID = GUIDPeaceful;
|
||||
ambientSound.SendToClient(player->GetSystemAddress());
|
||||
}
|
||||
} else if (timerName == "ShowVendor") {
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"vendorOn", 0, 0, LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "PropertyBankInteract.h"
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "Amf3.h"
|
||||
#include "Entity.h"
|
||||
|
||||
@@ -24,7 +25,11 @@ void PropertyBankInteract::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
args.Insert("state", "bank");
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "pushGameState", args);
|
||||
GameMessages::UIMessageServerToSingleClient uiMessage;
|
||||
uiMessage.target = user->GetObjectID();
|
||||
uiMessage.strMessageName = "pushGameState";
|
||||
uiMessage.args = std::move(args);
|
||||
uiMessage.SendToClient(user->GetSystemAddress());
|
||||
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"OpenBank", 0, 0, LWOOBJID_EMPTY,
|
||||
"", user->GetSystemAddress());
|
||||
@@ -37,7 +42,11 @@ void PropertyBankInteract::OnFireEventServerSide(Entity* self, Entity* sender, s
|
||||
|
||||
amfArgs.Insert("visible", false);
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(sender, sender->GetSystemAddress(), "ToggleBank", amfArgs);
|
||||
GameMessages::UIMessageServerToSingleClient uiMessage;
|
||||
uiMessage.target = sender->GetObjectID();
|
||||
uiMessage.strMessageName = "ToggleBank";
|
||||
uiMessage.args = std::move(amfArgs);
|
||||
uiMessage.SendToClient(sender->GetSystemAddress());
|
||||
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"CloseBank", 0, 0, LWOOBJID_EMPTY,
|
||||
"", sender->GetSystemAddress());
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "CatapultBaseServer.h"
|
||||
#include "PetMessages.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "Entity.h"
|
||||
#include "RenderComponent.h"
|
||||
@@ -28,7 +29,7 @@ void CatapultBaseServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
// tell the arm to the play the platform animation, which is just the arm laying there but with bouncer
|
||||
for (auto* obj : arm) {
|
||||
RenderComponent::PlayAnimation(obj, u"idle-platform");
|
||||
GameMessages::SendPlayNDAudioEmitter(obj, UNASSIGNED_SYSTEM_ADDRESS, "{8cccf912-69e3-4041-a20b-63e4afafc993}");
|
||||
GameMessages::PlayNDAudioEmitter(obj->GetObjectID(), "{8cccf912-69e3-4041-a20b-63e4afafc993}").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
// set the art so we can use it again
|
||||
self->SetVar(u"Arm", obj->GetObjectID());
|
||||
break;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "FallingTile.h"
|
||||
#include "MovingPlatformComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void FallingTile::OnStartup(Entity* self) {
|
||||
auto* movingPlatfromComponent = self->GetComponent<MovingPlatformComponent>();
|
||||
@@ -44,12 +45,12 @@ void FallingTile::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
movingPlatfromComponent->GotoWaypoint(1);
|
||||
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), -1, u"down", "down");
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), -1, u"down", "down").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else if (timerName == "flipBack") {
|
||||
self->SetVar<bool>(u"AboutToFall", false);
|
||||
|
||||
movingPlatfromComponent->GotoWaypoint(0);
|
||||
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), -1, u"up", "up");
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), -1, u"up", "up").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "NjGarmadonCelebration.h"
|
||||
#include "Character.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
void NjGarmadonCelebration::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
@@ -13,6 +14,9 @@ void NjGarmadonCelebration::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
if (!character->GetPlayerFlag(ePlayerFlag::NJ_GARMADON_CINEMATIC_SEEN)) {
|
||||
character->SetPlayerFlag(ePlayerFlag::NJ_GARMADON_CINEMATIC_SEEN, true);
|
||||
|
||||
GameMessages::SendStartCelebrationEffect(target, target->GetSystemAddress(), GarmadonCelebrationID);
|
||||
GameMessages::StartCelebrationEffect celebration;
|
||||
celebration.target = target->GetObjectID();
|
||||
celebration.celebrationID = GarmadonCelebrationID;
|
||||
celebration.SendToClient(target->GetSystemAddress());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "Character.h"
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "eMissionState.h"
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
@@ -54,7 +55,7 @@ void NjWuNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, e
|
||||
|
||||
// Stop the dragon effects
|
||||
for (auto* dragon : Game::entityManager->GetEntitiesInGroup(m_DragonStatueGroup)) {
|
||||
GameMessages::SendStopFXEffect(dragon, true, "on");
|
||||
GameMessages::StopFXEffect(dragon->GetObjectID(), true, "on").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "SkillComponent.h"
|
||||
#include "EntityInfo.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void RainOfArrows::OnStartup(Entity* self) {
|
||||
|
||||
@@ -60,7 +61,7 @@ void RainOfArrows::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
self->AddTimer("FireSkill", 0.7f);
|
||||
} else if (timerName == "PlayArrowSound") {
|
||||
GameMessages::SendPlayNDAudioEmitter(self, UNASSIGNED_SYSTEM_ADDRESS, m_ArrowsGUID);
|
||||
GameMessages::PlayNDAudioEmitter(self->GetObjectID(), m_ArrowsGUID).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else if (timerName == "FireSkill") {
|
||||
if (child != nullptr) {
|
||||
child->Smash();
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "EntityManager.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "BaseCombatAIComponent.h"
|
||||
#include "BuffComponent.h"
|
||||
#include "SkillComponent.h"
|
||||
@@ -265,7 +266,7 @@ void NjMonastryBossInstance::HandleCounterWeightSpawned(Entity* self, Entity* co
|
||||
}
|
||||
|
||||
RenderComponent::PlayAnimation(frakjaw, StunnedAnimation);
|
||||
GameMessages::SendPlayNDAudioEmitter(frakjaw, UNASSIGNED_SYSTEM_ADDRESS, CounterSmashAudio);
|
||||
GameMessages::PlayNDAudioEmitter(frakjaw->GetObjectID(), CounterSmashAudio).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
// Before wave 4 we should lower frakjaw from the ledge
|
||||
if (self->GetVar<uint32_t>(WaveNumberVariable) == 3) {
|
||||
|
||||
Reference in New Issue
Block a user