示例#1
0
        public static void Fly(string[] args)
        {
            string state   = CommandParser.Read <string>(args, 1);
            var    session = GetSession();

            if (state == "on")
            {
                MoveHandler.HandleMoveSetCanFly(ref session);
                ChatHandler.SendMessageByType(ref session, 0, 0, "Fly mode enabled.");
            }
            else if (state == "off")
            {
                MoveHandler.HandleMoveUnsetCanFly(ref session);
                ChatHandler.SendMessageByType(ref session, 0, 0, "Fly mode disabled.");
            }
        }
示例#2
0
        public static void Fly(string[] args, WorldClass session)
        {
            var state   = CommandParser.Read <string>(args, 1);
            var message = state == "on" ? "Fly mode enabled." : "Fly mode disabled.";

            ChatMessageValues chatMessage = new ChatMessageValues(0, message);

            if (state == "on")
            {
                MoveHandler.HandleMoveSetCanFly(ref session);
                ChatHandler.SendMessage(ref session, chatMessage);
            }
            else if (state == "off")
            {
                MoveHandler.HandleMoveUnsetCanFly(ref session);
                ChatHandler.SendMessage(ref session, chatMessage);
            }
        }