public override void OnResponse(NetState state, RelayInfo info)
            {
                if (info.ButtonID == 0) // Cancel
                {
                    return;
                }
                else if (m_Mobile.Deleted || m_Mobile.Map == null)
                {
                    return;
                }
                else if (info.ButtonID == 2) // Launch Browser
                {
                    m_Mobile.LaunchBrowser("http://uo.stratics.com/thb/info/maparchive/Archive1.shtml");
                }

                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;
                }

                TMList list = m_Lists[listIndex];

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

                TMEntry entry = list.Entries[listEntry];

                if (Server.Spells.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.Map       = list.Map;
                    m_Mobile.Location  = entry.Location;
                }
            }
Пример #2
0
 public TMList(TMEntry[] entries)
 {
     m_Entries = entries;
 }
            public override void OnResponse(NetState state, RelayInfo info)
            {
                if (info.ButtonID == 0) // Cancel
                {
                    return;
                }
                else if (m_Mobile.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;
                }

                TMList list = m_Lists[listIndex];

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

                TMEntry entry = list.Entries[listEntry];

                if (m_Mobile.Player && m_Mobile.Kills >= 5 && list.Map != Map.Trammel)
                {
                    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 (Server.Spells.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.Map       = list.Map;
                    m_Mobile.Location  = entry.Location;
                }
            }
 public TMList( string text, string selText, Map map, TMEntry[] entries ) 
 { 
    m_Text = text; 
    m_SelText = selText; 
    m_Map = map; 
    m_Entries = entries; 
 }