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); 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); } }
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); } }
private static int MoonGen(PMList list) { for (var index = 0; index < list.Entries.Length; index++) { PMEntry entry = list.Entries[index]; PublicMoongate o = new PublicMoongate(); o.MoveToWorld(entry.Location, list.Map); if (entry.Number == 1060642) // Umbra { o.Hue = 0x497; } } return(list.Entries.Length); }
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 ); AddLabel(30, 35 + (offset * 25), 1153, list.Name + " <--"); // Selected Catagory's Name PMEntry[] entries = list.Entries; for (int i = 0; i < entries.Length; ++i) { AddRadio(185, 35 + (i * 25), 210, 211, false, (index * 100) + i); //AddHtmlLocalized( 225, 35 + (i * 25), 150, 20, entries[i].DestName, false, false ); AddLabel(210, 35 + (i * 25), list.DestHue, entries[i].DestName); // Destination Names in Catagory } }
public static PMEntry FindEntry(PMList list, Point3D loc) { if (list != null) { for (var index = 0; index < list.Entries.Length; index++) { var o = list.Entries[index]; if (o.Location == loc) { return(o); } } return(null); } return(null); }
private static int MoonGen(PMList list) { foreach (PMEntry entry in list.Entries) { Item item = new PublicMoongate(); var loc = entry.Location; var map = list.Map; if (!MythikStaticValues.UpdateLoc(ref loc, ref map)) { continue; } item.MoveToWorld(loc, map); if (entry.Number == 1060642) // Umbra { item.Hue = 0x497; } } return(list.Entries.Length); }
private void RenderPage(int index, int offset) { PMList list = m_Lists[index]; if (Siege.SiegeShard && list.Number == 1012000) // Trammel { return; } 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); } }
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 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; } if (info.ButtonID == 2) //City { ArrayList a = new ArrayList(); foreach (Item i in World.Items.Values) { if (i is CityManagementStone) { CityManagementStone s = (CityManagementStone)i; if (s.HasMoongate == true && s.IsRegistered == true) { a.Add(i); } } } if (a.Count == 0) { m_Mobile.SendGump(new NoCitiesGump()); } else { m_Mobile.SendGump(new PCMoongateGump(m_Moongate, 0, null, null)); } } 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 (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 { CityManagementStone outgoingCity = null; Region currentRegion = Region.Find(m_Mobile.Location, m_Mobile.Map); if (currentRegion != null) { if (currentRegion is PlayerCityRegion) { PlayerCityRegion pcr = (PlayerCityRegion)currentRegion; outgoingCity = pcr.Stone; } } if (outgoingCity != null && outgoingCity.TravelTax >= 1) { m_Mobile.SendGump(new PCMoongateToll2Gump(m_Moongate, outgoingCity, entry.Location, list.Map)); } 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); } } }
public FeluccaTMapAltasGump(Mobile mobile) : base(100, 100) { m_Mobile = mobile; PMList[] checkLists; if (mobile.Player) { 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.AOSLists; } 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, 425, 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(45, 425, 140, 25, 1011036, false, false); // OKAY AddButton(10, 450, 4005, 4007, 0, GumpButtonType.Reply, 0); AddHtmlLocalized(45, 450, 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])); } } }
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; } }
public MoongateGump(Mobile mobile, Item moongate) : base(100, 100) { m_Mobile = mobile; m_Moongate = moongate; PMList[] checkLists; if (mobile.Player) { if (mobile.IsStaff()) { checkLists = PMList.Lists; } else if (Engines.VvV.VvVSigil.ExistsOn(mobile)) { checkLists = PMList.SigilLists; } else if (SpellHelper.RestrictRedTravel && mobile.Murderer && !Siege.SiegeShard) { checkLists = PMList.RedLists; } else { bool young = mobile is PlayerMobile pm && pm.Young; checkLists = young ? PMList.ListsYoung : PMList.Lists; } } else { checkLists = PMList.Lists; } 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) { if (Siege.SiegeShard && checkLists[i].Number == 1012000) // Trammel { continue; } AddButton(10, 35 + (i * 25), 2117, 2118, 0, GumpButtonType.Page, Array.IndexOf(m_Lists, checkLists[i]) + 1); if (checkLists[i].Number.Number > 0) { AddHtmlLocalized(30, 35 + (i * 25), 150, 20, checkLists[i].Number.Number, false, false); } else if (!string.IsNullOrEmpty(checkLists[i].Number.String)) { AddHtml(30, 35 + (i * 25), 150, 20, checkLists[i].Number.String, false, false); } } for (int i = 0; i < m_Lists.Length; ++i) { RenderPage(i, Array.IndexOf(checkLists, m_Lists[i])); } }
public static int IndexOfEntry(PMEntry entry) { PMList list = AllLists.FirstOrDefault(o => o.Entries.Contains(entry)); return(IndexOfEntry(list, entry)); }
protected PMEntry FindEntry() { return(FindEntry(PMList.GetList(Map))); }
public MoongateGump(Mobile mobile, Item moongate) : base(100, 100) { m_Mobile = mobile; m_Moongate = moongate; PMList[] checkLists; if (mobile.Player) { // Genova: verificando se restricao de mundos esta ativa. Se sim, usar apenas esta. if (PersonagemEmMundoRestrito.Ativo) { checkLists = PersonagemEmMundoRestrito.GeNovaLists; } else if (Factions.Sigil.ExistsOn(mobile)) { checkLists = PMList.SigilLists; } else if (mobile.Kills >= 5) { checkLists = PMList.RedLists; } else { int flags = mobile.NetState == null ? 0 : mobile.NetState.Flags; bool young = mobile is PlayerMobile ? ((PlayerMobile)mobile).Young : false; if (Core.SE && (flags & 0x10) != 0) { checkLists = young ? PMList.SEListsYoung : PMList.SELists; } else if (Core.AOS && (flags & 0x8) != 0) { checkLists = young ? PMList.AOSListsYoung : PMList.AOSLists; } else if ((flags & 0x4) != 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])); } }
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])); } }
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; } // *********** Advanced Programmers Only Past This Point --- EDIT AT OWN RISK!! ************* 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 ); AddBackground(0, 0, 335, 375, 2620); AddAlphaRegion(5, 5, 330, 365); AddButton(10, 275, 4005, 4007, 1, GumpButtonType.Reply, 0); //AddHtmlLocalized( 45, 210, 140, 25, 1011036, false, false ); // OKAY AddLabel(45, 275, 38, "OKAY"); AddButton(10, 300, 4005, 4007, 0, GumpButtonType.Reply, 0); //AddHtmlLocalized( 45, 235, 140, 25, 1011012, false, false ); // CANCEL AddLabel(45, 300, 38, "CANCEL"); //AddHtmlLocalized( 5, 5, 200, 20, 1012011, false, false ); // Pick your destination: AddLabel(190, 5, 1153, "Pick your destination:"); AddLabel(15, 5, 1153, "Facets:"); AddLabel(15, 350, 1153, "COV Public Moongate System By Tannis."); 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].DestName, false, false ); //AddHtml( 30, 35 + (i * 25), 150, 20, checkLists[i].DestName, false, false ); AddLabel(30, 35 + (i * 25), checkLists[i].NameHue, checkLists[i].Name); //Unselected Catagory's Name } for (int i = 0; i < m_Lists.Length; ++i) { RenderPage(i, Array.IndexOf(checkLists, m_Lists[i])); } }
private static int MoonGen( PMList list ) { foreach ( PMEntry entry in list.Entries ) { Moongate moon = new Moongate(); moon.Location = entry.Location; moon.Map = list.Map; moon.GateToStarRoom = true; if ( entry.Number == 1060642 ) // Umbra moon.Hue = 0x497; } return list.Entries.Length; }
public TravelBookGump(Mobile mobile, Item TravelBook) : base(100, 100) { m_Mobile = mobile; m_TravelBook = TravelBook; PMList[] checkLists; if (mobile.Player) { if (mobile.Kills >= 5) { checkLists = PMList.RedLists; } else { ClientFlags flags = mobile.NetState == null ? ClientFlags.None : mobile.NetState.Flags; //if (Core.AOS && (flags & 0x8) != 0) if (Core.AOS && (flags & ClientFlags.Malas) != 0) { checkLists = PMList.AOSLists; } else if (Core.SE && (flags & ClientFlags.Tokuno) != 0)// if ((flags & 0x4) != 0) { checkLists = PMList.LBRLists; } else { checkLists = PMList.UORLists; } } } else { checkLists = PMList.AOSLists; } 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, 450, 625, 5054); AddButton(10, 475, 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(45, 475, 140, 25, 1011036, false, false); // OKAY AddButton(10, 500, 4005, 4007, 0, GumpButtonType.Reply, 0); AddHtmlLocalized(45, 500, 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])); } }
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); } }
public MoongateGump(Mobile mobile, Item moongate) : base(100, 100) { m_Mobile = mobile; m_Moongate = moongate; PMList[] checkLists; if (mobile.IsPlayer) { if (Factions.Sigil.ExistsOn(mobile)) { checkLists = PMList.SigilLists; } else if (mobile.Kills >= 5) { checkLists = PMList.RedLists; } else { bool young = mobile is PlayerMobile && ((PlayerMobile)mobile).Young; checkLists = young ? PMList.YoungLists : PMList.DefaultLists; } } else { checkLists = PMList.DefaultLists; } 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, 0x13BE); AddHtmlLocalized(45, 210, 140, 25, 1011036, false, false); // OKAY AddButton(10, 210, 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(45, 235, 140, 25, 1011012, false, false); // CANCEL AddButton(10, 235, 4005, 4007, 0, GumpButtonType.Reply, 0); 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])); } }