Exemplo n.º 1
0
        private static void Door_OnCommand(CommandEventArgs e)
        {
            if (!e.Mobile.Alive)
            {
                e.Mobile.SendMessage("You can't use this command while being dead!");
                return;
            }

            BaseDoor doorToOpen = null;

            IPooledEnumerable eable = e.Mobile.GetObjectsInRange(3);

            foreach (object o in eable)
            {
                if (o is BaseDoor && ((BaseDoor)o).GuildID <= 0)
                {
                    //if (e.Mobile.InLOS(o))
                    //{
                    doorToOpen = (BaseDoor)o;
                    break;
                    //}
                }
            }
            eable.Free();

            if (doorToOpen == null)
            {
                return;
            }

            doorToOpen.Use(e.Mobile);
        }