示例#1
0
        public void Target(RecallRune rune)
        {
            if (!Caster.CanSee(rune))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.Mark))
            {
            }
            else if (SpellHelper.CheckMulti(Caster.Location, Caster.Map, !Core.AOS))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (!rune.IsChildOf(Caster.Backpack))
            {
                Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1062422);                   // You must have this rune in your backpack in order to mark it.
            }
            else if (CheckSequence())
            {
                rune.Mark(Caster);

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

            FinishSequence();
        }
示例#2
0
        public void Target(RecallRune rune)
        {
            BaseBoat boat = BaseBoat.FindBoatAt(Caster.Location, Caster.Map);

            if (!Caster.CanSee(rune))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.Mark))
            {
            }
            else if (boat == null && SpellHelper.CheckMulti(Caster.Location, Caster.Map, false))
            {
                Caster.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if (boat != null && !(boat is BaseGalleon))
            {
                Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501800); // You cannot mark an object at that location.
            }
            else if (!rune.IsChildOf(Caster.Backpack))
            {
                Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1062422); // You must have this rune in your backpack in order to mark it.
            }
            else if (CheckSequence())
            {
                rune.Mark(Caster);

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

            FinishSequence();
        }
示例#3
0
 private void MarkRune(RecallRune r, Mobile from)
 {
     r.Marked    = true;
     r.TargetMap = from.Map;
     r.Target    = from.Location;
     r.House     = null;
     from.PlaySound(0x1FA);
     if (r.IsChildOf(from.Backpack))
     {
         Effects.SendLocationEffect(from, from.Map, 14201, 16);
     }
     else
     {
         Effects.SendLocationEffect(r, r.Map, 14201, 16);
     }
 }
示例#4
0
        public void Target(RecallRune rune)
        {
            if (!Caster.CanSee(rune))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.Mark))
            {
                //Caster.SendAsciiMessage("ros");
            }
            else if (SpellHelper.CheckMulti(Caster.Location, Caster.Map, !Core.AOS))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (!rune.IsChildOf(Caster.Backpack))
            {
                Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1062422);                   // You must have this rune in your backpack in order to mark it.
            }
            else if (CheckSequence())
            {
                if (Caster.Region is Regions.HouseRegion || (Caster.Region is Regions.CustomRegion && ((Regions.CustomRegion)Caster.Region).Controller.IsRestrictedSpell(this)))
                {
                    Caster.SendAsciiMessage("You can't mark here.");
                }
                else if (Caster.Region is Regions.GreenAcres && Caster.AccessLevel == AccessLevel.Player)
                {
                    Caster.SendAsciiMessage("You cannot mark runes in Green Acres");
                }
                else
                {
                    rune.Mark(Caster);

                    Caster.PlaySound(Sound);
                }
            }

            FinishSequence();
        }
示例#5
0
        public void Target(RecallRune rune)
        {
            Region reg = Region.Find(Caster.Location, Caster.Map);

            if (!Caster.CanSee(rune))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (reg.IsPartOf(typeof(PirateRegion)))
            {
                Caster.SendMessage("These waters are too rough to cast this spell.");
            }
            else if (Worlds.RegionAllowedTeleport(Caster.Map, Caster.Location, Caster.X, Caster.Y) == false)
            {
                Caster.SendMessage("That spell does not seem to work in this place.");
            }
            else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.Mark))
            {
            }
            else if (SpellHelper.CheckMulti(Caster.Location, Caster.Map, !Core.AOS))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (!rune.IsChildOf(Caster.Backpack))
            {
                Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1062422);                   // You must have this rune in your backpack in order to mark it.
            }
            else if (CheckSequence())
            {
                rune.Mark(Caster);

                Caster.PlaySound(0x1FA);
                Effects.SendLocationEffect(Caster, Caster.Map, 14201, 16, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0), 0);
            }

            FinishSequence();
        }
示例#6
0
        public override void OnCast()
        {
            RecallSpell m_Owner = this;
            Mobile      from    = Caster;

            if (SphereSpellTarget is RecallRune)
            {
                RecallRune rune = (RecallRune)SphereSpellTarget;

                if (Caster.InLOS(rune) || (from.BankBox != null && rune.IsChildOf(from.BankBox)))
                {
                    if (rune.Marked)
                    {
                        if (rune.ChargesLeft == 0)
                        {
                            from.LocalOverheadMessage(MessageType.Regular, 906, true, "The recall rune's magic has faded");
                            DoFizzle();
                            return;
                        }

                        if (rune.ChargesLeft <= 10 && rune.ChargesLeft >= 1)
                        {
                            from.LocalOverheadMessage(MessageType.Regular, 906, true, "The recall rune is starting to fade");
                        }

                        m_Owner.Effect(rune.Target, rune.TargetMap, true);
                    }
                    else
                    {
                        from.SendLocalizedMessage(501805); // That rune is not yet marked.

                        if (from is PlayerMobile)
                        {
                            ((PlayerMobile)from).SpellCheck();
                        }
                    }
                }
                else
                {
                    Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501031); // I cannot see that object.

                    if (from is PlayerMobile)
                    {
                        ((PlayerMobile)from).SpellCheck();
                    }
                }
            }
            else if (SphereSpellTarget is Runebook)
            {
                RunebookEntry e = ((Runebook)SphereSpellTarget).Default;

                if (e != null)
                {
                    m_Owner.Effect(e.Location, e.Map, true);
                }
                else
                {
                    from.SendLocalizedMessage(502354); // Target is not marked.
                }
            }
            else if (SphereSpellTarget is Key && ((Key)SphereSpellTarget).KeyValue != 0 &&
                     ((Key)SphereSpellTarget).Link is BaseBoat)
            {
                BaseBoat boat = ((Key)SphereSpellTarget).Link as BaseBoat;

                if (!boat.Deleted && boat.CheckKey(((Key)SphereSpellTarget).KeyValue))
                {
                    m_Owner.Effect(boat.GetMarkedLocation(), boat.Map, false);
                    boat.Refresh();
                }
                else
                {
                    from.LocalOverheadMessage(MessageType.Regular, 906, 502357); // I can not recall from that object.
                }
            }
            else if (m_Entry != null)
            {
                /*if (m_Entry.ChargesLeft == 0)
                 * {
                 *  from.LocalOverheadMessage(MessageType.Regular, 906, true, "The runebook's recall rune's magic has faded");
                 *  DoFizzle();
                 *  return;
                 * }
                 * else if (m_Entry.ChargesLeft <= 10 && m_Entry.ChargesLeft >= 1)
                 *  from.LocalOverheadMessage(MessageType.Regular, 906, true, "The recall rune in your runebook is starting to fade");
                 */
                m_Owner.Effect(m_Entry.Location, m_Entry.Map, true);
            }
            else
            {
                from.LocalOverheadMessage(MessageType.Regular, 906, 502357); // I can not recall from that object.

                // if (from is PlayerMobile)
                //     ((PlayerMobile)from).SpellCheck();
            }
        }