コード例 #1
0
        public RecallSpell(Mobile caster, Item scroll, RunebookEntry entry, Runebook book, RuneTomeRuneEntry recallRuneEntry, RuneTome runeTome) : base(caster, scroll, m_Info)
        {
            m_Entry = entry;
            m_Book  = book;

            m_RunebookRuneEntry = recallRuneEntry;
            m_RuneTome          = runeTome;
        }
コード例 #2
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (o is RecallRune)
                {
                    RecallRune rune = (RecallRune)o;

                    if (rune.Marked)
                    {
                        m_Owner.Effect(rune.Target, rune.TargetMap, true);
                    }

                    else
                    {
                        from.SendLocalizedMessage(501805);                           // That rune is not yet marked.
                    }
                }

                else if (o is Runebook)
                {
                    RunebookEntry e = ((Runebook)o).Default;

                    if (e != null)
                    {
                        m_Owner.Effect(e.Location, e.Map, true);
                    }

                    else
                    {
                        from.SendLocalizedMessage(502354);                           // Target is not marked.
                    }
                }

                else if (o is RuneTome)
                {
                    RuneTome runeTome = o as RuneTome;

                    RuneTomeRuneEntry defaultRuneEntry = null;

                    foreach (RuneTomeRuneEntry entry in runeTome.m_RecallRuneEntries)
                    {
                        if (entry == null)
                        {
                            continue;
                        }

                        if (entry.m_IsDefaultRune)
                        {
                            defaultRuneEntry = entry;
                            break;
                        }
                    }

                    if (defaultRuneEntry == null)
                    {
                        if (runeTome.m_RecallRuneEntries.Count > 0)
                        {
                            defaultRuneEntry = runeTome.m_RecallRuneEntries[0];
                        }

                        else
                        {
                            from.SendMessage("There are no recall runes stored within this rune tome.");
                            return;
                        }
                    }

                    if (defaultRuneEntry != null)
                    {
                        m_Owner.Effect(defaultRuneEntry.m_Target, defaultRuneEntry.m_TargetMap, true);
                    }
                }

                else if (o is ShipRune)
                {
                    ShipRune rune = (ShipRune)o;
                    BaseShip m_Ship;

                    if (rune.m_Ship != null)
                    {
                        m_Ship = rune.m_Ship;

                        if (m_Ship.Deleted)
                        {
                            from.SendMessage("The ship bound to this rune no longer exists.");
                            return;
                        }

                        if (m_Ship.Owner == from)
                        {
                            m_Ship.TransferEmbarkedMobile(from);
                            m_Owner.Effect(m_Ship.GetRandomEmbarkLocation(true), m_Ship.Map, false);
                        }
                        else
                        {
                            from.SendMessage("You must be the owner of that ship to use this rune.");
                        }
                    }

                    else
                    {
                        from.SendMessage("The ship bound to this rune no longer exists.");
                    }
                }

                else if (o is HouseRaffleDeed && ((HouseRaffleDeed)o).ValidLocation())
                {
                    HouseRaffleDeed deed = (HouseRaffleDeed)o;

                    m_Owner.Effect(deed.PlotLocation, deed.PlotFacet, true);
                }

                else
                {
                    from.Send(new MessageLocalized(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357, from.Name, "")); // I can not recall from that object.
                }
            }
コード例 #3
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (o is RecallRune)
                {
                    RecallRune rune = (RecallRune)o;

                    if (rune.Marked)
                    {
                        m_Owner.Effect(rune.Target, rune.TargetMap, true);
                    }

                    else
                    {
                        from.SendLocalizedMessage(501803);                           // That rune is not yet marked.
                    }
                }

                else if (o is Runebook)
                {
                    RunebookEntry e = ((Runebook)o).Default;

                    if (e != null)
                    {
                        m_Owner.Effect(e.Location, e.Map, true);
                    }

                    else
                    {
                        from.SendLocalizedMessage(502354);                           // Target is not marked.
                    }
                }

                else if (o is Key && ((Key)o).KeyValue != 0 && ((Key)o).Link is BaseShip)
                {
                    //	BaseShip ship = ((Key)o).Link as BaseShip;

                    //	if ( !ship.Deleted && ship.CheckKey( ((Key)o).KeyValue ) )
                    //		m_Owner.Effect( ship.GetMarkedLocation(), ship.Map, false );
                    //	else

                    from.Send(new MessageLocalized(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 501030, from.Name, ""));                         // I can not gate travel from that object.
                }

                else if (o is RuneTome)
                {
                    RuneTome runeTome = o as RuneTome;

                    RuneTomeRuneEntry defaultRuneEntry = null;

                    foreach (RuneTomeRuneEntry entry in runeTome.m_RecallRuneEntries)
                    {
                        if (entry == null)
                        {
                            continue;
                        }

                        if (entry.m_IsDefaultRune)
                        {
                            defaultRuneEntry = entry;
                            break;
                        }
                    }

                    if (defaultRuneEntry == null)
                    {
                        if (runeTome.m_RecallRuneEntries.Count > 0)
                        {
                            defaultRuneEntry = runeTome.m_RecallRuneEntries[0];
                        }

                        else
                        {
                            from.SendMessage("There are no recall runes stored within this rune tome.");
                            return;
                        }
                    }

                    if (defaultRuneEntry != null)
                    {
                        m_Owner.Effect(defaultRuneEntry.m_Target, defaultRuneEntry.m_TargetMap, true);
                    }
                }

                else if (o is HouseRaffleDeed && ((HouseRaffleDeed)o).ValidLocation())
                {
                    HouseRaffleDeed deed = (HouseRaffleDeed)o;

                    m_Owner.Effect(deed.PlotLocation, deed.PlotFacet, true);
                }

                else
                {
                    from.Send(new MessageLocalized(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 501030, from.Name, ""));                         // I can not gate travel from that object.
                }
            }