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; 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); } } }
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); } } }
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 override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; if (m_Book.Deleted || !from.InRange(m_Book.GetWorldLocation(), 1)) { 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 { 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 <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 = $"{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 <RunebookGump>(); ; 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 <RunebookGump>(); ; from.SendGump(new RunebookGump(from, m_Book)); from.SendLocalizedMessage(502417); // New default location set. } break; } case 3: // Recall { if (HasSpell(from, SpellEntry.Recall)) { 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 = $"{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, SpellEntry.GateTravel)) { 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 = $"{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 { m_Book.Openers.Remove(from); break; } } } else { m_Book.Openers.Remove(from); } } }