fix(scripts): lightning garden orbs knock players back again (issue 1352)

As L_LIGHTNING_ORB_SERVER: knockback (dx*2.5, 15, dz*2.5) and the orb's knockback effect; it was off while platforms didn't run on the server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-10-01 04:55:03 -05:00
parent 6ff42bf312
commit e5d61ee90e

View File

@@ -1,4 +1,6 @@
#include "LightningOrbServer.h"
#include "CombatMessages.h"
#include "EffectsMessages.h"
void LightningOrbServer::OnCollisionPhantom(Entity* self, Entity* target) {
GameMessages::GetPosition playerPos;
@@ -6,7 +8,12 @@ void LightningOrbServer::OnCollisionPhantom(Entity* self, Entity* target) {
GameMessages::GetPosition selfPos;
selfPos.Send(self->GetObjectID());
const NiPoint3 newVec((playerPos.pos.x - selfPos.pos.x) * 2.5, 15, (playerPos.pos.z - selfPos.pos.z) * 2.5);
// ahhhh aron said to put a TODO here moving platforms don't work lol. disable this so people can actually do the puzzle
// GameMessages::SendKnockback(target->GetObjectID(), self->GetObjectID(), self->GetObjectID(), 0, newVec);
// GameMessages::SendPlayFXEffect(target->GetObjectID(), -1, u"knockback", "knockback");
// L_LIGHTNING_ORB_SERVER (issue 1352): it was off while the platforms didn't move with the server
GameMessages::Knockback knockback;
knockback.target = target->GetObjectID();
knockback.Caster = self->GetObjectID();
knockback.Originator = self->GetObjectID();
knockback.vector = newVec;
knockback.Send(UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::PlayFXEffect(self->GetObjectID(), -1, u"knockback", "knockback").Send(UNASSIGNED_SYSTEM_ADDRESS);
}