Alright so what I'm trying to do here..

Modify the existing MoonGate System (which is easy) but also add in a requirement. Certain gate entries will not be available to teleport to unless you possess the proper xml attachment. I tried adding a few IF statements to identify the attachment then check for the attachment but the script fell over on itself. I think I'm just doing it wrong. Here is the gate code im trying to throw in the attachment at.

Gate Code I'm trying to Modify

Code:
    public class PMList
    {
        public static readonly PMList Trammel =
            new PMList(1012000, 1012012, Map.Trammel, new PMEntry[]
            {
                NewWorldLevel1 gate = (NewWorldLevel1)XmlAttach.FindAttachment(m, typeof(NewWorldLevel1));
                if (gate.Level == 1)
                {
                    new PMEntry(new Point3D(4467, 1283, 5), 1012003), // Moonglow
                }
               
                new PMEntry(new Point3D(1336, 1997, 5), 1012004), // Britain
                new PMEntry(new Point3D(1499, 3771, 5), 1012005), // Jhelom
                new PMEntry(new Point3D(771, 752, 5), 1012006), // Yew
                new PMEntry(new Point3D(2701, 692, 5), 1012007), // Minoc
                new PMEntry(new Point3D(1828, 2948,-20), 1012008), // Trinsic
                new PMEntry(new Point3D(643, 2067, 5), 1012009), // Skara Brae
                /* Dynamic Z for Magincia to support both old and new maps. */
                new PMEntry(new Point3D(3563, 2139, Map.Trammel.GetAverageZ(3563, 2139)), 1012010), // (New) Magincia
                new PMEntry(new Point3D(3450, 2677, 25), 1078098)// New Haven
            });




Compile Error:
Code:
Scripts: Compiling C# scripts...Failed with: 1 errors, 0 warnings
Errors:
+ Items/- Misc/PublicMoongate.cs:
    CS1513: Line 205: } expected
    CS1519: Line 205: Invalid token '=' in class, struct, or interface member declaration
    CS1519: Line 205: Invalid token ')' in class, struct, or interface member declaration
    CS1519: Line 205: Invalid token '(' in class, struct, or interface member declaration
    CS1519: Line 205: Invalid token ',' in class, struct, or interface member declaration
    CS1519: Line 205: Invalid token ')' in class, struct, or interface member declaration
    CS1519: Line 206: Invalid token '==' in class, struct, or interface member declaration
    CS1520: Line 208: Method must have a return type
    CS1031: Line 208: Type expected
    CS1520: Line 208: Method must have a return type
    CS1031: Line 208: Type expected
    CS1518: Line 211: Expected class, delegate, enum, interface, or struct
    CS1518: Line 211: Expected class, delegate, enum, interface, or struct
    CS1518: Line 212: Expected class, delegate, enum, interface, or struct
    CS1518: Line 212: Expected class, delegate, enum, interface, or struct
    CS1518: Line 213: Expected class, delegate, enum, interface, or struct
    CS1518: Line 213: Expected class, delegate, enum, interface, or struct
    CS1518: Line 214: Expected class, delegate, enum, interface, or struct
    CS1518: Line 214: Expected class, delegate, enum, interface, or struct
    CS1518: Line 215: Expected class, delegate, enum, interface, or struct
    CS1518: Line 215: Expected class, delegate, enum, interface, or struct
    CS1518: Line 216: Expected class, delegate, enum, interface, or struct
    CS1518: Line 216: Expected class, delegate, enum, interface, or struct
    CS1518: Line 218: Expected class, delegate, enum, interface, or struct
    CS1518: Line 218: Expected class, delegate, enum, interface, or struct
    CS1518: Line 219: Expected class, delegate, enum, interface, or struct
    CS1518: Line 219: Expected class, delegate, enum, interface, or struct
    CS0116: Line 220: A namespace cannot directly contain members such as fields or methods
    CS1518: Line 221: Expected class, delegate, enum, interface, or struct
    CS1518: Line 222: Expected class, delegate, enum, interface, or struct
    CS1518: Line 222: Expected class, delegate, enum, interface, or struct
    CS1001: Line 222: Identifier expected
    CS1518: Line 223: Expected class, delegate, enum, interface, or struct
    CS1518: Line 224: Expected class, delegate, enum, interface, or struct
    CS1518: Line 224: Expected class, delegate, enum, interface, or struct
    CS1518: Line 225: Expected class, delegate, enum, interface, or struct
    CS1518: Line 225: Expected class, delegate, enum, interface, or struct
    CS1518: Line 226: Expected class, delegate, enum, interface, or struct
    CS1518: Line 226: Expected class, delegate, enum, interface, or struct
    CS1518: Line 227: Expected class, delegate, enum, interface, or struct
    CS1518: Line 227: Expected class, delegate, enum, interface, or struct
    CS1518: Line 228: Expected class, delegate, enum, interface, or struct
    CS1518: Line 228: Expected class, delegate, enum, interface, or struct
    CS1518: Line 229: Expected class, delegate, enum, interface, or struct
    CS1518: Line 229: Expected class, delegate, enum, interface, or struct
    CS1518: Line 230: Expected class, delegate, enum, interface, or struct
    CS1518: Line 230: Expected class, delegate, enum, interface, or struct
    CS1518: Line 232: Expected class, delegate, enum, interface, or struct
    CS1518: Line 232: Expected class, delegate, enum, interface, or struct
    CS1518: Line 233: Expected class, delegate, enum, interface, or struct
    CS1518: Line 233: Expected class, delegate, enum, interface, or struct
    CS1022: Line 234: Type or namespace definition, or end-of-file expected
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.



Full Gate Code

Code:
using System;
using System.Collections.Generic;
using Server.Commands;
using Server.Gumps;
using Server.Mobiles;
using Server.Network;
using Server.Spells;
using Server.Engines.XmlSpawner2;

namespace Server.Items
{
    public class PublicMoongate : Item
    {
        [Constructable]
        public PublicMoongate()
            : base(0xF6C)
        {
            this.Movable = false;
            this.Light = LightType.Circle300;
        }

        public PublicMoongate(Serial serial)
            : base(serial)
        {
        }

        public override bool ForceShowProperties
        {
            get
            {
                return ObjectPropertyList.Enabled;
            }
        }
        public override bool HandlesOnMovement
        {
            get
            {
                return true;
            }
        }
        public static void Initialize()
        {
            CommandSystem.Register("MoonGen", AccessLevel.Administrator, new CommandEventHandler(MoonGen_OnCommand));
        }

        [Usage("MoonGen")]
        [Description("Generates public moongates. Removes all old moongates.")]
        public static void MoonGen_OnCommand(CommandEventArgs e)
        {
            DeleteAll();

            int count = 0;

            count += MoonGen(PMList.Trammel);
            count += MoonGen(PMList.Felucca);
            count += MoonGen(PMList.Ilshenar);
            count += MoonGen(PMList.Malas);
            count += MoonGen(PMList.Tokuno);
            count += MoonGen(PMList.TerMur);

            World.Broadcast(0x35, true, "{0} moongates generated.", count);
        }

        public override void OnDoubleClick(Mobile from)
        {
            if (!from.Player)
                return;

            if (from.InRange(this.GetWorldLocation(), 1))
                this.UseGate(from);
            else
                from.SendLocalizedMessage(500446); // That is too far away.
        }

        public override bool OnMoveOver(Mobile m)
        {
            // Changed so criminals are not blocked by it.
            if (m.Player)
                this.UseGate(m);

            return true;
        }

        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (m is PlayerMobile)
            {
                if (!Utility.InRange(m.Location, this.Location, 1) && Utility.InRange(oldLocation, this.Location, 1))
                    m.CloseGump(typeof(MoongateGump));
            }
        }

        public bool UseGate(Mobile m)
        {
            if (m.Criminal)
            {
                m.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
                return false;
            }
            else if (SpellHelper.CheckCombat(m))
            {
                m.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
                return false;
            }
            else if (m.Spell != null)
            {
                m.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
                return false;
            }
            else if (m.Holding != null)
            {
                m.SendLocalizedMessage(1071955); // You cannot teleport while dragging an object.
                return false;
            }
            else
            {
                m.CloseGump(typeof(MoongateGump));
                m.SendGump(new MoongateGump(m, this));

                if (!m.Hidden || m.IsPlayer())
                    Effects.PlaySound(m.Location, m.Map, 0x20E);

                return true;
            }
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }

        private static void DeleteAll()
        {
            List<Item> list = new List<Item>();

            foreach (Item item in World.Items.Values)
            {
                if (item is PublicMoongate)
                    list.Add(item);
            }

            foreach (Item item in list)
                item.Delete();

            if (list.Count > 0)
                World.Broadcast(0x35, true, "{0} moongates removed.", list.Count);
        }

        private static int MoonGen(PMList list)
        {
            foreach (PMEntry entry in list.Entries)
            {
                Item item = new PublicMoongate();

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

                if (entry.Number == 1060642) // Umbra
                    item.Hue = 0x497;
            }

            return list.Entries.Length;
        }
    }

    public class PMEntry
    {
        private readonly Point3D m_Location;
        private readonly int m_Number;
        public PMEntry(Point3D loc, int number)
        {
            this.m_Location = loc;
            this.m_Number = number;
        }

        public Point3D Location
        {
            get
            {
                return this.m_Location;
            }
        }
        public int Number
        {
            get
            {
                return this.m_Number;
            }
        }
    }

    public class PMList
    {
        public static readonly PMList Trammel =
            new PMList(1012000, 1012012, Map.Trammel, new PMEntry[]
            {
                NewWorldLevel1 gate = (NewWorldLevel1)XmlAttach.FindAttachment(m, typeof(NewWorldLevel1));
                if (gate.Level == 1)
                {
                    new PMEntry(new Point3D(4467, 1283, 5), 1012003), // Moonglow
                }
               
                new PMEntry(new Point3D(1336, 1997, 5), 1012004), // Britain
                new PMEntry(new Point3D(1499, 3771, 5), 1012005), // Jhelom
                new PMEntry(new Point3D(771, 752, 5), 1012006), // Yew
                new PMEntry(new Point3D(2701, 692, 5), 1012007), // Minoc
                new PMEntry(new Point3D(1828, 2948,-20), 1012008), // Trinsic
                new PMEntry(new Point3D(643, 2067, 5), 1012009), // Skara Brae
                /* Dynamic Z for Magincia to support both old and new maps. */
                new PMEntry(new Point3D(3563, 2139, Map.Trammel.GetAverageZ(3563, 2139)), 1012010), // (New) Magincia
                new PMEntry(new Point3D(3450, 2677, 25), 1078098)// New Haven
            });
        public static readonly PMList Felucca =
            new PMList(1012001, 1012013, Map.Felucca, new PMEntry[]
            {
                new PMEntry(new Point3D(4467, 1283, 5), 1012003), // Moonglow
                new PMEntry(new Point3D(1336, 1997, 5), 1012004), // Britain
                new PMEntry(new Point3D(1499, 3771, 5), 1012005), // Jhelom
                new PMEntry(new Point3D(771, 752, 5), 1012006), // Yew
                new PMEntry(new Point3D(2701, 692, 5), 1012007), // Minoc
                new PMEntry(new Point3D(1828, 2948,-20), 1012008), // Trinsic
                new PMEntry(new Point3D(643, 2067, 5), 1012009), // Skara Brae
                /* Dynamic Z for Magincia to support both old and new maps. */
                new PMEntry(new Point3D(3563, 2139, Map.Felucca.GetAverageZ(3563, 2139)), 1012010), // (New) Magincia
                new PMEntry(new Point3D(2711, 2234, 0), 1019001)// Buccaneer's Den
            });
        public static readonly PMList Ilshenar =
            new PMList(1012002, 1012014, Map.Ilshenar, new PMEntry[]
            {
                new PMEntry(new Point3D(1215, 467, -13), 1012015), // Compassion
                new PMEntry(new Point3D(722, 1366, -60), 1012016), // Honesty
                new PMEntry(new Point3D(744, 724, -28), 1012017), // Honor
                new PMEntry(new Point3D(281, 1016, 0), 1012018), // Humility
                new PMEntry(new Point3D(987, 1011, -32), 1012019), // Justice
                new PMEntry(new Point3D(1174, 1286, -30), 1012020), // Sacrifice
                new PMEntry(new Point3D(1532, 1340, - 3), 1012021), // Spirituality
                new PMEntry(new Point3D(528, 216, -45), 1012022), // Valor
                new PMEntry(new Point3D(1721, 218, 96), 1019000)// Chaos
            });
        public static readonly PMList Malas =
            new PMList(1060643, 1062039, Map.Malas, new PMEntry[]
            {
                new PMEntry(new Point3D(1015, 527, -65), 1060641), // Luna
                new PMEntry(new Point3D(1997, 1386, -85), 1060642)// Umbra
            });
        public static readonly PMList Tokuno =
            new PMList(1063258, 1063415, Map.Tokuno, new PMEntry[]
            {
                new PMEntry(new Point3D(1169, 998, 41), 1063412), // Isamu-Jima
                new PMEntry(new Point3D(802, 1204, 25), 1063413), // Makoto-Jima
                new PMEntry(new Point3D(270, 628, 15), 1063414)// Homare-Jima
            });
        public static readonly PMList TerMur =
            new PMList(1113602, 1113602, Map.TerMur, new PMEntry[]
            {
                new PMEntry(new Point3D(852, 3526, -43), 1113603), // Royal City
                new PMEntry(new Point3D(926, 3989, -36), 1112572), // Holy City
            });
        public static readonly PMList[] UORLists = new PMList[] { Trammel, Felucca };
        public static readonly PMList[] UORListsYoung = new PMList[] { Trammel };
        public static readonly PMList[] LBRLists = new PMList[] { Trammel, Felucca, Ilshenar };
        public static readonly PMList[] LBRListsYoung = new PMList[] { Trammel, Ilshenar };
        public static readonly PMList[] AOSLists = new PMList[] { Trammel, Felucca, Ilshenar, Malas };
        public static readonly PMList[] AOSListsYoung = new PMList[] { Trammel, Ilshenar, Malas };
        public static readonly PMList[] SELists = new PMList[] { Trammel, Felucca, Ilshenar, Malas, Tokuno };
        public static readonly PMList[] SEListsYoung = new PMList[] { Trammel, Ilshenar, Malas, Tokuno };
        public static readonly PMList[] SALists    = new PMList[] { Trammel, Felucca, Ilshenar, Malas, Tokuno, TerMur };
        public static readonly PMList[] SAListsYoung = new PMList[] { Trammel, Ilshenar, Malas, Tokuno, TerMur };
        public static readonly PMList[] RedLists = new PMList[] { Felucca };
        public static readonly PMList[] SigilLists = new PMList[] { Felucca };
        private readonly int m_Number;
        private readonly int m_SelNumber;
        private readonly Map m_Map;
        private readonly PMEntry[] m_Entries;
        public PMList(int number, int selNumber, Map map, PMEntry[] entries)
        {
            this.m_Number = number;
            this.m_SelNumber = selNumber;
            this.m_Map = map;
            this.m_Entries = entries;
        }

        public int Number
        {
            get
            {
                return this.m_Number;
            }
        }
        public int SelNumber
        {
            get
            {
                return this.m_SelNumber;
            }
        }
        public Map Map
        {
            get
            {
                return this.m_Map;
            }
        }
        public PMEntry[] Entries
        {
            get
            {
                return this.m_Entries;
            }
        }
    }

    public class MoongateGump : Gump
    {
        private readonly Mobile m_Mobile;
        private readonly Item m_Moongate;
        private readonly PMList[] m_Lists;
        public MoongateGump(Mobile mobile, Item moongate)
            : base(100, 100)
        {
            this.m_Mobile = mobile;
            this.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.SA && (flags & ClientFlags.TerMur) != 0)
                        checkLists = young ? PMList.SAListsYoung : PMList.SALists;
                    else 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;
            }

            this.m_Lists = new PMList[checkLists.Length];

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

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

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

                    break;
                }
            }

            this.AddPage(0);

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

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

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

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

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

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

        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (info.ButtonID == 0) // Cancel
                return;
            else if (this.m_Mobile.Deleted || this.m_Moongate.Deleted || this.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 >= this.m_Lists.Length)
                return;

            PMList list = this.m_Lists[listIndex];

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

            PMEntry entry = list.Entries[listEntry];

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

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

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

                Effects.PlaySound(entry.Location, list.Map, 0x1FE);
            }
        }

        private void RenderPage(int index, int offset)
        {
            PMList list = this.m_Lists[index];

            this.AddPage(index + 1);

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

            PMEntry[] entries = list.Entries;

            for (int i = 0; i < entries.Length; ++i)
            {
                this.AddRadio(200, 35 + (i * 25), 210, 211, false, (index * 100) + i);
                this.AddHtmlLocalized(225, 35 + (i * 25), 150, 20, entries[i].Number, false, false);
            }
        }
    }
}
 
You are close man. I believe this is your fix:
Code:
XmlData a = (XmlData)XmlAttach.FindAttachment( from, typeof( XmlData ), "NWL1" );

                        if ( a != null && a.Data != "NWL1" )
                        {
                            new PMEntry(new Point3D(4467, 1283, 5), 1012003), // Moonglow
                        }
I have always had to add a string for the value being added to the attachment, even if it were "0" or "Null". Custom attachments might take a bit more caressing to get working, but using an existing attachment, you can just give it a different name/value:
Code:
XmlData a = (XmlData)XmlAttach.FindAttachment( from, typeof( XmlData ), "NWL2" );

Notice the . in the IF statement: (a.Data)...a is the attachment, the . indicates an additional level to "drill down", and Data is NWL1, NWL2, Null, etc. The first piece of code came from the TourGuideGump script.
 
Wow, didn't think to use the XmlData for this. Though, still not compiling due to error. Here is the error from console.

Code:
Scripts: Compiling C# scripts...Failed with: 1 errors, 0 warnings
Errors:
+ Items/- Misc/PublicMoongate.cs:
    CS1513: Line 205: } expected
    CS1519: Line 205: Invalid token '=' in class, struct, or interface member declaration
    CS1519: Line 205: Invalid token ')' in class, struct, or interface member declaration
    CS1519: Line 205: Invalid token '(' in class, struct, or interface member declaration
    CS1519: Line 205: Invalid token ',' in class, struct, or interface member declaration
    CS1519: Line 205: Invalid token ')' in class, struct, or interface member declaration
    CS1519: Line 206: Invalid token '!=' in class, struct, or interface member declaration
    CS1519: Line 206: Invalid token '!=' in class, struct, or interface member declaration
    CS1520: Line 208: Method must have a return type
    CS1031: Line 208: Type expected
    CS1520: Line 208: Method must have a return type
    CS1031: Line 208: Type expected
    CS1518: Line 211: Expected class, delegate, enum, interface, or struct
    CS1518: Line 211: Expected class, delegate, enum, interface, or struct
    CS1518: Line 212: Expected class, delegate, enum, interface, or struct
    CS1518: Line 212: Expected class, delegate, enum, interface, or struct
    CS1518: Line 213: Expected class, delegate, enum, interface, or struct
    CS1518: Line 213: Expected class, delegate, enum, interface, or struct
    CS1518: Line 214: Expected class, delegate, enum, interface, or struct
    CS1518: Line 214: Expected class, delegate, enum, interface, or struct
    CS1518: Line 215: Expected class, delegate, enum, interface, or struct
    CS1518: Line 215: Expected class, delegate, enum, interface, or struct
    CS1518: Line 216: Expected class, delegate, enum, interface, or struct
    CS1518: Line 216: Expected class, delegate, enum, interface, or struct
    CS1518: Line 218: Expected class, delegate, enum, interface, or struct
    CS1518: Line 218: Expected class, delegate, enum, interface, or struct
    CS1518: Line 219: Expected class, delegate, enum, interface, or struct
    CS1518: Line 219: Expected class, delegate, enum, interface, or struct
    CS0116: Line 220: A namespace cannot directly contain members such as fields or methods
    CS1518: Line 221: Expected class, delegate, enum, interface, or struct
    CS1518: Line 222: Expected class, delegate, enum, interface, or struct
    CS1518: Line 222: Expected class, delegate, enum, interface, or struct
    CS1001: Line 222: Identifier expected
    CS1518: Line 223: Expected class, delegate, enum, interface, or struct
    CS1518: Line 224: Expected class, delegate, enum, interface, or struct
    CS1518: Line 224: Expected class, delegate, enum, interface, or struct
    CS1518: Line 225: Expected class, delegate, enum, interface, or struct
    CS1518: Line 225: Expected class, delegate, enum, interface, or struct
    CS1518: Line 226: Expected class, delegate, enum, interface, or struct
    CS1518: Line 226: Expected class, delegate, enum, interface, or struct
    CS1518: Line 227: Expected class, delegate, enum, interface, or struct
    CS1518: Line 227: Expected class, delegate, enum, interface, or struct
    CS1518: Line 228: Expected class, delegate, enum, interface, or struct
    CS1518: Line 228: Expected class, delegate, enum, interface, or struct
    CS1518: Line 229: Expected class, delegate, enum, interface, or struct
    CS1518: Line 229: Expected class, delegate, enum, interface, or struct
    CS1518: Line 230: Expected class, delegate, enum, interface, or struct
    CS1518: Line 230: Expected class, delegate, enum, interface, or struct
    CS1518: Line 232: Expected class, delegate, enum, interface, or struct
    CS1518: Line 232: Expected class, delegate, enum, interface, or struct
    CS1518: Line 233: Expected class, delegate, enum, interface, or struct
    CS1518: Line 233: Expected class, delegate, enum, interface, or struct
    CS1022: Line 234: Type or namespace definition, or end-of-file expected
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

Here is the Code that I inserted.
Code:
    public class PMList
    {
        public static readonly PMList Trammel =
            new PMList(1012000, 1012012, Map.Trammel, new PMEntry[]
            {
                XmlData a = (XmlData)XmlAttach.FindAttachment( from, typeof( XmlData ), "NWL1" );
                        if ( a != null && a.Data != "NWL1" )
                        {
                            new PMEntry(new Point3D(4467, 1283, 5), 1012003), // Moonglow
                        }
 
You know, taking a closer look at that section of code...I don't think you can toss a variable declaration in that spot, and that is why it won't compile. Unless I missed something else further up (I did scan over all the moongate code though).

Might I suggest the following:
Edit your PublicMoongate.cs and remove all entries in the PMEntry that you want to have this requirement for.
Create a copy of PublicMoongate.cs, rename it to PublicMoongateReq.cs
Remove all the entries, but then ADD the ones you removed from PublicMoongate.cs
Now, use an Xmlspawner to check for the attachment, and then spawn the proper moongate version.

Yeah, it's a hacked up way, but it will work without scripting (besides basically copy/pasting).
 
I thought that might have been the case but I wasn't sure. Bummer, I like the suggestion but based on how I want to use it, would just add clutter. I'm going to look into the other public moongate system ( https://www.servuo.com/archive/acc-public-gates-and-spell-system.17/ ) and see if I can find a way to add in a option to check for xml attachments, i suspect that shouldn't be too hard as similar restrictions already exist.
[doublepost=1482956801][/doublepost]So after more pondering and scratching (my forhead) I figured out what to do with the above script. Add my own Entry list, then make a secondary gump (or more then one) , then on the walk in or double click, have at THAT point check for the xml attachment and send to the corresponding gump. I will post my finish script once i get it done :)
[doublepost=1482961409][/doublepost]I used an older already modded public gate script someone else did , think it was called World Map or Travel Map or something, but i wanted the string version for easier future modding. So i used that one this time around, and I got it working. The Trick is to make your own entry list, then activate them, and reference them in the gump with If statements checking for the attachment, so if attachment is detected, only X list will be displayed. I was hoping to go even deeper and do per entry but this will do. :) the mods are in the GUMP relating to the attachment switch off. Only did one attachment for now.

Code:
using System;
using System.Collections;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Mobiles;
using Server.Commands;
using Server.Engines.XmlSpawner2;

namespace Server.Items
{
   public class AincradFloor1Gate : Item
   {
      [Constructable]
      public AincradFloor1Gate() : base( 0xF6C ) //old id is 0x2259
      {
         Movable = false;
         Light = LightType.Circle300;
         //Hue = 500;
         Weight = 3; 
         Name = "Aincrad Gate";
      }

      public AincradFloor1Gate( Serial serial ) : base( serial )
      {
      }

      public override void OnDoubleClick( Mobile from )
      {
         if ( !from.Player )
            return;

         if ( from.InRange( GetWorldLocation(), 1 ) )
            UseGate( from );
         else
            from.SendLocalizedMessage( 500446 ); // That is too far away.
      }

      public override bool OnMoveOver( Mobile m )
      {
         return !m.Player || UseGate( m );
      }

      public bool UseGate( Mobile m )
      {
         if ( m.Criminal )
         {
            m.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
            return false;
         }
         else if ( Server.Spells.SpellHelper.CheckCombat( m ) )
         {
            m.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
            return false;
         }

                  else if ( Server.Misc.WeightOverloading.IsOverloaded(  m ) )
                        {
                                m.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
                                return false;
                        }



                  else if ( m.Region is Server.Regions.Jail )
                        {
                        m.SendLocalizedMessage( 1041530, "", 0x35 ); // You'll need a better jailbreak plan then that!
                        return false;
                        }


                       else if ( Server.Factions.Sigil.ExistsOn( m ) )
                                {
                                        m.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
                                        return false;
                                }

         else if ( m.Spell != null )
         {
            m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
            return false;
         }// CUSTOMIZATION //
         else
         {
            m.CloseGump( typeof( AincradFloor1GateGump ) );
            m.SendGump( new AincradFloor1GateGump( m ) );

            //Effects.PlaySound( m.Location, m.Map, 0x20E );
            return true;
         }
      }

      public override void Serialize( GenericWriter writer )
      {
         base.Serialize( writer );

         writer.Write( (int) 0 ); // version
      }

      public override void Deserialize( GenericReader reader )
      {
         base.Deserialize( reader );

         int version = reader.ReadInt();
      }

   public class PMEntry
   {
      private Point3D m_Location;
      private string m_Text;

      public Point3D Location
      {
         get
         {
            return m_Location;
         }
      }

      public string Text
      {
         get
         {
            return m_Text;
         }
      }

      public PMEntry( Point3D loc, string text )
      {
         m_Location = loc;
         m_Text = text;
      }
   }

   public class PMList
   {
      private string m_Text, m_SelText;
      private Map m_Map;
      private PMEntry[] m_Entries;

      public string Text
      {
         get
         {
            return m_Text;
         }
      }

      public string SelText
      {
         get
         {
            return m_SelText;
         }
      }

      public Map Map
      {
         get
         {
            return m_Map;
         }
      }

      public PMEntry[] Entries
      {
         get
         {
            return m_Entries;
         }
      }

      public PMList( string text, string selText, Map map, PMEntry[] entries )
      {
         m_Text = text;
         m_SelText = selText;
         m_Map = map;
         m_Entries = entries;
      }

      public static readonly PMList Felucca =
         new PMList( "Felucca", "Felucca", Map.Felucca, new PMEntry[]
            {
               new PMEntry( new Point3D( 4464,1166,0 ), "Fel Moonglow" ), // Moonglow
               new PMEntry( new Point3D( 1430,1703,9 ), "Fel Britain" ), // Britain
               new PMEntry( new Point3D( 1417,3821,0 ), "Fel Jhelom" ), // Jhelom
               new PMEntry( new Point3D(  542,985,0 ), "Fel Yew" ), // Yew
               new PMEntry( new Point3D( 2526,583,0 ), "Fel Minoc" ), // Minoc
               new PMEntry( new Point3D( 1823,2821,0 ), "Fel Trinsic" ), // Trinsic
               new PMEntry( new Point3D(  598,2134,0 ), "Fel Skara Brae" ), // Skara Brae
               new PMEntry( new Point3D( 3728,2164,20 ), "Fel Magincia" ), // Magincia
               new PMEntry( new Point3D( 3626,2612,0 ), "Fel Ocllo" ),  // Haven
               new PMEntry( new Point3D( 2899,676,0 ), "Fel Vesper" ),  // Vesper
               new PMEntry( new Point3D( 3770,1308,0 ), "Fel NuJhelom" ),  // NuJhelom
               new PMEntry( new Point3D( 2237,1214,0 ), "Fel Cove" ),  // Cove
               new PMEntry( new Point3D( 2895,3479,15 ), "Fel Serpents Hold" ),  // Serpents Hold
               new PMEntry( new Point3D( 2705,2162,0 ), "Fel Bucs Den" ),  // Bucs Den
               new PMEntry( new Point3D( 5272,3995,37 ), "Fel Delucia" ),  // Delucia
               new PMEntry( new Point3D( 5729,3209,-1 ), "Fel Papua" ),  // Papua
               new PMEntry( new Point3D( 1361,895,0 ), "Fel Wind" )  // Wind
            } );

      public static readonly PMList FeluccaDungeons =
         new PMList( "Felucca Dungeons", "Felucca Dungeons", Map.Felucca, new PMEntry[]
                {
               new PMEntry( new Point3D( 1301,1080,0 ), "Fel Despise" ),  // Despise
               new PMEntry( new Point3D( 511,1565,0 ), "Fel Shame" ),  // Shame
               new PMEntry( new Point3D( 4111,434,5 ), "Fel Deceit" ),  // Deceit
               new PMEntry( new Point3D( 2498,921,0 ), "Fel Covetous" ),  // Covetous
               new PMEntry( new Point3D( 2043,238,10 ), "Fel Wrong" ),  // Wrong
               new PMEntry( new Point3D( 1176,2637,0 ), "Fel Destard" ),  // Destard
               new PMEntry( new Point3D( 4721,3824,0 ), "Fel Hythloth" ),  // Hythloth
               new PMEntry( new Point3D( 4596,3630,30 ), "Fel Hythloth Fire Pit" ),  // Hythloth
               new PMEntry( new Point3D( 2923,3409,8 ), "Fel Fire" ),  // Fire
               new PMEntry( new Point3D( 1999,81,4 ), "Fel Ice" ),  // Ice
               new PMEntry( new Point3D( 5451,3143,-60 ), "Fel Terathan Keep" ),  // Terathan Keep
               new PMEntry( new Point3D( 4596,3630,30 ), "Fel Daemon Temple" ),  // Daemon Temple
               new PMEntry( new Point3D( 5766,2634,43 ), "Fel Ophidian Temple" ),  // Ophidian Temple
               new PMEntry( new Point3D( 2607,763,0 ), "Fel Solen Hives Area B" )  // Solen
                } );

      public static readonly PMList Trammel =
         new PMList( "Trammel", "Trammel", Map.Trammel, new PMEntry[]
            {
               new PMEntry( new Point3D( 4464,1166,0 ), "Tram Moonglow" ), // Moonglow
               new PMEntry( new Point3D( 1430,1703,9 ), "Tram Britain" ), // Britain
               new PMEntry( new Point3D( 1417,3821,0 ), "Tram Jhelom" ), // Jhelom
               new PMEntry( new Point3D(  542,985,0 ), "Tram Yew" ), // Yew
               new PMEntry( new Point3D( 2526,583,0 ), "Tram Minoc" ), // Minoc
               new PMEntry( new Point3D( 1823,2821,0 ), "Tram Trinsic" ), // Trinsic
               new PMEntry( new Point3D(  598,2134,0 ), "Tram Skara Brae" ), // Skara Brae
               new PMEntry( new Point3D( 3728,2164,20 ), "Tram Magincia" ), // Magincia
               new PMEntry( new Point3D( 3501,2573,14 ), "Tram Haven" ),  // Haven
               new PMEntry( new Point3D( 2899,676,0 ), "Tram Vesper" ),  // Vesper
               new PMEntry( new Point3D( 3770,1308,0 ), "Tram NuJhelom" ),  // NuJhelom
               new PMEntry( new Point3D( 2237,1214,0 ), "Tram Cove" ),  // Cove
               new PMEntry( new Point3D( 2895,3479,15 ), "Tram Serpents Hold" ),  // Serpents Hold
               new PMEntry( new Point3D( 2705,2162,0 ), "Tram Bucs Den" ),  // Bucs Den
               new PMEntry( new Point3D( 5272,3995,37 ), "Tram Delucia" ),  // Delucia
               new PMEntry( new Point3D( 5729,3209,-1 ), "Tram Papua" ),  // Papua
               new PMEntry( new Point3D( 1361,895,0 ), "Tram Wind" )  // Wind
            } );

      public static readonly PMList TrammelDungeons =
         new PMList( "Trammel Dungeons", "Trammel Dungeons", Map.Trammel, new PMEntry[]
                {
               new PMEntry( new Point3D( 1301,1080,0 ), "Tram Despise" ),  // Despise
               new PMEntry( new Point3D( 511,1565,0 ), "Tram Shame" ),  // Shame
               new PMEntry( new Point3D( 4111,434,5 ), "Tram Deceit" ),  // Deceit
               new PMEntry( new Point3D( 2498,921,0 ), "Tram Covetous" ),  // Covetous
               new PMEntry( new Point3D( 2043,238,10 ), "Tram Wrong" ),  // Wrong
               new PMEntry( new Point3D( 1176,2637,0 ), "Tram Destard" ),  // Destard
               new PMEntry( new Point3D( 4721,3824,0 ), "Tram Hythloth" ),  // Hythloth
               new PMEntry( new Point3D( 4596,3630,30 ), "Tram Hythloth Fire Pit" ),  // Hythloth
               new PMEntry( new Point3D( 2923,3409,8 ), "Tram Fire" ),  // Fire
               new PMEntry( new Point3D( 1999,81,4 ), "Tram Ice" ),  // Ice
               new PMEntry( new Point3D( 5451,3143,-60 ), "Tram Terathan Keep" ),  // Terathan Keep
               new PMEntry( new Point3D( 4596,3630,30 ), "Tram Daemon Temple" ),  // Daemon Temple
               new PMEntry( new Point3D( 5766,2634,43 ), "Tram Ophidian Temple" ),  // Ophidian Temple
               new PMEntry( new Point3D( 2607,763,0 ), "Tram Solen Hive Area B" )  // Solen
                } );

      public static readonly PMList Ilshenar =
         new PMList( "Ilshenar", "Ilshenar", Map.Ilshenar, new PMEntry[]
            {
               new PMEntry( new Point3D( 852,602,-40 ), "Gargoyle City" ),  // Gargoyle
               new PMEntry( new Point3D( 1151,659,-80 ), "Savage Camp" ),  // Savage
               new PMEntry( new Point3D( 576,1150,-100 ), "Ankh Dungeon" ),  // Ankh
               new PMEntry( new Point3D( 1747,1171,-2 ), "Blood Dungeon" ),  // Blood
               new PMEntry( new Point3D( 548,462,-53 ), "Sorceror's Dungeon" ),  // Sorceror's
               new PMEntry( new Point3D( 1362,1033,-8 ), "Spectre Dungeon" ),  // Spectre
               new PMEntry( new Point3D( 651,1302,-58 ), "Wisp Dungeon" ),  // Wisp
               new PMEntry( new Point3D( 1203,1124,-25 ), "Lakeshire" ),  // Lakeshire
               new PMEntry( new Point3D( 819,1130,-29 ), "Mistas" ),  // Mistas
               new PMEntry( new Point3D( 1706,205,104 ), "Montor" )  // Montor
            } );

      public static readonly PMList Malas =
         new PMList( "Malas", "Malas", Map.Malas, new PMEntry[]
            {
               new PMEntry( new Point3D( 990,520,-50 ), "Luna" ), // Luna
               new PMEntry( new Point3D( 2047,1353,-85 ), "Umbra" ),  // Umbra
               new PMEntry( new Point3D( 2368,1267,-85 ), "Doom" ),  // Doom
               new PMEntry( new Point3D( 912, 215, -90 ), "Orc Fort 1" ), 
               new PMEntry( new Point3D( 1678, 374, -50 ), "Orc Fort 2" ),
               new PMEntry( new Point3D( 1375, 621, -86 ), "Orc Fort 3" ),
               new PMEntry( new Point3D( 1184, 715, -89 ), "Orc Fort 4" ), 
               new PMEntry( new Point3D( 1279, 1324, -90 ), "Orc Fort 5" ),
               new PMEntry( new Point3D( 1598, 1834, -107 ), "Orc Fort 6" ), 
               new PMEntry( new Point3D( 1598, 1762, -110 ), "Ruined Temple" ) 
 

            } );

      public static readonly PMList Tokuno =
         new PMList( "Tokuno", "Tokuno", Map.Maps[4], new PMEntry[]
            {
               new PMEntry( new Point3D( 322,430,32 ), "Homare Bushido Dojo" ), // Homare Bushido Dojo
               new PMEntry( new Point3D( 255,789,63 ), "Homare Yomotsu Mine" ),  // Homare Yomotsu Mine
               new PMEntry( new Point3D( 203,985,18 ), "Homare Crane Marsh" ),  // Homare Crane Marsh
               new PMEntry( new Point3D( 741,1261,30 ), "Makoto Zento" ), // Makoto Zento
               new PMEntry( new Point3D( 727,1048,33 ), "Makoto Desert" ),  // Makoto Desert
               new PMEntry( new Point3D( 970,222,23 ), "Isamu Fan Dancer's Dojo" ), // Isamu Fan Dancer's Dojo
               new PMEntry( new Point3D( 1234,772,3 ), "Isamu Mt. Sho Castle" ),  // Isamu Mt. Sho Castle
               new PMEntry( new Point3D( 1044,523,15 ), "Isamu Valor Shrine" ),  // Isamu Valor Shrine
               new PMEntry( new Point3D( 1169, 998, 41 ), "Isamu -Jima" ),
               new PMEntry( new Point3D( 802, 1204, 25 ), "Makoto-Jima" ),
               new PMEntry( new Point3D( 270, 628, 15 ), "Homare-Jima" )
            } );
           
      public static readonly PMList AincradFloor1 =
         new PMList( "AincradFloor1", "AincradFloor1", Map.Maps[7], new PMEntry[]
            {
               new PMEntry( new Point3D( 2485,1591,0 ), "Town of Beginnings" ),
               new PMEntry( new Point3D( 1438,3742,12 ), "Boss Area" ),
            } );
      
        /*Adjust Facets To be Dispalyed if Gump permits*/

                public static readonly PMList[] UORLists                = new PMList[] { AincradFloor1 };
//                public static readonly PMList[] UORLists                = new PMList[] { Felucca, Trammel, TrammelDungeons, FeluccaDungeons };
//                public static readonly PMList[] UORlistsYoung   = new PMList[] { Trammel, TrammelDungeons };
                public static readonly PMList[] LBRLists                = new PMList[] { Felucca, Trammel, Ilshenar, TrammelDungeons, FeluccaDungeons };
//                public static readonly PMList[] LBRListsYoung   = new PMList[] { Trammel, TrammelDungeons, Ilshenar };
//                public static readonly PMList[] AOSLists                = new PMList[] { Trammel, Felucca, Ilshenar, Malas, Tokuno, TrammelDungeons, FeluccaDungeons };
//                public static readonly PMList[] AOSListsYoung   = new PMList[] { Trammel, TrammelDungeons, Ilshenar, Malas };
//                public static readonly PMList[] SELists         = new PMList[] { Trammel, Felucca, Ilshenar, Malas, Tokuno, TrammelDungeons, FeluccaDungeons };
//                public static readonly PMList[] SEListsYoung    = new PMList[] { Trammel, TrammelDungeons, Ilshenar, Malas, Tokuno };
                public static readonly PMList[] RedLists                = new PMList[] { Felucca, FeluccaDungeons  };
//                public static readonly PMList[] SigilLists      = new PMList[] { Felucca, FeluccaDungeons  };
    }
   
   public class AincradFloor1GateGump : Gump
   {/*
      public static void Initialize()
      {
         CommandSystem.Register( "Pod2", AccessLevel.GameMaster, new CommandEventHandler( AincradFloor1GateGump_OnCommand ) );
      }

      private static void AincradFloor1GateGump_OnCommand( CommandEventArgs e )
      {
         e.Mobile.SendGump( new AincradFloor1GateGump( e.Mobile ) );
      }*/

      private Mobile m_Mobile;
      private PMList[] m_Lists;

      public AincradFloor1GateGump( Mobile mobile ) : base( 100, 100 )
      {
         m_Mobile = mobile;

         PMList[] checkLists;

         if ( mobile.Player )
         {
            AincradLevel1 a = (AincradLevel1)XmlAttach.FindAttachment(mobile, typeof(AincradLevel1));
            if ( a != null )
            {
                checkLists = PMList.UORLists;
            }
            
            else if ( mobile.Kills >= 5 )
            {
               checkLists = PMList.RedLists;
            }
           // else
           // {
//               int flags = mobile.NetState == null ? 0 : mobile.NetState.Flags;

           //    if ( Core.AOS && (flags & 0x8) != 0 )
           //       checkLists = PMList.AOSLists;
           //    else if ( (flags & 0x4) != 0 )
           //       checkLists = PMList.LBRLists;
           //    else
           //       checkLists = PMList.UORLists;
          //  }
        // }
         else
         {
            checkLists = PMList.LBRLists;
         }

         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, 480, 9200 ); //5054 is invis. 2600 is not bad

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

         AddButton( 10, 295, 4005, 4007, 0, GumpButtonType.Reply, 0 );
         AddHtmlLocalized( 45, 295, 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 );
            AddHtml( 30, 35 + (i * 25), 150, 20, checkLists[i].Text, false, false );
         }

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

      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 );
         AddHtml( 30, 35 + (offset * 25), 150, 20, list.SelText, 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 );
            AddHtml( 225, 35 + (i * 25), 150, 20, entries[i].Text, false, false );
         }
      }

      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;

         PMList list = m_Lists[listIndex];

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

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