예제 #1
0
            public override void OnResponse(Mobile from, string text)
            {
                if (m_Book.Deleted)
                {
                    return;
                }

                if (!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 (m_Book.CheckAccess(from))
                {
                    m_Book.Description = Utility.FixHtml(text.Trim());

                    from.CloseGump(typeof(RunebookGump));
                    from.SendGump(new RunebookGump(from, m_Book));

                    from.SendMessage("The book's title has been changed.");
                }
                else
                {
                    from.SendLocalizedMessage(502416);                       // That cannot be done while the book is locked down.
                }
            }
예제 #2
0
            public override void OnResponse(Mobile from, string text)
            {
                if (m_Book.Deleted || !from.InRange(m_Book.GetWorldLocation(), (Core.ML ? 3 : 1)))
                {
                    return;
                }

                if (m_Book.CheckAccess(from))
                {
                    m_Book.Description = Utility.FixHtml(text.Trim());

                    from.CloseGump(typeof(RunebookGump));
                    from.SendGump(new RunebookGump(from, m_Book));

//I ADDED
                    Effects.PlaySound(from.Location, from.Map, 85);
//					from.SendMessage("When Use Title of book IS changed.");
//I ADDED FIN
                    from.SendMessage("The book's title has been changed.");
                }
                else
                {
                    m_Book.Openers.Remove(from);

                    from.SendLocalizedMessage(502416);                       // That cannot be done while the book is locked down.
                }
            }
예제 #3
0
            public override void OnResponse(Mobile from, string text)
            {
                if (m_Book.Deleted || !from.InRange(m_Book.GetWorldLocation(), 2))
                {
                    return;
                }

                if (m_Book.CheckAccess(from))
                {
                    m_Book.Description = Utility.FixHtml(text.Trim());

                    from.CloseGump(typeof(RunebookGump));
                    from.SendGump(new RunebookGump(from, m_Book));

                    from.SendMessage("The book's title has been changed.");
                }
                else
                {
                    m_Book.Openers.Remove(from);
                    if (from.Player)
                    {
                        ((Mobiles.PlayerMobile)from).CloseRunebookGump = false;
                    }

                    from.SendLocalizedMessage(502416);                       // That cannot be done while the book is locked down.
                }
            }
예제 #4
0
            public override void OnResponse(Mobile from, string text)
            {
                if (m_Book.Deleted || !from.InRange(m_Book.GetWorldLocation(), 1))
                {
                    return;
                }

                if (m_Book.CheckAccess(from))
                {
                    m_Book.Description = Utility.FixHtml(text.Trim());

                    from.CloseGump <RunebookGump>();
                    from.SendGump(new RunebookGump(from, m_Book));

                    from.SendMessage("The book's title has been changed.");
                }
                else
                {
                    from.SendLocalizedMessage(502416);                       // That cannot be done while the book is locked down.
                }
            }
예제 #5
0
            public override void OnResponse(Mobile from, string text)
            {
                if (m_Book.Deleted || !from.InRange(m_Book.GetWorldLocation(), 3))
                {
                    return;
                }

                if (m_Book.CheckAccess(from))
                {
                    m_Book.Description = Utility.FixHtml(text.Trim());

                    from.CloseGump(typeof(RunebookGump));
                    from.SendGump(new RunebookGump(from, m_Book));

                    from.SendLocalizedMessage(1041531); // You have changed the title of the rune book.
                }
                else
                {
                    m_Book.Openers.Remove(from);

                    from.SendLocalizedMessage(502416); // That cannot be done while the book is locked down.
                }
            }
예제 #6
0
            public override void OnResponse(Mobile from, string text)
            {
                if (m_Book.Deleted || !from.InRange(m_Book.GetWorldLocation(), (Core.ML ? 3 : 1)))
                {
                    return;
                }

                if (m_Book.CheckAccess(from))
                {
                    m_Book.Description = Utility.FixHtml(text.Trim());

                    from.CloseGump(typeof(RunebookGump));
                    from.SendGump(new RunebookGump(from, m_Book));

                    from.SendMessage("Le livre de runes a été renommé.");
                }
                else
                {
                    m_Book.Openers.Remove(from);

                    from.SendMessage("Vous ne pouvez faire cela lorsque le livre est fixé au sol");                       // That cannot be done while the book is locked down.
                }
            }
예제 #7
0
            public override void OnResponse(Mobile from, string text)
            {
                if (m_Book.Deleted || !from.InRange(m_Book.GetWorldLocation(), (Core.ML ? 3 : 1)))
                {
                    return;
                }

                if (m_Book.CheckAccess(from))
                {
                    m_Book.Description = Utility.FixHtml(text.Trim());

                    from.CloseGump(typeof(RunebookGump));
                    from.SendGump(new RunebookGump(from, m_Book));

                    from.SendMessage("O Titulo do Book foi alterado.");
                }
                else
                {
                    m_Book.Openers.Remove(from);

                    from.SendMessage("Voce nao pode fazer isto com Book travado.");                       // That cannot be done while the book is locked down.
                }
            }
예제 #8
0
        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);
                }
            }
        }
예제 #9
0
        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);
                }
            }
        }
예제 #10
0
        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);
                }
            }
        }
예제 #11
0
        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;
                    }
                    }
                }
            }
        }
예제 #12
0
        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);
                }
            }
        }
예제 #13
0
        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;
                    }
                    }
                }
            }
        }
예제 #14
0
        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);
                }
            }
        }