示例#1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Mobile)
                {
                    Mobile targ = (Mobile)targeted;
                    if (from != targ)
                    {
                        from.SendMessage("You may only set your own body to GM style.");
                    }

                    else
                    {
                        m_Mobile = from;

                        CommandLogging.WriteLine(from, "{0} {1} is assuming a GM body", from.AccessLevel, CommandLogging.Format(from));

                        Container pack = from.Backpack;

                        if (pack == null)
                        {
                            pack         = new Backpack();
                            pack.Movable = false;

                            from.AddItem(pack);
                        }

                        from.Body   = 0x190;
                        from.Fame   = 0;
                        from.Karma  = 0;
                        from.Kills  = 0;
                        from.Hidden = true;
                        from.Hits   = from.HitsMax;
                        from.Mana   = from.ManaMax;
                        from.Stam   = from.StamMax;

                        if (from.AccessLevel >= AccessLevel.GameMaster)
                        {
                            EquipItem(new StaffRing());
                            Spellbook book1 = new Spellbook((ulong)18446744073709551615);
                            Spellbook book2 = new NecromancerSpellbook((ulong)0xffff);
                            Spellbook book3 = new BookOfChivalry();

                            PackItem(book1);
                            PackItem(book2);
                            PackItem(book3);
                            PackItem(new EtherealHorse());

                            from.RawStr = 100;
                            from.RawDex = 100;
                            from.RawInt = 100;
                            from.Hits   = from.HitsMax;
                            from.Mana   = from.ManaMax;
                            from.Stam   = from.StamMax;

                            for (int i = 0; i < targ.Skills.Length; ++i)
                            {
                                targ.Skills[i].Base = 120;
                            }
                        }

                        if (from.AccessLevel == AccessLevel.Counselor)
                        {
                            EquipItem(new CounselorRobe());
                            EquipItem(new ThighBoots(3));
                            PackItem(new CounselorHide());
                            from.Title = "[Counselor]";
                            from.AddItem(new ShortHair(3));
                            from.AddItem(new Vandyke(3));
                        }

                        if (from.AccessLevel == AccessLevel.GameMaster)
                        {
                            EquipItem(new GMRobe());
                            EquipItem(new ThighBoots(39));
                            PackItem(new SeerHide(39));
                            from.Title = "[GM]";
                            from.AddItem(new ShortHair(39));
                            from.AddItem(new Vandyke(39));
                        }

                        if (from.AccessLevel == AccessLevel.Seer)
                        {
                            EquipItem(new SeerRobe());
                            EquipItem(new ThighBoots(467));
                            PackItem(new SeerHide());
                            from.Title = "[Seer]";
                            from.AddItem(new ShortHair(467));
                            from.AddItem(new Vandyke(467));
                        }

                        if (from.AccessLevel == AccessLevel.Administrator)
                        {
                            EquipItem(new AdminRobe());
                            EquipItem(new ThighBoots(1001));
                            PackItem(new AdminHide());
                            from.Title = "[Admin]";
                            from.AddItem(new ShortHair(1001));
                            from.AddItem(new Vandyke(1001));
                        }
                    }
                }
            }
示例#2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Mobile)
                {
                    Mobile targ = (Mobile)targeted;

                    GameClient state = targ.Client;

                    if (state != null)
                    {
                        CommandLogging.WriteLine(from, "{0} {1} firewalling {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(targeted));

                        Firewall.Add(state.Address);
                    }
                }
            }
示例#3
0
        public static void Invoke(Mobile from, Point3D start, Point3D end, string[] args, ArrayList packs)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("{0} {1} building ", from.AccessLevel, CommandLogging.Format(from));

            if (start == end)
            {
                sb.AppendFormat("at {0} in {1}", start, from.Map);
            }
            else
            {
                sb.AppendFormat("from {0} to {1} in {2}", start, end, from.Map);
            }

            sb.Append(":");

            for (int i = 0; i < args.Length; ++i)
            {
                sb.AppendFormat(" \"{0}\"", args[i]);
            }

            CommandLogging.WriteLine(from, sb.ToString());

            string name = args[0];

            FixArgs(ref args);

            string[,] props = null;

            for (int i = 0; i < args.Length; ++i)
            {
                if (Insensitive.Equals(args[i], "set"))
                {
                    int remains = args.Length - i - 1;

                    if (remains >= 2)
                    {
                        props = new string[remains / 2, 2];

                        remains /= 2;

                        for (int j = 0; j < remains; ++j)
                        {
                            props[j, 0] = args[i + (j * 2) + 1];
                            props[j, 1] = args[i + (j * 2) + 2];
                        }

                        FixSetString(ref args, i);
                    }

                    break;
                }
            }

            Type type = ScriptCompiler.FindTypeByName(name);

            if (type == null)
            {
                from.SendMessage("No type with that name was found.");
                return;
            }

            DateTime time = DateTime.Now;

            int built = BuildObjects(from, type, start, end, args, props, packs);

            if (built > 0)
            {
                from.SendMessage("{0} object{1} generated in {2:F1} seconds.", built, built != 1 ? "s" : "", (DateTime.Now - time).TotalSeconds);
            }
            else
            {
                SendUsage(type, from);
            }
        }
示例#4
0
        private static void PlaySound(Mobile m, int index, bool toAll)
        {
            Map map = m.Map;

            if (map == null)
            {
                return;
            }

            CommandLogging.WriteLine(m, "{0} {1} playing sound {2} (toAll={3})", m.AccessLevel, CommandLogging.Format(m), index, toAll);

            Packet p = GenericPackets.PlaySound(index, m.Location);

            p.Acquire();

            foreach (GameClient state in m.GetClientsInRange(12))
            {
                if (toAll || state.Mobile.CanSee(m))
                {
                    state.Send(p);
                }
            }

            p.Release();
        }
示例#5
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Mobile)
                {
                    CommandLogging.WriteLine(from, "{0} {1} dismounting {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(targeted));

                    Mobile targ = (Mobile)targeted;

                    foreach (var mount in targ.GetEquippedItems().OfType <IMountItem>().Select(mountItem => mountItem.Mount))
                    {
                        if (mount != null)
                        {
                            mount.Rider = null;
                        }
                    }

                    foreach (var item in targ.GetEquippedItems())
                    {
                        if (item.Layer == Layer.Mount)
                        {
                            item.Delete();
                        }
                    }
                }
            }
示例#6
0
        public static void ClearFacet_OnCommand(CommandEventArgs e)
        {
            Map map = e.Mobile.Map;

            if (map == null || map == Map.Internal)
            {
                e.Mobile.SendMessage("You may not run that command here.");
                return;
            }

            ArrayList list = new ArrayList();

            foreach (Item item in World.Instance.Items)
            {
                if (item.Map == map && item.Parent == null)
                {
                    list.Add(item);
                }
            }

            foreach (Mobile m in World.Instance.Mobiles)
            {
                if (m.Map == map && !m.IsPlayer)
                {
                    list.Add(m);
                }
            }

            if (list.Count > 0)
            {
                CommandLogging.WriteLine(e.Mobile, "{0} {1} starting facet clear of {2} ({3} objects)", e.Mobile.AccessLevel, CommandLogging.Format(e.Mobile), map, list.Count);

                e.Mobile.SendGump(new WarningGump(1060635, 30720, String.Format("You are about to delete {0} object{1} from this facet.  Do you really wish to continue?", list.Count, list.Count == 1 ? "" : "s"), 0xFFC000, 360, 260, new WarningGumpCallback(DeleteList_Callback), list));
            }
            else
            {
                e.Mobile.SendMessage("There were no objects found to delete.");
            }
        }
示例#7
0
                public EquipMenu(Mobile from, Mobile m, ItemListEntry[] entries)
                    : base("Equipment", entries)
                {
                    m_Mobile = m;

                    CommandLogging.WriteLine(from, "{0} {1} getting equip for {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(m));
                }
示例#8
0
        public override void Execute(CommandEventArgs e, object obj)
        {
            Mobile from = e.Mobile;

            if (e.Length == 1)
            {
                int    index = e.GetInt32(0);
                Mobile mob   = (Mobile)obj;

                CommandLogging.WriteLine(from, "{0} {1} playing sound {2} for {3}", from.AccessLevel, CommandLogging.Format(from), index, CommandLogging.Format(mob));
                mob.Send(GenericPackets.PlaySound(index, mob.Location));
            }
            else
            {
                from.SendMessage("Format: PrivSound <index>");
            }
        }
示例#9
0
        public override void Execute(CommandEventArgs e, object obj)
        {
            Mobile mob  = (Mobile)obj;
            Mobile from = e.Mobile;

            CommandLogging.WriteLine(from, "{0} {1} telling {2} \"{3}\"", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(mob), e.ArgString);

            mob.SendMessage(e.ArgString);
        }
示例#10
0
        public override void Execute(CommandEventArgs e, object obj)
        {
            Mobile from = e.Mobile;
            Mobile targ = (Mobile)obj;

            if (from.AccessLevel > targ.AccessLevel)
            {
                GameClient fromState = from.Client, targState = targ.Client;

                if (fromState != null && targState != null)
                {
                    Account fromAccount = fromState.Account as Account;
                    Account targAccount = targState.Account as Account;

                    if (fromAccount != null && targAccount != null)
                    {
                        CommandLogging.WriteLine(from, "{0} {1} {2} {3}", from.AccessLevel, CommandLogging.Format(from), m_Ban ? "banning" : "kicking", CommandLogging.Format(targ));

                        targ.Say("I've been {0}!", m_Ban ? "banned" : "kicked");

                        AddResponse(String.Format("They have been {0}.", m_Ban ? "banned" : "kicked"));

                        targState.Dispose();

                        if (m_Ban)
                        {
                            targAccount.Banned = true;
                            targAccount.SetUnspecifiedBan(from);
                            from.SendGump(new BanDurationGump(targAccount));
                        }
                    }
                }
                else if (targState == null)
                {
                    LogFailure("They are not online.");
                }
            }
            else
            {
                LogFailure("You do not have the required access level to do this.");
            }
        }
示例#11
0
        public override void Execute(CommandEventArgs e, object obj)
        {
            if (e.Length == 1)
            {
                Mobile mob  = (Mobile)obj;
                Mobile from = e.Mobile;

                if (mob.IsPlayer)
                {
                    GameClient ns = mob.Client;

                    if (ns == null)
                    {
                        LogFailure("That player is not online.");
                    }
                    else
                    {
                        string url = e.GetString(0);

                        CommandLogging.WriteLine(from, "{0} {1} requesting to open web browser of {2} to {3}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(mob), url);
                        AddResponse("Awaiting user confirmation...");
                        mob.SendGump(new WarningGump(1060637, 30720, String.Format("A game master is requesting to open your web browser to the following URL:<br>{0}", url), 0xFFC000, 320, 240, new WarningGumpCallback(OpenBrowser_Callback), new object[] { from, url }));
                    }
                }
                else
                {
                    LogFailure("That is not a player.");
                }
            }
            else
            {
                LogFailure("Format: OpenBrowser <url>");
            }
        }
示例#12
0
        public static void DeleteChar_WarningGumpCallback(Mobile from, bool okay, object state)
        {
            Mobile           mob       = (Mobile)state;
            NetState         ns        = mob.NetState;
            List <BaseHouse> houselist = BaseHouse.GetHouses(mob);
            List <Mobile>    mobs      = new List <Mobile>();

            int mobCount, houseCount;
            int itemCount = 0;

            if (!okay)
            {
                return;
            }

            CommandLogging.WriteLine(from, "{0} {1} deleting character {2}.", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(mob));

            foreach (Mobile m in World.Mobiles.Values)
            {
                if (m is BaseCreature)
                {
                    BaseCreature bc = (BaseCreature)m;
                    if ((bc.Controlled && bc.ControlMaster == mob) || (bc.Summoned && bc.SummonMaster == mob))
                    {
                        mobs.Add(bc);
                    }
                }
                else if (m is PlayerVendor)
                {
                    PlayerVendor pv = (PlayerVendor)m;
                    if (pv.Owner == mob)
                    {
                        mobs.Add(pv);
                    }
                }
            }

            mobCount = mobs.Count;
            for (int i = 0; i < mobs.Count; ++i)
            {
                mobs[i].Delete();
            }
            mobs.Clear();

            houseCount = houselist.Count;
            for (int j = 0; j < houselist.Count; ++j)
            {
                BaseHouse house = (BaseHouse)houselist[j];

                List <Item> itemlist = house.GetItems();

                for (int k = 0; k < itemlist.Count; ++k)
                {
                    Item item = (Item)itemlist[k];

                    if (item.IsLockedDown)
                    {
                        itemCount++;
                        item.Delete();
                    }
                    else if (item.IsSecure && item is BaseContainer)
                    {
                        BaseContainer con = (BaseContainer)itemlist[k];
                        itemCount += con.GetTotal(TotalType.Items) + 1; // +1 is the container itself
                        con.Delete();
                    }
                }
                itemlist.Clear();

                house.Delete();
            }
            houselist.Clear();

            from.SendMessage("{0} pet{3} and playervendor{3} and {1} house{4} with {2} item{5} inside deleted.", mobCount, houseCount, itemCount, mobCount != 1 ? "s" : "", houseCount != 1 ? "s" : "", itemCount != 1 ? "s" : "");
            mob.Say("I've been deleted!");

            if (ns != null)
            {
                ns.Dispose();
            }

            mob.Delete();

            from.SendMessage("Character has been disposed of thoughtfully.");
        }
示例#13
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_Mobile.Deleted)
            {
                m_From.SendGump(new InterfaceGump(m_From, m_List, m_Page));
                return;
            }
            else if (!BaseCommand.IsAccessible(m_From, m_Mobile))
            {
                m_From.SendMessage("That is no longer accessible.");
                m_From.SendGump(new InterfaceGump(m_From, m_List, m_Page));
                return;
            }

            switch (info.ButtonID)
            {
            case 0:
            case 1:
            {
                m_From.SendGump(new InterfaceGump(m_From, m_List, m_Page));
                break;
            }

            case 2:                     // Properties
            {
                m_From.SendGump(new InterfaceMobileGump(m_From, m_List, m_Page, m_Mobile));
                m_From.SendGump(new PropertiesGump(m_From, m_Mobile));
                break;
            }

            case 3:                     // Delete
            {
                if (!m_Mobile.Player)
                {
                    CommandLogging.WriteLine(m_From, "{0} {1} deleting {2}", m_From.AccessLevel, CommandLogging.Format(m_From), CommandLogging.Format(m_Mobile));
                    m_Mobile.Delete();
                    m_From.SendGump(new InterfaceGump(m_From, m_List, m_Page));
                }

                break;
            }

            case 4:                     // Go there
            {
                m_From.SendGump(new InterfaceMobileGump(m_From, m_List, m_Page, m_Mobile));
                InvokeCommand(String.Format("Go {0}", m_Mobile.Serial.Value));
                break;
            }

            case 5:                     // Bring them here
            {
                if (m_From.Map == null || m_From.Map == Map.Internal)
                {
                    m_From.SendMessage("You cannot bring that person here.");
                }
                else
                {
                    m_From.SendGump(new InterfaceMobileGump(m_From, m_List, m_Page, m_Mobile));
                    m_Mobile.MoveToWorld(m_From.Location, m_From.Map);
                }

                break;
            }

            case 6:                     // Move to target
            {
                m_From.SendGump(new InterfaceMobileGump(m_From, m_List, m_Page, m_Mobile));
                m_From.Target = new MoveTarget(m_Mobile);
                break;
            }

            case 7:                     // Kill
            {
                if (m_From == m_Mobile || m_From.AccessLevel > m_Mobile.AccessLevel)
                {
                    m_Mobile.Kill();
                }

                m_From.SendGump(new InterfaceMobileGump(m_From, m_List, m_Page, m_Mobile));

                break;
            }

            case 8:                     // Res
            {
                if (m_From == m_Mobile || m_From.AccessLevel > m_Mobile.AccessLevel)
                {
                    m_Mobile.PlaySound(0x214);
                    m_Mobile.FixedEffect(0x376A, 10, 16);

                    m_Mobile.Resurrect();
                }

                m_From.SendGump(new InterfaceMobileGump(m_From, m_List, m_Page, m_Mobile));

                break;
            }

            case 9:                     // Client
            {
                m_From.SendGump(new InterfaceMobileGump(m_From, m_List, m_Page, m_Mobile));

                if (m_Mobile.NetState != null)
                {
                    m_From.SendGump(new ClientGump(m_From, m_Mobile.NetState));
                }

                break;
            }
            }
        }
示例#14
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_Item.Deleted)
            {
                m_From.SendGump(new InterfaceGump(m_From, m_List, m_Page));
                return;
            }
            else if (!BaseCommand.IsAccessible(m_From, m_Item))
            {
                m_From.SendMessage("That is no longer accessible.");
                m_From.SendGump(new InterfaceGump(m_From, m_List, m_Page));
                return;
            }

            switch (info.ButtonID)
            {
            case 0:
            case 1:
            {
                m_From.SendGump(new InterfaceGump(m_From, m_List, m_Page));
                break;
            }

            case 2:                     // Properties
            {
                m_From.SendGump(new InterfaceItemGump(m_From, m_List, m_Page, m_Item));
                m_From.SendGump(new PropertiesGump(m_From, m_Item));
                break;
            }

            case 3:                     // Delete
            {
                CommandLogging.WriteLine(m_From, "{0} {1} deleting {2}", m_From.AccessLevel, CommandLogging.Format(m_From), CommandLogging.Format(m_Item));
                m_Item.Delete();
                m_From.SendGump(new InterfaceGump(m_From, m_List, m_Page));
                break;
            }

            case 4:                     // Go there
            {
                m_From.SendGump(new InterfaceItemGump(m_From, m_List, m_Page, m_Item));
                InvokeCommand(String.Format("Go {0}", m_Item.Serial.Value));
                break;
            }

            case 5:                     // Move to target
            {
                m_From.SendGump(new InterfaceItemGump(m_From, m_List, m_Page, m_Item));
                m_From.Target = new MoveTarget(m_Item);
                break;
            }

            case 6:                     // Bring to pack
            {
                Mobile owner = m_Item.RootParent as Mobile;

                if (owner != null && (owner.Map != null && owner.Map != Map.Internal) && !m_From.CanSee(owner))
                {
                    m_From.SendMessage("You can not get what you can not see.");
                }
                else if (owner != null && (owner.Map == null || owner.Map == Map.Internal) && owner.Hidden && owner.AccessLevel >= m_From.AccessLevel)
                {
                    m_From.SendMessage("You can not get what you can not see.");
                }
                else
                {
                    m_From.SendGump(new InterfaceItemGump(m_From, m_List, m_Page, m_Item));
                    m_From.AddToBackpack(m_Item);
                }

                break;
            }
            }
        }
示例#15
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Mobile)
                {
                    Item item = ((Mobile)targeted).FindItemOnLayer(m_Layer);

                    if (item != null)
                    {
                        CommandLogging.WriteLine(from, "{0} {1} deleting item on layer {2} of {3}", from.AccessLevel, CommandLogging.Format(from), m_Layer, CommandLogging.Format(targeted));
                        item.Delete();
                    }
                }
                else
                {
                    from.SendMessage("Target a mobile.");
                }
            }
示例#16
0
        public override void Execute(CommandEventArgs e, object obj)
        {
            IPoint3D p = obj as IPoint3D;

            if (p == null)
            {
                return;
            }

            Mobile from = e.Mobile;

            SpellHelper.GetSurfaceTop(ref p);

            CommandLogging.WriteLine(from, "{0} {1} teleporting to {2}", from.AccessLevel, CommandLogging.Format(from), new Point3D(p));

            Point3D fromLoc = from.Location;
            Point3D toLoc   = new Point3D(p);

            from.Location = toLoc;
            from.ProcessDelta();

            if (!from.Hidden)
            {
                Effects.SendLocationParticles(EffectItem.Create(fromLoc, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                Effects.SendLocationParticles(EffectItem.Create(toLoc, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);

                from.PlaySound(0x1FE);
            }
        }
示例#17
0
        public static void DeleteList_Callback(Mobile from, bool okay, object state)
        {
            if (okay)
            {
                ArrayList list = (ArrayList)state;

                CommandLogging.WriteLine(from, "{0} {1} deleting {2} objects", from.AccessLevel, CommandLogging.Format(from), list.Count);

                for (int i = 0; i < list.Count; ++i)
                {
                    object obj = list[i];

                    if (obj is Item)
                    {
                        ((Item)obj).Delete();
                    }
                    else if (obj is Mobile)
                    {
                        ((Mobile)obj).Delete();
                    }
                }

                from.SendMessage("You have deleted {0} object{1}.", list.Count, list.Count == 1 ? "" : "s");
            }
            else
            {
                from.SendMessage("You have chosen not to delete those objects.");
            }
        }
示例#18
0
        public override void Execute(CommandEventArgs e, object obj)
        {
            Mobile from = e.Mobile;
            Mobile mob  = (Mobile)obj;

            CommandLogging.WriteLine(from, "{0} {1} dismounting {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(mob));

            bool takenAction = false;

            foreach (var mountItem in mob.GetEquippedItems().OfType <MountItem>())
            {
                IMount mount = mountItem.Mount;

                if (mount != null)
                {
                    mount.Rider = null;
                    takenAction = true;
                }
            }

            foreach (var item in mob.GetEquippedItems())
            {
                if (item.Layer == Layer.Mount)
                {
                    takenAction = true;
                    item.Delete();
                }
            }

            if (takenAction)
            {
                AddResponse("They have been dismounted.");
            }
            else
            {
                LogFailure("They were not mounted.");
            }
        }
示例#19
0
        public static void GetFollowers_OnTarget(Mobile from, object obj)
        {
            if (obj is Mobile && ((Mobile)obj).IsPlayer)
            {
                Mobile    master = (Mobile)obj;
                ArrayList pets   = new ArrayList();

                foreach (Mobile m in World.Instance.Mobiles)
                {
                    if (m is BaseCreature)
                    {
                        BaseCreature bc = (BaseCreature)m;

                        if ((bc.Controlled && bc.ControlMaster == master) || (bc.Summoned && bc.SummonMaster == master))
                        {
                            pets.Add(bc);
                        }
                    }
                }

                if (pets.Count > 0)
                {
                    CommandLogging.WriteLine(from, "{0} {1} getting all followers of {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(master));

                    from.SendMessage("That player has {0} pet{1}.", pets.Count, pets.Count != 1 ? "s" : "");

                    for (int i = 0; i < pets.Count; ++i)
                    {
                        Mobile pet = (Mobile)pets[i];

                        if (pet is IMount)
                        {
                            ((IMount)pet).Rider = null;                                // make sure it's dismounted
                        }

                        pet.MoveToWorld(from.Location, from.Map);
                    }
                }
                else
                {
                    from.SendMessage("There were no pets found for that player.");
                }
            }
            else
            {
                from.BeginTarget(-1, false, TargetFlags.None, new TargetCallback(GetFollowers_OnTarget));
                from.SendMessage("That is not a player. Try again.");
            }
        }
示例#20
0
        public override void Execute(CommandEventArgs e, object obj)
        {
            if (obj is BaseVendor)
            {
                CommandLogging.WriteLine(e.Mobile, "{0} {1} restocking {2}", e.Mobile.AccessLevel, CommandLogging.Format(e.Mobile), CommandLogging.Format(obj));

                ((BaseVendor)obj).Restock();
                AddResponse("The vendor has been restocked.");
            }
            else
            {
                AddResponse("That is not a vendor.");
            }
        }
示例#21
0
 public override void OnResponse(GameClient state, int index)
 {
     if (index == 0)
     {
         CommandLogging.WriteLine(state.Mobile, "{0} {1} moving equip item {2} of {3}", state.Mobile.AccessLevel, CommandLogging.Format(state.Mobile), CommandLogging.Format(m_Item), CommandLogging.Format(m_Mobile));
         state.Mobile.Target = new MoveTarget(m_Item);
     }
     else if (index == 1)
     {
         CommandLogging.WriteLine(state.Mobile, "{0} {1} deleting equip item {2} of {3}", state.Mobile.AccessLevel, CommandLogging.Format(state.Mobile), CommandLogging.Format(m_Item), CommandLogging.Format(m_Mobile));
         m_Item.Delete();
     }
     else if (index == 2)
     {
         CommandLogging.WriteLine(state.Mobile, "{0} {1} opening props for equip item {2} of {3}", state.Mobile.AccessLevel, CommandLogging.Format(state.Mobile), CommandLogging.Format(m_Item), CommandLogging.Format(m_Mobile));
         state.Mobile.SendGump(new PropertiesGump(state.Mobile, m_Item));
     }
 }
示例#22
0
 public override void Execute(CommandEventArgs e, object obj)
 {
     if (obj is Item)
     {
         CommandLogging.WriteLine(e.Mobile, "{0} {1} deleting {2}", e.Mobile.AccessLevel, CommandLogging.Format(e.Mobile), CommandLogging.Format(obj));
         ((Item)obj).Delete();
         AddResponse("The item has been deleted.");
     }
     else if (obj is Mobile && !((Mobile)obj).IsPlayer)
     {
         CommandLogging.WriteLine(e.Mobile, "{0} {1} deleting {2}", e.Mobile.AccessLevel, CommandLogging.Format(e.Mobile), CommandLogging.Format(obj));
         ((Mobile)obj).Delete();
         AddResponse("The mobile has been deleted.");
     }
     else
     {
         LogFailure("That cannot be deleted.");
     }
 }
示例#23
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Mobile)
                {
                    Mobile m = (Mobile)targeted;

                    BankBox box = (m.IsPlayer ? m.BankBox : m.FindBankNoCreate());

                    if (box != null)
                    {
                        CommandLogging.WriteLine(from, "{0} {1} opening bank box of {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(targeted));

                        if (from == targeted)
                        {
                            box.Open();
                        }
                        else
                        {
                            box.DisplayTo(from);
                        }
                    }
                    else
                    {
                        from.SendMessage("They have no bank box.");
                    }
                }
            }
示例#24
0
        public override void Execute(CommandEventArgs e, object obj)
        {
            Mobile mob  = (Mobile)obj;
            Mobile from = e.Mobile;

            if (m_Value)
            {
                if (!mob.Alive)
                {
                    LogFailure("They are already dead.");
                }
                else if (!mob.CanBeDamaged())
                {
                    LogFailure("They cannot be harmed.");
                }
                else
                {
                    CommandLogging.WriteLine(from, "{0} {1} killing {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(mob));
                    mob.Kill();

                    AddResponse("They have been killed.");
                }
            }
            else
            {
                if (mob.IsDeadBondedPet)
                {
                    BaseCreature bc = mob as BaseCreature;

                    if (bc != null)
                    {
                        CommandLogging.WriteLine(from, "{0} {1} resurrecting {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(mob));

                        bc.PlaySound(0x214);
                        bc.FixedEffect(0x376A, 10, 16);

                        bc.ResurrectPet();

                        AddResponse("It has been resurrected.");
                    }
                }
                else if (!mob.Alive)
                {
                    CommandLogging.WriteLine(from, "{0} {1} resurrecting {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(mob));

                    mob.PlaySound(0x214);
                    mob.FixedEffect(0x376A, 10, 16);

                    mob.Resurrect();

                    AddResponse("They have been resurrected.");
                }
                else
                {
                    LogFailure("They are not dead.");
                }
            }
        }
示例#25
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Mobile)
                {
                    Mobile targ = (Mobile)targeted;

                    if (targ.Client != null)
                    {
                        CommandLogging.WriteLine(from, "{0} {1} opening client menu of {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(targeted));
                        from.SendGump(new ClientGump(from, targ.Client));
                    }
                }
            }
示例#26
0
        public override void Execute(CommandEventArgs e, object obj)
        {
            Mobile m = (Mobile)obj;

            CommandLogging.WriteLine(e.Mobile, "{0} {1} {2} {3}", e.Mobile.AccessLevel, CommandLogging.Format(e.Mobile), m_Value ? "hiding" : "unhiding", CommandLogging.Format(m));

            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z + 4), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z - 4), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z + 4), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z - 4), m.Map, 0x3728, 13);

            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 11), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 7), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 3), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z - 1), m.Map, 0x3728, 13);

            m.PlaySound(0x228);
            m.Hidden = m_Value;

            if (m_Value)
            {
                AddResponse("They have been hidden.");
            }
            else
            {
                AddResponse("They have been revealed.");
            }
        }
示例#27
0
			protected override void OnTarget( Mobile from, object targ )
			{
				if ( !(targ is Item) )
				{
					from.SendMessage( "You can only dupe items." );
					return;
				}

                Server.World.Broadcast(0x35, true, "Performing routine maintenance, please wait.");
                Console.WriteLine("AddToBank: working...");
                DateTime startTime = DateTime.Now;

				from.SendMessage( "Placing {0} into bank boxes...", ((Item)targ).Name == null ? "an item" : ((Item)targ).Name.ToString() );
				CommandLogging.WriteLine( from, "{0} {1} adding {2} to bank boxes )", from.AccessLevel, CommandLogging.Format( from ), CommandLogging.Format( targ ) );

				GiveItem(from, (Item)targ, m_Amount, m_CopyProperties,m_GiveRule, m_Access);

                DateTime endTime = DateTime.Now;
                Console.WriteLine("done in {0:F1} seconds.", (endTime - startTime).TotalSeconds);
                Server.World.Broadcast(0x35, true, "Routine maintenance complete. The entire process took {0:F1} seconds.", (endTime - startTime).TotalSeconds);
			}
示例#28
0
        public override void Execute(CommandEventArgs e, object obj)
        {
            Mobile     from  = e.Mobile;
            Mobile     targ  = (Mobile)obj;
            GameClient state = targ.Client;

            if (state != null)
            {
                CommandLogging.WriteLine(from, "{0} {1} firewalling {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(targ));

                Firewall.Add(state.Address);
                AddResponse("They have been firewalled.");
            }
            else
            {
                LogFailure("They are not online.");
            }
        }
示例#29
0
        public static int Build(Mobile from, Point3D start, Point3D end, ConstructorInfo ctor, object[] values, string[,] props, PropertyInfo[] realProps, ArrayList packs)
        {
            try
            {
                Map map = from.Map;

                int objectCount = (packs == null ? (((end.X - start.X) + 1) * ((end.Y - start.Y) + 1)) : packs.Count);

                if (objectCount >= 20)
                {
                    from.SendMessage("Constructing {0} objects, please wait.", objectCount);
                }

                bool sendError = true;

                StringBuilder sb = new StringBuilder();
                sb.Append("Serials: ");

                if (packs != null)
                {
                    for (int i = 0; i < packs.Count; ++i)
                    {
                        object built = Build(from, ctor, values, props, realProps, ref sendError);

                        if (built is IEntity)
                        {
                            sb.AppendFormat("0x{0:X}; ", ((IEntity)built).Serial.Value);
                        }
                        else
                        {
                            continue;
                        }

                        if (built is Item)
                        {
                            Container pack = (Container)packs[i];

                            pack.DropItem((Item)built);
                        }
                        else if (built is Mobile)
                        {
                            Mobile m = (Mobile)built;

                            m.MoveToWorld(new Point3D(start.X, start.Y, start.Z), map);
                        }
                    }
                }
                else
                {
                    for (int x = start.X; x <= end.X; ++x)
                    {
                        for (int y = start.Y; y <= end.Y; ++y)
                        {
                            object built = Build(from, ctor, values, props, realProps, ref sendError);

                            if (built is IEntity)
                            {
                                sb.AppendFormat("0x{0:X}; ", ((IEntity)built).Serial.Value);
                            }
                            else
                            {
                                continue;
                            }

                            if (built is Item)
                            {
                                Item item = (Item)built;

                                item.MoveToWorld(new Point3D(x, y, start.Z), map);
                            }
                            else if (built is Mobile)
                            {
                                Mobile m = (Mobile)built;

                                m.MoveToWorld(new Point3D(x, y, start.Z), map);
                            }
                        }
                    }
                }

                CommandLogging.WriteLine(from, sb.ToString());

                return(objectCount);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                return(0);
            }
        }
示例#30
0
        public override void Execute(CommandEventArgs e, object obj)
        {
            Mobile from = e.Mobile;
            Mobile mob  = (Mobile)obj;

            CommandLogging.WriteLine(from, "{0} {1} dismounting {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(mob));

            bool takenAction = false;

            for (int i = 0; i < mob.Items.Count; ++i)
            {
                Item item = (Item)mob.Items[i];

                if (item is IMountItem)
                {
                    IMount mount = ((IMountItem)item).Mount;

                    if (mount != null)
                    {
                        mount.Rider = null;
                        if (mob is TeiravonMobile)
                        {
                            TeiravonMobile tm = (TeiravonMobile)mob;
                            tm.Dismounted();
                        }
                        takenAction = true;
                    }

                    if (mob.Items.IndexOf(item) == -1)
                    {
                        --i;
                    }
                }
            }

            for (int i = 0; i < mob.Items.Count; ++i)
            {
                Item item = (Item)mob.Items[i];

                if (item.Layer == Layer.Mount)
                {
                    takenAction = true;
                    item.Delete();
                    --i;
                }
            }

            if (takenAction)
            {
                AddResponse("They have been dismounted.");
            }
            else
            {
                LogFailure("They were not mounted.");
            }
        }