CheckTravel() public static method

public static CheckTravel ( Map map, Point3D loc, TravelCheckType type ) : bool
map Map
loc Point3D
type TravelCheckType
return bool
示例#1
0
        /*public override bool CheckCast()
         * {
         *      if ( !base.CheckCast() )
         *              return false;
         *
         *      return SpellHelper.CheckTravel( Caster, TravelCheckType.Mark );
         * }*/

        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, true))
            {
                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(IPoint3D p)
        {
            IPoint3D orig = p;
            Map      map  = Caster.Map;

            SpellHelper.GetSurfaceTop(ref p);

            if (Server.Misc.WeightOverloading.IsOverloaded(Caster))
            {
                Caster.SendLocalizedMessage(502359, "", 0x22);                   // Thou art too encumbered to move.
            }

            /*else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.TeleportFrom ) )
             * {
             * }*/
            else if (!SpellHelper.CheckTravel(Caster, map, new Point3D(p), TravelCheckType.TeleportTo))
            {
            }
            else if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (SpellHelper.CheckMulti(new Point3D(p), map))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (!Caster.CanSee(p))
            {
                Caster.SendMessage("Vous ne pouvez pas  voir l'endroit où vous désirez vous téléporter.");
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, orig);

                Mobile m = Caster;

                Point3D from = m.Location;
                Point3D to   = new Point3D(p);

                m.Location = to;
                m.ProcessDelta();

                if (m.Player)
                {
                    Effects.SendLocationParticles(EffectItem.Create(from, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                    Effects.SendLocationParticles(EffectItem.Create(to, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);
                }
                else
                {
                    Effects.SendTargetParticles(m, 0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                }

                m.PlaySound(0x1FE);
            }

            FinishSequence();
        }
示例#3
0
        public override bool CheckCast()
        {
            if (SpellHelper.CheckCombat(Caster))
            {
                Caster.SendLocalizedMessage(1005564, "", 0x22);                   // Wouldst thou flee during the heat of battle??
                return(false);
            }

            return(SpellHelper.CheckTravel(Caster, TravelCheckType.GateFrom));
        }
示例#4
0
        public void GetLocation()
        {
            int X = Utility.Random(-10, 20);
            int Y = Utility.Random(-10, 20);

            Point3D total = Caster.Location;

            IPoint3D p = new Point3D(total.X + X, total.Y + Y, total.Z);

            IPoint3D orig = p;
            Map      map  = Caster.Map;

            SpellHelper.GetSurfaceTop(ref p);

            point = new Point3D(p);

            if (Server.Misc.WeightOverloading.IsOverloaded(Caster))
            {
                Check = false;
                Count++;
                return;
            }
            else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.TeleportFrom))
            {
                Check = false;
                Count++;
                return;
            }
            else if (!SpellHelper.CheckTravel(Caster, map, new Point3D(p), TravelCheckType.TeleportTo))
            {
                Check = false;
                Count++;
                return;
            }
            else if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z))
            {
                Check = false;
                Count++;
                return;
            }
            else if (SpellHelper.CheckMulti(new Point3D(p), map))
            {
                Check = false;
                Count++;
                return;
            }
            else if (!Caster.CanSee(new Point3D(p)) || !Caster.InLOS(new Point3D(p)))
            {
                Check = false;
                Count++;
                return;
            }

            Check = true;
        }
示例#5
0
        public void Effect(Point3D loc, Map map, bool checkMulti)
        {
            if (map == null || (!Core.AOS && Caster.Map != map))
            {
                Caster.SendLocalizedMessage(1005570);                   // You can not gate to another facet.
            }
            else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.GateFrom))
            {
            }
            else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.GateTo))
            {
            }

            else if (Caster.Kills >= 5 && map != Map.Felucca)
            {
                Caster.SendLocalizedMessage(1019004);                   // You are not allowed to travel there.
            }
            else if (SpellHelper.CheckCombat(Caster))
            {
                Caster.SendLocalizedMessage(1005564, "", 0x22);                   // Wouldst thou flee during the heat of battle??
            }
            else if (!map.CanSpawnMobile(loc.X, loc.Y, loc.Z))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if ((checkMulti && SpellHelper.CheckMulti(loc, map)))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (CheckSequence())
            {
                Caster.PublicOverheadMessage(Server.Network.MessageType.Regular, Caster.EmoteHue, true, "*slashes through the air, cutting through the fabric of space and time itself*");

                Effects.PlaySound(Caster.Location, Caster.Map, 476);

                InternalItem firstGate = new InternalItem(loc, map);
                firstGate.Hue = 1;
                firstGate.MoveToWorld(Caster.Location, Caster.Map);

                Effects.PlaySound(loc, map, 476);

                InternalItem secondGate = new InternalItem(Caster.Location, Caster.Map);
                secondGate.Hue = 1;
                secondGate.MoveToWorld(loc, map);
            }

            FinishSequence();
        }
示例#6
0
        public void Effect(Point3D loc, Map map, bool checkMulti)
        {
            if (map == null || Caster.Map != map)
            {
                Caster.SendLocalizedMessage(1005569);                   // You can not recall to another facet.
            }

            /*else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.RecallFrom ) )
             * {
             * }*/
            else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.RecallTo))
            {
            }
            else if (SpellHelper.CheckCombat(Caster))
            {
                Caster.SendLocalizedMessage(1005564, "", 0x22);                   // Wouldst thou flee during the heat of battle??
            }
            else if (Server.Misc.WeightOverloading.IsOverloaded(Caster))
            {
                Caster.SendLocalizedMessage(502359, "", 0x22);                   // Thou art too encumbered to move.
            }

            /*else if ( !map.CanSpawnMobile( loc.X, loc.Y, loc.Z ) )
             * {
             *      Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
             * }*/
            else if ((checkMulti && SpellHelper.CheckMulti(loc, map)))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            //else if ( m_Book != null && m_Book.CurCharges <= 0 )
            //{
            //    Caster.SendLocalizedMessage( 502412 ); // There are no charges left on that item.
            //}
            else if (CheckSequence())
            {
                BaseCreature.TeleportPets(Caster, loc, map, true);

                //if ( m_Book != null )
                //    --m_Book.CurCharges;

                Caster.PlaySound(0x1FC);
                Caster.MoveToWorld(loc, map);
                Caster.PlaySound(0x1FC);
            }

            FinishSequence();
        }
示例#7
0
        public void Effect(Point3D loc, Map map, bool checkMulti)
        {
            if (map == null || Caster.Map != map)
            {
                Caster.SendLocalizedMessage(1005570);                   // You can not gate to another facet.
            }

            /*else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.GateFrom ) )
             * {
             * }*/
            else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.GateTo))
            {
            }
            else if (SpellHelper.CheckCombat(Caster))
            {
                Caster.SendLocalizedMessage(1005564, "", 0x22);                   // Wouldst thou flee during the heat of battle??
            }

            /*else if ( !map.CanSpawnMobile( loc.X, loc.Y, loc.Z ) )
             * {
             *      Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
             * }*/
            else if ((checkMulti && SpellHelper.CheckMulti(loc, map)))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (CheckSequence())
            {
                Caster.SendLocalizedMessage(501024);                   // You open a magical gate to another location

                Effects.PlaySound(Caster.Location, Caster.Map, 0x20E);

                double duration = 30.0;

                duration = SpellHelper.AdjustValue(Caster, duration);

                InternalItem firstGate = new InternalItem(loc, map, duration);
                firstGate.MoveToWorld(Caster.Location, Caster.Map);

                Effects.PlaySound(loc, map, 0x20E);

                InternalItem secondGate = new InternalItem(Caster.Location, Caster.Map, duration);
                secondGate.MoveToWorld(loc, map);
            }

            FinishSequence();
        }
示例#8
0
        public override void OnCast()
        {
            if (CheckSequence())
            {
                if (Server.Misc.WeightOverloading.IsOverloaded(Caster))
                {
                    Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
                }

                while ((!Check || point == Caster.Location || point == new Point3D(0, 0, 0)) && Count < 30 || !SpellHelper.CheckTravel(Caster, Caster.Map, point, TravelCheckType.TeleportTo) || Caster.Map == null || !Caster.Map.CanSpawnMobile(point.X, point.Y, point.Z) || (SpellHelper.CheckMulti(new Point3D(point), Caster.Map)) || !Caster.CanSee(point))
                {
                    GetLocation();
                }

                SpellHelper.Turn(Caster, point);

                Mobile m = Caster;

                Point3D to = point;

                Point3D from = m.Location;

                m.Location = to;
                m.ProcessDelta();

                if (m.Player)
                {
                    Effects.SendLocationParticles(EffectItem.Create(from, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                    Effects.SendLocationParticles(EffectItem.Create(to, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);
                }
                else
                {
                    Effects.SendTargetParticles(m, 0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                }

                m.PlaySound(0x1FE);
            }
            FinishSequence();
        }