Exemplo n.º 1
0
        public override bool CheckCast()
        {
            var pm = Caster as PlayerMobile;

            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1061632);                   // You can't do that while carrying the sigil
            }
            else if (Caster.Criminal)
            {
                Caster.SendLocalizedMessage(1005561, "", 0x22);                   // Thou'rt a criminal and cannot escape so easily.
            }
            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 (Caster is BaseCreature && !((BaseCreature)Caster).Pseu_CanUseRecall)
            {
                Caster.SendMessage("You are not allowed to do that.");
            }
            else if (pm != null && pm.PokerGame != null)
            {
                pm.SendMessage(61, "You cannot recall while playing poker.");
            }
            else
            {
                return(SpellHelper.CheckTravel(Caster, TravelCheckType.RecallFrom));
            }

            return(false);
        }
Exemplo n.º 2
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();
        }
Exemplo n.º 3
0
        public static void LastLoc_Command(CommandEventArgs e)
        {
            PlayerMobile pm = e.Mobile as PlayerMobile;

            if (pm != null && pm.Companion)
            {
                if (pm.CompanionLastLocation != Point3D.Zero)
                {
                    if (pm.Criminal)
                    {
                        pm.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
                    }
                    else if (SpellHelper.CheckCombat(pm, true))
                    {
                        pm.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
                    }
                    else if (!SpellHelper.CheckTravel(pm, TravelCheckType.RecallFrom))
                    {
                        pm.SendMessage("Companions may not teleport away from this location");
                    }
                    else
                    {
                        CommandLogging.WriteLine(pm, "{0} {1} teleporting from {2} to {3}", pm.AccessLevel, CommandLogging.Format(pm), new Point3D(pm.Location), pm.CompanionLastLocation);
                        pm.Location = pm.CompanionLastLocation;
                        pm.CompanionLastLocation = Point3D.Zero;
                    }
                }
                else
                {
                    pm.SendAsciiMessage("You must first teleport to a new player before returning to your last location.");
                }
            }
        }
Exemplo n.º 4
0
        public void Target(IPoint3D p)
        {
            IPoint3D orig = p;
            Map      map  = Caster.Map;

            SpellHelper.GetSurfaceTop(ref p);

            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1061632);                   // You can't do that while carrying the sigil.
            }
            else 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 (CheckSequence())
            {
                if (Caster is PlayerMobile)
                {
                    Point3D peto = new Point3D(p); BaseCreature.TeleportPets(Caster, peto, map, false);
                }
                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
                {
                    m.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                }

                m.PlaySound(0x485);
            }

            FinishSequence();
        }
Exemplo n.º 5
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 (map == Map.Felucca && Caster is PlayerMobile && ((PlayerMobile)Caster).Young)
            {
                Caster.SendLocalizedMessage(1049543);                   // You decide against traveling to Felucca while you are still young.
            }
            else if (Caster.Kills >= 5 && map != Map.Felucca)
            {
                Caster.SendLocalizedMessage(1019004);                   // You are not allowed to travel there.
            }
            else if (Caster.Criminal)
            {
                Caster.SendLocalizedMessage(1005561, "", 0x22);                   // Thou'rt a criminal and cannot escape so easily.
            }
            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();
        }
Exemplo n.º 6
0
        public override bool CheckCast()
        {
            if (Core.UOSP)
            {
                Caster.SendMessage("That spell does not work here.");
                return(false);
            }

            if (Caster.Criminal)
            {
                Caster.SendLocalizedMessage(1005561, "", 0x22);                 // Thou'rt a criminal and cannot escape so easily.
                return(false);
            }
            else if (SpellHelper.CheckCombat(Caster))
            {
                Caster.SendLocalizedMessage(1005564, "", 0x22);                 // Wouldst thou flee during the heat of battle??
                return(false);
            }
            else if (Server.Misc.WeightOverloading.IsOverloaded(Caster))
            {
                Caster.SendLocalizedMessage(502359, "", 0x22);                 // Thou art too encumbered to move.
                return(false);
            }
            else if (Caster is PlayerMobile && (DateTime.Now - ((PlayerMobile)Caster).LastStoleAt < TimeSpan.FromMinutes(2)))
            {
                Caster.SendLocalizedMessage(1005561, "", 0x22);                 // Thou'rt a criminal and cannot escape so easily.
                return(false);
            }

            return(SpellHelper.CheckTravel(Caster, TravelCheckType.RecallFrom));
        }
Exemplo n.º 7
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 (!map.CanFit(loc.X, loc.Y, loc.Z, 16))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if ((checkMulti && SpellHelper.CheckMulti(loc, map)))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (!SpellHelper.CheckTravel(Caster, loc, map, TravelType.Gate) && Caster.AccessLevel == AccessLevel.Player)
            {
                Caster.PlaySound(0x5C);
            }
            else if (CheckSequence())
            {
                Caster.SendLocalizedMessage(501024);                   // You open a magical gate to another location

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

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

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

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

            FinishSequence();
        }
Exemplo n.º 8
0
        public override bool CheckCast()
        {
            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1061632);                   // You can't do that while carrying the sigil.
                return(false);
            }

            /*else if ( Caster.Criminal )
             * {
             * Caster.SendAsciiMessage(0x22, "Thou'rt a criminal and cannot escape so easily."); // Thou'rt a criminal and cannot escape so easily.
             *      return false;
             * }
             * else if ( SpellHelper.CheckCombat( Caster ) )
             * {
             * Caster.SendAsciiMessage(0x22, "Wouldst thou flee during the heat of battle??"); // Wouldst thou flee during the heat of battle??
             *      return false;
             * }*/
            else if (Server.Misc.WeightOverloading.IsOverloaded(Caster))
            {
                Caster.SendAsciiMessage(0x22, "Thou art too encumbered to move."); // Thou art too encumbered to move.
                return(false);
            }

            return(SpellHelper.CheckTravel(Caster, TravelCheckType.RecallFrom));
        }
Exemplo n.º 9
0
        public override bool CheckCast()
        {
            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1061632);                   // You can't do that while carrying the sigil
            }
            else if (Caster.Criminal)
            {
                Caster.SendLocalizedMessage(1005561, "", 0x22);                   // Thou'rt a criminal and cannot escape so easily.
            }
            //else if ( PokerDealer.IsPokerPlayer( Caster ) >= 0 )
            //	Caster.SendMessage( "You cannot travel while playing poker." );
            else if (Items.EventFlag.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1061632);                   // EventFlag Add by XLX.
            }
            else if (SpellHelper.CheckCombat(Caster) || SpellHelper.CheckFactionAggressed(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
            {
                return(SpellHelper.CheckTravel(Caster, TravelCheckType.RecallFrom));
            }

            return(false);
        }
Exemplo n.º 10
0
        public override bool CheckCast()
        {
            if (!base.CheckCast())
            {
                return(false);
            }

            if (Factions.Sigil.ExistsOn(Caster))
            {
                return(false);
            }
            else if (Caster.Criminal)
            {
                return(false);
            }
            else if (SpellHelper.CheckCombat(Caster))
            {
                return(false);
            }
            else if (Server.Misc.WeightOverloading.IsOverloaded(Caster))
            {
                return(false);
            }

            return(SpellHelper.CheckTravel(Caster, TravelCheckType.RecallFrom));
        }
Exemplo n.º 11
0
        public override bool CheckCast()
        {
            if (!base.CheckCast())
            {
                return(false);
            }

            if (Engines.VvV.VvVSigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
                return(false);
            }
            else if (Engines.CityLoyalty.CityTradeSystem.HasTrade(Caster))
            {
                Caster.SendLocalizedMessage(1151733); // You cannot do that while carrying a Trade Order.
                return(false);
            }
            else if (Caster.Criminal)
            {
                Caster.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
                return(false);
            }
            else if (SpellHelper.CheckCombat(Caster))
            {
                Caster.SendLocalizedMessage(1061282); // You cannot use the Sacred Journey ability to flee from combat.
                return(false);
            }
            else if (Misc.WeightOverloading.IsOverloaded(Caster))
            {
                Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
                return(false);
            }

            return(SpellHelper.CheckTravel(Caster, TravelCheckType.RecallFrom));
        }
Exemplo n.º 12
0
        public void Summon(SoulSliver sliver)
        {
            Mobile soul = sliver.Target;

            Map     map = sliver.Map;
            Point3D loc = sliver.Location;

            if (!SpellHelper.CheckTravel(soul, TravelCheckType.RecallFrom))
            {
            }
            else if (!SpellHelper.CheckTravel(Caster, Caster.Map, sliver.Location, TravelCheckType.RecallTo))
            {
            }
            else if (SpellHelper.CheckCombat(soul))
            {
                Caster.SendMessage("They cannot be called in the heat of battle."); // 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 (CheckSequence())
            {
                Effects.SendLocationParticles(EffectItem.Create(soul.Location, soul.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042);
                Effects.PlaySound(soul, soul.Map, 0x201);
                soul.SendMessage("You feel a sickening wrenching sensation.");
                soul.MoveToWorld(loc, map);
                soul.PlaySound(0x1FC);
            }

            FinishSequence();
        }
Exemplo n.º 13
0
 public override bool OnMoveOver(Mobile m)
 {
     if (m.Player && m.Criminal)
     {
         m.SendLocalizedMessage(1005561, "", 0x22);                       // Thou'rt a criminal and cannot escape so easily.
         return(true);
     }
     else if (m is BaseOverland && (m as BaseOverland).GateTravel == false)
     {                       // overland mobs are afraid of magic and will not enter!
         BaseOverland bo = m as BaseOverland;
         bo.OnMoongate();
         return(true);
     }
     else
     {                   // Adam: there is an exploit where you drop a preview house on top of a gate.
         //  the GateTo checker below will send the exploiters to jail if that's the case
         bool jail;
         if (SpellHelper.CheckTravel(m.Map, this.Target, TravelCheckType.GateTo, m, out jail))
         {
             return(base.OnMoveOver(m));
         }
         else
         {
             if (jail == true)
             {
                 Point3D jailCell = new Point3D(5295, 1174, 0);
                 m.MoveToWorld(jailCell, m.Map);
             }
             return(false);
         }
     }
 }
Exemplo n.º 14
0
        public void Effect(Point3D loc, Map map, bool checkMulti)
        {
            bool t2aOK = SpellHelper.TravelInsideT2A(loc, Caster);

            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1061632);                   // You can't do that while carrying the sigil.
            }
            else if (map == null || (!Core.AOS && Caster.Map != map))
            {
                Caster.SendLocalizedMessage(1005570);                   // You can not gate to another facet.
            }
            else if (!t2aOK && !SpellHelper.CheckTravel(Caster, TravelCheckType.GateFrom))
            {
            }
            else if (!t2aOK && !SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.GateTo))
            {
            }
            else if (map == Map.Felucca && Caster is PlayerMobile && ((PlayerMobile)Caster).Young)
            {
                Caster.SendLocalizedMessage(1049543);                   // You decide against traveling to Felucca while you are still young.
            }

            /*else if ( Caster.Kills >= 5 && map != Map.Felucca )
             * {
             *      Caster.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
             * }
             * else if ( Caster.Criminal )
             * {
             *      Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
             * }
             * 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);

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

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

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

            FinishSequence();
        }
Exemplo n.º 15
0
        public async Task OnTargetAsync(ITargetResponse <RecallRune> response)
        {
            if (!response.HasValue)
            {
                return;
            }

            var target = response.Target;

            if (!SpellHelper.CheckTravel(Caster, TravelCheckType.Mark))
            {
                // Thy spell doth not appear to work...
                Caster.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 501802, Caster.NetState);
                return;
            }

            if (Caster.GetMulti()?.IsMultiOwner(Caster) == false)
            {
                Caster.SendFailureMessage(1010587); // You are not a co-owner of this house.
                return;
            }

            if (!target.IsChildOf(Caster.Backpack))
            {
                // You must have this rune in your backpack in order to mark it.
                Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1062422);
                return;
            }

            target.Mark(Caster);

            Caster.PlaySound(0x1FA);
            Effects.SendLocationEffect(Caster, 14201, 16);
        }
Exemplo n.º 16
0
        public override bool CheckCast()
        {
            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
                return(false);
            }
            else if (Caster.Criminal)
            {
                Caster.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
                return(false);
            }
            else if (SpellHelper.CheckCombat(Caster))
            {
                Caster.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
                return(false);
            }
            else if (Misc.WeightOverloading.IsOverloaded(Caster))
            {
                Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
                return(false);
            }

            return(SpellHelper.CheckTravel(Caster, TravelCheckType.RecallFrom));
        }
Exemplo n.º 17
0
        public override bool CheckCast()
        {
            WarpBlockerTotem recallBlocker = WarpBlockerTotem.RecallBlockerTriggered(Caster, WarpBlockerTotem.MovementMode.TeleportOut, Caster.Location, Caster.Map);

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

                return(false);
            }

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

            else if (!Caster.CanBeginAction(typeof(TeleportSpell)))
            {
                Caster.SendLocalizedMessage(502644, "", 0x22); //You have not yet recovered from casting a spell.
                return(false);
            }

            //return true;
            return(SpellHelper.CheckTravel(Caster, TravelCheckType.TeleportFrom));
        }
Exemplo n.º 18
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();
        }
Exemplo n.º 19
0
            public override bool CheckCast()
            {
                if (!_Stone.Home.IsValid())
                {
                    Caster.SendMessage(0x22, "You have not yet set your Hearthstones' Home location.");
                    return(false);
                }
                else if (Factions.Sigil.ExistsOn(Caster))
                {
                    Caster.SendLocalizedMessage(1061632);                     // You can't do that while carrying the sigil.
                    return(false);
                }

                /*else if (Caster.Criminal)
                 * {
                 *      Caster.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
                 *      return false;
                 * }*/
                else if (SpellHelper.CheckCombat(Caster))
                {
                    Caster.SendLocalizedMessage(1005564, "", 0x22);                     // Wouldst thou flee during the heat of battle??
                    return(false);
                }
                else if (Server.Misc.WeightOverloading.IsOverloaded(Caster))
                {
                    Caster.SendLocalizedMessage(502359, "", 0x22);                     // Thou art too encumbered to move.
                    return(false);
                }

                return(SpellHelper.CheckTravel(Caster, TravelCheckType.RecallFrom));
            }
Exemplo n.º 20
0
        public override bool CheckCast()
        {
            if (Engines.VvV.VvVSigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
                return(false);
            }

            if (Engines.CityLoyalty.CityTradeSystem.HasTrade(Caster))
            {
                Caster.SendLocalizedMessage(1151733); // You cannot do that while carrying a Trade Order.
                return(false);
            }

            if (Caster.Criminal)
            {
                Caster.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
                return(false);
            }

            if (SpellHelper.CheckCombat(Caster))
            {
                Caster.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
                return(false);
            }

            return(SpellHelper.CheckTravel(Caster, TravelCheckType.GateFrom));
        }
Exemplo n.º 21
0
        public override bool CheckCast()
        {
            if (!base.CheckCast())
            {
                return(false);
            }

            if (Factions.Sigil.ExistsOn(this.Caster))
            {
                this.Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
                return(false);
            }
            else if (this.Caster.Criminal)
            {
                this.Caster.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
                return(false);
            }
            else if (SpellHelper.CheckCombat(this.Caster))
            {
                this.Caster.SendLocalizedMessage(1061282); // You cannot use the Sacred Journey ability to flee from combat.
                return(false);
            }
            else if (Server.Misc.WeightOverloading.IsOverloaded(this.Caster))
            {
                this.Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
                return(false);
            }

            return(SpellHelper.CheckTravel(this.Caster, TravelCheckType.RecallFrom));
        }
Exemplo n.º 22
0
        public void Effect(Point3D loc, Map map, bool checkMulti)
        {
            if (Factions.Sigil.ExistsOn(this.Caster))
            {
                this.Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
            }
            else if (map == null || (!Core.AOS && this.Caster.Map != map))
            {
                this.Caster.SendLocalizedMessage(1005569); // You can not recall to another facet.
            }
            else if (!SpellHelper.CheckTravel(this.Caster, TravelCheckType.RecallFrom))
            {
            }
            else if (!SpellHelper.CheckTravel(this.Caster, map, loc, TravelCheckType.RecallTo))
            {
            }
            else if (map == Map.Felucca && this.Caster is PlayerMobile && ((PlayerMobile)this.Caster).Young)
            {
                this.Caster.SendLocalizedMessage(1049543); // You decide against traveling to Felucca while you are still young.
            }
            else if (this.Caster.Kills >= 5 && map != Map.Felucca)
            {
                this.Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there.
            }
            else if (this.Caster.Criminal)
            {
                this.Caster.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
            }
            else if (SpellHelper.CheckCombat(this.Caster))
            {
                this.Caster.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
            }
            else if (Server.Misc.WeightOverloading.IsOverloaded(this.Caster))
            {
                this.Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
            }
            else if (!map.CanSpawnMobile(loc.X, loc.Y, loc.Z))
            {
                this.Caster.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if ((checkMulti && SpellHelper.CheckMulti(loc, map)))
            {
                this.Caster.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if (this.Caster.Holding != null)
            {
                this.Caster.SendLocalizedMessage(1071955); // You cannot teleport while dragging an object.
            }
            else if (this.CheckSequence())
            {
                BaseCreature.TeleportPets(this.Caster, loc, map, true);

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

            this.FinishSequence();
        }
Exemplo n.º 23
0
        public void Target(IPoint3D p)
        {
            IPoint3D orig = p;
            Map      map  = Caster.Map;

            SpellHelper.GetSurfaceTop(ref p);

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

            PlayerMobile pm = Caster as PlayerMobile; // IsStealthing should be moved to Server.Mobiles

            if (!pm.IsStealthing)
            {
                Caster.SendLocalizedMessage(1063087); // You must be in stealth mode to use this ability.
            }
            else if (Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
            }
            else if (WeightOverloading.IsOverloaded(Caster))
            {
                Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
            }
            else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.TeleportFrom) ||
                     !SpellHelper.CheckTravel(Caster, map, to, TravelCheckType.TeleportTo))
            {
            }
            else if (map?.CanSpawnMobile(p.X, p.Y, p.Z) != true)
            {
                Caster.SendLocalizedMessage(502831); // Cannot teleport to that spot.
            }
            else if (SpellHelper.CheckMulti(to, map, true, 5))
            {
                Caster.SendLocalizedMessage(502831); // Cannot teleport to that spot.
            }
            else if (Region.Find(to, map).IsPartOf <HouseRegion>())
            {
                Caster.SendLocalizedMessage(502829); // Cannot teleport to that spot.
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, orig);

                Mobile m = Caster;

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

                Effects.SendLocationParticles(EffectItem.Create(from, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10,
                                              2023);

                m.PlaySound(0x512);

                Stealth.OnUse(m); // stealth check after the a jump
            }

            FinishSequence();
        }
Exemplo n.º 24
0
		public void Effect( Point3D loc, Map map, bool checkMulti )
		{
			if ( map == null || (!Core.AOS && 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 ( Caster.Kills >= 5 && map != Map.Felucca )
			{
				Caster.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
			}
			else if ( Caster.Criminal )
			{
				Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
			}
			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( 143 );
				Caster.Map = map;
				Caster.Location = loc;
				Caster.FixedParticles( 0x3779, 1, 30, 9964, 3, 3, EffectLayer.Waist );

				IEntity from = new Entity( Serial.Zero, new Point3D( Caster.X, Caster.Y, Caster.Z ), Caster.Map );
				IEntity to = new Entity( Serial.Zero, new Point3D( Caster.X, Caster.Y, Caster.Z + 50 ), Caster.Map );
				Effects.SendMovingParticles( from, to, 0x20F2, 2, 1, false, false, 0, 3, 9501, 1, 0, EffectLayer.Head, 0x100 );
				Caster.PlaySound( 144 );
			}

			FinishSequence();
		}
Exemplo n.º 25
0
        public override bool CheckCast()
        {
            if (!base.CheckCast())
            {
                return(false);
            }

            return(SpellHelper.CheckTravel(Caster, TravelCheckType.Mark));
        }
Exemplo n.º 26
0
        public void Target(Mobile from, IPoint3D p)
        {
            IPoint3D orig = p;
            Map      map  = from.Map;

            SpellHelper.GetSurfaceTop(ref p);

            // manufacture a fake spell so we can insure the teleport ring follows
            //	the same region-based rules as does the spell (21=teleport)
            Spell spell = SpellRegistry.NewSpell(21, from, null);

            if (Server.Misc.WeightOverloading.IsOverloaded(from))
            {                   // Thou art too encumbered to move.
                from.SendLocalizedMessage(502359, "", 0x22);
            }
            else if (from.Region.OnBeginSpellCast(from, spell) == false)
            {                   // check to region to see if the teleport SPELL is allowed.
                from.SendMessage("The magic normally within this object seems absent.");
            }                   // if it is not, then the teleport ring should not be allowed.
            else if (!SpellHelper.CheckTravel(from, TravelCheckType.TeleportFrom))
            {                   // make teleport rings follow the same rules as the spell
            }
            else if (!SpellHelper.CheckTravel(from, map, new Point3D(p), TravelCheckType.TeleportTo))
            {                   // make teleport rings follow the same rules as the spell
            }
            else if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z))
            {
                from.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (SpellHelper.CheckMulti(new Point3D(p), map))
            {
                from.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else
            {
                SpellHelper.Turn(from, orig);

                Mobile m = from;

                Point3D frompoint = m.Location;
                Point3D topoint   = new Point3D(p);

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

                Effects.SendLocationParticles(EffectItem.Create(frompoint, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                Effects.SendLocationParticles(EffectItem.Create(topoint, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);

                m.PlaySound(0x1FE);
                MagicCharges--;
                m.RevealingAction();
                if (MagicCharges == 0)
                {
                    MagicType = JewelMagicEffect.None;
                }
            }
        }
Exemplo n.º 27
0
        public void Effect(Point3D loc, Map map, bool checkMulti)
        {
            if (map == null || (!Core.AOS && 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 (Caster.Murderer && map != Map.Felucca)
            {
                Caster.SendLocalizedMessage(1019004);                 // You are not allowed to travel there.
            }
            else if (Caster.Criminal)
            {
                Caster.SendLocalizedMessage(1005561, "", 0x22);                 // Thou'rt a criminal and cannot escape so easily.
            }
            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 ((Core.UOAI || Core.UOAR || Core.UOSP) && BaseBoat.FindBoatAt(loc, map, 16) != null)
            {
                // disallow recalling onto the boat (AI&SP) - they recalled off their key
                Caster.SendLocalizedMessage(501942);                 // That location is blocked.
            }
            else if (SpellHelper.IsSpecialRegion(loc) || SpellHelper.IsSpecialRegion(Caster.Location))
            {
                Caster.SendLocalizedMessage(501942);                 // That location is blocked.
            }
            else if (CheckSequence())
            {
                InternalTimer t = new InternalTimer(this, Caster, loc, m_Book);
                t.Start();
            }

            FinishSequence();
        }
Exemplo n.º 28
0
        public void Effect(Point3D loc, Map map, bool checkMulti)
        {
            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendAsciiMessage("You can't do that while carrying the sigil.");
            }
            else if (map == null || (!Core.AOS && Caster.Map != map))
            {
                Caster.SendAsciiMessage("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 (map == Map.Felucca && Caster is PlayerMobile && ((PlayerMobile)Caster).Young)
            {
                Caster.SendAsciiMessage("You decide against traveling to Felucca while you are still young.");
            }
            else if (Caster.Kills >= 5 && map != Map.Felucca)
            {
                Caster.SendAsciiMessage("You are not allowed to travel there.");
            }
            else if (Caster.Criminal)
            {
                Caster.SendAsciiMessage(0x22, "Thou'rt a criminal and cannot escape so easily.");
            }
            else if (SpellHelper.CheckCombat(Caster))
            {
                Caster.SendAsciiMessage(0x22, "Wouldst thou flee during the heat of battle?");
            }
            else if (!map.CanSpawnMobile(loc.X, loc.Y, loc.Z))
            {
                Caster.SendAsciiMessage("That location is blocked.");
            }
            else if ((checkMulti && SpellHelper.CheckMulti(loc, map)))
            {
                Caster.SendAsciiMessage("That location is blocked.");
            }
            else if (CheckSequence())
            {
                Caster.SendAsciiMessage("You open a magical gate to another location.");

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

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

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

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

            FinishSequence();
        }
Exemplo n.º 29
0
        public void Effect(Point3D loc, Map map, bool checkMulti)
        {
            if (!SpellHelper.CheckTravel(Caster, TravelCheckType.RecallFrom))
            {
            }
            else if (Worlds.AllowEscape(Caster, Caster.Map, Caster.Location, Caster.X, Caster.Y) == false)
            {
                Caster.SendMessage("That ability does not seem to work in this place.");
            }
            else if (Worlds.RegionAllowedRecall(Caster.Map, Caster.Location, Caster.X, Caster.Y) == false)
            {
                Caster.SendMessage("That ability does not seem to work in this place.");
            }
            else if (Worlds.RegionAllowedTeleport(map, loc, loc.X, loc.Y) == false)
            {
                Caster.SendMessage("The destination seems magically unreachable.");
            }
            else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.RecallTo))
            {
            }
            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, false);

                if (m_Book != null)
                {
                    --m_Book.CurCharges;
                }

                Caster.PlaySound(0x0F7);
                Effects.SendLocationEffect(Caster.Location, Caster.Map, 0x373A, 60, 10, 0xB65, 0);

                Caster.MoveToWorld(loc, map);

                Caster.PlaySound(0x0F7);
                Effects.SendLocationEffect(Caster.Location, Caster.Map, 0x373A, 60, 10, 0xB65, 0);
            }

            FinishSequence();
        }
Exemplo n.º 30
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 (Caster.Criminal)
            {
                Caster.SendLocalizedMessage(1005561, "", 0x22);                   // Thou'rt a criminal and cannot escape so easily.
            }
            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 (Core.AOS && (GateExistsAt(map, loc) || GateExistsAt(Caster.Map, Caster.Location))) // SE restricted stacking gates
            {
                Caster.SendLocalizedMessage(1071242);                                                   // There is already a gate there.
            }
            else if (CheckSequence())
            {
                Caster.SendLocalizedMessage(501024);                   // You open a magical gate to another location

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

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

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

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

                ((Moongate)firstGate).PairedGate  = secondGate;
                ((Moongate)secondGate).PairedGate = firstGate;
            }

            FinishSequence();
        }