mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
Merge remote-tracking branch 'upstream/main' into first-draft-leaderboard-re-write
This commit is contained in:
@@ -2,56 +2,27 @@
|
||||
|
||||
#include "PhantomPhysicsComponent.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "EntityManager.h"
|
||||
#include "AgMonumentLaserServer.h"
|
||||
#include "EntityManager.h"
|
||||
#include "ePhysicsEffectType.h"
|
||||
#include "eReplicaComponentType.h"
|
||||
|
||||
void AgLaserSensorServer::OnStartup(Entity* self) {
|
||||
|
||||
PhantomPhysicsComponent* physComp = static_cast<PhantomPhysicsComponent*>(self->GetComponent(eReplicaComponentType::PHANTOM_PHYSICS));
|
||||
physComp->SetPhysicsEffectActive(true);
|
||||
physComp->SetEffectType(ePhysicsEffectType::REPULSE);
|
||||
physComp->SetDirectionalMultiplier(static_cast<float>(m_RepelForce));
|
||||
physComp->SetDirection(NiPoint3::UNIT_Y);
|
||||
|
||||
m_Skill = self->GetComponent<SkillComponent>();
|
||||
self->SetBoolean(u"active", true);
|
||||
auto repelForce = self->GetVarAs<float>(u"repelForce");
|
||||
if (!repelForce) repelForce = m_RepelForce;
|
||||
auto* phantomPhysicsComponent = self->GetComponent<PhantomPhysicsComponent>();
|
||||
if (!phantomPhysicsComponent) return;
|
||||
phantomPhysicsComponent->SetPhysicsEffectActive(true);
|
||||
phantomPhysicsComponent->SetEffectType(ePhysicsEffectType::REPULSE);
|
||||
phantomPhysicsComponent->SetDirectionalMultiplier(repelForce);
|
||||
phantomPhysicsComponent->SetDirection(NiPoint3::UNIT_Y);
|
||||
}
|
||||
|
||||
|
||||
void AgLaserSensorServer::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
|
||||
if (!m_Skill) return;
|
||||
|
||||
|
||||
Entity* laser = nullptr;
|
||||
|
||||
for (auto script : EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::SCRIPT)) {
|
||||
|
||||
AgMonumentLaserServer* hasLaser = (AgMonumentLaserServer*)script;
|
||||
|
||||
if (hasLaser) {
|
||||
const auto source = script->GetPosition();
|
||||
const auto obj = self->GetObjectID();
|
||||
|
||||
if (obj == 76690936093053 && Vector3::DistanceSquared(source, NiPoint3(149.007f, 417.083f, 218.346f)) <= 1.0f) {
|
||||
laser = script;
|
||||
break;
|
||||
} else if (obj == 75866302318824 && Vector3::DistanceSquared(source, NiPoint3(48.6403f, 403.803f, 196.711f)) <= 1.0f) {
|
||||
laser = script;
|
||||
break;
|
||||
} else if (obj == 75866302318822 && Vector3::DistanceSquared(source, NiPoint3(19.2155f, 420.083f, 249.226f)) <= 1.0f) {
|
||||
laser = script;
|
||||
break;
|
||||
} else if (obj == 75866302318823 && Vector3::DistanceSquared(source, NiPoint3(-6.61596f, 404.633f, 274.323f)) <= 1.0f) {
|
||||
laser = script;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (laser != nullptr) {
|
||||
m_Skill->CalculateBehavior(m_SkillCastID, 15714, target->GetObjectID());
|
||||
}
|
||||
auto active = self->GetVar<bool>(u"active");
|
||||
if (!active) return;
|
||||
auto skillCastID = self->GetVarAs<float>(u"skillCastID");
|
||||
if (skillCastID == 0) skillCastID = m_SkillCastID;
|
||||
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||
if (!skillComponent) return;
|
||||
skillComponent->CastSkill(m_SkillCastID, target->GetObjectID());
|
||||
}
|
||||
|
@@ -8,8 +8,7 @@ public:
|
||||
void OnStartup(Entity* self);
|
||||
void OnCollisionPhantom(Entity* self, Entity* target);
|
||||
private:
|
||||
SkillComponent* m_Skill;
|
||||
int m_RepelForce = -25;
|
||||
float m_RepelForce = -25.0f;
|
||||
int m_SkillCastID = 163;
|
||||
};
|
||||
|
||||
|
@@ -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());
|
||||
}
|
||||
|
@@ -1,20 +1,17 @@
|
||||
#include "AgMonumentLaserServer.h"
|
||||
#include "EntityManager.h"
|
||||
|
||||
void AgMonumentLaserServer::OnStartup(Entity* self) {
|
||||
/*
|
||||
self->SetProximityRadius(m_Radius, "MonumentLaser");
|
||||
|
||||
std::cout << "Monument Laser " << self->GetObjectID() << " is at " << self->GetPosition().GetX()
|
||||
<< ","<< self->GetPosition().GetY() << "," << self->GetPosition().GetZ() << std::endl;
|
||||
*/
|
||||
}
|
||||
|
||||
void AgMonumentLaserServer::OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) {
|
||||
/*
|
||||
if (status == "ENTER") {
|
||||
|
||||
std::cout << "Monument laser ID: " << self->GetObjectID() << std::endl;
|
||||
auto lasers = EntityManager::Instance()->GetEntitiesInGroup(self->GetVarAsString(u"volGroup"));
|
||||
for (auto laser : lasers) {
|
||||
if (laser) laser->SetBoolean(u"active", true);
|
||||
}
|
||||
}
|
||||
|
||||
void AgMonumentLaserServer::OnDie(Entity* self, Entity* killer) {
|
||||
auto lasers = EntityManager::Instance()->GetEntitiesInGroup(self->GetVarAsString(u"volGroup"));
|
||||
for (auto laser : lasers) {
|
||||
if (laser) laser->SetBoolean(u"active", false);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
@@ -3,8 +3,6 @@
|
||||
|
||||
class AgMonumentLaserServer : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self);
|
||||
void OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status);
|
||||
private:
|
||||
float m_Radius = 25.0f;
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnDie(Entity* self, Entity* killer) override;
|
||||
};
|
||||
|
@@ -9,8 +9,8 @@ void ZoneAgSpiderQueen::SetGameVariables(Entity* self) {
|
||||
ZoneAgProperty::SetGameVariables(self);
|
||||
|
||||
// Disable property flags
|
||||
self->SetVar<uint32_t>(defeatedProperyFlag, 0);
|
||||
self->SetVar<uint32_t>(placedModelFlag, 0);
|
||||
self->SetVar<int32_t>(defeatedProperyFlag, 0);
|
||||
self->SetVar<int32_t>(placedModelFlag, 0);
|
||||
self->SetVar<uint32_t>(guardFirstMissionFlag, 0);
|
||||
self->SetVar<uint32_t>(guardMissionFlag, 0);
|
||||
self->SetVar<uint32_t>(brickLinkMissionIDFlag, 0);
|
||||
|
@@ -18,7 +18,7 @@ void AmBlueX::OnSkillEventFired(Entity* self, Entity* caster, const std::string&
|
||||
|
||||
auto* character = caster->GetCharacter();
|
||||
if (character != nullptr) {
|
||||
character->SetPlayerFlag(self->GetVar<uint32_t>(m_FlagVariable), true);
|
||||
character->SetPlayerFlag(self->GetVar<int32_t>(m_FlagVariable), true);
|
||||
}
|
||||
|
||||
EntityInfo info{};
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#include "AmConsoleTeleportServer.h"
|
||||
#include "ChooseYourDestinationNsToNt.h"
|
||||
#include "AMFFormat.h"
|
||||
#include "Amf3.h"
|
||||
|
||||
void AmConsoleTeleportServer::OnStartup(Entity* self) {
|
||||
self->SetVar(u"teleportAnim", m_TeleportAnim);
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include "ProximityMonitorComponent.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "EntityInfo.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "eStateChangeType.h"
|
||||
|
||||
void AmSkullkinDrill::OnStartup(Entity* self) {
|
||||
@@ -71,7 +72,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);
|
||||
|
||||
@@ -171,7 +172,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");
|
||||
|
||||
@@ -191,7 +192,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");
|
||||
}
|
||||
@@ -216,7 +217,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);
|
||||
}
|
||||
@@ -309,7 +310,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);
|
||||
|
||||
|
@@ -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");
|
||||
}
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -2,6 +2,7 @@
|
||||
#include "GameMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "eTerminateType.h"
|
||||
#include "eStateChangeType.h"
|
||||
|
||||
@@ -29,7 +30,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);
|
||||
|
||||
@@ -60,7 +61,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}");
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include "RenderComponent.h"
|
||||
#include "eMissionTaskType.h"
|
||||
#include "eReplicaComponentType.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "eTerminateType.h"
|
||||
|
||||
void GfTikiTorch::OnStartup(Entity* self) {
|
||||
@@ -17,7 +18,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++) {
|
||||
@@ -56,7 +57,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) {
|
||||
|
@@ -10,6 +10,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);
|
||||
@@ -43,10 +44,13 @@ void MastTeleport::OnTimerDone(Entity* self, std::string timerName) {
|
||||
GameMessages::SendTeleport(playerId, position, rotation, player->GetSystemAddress(), true);
|
||||
|
||||
// Hacky fix for odd rotations
|
||||
if (self->GetVar<std::u16string>(u"MastName") != u"Jail") {
|
||||
auto mastName = self->GetVar<std::u16string>(u"MastName");
|
||||
if (mastName == u"Elephant") {
|
||||
GameMessages::SendOrientToAngle(playerId, true, (M_PI / 180) * 140.0f, player->GetSystemAddress());
|
||||
} else {
|
||||
} else if (mastName == u"Jail") {
|
||||
GameMessages::SendOrientToAngle(playerId, true, (M_PI / 180) * 100.0f, player->GetSystemAddress());
|
||||
} else if (mastName == u""){
|
||||
GameMessages::SendOrientToAngle(playerId, true, (M_PI / 180) * 203.0f, player->GetSystemAddress());
|
||||
}
|
||||
|
||||
const auto cinematic = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Cinematic"));
|
||||
@@ -60,11 +64,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");
|
||||
|
||||
|
@@ -1,24 +1,24 @@
|
||||
#include "BankInteractServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "Entity.h"
|
||||
#include "AMFFormat.h"
|
||||
#include "Amf3.h"
|
||||
|
||||
void BankInteractServer::OnUse(Entity* self, Entity* user) {
|
||||
AMFArrayValue args;
|
||||
AMFStringValue* bank = new AMFStringValue();
|
||||
bank->SetStringValue("bank");
|
||||
args.InsertValue("state", bank);
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "pushGameState", &args);
|
||||
args.Insert("state", "bank");
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "pushGameState", args);
|
||||
}
|
||||
|
||||
void BankInteractServer::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1,
|
||||
int32_t param2, int32_t param3) {
|
||||
if (args == "ToggleBank") {
|
||||
AMFArrayValue args;
|
||||
args.InsertValue("visible", new AMFFalseValue());
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(sender, sender->GetSystemAddress(), "ToggleBank", &args);
|
||||
args.Insert("visible", false);
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(sender, sender->GetSystemAddress(), "ToggleBank", args);
|
||||
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"CloseBank", 0, 0, LWOOBJID_EMPTY, "", sender->GetSystemAddress());
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -1,19 +1,20 @@
|
||||
#include "MailBoxServer.h"
|
||||
#include "AMFFormat.h"
|
||||
#include "Amf3.h"
|
||||
#include "GameMessages.h"
|
||||
#include "Entity.h"
|
||||
|
||||
void MailBoxServer::OnUse(Entity* self, Entity* user) {
|
||||
AMFStringValue* value = new AMFStringValue();
|
||||
value->SetStringValue("Mail");
|
||||
AMFArrayValue args;
|
||||
args.InsertValue("state", value);
|
||||
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "pushGameState", &args);
|
||||
|
||||
args.Insert("state", "Mail");
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "pushGameState", args);
|
||||
}
|
||||
|
||||
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.InsertValue("visible", new AMFFalseValue());
|
||||
GameMessages::SendUIMessageServerToSingleClient(sender, sender->GetSystemAddress(), "ToggleMail", &args);
|
||||
args.Insert("visible", false);
|
||||
GameMessages::SendUIMessageServerToSingleClient(sender, sender->GetSystemAddress(), "ToggleMail", args);
|
||||
}
|
||||
}
|
||||
|
@@ -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();
|
||||
|
||||
|
@@ -2,7 +2,8 @@
|
||||
#include "Character.h"
|
||||
#include "GameMessages.h"
|
||||
#include "dServer.h"
|
||||
#include "AMFFormat.h"
|
||||
#include "Amf3.h"
|
||||
#include "Entity.h"
|
||||
|
||||
void StoryBoxInteractServer::OnUse(Entity* self, Entity* user) {
|
||||
if (self->GetVar<bool>(u"hasCustomText")) {
|
||||
@@ -11,24 +12,18 @@ void StoryBoxInteractServer::OnUse(Entity* self, Entity* user) {
|
||||
{
|
||||
AMFArrayValue args;
|
||||
|
||||
auto* state = new AMFStringValue();
|
||||
state->SetStringValue("Story");
|
||||
args.Insert("state", "Story");
|
||||
|
||||
args.InsertValue("state", state);
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "pushGameState", &args);
|
||||
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "pushGameState", args);
|
||||
}
|
||||
|
||||
user->AddCallbackTimer(0.1f, [user, customText]() {
|
||||
AMFArrayValue args;
|
||||
|
||||
auto* text = new AMFStringValue();
|
||||
text->SetStringValue(customText);
|
||||
args.Insert("visible", true);
|
||||
args.Insert("text", customText);
|
||||
|
||||
args.InsertValue("visible", new AMFTrueValue());
|
||||
args.InsertValue("text", text);
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "ToggleStoryBox", &args);
|
||||
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "ToggleStoryBox", args);
|
||||
});
|
||||
|
||||
return;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include "NsLegoClubDoor.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "AMFFormat.h"
|
||||
#include "Amf3.h"
|
||||
|
||||
void NsLegoClubDoor::OnStartup(Entity* self) {
|
||||
self->SetVar(u"currentZone", (int32_t)dZoneManager::Instance()->GetZoneID().GetMapID());
|
||||
@@ -12,116 +12,56 @@ void NsLegoClubDoor::OnStartup(Entity* self) {
|
||||
|
||||
args = {};
|
||||
|
||||
AMFStringValue* callbackClient = new AMFStringValue();
|
||||
callbackClient->SetStringValue(std::to_string(self->GetObjectID()));
|
||||
args.InsertValue("callbackClient", callbackClient);
|
||||
args.Insert("callbackClient", std::to_string(self->GetObjectID()));
|
||||
args.Insert("strIdentifier", "choiceDoor");
|
||||
args.Insert("title", "%[UI_CHOICE_DESTINATION]");
|
||||
|
||||
AMFStringValue* strIdentifier = new AMFStringValue();
|
||||
strIdentifier->SetStringValue("choiceDoor");
|
||||
args.InsertValue("strIdentifier", strIdentifier);
|
||||
|
||||
AMFStringValue* title = new AMFStringValue();
|
||||
title->SetStringValue("%[UI_CHOICE_DESTINATION]");
|
||||
args.InsertValue("title", title);
|
||||
|
||||
AMFArrayValue* choiceOptions = new AMFArrayValue();
|
||||
AMFArrayValue* choiceOptions = args.InsertArray("options");
|
||||
|
||||
{
|
||||
AMFArrayValue* nsArgs = new AMFArrayValue();
|
||||
AMFArrayValue* nsArgs = choiceOptions->PushArray();
|
||||
|
||||
AMFStringValue* image = new AMFStringValue();
|
||||
image->SetStringValue("textures/ui/zone_thumnails/Nimbus_Station.dds");
|
||||
nsArgs->InsertValue("image", image);
|
||||
|
||||
AMFStringValue* caption = new AMFStringValue();
|
||||
caption->SetStringValue("%[UI_CHOICE_NS]");
|
||||
nsArgs->InsertValue("caption", caption);
|
||||
|
||||
AMFStringValue* identifier = new AMFStringValue();
|
||||
identifier->SetStringValue("zoneID_1200");
|
||||
nsArgs->InsertValue("identifier", identifier);
|
||||
|
||||
AMFStringValue* tooltipText = new AMFStringValue();
|
||||
tooltipText->SetStringValue("%[UI_CHOICE_NS_HOVER]");
|
||||
nsArgs->InsertValue("tooltipText", tooltipText);
|
||||
|
||||
choiceOptions->PushBackValue(nsArgs);
|
||||
nsArgs->Insert("image", "textures/ui/zone_thumnails/Nimbus_Station.dds");
|
||||
nsArgs->Insert("caption", "%[UI_CHOICE_NS]");
|
||||
nsArgs->Insert("identifier", "zoneID_1200");
|
||||
nsArgs->Insert("tooltipText", "%[UI_CHOICE_NS_HOVER]");
|
||||
}
|
||||
|
||||
{
|
||||
AMFArrayValue* ntArgs = new AMFArrayValue();
|
||||
AMFArrayValue* ntArgs = choiceOptions->PushArray();
|
||||
|
||||
AMFStringValue* image = new AMFStringValue();
|
||||
image->SetStringValue("textures/ui/zone_thumnails/Nexus_Tower.dds");
|
||||
ntArgs->InsertValue("image", image);
|
||||
|
||||
AMFStringValue* caption = new AMFStringValue();
|
||||
caption->SetStringValue("%[UI_CHOICE_NT]");
|
||||
ntArgs->InsertValue("caption", caption);
|
||||
|
||||
AMFStringValue* identifier = new AMFStringValue();
|
||||
identifier->SetStringValue("zoneID_1900");
|
||||
ntArgs->InsertValue("identifier", identifier);
|
||||
|
||||
AMFStringValue* tooltipText = new AMFStringValue();
|
||||
tooltipText->SetStringValue("%[UI_CHOICE_NT_HOVER]");
|
||||
ntArgs->InsertValue("tooltipText", tooltipText);
|
||||
|
||||
choiceOptions->PushBackValue(ntArgs);
|
||||
ntArgs->Insert("image", "textures/ui/zone_thumnails/Nexus_Tower.dds");
|
||||
ntArgs->Insert("caption", "%[UI_CHOICE_NT]");
|
||||
ntArgs->Insert("identifier", "zoneID_1900");
|
||||
ntArgs->Insert("tooltipText", "%[UI_CHOICE_NT_HOVER]");
|
||||
}
|
||||
|
||||
options = choiceOptions;
|
||||
|
||||
args.InsertValue("options", choiceOptions);
|
||||
}
|
||||
|
||||
void NsLegoClubDoor::OnUse(Entity* self, Entity* user) {
|
||||
auto* player = user;
|
||||
|
||||
if (CheckChoice(self, player)) {
|
||||
AMFArrayValue* multiArgs = new AMFArrayValue();
|
||||
AMFArrayValue multiArgs;
|
||||
|
||||
AMFStringValue* callbackClient = new AMFStringValue();
|
||||
callbackClient->SetStringValue(std::to_string(self->GetObjectID()));
|
||||
multiArgs->InsertValue("callbackClient", callbackClient);
|
||||
|
||||
AMFStringValue* strIdentifier = new AMFStringValue();
|
||||
strIdentifier->SetStringValue("choiceDoor");
|
||||
multiArgs->InsertValue("strIdentifier", strIdentifier);
|
||||
|
||||
AMFStringValue* title = new AMFStringValue();
|
||||
title->SetStringValue("%[UI_CHOICE_DESTINATION]");
|
||||
multiArgs->InsertValue("title", title);
|
||||
|
||||
multiArgs->InsertValue("options", options);
|
||||
multiArgs.Insert("callbackClient", std::to_string(self->GetObjectID()));
|
||||
multiArgs.Insert("strIdentifier", "choiceDoor");
|
||||
multiArgs.Insert("title", "%[UI_CHOICE_DESTINATION]");
|
||||
multiArgs.Insert("options", static_cast<AMFBaseValue*>(options));
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(player, player->GetSystemAddress(), "QueueChoiceBox", multiArgs);
|
||||
|
||||
multiArgs.Remove("options", false); // We do not want the local amf to delete the options!
|
||||
} else if (self->GetVar<int32_t>(u"currentZone") != m_ChoiceZoneID) {
|
||||
AMFArrayValue* multiArgs = new AMFArrayValue();
|
||||
AMFArrayValue multiArgs;
|
||||
multiArgs.Insert("state", "Lobby");
|
||||
|
||||
AMFStringValue* state = new AMFStringValue();
|
||||
state->SetStringValue("Lobby");
|
||||
multiArgs->InsertValue("state", state);
|
||||
|
||||
AMFArrayValue* context = new AMFArrayValue();
|
||||
|
||||
AMFStringValue* user = new AMFStringValue();
|
||||
user->SetStringValue(std::to_string(player->GetObjectID()));
|
||||
context->InsertValue("user", user);
|
||||
|
||||
AMFStringValue* callbackObj = new AMFStringValue();
|
||||
callbackObj->SetStringValue(std::to_string(self->GetObjectID()));
|
||||
context->InsertValue("callbackObj", callbackObj);
|
||||
|
||||
AMFStringValue* helpVisible = new AMFStringValue();
|
||||
helpVisible->SetStringValue("show");
|
||||
context->InsertValue("HelpVisible", helpVisible);
|
||||
|
||||
AMFStringValue* type = new AMFStringValue();
|
||||
type->SetStringValue("Lego_Club_Valid");
|
||||
context->InsertValue("type", type);
|
||||
|
||||
multiArgs->InsertValue("context", context);
|
||||
AMFArrayValue* context = multiArgs.InsertArray("context");
|
||||
context->Insert("user", std::to_string(player->GetObjectID()));
|
||||
context->Insert("callbackObj", std::to_string(self->GetObjectID()));
|
||||
context->Insert("HelpVisible", "show");
|
||||
context->Insert("type", "Lego_Club_Valid");
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(player, player->GetSystemAddress(), "pushGameState", multiArgs);
|
||||
} else {
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include "CppScripts.h"
|
||||
#include "ChooseYourDestinationNsToNt.h"
|
||||
#include "BaseConsoleTeleportServer.h"
|
||||
#include "AMFFormat.h"
|
||||
#include "Amf3.h"
|
||||
|
||||
class NsLegoClubDoor : public CppScripts::Script, ChooseYourDestinationNsToNt, BaseConsoleTeleportServer
|
||||
{
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include "NsLupTeleport.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "AMFFormat.h"
|
||||
#include "Amf3.h"
|
||||
|
||||
void NsLupTeleport::OnStartup(Entity* self) {
|
||||
self->SetVar(u"currentZone", (int32_t)dZoneManager::Instance()->GetZoneID().GetMapID());
|
||||
@@ -12,72 +12,36 @@ void NsLupTeleport::OnStartup(Entity* self) {
|
||||
|
||||
args = {};
|
||||
|
||||
AMFStringValue* callbackClient = new AMFStringValue();
|
||||
callbackClient->SetStringValue(std::to_string(self->GetObjectID()));
|
||||
args.InsertValue("callbackClient", callbackClient);
|
||||
args.Insert("callbackClient", std::to_string(self->GetObjectID()));
|
||||
args.Insert("strIdentifier", "choiceDoor");
|
||||
args.Insert("title", "%[UI_CHOICE_DESTINATION]");
|
||||
|
||||
AMFStringValue* strIdentifier = new AMFStringValue();
|
||||
strIdentifier->SetStringValue("choiceDoor");
|
||||
args.InsertValue("strIdentifier", strIdentifier);
|
||||
|
||||
AMFStringValue* title = new AMFStringValue();
|
||||
title->SetStringValue("%[UI_CHOICE_DESTINATION]");
|
||||
args.InsertValue("title", title);
|
||||
|
||||
AMFArrayValue* choiceOptions = new AMFArrayValue();
|
||||
AMFArrayValue* choiceOptions = args.InsertArray("options");
|
||||
|
||||
{
|
||||
AMFArrayValue* nsArgs = new AMFArrayValue();
|
||||
AMFArrayValue* nsArgs = choiceOptions->PushArray();
|
||||
|
||||
AMFStringValue* image = new AMFStringValue();
|
||||
image->SetStringValue("textures/ui/zone_thumnails/Nimbus_Station.dds");
|
||||
nsArgs->InsertValue("image", image);
|
||||
|
||||
AMFStringValue* caption = new AMFStringValue();
|
||||
caption->SetStringValue("%[UI_CHOICE_NS]");
|
||||
nsArgs->InsertValue("caption", caption);
|
||||
|
||||
AMFStringValue* identifier = new AMFStringValue();
|
||||
identifier->SetStringValue("zoneID_1200");
|
||||
nsArgs->InsertValue("identifier", identifier);
|
||||
|
||||
AMFStringValue* tooltipText = new AMFStringValue();
|
||||
tooltipText->SetStringValue("%[UI_CHOICE_NS_HOVER]");
|
||||
nsArgs->InsertValue("tooltipText", tooltipText);
|
||||
|
||||
choiceOptions->PushBackValue(nsArgs);
|
||||
nsArgs->Insert("image", "textures/ui/zone_thumnails/Nimbus_Station.dds");
|
||||
nsArgs->Insert("caption", "%[UI_CHOICE_NS]");
|
||||
nsArgs->Insert("identifier", "zoneID_1200");
|
||||
nsArgs->Insert("tooltipText", "%[UI_CHOICE_NS_HOVER]");
|
||||
}
|
||||
|
||||
{
|
||||
AMFArrayValue* ntArgs = new AMFArrayValue();
|
||||
AMFArrayValue* ntArgs = choiceOptions->PushArray();
|
||||
|
||||
AMFStringValue* image = new AMFStringValue();
|
||||
image->SetStringValue("textures/ui/zone_thumnails/Nexus_Tower.dds");
|
||||
ntArgs->InsertValue("image", image);
|
||||
|
||||
AMFStringValue* caption = new AMFStringValue();
|
||||
caption->SetStringValue("%[UI_CHOICE_NT]");
|
||||
ntArgs->InsertValue("caption", caption);
|
||||
|
||||
AMFStringValue* identifier = new AMFStringValue();
|
||||
identifier->SetStringValue("zoneID_1900");
|
||||
ntArgs->InsertValue("identifier", identifier);
|
||||
|
||||
AMFStringValue* tooltipText = new AMFStringValue();
|
||||
tooltipText->SetStringValue("%[UI_CHOICE_NT_HOVER]");
|
||||
ntArgs->InsertValue("tooltipText", tooltipText);
|
||||
|
||||
choiceOptions->PushBackValue(ntArgs);
|
||||
ntArgs->Insert("image", "textures/ui/zone_thumnails/Nexus_Tower.dds");
|
||||
ntArgs->Insert("caption", "%[UI_CHOICE_NT]");
|
||||
ntArgs->Insert("identifier", "zoneID_1900");
|
||||
ntArgs->Insert("tooltipText", "%[UI_CHOICE_NT_HOVER]");
|
||||
}
|
||||
|
||||
args.InsertValue("options", choiceOptions);
|
||||
}
|
||||
|
||||
void NsLupTeleport::OnUse(Entity* self, Entity* user) {
|
||||
auto* player = user;
|
||||
|
||||
if (CheckChoice(self, player)) {
|
||||
GameMessages::SendUIMessageServerToSingleClient(player, player->GetSystemAddress(), "QueueChoiceBox", &args);
|
||||
GameMessages::SendUIMessageServerToSingleClient(player, player->GetSystemAddress(), "QueueChoiceBox", args);
|
||||
} else {
|
||||
BaseOnUse(self, player);
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include "CppScripts.h"
|
||||
#include "ChooseYourDestinationNsToNt.h"
|
||||
#include "BaseConsoleTeleportServer.h"
|
||||
#include "AMFFormat.h"
|
||||
#include "Amf3.h"
|
||||
|
||||
class NsLupTeleport : public CppScripts::Script, ChooseYourDestinationNsToNt, BaseConsoleTeleportServer
|
||||
{
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "MissionComponent.h"
|
||||
#include "eMissionTaskType.h"
|
||||
#include "eMissionState.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "eEndBehavior.h"
|
||||
#include "eStateChangeType.h"
|
||||
|
||||
@@ -51,7 +52,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;
|
||||
|
||||
@@ -84,7 +85,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;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#include "NtConsoleTeleportServer.h"
|
||||
#include "Entity.h"
|
||||
#include "AMFFormat.h"
|
||||
#include "Amf3.h"
|
||||
|
||||
void NtConsoleTeleportServer::OnStartup(Entity* self) {
|
||||
self->SetVar(u"teleportAnim", m_TeleportAnim);
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "EntityManager.h"
|
||||
#include "Character.h"
|
||||
#include "eMissionState.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "eTerminateType.h"
|
||||
#include "eStateChangeType.h"
|
||||
|
||||
@@ -34,18 +35,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();
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "EntityManager.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "eMissionTaskType.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "eStateChangeType.h"
|
||||
|
||||
void NtParadoxTeleServer::OnStartup(Entity* self) {
|
||||
@@ -28,9 +29,8 @@ void NtParadoxTeleServer::OnProximityUpdate(Entity* self, Entity* entering, std:
|
||||
true, true, true, true, true, true, true
|
||||
);
|
||||
|
||||
GameMessages::SendPlayAnimation(player, u"teledeath", 4.0f);
|
||||
|
||||
const auto animTime = 2;
|
||||
auto animTime = RenderComponent::PlayAnimation(player, u"teledeath", 4.0f);
|
||||
if (animTime == 0.0f) animTime = 2.0f;
|
||||
|
||||
self->AddCallbackTimer(animTime, [this, self, playerID]() {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
@@ -74,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;
|
||||
|
||||
|
@@ -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>();
|
||||
|
||||
|
@@ -1,6 +1,9 @@
|
||||
#include "NtVentureCannonServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "Entity.h"
|
||||
#include "GeneralUtils.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "eEndBehavior.h"
|
||||
#include "eTerminateType.h"
|
||||
#include "eStateChangeType.h"
|
||||
@@ -29,7 +32,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());
|
||||
@@ -121,5 +124,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);
|
||||
}
|
||||
|
@@ -31,8 +31,8 @@ void ZoneAgMedProperty::SetGameVariables(Entity* self) {
|
||||
self->SetVar<std::vector<std::string>>(AmbientFXSpawner, { "BirdFX", "SunBeam" });
|
||||
self->SetVar<std::vector<std::string>>(BehaviorObjsSpawner, {});
|
||||
|
||||
self->SetVar<uint32_t>(defeatedProperyFlag, 118);
|
||||
self->SetVar<uint32_t>(placedModelFlag, 119);
|
||||
self->SetVar<int32_t>(defeatedProperyFlag, 118);
|
||||
self->SetVar<int32_t>(placedModelFlag, 119);
|
||||
self->SetVar<uint32_t>(guardMissionFlag, 1293);
|
||||
self->SetVar<uint32_t>(brickLinkMissionIDFlag, 1294);
|
||||
self->SetVar<std::string>(passwordFlag, "s3kratK1ttN");
|
||||
|
@@ -39,8 +39,8 @@ void ZoneAgProperty::SetGameVariables(Entity* self) {
|
||||
self->SetVar<std::string>(LauncherSpawner, "Launcher");
|
||||
self->SetVar<std::string>(InstancerSpawner, "Instancer");
|
||||
|
||||
self->SetVar<uint32_t>(defeatedProperyFlag, 71);
|
||||
self->SetVar<uint32_t>(placedModelFlag, 73);
|
||||
self->SetVar<int32_t>(defeatedProperyFlag, 71);
|
||||
self->SetVar<int32_t>(placedModelFlag, 73);
|
||||
self->SetVar<uint32_t>(guardFirstMissionFlag, 891);
|
||||
self->SetVar<uint32_t>(guardMissionFlag, 320);
|
||||
self->SetVar<uint32_t>(brickLinkMissionIDFlag, 951);
|
||||
|
@@ -1,7 +1,8 @@
|
||||
#include "PropertyBankInteract.h"
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "AMFFormat.h"
|
||||
#include "Amf3.h"
|
||||
#include "Entity.h"
|
||||
|
||||
void PropertyBankInteract::OnStartup(Entity* self) {
|
||||
auto* zoneControl = EntityManager::Instance()->GetZoneControlEntity();
|
||||
@@ -20,11 +21,10 @@ void PropertyBankInteract::OnPlayerLoaded(Entity* self, Entity* player) {
|
||||
void PropertyBankInteract::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
AMFArrayValue args;
|
||||
auto* value = new AMFStringValue();
|
||||
value->SetStringValue("bank");
|
||||
args.InsertValue("state", value);
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "pushGameState", &args);
|
||||
args.Insert("state", "bank");
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "pushGameState", args);
|
||||
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"OpenBank", 0, 0, LWOOBJID_EMPTY,
|
||||
"", user->GetSystemAddress());
|
||||
@@ -34,9 +34,10 @@ void PropertyBankInteract::OnFireEventServerSide(Entity* self, Entity* sender, s
|
||||
int32_t param2, int32_t param3) {
|
||||
if (args == "ToggleBank") {
|
||||
AMFArrayValue amfArgs;
|
||||
amfArgs.InsertValue("visible", new AMFFalseValue());
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(sender, sender->GetSystemAddress(), "ToggleBank", &amfArgs);
|
||||
amfArgs.Insert("visible", false);
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(sender, sender->GetSystemAddress(), "ToggleBank", amfArgs);
|
||||
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"CloseBank", 0, 0, LWOOBJID_EMPTY,
|
||||
"", sender->GetSystemAddress());
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user