Exemple #1
0
        public void Target(RecallRune rune)
        {
            // IPY : Protection for DungeonMiningSystem.
            if (Caster.Map == Map.Ilshenar)
            {
                Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work...
                return;
            }

            WarpBlockerTotem recallBlocker = WarpBlockerTotem.RecallBlockerTriggered(Caster, WarpBlockerTotem.MovementMode.Mark, Caster.Location, Caster.Map);

            if (recallBlocker != null)
            {
                if (recallBlocker.PreventMarkResponse != "")
                {
                    Caster.SendMessage(recallBlocker.PreventMarkResponse);
                }
                else
                {
                    Caster.SendMessage(WarpBlockerTotem.DefaultMarkResponse);
                }
            }

            else if (!Caster.CanSee(rune))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }

            else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.Mark))
            {
                Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work...
            }

            else if (Caster.Map != Map.Felucca)
            {
                Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work...
            }

            else if (SpellHelper.CheckMulti(Caster.Location, Caster.Map))
            {
                Caster.SendLocalizedMessage(501942); // That location is blocked.
            }

            else if (SpellHelper.IsSolenHiveLoc(Caster.Location))
            {
                Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work...
            }

            else if (SpellHelper.IsStarRoom(Caster.Location))
            {
                Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work...
            }

            else if (SpellHelper.IsWindLoc(Caster.Location))
            {
                Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work...
            }

            else if (BaseBoat.FindBoatAt(Caster.Location, Caster.Map) != null)
            {
                Caster.SendMessage("You cannot mark a location at sea.");
            }

            else if (CheckSequence())
            {
                rune.Mark(Caster);

                int spellHue = 0; // PlayerEnhancementPersistance.GetSpellHueFor(Caster, HueableSpell.Mark);

                Caster.PlaySound(0x1FA);
                Effects.SendLocationEffect(Caster, Caster.Map, 14201, 16, spellHue, 0);
            }

            FinishSequence();
        }
Exemple #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 BoatRune)
                {
                    BoatRune rune = (BoatRune)o;
                    BaseBoat m_Boat;

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

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

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

                    else
                    {
                        from.SendMessage("The boat 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.
                }
            }