Remove inlines

Clean up macros

more tomorrow

Cleanup and optimize CDActivities table

Remove unused include

Further work on CDActivityRewards

Update MasterServer.cpp

Further animations work

Activities still needs work for a better PK.

fix type

All of these replacements worked

Create internal interface for animations

Allows for user to just call GetAnimationTIme or PlayAnimation rather than passing in arbitrary true false statements
This commit is contained in:
David Markowitz
2023-03-20 06:10:52 -07:00
parent 7671cc6865
commit b432a3f5da
84 changed files with 631 additions and 607 deletions

View File

@@ -2,6 +2,7 @@
#include "GameMessages.h"
#include "dServer.h"
#include "VanityUtilities.h"
#include "RenderComponent.h"
void DLUVanityNPC::OnStartup(Entity* self) {
m_NPC = VanityUtilities::GetNPC("averysumner - Destroyer of Worlds");
@@ -17,7 +18,7 @@ void DLUVanityNPC::OnStartup(Entity* self) {
void DLUVanityNPC::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "setupTeleport") {
GameMessages::SendPlayAnimation(self, u"interact");
RenderComponent::PlayAnimation(self, u"interact");
GameMessages::SendPlayFXEffect(self->GetObjectID(), 6478, u"teleportBeam", "teleportBeam");
GameMessages::SendPlayFXEffect(self->GetObjectID(), 6478, u"teleportRings", "teleportRings");

View File

@@ -14,6 +14,7 @@
#include "GameMessages.h"
#include "SkillComponent.h"
#include "eReplicaComponentType.h"
#include "RenderComponent.h"
#include <vector>
@@ -695,11 +696,11 @@ float BossSpiderQueenEnemyServer::PlayAnimAndReturnTime(Entity* self, const std:
//TODO: Get the actual animation time
// Get the anim time
float animTimer = defaultAnimPause; //self:GetAnimationTime{animationID = animID}.time
float animTimer = RenderComponent::GetAnimationTime(self, animID);
// If we have an animation play it
if (animTimer > 0) {
GameMessages::SendPlayAnimation(self, animID);
animTimer = RenderComponent::PlayAnimation(self, animID);
}
// If the anim time is less than the the default time use default

View File

@@ -7,6 +7,7 @@
#include "BaseCombatAIComponent.h"
#include "EntityInfo.h"
#include "eAninmationFlags.h"
#include "RenderComponent.h"
void AmDarklingDragon::OnStartup(Entity* self) {
self->SetVar<int32_t>(u"weakspot", 0);
@@ -70,9 +71,9 @@ 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::SendPlayAnimation(self, u"stunstart", 1.7f);
float animationTime = RenderComponent::PlayAnimation(self, u"stunstart", 1.7f);
self->AddTimer("timeToStunLoop", 1);
self->AddTimer("timeToStunLoop", animationTime);
auto position = self->GetPosition();
auto forward = self->GetRotation().GetForwardVector();
@@ -121,9 +122,9 @@ void AmDarklingDragon::OnTimerDone(Entity* self, std::string timerName) {
} else if (timerName == "ExposeWeakSpotTimer") {
self->SetVar<int32_t>(u"weakspot", 1);
} else if (timerName == "timeToStunLoop") {
GameMessages::SendPlayAnimation(self, u"stunloop", 1.8f);
RenderComponent::PlayAnimation(self, u"stunloop", 1.8f);
} else if (timerName == "ReviveTimer") {
GameMessages::SendPlayAnimation(self, u"stunend", 2.0f);
RenderComponent::PlayAnimation(self, u"stunend", 2.0f);
self->AddTimer("backToAttack", 1);
} else if (timerName == "backToAttack") {
auto* baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();
@@ -153,5 +154,5 @@ void AmDarklingDragon::OnFireEventServerSide(Entity* self, Entity* sender, std::
self->SetVar<LWOOBJID>(u"Golem", sender->GetObjectID());
GameMessages::SendPlayAnimation(self, u"quickbuildhold", 1.9f);
RenderComponent::PlayAnimation(self, u"quickbuildhold", 1.9f);
}

View File

@@ -5,6 +5,7 @@
#include "DestroyableComponent.h"
#include "eAninmationFlags.h"
#include "EntityInfo.h"
#include "RenderComponent.h"
void FvMaelstromDragon::OnStartup(Entity* self) {
self->SetVar<int32_t>(u"weakspot", 0);
@@ -86,9 +87,9 @@ 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::SendPlayAnimation(self, u"stunstart", 1.7f);
RenderComponent::PlayAnimation(self, u"stunstart", 1.7f);
self->AddTimer("timeToStunLoop", 1);
self->AddTimer("timeToStunLoop", 1.0f);
auto position = self->GetPosition();
auto forward = self->GetRotation().GetForwardVector();
@@ -137,10 +138,10 @@ void FvMaelstromDragon::OnTimerDone(Entity* self, std::string timerName) {
} else if (timerName == "ExposeWeakSpotTimer") {
self->SetVar<int32_t>(u"weakspot", 1);
} else if (timerName == "timeToStunLoop") {
GameMessages::SendPlayAnimation(self, u"stunloop", 1.8f);
RenderComponent::PlayAnimation(self, u"stunloop", 1.8f);
} else if (timerName == "ReviveTimer") {
GameMessages::SendPlayAnimation(self, u"stunend", 2.0f);
self->AddTimer("backToAttack", 1);
RenderComponent::PlayAnimation(self, u"stunend", 2.0f);
self->AddTimer("backToAttack", 1.0f);
} else if (timerName == "backToAttack") {
auto* baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();
auto* skillComponent = self->GetComponent<SkillComponent>();
@@ -174,5 +175,5 @@ FvMaelstromDragon::OnFireEventServerSide(Entity* self, Entity* sender, std::stri
self->SetVar<LWOOBJID>(u"Golem", sender->GetObjectID());
GameMessages::SendPlayAnimation(self, u"quickbuildhold", 1.9f);
RenderComponent::PlayAnimation(self, u"quickbuildhold", 1.9f);
}

View File

@@ -6,6 +6,7 @@
#include "EntityInfo.h"
#include "SkillComponent.h"
#include "eAninmationFlags.h"
#include "RenderComponent.h"
void BaseEnemyApe::OnStartup(Entity* self) {
self->SetVar<uint32_t>(u"timesStunned", 2);
@@ -37,7 +38,7 @@ void BaseEnemyApe::OnHit(Entity* self, Entity* attacker) {
if (skillComponent) {
skillComponent->Reset();
}
GameMessages::SendPlayAnimation(self, u"disable", 1.7f);
RenderComponent::PlayAnimation(self, u"disable", 1.7f);
GameMessages::SendChangeIdleFlags(self->GetObjectID(), eAnimationFlags::IDLE_NONE, eAnimationFlags::IDLE_COMBAT, UNASSIGNED_SYSTEM_ADDRESS);
const auto reviveTime = self->GetVar<float_t>(u"reviveTime") != 0.0f
? self->GetVar<float_t>(u"reviveTime") : 12.0f;

View File

@@ -1,6 +1,8 @@
#include "GfApeSmashingQB.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "Entity.h"
#include "RenderComponent.h"
void GfApeSmashingQB::OnStartup(Entity* self) {
self->SetNetworkVar<LWOOBJID>(u"lootTagOwner", self->GetVar<LWOOBJID>(u"lootTagOwner"));
@@ -16,7 +18,7 @@ void GfApeSmashingQB::OnRebuildComplete(Entity* self, Entity* target) {
auto* ape = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"ape"));
if (ape != nullptr) {
ape->OnFireEventServerSide(target, "rebuildDone");
GameMessages::SendPlayAnimation(self, u"smash", 1.7f);
RenderComponent::PlayAnimation(self, u"smash", 1.7f);
self->AddTimer("anchorBreakTime", 1.0f);
}
}

View File

@@ -4,19 +4,15 @@
#include "EntityManager.h"
#include "MissionComponent.h"
#include "eMissionTaskType.h"
#include "RenderComponent.h"
void MaestromExtracticatorServer::OnStartup(Entity* self) {
//self:SetNetworkVar("current_anim", failAnim)
GameMessages::SendPlayAnimation(self, GeneralUtils::ASCIIToUTF16(failAnim));
self->AddTimer("PlayFail", defaultTime);
self->AddTimer("PlayFail", RenderComponent::PlayAnimation(self, failAnim));
self->AddTimer("RemoveSample", destroyAfterNoSampleTime);
}
void MaestromExtracticatorServer::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1,
int32_t param2, int32_t param3) {
if (sender == nullptr)
return;
void MaestromExtracticatorServer::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) {
if (sender == nullptr) return;
if (args == "attemptCollection") {
Entity* player = EntityManager::Instance()->GetEntity(self->GetSpawnerID());
@@ -32,20 +28,17 @@ void MaestromExtracticatorServer::OnFireEventServerSide(Entity* self, Entity* se
}
void MaestromExtracticatorServer::CollectSample(Entity* self, LWOOBJID sampleObj) {
PlayAnimAndReturnTime(self, collectAnim);
self->AddTimer("RemoveSample", defaultTime);
self->AddTimer("RemoveSample", PlayAnimAndReturnTime(self, collectAnim));
}
void MaestromExtracticatorServer::PlayAnimAndReturnTime(Entity* self, std::string animID) {
GameMessages::SendPlayAnimation(self, GeneralUtils::ASCIIToUTF16(animID));
float MaestromExtracticatorServer::PlayAnimAndReturnTime(Entity* self, std::string animID) {
return RenderComponent::PlayAnimation(self, animID);
}
void MaestromExtracticatorServer::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "RemoveSample") {
self->ScheduleKillAfterUpdate();
}
if (timerName == "PlayFail") {
GameMessages::SendPlayAnimation(self, GeneralUtils::ASCIIToUTF16(failAnim));
} else if (timerName == "PlayFail") {
RenderComponent::PlayAnimation(self, failAnim);
}
}

View File

@@ -7,12 +7,11 @@ public:
void OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2,
int32_t param3);
void CollectSample(Entity* self, LWOOBJID sampleObj);
void PlayAnimAndReturnTime(Entity* self, std::string animID);
float PlayAnimAndReturnTime(Entity* self, std::string animID);
void OnTimerDone(Entity* self, std::string timerName);
private:
const std::string failAnim = "idle_maelstrom";
const std::string collectAnim = "collect_maelstrom";
const float defaultTime = 4.0f;
const float destroyAfterNoSampleTime = 8.0f;
};

View File

@@ -1,5 +1,8 @@
#include "AgMonumentBirds.h"
#include "GameMessages.h"
#include "Entity.h"
#include "RenderComponent.h"
#include "EntityManager.h"
//--------------------------------------------------------------
//Makes the ag birds fly away when you get close and smashes them.
@@ -16,7 +19,7 @@ void AgMonumentBirds::OnProximityUpdate(Entity* self, Entity* entering, std::str
if (name == "MonumentBirds" && status == "ENTER") {
self->AddTimer("killBird", 1.0f);
GameMessages::SendPlayAnimation(self, sOnProximityAnim);
RenderComponent::PlayAnimation(self, sOnProximityAnim);
self->SetVar<bool>(u"IsFlying", true);
self->SetVar<LWOOBJID>(u"PlayerID", entering->GetObjectID());
}

View File

@@ -5,6 +5,7 @@
#include "ProximityMonitorComponent.h"
#include "MissionComponent.h"
#include "EntityInfo.h"
#include "RenderComponent.h"
void AmSkullkinDrill::OnStartup(Entity* self) {
self->SetNetworkVar(u"bIsInUse", false);
@@ -70,7 +71,7 @@ void AmSkullkinDrill::OnSkillEventFired(Entity* self, Entity* caster, const std:
}
void AmSkullkinDrill::TriggerDrill(Entity* self) {
GameMessages::SendPlayAnimation(self, u"slowdown");
RenderComponent::PlayAnimation(self, u"slowdown");
self->AddTimer("killDrill", 10.0f);
@@ -170,7 +171,7 @@ void AmSkullkinDrill::OnArrived(Entity* self, uint32_t waypointIndex) {
auto* standObj = GetStandObj(self);
if (waypointIndex == 1) {
GameMessages::SendPlayAnimation(self, u"no-spin");
RenderComponent::PlayAnimation(self, u"no-spin");
GameMessages::SendStopFXEffect(self, true, "active");
GameMessages::SendPlayFXEffect(self->GetObjectID(), -1, u"indicator", "indicator");
@@ -190,7 +191,7 @@ void AmSkullkinDrill::OnArrived(Entity* self, uint32_t waypointIndex) {
return;
} else {
GameMessages::SendPlayAnimation(self, u"idle");
RenderComponent::PlayAnimation(self, u"idle");
GameMessages::SendPlayFXEffect(self->GetObjectID(), -1, u"spin", "active");
GameMessages::SendStopFXEffect(self, true, "indicator");
}
@@ -215,7 +216,7 @@ void AmSkullkinDrill::PlayCinematic(Entity* self) {
void AmSkullkinDrill::PlayAnim(Entity* self, Entity* player, const std::string& animName) {
const auto animTime = animName == "spinjitzu-staff-end" ? 0.5f : 1.0f;
GameMessages::SendPlayAnimation(player, GeneralUtils::ASCIIToUTF16(animName));
RenderComponent::PlayAnimation(player, animName);
self->AddTimer("AnimDone_" + animName, animTime);
}
@@ -308,7 +309,7 @@ void AmSkullkinDrill::OnTimerDone(Entity* self, std::string timerName) {
if (animName == "spinjitzu-staff-windup") {
TriggerDrill(self);
GameMessages::SendPlayAnimation(player, u"spinjitzu-staff-loop");
RenderComponent::PlayAnimation(player, u"spinjitzu-staff-loop");
} else if (animName == "spinjitzu-staff-end") {
FreezePlayer(self, player, false);

View File

@@ -1,6 +1,8 @@
#include "AmSkullkinDrillStand.h"
#include "GameMessages.h"
#include "dpEntity.h"
#include "Entity.h"
#include "RenderComponent.h"
void AmSkullkinDrillStand::OnStartup(Entity* self) {
self->SetVar(u"bActive", true);
@@ -31,5 +33,5 @@ void AmSkullkinDrillStand::OnProximityUpdate(Entity* self, Entity* entering, std
GameMessages::SendPlayFXEffect(entering->GetObjectID(), 1378, u"create", "pushBack");
GameMessages::SendPlayAnimation(entering, u"knockback-recovery");
RenderComponent::PlayAnimation(entering, u"knockback-recovery");
}

View File

@@ -5,6 +5,7 @@
#include "EntityInfo.h"
#include "GameMessages.h"
#include "MissionComponent.h"
#include "RenderComponent.h"
void AmSkullkinTower::OnStartup(Entity* self) {
self->SetProximityRadius(20, "Tower");
@@ -117,13 +118,13 @@ void AmSkullkinTower::OnChildRemoved(Entity* self, Entity* child) {
self->SetVar(u"legTable", legTable);
if (legTable.size() == 2) {
GameMessages::SendPlayAnimation(self, u"wobble-1");
RenderComponent::PlayAnimation(self, u"wobble-1");
} else if (legTable.size() == 1) {
GameMessages::SendPlayAnimation(self, u"wobble-2");
RenderComponent::PlayAnimation(self, u"wobble-2");
} else if (legTable.empty()) {
const auto animTime = 2.5f;
GameMessages::SendPlayAnimation(self, u"fall");
RenderComponent::PlayAnimation(self, u"fall");
self->AddTimer("spawnGuys", animTime - 0.2f);

View File

@@ -2,6 +2,7 @@
#include "GameMessages.h"
#include "EntityManager.h"
#include "MissionComponent.h"
#include "RenderComponent.h"
void GfCaptainsCannon::OnUse(Entity* self, Entity* user) {
if (self->GetVar<bool>(u"bIsInUse")) {
@@ -27,7 +28,7 @@ void GfCaptainsCannon::OnUse(Entity* self, Entity* user) {
GameMessages::SendTeleport(user->GetObjectID(), position, rotation, user->GetSystemAddress());
GameMessages::SendPlayAnimation(user, u"cannon-strike-no-equip");
RenderComponent::PlayAnimation(user, u"cannon-strike-no-equip");
GameMessages::SendPlayFXEffect(user->GetObjectID(), 6039, u"hook", "hook", LWOOBJID_EMPTY, 1, 1, true);
@@ -58,7 +59,7 @@ void GfCaptainsCannon::OnTimerDone(Entity* self, std::string timerName) {
for (auto* shark : sharkObjects) {
if (shark->GetLOT() != m_SharkItemID) continue;
GameMessages::SendPlayAnimation(shark, u"cannon");
RenderComponent::PlayAnimation(shark, u"cannon");
}
GameMessages::SendPlay2DAmbientSound(player, "{7457d85c-4537-4317-ac9d-2f549219ea87}");

View File

@@ -5,6 +5,7 @@
#include "RenderComponent.h"
#include "eMissionTaskType.h"
#include "eReplicaComponentType.h"
#include "RenderComponent.h"
void GfTikiTorch::OnStartup(Entity* self) {
LightTorch(self);
@@ -16,7 +17,7 @@ void GfTikiTorch::OnUse(Entity* self, Entity* killer) {
return;
}
GameMessages::SendPlayAnimation(self, u"interact");
RenderComponent::PlayAnimation(self, u"interact");
self->SetI64(u"userID", killer->GetObjectID());
for (int i = 0; i < m_numspawn; i++) {
@@ -55,7 +56,7 @@ void GfTikiTorch::LightTorch(Entity* self) {
void GfTikiTorch::OnSkillEventFired(Entity* self, Entity* caster, const std::string& message) {
if (self->GetBoolean(u"isBurning") && message == "waterspray") {
GameMessages::SendPlayAnimation(self, u"water");
RenderComponent::PlayAnimation(self, u"water");
auto* renderComponent = self->GetComponent<RenderComponent>();
if (renderComponent != nullptr) {

View File

@@ -8,6 +8,7 @@
#define _USE_MATH_DEFINES
#include <math.h>
#endif
#include "RenderComponent.h"
void MastTeleport::OnStartup(Entity* self) {
self->SetNetworkVar<std::string>(u"hookPreconditions", "154;44", UNASSIGNED_SYSTEM_ADDRESS);
@@ -58,11 +59,12 @@ void MastTeleport::OnTimerDone(Entity* self, std::string timerName) {
GameMessages::SendPlayFXEffect(playerId, 6039, u"hook", "hook", LWOOBJID_EMPTY, 1, 1, true);
GameMessages::SendPlayAnimation(player, u"crow-swing-no-equip", 4.0f);
float animationTime = 6.25f;
animationTime = RenderComponent::PlayAnimation(player, "crow-swing-no-equip", 4.0f);
GameMessages::SendPlayAnimation(self, u"swing");
RenderComponent::PlayAnimation(self, u"swing");
self->AddTimer("PlayerAnimDone", 6.25f);
self->AddTimer("PlayerAnimDone", animationTime);
} else if (timerName == "PlayerAnimDone") {
GameMessages::SendStopFXEffect(player, true, "hook");

View File

@@ -4,6 +4,7 @@
#include "MissionComponent.h"
#include "SkillComponent.h"
#include "eMissionTaskType.h"
#include "RenderComponent.h"
//TODO: this has to be updated so that you only get killed if you're in a certain radius.
//And so that all entities in a certain radius are killed, not just the attacker.
@@ -69,23 +70,6 @@ void ExplodingAsset::OnHit(Entity* self, Entity* attacker) {
}
void ExplodingAsset::OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) {
/*
if msg.objId:BelongsToFaction{factionID = 1}.bIsInFaction then
if (msg.status == "ENTER") then
self:PlayAnimation{ animationID = "bounce" }
self:PlayFXEffect{ name = "bouncin", effectType = "anim" }
self:SetVar("playersNearChest", (self:GetVar("playersNearChest") + 1 ))
elseif (msg.status == "LEAVE") then
self:SetVar("playersNearChest", (self:GetVar("playersNearChest") - 1 ))
if self:GetVar("playersNearChest") < 1 then
self:PlayAnimation{ animationID = "idle" }
self:StopFXEffect{ name = "bouncin" }
self:SetVar("playersNearChest", 0)
end
end
end
*/
auto* destuctableComponent = entering->GetComponent<DestroyableComponent>();
if (destuctableComponent == nullptr) return;
@@ -95,14 +79,14 @@ void ExplodingAsset::OnProximityUpdate(Entity* self, Entity* entering, std::stri
if (!std::count(factions.begin(), factions.end(), 1)) return;
if (status == "ENTER") {
GameMessages::SendPlayAnimation(self, u"bounce");
RenderComponent::PlayAnimation(self, u"bounce");
GameMessages::SendPlayFXEffect(self, -1, u"anim", "bouncin", LWOOBJID_EMPTY, 1, 1, true);
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) {
GameMessages::SendPlayAnimation(self, u"idle");
RenderComponent::PlayAnimation(self, u"idle");
GameMessages::SendStopFXEffect(self, true, "bouncin");
self->SetVar<int32_t>(u"playersNearChest", 0);
}

View File

@@ -1,6 +1,8 @@
#include "NjIceRailActivator.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "Entity.h"
#include "RenderComponent.h"
void NjIceRailActivator::OnPlayerRailArrived(Entity* self, Entity* sender, const std::u16string& pathName,
int32_t waypoint) {
@@ -9,7 +11,7 @@ void NjIceRailActivator::OnPlayerRailArrived(Entity* self, Entity* sender, const
const auto& blockGroup = self->GetVar<std::u16string>(BlockGroupVariable);
for (auto* block : EntityManager::Instance()->GetEntitiesInGroup(GeneralUtils::UTF16ToWTF8(blockGroup))) {
GameMessages::SendPlayAnimation(block, u"explode");
RenderComponent::PlayAnimation(block, u"explode");
const auto blockID = block->GetObjectID();

View File

@@ -4,6 +4,7 @@
#include "MissionComponent.h"
#include "eMissionTaskType.h"
#include "eMissionState.h"
#include "RenderComponent.h"
void NtAssemblyTubeServer::OnStartup(Entity* self) {
self->SetProximityRadius(5, "teleport");
@@ -49,7 +50,7 @@ void NtAssemblyTubeServer::RunAssemblyTube(Entity* self, Entity* player) {
);
}
GameMessages::SendPlayAnimation(player, u"tube-sucker", 4.0f);
RenderComponent::PlayAnimation(player, u"tube-sucker", 4.0f);
const auto animTime = 3;
@@ -82,7 +83,7 @@ void NtAssemblyTubeServer::TeleportPlayer(Entity* self, Entity* player) {
GameMessages::SendTeleport(player->GetObjectID(), destPosition, destRotation, player->GetSystemAddress(), true);
GameMessages::SendPlayAnimation(player, u"tube-resurrect", 4.0f);
RenderComponent::PlayAnimation(player, u"tube-resurrect", 4.0f);
const auto animTime = 2;

View File

@@ -4,6 +4,7 @@
#include "EntityManager.h"
#include "Character.h"
#include "eMissionState.h"
#include "RenderComponent.h"
void NtParadoxPanelServer::OnUse(Entity* self, Entity* user) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"bActive", 1, 0, user->GetObjectID(), "", user->GetSystemAddress());
@@ -32,18 +33,18 @@ void NtParadoxPanelServer::OnUse(Entity* self, Entity* user) {
player->GetCharacter()->SetPlayerFlag(flag, true);
GameMessages::SendPlayAnimation(player, u"rebuild-celebrate");
RenderComponent::PlayAnimation(player, u"rebuild-celebrate");
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"SparkStop", 0, 0, player->GetObjectID(), "", player->GetSystemAddress());
GameMessages::SendSetStunned(player->GetObjectID(), eStateChangeType::POP, player->GetSystemAddress(), LWOOBJID_EMPTY, false, false, true, false, true, true, false, false, true);
self->SetVar(u"bActive", false);
});
GameMessages::SendPlayAnimation(user, u"nexus-powerpanel", 6.0f);
RenderComponent::PlayAnimation(user, u"nexus-powerpanel", 6.0f);
GameMessages::SendSetStunned(user->GetObjectID(), eStateChangeType::PUSH, user->GetSystemAddress(), LWOOBJID_EMPTY, false, false, true, false, true, true, false, false, true);
return;
}
GameMessages::SendPlayAnimation(user, shockAnim);
RenderComponent::PlayAnimation(user, shockAnim);
const auto dir = self->GetRotation().GetRightVector();

View File

@@ -3,6 +3,7 @@
#include "EntityManager.h"
#include "MissionComponent.h"
#include "eMissionTaskType.h"
#include "RenderComponent.h"
void NtParadoxTeleServer::OnStartup(Entity* self) {
self->SetProximityRadius(5, "teleport");
@@ -27,7 +28,7 @@ void NtParadoxTeleServer::OnProximityUpdate(Entity* self, Entity* entering, std:
true, true, true, true, true, true, true
);
GameMessages::SendPlayAnimation(player, u"teledeath", 4.0f);
RenderComponent::PlayAnimation(player, u"teledeath", 4.0f);
const auto animTime = 2;
@@ -73,7 +74,7 @@ void NtParadoxTeleServer::TeleportPlayer(Entity* self, Entity* player) {
GameMessages::SendTeleport(player->GetObjectID(), destPosition, destRotation, player->GetSystemAddress(), true);
GameMessages::SendPlayAnimation(player, u"paradox-teleport-in", 4.0f);
RenderComponent::PlayAnimation(player, u"paradox-teleport-in", 4.0f);
const auto animTime = 2;

View File

@@ -1,6 +1,7 @@
#include "NtSleepingGuard.h"
#include "GameMessages.h"
#include "MissionComponent.h"
#include "RenderComponent.h"
void NtSleepingGuard::OnStartup(Entity* self) {
self->SetNetworkVar<bool>(u"asleep", true);
@@ -17,7 +18,7 @@ void NtSleepingGuard::OnEmoteReceived(Entity* self, const int32_t emote, Entity*
// Set asleep to false
self->SetNetworkVar<bool>(u"asleep", false);
GameMessages::SendPlayAnimation(self, u"greet");
RenderComponent::PlayAnimation(self, u"greet");
auto* missionComponent = target->GetComponent<MissionComponent>();

View File

@@ -1,6 +1,9 @@
#include "NtVentureCannonServer.h"
#include "GameMessages.h"
#include "EntityManager.h"
#include "Entity.h"
#include "GeneralUtils.h"
#include "RenderComponent.h"
void NtVentureCannonServer::OnUse(Entity* self, Entity* user) {
auto* player = user;
@@ -26,7 +29,7 @@ void NtVentureCannonServer::OnUse(Entity* self, Entity* user) {
GameMessages::SendTeleport(playerID, destPosition, destRotation, player->GetSystemAddress(), true);
GameMessages::SendPlayAnimation(player, u"scale-down", 4.0f);
RenderComponent::PlayAnimation(player, u"scale-down", 4.0f);
const auto enterCinematicUname = enterCinematic;
GameMessages::SendPlayCinematic(player->GetObjectID(), enterCinematicUname, player->GetSystemAddress());
@@ -118,5 +121,5 @@ void NtVentureCannonServer::FirePlayer(Entity* self, Entity* player) {
GameMessages::SendTeleport(player->GetObjectID(), destPosition, destRotation, player->GetSystemAddress(), true);
GameMessages::SendPlayAnimation(player, u"venture-cannon-out", 4.0f);
RenderComponent::PlayAnimation(player, u"venture-cannon-out", 4.0f);
}

View File

@@ -1,6 +1,8 @@
#include "CatapultBaseServer.h"
#include "GameMessages.h"
#include "EntityManager.h"
#include "Entity.h"
#include "RenderComponent.h"
void CatapultBaseServer::OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) {
if (name == "BouncerBuilt") {
@@ -21,7 +23,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) {
GameMessages::SendPlayAnimation(obj, u"idle-platform");
RenderComponent::PlayAnimation(obj, u"idle-platform");
GameMessages::SendPlayNDAudioEmitter(obj, UNASSIGNED_SYSTEM_ADDRESS, "{8cccf912-69e3-4041-a20b-63e4afafc993}");
// set the art so we can use it again
self->SetVar(u"Arm", obj->GetObjectID());
@@ -38,7 +40,7 @@ void CatapultBaseServer::OnTimerDone(Entity* self, std::string timerName) {
// tell the arm to player the launcher animation
auto animTime = 1;
self->AddTimer("resetArm", animTime);
GameMessages::SendPlayAnimation(arm, u"launch");
RenderComponent::PlayAnimation(arm, u"launch");
} else if (timerName == "bounce") {
auto* bouncer = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"Bouncer"));
if (bouncer == nullptr) return;
@@ -52,7 +54,7 @@ void CatapultBaseServer::OnTimerDone(Entity* self, std::string timerName) {
if (arm == nullptr) return;
// set the arm back to natural state
GameMessages::SendPlayAnimation(arm, u"idle");
RenderComponent::PlayAnimation(arm, u"idle");
auto* bouncer = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"Bouncer"));
if (bouncer == nullptr) return;

View File

@@ -4,6 +4,7 @@
#include "GameMessages.h"
#include "Character.h"
#include "dZoneManager.h"
#include "RenderComponent.h"
void CavePrisonCage::OnStartup(Entity* self) {
const auto& myNum = self->GetVar<std::u16string>(u"myNumber");
@@ -101,7 +102,7 @@ void CavePrisonCage::SpawnCounterweight(Entity* self, Spawner* spawner) {
}
// Play the 'down' animation on the button
GameMessages::SendPlayAnimation(button, u"down");
RenderComponent::PlayAnimation(button, u"down");
// Setup a timer named 'buttonGoingDown' to be triggered in 5 seconds
self->AddTimer("buttonGoingDown", 5.0f);
@@ -136,13 +137,13 @@ void CavePrisonCage::OnTimerDone(Entity* self, std::string timerName) {
// the anim of the button down is over
if (timerName == "buttonGoingDown") {
// Play the 'up' animation
GameMessages::SendPlayAnimation(self, u"up");
RenderComponent::PlayAnimation(self, u"up");
// Setup a timer named 'CageOpen' to be triggered in 1 second
self->AddTimer("CageOpen", 1.0f);
} else if (timerName == "CageOpen") {
// play the idle open anim
GameMessages::SendPlayAnimation(self, u"idle-up");
RenderComponent::PlayAnimation(self, u"idle-up");
// Get the villeger
auto* villager = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"villager"));
@@ -199,13 +200,13 @@ void CavePrisonCage::OnTimerDone(Entity* self, std::string timerName) {
}
// Play the 'up' animation on the button
GameMessages::SendPlayAnimation(button, u"up");
RenderComponent::PlayAnimation(button, u"up");
// Setup a timer named 'CageClosed' to be triggered in 1 second
self->AddTimer("CageClosed", 1.0f);
} else if (timerName == "CageClosed") {
// play the idle closed anim
GameMessages::SendPlayAnimation(self, u"idle");
RenderComponent::PlayAnimation(self, u"idle");
// Setup a timer named 'ResetPrison' to be triggered in 10 seconds
self->AddTimer("ResetPrison", 10.0f);

View File

@@ -9,6 +9,7 @@
#include "SkillComponent.h"
#include "TeamManager.h"
#include <algorithm>
#include "RenderComponent.h"
// // // // // // //
// Event handling //
@@ -261,7 +262,7 @@ void NjMonastryBossInstance::HandleCounterWeightSpawned(Entity* self, Entity* co
skillComponent->CalculateBehavior(1635, 39097, frakjaw->GetObjectID(), true, false);
}
GameMessages::SendPlayAnimation(frakjaw, StunnedAnimation);
RenderComponent::PlayAnimation(frakjaw, StunnedAnimation);
GameMessages::SendPlayNDAudioEmitter(frakjaw, UNASSIGNED_SYSTEM_ADDRESS, CounterSmashAudio);
// Before wave 4 we should lower frakjaw from the ledge
@@ -281,7 +282,7 @@ void NjMonastryBossInstance::HandleCounterWeightSpawned(Entity* self, Entity* co
}
void NjMonastryBossInstance::HandleLowerFrakjawSpawned(Entity* self, Entity* lowerFrakjaw) {
GameMessages::SendPlayAnimation(lowerFrakjaw, TeleportInAnimation);
RenderComponent::PlayAnimation(lowerFrakjaw, TeleportInAnimation);
self->SetVar<LWOOBJID>(LowerFrakjawVariable, lowerFrakjaw->GetObjectID());
auto* combatAI = lowerFrakjaw->GetComponent<BaseCombatAIComponent>();
@@ -401,7 +402,7 @@ void NjMonastryBossInstance::TeleportPlayer(Entity* player, uint32_t position) {
void NjMonastryBossInstance::SummonWave(Entity* self, Entity* frakjaw) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0, LWOOBJID_EMPTY,
LedgeFrakSummon, UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::SendPlayAnimation(frakjaw, SummonAnimation);
RenderComponent::PlayAnimation(frakjaw, SummonAnimation);
// Stop the music for the first, fourth and fifth wave
const auto wave = self->GetVar<uint32_t>(WaveNumberVariable);
@@ -425,7 +426,7 @@ void NjMonastryBossInstance::LowerFrakjawSummon(Entity* self, Entity* frakjaw) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0,
LWOOBJID_EMPTY, BottomFrakSummon, UNASSIGNED_SYSTEM_ADDRESS);
ActivityTimerStart(self, SpawnWaveTimer, 2.0f, 2.0f);
GameMessages::SendPlayAnimation(frakjaw, SummonAnimation);
RenderComponent::PlayAnimation(frakjaw, SummonAnimation);
}
void NjMonastryBossInstance::RemovePoison(Entity* self) {
@@ -444,7 +445,7 @@ void NjMonastryBossInstance::RemovePoison(Entity* self) {
}
void NjMonastryBossInstance::LowerFrakjaw(Entity* self, Entity* frakjaw) {
GameMessages::SendPlayAnimation(frakjaw, TeleportOutAnimation);
RenderComponent::PlayAnimation(frakjaw, TeleportOutAnimation);
ActivityTimerStart(self, LowerFrakjawCamTimer, 2.0f, 2.0f);
GameMessages::SendNotifyClientObject(frakjaw->GetObjectID(), StopMusicNotification, 0, 0,