Esempio n. 1
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (info.ButtonID != 0 && PageQueue.List.IndexOf(m_Entry) < 0)
            {
                state.Mobile.SendGump(new PageQueueGump());
                state.Mobile.SendMessage("That page has been removed.");
                return;
            }

            switch (info.ButtonID)
            {
            case 0:                     // close
            {
                if (m_Entry.Handler != state.Mobile)
                {
                    PageQueueGump g = new PageQueueGump();

                    g.SendTo(state);
                }

                break;
            }

            case 1:                     // go to sender
            {
                Mobile m = state.Mobile;

                if (m_Entry.Sender.Deleted)
                {
                    m.SendMessage("That character no longer exists.");
                }
                else if (m_Entry.Sender.Map == null || m_Entry.Sender.Map == Map.Internal)
                {
                    m.SendMessage("That character is not in the world.");
                }
                else
                {
                    m_Entry.AddResponse(state.Mobile, "[Go Sender]");
                    m.MoveToWorld(m_Entry.Sender.Location, m_Entry.Sender.Map);

                    m.SendMessage("You have been teleported to that pages sender.");

                    Resend(state);
                }

                break;
            }

            case 2:                     // go to handler
            {
                Mobile m = state.Mobile;
                Mobile h = m_Entry.Handler;

                if (h != null)
                {
                    if (h.Deleted)
                    {
                        m.SendMessage("That character no longer exists.");
                    }
                    else if (h.Map == null || h.Map == Map.Internal)
                    {
                        m.SendMessage("That character is not in the world.");
                    }
                    else
                    {
                        m_Entry.AddResponse(state.Mobile, "[Go Handler]");
                        m.MoveToWorld(h.Location, h.Map);

                        m.SendMessage("You have been teleported to that pages handler.");
                        Resend(state);
                    }
                }
                else
                {
                    m.SendMessage("Nobody is handling that page.");
                    Resend(state);
                }

                break;
            }

            case 3:                     // go to page location
            {
                Mobile m = state.Mobile;

                if (m_Entry.PageMap == null || m_Entry.PageMap == Map.Internal)
                {
                    m.SendMessage("That location is not in the world.");
                }
                else
                {
                    m_Entry.AddResponse(state.Mobile, "[Go PageLoc]");
                    m.MoveToWorld(m_Entry.PageLocation, m_Entry.PageMap);

                    state.Mobile.SendMessage("You have been teleported to the original page location.");

                    Resend(state);
                }

                break;
            }

            case 4:                     // handle page
            {
                if (m_Entry.Handler == null)
                {
                    m_Entry.AddResponse(state.Mobile, "[Handling]");
                    m_Entry.Handler = state.Mobile;

                    state.Mobile.SendMessage("You are now handling the page.");
                }
                else
                {
                    state.Mobile.SendMessage("Someone is already handling that page.");
                }

                Resend(state);

                break;
            }

            case 5:                     // delete page
            {
                if (m_Entry.Handler == null)
                {
                    m_Entry.AddResponse(state.Mobile, "[Deleting]");
                    PageQueue.Remove(m_Entry);

                    state.Mobile.SendMessage("You delete the page.");

                    PageQueueGump g = new PageQueueGump();

                    g.SendTo(state);
                }
                else
                {
                    state.Mobile.SendMessage("Someone is handling that page, it can not be deleted.");

                    Resend(state);
                }

                break;
            }

            case 6:                     // abandon page
            {
                if (m_Entry.Handler == state.Mobile)
                {
                    m_Entry.AddResponse(state.Mobile, "[Abandoning]");
                    state.Mobile.SendMessage("You abandon the page.");

                    m_Entry.Handler = null;
                }
                else
                {
                    state.Mobile.SendMessage("You are not handling that page.");
                }

                Resend(state);

                break;
            }

            case 7:                     // page handled
            {
                if (m_Entry.Handler == state.Mobile)
                {
                    m_Entry.AddResponse(state.Mobile, "[Handled]");
                    PageQueue.Remove(m_Entry);

                    m_Entry.Handler = null;

                    state.Mobile.SendMessage("You mark the page as handled, and remove it from the queue.");

                    PageQueueGump g = new PageQueueGump();

                    g.SendTo(state);
                }
                else
                {
                    state.Mobile.SendMessage("You are not handling that page.");

                    Resend(state);
                }

                break;
            }

            case 8:                     // Send message
            {
                TextRelay text = info.GetTextEntry(0);

                if (text != null)
                {
                    m_Entry.AddResponse(state.Mobile, "[Response] " + text.Text);
                    m_Entry.Sender.SendGump(new MessageSentGump(m_Entry.Sender, state.Mobile.Name, text.Text));
                    //m_Entry.Sender.SendMessage( 0x482, "{0} tells you:", state.Mobile.Name );
                    //m_Entry.Sender.SendMessage( 0x482, text.Text );
                }

                Resend(state);

                break;
            }

            case 9:                     // predef overview
            {
                Resend(state);
                state.Mobile.SendGump(new PredefGump(state.Mobile, null));

                break;
            }

            case 10:                     // View Speech Log
            {
                Resend(state);

                if (m_Entry.SpeechLog != null)
                {
                    Gump gump = new SpeechLogGump(m_Entry.Sender, m_Entry.SpeechLog);
                    state.Mobile.SendGump(gump);
                }

                break;
            }

            default:
            {
                int       index   = info.ButtonID - 100;
                ArrayList preresp = PredefinedResponse.List;

                if (index >= 0 && index < preresp.Count)
                {
                    m_Entry.AddResponse(state.Mobile, "[PreDef] " + ((PredefinedResponse)preresp[index]).Title);
                    m_Entry.Sender.SendGump(new MessageSentGump(m_Entry.Sender, state.Mobile.Name, ((PredefinedResponse)preresp[index]).Message));
                }

                Resend(state);

                break;
            }
            }
        }
Esempio n. 2
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            PageType type = (PageType)(-1);

            switch (info.ButtonID)
            {
            case 0:                                          // Close/Cancel
            {
                from.SendLocalizedMessage(501235, "", 0x35); // Help request aborted.

                break;
            }

            case 1:     // General question
            {
                type = PageType.Question;
                break;
            }

            case 2:     // Stuck
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (house != null && house.IsAosRules && !from.Region.IsPartOf(typeof(Engines.ConPVP.SafeZone)))         // Dueling
                {
                    from.Location = house.BanLocation;
                }
                else if (from.Region.IsPartOf(typeof(Server.Regions.Jail)))
                {
                    from.SendLocalizedMessage(1114345, "", 0x35);         // You'll need a better jailbreak plan than that!
                }
                else if (Factions.Sigil.ExistsOn(from))
                {
                    from.SendLocalizedMessage(1061632);         // You can't do that while carrying the sigil.
                }
                else if (from is PlayerMobile && ((PlayerMobile)from).CanUseStuckMenu() && from.Region.CanUseStuckMenu(from) && !CheckCombat(from) && !from.Frozen && !from.Criminal && (Core.AOS || from.Kills < 5))
                {
                    StuckMenu menu = new StuckMenu(from, from, true);

                    menu.BeginClose();

                    from.SendGump(menu);
                }
                else
                {
                    type = PageType.Stuck;
                }

                break;
            }

            case 3:     // Report bug or contact Origin
            {
                type = PageType.Bug;
                break;
            }

            case 4:     // Game suggestion
            {
                type = PageType.Suggestion;
                break;
            }

            case 5:     // Account management
            {
                type = PageType.Account;
                break;
            }

            case 6:     // Other
            {
                type = PageType.Other;
                break;
            }

            case 7:     // Harassment: verbal/exploit
            {
                type = PageType.VerbalHarassment;
                break;
            }

            case 8:     // Harassment: physical
            {
                type = PageType.PhysicalHarassment;
                break;
            }

            case 9:     // Young player transport
            {
                if (IsYoung(from))
                {
                    if (from.Region.IsPartOf(typeof(Regions.Jail)))
                    {
                        from.SendLocalizedMessage(1114345, "", 0x35);         // You'll need a better jailbreak plan than that!
                    }
                    else if (from.Region.IsPartOf("Haven Island"))
                    {
                        from.SendLocalizedMessage(1041529);         // You're already in Haven
                    }
                    else
                    {
                        from.MoveToWorld(new Point3D(3503, 2574, 14), Map.Trammel);
                    }
                }

                break;
            }
            }

            if (type != (PageType)(-1) && PageQueue.CheckAllowedToPage(from))
            {
                from.SendGump(new PagePromptGump(from, type));
            }
        }
Esempio n. 3
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            try
            {
                Mobile from = state.Mobile;

                PageType type = (PageType)(-1);

                switch (info.ButtonID)
                {
                case 0:                                          // Close/Cancel
                {
                    from.SendLocalizedMessage(501235, "", 0x35); // Help request aborted.

                    break;
                }

                case 1:                         // General question
                {
                    type = PageType.Question;
                    break;
                }

                case 2:                         // Stuck
                {
                    if (CoreAI.IsDynamicFeatureSet(CoreAI.FeatureBits.HelpStuckDisabled))
                    {
                        from.SendMessage("Sorry, help stuck is unavailable at this time. Please page for GM assistance");
                        return;
                    }

                    if (StuckMenu.ValidUseLocation(from, from))
                    {
                        //if (!TryMoveStuckPlayer(from, 4))
                        //{
                        //	int staffonline = 0;
                        //	foreach (NetState ns in NetState.Instances)
                        //	{
                        //		Mobile m = ns.Mobile;
                        //		if (m != null && m.AccessLevel >= AccessLevel.Counselor && m.AutoPageNotify)
                        //			staffonline++;
                        //	}
                        //
                        //	if (staffonline == 0)
                        //	{
                        //		StuckMenu menu = new StuckMenu( from, from, true );
                        //
                        //		menu.BeginClose();
                        //
                        //		from.SendGump( menu );
                        //	}
                        //	else
                        //	{
                        //		type = PageType.Stuck;
                        //	}
                        //}


                        from.SendMenu(new HelpStuckQuestion(from));
                    }
                    else
                    {
                        type = PageType.Stuck;
                    }

                    break;
                }

                case 3:                         // Report bug or contact Origin
                {
                    type = PageType.Bug;
                    break;
                }

                case 4:                         // Game suggestion
                {
                    type = PageType.Suggestion;
                    break;
                }

                case 5:                         // Account management
                {
                    type = PageType.Account;
                    break;
                }

                case 6:                         // Other
                {
                    type = PageType.Other;
                    break;
                }

                case 7:                         // Harassment: verbal/exploit
                {
                    type = PageType.Harassment;
                    break;
                }

                case 8:                         // Harassment: physical
                {
                    type = PageType.PhysicalHarassment;
                    break;
                }

                case 9:                         // Young player transport
                {
                    /*
                     * if ( IsYoung( from ) )
                     * {
                     *      if ( from.Region is Regions.Jail )
                     *      {
                     *              from.SendLocalizedMessage( 1041530, "", 0x35 ); // You'll need a better jailbreak plan then that!
                     *      }
                     *      else if ( from.Region.Name == "Haven" )
                     *      {
                     *              from.SendLocalizedMessage( 1041529 ); // You're already in Haven
                     *      }
                     *      else
                     *      {
                     *              from.MoveToWorld( new Point3D( 3618, 2587, 0 ), Map.Trammel );
                     *      }
                     * }
                     */

                    break;
                }
                }

                if (type != (PageType)(-1) && PageQueue.CheckAllowedToPage(from))
                {
                    from.SendGump(new PagePromptGump(from, type));
                }
            }
            catch (Exception exc)
            {
                LogHelper.LogException(exc);
                System.Console.WriteLine("Exception caught in HelpGump.OnResponse: " + exc.Message);
                System.Console.WriteLine(exc.StackTrace.ToString());
            }
        }
Esempio n. 4
0
        public PageEntryGump(Mobile m, PageEntry entry) : base(30, 30)
        {
            try
            {
                m_Mobile = m;
                m_Entry  = entry;

                int buttons = 0;

                int bottom = 356;

                AddPage(0);

                AddImageTiled(0, 0, 410, 456, 0xA40);
                AddAlphaRegion(1, 1, 408, 454);

                AddPage(1);

                AddLabel(18, 18, 2100, "Sent:");
                AddLabelCropped(128, 18, 264, 20, 2100, entry.Sent.ToString());

                AddLabel(18, 38, 2100, "Sender:");
                AddLabelCropped(128, 38, 264, 20, 2100, String.Format("{0} {1} [{2}]", entry.Sender.RawName, entry.Sender.Location, entry.Sender.Map));

                AddButton(18, bottom - (buttons * 22), 0xFAB, 0xFAD, 8, GumpButtonType.Reply, 0);
                AddImageTiled(52, bottom - (buttons * 22) + 1, 340, 80, 0xA40 /*0xBBC*//*0x2458*/);
                AddImageTiled(53, bottom - (buttons * 22) + 2, 338, 78, 0xBBC /*0x2426*/);
                AddTextEntry(55, bottom - (buttons++ *22) + 2, 336, 78, 0x480, 0, "");

                AddButton(18, bottom - (buttons * 22), 0xFA5, 0xFA7, 0, GumpButtonType.Page, 2);
                AddLabel(52, bottom - (buttons++ *22), 2100, "Predefined Response");

                if (entry.Sender != m)
                {
                    AddButton(18, bottom - (buttons * 22), 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
                    AddLabel(52, bottom - (buttons++ *22), 2100, "Go to Sender");
                }

                AddLabel(18, 58, 2100, "Handler:");

                if (entry.Handler == null)
                {
                    AddLabelCropped(128, 58, 264, 20, 2100, "Unhandled");

                    AddButton(18, bottom - (buttons * 22), 0xFB1, 0xFB3, 5, GumpButtonType.Reply, 0);
                    AddLabel(52, bottom - (buttons++ *22), 2100, "Delete Page");

                    AddButton(18, bottom - (buttons * 22), 0xFB7, 0xFB9, 4, GumpButtonType.Reply, 0);
                    AddLabel(52, bottom - (buttons++ *22), 2100, "Handle Page");
                }
                else
                {
                    AddLabelCropped(128, 58, 264, 20, m_AccessLevelHues[(int)entry.Handler.AccessLevel], entry.Handler.Name);

                    if (entry.Handler != m)
                    {
                        AddButton(18, bottom - (buttons * 22), 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0);
                        AddLabel(52, bottom - (buttons++ *22), 2100, "Go to Handler");
                    }
                    else
                    {
                        AddButton(18, bottom - (buttons * 22), 0xFA2, 0xFA4, 6, GumpButtonType.Reply, 0);
                        AddLabel(52, bottom - (buttons++ *22), 2100, "Abandon Page");

                        AddButton(18, bottom - (buttons * 22), 0xFB7, 0xFB9, 7, GumpButtonType.Reply, 0);
                        AddLabel(52, bottom - (buttons++ *22), 2100, "Page Handled");
                    }
                }

                AddLabel(18, 78, 2100, "Page Location:");
                AddLabelCropped(128, 78, 264, 20, 2100, String.Format("{0} [{1}]", entry.PageLocation, entry.PageMap));

                AddButton(18, bottom - (buttons * 22), 0xFA5, 0xFA7, 3, GumpButtonType.Reply, 0);
                AddLabel(52, bottom - (buttons++ *22), 2100, "Go to Page Location");

                if (entry.SpeechLog != null)
                {
                    AddButton(18, bottom - (buttons * 22), 0xFA5, 0xFA7, 10, GumpButtonType.Reply, 0);
                    AddLabel(52, bottom - (buttons++ *22), 2100, "View Speech Log");
                }

                AddLabel(18, 98, 2100, "Page Type:");
                AddLabelCropped(128, 98, 264, 20, 2100, PageQueue.GetPageTypeName(entry.Type));

                AddLabel(18, 118, 2100, "Message:");
                AddHtml(128, 118, 250, 100, entry.Message, true, true);

                AddPage(2);

                ArrayList preresp = PredefinedResponse.List;

                AddButton(18, 18, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1);
                AddButton(410 - 18 - 32, 18, 0xFAB, 0xFAC, 9, GumpButtonType.Reply, 0);

                if (preresp.Count == 0)
                {
                    AddLabel(52, 18, 2100, "There are no predefined responses.");
                }
                else
                {
                    AddLabel(52, 18, 2100, "Back");

                    for (int i = 0; i < preresp.Count; ++i)
                    {
                        AddButton(18, 40 + (i * 22), 0xFA5, 0xFA7, 100 + i, GumpButtonType.Reply, 0);
                        AddLabel(52, 40 + (i * 22), 2100, ((PredefinedResponse)preresp[i]).Title);
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Esempio n. 5
0
        public PageQueueGump(Mobile m)
            : base(30, 30)
        {
            Add(new GumpPage(0));

            if (m != null && m.NetState != null && m.NetState.IsEnhancedClient)
            {
                AddBackground(1, 1, 408, 446, 9300);
            }
            else
            {
                Add(new GumpImageTiled(0, 0, 410, 448, 0xA40));
                Add(new GumpAlphaRegion(1, 1, 408, 446));
            }

            Add(new GumpLabel(180, 12, 2100, "Page Queue"));

            ArrayList list = PageQueue.List;

            for (int i = 0; i < list.Count;)
            {
                PageEntry e = (PageEntry)list[i];

                if (e.Sender.Deleted)
                {
                    e.AddResponse(e.Sender, "[Logout]");
                    PageQueue.Remove(e);
                }
                else
                {
                    ++i;
                }
            }

            m_List = (PageEntry[])list.ToArray(typeof(PageEntry));

            if (m_List.Length > 0)
            {
                Add(new GumpPage(1));

                for (int i = 0; i < m_List.Length; ++i)
                {
                    PageEntry e = m_List[i];

                    if (i >= 5 && (i % 5) == 0)
                    {
                        AddButton(368, 12, 0xFA5, 0xFA7, 0, GumpButtonType.Page, (i / 5) + 1);
                        Add(new GumpLabel(298, 12, 2100, "Next Page"));
                        Add(new GumpPage((i / 5) + 1));
                        AddButton(12, 12, 0xFAE, 0xFB0, 0, GumpButtonType.Page, (i / 5));
                        Add(new GumpLabel(48, 12, 2100, "Previous Page"));
                    }

                    string typeString = PageQueue.GetPageTypeName(e.Type);

                    string html = string.Format("[{0}] {1} <basefont color=#{2:X6}>[<u>{3}</u>]</basefont>", typeString, e.Message, e.Handler == null ? 0xFF0000 : 0xFF, e.Handler == null ? "Unhandled" : "Handling");

                    Add(new GumpHtml(12, 44 + ((i % 5) * 80), 350, 70, html, true, true));
                    AddButton(370, 44 + ((i % 5) * 80) + 24, 0xFA5, 0xFA7, i + 1, GumpButtonType.Reply, 0);
                }
            }
            else
            {
                Add(new GumpLabel(12, 44, 2100, "The page queue is empty."));
            }
        }
Esempio n. 6
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            PageType type = (PageType)(-1);

            switch (info.ButtonID)
            {
            case 0:                                    // Close/Cancel
            {
                from.SendLocalizedMessage(501235, ""); // Help request aborted.

                break;
            }

            case 1:                     // General question
            {
                type = PageType.Question;
                break;
            }

            case 2:                     // Stuck
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (house != null && house.IsAosRules)
                {
                    from.Location = house.BanLocation;
                }
                else if (from.Region.IsPartOf(typeof(Jail)))
                {
                    from.SendLocalizedMessage(1114345, "", 0x35);     // You'll need a better jailbreak plan than that!
                }
                else if (Sigil.ExistsOn(from))
                {
                    from.SendLocalizedMessage(1061632);                               // You can't do that while carrying the sigil.
                }
                else if (from.CanUseStuckMenu() && from.Region.CanUseStuckMenu(from))
                {
                    StuckMenu menu = new StuckMenu(from, from, true);

                    menu.BeginClose();

                    from.SendGump(menu);
                }
                else
                {
                    type = PageType.Stuck;
                }

                break;
            }

            case 3:                     // Report bug or contact Origin
            {
                type = PageType.Bug;
                break;
            }

            case 4:                     // Game suggestion
            {
                type = PageType.Suggestion;
                break;
            }

            case 5:                     // Account management
            {
                type = PageType.Account;
                break;
            }

            case 6:                     // Other
            {
                type = PageType.Other;
                break;
            }

            case 7:                     // Harassment: verbal/exploit
            {
                type = PageType.VerbalHarassment;
                break;
            }

            case 8:                     // Harassment: physical
            {
                type = PageType.PhysicalHarassment;
                break;
            }

            case 9:                     // Young player transport
            {
                if (IsYoung(from))
                {
                    if (from.Region.IsPartOf(typeof(Jail)))
                    {
                        from.SendLocalizedMessage(1114345, "", 0x35);     // You'll need a better jailbreak plan than that!
                    }
                    else if (from.CanUseStuckMenu() && from.Region.CanUseStuckMenu(from))
                    {
                        from.MoveToWorld(new Point3D(1426, 1696, 0), Map.Felucca);

                        if (from.IsInEvent)
                        {
                            from.IsInEvent = false;
                            from.SendAsciiMessage("You auto supply has been removed.");

                            SupplySystem.RemoveEventGear(from);
                        }
                    }
                    else
                    {
                        from.SendAsciiMessage("You cannot use the young player transport system from where you are");
                    }
                }

                break;
            }
            }

            if (type != (PageType)(-1) && PageQueue.CheckAllowedToPage(from))
            {
                from.SendGump(new PagePromptGump(from, type));
            }
        }
Esempio n. 7
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile       from   = state.Mobile;
            PlayerMobile player = from as PlayerMobile;

            if (player == null)
            {
                return;
            }

            PageType type = (PageType)(-1);

            switch (info.ButtonID)
            {
            case 0:                                          // Close/Cancel
            {
                from.SendLocalizedMessage(501235, "", 0x35); // Help request aborted.
                break;
            }

            case 1:                     // General question
            {
                type = PageType.Question;
                break;
            }

            case 2:                     // Stuck
            {
                BaseHouse        house         = BaseHouse.FindHouseAt(player);
                WarpBlockerTotem recallBlocker = WarpBlockerTotem.RecallBlockerTriggered(player, WarpBlockerTotem.MovementMode.HelpStuck, player.Location, player.Map);

                if (house != null)
                {
                    player.Location = house.BanLocation;
                }

                else if (recallBlocker != null)
                {
                    if (recallBlocker.PreventHelpStuckResponse != "")
                    {
                        player.SendMessage(recallBlocker.PreventHelpStuckResponse);
                    }
                    else
                    {
                        player.SendMessage(WarpBlockerTotem.DefaultHelpStuckResponse);
                    }
                }

                else if (player.Region.IsPartOf(typeof(Server.Regions.Jail)))
                {
                    player.SendLocalizedMessage(1041530, "", 0x35);     // You'll need a better jailbreak plan then that!
                }
                else if (CheckCombat(player))
                {
                    player.SendMessage("You have been in combat too recently to use this option.");
                }

                else if (player.RecallRestrictionExpiration > DateTime.UtcNow)
                {
                    player.SendMessage("You must wait for your Recall Restriction to expire before you may use this option.");
                }

                else if (player.CanUseStuckMenu() && from.Region.CanUseStuckMenu(player) && !player.Frozen)
                {
                    StuckMenu menu = new StuckMenu(player, player, true);

                    menu.BeginClose();
                    player.SendGump(menu);
                }

                else
                {
                    type = PageType.Stuck;
                }

                break;
            }

            case 3:                     // Report bug or contact Origin
            {
                type = PageType.Bug;
                break;
            }

            case 4:                     // Game suggestion
            {
                type = PageType.Suggestion;
                break;
            }

            case 5:                     // Account management
            {
                type = PageType.Account;
                break;
            }

            case 6:                     // Other
            {
                type = PageType.Other;
                break;
            }

            case 7:                     // Harassment: verbal/exploit
            {
                type = PageType.VerbalHarassment;
                break;
            }

            case 8:                     // Harassment: physical
            {
                type = PageType.PhysicalHarassment;
                break;
            }
            }

            if (type != (PageType)(-1) && PageQueue.CheckAllowedToPage(from))
            {
                from.SendGump(new PagePromptGump(from, type));
            }
        }
Esempio n. 8
0
 public override void OnResponse(NetState state, RelayInfo info)
 {
     PageQueue.SendPageQueueGump(state.Mobile);
 }
Esempio n. 9
0
        public PageEntryGump(Mobile m, PageEntry entry) : base(30, 30)
        {
            m_Mobile = m;
            m_Entry  = entry;

            var buttons = 0;

            var bottom = 356;

            AddPage(0);

            AddImageTiled(0, 0, 410, 456, 0xA40);
            AddAlphaRegion(1, 1, 408, 454);

            AddPage(1);

            AddLabel(18, 18, 2100, "Sent:");
            AddLabelCropped(128, 18, 264, 20, 2100, entry.Sent.ToString());

            AddLabel(18, 38, 2100, "Sender:");
            AddLabelCropped(
                128,
                38,
                264,
                20,
                2100,
                $"{entry.Sender.RawName} {entry.Sender.Location} [{entry.Sender.Map}]"
                );

            AddButton(18, bottom - buttons * 22, 0xFAB, 0xFAD, 8);
            AddImageTiled(52, bottom - buttons * 22 + 1, 340, 80, 0xA40 /*0xBBC*/ /*0x2458*/);
            AddImageTiled(53, bottom - buttons * 22 + 2, 338, 78, 0xBBC /*0x2426*/);
            AddTextEntry(55, bottom - buttons++ *22 + 2, 336, 78, 0x480, 0, "");

            AddButton(18, bottom - buttons * 22, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 2);
            AddLabel(52, bottom - buttons++ *22, 2100, "Predefined Response");

            if (entry.Sender != m)
            {
                AddButton(18, bottom - buttons * 22, 0xFA5, 0xFA7, 1);
                AddLabel(52, bottom - buttons++ *22, 2100, "Go to Sender");
            }

            AddLabel(18, 58, 2100, "Handler:");

            if (entry.Handler == null)
            {
                AddLabelCropped(128, 58, 264, 20, 2100, "Unhandled");

                AddButton(18, bottom - buttons * 22, 0xFB1, 0xFB3, 5);
                AddLabel(52, bottom - buttons++ *22, 2100, "Delete Page");

                AddButton(18, bottom - buttons * 22, 0xFB7, 0xFB9, 4);
                AddLabel(52, bottom - buttons++ *22, 2100, "Handle Page");
            }
            else
            {
                AddLabelCropped(128, 58, 264, 20, m_AccessLevelHues[(int)entry.Handler.AccessLevel], entry.Handler.Name);

                if (entry.Handler != m)
                {
                    AddButton(18, bottom - buttons * 22, 0xFA5, 0xFA7, 2);
                    AddLabel(52, bottom - buttons++ *22, 2100, "Go to Handler");
                }
                else
                {
                    AddButton(18, bottom - buttons * 22, 0xFA2, 0xFA4, 6);
                    AddLabel(52, bottom - buttons++ *22, 2100, "Abandon Page");

                    AddButton(18, bottom - buttons * 22, 0xFB7, 0xFB9, 7);
                    AddLabel(52, bottom - buttons++ *22, 2100, "Page Handled");
                }
            }

            AddLabel(18, 78, 2100, "Page Location:");
            AddLabelCropped(128, 78, 264, 20, 2100, $"{entry.PageLocation} [{entry.PageMap}]");

            AddButton(18, bottom - buttons * 22, 0xFA5, 0xFA7, 3);
            AddLabel(52, bottom - buttons++ *22, 2100, "Go to Page Location");

            if (entry.SpeechLog != null)
            {
                AddButton(18, bottom - buttons * 22, 0xFA5, 0xFA7, 10);
                AddLabel(52, bottom - buttons * 22, 2100, "View Speech Log");
            }

            AddLabel(18, 98, 2100, "Page Type:");
            AddLabelCropped(128, 98, 264, 20, 2100, PageQueue.GetPageTypeName(entry.Type));

            AddLabel(18, 118, 2100, "Message:");
            AddHtml(128, 118, 250, 100, entry.Message, true, true);

            AddPage(2);

            var preresp = PredefinedResponse.List;

            AddButton(18, 18, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1);
            AddButton(410 - 18 - 32, 18, 0xFAB, 0xFAC, 9);

            if (preresp.Count == 0)
            {
                AddLabel(52, 18, 2100, "There are no predefined responses.");
            }
            else
            {
                AddLabel(52, 18, 2100, "Back");

                for (var i = 0; i < preresp.Count; ++i)
                {
                    AddButton(18, 40 + i * 22, 0xFA5, 0xFA7, 100 + i);
                    AddLabel(52, 40 + i * 22, 2100, preresp[i].Title);
                }
            }
        }
Esempio n. 10
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            PageType type = (PageType)(-1);

            switch (info.ButtonID)
            {
            case 0:                                          // Close/Cancel
            {
                from.SendLocalizedMessage(501235, "", 0x35); // Help request aborted.

                break;
            }

            case 1:                     // General question
            {
                type = PageType.Question;
                break;
            }

            case 2:                     // Stuck
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (from.Region.IsPartOf(typeof(Server.Regions.Jail)))
                {
                    from.SendLocalizedMessage(1114345, "", 0x35);                               // You'll need a better jailbreak plan than that!
                }
                else if (from.CanUseStuckMenu() && from.Region.CanUseStuckMenu(from) && !CheckCombat(from) && !from.Frozen && !from.Criminal && from.Kills < 5)
                {
                    StuckMenu menu = new StuckMenu(from, from, true);

                    menu.BeginClose();

                    from.SendGump(menu);
                }
                else
                {
                    type = PageType.Stuck;
                }

                break;
            }

            case 3:                     // Report bug or contact Origin
            {
                type = PageType.Bug;
                break;
            }

            case 4:                     // Game suggestion
            {
                type = PageType.Suggestion;
                break;
            }

            case 5:                     // Account management
            {
                type = PageType.Account;
                break;
            }

            case 6:                     // Other
            {
                type = PageType.Other;
                break;
            }

            case 7:                     // Harassment: verbal/exploit
            {
                type = PageType.VerbalHarassment;
                break;
            }

            case 8:                     // Harassment: physical
            {
                type = PageType.PhysicalHarassment;
                break;
            }
            }

            if (type != (PageType)(-1) && PageQueue.CheckAllowedToPage(from))
            {
                from.SendGump(new PagePromptGump(from, type));
            }
        }
Esempio n. 11
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            PageType type = (PageType)(-1);

            switch (info.ButtonID)
            {
            case 0:                                          // Close/Cancel
            {
                from.SendLocalizedMessage(501235, "", 0x35); // Help request aborted.

                break;
            }

            case 1:                     // General question about Ultima Online
            {
                from.LaunchBrowser("http://www.uo.com");
                break;
            }

            case 2:                     // Stuck
            {
                var house = HousingHelper.FindHouseAt(from);

                if (house != null)
                {
                    from.Location = house.BanLocation;
                }
                else if (from.Region.IsPartOf <Regions.Jail>())
                {
                    from.SendLocalizedMessage(1041530, "", 0x35);                                       // You'll need a better jailbreak plan then that!
                }
                else if (Factions.Sigil.ExistsOn(from))
                {
                    from.SendLocalizedMessage(1061632);                                       // You can't do that while carrying the sigil.
                }
                else if (from.CanUseStuckMenu() && from.Region.CanUseStuckMenu(from) && !CheckCombat(from) && !from.Frozen && !from.Criminal)
                {
                    StuckMenu menu = new StuckMenu(from, from, true);

                    menu.BeginClose();

                    from.SendGump(menu);
                }
                else
                {
                    type = PageType.Stuck;
                }

                break;
            }

            case 3:                     // Harassment: Verbal
            {
                type = PageType.VerbalHarassment;
                break;
            }

            case 4:                     // Other
            {
                type = PageType.Other;
                break;
            }

            case 5:                     // Visit the OWO web page
            {
                from.LaunchBrowser("http://www.uoguide.com/");
                break;
            }

            case 6:                     // Report a bug or contact Origin
            {
                from.LaunchBrowser("http://www.uo.com");
                break;
            }

            case 7:                     // Contact a Councelor
            {
                type = PageType.Question;
                break;
            }

            case 8:                     // Visit the Ultima Online web site
            {
                from.LaunchBrowser("http://www.uo.com");
                break;
            }

            case 10:                     // Young player transport
            {
                if (IsYoung(from))
                {
                    if (from.Region.IsPartOf <Regions.Jail>())
                    {
                        from.SendLocalizedMessage(1041530, "", 0x35);                                           // You'll need a better jailbreak plan then that!
                    }
                    else if (from.Region.Name == "Haven" || from.Region.Name == "New Haven")
                    {
                        from.SendLocalizedMessage(1041529);                                           // You're already in Haven
                    }
                    else
                    {
                        if (from.Alive)
                        {
                            from.MoveToWorld(new Point3D(3503, 2574, 14), Map.Trammel);
                        }
                        else
                        {
                            from.MoveToWorld(new Point3D(3469, 2559, 36), Map.Trammel);
                        }
                    }
                }

                break;
            }

            case 11:                     // Promotional Code
            {
                if (PromotionalSystem.Enabled)
                {
                    from.SendGump(new PromotionalCodeGump());
                }
                else
                {
                    from.SendLocalizedMessage(1062904);                                       // The promo code redemption system is currently unavailable. Please try again later.

                    from.SendLocalizedMessage(501235, "", 0x35);                              // Help request aborted.
                }

                break;
            }

            case 12:                     // Harassment: Physical
            {
                type = PageType.PhysicalHarassment;
                break;
            }
            }

            if (type != (PageType)(-1) && PageQueue.CheckAllowedToPage(from))
            {
                from.SendGump(new PagePromptGump(from, type));
            }
        }
Esempio n. 12
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            PageType type = (PageType)(-1);

            switch (info.ButtonID)
            {
            case 0:                                          // Close/Cancel
            {
                from.SendLocalizedMessage(501235, "", 0x35); // Help request aborted.

                break;
            }

            case 1:     // General question
            {
                type = PageType.Question;
                break;
            }

            case 2:     // Stuck
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (house != null)
                {
                    from.Location = house.BanLocation;
                }
                else if (CityLoyalty.CityTradeSystem.HasTrade(from))
                {
                    from.SendLocalizedMessage(1151733);         // You cannot do that while carrying a Trade Order.
                }
                else if (from.Region.IsPartOf <Regions.Jail>())
                {
                    from.SendLocalizedMessage(1114345, "", 0x35);         // You'll need a better jailbreak plan than that!
                }
                else if (from.Region.CanUseStuckMenu(from) && !CheckCombat(from) && !from.Frozen && !from.Criminal)
                {
                    StuckMenu menu = new StuckMenu(from, from, true);

                    menu.BeginClose();

                    from.SendGump(menu);
                }
                else
                {
                    type = PageType.Stuck;
                }

                break;
            }

            case 3:     // Report bug or contact Origin
            {
                type = PageType.Bug;
                break;
            }

            case 4:     // Game suggestion
            {
                type = PageType.Suggestion;
                break;
            }

            case 5:     // Account management
            {
                type = PageType.Account;
                break;
            }

            case 6:     // Other
            {
                type = PageType.Other;
                break;
            }

            case 7:     // Harassment: verbal/exploit
            {
                type = PageType.VerbalHarassment;
                break;
            }

            case 8:     // Harassment: physical
            {
                type = PageType.PhysicalHarassment;
                break;
            }

            case 9:     // Young player transport
            {
                if (IsYoung(from))
                {
                    if (from.Region.IsPartOf <Regions.Jail>())
                    {
                        from.SendLocalizedMessage(1114345, "", 0x35);         // You'll need a better jailbreak plan than that!
                    }
                    else if (CityLoyalty.CityTradeSystem.HasTrade(from))
                    {
                        from.SendLocalizedMessage(1151733);         // You cannot do that while carrying a Trade Order.
                    }
                    else if (from.Region.IsPartOf("Haven Island"))
                    {
                        from.SendLocalizedMessage(1041529);         // You're already in Haven
                    }
                    else
                    {
                        from.MoveToWorld(new Point3D(3503, 2574, 14), Map.Trammel);
                    }
                }

                break;
            }
            }

            if (type != (PageType)(-1) && PageQueue.CheckAllowedToPage(from))
            {
                from.SendGump(new PagePromptGump(from, type));
            }
        }
Esempio n. 13
0
        public override void OnResponse(NetState state, int index)
        {
            Mobile from = state.Mobile;

            PageType type = (PageType)(-1);

            switch (index)
            {
            /*case 0: // Close/Cancel
             *  {
             *      from.SendAsciiMessage("Help request unchanged.", 0x35); // Help request aborted.
             *
             *      break;
             *  }*/
            case 0:     // General question
            {
                type = PageType.Question;
                break;
            }

            case 1:     // Stuck
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (house != null && house.IsAosRules)
                {
                    from.Location = house.BanLocation;
                }
                else if (from.Region.IsPartOf(typeof(Server.Regions.Jail)))
                {
                    from.SendLocalizedMessage(0x35, "You'll need a better jailbreak plan then that!");        // You'll need a better jailbreak plan then that!
                }
                else if (Factions.Sigil.ExistsOn(from))
                {
                    from.SendLocalizedMessage(1061632);         // You can't do that while carrying the sigil.
                }
                else if (from.CanUseStuckMenu() && from.Region.CanUseStuckMenu(from) && !CheckCombat(from) && !from.Frozen && !from.Criminal && (Core.AOS || from.Kills < 5))
                {
                    StuckMenu menu = new StuckMenu(from, from, true);

                    menu.BeginClose();

                    from.SendGump(menu);
                }
                else
                {
                    type = PageType.Stuck;
                }

                break;
            }

            case 2:     // Harassment: verbal/exploit
            {
                type = PageType.VerbalHarassment;
                break;
            }

            case 3:     // Other
            {
                type = PageType.Other;
                break;
            }
            }

            if (type != (PageType)(-1) && PageQueue.CheckAllowedToPage(from))
            {
                from.SendAsciiMessage(0x35, "Please enter a brief description (up to 40 characters) of your problem:");
                from.Prompt = new HelpPrompt(from, type);
            }
            //from.SendGump(new PagePromptGump(from, type));
        }
Esempio n. 14
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            var type = (PageType)(-1);

            switch (info.ButtonID)
            {
            case 0:                                          // Close/Cancel
            {
                from.SendLocalizedMessage(501235, "", 0x35); // Help request aborted.

                break;
            }

            case 1:                     // General question
            {
                type = PageType.Question;
                break;
            }

            case 2:                     // Stuck
            {
                if (from is BaseCreature)
                {
                    from.SendMessage("You can't use the help stuck menu if on anything but a player character!");
                    return;
                }
                if (from != null && from.Map == Map.ZombieLand)
                {
                    from.SendMessage(54, "You cannot use the stuck option while in the zombie event.  Please log out of the event first.");
                    return;
                }
                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (house != null && house.IsAosRules && !from.Region.IsPartOf(typeof(SafeZone)))                                 // Dueling
                {
                    from.Location = house.BanLocation;
                }
                else if (from.Region.IsPartOf(typeof(Regions.Jail)))
                {
                    from.SendLocalizedMessage(1114345, "", 0x35);                                     // You'll need a better jailbreak plan than that!
                }
                else if (Sigil.ExistsOn(from))
                {
                    from.SendLocalizedMessage(1061632);                                     // You can't do that while carrying the sigil.
                }
                else if (from.CanUseStuckMenu() && from.Region.CanUseStuckMenu(from) && !CheckCombat(from) && !from.Frozen &&
                         !from.Criminal)                                         // && (Core.AOS || from.Kills < Mobile.MurderCount) )
                {
                    var menu = new StuckMenu(from, from, true);

                    menu.BeginClose();

                    from.SendGump(menu);
                }
                else
                {
                    type = PageType.Stuck;
                }

                break;
            }

            case 3:                     // Report bug or contact UOFOREVER
            {
                type = PageType.Bug;
                break;
            }

            case 4:                     // Game suggestion
            {
                type = PageType.Suggestion;
                break;
            }

            case 5:                     // Account management
            {
                type = PageType.Account;
                break;
            }

            case 6:                     // Other
            {
                type = PageType.Other;
                break;
            }

            case 7:                     // Harassment: verbal/exploit
            {
                type = PageType.VerbalHarassment;
                break;
            }

            case 8:                     // Harassment: physical
            {
                type = PageType.PhysicalHarassment;
                break;
            }

            case 9:                     // Young player transport
            {
                if (IsYoung(from))
                {
                    if (from.Region.IsPartOf(typeof(Regions.Jail)))
                    {
                        from.SendLocalizedMessage(1114345, "", 0x35);
                        // You'll need a better jailbreak plan than that!
                    }
                    else if (from.Region.IsPartOf("Haven Island"))
                    {
                        from.SendLocalizedMessage(1041529);                                         // You're already in Haven
                    }
                    else
                    {
                        from.MoveToWorld(new Point3D(3503, 2574, 14), Map.Felucca);
                    }
                }

                break;
            }
            }

            if (type != (PageType)(-1) && PageQueue.CheckAllowedToPage(from))
            {
                from.SendGump(new PagePromptGump(from, type));
            }
        }
Esempio n. 15
0
 public override void OnResponse(GameClient state, RelayInfo info)
 {
     PageQueue.SendPageQueueGump(state.Mobile);
 }