mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-09 22:33:45 +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:
@@ -8,6 +8,7 @@
|
||||
#include "dpWorld.h"
|
||||
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "dServer.h"
|
||||
#include "Game.h"
|
||||
|
||||
@@ -163,7 +164,7 @@ void BaseCombatAIComponent::Update(const float deltaTime) {
|
||||
m_TetherTime -= deltaTime;
|
||||
m_ForcedTetherTime -= deltaTime;
|
||||
if (m_ForcedTetherTime >= 0) return;
|
||||
GameMessages::SendStopFXEffect(m_Parent, true, "tether");
|
||||
GameMessages::StopFXEffect(m_Parent->GetObjectID(), true, "tether").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
m_TetherEffectActive = false;
|
||||
}
|
||||
|
||||
@@ -836,7 +837,7 @@ void BaseCombatAIComponent::TetherLogic() {
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
}
|
||||
|
||||
GameMessages::SendPlayFXEffect(m_Parent->GetObjectID(), 6270, u"tether", "tether");
|
||||
GameMessages::PlayFXEffect(m_Parent->GetObjectID(), 6270, u"tether", "tether").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
m_TetherEffectActive = true;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "Game.h"
|
||||
#include "Logger.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "BitStream.h"
|
||||
#include "eTriggerEventType.h"
|
||||
#include "Amf3.h"
|
||||
@@ -67,10 +68,10 @@ void BouncerComponent::SetPetBouncerEnabled(bool value) {
|
||||
|
||||
if (value) {
|
||||
m_Parent->TriggerEvent(eTriggerEventType::PET_ON_SWITCH, m_Parent);
|
||||
GameMessages::SendPlayFXEffect(m_Parent->GetObjectID(), 1513, u"create", "PetOnSwitch", LWOOBJID_EMPTY, 1, 1, true);
|
||||
GameMessages::PlayFXEffect(m_Parent->GetObjectID(), 1513, u"create", "PetOnSwitch").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else {
|
||||
m_Parent->TriggerEvent(eTriggerEventType::PET_OFF_SWITCH, m_Parent);
|
||||
GameMessages::SendStopFXEffect(m_Parent, true, "PetOnSwitch");
|
||||
GameMessages::StopFXEffect(m_Parent->GetObjectID(), true, "PetOnSwitch").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "Game.h"
|
||||
#include "Logger.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "ControllablePhysicsComponent.h"
|
||||
#include "EntityManager.h"
|
||||
@@ -123,7 +124,10 @@ void BuffComponent::ApplyBuffFx(uint32_t buffId, const BuffParameter& buff) {
|
||||
|
||||
fxToPlay += std::to_string(buffId);
|
||||
LOG_DEBUG("Playing %s %i", fxToPlay.c_str(), buff.effectId);
|
||||
GameMessages::SendPlayFXEffect(m_Parent->GetObjectID(), buff.effectId, u"cast", fxToPlay, LWOOBJID_EMPTY, 1.07f, 1.0f, false);
|
||||
GameMessages::PlayFXEffect fx(m_Parent->GetObjectID(), buff.effectId, u"cast", fxToPlay);
|
||||
fx.priority = 1.07f;
|
||||
fx.serialize = false;
|
||||
fx.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
void BuffComponent::RemoveBuffFx(uint32_t buffId, const BuffParameter& buff) {
|
||||
@@ -134,7 +138,7 @@ void BuffComponent::RemoveBuffFx(uint32_t buffId, const BuffParameter& buff) {
|
||||
|
||||
fxToPlay += std::to_string(buffId);
|
||||
LOG_DEBUG("Stopping %s", fxToPlay.c_str());
|
||||
GameMessages::SendStopFXEffect(m_Parent, false, fxToPlay);
|
||||
GameMessages::StopFXEffect(m_Parent->GetObjectID(), false, fxToPlay).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
void BuffComponent::ApplyBuff(const int32_t id, const float duration, const LWOOBJID source, bool addImmunity,
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "EntityManager.h"
|
||||
#include "HavokVehiclePhysicsComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "Item.h"
|
||||
#include "Amf3.h"
|
||||
#include "eGameMasterLevel.h"
|
||||
@@ -844,7 +845,11 @@ void CharacterComponent::UpdateClientMinimap(bool showFaction, std::string ventu
|
||||
if (!m_Parent) return;
|
||||
AMFArrayValue arrayToSend;
|
||||
arrayToSend.Insert(ventureVisionType, showFaction);
|
||||
GameMessages::SendUIMessageServerToSingleClient(m_Parent, m_Parent ? m_Parent->GetSystemAddress() : UNASSIGNED_SYSTEM_ADDRESS, "SetFactionVisibility", arrayToSend);
|
||||
GameMessages::UIMessageServerToSingleClient uiMessage;
|
||||
uiMessage.target = m_Parent->GetObjectID();
|
||||
uiMessage.strMessageName = "SetFactionVisibility";
|
||||
uiMessage.args = std::move(arrayToSend);
|
||||
uiMessage.SendToClient(m_Parent ? m_Parent->GetSystemAddress() : UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
void CharacterComponent::AwardClaimCodes() {
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "Amf3.h"
|
||||
#include "AmfSerialize.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "User.h"
|
||||
#include "CDClientManager.h"
|
||||
#include "CDDestructibleComponentTable.h"
|
||||
@@ -272,7 +273,11 @@ void DestroyableComponent::SetMaxHealth(float value, bool playAnim) {
|
||||
args.Insert("amount", std::to_string(difference));
|
||||
args.Insert("type", "health");
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(m_Parent, characterComponent->GetSystemAddress(), "MaxPlayerBarUpdate", args);
|
||||
GameMessages::UIMessageServerToSingleClient uiMessage;
|
||||
uiMessage.target = m_Parent->GetObjectID();
|
||||
uiMessage.strMessageName = "MaxPlayerBarUpdate";
|
||||
uiMessage.args = std::move(args);
|
||||
uiMessage.SendToClient(characterComponent->GetSystemAddress());
|
||||
}
|
||||
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
@@ -314,7 +319,11 @@ void DestroyableComponent::SetMaxArmor(float value, bool playAnim) {
|
||||
args.Insert("amount", std::to_string(value));
|
||||
args.Insert("type", "armor");
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(m_Parent, characterComponent->GetSystemAddress(), "MaxPlayerBarUpdate", args);
|
||||
GameMessages::UIMessageServerToSingleClient uiMessage;
|
||||
uiMessage.target = m_Parent->GetObjectID();
|
||||
uiMessage.strMessageName = "MaxPlayerBarUpdate";
|
||||
uiMessage.args = std::move(args);
|
||||
uiMessage.SendToClient(characterComponent->GetSystemAddress());
|
||||
}
|
||||
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
@@ -355,7 +364,11 @@ void DestroyableComponent::SetMaxImagination(float value, bool playAnim) {
|
||||
args.Insert("amount", std::to_string(difference));
|
||||
args.Insert("type", "imagination");
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(m_Parent, characterComponent->GetSystemAddress(), "MaxPlayerBarUpdate", args);
|
||||
GameMessages::UIMessageServerToSingleClient uiMessage;
|
||||
uiMessage.target = m_Parent->GetObjectID();
|
||||
uiMessage.strMessageName = "MaxPlayerBarUpdate";
|
||||
uiMessage.args = std::move(args);
|
||||
uiMessage.SendToClient(characterComponent->GetSystemAddress());
|
||||
}
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "DashboardNotify.h"
|
||||
#include "GameMessages.h"
|
||||
#include "PetMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "BrickDatabase.h"
|
||||
#include "CDClientDatabase.h"
|
||||
#include "CDTamingBuildPuzzleTable.h"
|
||||
@@ -469,7 +470,7 @@ void PetComponent::NotifyTamingBuildSuccess(NiPoint3 position) {
|
||||
const auto* const entry = CDClientManager::GetTable<CDTamingBuildPuzzleTable>()->GetByLOT(m_Parent->GetLOT());
|
||||
if (!entry) return;
|
||||
|
||||
GameMessages::SendPlayFXEffect(tamer, -1, u"petceleb", "", LWOOBJID_EMPTY, 1, 1, true);
|
||||
GameMessages::PlayFXEffect(tamer->GetObjectID(), -1, u"petceleb", "").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
RenderComponent::PlayAnimation(tamer, u"rebuild-celebrate");
|
||||
|
||||
EntityInfo info{};
|
||||
@@ -1036,7 +1037,7 @@ void PetComponent::AddDrainImaginationTimer(bool fromTaming) {
|
||||
}
|
||||
|
||||
void PetComponent::Deactivate() {
|
||||
GameMessages::SendPlayFXEffect(m_Parent->GetObjectID(), -1, u"despawn", "", LWOOBJID_EMPTY, 1, 1, true);
|
||||
GameMessages::PlayFXEffect(m_Parent->GetObjectID(), -1, u"despawn", "").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
activePets.erase(m_Owner);
|
||||
|
||||
@@ -1105,7 +1106,11 @@ void PetComponent::Command(const NiPoint3& position, const LWOOBJID source, cons
|
||||
|
||||
if (commandType == 1) {
|
||||
// Emotes
|
||||
GameMessages::SendPlayEmote(m_Parent->GetObjectID(), typeId, owner->GetObjectID(), UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayEmote playEmote;
|
||||
playEmote.target = m_Parent->GetObjectID();
|
||||
playEmote.emoteID = typeId;
|
||||
playEmote.targetID = owner->GetObjectID();
|
||||
playEmote.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::EmotePlayed msg;
|
||||
msg.target = owner->GetObjectID();
|
||||
msg.emoteID = typeId;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "Character.h"
|
||||
#include "Database.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "PropertyManagementComponent.h"
|
||||
#include "PropertyMessages.h"
|
||||
#include "RocketLaunchpadControlComponent.h"
|
||||
@@ -42,7 +43,11 @@ void PropertyEntranceComponent::OnUse(Entity* entity) {
|
||||
|
||||
args.Insert("state", "property_menu");
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(entity, entity->GetSystemAddress(), "pushGameState", args);
|
||||
GameMessages::UIMessageServerToSingleClient uiMessage;
|
||||
uiMessage.target = entity->GetObjectID();
|
||||
uiMessage.strMessageName = "pushGameState";
|
||||
uiMessage.args = std::move(args);
|
||||
uiMessage.SendToClient(entity->GetSystemAddress());
|
||||
}
|
||||
|
||||
void PropertyEntranceComponent::OnEnterProperty(Entity* entity, uint32_t index, bool returnToZone, const SystemAddress& sysAddr) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "Entity.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "Game.h"
|
||||
#include "Logger.h"
|
||||
@@ -425,7 +426,9 @@ void QuickBuildComponent::CompleteQuickBuild(Entity* const user) {
|
||||
Game::entityManager->SerializeEntity(user);
|
||||
|
||||
GameMessages::SendQuickBuildNotifyState(m_Parent, m_State, eQuickBuildState::COMPLETED, user->GetObjectID());
|
||||
GameMessages::SendPlayFXEffect(m_Parent, 507, u"create", "BrickFadeUpVisCompleteEffect", LWOOBJID_EMPTY, 0.4f, 1.0f, true);
|
||||
GameMessages::PlayFXEffect fx(m_Parent->GetObjectID(), 507, u"create", "BrickFadeUpVisCompleteEffect");
|
||||
fx.priority = 0.4f;
|
||||
fx.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::SendEnableQuickBuild(m_Parent, false, false, true, eQuickBuildFailReason::NOT_GIVEN, m_ResetTime, user->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, m_Parent->GetObjectID());
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "CDRailActivatorComponent.h"
|
||||
#include "Entity.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "Game.h"
|
||||
#include "Logger.h"
|
||||
@@ -55,8 +56,7 @@ void RailActivatorComponent::OnUse(Entity* originator) {
|
||||
|
||||
// Start the initial effects
|
||||
if (!m_StartEffect.second.empty()) {
|
||||
GameMessages::SendPlayFXEffect(originator->GetObjectID(), m_StartEffect.first, m_StartEffect.second,
|
||||
std::to_string(m_StartEffect.first));
|
||||
GameMessages::PlayFXEffect(originator->GetObjectID(), m_StartEffect.first, m_StartEffect.second, std::to_string(m_StartEffect.first)).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
float animationLength = 0.5f;
|
||||
@@ -90,13 +90,12 @@ void RailActivatorComponent::OnRailMovementReady(Entity* originator) const {
|
||||
if (std::find(m_EntitiesOnRail.begin(), m_EntitiesOnRail.end(), originator->GetObjectID()) != m_EntitiesOnRail.end()) {
|
||||
// Stop the initial effects
|
||||
if (!m_StartEffect.second.empty()) {
|
||||
GameMessages::SendStopFXEffect(originator, false, std::to_string(m_StartEffect.first));
|
||||
GameMessages::StopFXEffect(originator->GetObjectID(), false, std::to_string(m_StartEffect.first)).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
// Start the looping effects
|
||||
if (!m_LoopEffect.second.empty()) {
|
||||
GameMessages::SendPlayFXEffect(originator->GetObjectID(), m_LoopEffect.first, m_LoopEffect.second,
|
||||
std::to_string(m_LoopEffect.first));
|
||||
GameMessages::PlayFXEffect(originator->GetObjectID(), m_LoopEffect.first, m_LoopEffect.second, std::to_string(m_LoopEffect.first)).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
if (!m_LoopAnimation.empty()) {
|
||||
@@ -125,13 +124,12 @@ void RailActivatorComponent::OnCancelRailMovement(Entity* originator) {
|
||||
if (std::find(m_EntitiesOnRail.begin(), m_EntitiesOnRail.end(), originator->GetObjectID()) != m_EntitiesOnRail.end()) {
|
||||
// Stop the looping effects
|
||||
if (!m_LoopEffect.second.empty()) {
|
||||
GameMessages::SendStopFXEffect(originator, false, std::to_string(m_LoopEffect.first));
|
||||
GameMessages::StopFXEffect(originator->GetObjectID(), false, std::to_string(m_LoopEffect.first)).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
// Start the end effects
|
||||
if (!m_StopEffect.second.empty()) {
|
||||
GameMessages::SendPlayFXEffect(originator->GetObjectID(), m_StopEffect.first, m_StopEffect.second,
|
||||
std::to_string(m_StopEffect.first));
|
||||
GameMessages::PlayFXEffect(originator->GetObjectID(), m_StopEffect.first, m_StopEffect.second, std::to_string(m_StopEffect.first)).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
if (!m_StopAnimation.empty()) {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "CDClientManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "Game.h"
|
||||
#include "Logger.h"
|
||||
#include "CDAnimationsTable.h"
|
||||
@@ -96,7 +97,12 @@ void RenderComponent::Update(const float deltaTime) {
|
||||
void RenderComponent::PlayEffect(const int32_t effectId, const std::u16string& effectType, const std::string& name, const LWOOBJID secondary, const float priority, const float scale, const bool serialize) {
|
||||
RemoveEffect(name);
|
||||
|
||||
GameMessages::SendPlayFXEffect(m_Parent, effectId, effectType, name, secondary, priority, scale, serialize);
|
||||
GameMessages::PlayFXEffect fx(m_Parent->GetObjectID(), effectId, effectType, name);
|
||||
fx.secondary = secondary;
|
||||
fx.priority = priority;
|
||||
fx.scale = scale;
|
||||
fx.serialize = serialize;
|
||||
fx.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
auto& effect = AddEffect(effectId, name, effectType, priority);
|
||||
|
||||
@@ -135,7 +141,7 @@ void RenderComponent::PlayEffect(const int32_t effectId, const std::u16string& e
|
||||
}
|
||||
|
||||
void RenderComponent::StopEffect(const std::string& name, const bool killImmediate) {
|
||||
GameMessages::SendStopFXEffect(m_Parent, killImmediate, name);
|
||||
GameMessages::StopFXEffect(m_Parent->GetObjectID(), killImmediate, name).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
RemoveEffect(name);
|
||||
}
|
||||
@@ -175,7 +181,12 @@ float RenderComponent::DoAnimation(Entity* self, const std::string& animation, b
|
||||
returnlength = animationGroup->animation_length;
|
||||
}
|
||||
}
|
||||
if (sendAnimation) GameMessages::SendPlayAnimation(self, GeneralUtils::ASCIIToUTF16(animation), priority, scale);
|
||||
if (sendAnimation) {
|
||||
GameMessages::PlayAnimation playAnimation(self->GetObjectID(), GeneralUtils::ASCIIToUTF16(animation));
|
||||
playAnimation.fPriority = priority;
|
||||
playAnimation.fScale = scale;
|
||||
playAnimation.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
if (returnlength == 0.0f) LOG("WARNING: Unable to find animation %s for lot %i in any group.", animation.c_str(), self->GetLOT());
|
||||
return returnlength;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "eTriggerEventType.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
std::vector<SwitchComponent*> SwitchComponent::petSwitches;
|
||||
|
||||
@@ -78,7 +79,7 @@ void SwitchComponent::EntityEnter(Entity* entity) {
|
||||
m_Timer = m_ResetTime;
|
||||
|
||||
if (m_PetBouncer != nullptr) {
|
||||
GameMessages::SendPlayFXEffect(m_Parent->GetObjectID(), 2602, u"pettriggeractive", "BounceEffect", LWOOBJID_EMPTY, 1, 1, true);
|
||||
GameMessages::PlayFXEffect(m_Parent->GetObjectID(), 2602, u"pettriggeractive", "BounceEffect").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
RenderComponent::PlayAnimation(m_Parent, u"engaged");
|
||||
m_PetBouncer->SetPetBouncerEnabled(true);
|
||||
} else {
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "MovementAIComponent.h"
|
||||
|
||||
#include <glm/gtc/quaternion.hpp>
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
TriggerComponent::TriggerComponent(Entity* parent, const int32_t componentID, const std::string triggerInfo) : Component(parent, componentID) {
|
||||
m_Parent = parent;
|
||||
@@ -124,7 +125,7 @@ void TriggerComponent::HandleTriggerCommand(LUTriggers::Command* command, Entity
|
||||
HandlePlayEffect(targetEntity, argArray);
|
||||
break;
|
||||
case eTriggerCommandType::STOP_EFFECT:
|
||||
GameMessages::SendStopFXEffect(targetEntity, true, command->args);
|
||||
GameMessages::StopFXEffect(targetEntity->GetObjectID(), true, command->args).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
break;
|
||||
case eTriggerCommandType::CAST_SKILL:
|
||||
HandleCastSkill(targetEntity, command->args);
|
||||
@@ -327,7 +328,19 @@ void TriggerComponent::HandlePlayCinematic(Entity* targetEntity, std::vector<std
|
||||
}
|
||||
}
|
||||
|
||||
GameMessages::SendPlayCinematic(targetEntity->GetObjectID(), GeneralUtils::UTF8ToUTF16(argArray.at(0)), targetEntity->GetSystemAddress(), true, true, false, false, wait, hidePlayer, leadIn, leaveLocked, unlock);
|
||||
GameMessages::PlayCinematic cinematic;
|
||||
cinematic.target = targetEntity->GetObjectID();
|
||||
cinematic.pathName = GeneralUtils::UTF8ToUTF16(argArray.at(0));
|
||||
cinematic.allowGhostUpdates = true;
|
||||
cinematic.bCloseMultiInteract = true;
|
||||
cinematic.bSendServerNotify = false;
|
||||
cinematic.bUseControlledObjectForAudioListener = false;
|
||||
cinematic.endBehavior = wait;
|
||||
cinematic.hidePlayerDuringCine = hidePlayer;
|
||||
cinematic.leadIn = leadIn;
|
||||
cinematic.leavePlayerLockedWhenFinished = leaveLocked;
|
||||
cinematic.lockPlayer = unlock;
|
||||
cinematic.Send(targetEntity->GetSystemAddress());
|
||||
}
|
||||
|
||||
void TriggerComponent::HandleToggleBBB(Entity* targetEntity, std::string args) {
|
||||
@@ -366,7 +379,9 @@ void TriggerComponent::HandlePlayEffect(Entity* targetEntity, std::vector<std::s
|
||||
priority = GeneralUtils::TryParse<float>(argArray.at(3)).value_or(priority);
|
||||
}
|
||||
|
||||
GameMessages::SendPlayFXEffect(targetEntity, effectID.value(), effectType, argArray.at(0), LWOOBJID_EMPTY, priority);
|
||||
GameMessages::PlayFXEffect fx(targetEntity->GetObjectID(), effectID.value(), effectType, argArray.at(0));
|
||||
fx.priority = priority;
|
||||
fx.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
void TriggerComponent::HandleCastSkill(Entity* targetEntity, std::string args) {
|
||||
|
||||
Reference in New Issue
Block a user