示例#1
0
        public static void RollDiceAction(Session session, CNetRollDiceAction data)
        {
            var maxValue = data.MaxValue >= data.MinValue ? data.MaxValue : data.MinValue;

            maxValue = Math.Min(maxValue, int.MaxValue - 1);
            ChatChannel.Roll(data.ChannelId, session.Player, data.MinValue, maxValue);
        }
示例#2
0
        public static void RollDiceAction(Session session, CNetRollDiceAction data)
        {
            var maxValue = data.MaxValue >= data.MinValue ? data.MaxValue : data.MinValue;

            maxValue = Math.Min(maxValue, int.MaxValue - 1);

            session.Send(new CNetRollDiceNotification(true)
            {
                ChannelId  = data.ChannelId,
                Player     = session.Player.GetWorldPlayer(),
                MinValue   = data.MinValue,
                MaxValue   = maxValue,
                RollResult = new Random(Environment.TickCount).Next(data.MinValue, maxValue)
            });
        }