From 89c06543d8d601e4a7afb0b28122e1cc1827d004 Mon Sep 17 00:00:00 2001 From: Dascia Date: Tue, 4 Nov 2025 17:55:47 +0300 Subject: [PATCH 1/2] add count option to EnchantedHitAction and CriticalHitAction. --- server/entity/action.go | 12 ++++++++++-- server/session/world.go | 10 ++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/server/entity/action.go b/server/entity/action.go index 4a48a11df..ccfe32d62 100644 --- a/server/entity/action.go +++ b/server/entity/action.go @@ -14,11 +14,19 @@ type HurtAction struct{ action } // CriticalHitAction is a world.EntityAction that makes an entity display critical hit particles. This will show stars // around the entity. -type CriticalHitAction struct{ action } +type CriticalHitAction struct { + action + // Count is the count of particles around the entity. + Count int +} // EnchantedHitAction is a world.Action that makes an entity display enchanted hit particles. This will show circles // around the entity. -type EnchantedHitAction struct{ action } +type EnchantedHitAction struct { + action + // Count is the count of particles around the entity. + Count int +} // DeathAction is a world.EntityAction that makes an entity display the death animation. After this animation, the // entity disappears from viewers watching it. diff --git a/server/session/world.go b/server/session/world.go index 09b4598b5..5dfc03b2f 100644 --- a/server/session/world.go +++ b/server/session/world.go @@ -973,16 +973,22 @@ func (s *Session) ViewEntityAction(e world.Entity, a world.EntityAction) { EventType: packet.ActorEventHurt, }) case entity.CriticalHitAction: + if act.Count == 0 { + act.Count = 55 + } s.writePacket(&packet.Animate{ ActionType: packet.AnimateActionCriticalHit, EntityRuntimeID: s.entityRuntimeID(e), - Data: 55, + Data: float32(act.Count), }) case entity.EnchantedHitAction: + if act.Count == 0 { + act.Count = 15 + } s.writePacket(&packet.Animate{ ActionType: packet.AnimateActionMagicCriticalHit, EntityRuntimeID: s.entityRuntimeID(e), - Data: 15, + Data: float32(act.Count), }) case entity.DeathAction: s.writePacket(&packet.ActorEvent{ From 994a87175f70f5f9d82fa4438b63ccff787cfe8c Mon Sep 17 00:00:00 2001 From: Darya Markova <122279000+Dasciam@users.noreply.github.com> Date: Tue, 4 Nov 2025 17:58:53 +0300 Subject: [PATCH 2/2] Update world.go --- server/session/world.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/session/world.go b/server/session/world.go index 5dfc03b2f..733c0789d 100644 --- a/server/session/world.go +++ b/server/session/world.go @@ -973,7 +973,7 @@ func (s *Session) ViewEntityAction(e world.Entity, a world.EntityAction) { EventType: packet.ActorEventHurt, }) case entity.CriticalHitAction: - if act.Count == 0 { + if act.Count <= 0 { act.Count = 55 } s.writePacket(&packet.Animate{ @@ -982,7 +982,7 @@ func (s *Session) ViewEntityAction(e world.Entity, a world.EntityAction) { Data: float32(act.Count), }) case entity.EnchantedHitAction: - if act.Count == 0 { + if act.Count <= 0 { act.Count = 15 } s.writePacket(&packet.Animate{