Example #1
0
        public override void OnEvent(TargetSelectionRequestEvent targetingRequest)
        {
            base.OnEvent(targetingRequest);

            if (targetingRequest.FromSelf)
            {
                return;
            }

            World.FindPlayer(targetingRequest.RaisedBy)?.Attributes.UpdateTarget(targetingRequest.TargetId.PackedValue, updateState: true);
        }
Example #2
0
        public void SelectTarget(Unit target)
        {
            if (!Player.ExistsIn(World))
            {
                return;
            }

            Player.SetTarget(target);

            TargetSelectionRequestEvent targetSelectionRequest = TargetSelectionRequestEvent.Create(Bolt.GlobalTargets.OnlyServer);

            targetSelectionRequest.TargetId = target?.BoltEntity.NetworkId ?? default;
            targetSelectionRequest.Send();
        }