Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions server/entity/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 8 additions & 2 deletions server/session/world.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down