public MessageGump(MessageEntry entry, Map map, Point3D loc) : base(150, 50) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; string fmt; if (Sextant.Format(loc, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { fmt = $"{yLat}°{yMins}'{(ySouth ? "S" : "N")},{xLong}°{xMins}'{(xEast ? "E" : "W")}"; } else { fmt = "?????"; } AddPage(0); AddBackground(0, 40, 350, 300, 2520); /* This is a message hastily scribbled by a passenger aboard a sinking ship. * While it is probably too late to save the passengers and crew, * perhaps some treasure went down with the ship! * The message gives the ship's last known sextant co-ordinates. */ AddHtmlLocalized( 30, 80, 285, 160, 1018326, true, true ); AddHtml(35, 240, 230, 20, fmt); AddButton(35, 265, 4005, 4007, 0); AddHtmlLocalized(70, 265, 100, 20, 1011036); // OKAY }
public String GetSextantLocation(Mobile m) //returns location of mobile in sextant coords { if (m.Deleted) { return("Pet Heaven"); } string location; int xLong = 0, yLat = 0, xMins = 0, yMins = 0; bool xEast = false, ySouth = false; Map map = m.Map; bool valid = Server.Items.Sextant.Format(m.Location, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth); if (valid) { location = Sextant.Format(xLong, yLat, xMins, yMins, xEast, ySouth); } else { location = "????"; } if (!valid) { location = string.Format("{0} {1}", m.X, m.Y); } if (map != null) { Region reg = m.Region; if (reg != map.DefaultRegion) { location += (" in " + reg); } } return(location); }
public static string GetLocation(RunebookEntry e) { string loc; // Location labels int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (e.Type == RecallRuneType.Ship) { loc = string.Format("Aboard {0}", e.Description.Substring(e.Description.IndexOf(",") + 2)); } else if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { loc = string.Format("{0}o {1}'{2}, {3}o {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); } else { loc = "Nowhere"; } return(loc); }
public string DescribeLocation(Map map, Point3D p) { string location; int xLong = 0, yLat = 0, xMins = 0, yMins = 0; bool xEast = false, ySouth = false; //Point3D p = Point3D.Parse(Name); Region rx = Region.Find(p, map); bool valid = Sextant.Format(p, rx.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth); if (valid) { location = Sextant.Format(xLong, yLat, xMins, yMins, xEast, ySouth); } else { location = "????"; } if (!valid) { location = string.Format("{0} {1}", p.X, p.Y); } if (rx.Map != null) { //if ( mob.Region != mob.Map.DefaultRegion && mob.Region.ToString() != "" ) if (rx != rx.Map.DefaultRegion && rx.ToString() != "" && rx.ToString() != "DynRegion") { location += (" in " + rx); } } return(location); }
public override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; if (m_Book.Deleted || !from.InRange(m_Book.GetWorldLocation(), (Core.ML ? 3 : 1)) || !Multis.DesignContext.Check(from)) { m_Book.Openers.Remove(from); return; } int buttonID = info.ButtonID; if (buttonID == 0) // Close { m_Book.Openers.Remove(from); } else if (buttonID == 1) // Rename book { if (m_Book.CheckAccess(from) && m_Book.Movable != false) { from.Prompt = new InternalPrompt(m_Book); } else { m_Book.Openers.Remove(from); from.SendLocalizedMessage(502413); // That cannot be done while the book is locked down. } } else { int index = buttonID % 25; int type = buttonID / 25; if (type == 0 || type == 1) { index = buttonID - 10; } if (m_Book.Entries.ElementAtOrDefault(index) != null) { if (index >= 0 && index < m_Book.Entries.Count) { RunebookEntry e = (RunebookEntry)m_Book.Entries[index]; switch (type) { case 0: case 1: // Use charges { if (m_Book.CurCharges <= 0) { from.CloseGump(typeof(RunebookGump)); from.SendGump(new RunebookGump(from, m_Book)); from.SendLocalizedMessage(502412); // There are no charges left on that item. } else { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}o {1}'{2}, {3}o {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new RecallSpell(from, m_Book, e, m_Book).Cast(); m_Book.Openers.Remove(from); } break; } case 8: // Drop rune { if (m_Book.CheckAccess(from) && m_Book.Movable != false) { m_Book.DropRune(from, e, index); from.CloseGump(typeof(RunebookGump)); from.SendGump(new RunebookGump(from, m_Book)); } else { m_Book.Openers.Remove(from); from.SendLocalizedMessage(502413); // That cannot be done while the book is locked down. } break; } case 12: // Set default { if (m_Book.CheckAccess(from)) { m_Book.Default = e; from.CloseGump(typeof(RunebookGump)); from.SendGump(new RunebookGump(from, m_Book)); from.SendLocalizedMessage(502417, "", 0x35); // New default location set. m_Book.Openers.Remove(from); } else { from.SendLocalizedMessage(502413); // That cannot be done while the book is locked down. } break; } case 2: // Recall { if (HasSpell(from, 31)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}o {1}'{2}, {3}o {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new RecallSpell(from, null, e, null).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } m_Book.Openers.Remove(from); break; } case 4: // Gate { if (HasSpell(from, 51)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}o {1}'{2}, {3}o {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new GateTravelSpell(from, null, e).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } m_Book.Openers.Remove(from); break; } case 3: // Sacred Journey { if (HasSpell(from, 209)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}o {1}'{2}, {3}o {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new SacredJourneySpell(from, null, e, null).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } m_Book.Openers.Remove(from); break; } default: break; } } else { m_Book.Openers.Remove(from); } } else { from.SendLocalizedMessage(502423); // This place in the book is empty. m_Book.Openers.Remove(from); } } }
private void AddDetails(int index, int half) { List <RunebookEntry> entries = m_Book.Entries; if (entries.Count != 0) { // Use charge button AddButton(130 + (half * 160), 65, 2103, 2104, 10 + index, GumpButtonType.Reply, 0); if (index < 16) { if (m_Book.Entries.ElementAtOrDefault(index) != null) { RunebookEntry e = (RunebookEntry)m_Book.Entries[index]; // Description label AddLabelCroppedIntern(145 + (half * 160), 60, 115, 17, GetMapHue(e.Map), index + 2); // Location labels int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { AddLabelIntern(135 + (half * 160), 80, 0, index + 23); } // Drop rune button AddButton(135 + (half * 160), 115, 2437, 2438, 200 + index, GumpButtonType.Reply, 0); AddHtmlLocalized(150 + (half * 160), 115, 100, 18, 1011298, false, false); // Drop rune // Set as default button int defButtonID = e != m_Book.Default ? 2361 : 2360; AddButton(160 + (half * 140), 20, defButtonID, defButtonID, 300 + index, GumpButtonType.Reply, 0); AddHtmlLocalized(175 + (half * 140), 15, 100, 18, 1011300, false, false); // Set default } else { AddLabelIntern(145 + (half * 160), 60, 0, index + 2); } if (Core.AOS) { AddButton(135 + (half * 160), 140, 2103, 2104, 50 + index, GumpButtonType.Reply, 0); AddHtmlLocalized(150 + (half * 160), 136, 110, 20, 1062722, false, false); // Recall AddButton(135 + (half * 160), 158, 2103, 2104, 100 + index, GumpButtonType.Reply, 0); AddHtmlLocalized(150 + (half * 160), 154, 110, 20, 1062723, false, false); // Gate Travel AddButton(135 + (half * 160), 176, 2103, 2104, 75 + index, GumpButtonType.Reply, 0); AddHtmlLocalized(150 + (half * 160), 172, 110, 20, 1062724, false, false); // Sacred Journey } else { AddButton(135 + (half * 160), 140, 2103, 2104, 50 + index, GumpButtonType.Reply, 0); AddHtmlLocalized(150 + (half * 160), 136, 110, 20, 1062722, false, false); // Recall AddButton(135 + (half * 160), 158, 2103, 2104, 100 + index, GumpButtonType.Reply, 0); AddHtmlLocalized(150 + (half * 160), 154, 110, 20, 1062723, false, false); // Gate Travel } } } }
public static void ReportAsMacroer(Mobile from, PlayerMobile pm) { string location; int xLong = 0, yLat = 0, xMins = 0, yMins = 0; bool xEast = false, ySouth = false; Map map = pm.Map; bool valid = Sextant.Format(pm.Location, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth); if (valid) { location = Sextant.Format(xLong, yLat, xMins, yMins, xEast, ySouth); } else { location = "????"; } if (!valid) { location = string.Format("{0} {1}", pm.X, pm.Y); } if (map != null) { Region reg = pm.Region; if (reg != map.DefaultRegion) { location += (" in " + reg); } } //Output command log. if (from != null) { Server.Scripts.Commands.CommandLogging.WriteLine(from, "{0} used [Macroer command on {1}({2}) - at {3}", from.Name, pm.Name, pm.Serial, location); } if (from != null) { from.SendMessage("Reporting {0} as an AFK macroer!", pm.Name); } Account acct = pm.Account as Account; int count = 0; foreach (AccountComment comm in acct.Comments) { if (comm.Content.IndexOf(" : reported using the [macroer command") != -1) { count++; } } if (from != null) { from.SendMessage("{0} has been reported for macroing {1} times before.", pm.Name, count); } string[] lns = new string[2]; lns[0] = String.Format("A bounty has been placed on the head of {0} for unlawful resource gathering.", pm.Name); lns[1] = String.Format("{0} was last seen at {1}.", pm.Name, location); if (PJUM.HasBeenReported(pm)) { if (from != null) { from.SendMessage("{0} has already been reported.", pm.Name); } if (from == null) { // the system is automatically jailing this player. Jail.JailPlayer jt = new Jail.JailPlayer(pm, 3, "Caught macroing again within 8 hours by automated system.", false); jt.GoToJail(); } } else { // Adam: changed to 4 hours from 8 PJUM.AddMacroer(lns, pm, DateTime.Now + TimeSpan.FromHours(4)); //Add bounty to player string name = String.Format("Officer {0}", Utility.RandomBool() ? NameList.RandomName("male") : NameList.RandomName("female")); int bountyAmount = 0; Container cont = pm.BankBox; if (cont != null) { int iAmountInBank = 0; Item[] golds = cont.FindItemsByType(typeof(Gold), true); foreach (Item g in golds) { iAmountInBank += g.Amount; } int min = Math.Min(iAmountInBank, 1000); int max = Math.Min(iAmountInBank, 3000); int randomAmount = Utility.RandomMinMax(min, max); if (cont.ConsumeTotal(typeof(Gold), randomAmount)) { bountyAmount = randomAmount; } } if (bountyAmount < 1500) { bountyAmount = Utility.RandomMinMax(1000, 3000); } Bounty bounty = null; if (from != null) { bounty = new Bounty((PlayerMobile)from, pm, bountyAmount, name); } else { bounty = new Bounty(null, pm, bountyAmount, name); } if (bounty != null) { BountyKeeper.Add(bounty); } //Add comment to account Account acc = pm.Account as Account; string comment = String.Format("On {0}, {1} caught {2} unattended macroing at {3} : reported using the [macroer command", DateTime.Now, from != null?from.Name:"auto-RTT", pm.Name, location); acc.Comments.Add(new AccountComment(from != null ? from.Name : "auto-RTT", comment)); } }
public override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; if (m_Book.Deleted || !DesignContext.Check(from)) { return; } int buttonID = info.ButtonID; if (buttonID > 0 && (!m_Book.Dictionary.ContainsKey(from) || (m_Book.Dictionary[from] != from.Location && !m_Book.IsChildOf(from.Backpack)))) { from.SendAsciiMessage("You cannot do this since you moved after using the runebook"); return; } if (buttonID == 1) // Rename book { if (m_Book.CheckAccess(from)) { from.SendLocalizedMessage(502414); // Please enter a title for the runebook: from.Prompt = new InternalPrompt(m_Book); } else { from.SendLocalizedMessage(502413); // That cannot be done while the book is locked down. } } else { buttonID -= 2; int index = buttonID / 6; int type = buttonID % 6; if (index >= 0 && index < m_Book.Entries.Count) { RunebookEntry e = m_Book.Entries[index]; switch (type) { case 0: // Use charges { if (m_Book.CurCharges <= 0) { if (HasSpell(from, 31)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); //from.SendMessage( location ); } m_Book.OnTravel(); new RecallSpell(from, null, e, m_Book).Cast(); } else { from.CloseGump(typeof(RunebookGump)); from.SendGump(new RunebookGump(from, m_Book)); from.SendLocalizedMessage(502412); // There are no charges left on that item. } } else { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); //from.SendMessage( location ); } m_Book.OnTravel(); new RecallSpell(from, m_Book, e, m_Book).Cast(); } break; } case 1: // Drop rune { if (m_Book.CheckAccess(from)) { m_Book.DropRune(from, e, index); from.CloseGump(typeof(RunebookGump)); if (!Core.ML) { from.SendGump(new RunebookGump(from, m_Book)); } } else { from.SendLocalizedMessage(502413); // That cannot be done while the book is locked down. } break; } case 2: // Set default { if (m_Book.CheckAccess(from)) { m_Book.Default = e; from.CloseGump(typeof(RunebookGump)); from.SendGump(new RunebookGump(from, m_Book)); from.SendLocalizedMessage(502417); // New default location set. } else { from.SendLocalizedMessage(502413); // That cannot be done while the book is locked down. } break; } case 3: // Recall { if (HasSpell(from, 31)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); //from.SendMessage( location ); } m_Book.OnTravel(); new RecallSpell(from, null, e, m_Book).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } break; } case 4: // Gate { if (HasSpell(from, 51)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); //from.SendMessage( location ); } m_Book.OnTravel(); new GateTravelSpell(from, null, e, m_Book).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } break; } case 5: // Sacred Journey { if (Core.AOS) { if (HasSpell(from, 209)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new SacredJourneySpell(from, null, e, null).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } } break; } } } } }
public void FindMessage(Mobile m) { if (Deleted || !m.Alive) { return; } CharacterDatabase DB = Server.Items.CharacterDatabase.GetDB(m); string msgQuest = DB.MessageQuest; string myHomeWorld = "the Land of Sosaria"; bool GiveMail = true; if (msgQuest != "" && msgQuest != null) { ArrayList targets = new ArrayList(); foreach (Item item in World.Items.Values) { if (item is CourierMail) { if (((CourierMail)item).owner == m) { GiveMail = false; m.AddToBackpack(item); m.PlaySound(0x249); SayTo(m, "Hmmm...I already gave you a message from " + msgQuest + ". Here is a another if you lost it."); } } } } if (GiveMail) { CourierMail envelope = new CourierMail(m); envelope.owner = m; string alignment = "good"; int c = 0; ArrayList npcs = new ArrayList(); foreach (Mobile msg in World.Mobiles.Values) { if (msg is EpicCharacter && msg.Name != "the Great Earth Serpent") { string tWorld = Worlds.GetMyWorld(msg.Map, msg.Location, msg.X, msg.Y); if ((((EpicCharacter)msg).MyAlignment == "neutral" || ((EpicCharacter)msg).MyAlignment == "evil") && (m.Karma < 0 || ((PlayerMobile)m).KarmaLocked == true)) { if (tWorld == "the Land of Sosaria") { npcs.Add(msg); c++; } else if (CharacterDatabase.GetDiscovered(m, tWorld)) { npcs.Add(msg); c++; } } else if ((((EpicCharacter)msg).MyAlignment == "neutral" || ((EpicCharacter)msg).MyAlignment == "good") && m.Karma >= 0) { if (tWorld == "the Land of Sosaria") { npcs.Add(msg); c++; } else if (CharacterDatabase.GetDiscovered(m, tWorld)) { npcs.Add(msg); c++; } } else { if (tWorld == "the Land of Sosaria") { npcs.Add(msg); c++; } else if (CharacterDatabase.GetDiscovered(m, tWorld)) { npcs.Add(msg); c++; } } } } int o = Utility.RandomMinMax(0, c); for (int i = 0; i < npcs.Count; ++i) { EpicCharacter dude = ( EpicCharacter )npcs[i]; if (i == o) { Point3D WhoLoc = new Point3D(dude.MyX, dude.MyY, 0); Map WhoMap = dude.MyWorld; string my_location = ""; int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(WhoLoc, WhoMap, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { my_location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); } myHomeWorld = Server.Misc.Worlds.GetMyWorld(WhoMap, WhoLoc, dude.MyX, dude.MyY); envelope.ForWho = dude.Name + " " + dude.Title; envelope.ForWhere = my_location; envelope.ForAlignment = dude.MyAlignment; alignment = dude.MyAlignment; DB.MessageQuest = dude.Name; } } PickSearchLocation(envelope, "No Dungeon Yet", m, alignment, myHomeWorld); m.AddToBackpack(envelope); m.PlaySound(0x249); SayTo(m, "Hmmm...I do have a message for you. Here you go."); } }
public override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; if (m_MasterBook.Deleted || !from.InRange(m_MasterBook.GetWorldLocation(), 1) || !Multis.DesignContext.Check(from)) { return; } int buttonID = info.ButtonID; if (buttonID == 196) { from.CloseGump(typeof(InternalRunebookGump)); from.SendGump(new OKTargetGump("Remove Runebook?", 16777215, "Are you sure you want to remove this Runebook?", 16777215, 300, 300, new GenericOKCallback(RemoveRunebook_Callback), m_MasterBook, m_Book, m_BookNum)); } else if (buttonID == 197) { from.CloseGump(typeof(InternalRunebookGump)); from.SendGump(new InternalRunebookGump(from, m_Book, m_MasterBook, m_BookNum)); from.SendMessage("Target a Recall Scroll to add charges."); from.Target = new InternalTarget(m_Book, m_MasterBook, m_BookNum); } else if (buttonID == 198) { from.CloseGump(typeof(InternalRunebookGump)); from.SendGump(new InternalRunebookGump(from, m_Book, m_MasterBook, m_BookNum)); from.SendMessage("Target a Recall Rune to add a destination."); from.Target = new InternalRuneTarget(m_Book, m_MasterBook, m_BookNum); } else if (buttonID == 199) { from.CloseGump(typeof(InternalRunebookGump)); from.SendGump(new MasterRunebookGump(from, m_MasterBook)); } else if (buttonID > 199) { from.CloseGump(typeof(InternalRunebookGump)); from.SendGump(new InternalRunebookGump(from, m_MasterBook.Books[buttonID - 200], m_MasterBook, buttonID - 200)); } else { buttonID -= 2; int index = buttonID / 6; int type = buttonID % 6; if (index >= 0 && index < m_Book.Entries.Count) { RunebookEntry e = (RunebookEntry)m_Book.Entries[index]; switch (type) { case 0: // Use charges { if (m_Book.CurCharges <= 0) { from.CloseGump(typeof(InternalRunebookGump)); from.SendGump(new InternalRunebookGump(from, m_Book, m_MasterBook, m_BookNum)); from.SendLocalizedMessage(502412); // There are no charges left on that item. } else { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new RecallSpell(from, m_Book, e, m_Book).Cast(); } break; } case 1: // Drop rune { if (m_Book.CheckAccess(from)) { m_Book.DropRune(from, e, index); from.CloseGump(typeof(InternalRunebookGump)); from.SendGump(new InternalRunebookGump(from, m_Book, m_MasterBook, m_BookNum)); } else { from.SendLocalizedMessage(502413); // That cannot be done while the book is locked down. } break; } case 3: // Recall { if (HasSpell(from, 31)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new RecallSpell(from, null, e, null).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } break; } case 4: // Gate { if (HasSpell(from, 51)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new GateTravelSpell(from, null, e).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } break; } case 5: // Sacred Journey { if (Core.AOS) { if (HasSpell(from, 209)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new SacredJourneySpell(from, null, e, null).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } } break; } } } } }
public override void OnResponse(NetState state, RelayInfo info) { var from = state.Mobile; if (Book.Deleted || !from.InRange(Book.GetWorldLocation(), Core.ML ? 3 : 1) || !DesignContext.Check(from)) { Book.Openers.Remove(from); return; } var buttonID = info.ButtonID; if (buttonID == 1) // Rename book { if (!Book.IsLockedDown || from.AccessLevel >= AccessLevel.GameMaster) { from.SendLocalizedMessage(502414); // Please enter a title for the runebook: from.Prompt = new InternalPrompt(Book); } else { Book.Openers.Remove(from); from.SendLocalizedMessage(502413, null, 0x35); // That cannot be done while the book is locked down. } } else { buttonID -= 2; var index = buttonID / 6; var type = buttonID % 6; if (index >= 0 && index < Book.Entries.Count) { var e = Book.Entries[index]; switch (type) { case 0: // Use charges { if (Book.CurCharges <= 0) { from.CloseGump <RunebookGump>(); from.SendGump(new RunebookGump(from, Book)); from.SendLocalizedMessage(502412); // There are no charges left on that item. } else { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format( e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth )) { var location = $"{yLat}° {yMins}'{(ySouth ? "S" : "N")}, {xLong}' {xMins}'{(xEast ? "E" : "W")}"; from.SendMessage(location); } Book.OnTravel(); new RecallSpell(from, e, Book, Book).Cast(); Book.Openers.Remove(from); } break; } case 1: // Drop rune { if (!Book.IsLockedDown || from.AccessLevel >= AccessLevel.GameMaster) { Book.DropRune(from, e, index); from.CloseGump <RunebookGump>(); if (!Core.ML) { from.SendGump(new RunebookGump(from, Book)); } } else { Book.Openers.Remove(from); from.SendLocalizedMessage( 502413, null, 0x35 ); // That cannot be done while the book is locked down. } break; } case 2: // Set default { if (Book.CheckAccess(from)) { Book.Default = e; from.CloseGump <RunebookGump>(); from.SendGump(new RunebookGump(from, Book)); from.SendLocalizedMessage(502417); // New default location set. } break; } case 3: // Recall { if (HasSpell(from, 31)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format( e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth )) { var location = $"{yLat}° {yMins}'{(ySouth ? "S" : "N")}, {xLong}' {xMins}'{(xEast ? "E" : "W")}"; from.SendMessage(location); } Book.OnTravel(); new RecallSpell(from, e).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } Book.Openers.Remove(from); break; } case 4: // Gate { if (HasSpell(from, 51)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format( e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth )) { var location = $"{yLat}° {yMins}'{(ySouth ? "S" : "N")}, {xLong}' {xMins}'{(xEast ? "E" : "W")}"; from.SendMessage(location); } Book.OnTravel(); new GateTravelSpell(from, e).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } Book.Openers.Remove(from); break; } case 5: // Sacred Journey { if (Core.AOS) { if (HasSpell(from, 209)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format( e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth )) { var location = $"{yLat}° {yMins}'{(ySouth ? "S" : "N")}, {xLong}' {xMins}'{(xEast ? "E" : "W")}"; from.SendMessage(location); } Book.OnTravel(); new SacredJourneySpell(from, e).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } } Book.Openers.Remove(from); break; } } } else { Book.Openers.Remove(from); } } }
public static string DescribeLocation(object o) { Point3D oLocation; Region oRegion; Map oMap; if (o is Item) { oLocation = (o as Item).Location; oRegion = Region.Find((o as Item).Location, (o as Item).Map); oMap = (o as Item).Map; } else if (o is Mobile) { oLocation = (o as Mobile).Location; oRegion = (o as Mobile).Region; oMap = (o as Mobile).Map; } else { return("Error!"); } string location = ""; int xLong = 0, yLat = 0, xMins = 0, yMins = 0; bool xEast = false, ySouth = false; Point3D p = new Point3D(oLocation); bool valid = Sextant.Format(p, oMap, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth); if (valid) { location = Sextant.Format(xLong, yLat, xMins, yMins, xEast, ySouth); } if (!valid) { string mobName = NearbyMobile(oMap, oLocation); if (mobName != null) { location = string.Format("{0} in a dark cave.", mobName); } else // heh, good luck finding this guy! { location = string.Format("{0} in a dark cave", "some rocks"); } } if (oMap != null) { if (oRegion != oMap.DefaultRegion && oRegion.ToString() != "") { location += (" in " + oRegion); } } location += "."; return(location); }
public override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; if (m_Book.Deleted || !from.InRange(m_Book.GetWorldLocation(), 1)) { return; } int buttonID = info.ButtonID; if (buttonID == 1) // Rename book { if (m_Book.CheckAccess(from)) { from.SendLocalizedMessage(502414); // Please enter a title for the runebook: from.Prompt = new InternalPrompt(m_Book); } else { from.SendLocalizedMessage(502413); // That cannot be done while the book is locked down. } } else { buttonID -= 2; int index = buttonID / 6; int type = buttonID % 6; if (index >= 0 && index < m_Book.Entries.Count) { RunebookEntry e = (RunebookEntry)m_Book.Entries[index]; switch (type) { case 0: // Use charges { //if ( m_Book.CurCharges <= 0 ) //{ // from.CloseGump( typeof( RunebookGump ) ); // from.SendGump( new RunebookGump( from, m_Book ) ); // from.SendLocalizedMessage( 502412 ); // There are no charges left on that item. //} //else //{ if (HasSpell(from, 32)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } new RappelSpell(from, m_Book, e, m_Book).Cast(); //} } else { from.SendLocalizedMessage(500015); // You do not have that spell! } break; } case 1: // Drop rune { if (m_Book.CheckAccess(from)) { m_Book.DropRune(from, e, index); from.CloseGump(typeof(RunebookGump)); from.SendGump(new RunebookGump(from, m_Book)); } else { from.SendLocalizedMessage(502413); // That cannot be done while the book is locked down. } break; } case 2: // Set default { if (m_Book.CheckAccess(from)) { m_Book.Default = e; from.CloseGump(typeof(RunebookGump)); from.SendGump(new RunebookGump(from, m_Book)); from.SendLocalizedMessage(502417); // New default location set. } else { from.SendLocalizedMessage(502413); // That cannot be done while the book is locked down. } break; } case 3: // Recall { if (HasSpell(from, 32)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } new RappelSpell(from, null, e, null).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } break; } case 4: // Gate { if (HasSpell(from, 52)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } new TrouDeVerSpell(from, null, e).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } break; } case 5: // Sacred Journey { break; } } } } }
public static void ReportAsMacroer(Mobile from, PlayerMobile pm) { string location; int xLong = 0, yLat = 0, xMins = 0, yMins = 0; bool xEast = false, ySouth = false; Map map = pm.Map; bool valid = Sextant.Format(pm.Location, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth); if (valid) { location = Sextant.Format(xLong, yLat, xMins, yMins, xEast, ySouth); } else { location = "????"; } if (!valid) { location = string.Format("{0} {1}", pm.X, pm.Y); } if (map != null) { Region reg = pm.Region; if (reg != map.DefaultRegion) { location += (" in " + reg); } } //Output command log. if (from != null) { Server.Commands.CommandLogging.WriteLine(from, "{0} used [Macroer command on {1}({2}) - at {3}", from.Name, pm.Name, pm.Serial, location); } if (from != null) { from.SendMessage("Reporting {0} as an AFK macroer!", pm.Name); } Account acct = pm.Account as Account; int count = 0; foreach (AccountComment comm in acct.Comments) { if (comm.Content.IndexOf(" : reported using the [macroer command") != -1) { count++; } } if (from != null) { from.SendMessage("{0} has been reported for macroing {1} times before.", pm.Name, count); } if (PJUM.HasBeenReported(pm)) { if (from != null) { from.SendMessage("{0} has already been reported.", pm.Name); } if (from == null) { // the system is automatically jailing this player. Jail.JailPlayer jt = new Jail.JailPlayer(pm, 3, "Caught macroing again within 8 hours by automated system.", false); jt.GoToJail(); } } else { string[] lns = new string[2]; // make the message reflect whether or not there is an actual/reasonable bounty if (HasGold(pm) > 100 || BountyKeeper.CurrentLBBonusAmount > 100) { lns[0] = String.Format("A bounty has been placed on the head of {0} for unlawful resource gathering.", pm.Name); } else { lns[0] = String.Format("{0} is an enemy of the kingdom for unlawful resource gathering.", pm.Name); } lns[1] = String.Format("{0} was last seen at {1}.", pm.Name, location); // Adam: changed to 4 hours from 8 ListEntry TCTextHandle = PJUM.AddMacroer(lns, pm, DateTime.Now + TimeSpan.FromHours(4)); //Add bounty to player string name = String.Format("Officer {0}", Utility.RandomBool() ? NameList.RandomName("male") : NameList.RandomName("female")); int bountyAmount = 0; Container cont = pm.BankBox; if (cont != null) { int iAmountInBank = 0; Item[] golds = cont.FindItemsByType(typeof(Gold), true); foreach (Item g in golds) { iAmountInBank += g.Amount; } int randomAmount = Utility.RandomMinMax(iAmountInBank / 2, iAmountInBank); if (cont.ConsumeTotal(typeof(Gold), randomAmount)) { bountyAmount = randomAmount; } } // note, from can be null (which is fine) Bounty bounty = null; bounty = new Bounty(from as PlayerMobile, pm, bountyAmount, name); if (bounty != null) { // associate the town crier message with thie bounty so we can update the message once the bounty is collected. bounty.TownCrierEntryID = TCTextHandle.EntryID; BountyKeeper.Add(bounty); } //Add comment to account Account acc = pm.Account as Account; string comment = String.Format("On {0}, {1} caught {2} unattended macroing at {3} : reported using the [macroer command", DateTime.Now, from != null ? from.Name : "auto-RTT", pm.Name, location); acc.Comments.Add(new AccountComment(from != null ? from.Name : "RTT SYSTEM", comment)); } }
protected override void OnTarget(Mobile from, object targ) { if (targ is PlayerMobile) { try { PlayerMobile pm = (PlayerMobile)targ; string location; int xLong = 0, yLat = 0, xMins = 0, yMins = 0; bool xEast = false, ySouth = false; Map map = pm.Map; bool valid = Sextant.Format(pm.Location, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth); if (valid) { location = Sextant.Format(xLong, yLat, xMins, yMins, xEast, ySouth); } else { location = "????"; } if (!valid) { location = string.Format("{0} {1}", pm.X, pm.Y); } if (map != null) { Region reg = pm.Region; if (reg != map.DefaultRegion) { location += (" in " + reg); } } //Output command log. Server.Scripts.Commands.CommandLogging.WriteLine(from, "{0} used [ibanthee command on {1}({2}) - at {3}", from.Name, pm.Name, pm.Serial, location); from.SendMessage("Reporting {0} as Banned!", pm.Name); string[] lns = new string[2]; lns[0] = String.Format("A bounty has been placed on the head of {0} for disrupting a royal tournament. .", pm.Name); lns[1] = String.Format("{0} was last seen at {1}.", pm.Name, location); if (PJUM.HasBeenReported(pm)) { from.SendMessage("{0} has already been reported.", pm.Name); } else { //move player to outside arena pm.MoveToWorld(new Point3D(353, 905, 0), Map.Felucca); PJUM.AddMacroer(lns, pm, DateTime.Now + TimeSpan.FromHours(2)); //Add bounty to player string name = String.Format("Officer {0}", Utility.RandomBool() ? NameList.RandomName("male") : NameList.RandomName("female")); int bountyAmount = 0; Container cont = pm.BankBox; if (cont != null) { int iAmountInBank = 0; Item[] golds = cont.FindItemsByType(typeof(Gold), true); foreach (Item g in golds) { iAmountInBank += g.Amount; } int min = Math.Min(iAmountInBank, 1000); int max = Math.Min(iAmountInBank, 3000); int randomAmount = Utility.RandomMinMax(min, max); if (cont.ConsumeTotal(typeof(Gold), randomAmount)) { bountyAmount = randomAmount; } } if (bountyAmount == 0) { bountyAmount = 100; } Bounty bounty = new Bounty((PlayerMobile)from, pm, bountyAmount, name); BountyKeeper.Add(bounty); //Add comment to account Account acc = pm.Account as Account; string comment = String.Format("On {0}, {1} caught {2} disturbing event at {3} : removed using the [ibanthee command", DateTime.Now, from.Name, pm.Name, location); acc.Comments.Add(new AccountComment(from.Name, comment)); } } catch (Exception except) { LogHelper.LogException(except); System.Console.WriteLine("Caught exception in [ibanthee command: {0}", except.Message); System.Console.WriteLine(except.StackTrace); } } else { from.SendMessage("Only players can be banned."); } }
public ViewBoatsGump(Mobile from, List <BaseBoat> list, BaseBoat sel) : base(50, 40) { m_From = from; m_List = list; m_Selection = sel; from.CloseGump(typeof(ViewBoatsGump)); AddPage(0); AddBackground(0, 0, 240, 360, 5054); AddBlackAlpha(10, 10, 220, 340); if (sel == null || sel.Deleted) { m_Selection = null; AddHtml(35, 15, 120, 20, Color("Boat Type", White), false, false); if (list.Count == 0) { AddHtml(35, 40, 160, 40, Color("There were no boats found for that player.", White), false, false); } AddImage(190, 17, 0x25EA); AddImage(207, 17, 0x25E6); int page = 0; for (int i = 0; i < list.Count; ++i) { if ((i % 15) == 0) { if (page > 0) { AddButton(207, 17, 0x15E1, 0x15E5, 0, GumpButtonType.Page, page + 1); } AddPage(++page); if (page > 1) { AddButton(190, 17, 0x15E3, 0x15E7, 0, GumpButtonType.Page, page - 1); } } object name = FindBoatName((BaseBoat)list[i]); AddHtml(15, 40 + ((i % 15) * 20), 20, 20, Color(String.Format("{0}.", i + 1), White), false, false); if (name is int) { AddHtmlLocalized(35, 40 + ((i % 15) * 20), 160, 20, (int)name, White16, false, false); } else if (name is string) { AddHtml(35, 40 + ((i % 15) * 20), 160, 20, Color((string)name, White), false, false); } AddButton(198, 39 + ((i % 15) * 20), 4005, 4007, i + 1, GumpButtonType.Reply, 0); } } else { string boatName = sel.Name, owner, location; Map map = sel.Map; if (boatName == null || boatName == String.Empty) { boatName = "nothing"; } Mobile boatOwner = sel.Owner; if (boatOwner == null) { owner = "nobody"; } else { owner = boatOwner.Name; } int xLong = 0, yLat = 0, xMins = 0, yMins = 0; bool xEast = false, ySouth = false; bool valid = Sextant.Format(sel.Location, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth); if (valid) { location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); } else { location = "????"; } AddHtml(10, 15, 220, 20, Color(Center("Boat Properties"), White), false, false); AddHtml(15, 40, 210, 20, Color("Facet:", White), false, false); AddHtml(15, 40, 210, 20, Color(Right(map == null ? "(-null-)" : map.Name), White), false, false); AddHtml(15, 60, 210, 20, Color("Location:", White), false, false); AddHtml(15, 60, 210, 20, Color(Right(sel.Location.ToString()), White), false, false); AddHtml(15, 80, 210, 20, Color("Sextant:", White), false, false); AddHtml(15, 80, 210, 20, Color(Right(location), White), false, false); AddHtml(15, 100, 210, 20, Color("Owner:", White), false, false); AddHtml(15, 100, 210, 20, Color(Right(owner), White), false, false); AddHtml(15, 120, 210, 20, Color("Name:", White), false, false); AddHtml(15, 120, 210, 20, Color(Right(boatName), White), false, false); //AddHtml( 15, 140, 210, 20, Color( "Friends:", White ), false, false ); //AddHtml( 15, 140, 210, 20, Color( Right( sel.Friends.Count.ToString() ), White ), false, false ); //AddHtml( 15, 160, 210, 20, Color( "Co-Owners:", White ), false, false ); //AddHtml( 15, 160, 210, 20, Color( Right( sel.CoOwners.Count.ToString() ), White ), false, false ); //AddHtml( 15, 180, 210, 20, Color( "Bans:", White ), false, false ); //AddHtml( 15, 180, 210, 20, Color( Right( sel.Bans.Count.ToString() ), White ), false, false ); AddHtml(15, 180, 210, 20, Color("Decays:", White), false, false); AddHtml(15, 180, 210, 20, Color(Right(sel.CheckDecay() ? "Yes" : "No"), White), false, false); AddHtml(15, 200, 210, 20, Color("Decay Level:", White), false, false); AddHtml(15, 210, 210, 20, Color(Right(sel.StatusText()), White), false, false); AddButton(15, 245, 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtml(50, 245, 120, 20, Color("Go to boat", White), false, false); //AddButton( 15, 265, 4005, 4007, 2, GumpButtonType.Reply, 0 ); //AddHtml( 50, 265, 120, 20, Color( "Open boat menu", White ), false, false ); AddButton(15, 285, 4005, 4007, 3, GumpButtonType.Reply, 0); AddHtml(50, 285, 120, 20, Color("Delete boat", White), false, false); AddButton(15, 305, 4005, 4007, 4, GumpButtonType.Reply, 0); AddHtml(50, 305, 120, 20, Color("Refresh boat", White), false, false); } }
public ViewHousesGump(Mobile from, ArrayList list, BaseHouse sel) : base(50, 40) { m_From = from; m_List = list; m_Selection = sel; from.CloseGump(typeof(ViewHousesGump)); AddPage(0); AddBackground(0, 0, 240, 360, 5054); AddBlackAlpha(10, 10, 220, 340); if (sel == null || sel.Deleted) { m_Selection = null; AddHtml(35, 15, 120, 20, Color("House Type", White), false, false); if (list.Count == 0) { AddHtml(35, 40, 160, 40, Color("There were no houses found for that player.", White), false, false); } AddImage(190, 17, 0x25EA); AddImage(207, 17, 0x25E6); int page = 0; for (int i = 0; i < list.Count; ++i) { if ((i % 15) == 0) { if (page > 0) { AddButton(207, 17, 0x15E1, 0x15E5, 0, GumpButtonType.Page, page + 1); } AddPage(++page); if (page > 1) { AddButton(190, 17, 0x15E3, 0x15E7, 0, GumpButtonType.Page, page - 1); } } object name = FindHouseName((BaseHouse)list[i]); AddHtml(15, 40 + ((i % 15) * 20), 20, 20, Color(String.Format("{0}.", i + 1), White), false, false); if (name is int) { AddHtmlLocalized(35, 40 + ((i % 15) * 20), 160, 20, (int)name, White16, false, false); } else if (name is string) { AddHtml(35, 40 + ((i % 15) * 20), 160, 20, Color((string)name, White), false, false); } AddButton(198, 39 + ((i % 15) * 20), 4005, 4007, i + 1, GumpButtonType.Reply, 0); } } else { string houseName, owner, location; Map map = sel.Map; Item sign = sel.Sign; if (sign == null || sign.Name == null || sign.Name == "a house sign") { houseName = "nothing"; } else { houseName = sign.Name; } Mobile houseOwner = sel.Owner; if (houseOwner == null) { owner = "nobody"; } else { owner = houseOwner.Name; } int xLong = 0, yLat = 0, xMins = 0, yMins = 0; bool xEast = false, ySouth = false; bool valid = Sextant.Format(sel.Location, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth); if (valid) { location = Sextant.Format(xLong, yLat, xMins, yMins, xEast, ySouth); } else { location = "????"; } AddHtml(10, 15, 220, 20, Color(Center("House Properties"), White), false, false); AddHtml(15, 40, 210, 20, Color("Facet:", White), false, false); AddHtml(15, 40, 210, 20, Color(Right(map == null ? "(null)" : map.Name), White), false, false); AddHtml(15, 60, 210, 20, Color("Location:", White), false, false); AddHtml(15, 60, 210, 20, Color(Right(sel.Location.ToString()), White), false, false); AddHtml(15, 80, 210, 20, Color("Sextant:", White), false, false); AddHtml(15, 80, 210, 20, Color(Right(location), White), false, false); AddHtml(15, 100, 210, 20, Color("Owner:", White), false, false); AddHtml(15, 100, 210, 20, Color(Right(owner), White), false, false); AddHtml(15, 120, 210, 20, Color("Name:", White), false, false); AddHtml(15, 120, 210, 20, Color(Right(houseName), White), false, false); AddHtml(15, 140, 210, 20, Color("Friends:", White), false, false); AddHtml(15, 140, 210, 20, Color(Right(sel.Friends.Count.ToString()), White), false, false); AddHtml(15, 160, 210, 20, Color("Co-Owners:", White), false, false); AddHtml(15, 160, 210, 20, Color(Right(sel.CoOwners.Count.ToString()), White), false, false); AddHtml(15, 180, 210, 20, Color("Bans:", White), false, false); AddHtml(15, 180, 210, 20, Color(Right(sel.Bans.Count.ToString()), White), false, false); AddButton(15, 205, 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtml(50, 205, 120, 20, Color("Go to house", White), false, false); AddButton(15, 225, 4005, 4007, 2, GumpButtonType.Reply, 0); AddHtml(50, 225, 120, 20, Color("Open house menu", White), false, false); AddButton(15, 245, 4005, 4007, 3, GumpButtonType.Reply, 0); AddHtml(50, 245, 120, 20, Color("Demolish house", White), false, false); } }
private void AddDetails(int index, int half) { string title = "Runebook"; if (m_Book.Description != null && m_Book.Description != "") { title = m_Book.Description; } AddHtml(377, 26, 196, 20, @"<BODY><BASEFONT Color=#111111><H3>" + title + "</H3></BASEFONT></BODY>", (bool)false, (bool)false); string desc; string hue; int filled = 0; string Sextants = ""; int defButtonID = 0; if (index < m_Book.Entries.Count) { RunebookEntry e = (RunebookEntry)m_Book.Entries[index]; desc = GetName(e.Description); hue = GetEntryHue(e.Map); filled = 1; // Location labels int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { Sextants = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); } // Set as default button defButtonID = e != m_Book.Default ? 11410 : 11400; } else { desc = "Empty"; hue = "#111111"; filled = 0; } int t = 10; int v = 140; int w = 7; if (half == 1) { v = 440; } AddHtml(v - 20, 62, 217, 20, @"<BODY><BASEFONT Color=" + hue + "><H3>" + desc + "</H3></BASEFONT></BODY>", (bool)false, (bool)false); if (filled > 0) { AddButton(v - 40, 65, 30008, 30008, 2 + (index * 6) + 0, GumpButtonType.Reply, 0); AddHtml(v - 25, 84, 217, 20, @"<BODY><BASEFONT Color=#111111><H3>" + Sextants + "</H3></BASEFONT></BODY>", (bool)false, (bool)false); AddButton(v - 20, 115 - w, defButtonID, defButtonID, 2 + (index * 6) + 2, GumpButtonType.Reply, 0); AddHtml(v, 115 - t, 217, 20, @"<BODY><BASEFONT Color=#111111><H3>Set As Default</H3></BASEFONT></BODY>", (bool)false, (bool)false); AddHtml(v, 140 - t, 217, 20, @"<BODY><BASEFONT Color=#111111><H3>Remove Rune</H3></BASEFONT></BODY>", (bool)false, (bool)false); AddButton(v - 20, 140 - w, 30008, 30008, 2 + (index * 6) + 1, GumpButtonType.Reply, 0); AddHtml(v, 165 - t, 217, 20, @"<BODY><BASEFONT Color=#111111><H3>Recall</H3></BASEFONT></BODY>", (bool)false, (bool)false); AddButton(v - 20, 165 - w, 30008, 30008, 2 + (index * 6) + 3, GumpButtonType.Reply, 0); AddHtml(v, 190 - t, 217, 20, @"<BODY><BASEFONT Color=#111111><H3>Gate</H3></BASEFONT></BODY>", (bool)false, (bool)false); AddButton(v - 20, 190 - w, 30008, 30008, 2 + (index * 6) + 4, GumpButtonType.Reply, 0); AddHtml(v, 215 - t, 217, 20, @"<BODY><BASEFONT Color=#111111><H3>Sacred Journey</H3></BASEFONT></BODY>", (bool)false, (bool)false); AddButton(v - 20, 215 - w, 30008, 30008, 2 + (index * 6) + 5, GumpButtonType.Reply, 0); AddHtml(v, 240 - t, 217, 20, @"<BODY><BASEFONT Color=#111111><H3>Nature Passage</H3></BASEFONT></BODY>", (bool)false, (bool)false); AddButton(v - 20, 240 - w, 30008, 30008, 602 + (index * 6) + 1, GumpButtonType.Reply, 0); AddHtml(v, 265 - t, 217, 20, @"<BODY><BASEFONT Color=#111111><H3>Mushroom Gateway</H3></BASEFONT></BODY>", (bool)false, (bool)false); AddButton(v - 20, 265 - w, 30008, 30008, 602 + (index * 6) + 2, GumpButtonType.Reply, 0); AddHtml(v, 290 - t, 217, 20, @"<BODY><BASEFONT Color=#111111><H3>Demonic Fire</H3></BASEFONT></BODY>", (bool)false, (bool)false); AddButton(v - 20, 290 - w, 30008, 30008, 602 + (index * 6) + 3, GumpButtonType.Reply, 0); AddHtml(v, 315 - t, 217, 20, @"<BODY><BASEFONT Color=#111111><H3>Black Gate</H3></BASEFONT></BODY>", (bool)false, (bool)false); AddButton(v - 20, 315 - w, 30008, 30008, 602 + (index * 6) + 4, GumpButtonType.Reply, 0); AddHtml(v, 340 - t, 217, 20, @"<BODY><BASEFONT Color=#111111><H3>Astral Travel</H3></BASEFONT></BODY>", (bool)false, (bool)false); AddButton(v - 20, 340 - w, 30008, 30008, 602 + (index * 6) + 5, GumpButtonType.Reply, 0); AddHtml(v, 365 - t, 217, 20, @"<BODY><BASEFONT Color=#111111><H3>Ethereal Travel</H3></BASEFONT></BODY>", (bool)false, (bool)false); AddButton(v - 20, 365 - w, 30008, 30008, 702 + (index * 6) + 1, GumpButtonType.Reply, 0); } }
private void AddDetails(int index, int half) { // Use charge button AddButton(130 + half * 160, 65, 2103, 2104, 2 + index * 6 + 0); string desc; int hue; if (index < Book.Entries.Count) { var e = Book.Entries[index]; desc = GetName(e.Description); hue = GetMapHue(e.Map); // Location labels int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { AddLabel(135 + half * 160, 80, 0, $"{yLat}° {yMins}'{(ySouth ? "S" : "N")}"); AddLabel(135 + half * 160, 95, 0, $"{xLong}° {xMins}'{(xEast ? "E" : "W")}"); } // Drop rune button AddButton(135 + half * 160, 115, 2437, 2438, 2 + index * 6 + 1); AddHtmlLocalized(150 + half * 160, 115, 100, 18, 1011298); // Drop rune // Set as default button var defButtonID = e != Book.Default ? 2361 : 2360; AddButton(160 + half * 140, 20, defButtonID, defButtonID, 2 + index * 6 + 2); AddHtmlLocalized(175 + half * 140, 15, 100, 18, 1011300); // Set default if (Core.AOS) { AddButton(135 + half * 160, 140, 2103, 2104, 2 + index * 6 + 3); AddHtmlLocalized(150 + half * 160, 136, 110, 20, 1062722); // Recall AddButton(135 + half * 160, 158, 2103, 2104, 2 + index * 6 + 4); AddHtmlLocalized(150 + half * 160, 154, 110, 20, 1062723); // Gate Travel AddButton(135 + half * 160, 176, 2103, 2104, 2 + index * 6 + 5); AddHtmlLocalized(150 + half * 160, 172, 110, 20, 1062724); // Sacred Journey } else { // Recall button AddButton(135 + half * 160, 140, 2271, 2271, 2 + index * 6 + 3); // Gate button AddButton(205 + half * 160, 140, 2291, 2291, 2 + index * 6 + 4); } } else { desc = "Empty"; hue = 0; } // Description label AddLabelCropped(145 + half * 160, 60, 115, 17, hue, desc); }
public CityManagementGump(CityManagementStone stone, Mobile from) : base(50, 50) { m_Stone = stone; int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; int X = stone.Center.X; int Y = stone.Center.Y; int Z = 0; Point3D loc = new Point3D(X, Y, Z); string fmt; if (Sextant.Format(loc, stone.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { fmt = String.Format("{0}°{1}'{2},{3}°{4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); } else { fmt = "???"; } Closable = true; Disposable = true; Dragable = true; Resizable = false; AddPage(0); AddImage(396, 160, 10462); AddImage(396, 60, 10462); AddBackground(15, 20, 407, 340, 5120); AddBackground(428, 20, 166, 208, 5120); AddButton(440, 50, 5601, 5601, 1, GumpButtonType.Page, 1); AddButton(440, 75, 5601, 5601, 2, GumpButtonType.Page, 2); AddButton(440, 100, 5601, 5601, 3, GumpButtonType.Page, 3); AddButton(440, 125, 5601, 5601, 4, GumpButtonType.Page, 4); AddButton(440, 150, 5601, 5601, 5, GumpButtonType.Page, 5); AddButton(440, 175, 5601, 5601, 6, GumpButtonType.Page, 6); AddButton(440, 200, 5601, 5601, 7, GumpButtonType.Page, 7); AddLabel(475, 23, 1149, @"Navigation"); AddLabel(465, 47, 1149, @"Information"); AddImageTiled(20, 54, 399, 9, 5121); AddLabel(465, 72, 1149, @"General Settings"); AddLabel(465, 97, 1149, @"Membership"); AddLabel(465, 123, 1149, @"Treasury Info"); AddLabel(465, 147, 1149, @"Levy Taxes"); AddLabel(465, 172, 1149, @"War Dept."); AddLabel(465, 197, 1149, @"Misc."); AddPage(1); AddHtml(22, 27, 393, 21, @"<BASEFONT COLOR=WHITE><CENTER>Information</CENTER></BASEFONT>", (bool)false, (bool)false); AddLabel(25, 60, 1149, @"City Name: " + stone.CityName.ToString()); AddLabel(25, 80, 1149, @"City Level: " + stone.Level.ToString()); int l1offset = PlayerGovernmentSystem.L1CLOffset * 2; int l2offset = PlayerGovernmentSystem.L2CLOffset * 2; int l3offset = PlayerGovernmentSystem.L3CLOffset * 2; int l4offset = PlayerGovernmentSystem.L4CLOffset * 2; int l5offset = PlayerGovernmentSystem.L5CLOffset * 2; int l6offset = PlayerGovernmentSystem.L6CLOffset * 2; if (stone.Level == 1) { AddLabel(25, 100, 1149, @"City Limits: " + l1offset.ToString() + "x" + l1offset.ToString()); } else if (stone.Level == 2) { AddLabel(25, 100, 1149, @"City Limits: " + l2offset.ToString() + "x" + l2offset.ToString()); } else if (stone.Level == 3) { AddLabel(25, 100, 1149, @"City Limits: " + l3offset.ToString() + "x" + l3offset.ToString()); } else if (stone.Level == 4) { AddLabel(25, 100, 1149, @"City Limits: " + l4offset.ToString() + "x" + l4offset.ToString()); } else if (stone.Level == 5) { AddLabel(25, 100, 1149, @"City Limits: " + l5offset.ToString() + "x" + l5offset.ToString()); } else if (stone.Level == 6) { AddLabel(25, 100, 1149, @"City Limits: " + l6offset.ToString() + "x" + l6offset.ToString()); } else { AddLabel(25, 100, 1149, @"City Limits: ???"); } AddLabel(25, 120, 1149, @"City Population: " + stone.Citizens.Count.ToString()); AddLabel(25, 140, 1149, @"City Location: " + fmt); AddLabel(25, 160, 1149, @"Treasury Balance: " + stone.CityTreasury.ToString()); if (stone.Level == 1) { AddLabel(25, 180, 1149, @"City Rank: " + PlayerGovernmentSystem.Title1.ToString()); } else if (stone.Level == 2) { AddLabel(25, 180, 1149, @"City Rank: " + PlayerGovernmentSystem.Title2.ToString()); } else if (stone.Level == 3) { AddLabel(25, 180, 1149, @"City Rank: " + PlayerGovernmentSystem.Title3.ToString()); } else if (stone.Level == 4) { AddLabel(25, 180, 1149, @"City Rank: " + PlayerGovernmentSystem.Title4.ToString()); } else if (stone.Level == 5) { AddLabel(25, 180, 1149, @"City Rank: " + PlayerGovernmentSystem.Title5.ToString()); } else if (stone.Level == 6) { AddLabel(25, 180, 1149, @"City Rank: " + PlayerGovernmentSystem.Title6.ToString()); } else { AddLabel(25, 180, 1149, @"City Rank: ???"); } //if ( stone.IsGuarded == true ) //AddLabel(25, 200, 1149, @"City Guards: Enabled"); //else AddLabel(25, 200, 1149, @"City Guards: Disabled"); if (stone.AllowHousing == true) { AddLabel(25, 220, 1149, @"House Placement: Enabled"); } else { AddLabel(25, 220, 1149, @"House Placement: Disabled"); } AddLabel(25, 240, 1149, @"Current Income Tax: " + stone.IncomeTax.ToString()); AddLabel(25, 260, 1149, @"Current Property Tax: " + stone.HousingTax.ToString()); AddLabel(25, 280, 1149, @"Current Travel Tax: " + stone.TravelTax.ToString()); AddLabel(25, 300, 1149, @"Max Decorations: " + stone.MaxDecore.ToString()); AddLabel(25, 320, 1149, @"Current Decorations: " + stone.CurrentDecore.ToString()); AddLabel(25, 340, 1149, @"Town Vendors: " + stone.Vendors.Count.ToString()); AddPage(2); AddHtml(22, 27, 393, 21, @"<BASEFONT COLOR=WHITE><CENTER>General Settings</CENTER></BASEFONT>", (bool)false, (bool)false); AddButton(30, 60, 4005, 4006, 1, GumpButtonType.Reply, 0); AddButton(30, 90, 4005, 4006, 2, GumpButtonType.Reply, 0); //AddButton(30, 120, 4005, 4006, 3, GumpButtonType.Reply, 0); AddButton(30, 150, 4005, 4006, 4, GumpButtonType.Reply, 0); AddImageTiled(27, 200, 385, 109, 5154); AddLabel(31, 177, 1149, @"City Rules, You can use HTML"); AddTextEntry(27, 200, 385, 109, 0, 1, @""); AddButton(210, 60, 4005, 4006, 5, GumpButtonType.Reply, 0); AddButton(210, 90, 4005, 4006, 6, GumpButtonType.Reply, 0); AddButton(210, 120, 4005, 4006, 7, GumpButtonType.Reply, 0); AddButton(210, 150, 4005, 4006, 8, GumpButtonType.Reply, 0); AddLabel(70, 60, 1149, @"Change City Name"); if (stone.AllowHousing == true) { AddLabel(70, 90, 1149, @"Housing (ON)"); } else { AddLabel(70, 90, 1149, @"Housing (Off)"); } /*if ( stone.IsGuarded == true ) * AddLabel(70, 120, 1149, @"Guards (ON)"); * else * AddLabel(70, 120, 1149, @"Guards (Off)");*/ AddLabel(70, 150, 1149, @"Register City"); AddLabel(250, 60, 1149, @"Change City URL"); AddLabel(250, 90, 1149, @"View City Ban List"); AddLabel(250, 120, 1149, @"Ban Someone From City"); AddLabel(250, 150, 1149, @"Lift A Ban"); AddButton(30, 315, 4005, 4006, 9, GumpButtonType.Reply, 0); AddLabel(70, 315, 1149, @"Set City Rules"); AddPage(3); AddHtml(22, 27, 393, 21, @"<BASEFONT COLOR=WHITE><CENTER>Membership</CENTER></BASEFONT>", (bool)false, (bool)false); AddButton(30, 60, 4005, 4006, 11, GumpButtonType.Reply, 0); AddButton(30, 90, 4005, 4006, 12, GumpButtonType.Reply, 0); AddButton(30, 120, 4005, 4006, 13, GumpButtonType.Reply, 0); AddButton(30, 150, 4005, 4006, 14, GumpButtonType.Reply, 0); AddLabel(70, 60, 1149, @"Add Citizen"); AddLabel(70, 90, 1149, @"Remove Citizen"); AddLabel(70, 120, 1149, @"View Sponsored"); AddLabel(70, 150, 1149, @"View Citizen List"); AddLabel(250, 60, 1149, @"Citizens: " + stone.Citizens.Count.ToString()); AddLabel(250, 90, 1149, @"Sponsored: " + stone.Sponsored.Count.ToString()); AddButton(30, 180, 4005, 4006, 10, GumpButtonType.Reply, 0); AddLabel(70, 180, 1149, @"Change A Citizens Title"); AddLabel(70, 210, 1149, @"Select an Assistant Mayor"); AddButton(30, 210, 4005, 4006, 34, GumpButtonType.Reply, 0); AddLabel(250, 140, 1149, @"Current Assistant Mayor"); AddLabel(70, 240, 1149, @"Select a General"); AddButton(30, 240, 4005, 4006, 35, GumpButtonType.Reply, 0); AddLabel(250, 220, 1149, @"Current General"); if (m_Stone.AssistMayor != null) { AddLabel(250, 170, 1149, m_Stone.AssistMayor.Name); } else { AddLabel(250, 170, 1149, @"None"); } if (m_Stone.General != null) { AddLabel(250, 250, 1149, m_Stone.General.Name); } else { AddLabel(250, 250, 1149, @"None"); } AddPage(4); AddHtml(22, 27, 393, 21, @"<BASEFONT COLOR=WHITE><CENTER>Treasury</CENTER></BASEFONT>", (bool)false, (bool)false); AddButton(30, 60, 4005, 4006, 15, GumpButtonType.Reply, 0); AddButton(30, 90, 4005, 4006, 16, GumpButtonType.Reply, 0); AddLabel(70, 60, 1149, @"Deposit To Treasury"); AddLabel(70, 90, 1149, @"Withdraw From Treasury"); AddLabel(250, 60, 1149, @"Balance: " + stone.CityTreasury.ToString()); AddPage(5); AddHtml(22, 27, 393, 21, @"<BASEFONT COLOR=WHITE><CENTER>Taxes</CENTER></BASEFONT>", (bool)false, (bool)false); AddButton(30, 60, 4005, 4006, 17, GumpButtonType.Reply, 0); AddButton(30, 90, 4005, 4006, 18, GumpButtonType.Reply, 0); AddLabel(70, 60, 1149, @"Set Income Tax"); AddLabel(70, 90, 1149, @"Set Property Tax"); AddLabel(250, 60, 1149, @"Income Tax: " + stone.IncomeTax.ToString()); AddButton(30, 120, 4005, 4006, 19, GumpButtonType.Reply, 0); AddLabel(70, 120, 1149, @"Set Travel Tax"); AddLabel(250, 90, 1149, @"Property Tax: " + stone.HousingTax.ToString()); AddLabel(250, 120, 1149, @"Travel Tax: " + stone.TravelTax.ToString()); if (m_Stone.HasHealer == true) { AddButton(30, 150, 4005, 4006, 32, GumpButtonType.Reply, 0); AddButton(30, 180, 4005, 4006, 33, GumpButtonType.Reply, 0); AddLabel(70, 150, 1149, @"Set Resurrection Fee"); AddLabel(250, 150, 1149, @"Ressurrection Fee: " + stone.ResFee.ToString()); AddLabel(70, 180, 1149, @"Set Corpse Retrieval Fee"); AddLabel(250, 180, 1149, @"Retrieval Fee: " + stone.CorpseFee.ToString()); } AddPage(6); AddButton(30, 60, 4005, 4006, 20, GumpButtonType.Reply, 0); AddButton(30, 90, 4005, 4006, 21, GumpButtonType.Reply, 0); AddLabel(70, 60, 1149, @"Declare War!"); AddLabel(70, 90, 1149, @"View Wars Declared"); AddLabel(250, 60, 1149, @"Waring: " + stone.Waring.Count.ToString()); AddButton(30, 120, 4005, 4006, 22, GumpButtonType.Reply, 0); AddLabel(70, 120, 1149, @"View War Invitations"); AddLabel(250, 90, 1149, @"Wars Declared: " + stone.WarsDeclared.Count.ToString()); AddLabel(250, 120, 1149, @"War Invites: " + stone.WarsInvited.Count.ToString()); AddButton(30, 150, 4005, 4006, 23, GumpButtonType.Reply, 0); AddLabel(70, 150, 1149, @"Declare Peace"); AddButton(30, 180, 4005, 4006, 24, GumpButtonType.Reply, 0); AddLabel(70, 180, 1149, @"View Cities We Are At War With"); AddHtml(22, 27, 393, 21, @"<BASEFONT COLOR=WHITE><CENTER>War Department</CENTER></BASEFONT>", (bool)false, (bool)false); AddButton(30, 210, 4005, 4006, 25, GumpButtonType.Reply, 0); AddButton(30, 240, 4005, 4006, 26, GumpButtonType.Reply, 0); AddButton(30, 270, 4005, 4006, 27, GumpButtonType.Reply, 0); AddButton(30, 300, 4005, 4006, 28, GumpButtonType.Reply, 0); AddButton(30, 330, 4005, 4006, 29, GumpButtonType.Reply, 0); AddLabel(70, 210, 1149, @"Declare Allegiance"); AddLabel(70, 240, 1149, @"View Allegiances Proposed"); AddLabel(70, 270, 1149, @"View Allegiances Invited"); AddLabel(70, 300, 1149, @"Cancel An Allegiance"); AddLabel(70, 330, 1149, @"View Cities We Are Allied With"); AddLabel(250, 210, 1149, @"Allegiances: " + stone.Allegiances.Count.ToString()); AddLabel(250, 240, 1149, @"Allegiances Declared: " + stone.AllegiancesDeclared.Count.ToString()); AddLabel(250, 270, 1149, @"Allegiances Invites: " + stone.AllegiancesInvited.Count.ToString()); AddPage(7); AddHtml(22, 27, 393, 21, @"<BASEFONT COLOR=WHITE><CENTER>Misc.</CENTER></BASEFONT>", (bool)false, (bool)false); AddButton(30, 60, 4005, 4006, 30, GumpButtonType.Reply, 0); AddButton(30, 90, 4005, 4006, 31, GumpButtonType.Reply, 0); AddLabel(70, 60, 1149, @"Disband City"); AddLabel(70, 90, 1149, @"View Maintenance Report"); }
public ViewHousesGump(Mobile from, List <BaseHouse> list, BaseHouse sel) : base(50, 40) { m_From = from; m_List = list; m_Selection = sel; from.CloseGump <ViewHousesGump>(); AddPage(0); AddBackground(0, 0, 240, 360, 5054); AddBlackAlpha(10, 10, 220, 340); if (sel?.Deleted != false) { m_Selection = null; AddHtml(35, 15, 120, 20, Color("House Type", White)); if (list.Count == 0) { AddHtml(35, 40, 160, 40, Color("There were no houses found for that player.", White)); } AddImage(190, 17, 0x25EA); AddImage(207, 17, 0x25E6); int page = 0; for (int i = 0; i < list.Count; ++i) { if (i % 15 == 0) { if (page > 0) { AddButton(207, 17, 0x15E1, 0x15E5, 0, GumpButtonType.Page, page + 1); } AddPage(++page); if (page > 1) { AddButton(190, 17, 0x15E3, 0x15E7, 0, GumpButtonType.Page, page - 1); } } TextDefinition name = FindHouseName(list[i]); AddHtml(15, 40 + i % 15 * 20, 20, 20, Color($"{i + 1}.", White)); if (name.Number > 0) { AddHtmlLocalized(35, 40 + i % 15 * 20, 160, 20, name, White16); } else { AddHtml(35, 40 + i % 15 * 20, 160, 20, Color(name, White)); } AddButton(198, 39 + i % 15 * 20, 4005, 4007, i + 1); } } else { string location; Map map = sel.Map; string houseName = sel.Sign == null ? "An Unnamed House" : sel.Sign.GetName(); string owner = sel.Owner == null ? "nobody" : sel.Owner.Name; int xLong = 0, yLat = 0, xMins = 0, yMins = 0; bool xEast = false, ySouth = false; bool valid = Sextant.Format(sel.Location, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth); if (valid) { location = $"{yLat}° {yMins}'{(ySouth ? "S" : "N")}, {xLong}° {xMins}'{(xEast ? "E" : "W")}"; } else { location = "unknown"; } AddHtml(10, 15, 220, 20, Color(Center("House Properties"), White)); AddHtml(15, 40, 210, 20, Color("Facet:", White)); AddHtml(15, 40, 210, 20, Color(Right(map == null ? "(null)" : map.Name), White)); AddHtml(15, 60, 210, 20, Color("Location:", White)); AddHtml(15, 60, 210, 20, Color(Right(sel.Location.ToString()), White)); AddHtml(15, 80, 210, 20, Color("Sextant:", White)); AddHtml(15, 80, 210, 20, Color(Right(location), White)); AddHtml(15, 100, 210, 20, Color("Owner:", White)); AddHtml(15, 100, 210, 20, Color(Right(owner), White)); AddHtml(15, 120, 210, 20, Color("Name:", White)); AddHtml(15, 120, 210, 20, Color(Right(houseName), White)); AddHtml(15, 140, 210, 20, Color("Friends:", White)); AddHtml(15, 140, 210, 20, Color(Right(sel.Friends.Count.ToString()), White)); AddHtml(15, 160, 210, 20, Color("Co-Owners:", White)); AddHtml(15, 160, 210, 20, Color(Right(sel.CoOwners.Count.ToString()), White)); AddHtml(15, 180, 210, 20, Color("Bans:", White)); AddHtml(15, 180, 210, 20, Color(Right(sel.Bans.Count.ToString()), White)); AddHtml(15, 200, 210, 20, Color("Decays:", White)); AddHtml(15, 200, 210, 20, Color(Right(sel.CanDecay ? "Yes" : "No"), White)); AddHtml(15, 220, 210, 20, Color("Decay Level:", White)); AddHtml(15, 220, 210, 20, Color(Right(sel.DecayLevel.ToString()), White)); AddButton(15, 245, 4005, 4007, 1); AddHtml(50, 245, 120, 20, Color("Go to house", White)); AddButton(15, 265, 4005, 4007, 2); AddHtml(50, 265, 120, 20, Color("Open house menu", White)); AddButton(15, 285, 4005, 4007, 3); AddHtml(50, 285, 120, 20, Color("Demolish house", White)); AddButton(15, 305, 4005, 4007, 4); AddHtml(50, 305, 120, 20, Color("Refresh house", White)); } }
public override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; if (m_Book.Deleted || !from.InRange(m_Book.GetWorldLocation(), (Core.ML ? 3 : 1)) || !Multis.DesignContext.Check(from)) { m_Book.Openers.Remove(from); return; } int buttonID = info.ButtonID; //I ADDED Effects.PlaySound(from.Location, from.Map, 85); // from.SendMessage("netstate resonce - Cover all if buttons"); //I ADDED FIN if (buttonID == 1) // Rename book { if (!m_Book.IsLockedDown || from.AccessLevel >= AccessLevel.GameMaster) { from.SendLocalizedMessage(502414); // Please enter a title for the runebook: from.Prompt = new InternalPrompt(m_Book); } else { m_Book.Openers.Remove(from); from.SendLocalizedMessage(502413, null, 0x35); // That cannot be done while the book is locked down. } } else { buttonID -= 2; int index = buttonID / 6; int type = buttonID % 6; if (index >= 0 && index < m_Book.Entries.Count) { RunebookEntry e = (RunebookEntry)m_Book.Entries[index]; switch (type) { case 0: // Use charges { if (m_Book.CurCharges <= 0) { from.CloseGump(typeof(RunebookGump)); from.SendGump(new RunebookGump(from, m_Book)); from.SendLocalizedMessage(502412); // There are no charges left on that item. } else { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new RecallSpell(from, m_Book, e, m_Book).Cast(); m_Book.Openers.Remove(from); } break; } case 1: // Drop rune { if (!m_Book.IsLockedDown || from.AccessLevel >= AccessLevel.GameMaster) { m_Book.DropRune(from, e, index); from.CloseGump(typeof(RunebookGump)); if (!Core.ML) { from.SendGump(new RunebookGump(from, m_Book)); } } else { m_Book.Openers.Remove(from); from.SendLocalizedMessage(502413, null, 0x35); // That cannot be done while the book is locked down. } break; } case 2: // Set default { if (m_Book.CheckAccess(from)) { m_Book.Default = e; from.CloseGump(typeof(RunebookGump)); from.SendGump(new RunebookGump(from, m_Book)); from.SendLocalizedMessage(502417); // New default location set. } break; } case 3: // Recall { if (HasSpell(from, 31)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new RecallSpell(from, null, e, null).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } m_Book.Openers.Remove(from); break; } case 4: // Gate { if (HasSpell(from, 51)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new GateTravelSpell(from, null, e).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } m_Book.Openers.Remove(from); break; } case 5: // Sacred Journey { if (Core.AOS) { if (HasSpell(from, 209)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new SacredJourneySpell(from, null, e, null).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } } m_Book.Openers.Remove(from); break; } } } else { m_Book.Openers.Remove(from); } } }
public override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; from.SendSound(0x55); if (m_Book.Deleted || !from.InRange(m_Book.GetWorldLocation(), (Core.ML ? 3 : 1)) || !Multis.DesignContext.Check(from)) { m_Book.Openers.Remove(from); return; } int buttonID = info.ButtonID; if (buttonID == 1) // Rename book { if (!m_Book.IsLockedDown || from.AccessLevel >= AccessLevel.GameMaster) { from.SendLocalizedMessage(502414); // Please enter a title for the runebook: from.Prompt = new InternalPrompt(m_Book); } else { m_Book.Openers.Remove(from); from.SendLocalizedMessage(502413, null, 0x35); // That cannot be done while the book is locked down. } } else if (buttonID > 600 && buttonID < 700) { buttonID -= 602; int index = buttonID / 6; int type = buttonID % 6; if (index >= 0 && index < m_Book.Entries.Count) { RunebookEntry e = (RunebookEntry)m_Book.Entries[index]; switch (type) { case 1: // Nature Passage { if (from.Backpack.FindItemByType(typeof(NaturesPassagePotion)) == null) { from.SendMessage("You do not have that potion!"); } else { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new NaturesPassageSpell(from, null, e, null).Cast(); from.SendMessage("You empty a jar in the attempt."); from.AddToBackpack(new Jar()); (from.Backpack.FindItemByType(typeof(NaturesPassagePotion))).Consume(); } break; } case 2: // Mushroom Gateway { if (from.Backpack.FindItemByType(typeof(MushroomGatewayPotion)) == null) { from.SendMessage("You do not have that potion!"); } else { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new MushroomGatewaySpell(from, null, e).Cast(); from.SendMessage("You empty a jar in the attempt."); from.AddToBackpack(new Jar()); (from.Backpack.FindItemByType(typeof(MushroomGatewayPotion))).Consume(); } break; } case 3: // Demonic Fire { if (from.Backpack.FindItemByType(typeof(HellsGateScroll)) == null) { from.SendMessage("You do not have that potion!"); } else { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new HellsGateSpell(from, null, e, null).Cast(); from.SendMessage("You empty a jar in the attempt."); from.AddToBackpack(new Jar()); (from.Backpack.FindItemByType(typeof(HellsGateScroll))).Consume(); } break; } case 4: // Black Gate { if (from.Backpack.FindItemByType(typeof(GraveyardGatewayScroll)) == null) { from.SendMessage("You do not have that potion!"); } else { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new UndeadGraveyardGatewaySpell(from, null, e).Cast(); from.SendMessage("You empty a jar in the attempt."); from.AddToBackpack(new Jar()); (from.Backpack.FindItemByType(typeof(GraveyardGatewayScroll))).Consume(); } break; } case 5: // Astral Travel { if (HasSpell(from, 251)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new AstralTravel(from, null, e, null).Cast(); } else { from.SendMessage("You do not have that skill!"); } m_Book.Openers.Remove(from); break; } } } } else if (buttonID > 700) { buttonID -= 702; int index = buttonID / 6; int type = buttonID % 6; if (index >= 0 && index < m_Book.Entries.Count) { RunebookEntry e = (RunebookEntry)m_Book.Entries[index]; switch (type) { case 1: // Ethereal Travel { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new ResearchEtherealTravel(from, null, e, null).Cast(); m_Book.Openers.Remove(from); break; } } } else { m_Book.Openers.Remove(from); } } else { buttonID -= 2; int index = buttonID / 6; int type = buttonID % 6; if (index >= 0 && index < m_Book.Entries.Count) { RunebookEntry e = (RunebookEntry)m_Book.Entries[index]; switch (type) { case 0: // Use charges { if (m_Book.CurCharges <= 0) { from.CloseGump(typeof(RunebookGump)); from.SendGump(new RunebookGump(from, m_Book)); from.SendLocalizedMessage(502412); // There are no charges left on that item. } else { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new RecallSpell(from, m_Book, e, m_Book).Cast(); m_Book.Openers.Remove(from); } break; } case 1: // Drop rune { if (!m_Book.IsLockedDown || from.AccessLevel >= AccessLevel.GameMaster) { m_Book.DropRune(from, e, index); from.CloseGump(typeof(RunebookGump)); if (!Core.ML) { from.SendGump(new RunebookGump(from, m_Book)); } } else { m_Book.Openers.Remove(from); from.SendLocalizedMessage(502413, null, 0x35); // That cannot be done while the book is locked down. } break; } case 2: // Set default { if (m_Book.CheckAccess(from)) { m_Book.Default = e; from.CloseGump(typeof(RunebookGump)); from.SendGump(new RunebookGump(from, m_Book)); from.SendLocalizedMessage(502417); // New default location set. } break; } case 3: // Recall { if (HasSpell(from, 31)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new RecallSpell(from, null, e, null).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } m_Book.Openers.Remove(from); break; } case 4: // Gate { if (HasSpell(from, 51)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new GateTravelSpell(from, null, e).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } m_Book.Openers.Remove(from); break; } case 5: // Sacred Journey { if (Core.AOS) { if (HasSpell(from, 209)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new SacredJourneySpell(from, null, e, null).Cast(); } else { from.SendLocalizedMessage(500015); // You do not have that spell! } } m_Book.Openers.Remove(from); break; } } } else { m_Book.Openers.Remove(from); } } }
public override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; if (m_Book.Deleted || !from.InRange(m_Book.GetWorldLocation(), (Core.ML ? 3 : 1)) || !Multis.DesignContext.Check(from)) { m_Book.Openers.Remove(from); return; } int buttonID = info.ButtonID; if (buttonID == 1) // Rename book { if (!m_Book.IsLockedDown || from.AccessLevel >= AccessLevel.GameMaster) { from.SendMessage("Digite o Titulo do Book"); // Please enter a title for the runebook: from.Prompt = new InternalPrompt(m_Book); } else { m_Book.Openers.Remove(from); from.SendMessage("Voce nao pode fazer isto com o livro travado."); // That cannot be done while the book is locked down. } } else { buttonID -= 2; int index = buttonID / 6; int type = buttonID % 6; if (index >= 0 && index < m_Book.Entries.Count) { RunebookEntry e = (RunebookEntry)m_Book.Entries[index]; switch (type) { case 0: // Use charges { Item blackPearl = from.Backpack.FindItemByType(typeof(BlackPearl), true); Item bloodmoss = from.Backpack.FindItemByType(typeof(Bloodmoss), true); Item mandrakeRoot = from.Backpack.FindItemByType(typeof(MandrakeRoot), true); if (blackPearl == null || bloodmoss == null || mandrakeRoot == null) { from.SendMessage("Voce nao tem reagentes suficientes"); } else { if (HasSpell(from, 31)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new RecallSpell(from, null, e, null).Cast(); return; } else { from.SendLocalizedMessage(500015); // You do not have that spell! return; } } if (m_Book.CurCharges <= 0) { from.CloseGump(typeof(RunebookGump)); from.SendGump(new RunebookGump(from, m_Book)); from.SendMessage("O item esta sem cargas"); // There are no charges left on that item. } else { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new RecallSpell(from, m_Book, e, m_Book).Cast(); m_Book.Openers.Remove(from); } break; } case 1: // Drop rune { if (!m_Book.IsLockedDown || from.AccessLevel >= AccessLevel.GameMaster) { m_Book.DropRune(from, e, index); from.CloseGump(typeof(RunebookGump)); if (!Core.ML) { from.SendGump(new RunebookGump(from, m_Book)); } } else { m_Book.Openers.Remove(from); from.SendMessage("Voce nao pode fazer isto com o livro travado"); // That cannot be done while the book is locked down. } break; } case 2: // Set default { if (m_Book.CheckAccess(from)) { m_Book.Default = e; from.CloseGump(typeof(RunebookGump)); from.SendGump(new RunebookGump(from, m_Book)); from.SendMessage("Nova runa definida como padrao"); // New default location set. } break; } case 3: // Recall { if (HasSpell(from, 31)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new RecallSpell(from, null, e, null).Cast(); } else { from.SendMessage("Voce nao tem esta magia"); // You do not have that spell! } m_Book.Openers.Remove(from); break; } case 4: // Gate { if (HasSpell(from, 51)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new GateTravelSpell(from, null, e).Cast(); } else { from.SendMessage("Voce nao tem esta magia"); // You do not have that spell! } m_Book.Openers.Remove(from); break; } case 5: // Sacred Journey { if (Core.AOS) { if (HasSpell(from, 209)) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); from.SendMessage(location); } m_Book.OnTravel(); new SacredJourneySpell(from, null, e, null).Cast(); } else { from.SendMessage("Voce nao tem esta magia"); // You do not have that spell! } } m_Book.Openers.Remove(from); break; } } } else { m_Book.Openers.Remove(from); } } }
private void AddDetails(int index, int half) { // Use charge button AddButton(130 + (half * 160), 65, 2103, 2104, 2 + (index * 6) + 0, GumpButtonType.Reply, 0); string desc; int hue; if (index < m_Book.Entries.Count) { RunebookEntry e = (RunebookEntry)m_Book.Entries[index]; desc = GetName(e.Description); hue = GetMapHue(e.Map); // Location labels int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { AddLabel(135 + (half * 160), 80, 0, String.Format("{0}° {1}'{2}", yLat, yMins, ySouth ? "S" : "N")); AddLabel(135 + (half * 160), 95, 0, String.Format("{0}° {1}'{2}", xLong, xMins, xEast ? "E" : "W")); } // Drop rune button AddButton(135 + (half * 160), 115, 2437, 2438, 2 + (index * 6) + 1, GumpButtonType.Reply, 0); AddHtmlLocalized(150 + (half * 160), 115, 100, 18, 1011298, false, false); // Drop rune // Set as default button int defButtonID = e != m_Book.Default ? 2361 : 2360; AddButton(160 + (half * 140), 20, defButtonID, defButtonID, 2 + (index * 6) + 2, GumpButtonType.Reply, 0); AddHtmlLocalized(175 + (half * 140), 15, 100, 18, 1011300, false, false); // Set default if (Core.AOS) { AddButton(135 + (half * 160), 140, 2103, 2104, 2 + (index * 6) + 3, GumpButtonType.Reply, 0); AddHtmlLocalized(150 + (half * 160), 136, 110, 20, 1062722, false, false); // Recall AddButton(135 + (half * 160), 158, 2103, 2104, 2 + (index * 6) + 4, GumpButtonType.Reply, 0); AddHtmlLocalized(150 + (half * 160), 154, 110, 20, 1062723, false, false); // Gate Travel AddButton(135 + (half * 160), 176, 2103, 2104, 2 + (index * 6) + 5, GumpButtonType.Reply, 0); AddHtmlLocalized(150 + (half * 160), 172, 110, 20, 1062724, false, false); // Sacred Journey } else { // Recall button AddButton(135 + (half * 160), 140, 2271, 2271, 2 + (index * 6) + 3, GumpButtonType.Reply, 0); // Gate button AddButton(205 + (half * 160), 140, 2291, 2291, 2 + (index * 6) + 4, GumpButtonType.Reply, 0); } } else { desc = "Empty"; hue = 0; } // Description label AddLabelCropped(145 + (half * 160), 60, 115, 17, hue, desc); }
// button IDs: //1 - rename book //200 - drop rune //10 - recall (charge) //50 - recall (spell) //100 - gate travel //75 - sacred journey //300 - set default //0 - close gump public void PrecompileStringTable() { // here's the order on OSI: // first two strings are "old" unlocalized version: Intern("Charges", true); // 0 Intern("Max Charges", true); // 1 // Next 16 entries are Location Values for (int i = 0; i < 16; ++i) { string desc; if (i < m_Book.Entries.Count) { desc = GetName(((RunebookEntry)m_Book.Entries[i]).Description); } else { desc = "Empty"; } Intern(desc, false); } // Next 2 entries are charge / max charge Intern(m_Book.CurCharges.ToString(), false); Intern(m_Book.MaxCharges.ToString(), false); // then old unused "drop rune" etc entries Intern("Drop Rune", true); Intern("Rename Book", true); Intern("Set Default", true); // 22 // then location values, one entry has two values for (int i = 0; i < 16; ++i) { if (i < m_Book.Entries.Count) { RunebookEntry e = (RunebookEntry)m_Book.Entries[i]; // Location labels int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { Intern(String.Format("{0}� {1}'{2}", yLat, yMins, ySouth ? "S" : "N"), false); Intern(String.Format("{0}� {1}'{2}", xLong, xMins, xEast ? "E" : "W"), false); } else { Intern("Nowhere", false); Intern("Nowhere", false); } } else { Intern("Nowhere", false); Intern("Nowhere", false); } } }
public ViewHousesGump(Mobile from, List <BaseHouse> list, BaseHouse sel) : base(50, 40) { m_From = from; m_List = list; m_Selection = sel; from.CloseGump(typeof(ViewHousesGump)); AddPage(0); AddBackground(0, 0, 240, 360, 5054); AddBlackAlpha(10, 10, 220, 340); if (sel == null || sel.Deleted) { m_Selection = null; AddHtml(35, 15, 120, 20, Color("House Type", White), false, false); if (list.Count == 0) { AddHtml(35, 40, 160, 40, Color("There were no houses found for that player.", White), false, false); } AddImage(190, 17, 0x25EA); AddImage(207, 17, 0x25E6); int page = 0; for (int i = 0; i < list.Count; ++i) { if ((i % 15) == 0) { if (page > 0) { AddButton(207, 17, 0x15E1, 0x15E5, 0, GumpButtonType.Page, page + 1); } AddPage(++page); if (page > 1) { AddButton(190, 17, 0x15E3, 0x15E7, 0, GumpButtonType.Page, page - 1); } } object name = FindHouseName(list[i]); AddHtml(15, 40 + ((i % 15) * 20), 20, 20, Color(string.Format("{0}.", i + 1), White), false, false); if (name is int) { AddHtmlLocalized(35, 40 + ((i % 15) * 20), 160, 20, (int)name, White16, false, false); } else if (name is string) { AddHtml(35, 40 + ((i % 15) * 20), 160, 20, Color((string)name, White), false, false); } AddButton(198, 39 + ((i % 15) * 20), 4005, 4007, i + 1, GumpButtonType.Reply, 0); } } else { string houseName, owner, location; Map map = sel.Map; houseName = (sel.Sign == null) ? "An Unnamed House" : sel.Sign.GetName(); owner = (sel.Owner == null) ? "nobody" : sel.Owner.Name; int xLong = 0, yLat = 0, xMins = 0, yMins = 0; bool xEast = false, ySouth = false; bool valid = Sextant.Format(sel.Location, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth); if (valid) { location = string.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); } else { location = "unknown"; } AddHtml(10, 15, 220, 20, Color(Center("House Properties"), White), false, false); AddHtml(15, 40, 210, 20, Color("Facet:", White), false, false); AddHtml(15, 40, 210, 20, Color(Right(map == null ? "(null)" : map.Name), White), false, false); AddHtml(15, 60, 210, 20, Color("Location:", White), false, false); AddHtml(15, 60, 210, 20, Color(Right(sel.Location.ToString()), White), false, false); AddHtml(15, 80, 210, 20, Color("Sextant:", White), false, false); AddHtml(15, 80, 210, 20, Color(Right(location), White), false, false); AddHtml(15, 100, 210, 20, Color("Owner:", White), false, false); AddHtml(15, 100, 210, 20, Color(Right(owner), White), false, false); AddHtml(15, 120, 210, 20, Color("Name:", White), false, false); AddHtml(15, 120, 210, 20, Color(Right(houseName), White), false, false); AddHtml(15, 140, 210, 20, Color("Friends:", White), false, false); AddHtml(15, 140, 210, 20, Color(Right(sel.Friends.Count.ToString()), White), false, false); AddHtml(15, 160, 210, 20, Color("Co-Owners:", White), false, false); AddHtml(15, 160, 210, 20, Color(Right(sel.CoOwners.Count.ToString()), White), false, false); AddHtml(15, 180, 210, 20, Color("Bans:", White), false, false); AddHtml(15, 180, 210, 20, Color(Right(sel.Bans.Count.ToString()), White), false, false); AddHtml(15, 200, 210, 20, Color("Decays:", White), false, false); AddHtml(15, 200, 210, 20, Color(Right(sel.CanDecay ? "Yes" : "No"), White), false, false); AddHtml(15, 220, 210, 20, Color("Decay Level:", White), false, false); AddHtml(15, 220, 210, 20, Color(Right(sel.DecayLevel.ToString()), White), false, false); AddButton(15, 245, 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtml(50, 245, 120, 20, Color("Go to house", White), false, false); AddButton(15, 265, 4005, 4007, 2, GumpButtonType.Reply, 0); AddHtml(50, 265, 120, 20, Color("Open house menu", White), false, false); AddButton(15, 285, 4005, 4007, 3, GumpButtonType.Reply, 0); AddHtml(50, 285, 120, 20, Color("Demolish house", White), false, false); AddButton(15, 305, 4005, 4007, 4, GumpButtonType.Reply, 0); AddHtml(50, 305, 120, 20, Color("Refresh house", White), false, false); } }
public static void TryPirateBlab(Mobile from, Mobile npc) { if (m_PirateBlabTable.ContainsKey(from) && m_PirateBlabTable[from] > DateTime.UtcNow || BountyQuestSpawner.Bounties.Count <= 0) { return; } //Make of list of bounties on their map List <Mobile> bounties = new List <Mobile>(); foreach (Mobile mob in BountyQuestSpawner.Bounties.Keys) { if (mob.Map == from.Map && mob is PirateCaptain && !bounties.Contains(mob)) { bounties.Add(mob); } } if (bounties.Count == 0) { return; } Mobile bounty = bounties[Utility.Random(bounties.Count)]; if (bounty != null) { PirateCaptain capt = (PirateCaptain)bounty; int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; Point3D loc = capt.Location; Map map = capt.Map; string locArgs; //string nameArgs; string combine; if (Sextant.Format(loc, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { locArgs = String.Format("{0}°{1}'{2},{3}°{4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); } else { locArgs = "?????"; } //if (capt.PirateName > -1) // nameArgs = String.Format("#{0} #{1} #{2}", capt.Adjective, capt.Noun, capt.PirateName); //else // nameArgs = String.Format("#{0} #{1} {2}", capt.Adjective, capt.Noun, capt.Name); combine = String.Format("{0}\t{1}", capt.PirateName > -1 ? String.Format("#{0}", capt.PirateName) : capt.Name, locArgs); int cliloc = Utility.RandomMinMax(1149856, 1149865); npc.SayTo(from, cliloc, combine); m_PirateBlabTable[from] = DateTime.UtcNow + BlabDuration; } }