Exemple #1
0
        private void RenderPage(int index, int offset)
        {
            PMList list = m_Lists[index];

            AddPage(index + 1);

            AddButton(10, 35 + (offset * 25), 2117, 2118, 0, GumpButtonType.Page, index + 1);
            AddHtmlLocalized(30, 35 + (offset * 25), 150, 20, list.SelNumber, false, false);

            PMEntry[] entries = list.Entries;

            for (int i = 0; i < entries.Length; ++i)
            {
                AddRadio(200, 35 + (i * 25), 210, 211, false, (index * 100) + i);
                AddHtmlLocalized(225, 35 + (i * 25), 150, 20, entries[i].Number, false, false);
            }
        }
Exemple #2
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (info.ButtonID == 0) // Cancel
            {
                return;
            }
            else if (m_Mobile.Deleted || m_Moongate.Deleted || m_Mobile.Map == null)
            {
                return;
            }

            int[] switches = info.Switches;

            if (switches.Length == 0)
            {
                return;
            }

            int switchID  = switches[0];
            int listIndex = switchID / 100;
            int listEntry = switchID % 100;

            if (listIndex < 0 || listIndex >= m_Lists.Length)
            {
                return;
            }

            PMList list = m_Lists[listIndex];

            if (listEntry < 0 || listEntry >= list.Entries.Length)
            {
                return;
            }

            PMEntry entry = list.Entries[listEntry];

            if (!m_Mobile.InRange(m_Moongate.GetWorldLocation(), 1) || m_Mobile.Map != m_Moongate.Map)
            {
                m_Mobile.SendLocalizedMessage(1019002); // You are too far away to use the gate.
            }
            else if (m_Mobile.Player && m_Mobile.Kills >= 5 && list.Map != Map.Felucca)
            {
                m_Mobile.SendLocalizedMessage(1019004); // You are not allowed to travel there.
            }
            else if (Factions.Sigil.ExistsOn(m_Mobile) && list.Map != Factions.Faction.Facet)
            {
                m_Mobile.SendLocalizedMessage(1019004); // You are not allowed to travel there.
            }
            else if (m_Mobile.Criminal)
            {
                m_Mobile.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
            }
            else if (SpellHelper.CheckCombat(m_Mobile))
            {
                m_Mobile.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
            }
            else if (m_Mobile.Spell != null)
            {
                m_Mobile.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
            }
            else if (m_Mobile.Map == list.Map && m_Mobile.InRange(entry.Location, 1))
            {
                m_Mobile.SendLocalizedMessage(1019003); // You are already there.
            }
            else
            {
                BaseCreature.TeleportPets(m_Mobile, entry.Location, list.Map);

                m_Mobile.Combatant = null;
                m_Mobile.Warmode   = false;
                m_Mobile.Hidden    = true;

                m_Mobile.MoveToWorld(entry.Location, list.Map);

                Effects.PlaySound(entry.Location, list.Map, 0x1FE);
            }
        }
Exemple #3
0
        public MoongateGump(Mobile mobile, Item moongate) : base(100, 100)
        {
            m_Mobile   = mobile;
            m_Moongate = moongate;

            PMList[] checkLists;

            if (mobile.Player)
            {
                if (Factions.Sigil.ExistsOn(mobile))
                {
                    checkLists = PMList.SigilLists;
                }
                else if (mobile.Kills >= 5)
                {
                    checkLists = PMList.RedLists;
                }
                else
                {
                    ClientFlags flags = mobile.NetState == null ? ClientFlags.None : mobile.NetState.Flags;
                    bool        young = mobile is PlayerMobile ? ((PlayerMobile)mobile).Young : false;

                    if (Core.SE && (flags & ClientFlags.Tokuno) != 0)
                    {
                        checkLists = young ? PMList.SEListsYoung : PMList.SELists;
                    }
                    else if (Core.AOS && (flags & ClientFlags.Malas) != 0)
                    {
                        checkLists = young ? PMList.AOSListsYoung : PMList.AOSLists;
                    }
                    else if ((flags & ClientFlags.Ilshenar) != 0)
                    {
                        checkLists = young ? PMList.LBRListsYoung : PMList.LBRLists;
                    }
                    else
                    {
                        checkLists = young ? PMList.UORListsYoung : PMList.UORLists;
                    }
                }
            }
            else
            {
                checkLists = PMList.SELists;
            }

            m_Lists = new PMList[checkLists.Length];

            for (int i = 0; i < m_Lists.Length; ++i)
            {
                m_Lists[i] = checkLists[i];
            }

            for (int i = 0; i < m_Lists.Length; ++i)
            {
                if (m_Lists[i].Map == mobile.Map)
                {
                    PMList temp = m_Lists[i];

                    m_Lists[i] = m_Lists[0];
                    m_Lists[0] = temp;

                    break;
                }
            }

            AddPage(0);

            AddBackground(0, 0, 380, 280, 5054);

            AddButton(10, 210, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 210, 140, 25, 1011036, false, false); // OKAY

            AddButton(10, 235, 4005, 4007, 0, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 235, 140, 25, 1011012, false, false); // CANCEL

            AddHtmlLocalized(5, 5, 200, 20, 1012011, false, false);    // Pick your destination:

            for (int i = 0; i < checkLists.Length; ++i)
            {
                AddButton(10, 35 + (i * 25), 2117, 2118, 0, GumpButtonType.Page, Array.IndexOf(m_Lists, checkLists[i]) + 1);
                AddHtmlLocalized(30, 35 + (i * 25), 150, 20, checkLists[i].Number, false, false);
            }

            for (int i = 0; i < m_Lists.Length; ++i)
            {
                RenderPage(i, Array.IndexOf(checkLists, m_Lists[i]));
            }
        }