public override void OnCancel(Mobile from) { if (m_Entry != null) { m_Owner.RemoveEntry(m_Entry); } if (m_Lines.Count > 0) { m_Owner.AddEntry(m_Lines.ToArray(), m_Duration); from.SendMessage("Message has been set."); } else { if (m_Entry != null) { from.SendMessage("Message deleted."); } else { from.SendLocalizedMessage(502980); // Message entry cancelled. } } from.SendGump(new TownCrierGump(from, m_Owner)); }
public override void OnCancel(Mobile from) { if (m_Entry != null) { try { if (from.AccessLevel < AccessLevel.GameMaster) { from.SendMessage("A partial refund was delivered to your bank account."); from.BankBox.DropItem(new Gold(m_Entry.CalculateCost())); } } catch { from.SendMessage("An error occurred while trying to put a refund in your bank account. Contact a Game Master immediately."); } m_Owner.RemoveEntry(m_Entry); } if (m_Lines.Count > 0) { if (from.AccessLevel < AccessLevel.GameMaster) { TownCrierEntry tce = new TownCrierEntry((string[])m_Lines.ToArray(typeof(string)), m_Duration, from.Serial); TownCrier.AddUnpaidEntry(from, tce); from.SendMessage("This message will cost {0}gp. Drag gold or a check onto a Town Crier to pay.", tce.CalculateCost()); } else { m_Owner.AddEntry(new TownCrierEntry((string[])m_Lines.ToArray(typeof(string)), m_Duration, from.Serial)); from.SendMessage("Message has been set."); } } else { if (m_Entry != null) { from.SendMessage("Message deleted."); } else { from.SendLocalizedMessage(502980); // Message entry cancelled. } } from.SendGump(new TownCrierGump(from, m_Owner)); }