public override void OnResponse(Server.Network.NetState sender, RelayInfo info) { m_Mobile.Frozen = false; int buttonID = info.ButtonID - 1; if (buttonID > 0) { int index = buttonID / 4; int type = buttonID % 4; TownEntry[] table = null; int price = 0; switch (type) { case 1: { table = m_GuardedTowns; price = m_Stone.GuardedPrice; break; } case 2: { table = m_UnguardedTowns; price = m_Stone.UnguardedPrice; break; } case 3: { table = m_NeutralTowns; price = m_Stone.NeutralPrice; break; } } if (index < table.Length) { TownEntry te = (TownEntry)table.GetValue(index); var timer = new TravelTimer(m_Mobile, te.GetLocation(), price); timer.Start(); m_Mobile.BeginAction(timer); m_Mobile.RevealingAction(); } } }
private void ListTable(TownEntry[] table, int x, int type) { int offset = 0; for (int i = 0; i < table.Length; i++) { TownEntry te = (TownEntry)table.GetValue(i); if (te != null) { AddLabel(x + 23, 85 + (i * 20) + offset, 0x481, te.Name); AddButton(x + 5, 88 + (i * 20) + offset, 0x15E1, 0x15E5, GetButtonID(type, i), GumpButtonType.Reply, 0); } } }