示例#1
0
        public bool CommandDb(Player user, Command command, string text)
        {
            if (Parser.GetArgument(text, 2).Text == "entities")
            {
                if (Parser.GetArgument(text, 3).Text == "list")
                {
                    int count = 1;
                    foreach (Thing thing in Global.Things)
                    {
                        user.SendMessage(count + ".  " + "[" + thing.Name + "] #" + thing.IndexNumber + "; type: " + thing.GetType() + "\n\r");
                        count++;
                    }
                }
            }
            if (Parser.GetArgument(text, 2).Text == "menu")
            {
                DynamicMenu menu = new DynamicMenu(user, "HandleMenu");
                menu.List.Add("waffle", new Command("waffle", "", false, "Menu item 1"));
                menu.List.Add("carrot", new Command("carrot", "", false, "Menu item 2"));
                menu.List.Add("apple", new Command("apple", "", false, "Menu item 3"));
                user.Menu = menu;
                user.SendMessage("Please select from the following: waffle, carrot, apple\n\r");
            }
            if (Parser.GetArgument(text, 2).Text == "littleman")
            {
                AreaLittleMan littleMan = new AreaLittleMan(300, 7);
                Area          area      = littleMan.Generate();
                Room          room      = area.Rooms[0];
                Instance      instance  = InstanceManager.NewInstance(user, Convert.ToInt32(Parser.GetArgument(text, 3).Text));
                instance.Area = area;
                user.Move(room);
            }
            if (Parser.GetArgument(text, 2).Text == "map")
            {
                Area area = user.Room.Area;
            }
            if (Parser.GetArgument(text, 2).Text == "instance")
            {
                InstanceManager.NewInstance(user, Convert.ToInt32(Parser.GetArgument(text, 3).Text));
            }
            if (Parser.GetArgument(text, 2).Text == "killinstance")
            {
                InstanceManager.RemoveInstance(user);
            }
            if (Parser.GetArgument(text, 2).Text == "bat")
            {
                Mob mob = new Mob();
                mob.Name = "test mob #" + Combat.Random.Next(0, 9);
                mob.Skills.Add("Autoattack", new SkillInstance(Global.SkillTable["Autoattack"], new SkillAI()));
            }

            return(true);
        }
示例#2
0
        public bool CommandDb(Player user, Command command, string text)
        {
            if (Parser.GetArgument(text, 2).Text == "entities")
            {
                if (Parser.GetArgument(text, 3).Text == "list")
                {
                    int count = 1;
                    foreach (Entity thing in Global.Entites)
                    {
                        user.SendMessage(count + ".  " + "[" + thing.Name + "] #" + thing.IndexNumber + "; type: " + thing.GetType() + "\n\r");
                        count++;
                    }
                }
            }
            if (Parser.GetArgument(text, 2).Text == "menu")
            {
                DynamicMenu menu = new DynamicMenu(user, "HandleMenu");
                menu.List.Add("waffle", new Command("waffle", "", false, "Menu item 1"));
                menu.List.Add("carrot", new Command("carrot", "", false, "Menu item 2"));
                menu.List.Add("apple", new Command("apple", "", false, "Menu item 3"));
                user.Menu = menu;
                user.SendMessage("Please select from the following: waffle, carrot, apple\n\r");
            }
            if (Parser.GetArgument(text, 2).Text == "littleman")
            {
                AreaLittleMan littleMan = new AreaLittleMan(300, 7);
                Area area = littleMan.Generate();
                Room room = area.Rooms[0];
                Instance instance = InstanceManager.NewInstance(user, Convert.ToInt32(Parser.GetArgument(text, 3).Text));
                instance.Area = area;
                user.Move(room);
            }
            if (Parser.GetArgument(text, 2).Text == "map")
            {
                Area area = ((Room)user.Location).Area;

            }
            if (Parser.GetArgument(text, 2).Text == "instance")
            {
                InstanceManager.NewInstance(user, Convert.ToInt32(Parser.GetArgument(text, 3).Text));

            }
            if (Parser.GetArgument(text, 2).Text == "killinstance")
            {
                InstanceManager.RemoveInstance(user);
            }
            if (Parser.GetArgument(text, 2).Text == "bat")
            {
                Mob mob = new Mob();
                mob.Name = "test mob #" + Combat.Random.Next(0, 9);
                mob.Skills.Add("Autoattack", new SkillInstance(Global.SkillTable["Autoattack"], new SkillAI()));
            }

            return true;
        }