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:
Aaron Kimbrell
2026-09-26 19:06:00 -05:00
parent 5a9a3e380b
commit dae1925d1a
117 changed files with 2832 additions and 1058 deletions

View File

@@ -1,5 +1,6 @@
#include "DLUVanityTeleportingObject.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "dServer.h"
#include "VanityUtilities.h"
#include "RenderComponent.h"
@@ -17,14 +18,14 @@ void DLUVanityTeleportingObject::OnStartup(Entity* self) {
void DLUVanityTeleportingObject::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "setupTeleport") {
RenderComponent::PlayAnimation(self, u"interact");
GameMessages::SendPlayFXEffect(self->GetObjectID(), 6478, u"teleportBeam", "teleportBeam");
GameMessages::SendPlayFXEffect(self->GetObjectID(), 6478, u"teleportRings", "teleportRings");
GameMessages::PlayFXEffect(self->GetObjectID(), 6478, u"teleportBeam", "teleportBeam").Send(UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::PlayFXEffect(self->GetObjectID(), 6478, u"teleportRings", "teleportRings").Send(UNASSIGNED_SYSTEM_ADDRESS);
self->AddTimer("teleport", 2.0f);
self->AddTimer("stopFX", 2.0f);
} else if (timerName == "stopFX") {
GameMessages::SendStopFXEffect(self, true, "teleportBeam");
GameMessages::SendStopFXEffect(self, true, "teleportRings");
GameMessages::StopFXEffect(self->GetObjectID(), true, "teleportBeam").Send(UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::StopFXEffect(self->GetObjectID(), true, "teleportRings").Send(UNASSIGNED_SYSTEM_ADDRESS);
} else if (timerName == "teleport") {
std::vector<VanityObjectLocation>& locations = m_Object->m_Locations[Game::server->GetZoneID()];
@@ -37,8 +38,8 @@ void DLUVanityTeleportingObject::OnTimerDone(Entity* self, std::string timerName
self->SetPosition(newLocation.m_Position);
self->SetRotation(newLocation.m_Rotation);
GameMessages::SendPlayFXEffect(self->GetObjectID(), 6478, u"teleportBeam", "teleportBeam");
GameMessages::SendPlayFXEffect(self->GetObjectID(), 6478, u"teleportRings", "teleportRings");
GameMessages::PlayFXEffect(self->GetObjectID(), 6478, u"teleportBeam", "teleportBeam").Send(UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::PlayFXEffect(self->GetObjectID(), 6478, u"teleportRings", "teleportRings").Send(UNASSIGNED_SYSTEM_ADDRESS);
self->AddTimer("stopFX", 2.0f);
self->AddTimer("setupTeleport", m_TeleportInterval);
}

View File

@@ -12,6 +12,7 @@
#include "BaseCombatAIComponent.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "SkillComponent.h"
#include "eReplicaComponentType.h"
#include "RenderComponent.h"
@@ -527,7 +528,12 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
}
}
GameMessages::SendPlayEmbeddedEffectOnAllClientsNearObject(self, u"camshake-bridge", self->GetObjectID(), 100.0f);
GameMessages::PlayEmbeddedEffectOnAllClientsNearObject embeddedEffect;
embeddedEffect.target = self->GetObjectID();
embeddedEffect.effectName = u"camshake-bridge";
embeddedEffect.fromObjectID = self->GetObjectID();
embeddedEffect.radius = 100.0f;
embeddedEffect.Send(UNASSIGNED_SYSTEM_ADDRESS);
} else if (timerName == "AdvanceComplete") {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"SetColGroup", 11, 0, 0, "", UNASSIGNED_SYSTEM_ADDRESS);

View File

@@ -3,6 +3,7 @@
#include "DestroyableComponent.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "SkillComponent.h"
#include "BaseCombatAIComponent.h"
#include "EntityInfo.h"
@@ -36,7 +37,7 @@ void AmDarklingDragon::OnDie(Entity* self, Entity* killer) {
}
void AmDarklingDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t damage) {
GameMessages::SendPlayFXEffect(self, -1, u"gothit", "", LWOOBJID_EMPTY, 1, 1, true);
GameMessages::PlayFXEffect(self->GetObjectID(), -1, u"gothit", "").Send(UNASSIGNED_SYSTEM_ADDRESS);
if (true) {
auto weakpoint = self->GetVar<int32_t>(u"weakspot");
@@ -70,7 +71,11 @@ void AmDarklingDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t
}
self->SetVar<int32_t>(u"weakpoint", 2);
GameMessages::SendChangeIdleFlags(self->GetObjectID(), eAnimationFlags::IDLE_NONE, eAnimationFlags::IDLE_COMBAT, UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::ChangeIdleFlags idleFlags;
idleFlags.target = self->GetObjectID();
idleFlags.flagsOn = eAnimationFlags::IDLE_NONE;
idleFlags.flagsOff = eAnimationFlags::IDLE_COMBAT;
idleFlags.Send(UNASSIGNED_SYSTEM_ADDRESS);
float animationTime = RenderComponent::PlayAnimation(self, u"stunstart", 1.7f);
self->AddTimer("timeToStunLoop", 1.0f);
@@ -134,7 +139,11 @@ void AmDarklingDragon::OnTimerDone(Entity* self, std::string timerName) {
skillComponent->Interrupt();
skillComponent->Reset();
}
GameMessages::SendChangeIdleFlags(self->GetObjectID(), eAnimationFlags::IDLE_COMBAT, eAnimationFlags::IDLE_NONE, UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::ChangeIdleFlags idleFlags;
idleFlags.target = self->GetObjectID();
idleFlags.flagsOn = eAnimationFlags::IDLE_COMBAT;
idleFlags.flagsOff = eAnimationFlags::IDLE_NONE;
idleFlags.Send(UNASSIGNED_SYSTEM_ADDRESS);
self->SetVar<int32_t>(u"weakspot", -1);
GameMessages::SendNotifyObject(self->GetObjectID(), self->GetObjectID(), u"DragonRevive", UNASSIGNED_SYSTEM_ADDRESS);
}

View File

@@ -6,6 +6,7 @@
#include "eAnimationFlags.h"
#include "EntityInfo.h"
#include "RenderComponent.h"
#include "EffectsMessages.h"
void FvMaelstromDragon::OnStartup(Entity* self) {
self->SetVar<int32_t>(u"weakspot", 0);
@@ -49,7 +50,7 @@ void FvMaelstromDragon::OnDie(Entity* self, Entity* killer) {
}
void FvMaelstromDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t damage) {
GameMessages::SendPlayFXEffect(self, -1, u"gothit", "", LWOOBJID_EMPTY, 1, 1, true);
GameMessages::PlayFXEffect(self->GetObjectID(), -1, u"gothit", "").Send(UNASSIGNED_SYSTEM_ADDRESS);
if (true) {
auto weakpoint = self->GetVar<int32_t>(u"weakspot");
@@ -86,7 +87,11 @@ void FvMaelstromDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_
self->SetVar<int32_t>(u"weakpoint", 2);
GameMessages::SendChangeIdleFlags(self->GetObjectID(), eAnimationFlags::IDLE_NONE, eAnimationFlags::IDLE_COMBAT, UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::ChangeIdleFlags idleFlags;
idleFlags.target = self->GetObjectID();
idleFlags.flagsOn = eAnimationFlags::IDLE_NONE;
idleFlags.flagsOff = eAnimationFlags::IDLE_COMBAT;
idleFlags.Send(UNASSIGNED_SYSTEM_ADDRESS);
RenderComponent::PlayAnimation(self, u"stunstart", 1.7f);
self->AddTimer("timeToStunLoop", 1.0f);
@@ -152,7 +157,11 @@ void FvMaelstromDragon::OnTimerDone(Entity* self, std::string timerName) {
skillComponent->Interrupt();
skillComponent->Reset();
}
GameMessages::SendChangeIdleFlags(self->GetObjectID(), eAnimationFlags::IDLE_COMBAT, eAnimationFlags::IDLE_NONE, UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::ChangeIdleFlags idleFlags;
idleFlags.target = self->GetObjectID();
idleFlags.flagsOn = eAnimationFlags::IDLE_COMBAT;
idleFlags.flagsOff = eAnimationFlags::IDLE_NONE;
idleFlags.Send(UNASSIGNED_SYSTEM_ADDRESS);
self->SetVar<int32_t>(u"weakspot", -1);
GameMessages::SendNotifyObject(self->GetObjectID(), self->GetObjectID(), u"DragonRevive", UNASSIGNED_SYSTEM_ADDRESS);

View File

@@ -2,6 +2,7 @@
#include "BaseCombatAIComponent.h"
#include "DestroyableComponent.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "EntityManager.h"
#include "EntityInfo.h"
#include "SkillComponent.h"
@@ -40,7 +41,11 @@ void BaseEnemyApe::OnHit(Entity* self, Entity* attacker) {
skillComponent->Reset();
}
RenderComponent::PlayAnimation(self, u"disable", 1.7f);
GameMessages::SendChangeIdleFlags(self->GetObjectID(), eAnimationFlags::IDLE_NONE, eAnimationFlags::IDLE_COMBAT, UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::ChangeIdleFlags idleFlags;
idleFlags.target = self->GetObjectID();
idleFlags.flagsOn = eAnimationFlags::IDLE_NONE;
idleFlags.flagsOff = eAnimationFlags::IDLE_COMBAT;
idleFlags.Send(UNASSIGNED_SYSTEM_ADDRESS);
const auto reviveTime = self->GetVar<float_t>(u"reviveTime") != 0.0f
? self->GetVar<float_t>(u"reviveTime") : 12.0f;
self->AddTimer("reviveTime", reviveTime);
@@ -57,7 +62,11 @@ void BaseEnemyApe::OnTimerDone(Entity* self, std::string timerName) {
destroyableComponent->SetArmor(destroyableComponent->GetMaxArmor() / timesStunned);
}
Game::entityManager->SerializeEntity(self);
GameMessages::SendChangeIdleFlags(self->GetObjectID(), eAnimationFlags::IDLE_COMBAT, eAnimationFlags::IDLE_NONE, UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::ChangeIdleFlags idleFlags;
idleFlags.target = self->GetObjectID();
idleFlags.flagsOn = eAnimationFlags::IDLE_COMBAT;
idleFlags.flagsOff = eAnimationFlags::IDLE_NONE;
idleFlags.Send(UNASSIGNED_SYSTEM_ADDRESS);
self->SetVar<uint32_t>(u"timesStunned", timesStunned + 1);
StunApe(self, false);

View File

@@ -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());
}
}

View File

@@ -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") {

View File

@@ -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") {

View File

@@ -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") {

View File

@@ -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");
}

View File

@@ -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);
}
}

View File

@@ -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);

View File

@@ -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>();

View File

@@ -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());

View File

@@ -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());
}

View File

@@ -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);

View File

@@ -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);
}
}

View File

@@ -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());
}
}

View File

@@ -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());
}
}

View File

@@ -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;

View File

@@ -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:

View File

@@ -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(

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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.

View File

@@ -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);
}
}

View File

@@ -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());
}

View File

@@ -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());
}

View File

@@ -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 {

View File

@@ -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);
});

View File

@@ -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());
}
}

View File

@@ -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);

View File

@@ -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);
}
}

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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());

View File

@@ -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;

View File

@@ -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);
}
}

View File

@@ -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());
}
}

View File

@@ -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);
}
});
}

View File

@@ -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();

View File

@@ -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) {