Ejemplo n.º 1
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            if (from.AccessLevel < AccessLevel.Counselor)
            {
                from.SendMessage(2102, "Only staff members can use this.");
            }
            else
            {
                switch (info.ButtonID)
                {
                case 8:
                {
                    CommandToolbarEdit gump = new CommandToolbarEdit("Props", "M Tele", "Move", "M Delete", "Wipe", "Who", "Add", "Normal", "true", "true");

                    /*gump.AddTextEntry(153, 90, 445, 20, 2101, 1, @"Props" );
                     * gump.AddTextEntry(153, 130, 445, 20, 2101, 2, @"M Tele" );
                     * gump.AddTextEntry(153, 170, 445, 20, 2101, 3, @"Move" );
                     * gump.AddTextEntry(153, 210, 445, 20, 2101, 4, @"M Delete" );
                     * gump.AddTextEntry(153, 250, 445, 20, 2101, 5, @"Wipe" );
                     * gump.AddTextEntry(153, 290, 445, 20, 2101, 6, @"Who" );
                     * gump.AddTextEntry(153, 330, 445, 20, 2101, 7, @"Add" );
                     * gump.HideB = true;
                     * gump.Adv = true;
                     * gump.HideS = "Normal";
                     * gump.AddButton(287, 399, 2153, 2151, 12, GumpButtonType.Reply, 1);
                     * gump.AddLabel(374, 403, 0, gump.HideType);
                     *
                     * gump.AddPage(2);
                     *
                     * gump.AddBackground(0, 0, 273, 545, 9270);
                     * gump.AddLabel(75, 39, 2101, @"Hide Type Edit Menu");
                     *
                     * gump.AddBackground(64, 83, 131, 26, 9350);
                     * gump.AddLabel(72, 87, 0, @"Normal Hide");
                     * gump.AddButton(196, 87, 5601, 5605, 14, GumpButtonType.Reply, 2);
                     * gump.AddBackground(64, 123, 131, 26, 9350);
                     * gump.AddLabel(72, 127, 0, @"Blood Oath Hide");
                     * gump.AddButton(196, 127, 5601, 5605, 15, GumpButtonType.Reply, 2);
                     * gump.AddBackground(64, 163, 131, 26, 9350);
                     * gump.AddLabel(72, 167, 0, @"Divine Male Hide");
                     * gump.AddButton(196, 167, 5601, 5605, 16, GumpButtonType.Reply, 2);
                     * gump.AddBackground(64, 203, 131, 26, 9350);
                     * gump.AddLabel(72, 207, 0, @"Divine Female Hide");
                     * gump.AddButton(196, 207, 5601, 5605, 17, GumpButtonType.Reply, 2);
                     * gump.AddBackground(64, 243, 131, 26, 9350);
                     * gump.AddLabel(72, 247, 0, @"Explosion Hide");
                     * gump.AddButton(196, 247, 5601, 5605, 18, GumpButtonType.Reply, 2);
                     * gump.AddBackground(64, 283, 131, 26, 9350);
                     * gump.AddLabel(72, 287, 0, @"Fire Hide");
                     * gump.AddButton(196, 287, 5601, 5605, 19, GumpButtonType.Reply, 2);
                     * gump.AddBackground(64, 323, 131, 26, 9350);
                     * gump.AddLabel(72, 327, 0, @"Noble Hide");
                     * gump.AddButton(196, 327, 5601, 5605, 20, GumpButtonType.Reply, 2);
                     * gump.AddBackground(64, 363, 131, 26, 9350);
                     * gump.AddLabel(72, 367, 0, @"Poison Hide");
                     * gump.AddButton(196, 367, 5601, 5605, 21, GumpButtonType.Reply, 2);
                     * gump.AddBackground(64, 403, 131, 26, 9350);
                     * gump.AddLabel(72, 407, 0, @"Shiney Hide");
                     * gump.AddButton(196, 407, 5601, 5605, 22, GumpButtonType.Reply, 2);
                     * gump.AddBackground(64, 443, 131, 26, 9350);
                     * gump.AddLabel(72, 447, 0, @"Thunder Hide");
                     * gump.AddButton(196, 447, 5601, 5605, 23, GumpButtonType.Reply, 2);
                     * gump.AddBackground(64, 483, 131, 26, 9350);
                     * gump.AddLabel(72, 487, 0, @"Wither Hide");
                     * gump.AddButton(196, 487, 5601, 5605, 24, GumpButtonType.Reply, 2);*/
                    from.SendGump(gump);
                    from.SendMessage(2102, "Settings have been changed to default.");

                    break;
                }

                case 9:
                {
                    TextRelay t1 = info.GetTextEntry(1);
                    C1 = t1.Text.Replace("|", "");
                    TextRelay t2 = info.GetTextEntry(2);
                    C2 = t2.Text.Replace("|", "");
                    TextRelay t3 = info.GetTextEntry(3);
                    C3 = t3.Text.Replace("|", "");
                    TextRelay t4 = info.GetTextEntry(4);
                    C4 = t4.Text.Replace("|", "");
                    TextRelay t5 = info.GetTextEntry(5);
                    C5 = t5.Text.Replace("|", "");
                    TextRelay t6 = info.GetTextEntry(6);
                    C6 = t6.Text.Replace("|", "");
                    TextRelay t7 = info.GetTextEntry(7);
                    C7 = t7.Text.Replace("|", "");

                    if (C1 != null && C2 != null && C3 != null && C4 != null && C5 != null && C6 != null && C7 != null)
                    {
                        Account A = from.Account as Account;
                        A.RemoveTag("CommandToolbar");
                        string ADV = "false", HIDEB = "false";
                        if (Adv)
                        {
                            ADV = "true";
                        }
                        if (HideB)
                        {
                            HIDEB = "true";
                        }
                        A.SetTag("CommandToolbar", C1 + "|" + C2 + "|" + C3 + "|" + C4 + "|" + C5 + "|" + C6 + "|" + C7 + "|" + HideS + "|" + HIDEB + "|" + ADV);
                        from.SendMessage(2102, "Your new settings have been successfully applied.");
                        if (from.HasGump(typeof(CommandToolbar)))
                        {
                            from.CloseGump(typeof(CommandToolbar));
                            ToolbarCmds.TagToolbar(from);
                        }
                    }
                    else
                    {
                        from.SendMessage(2102, "One of your text entries is invalid. Please try again.");
                    }

                    break;
                }

                case 11:
                {
                    TextRelay t1 = info.GetTextEntry(1);
                    C1 = t1.Text.Replace("|", "");
                    TextRelay t2 = info.GetTextEntry(2);
                    C2 = t2.Text.Replace("|", "");
                    TextRelay t3 = info.GetTextEntry(3);
                    C3 = t3.Text.Replace("|", "");
                    TextRelay t4 = info.GetTextEntry(4);
                    C4 = t4.Text.Replace("|", "");
                    TextRelay t5 = info.GetTextEntry(5);
                    C5 = t5.Text.Replace("|", "");
                    TextRelay t6 = info.GetTextEntry(6);
                    C6 = t6.Text.Replace("|", "");
                    TextRelay t7 = info.GetTextEntry(7);
                    C7 = t7.Text.Replace("|", "");

                    string ADV = "false", HIDEB = "false";
                    if (Adv)
                    {
                        ADV = "true";
                    }
                    if (!HideB)
                    {
                        HIDEB = "true";
                    }
                    from.SendGump(new CommandToolbarEdit(C1, C2, C3, C4, C5, C6, C7, HideS, HIDEB, ADV));

                    break;
                }
                }
            }
        }
Ejemplo n.º 2
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile   from   = state.Mobile;
            string   prefix = CommandSystem.Prefix;
            IPoint3D p      = from.Location as IPoint3D;

            if (from.AccessLevel < AccessLevel.Counselor)
            {
                from.SendMessage(2102, "Only staff members can use this.");
                return;
            }

            switch (info.ButtonID)
            {
            case 1:
            {
                from.SendMessage(2102, "{0}{1}", prefix, C1);
                CommandSystem.Handle(from, String.Format("{0}{1}", prefix, C1));
                ToolbarCmds.TagToolbar(from);
                break;
            }

            case 2:
            {
                from.SendMessage(2109, "{0}{1}", prefix, C2);
                CommandSystem.Handle(from, String.Format("{0}{1}", prefix, C2));
                ToolbarCmds.TagToolbar(from);
                break;
            }

            case 3:
            {
                from.SendMessage(2102, "{0}{1}", prefix, C3);
                CommandSystem.Handle(from, String.Format("{0}{1}", prefix, C3));
                ToolbarCmds.TagToolbar(from);
                break;
            }

            case 4:
            {
                from.SendMessage(2109, "{0}{1}", prefix, C4);
                CommandSystem.Handle(from, String.Format("{0}{1}", prefix, C4));
                ToolbarCmds.TagToolbar(from);
                break;
            }

            case 5:
            {
                from.SendMessage(2102, "{0}{1}", prefix, C5);
                CommandSystem.Handle(from, String.Format("{0}{1}", prefix, C5));
                ToolbarCmds.TagToolbar(from);
                break;
            }

            case 6:
            {
                from.SendMessage(2109, "{0}{1}", prefix, C6);
                CommandSystem.Handle(from, String.Format("{0}{1}", prefix, C6));
                ToolbarCmds.TagToolbar(from);
                break;
            }

            case 7:
            {
                from.SendMessage(2102, "{0}{1}", prefix, C7);
                CommandSystem.Handle(from, String.Format("{0}{1}", prefix, C7));
                ToolbarCmds.TagToolbar(from);
                break;
            }

            case 9:
            {
                //if ( HideType == "Normal" )
                //{
                Effects.SendLocationEffect(new Point3D(from.X + 1, from.Y, from.Z + 4), from.Map, 0x3728, 13);
                Effects.SendLocationEffect(new Point3D(from.X + 1, from.Y, from.Z), from.Map, 0x3728, 13);
                Effects.SendLocationEffect(new Point3D(from.X + 1, from.Y, from.Z - 4), from.Map, 0x3728, 13);
                Effects.SendLocationEffect(new Point3D(from.X, from.Y + 1, from.Z + 4), from.Map, 0x3728, 13);
                Effects.SendLocationEffect(new Point3D(from.X, from.Y + 1, from.Z), from.Map, 0x3728, 13);
                Effects.SendLocationEffect(new Point3D(from.X, from.Y + 1, from.Z - 4), from.Map, 0x3728, 13);
                Effects.SendLocationEffect(new Point3D(from.X + 1, from.Y + 1, from.Z + 11), from.Map, 0x3728, 13);
                Effects.SendLocationEffect(new Point3D(from.X + 1, from.Y + 1, from.Z + 7), from.Map, 0x3728, 13);
                Effects.SendLocationEffect(new Point3D(from.X + 1, from.Y + 1, from.Z + 3), from.Map, 0x3728, 13);
                Effects.SendLocationEffect(new Point3D(from.X + 1, from.Y + 1, from.Z - 1), from.Map, 0x3728, 13);
                from.PlaySound(0x228);
                if (!from.Hidden)
                {
                    from.Hidden = true;
                }
                else
                {
                    from.Hidden = false;
                }
                //}

                ToolbarCmds.TagToolbar(from);
                break;
            }

                /*case 10:
                 * {
                 *      if( (from.HasGump( typeof( ItemMove ))) || (from.HasGump( typeof( MobileMove))))
                 *      {
                 *              from.SendMessage("You must close all Item/Mobile movers before you do this!");
                 *      }
                 *      else
                 *      {
                 *              from.Target = new ItemMobileMoveTarget( this );
                 *              from.SendMessage("Select an item/mobile.");
                 *      }
                 *
                 *      from.SendGump( new CommandToolbar( item ) );
                 *      break;
                 * }
                 * case 11:
                 * {
                 *      if( from.HasGump( typeof( CreatureControl )))
                 *      {
                 *              from.SendMessage("You must close all Creature Controls before you do this!");
                 *      }
                 *      else
                 *      {
                 *              from.Target = new ControlTarget( this );
                 *              from.SendMessage("Select a creature.");
                 *      }
                 *
                 *      from.SendGump( new CommandToolbar( item ) );
                 *      break;
                 * }*/
            }
        }