diff --git a/Maple2.Model/Game/TriggerObject.cs b/Maple2.Model/Game/TriggerObject.cs index 74a0923a..d94c0d67 100644 --- a/Maple2.Model/Game/TriggerObject.cs +++ b/Maple2.Model/Game/TriggerObject.cs @@ -120,6 +120,8 @@ public TriggerBox(Ms2TriggerBox metadata) { public bool Contains(in Vector3 point) => box.Contains(point); + public bool Intersects(in IPrism shape) => box.Intersects(shape); + public override string ToString() { return $"Id:{Id}\n- {box}"; } diff --git a/Maple2.Server.Game/Trigger/TriggerContext.Npc.cs b/Maple2.Server.Game/Trigger/TriggerContext.Npc.cs index 62b650fd..a2bcbcd1 100644 --- a/Maple2.Server.Game/Trigger/TriggerContext.Npc.cs +++ b/Maple2.Server.Game/Trigger/TriggerContext.Npc.cs @@ -274,7 +274,7 @@ private IEnumerable NpcsInBox(params int[] boxIds) { .Select(boxId => Objects.Boxes.GetValueOrDefault(boxId)) .Where(box => box != null)!; - return Field.EnumerateNpcs().Where(mob => boxes.Any(box => box.Contains(mob.Position))); + return Field.EnumerateNpcs().Where(mob => boxes.Any(box => box.Contains(mob.Position) || box.Intersects(mob.Shape))); } private void SpawnNpc(int spawnId, bool useSpawnAnimation = false) {