mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-23 06:23:08 +00:00
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:
@@ -1,4 +1,6 @@
|
|||||||
#include "LightningOrbServer.h"
|
#include "LightningOrbServer.h"
|
||||||
|
#include "CombatMessages.h"
|
||||||
|
#include "EffectsMessages.h"
|
||||||
|
|
||||||
void LightningOrbServer::OnCollisionPhantom(Entity* self, Entity* target) {
|
void LightningOrbServer::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||||
GameMessages::GetPosition playerPos;
|
GameMessages::GetPosition playerPos;
|
||||||
@@ -6,7 +8,12 @@ void LightningOrbServer::OnCollisionPhantom(Entity* self, Entity* target) {
|
|||||||
GameMessages::GetPosition selfPos;
|
GameMessages::GetPosition selfPos;
|
||||||
selfPos.Send(self->GetObjectID());
|
selfPos.Send(self->GetObjectID());
|
||||||
const NiPoint3 newVec((playerPos.pos.x - selfPos.pos.x) * 2.5, 15, (playerPos.pos.z - selfPos.pos.z) * 2.5);
|
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
|
// L_LIGHTNING_ORB_SERVER (issue 1352): it was off while the platforms didn't move with the server
|
||||||
// GameMessages::SendKnockback(target->GetObjectID(), self->GetObjectID(), self->GetObjectID(), 0, newVec);
|
GameMessages::Knockback knockback;
|
||||||
// GameMessages::SendPlayFXEffect(target->GetObjectID(), -1, u"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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user