public StuckMenu(Mobile beholder, Mobile beheld, bool markUse) : base(150, 50) { m_Sender = beholder; m_Mobile = beheld; m_MarkUse = markUse; Closable = false; Dragable = false; Disposable = false; AddBackground(0, 0, 270, 320, 2600); AddHtmlLocalized(50, 20, 250, 35, 1011027, false, false); // Chose a town: StuckMenuEntry[] entries = IsInSecondAgeArea(beheld) ? m_T2AEntries : m_Entries; for (int i = 0; i < entries.Length; i++) { StuckMenuEntry entry = entries[i]; AddButton(50, 55 + 35 * i, 208, 209, i + 1, GumpButtonType.Reply, 0); AddHtmlLocalized(75, 55 + 35 * i, 335, 40, entry.Name, false, false); } AddButton(55, 263, 4005, 4007, 0, GumpButtonType.Reply, 0); AddHtmlLocalized(90, 265, 200, 35, 1011012, false, false); // CANCEL }
public TeleportTimer(Mobile mobile, StuckMenuEntry destination, TimeSpan delay) : base(TimeSpan.Zero, TimeSpan.FromSeconds(1.0)) { Priority = TimerPriority.TwoFiftyMS; m_Mobile = mobile; m_Destination = destination; m_End = DateTime.UtcNow + delay; }
private void Teleport(StuckMenuEntry entry) { if (m_MarkUse) { m_Mobile.SendLocalizedMessage(1010589); // You will be teleported within the next two minutes. new TeleportTimer(m_Mobile, entry, TimeSpan.FromSeconds(10.0 + (Utility.RandomDouble() * 110.0))).Start(); if (m_Mobile is PlayerMobile) { ((PlayerMobile)m_Mobile).UsedStuckMenu(); } } else { new TeleportTimer(m_Mobile, entry, TimeSpan.Zero).Start(); } }