예제 #1
0
        public static void OnSetTarget(WorldClient client, INetPacketStream packet)
        {
            var setTargetPacket = new SetTargetPacket(packet);
            var setTargetArgs   = new SetTargetEventArgs(setTargetPacket.TargetId, setTargetPacket.Clear);

            client.Player.NotifySystem <InteractionSystem>(setTargetArgs);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="player"></param>
        /// <param name="e"></param>
        private void SetTarget(IPlayerEntity player, SetTargetEventArgs e)
        {
            var targetEntity = player.FindEntity <IEntity>(e.TargetId);

            if (targetEntity == null)
            {
                return;
            }

            if (e.TargetingMode == SELECT_TARGET)
            {
                player.Interaction.TargetEntity = targetEntity;
                Logger.LogDebug("Player {0} selected {1} as target.", player.Object.Name, targetEntity.Object.Name);
            }
            else if (e.TargetingMode == UNSELECT_TARGET)
            {
                player.Interaction.TargetEntity = null;
                Logger.LogDebug("Player {0} cleared selection on {1}.", player.Object.Name, targetEntity.Object.Name);
            }
            else
            {
                Logger.LogWarning("Player {0} raised an invalid or unknown target mode on {1}.", player.Object.Name, targetEntity.Object.Name);
            }
        }