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);
            }

            return(SpellHelper.CheckTravel(Caster, TravelCheckType.GateFrom));
        }
Beispiel #2
0
        public override bool CheckCast()
        {
            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));
        }
Beispiel #3
0
        private static void OnConvokeCommand(CommandEventArgs e)
        {
            Mobile from = e.Mobile;
            int    key  = from.Serial.Value;

            if (SpellHelper.CheckCombat(from))
            {
                from.SendMessage(38, "You can't do this while in middle a combat.");
                return;
            }

            if (LastUsed.ContainsKey(key) && (DateTime.Now - Config.UseDelay) < LastUsed[key])
            {
                TimeSpan timeToWait = Config.UseDelay - (DateTime.Now - LastUsed[key]);
                from.SendMessage(38, "You still need to wait {0:N0} seconds before convoking another player.", timeToWait.TotalSeconds);
                return;
            }

            from.CloseGump(typeof(ConvokeGumpList));
            from.SendGump(new ConvokeGumpList(from, e.ArgString));
        }
Beispiel #4
0
        public bool CheckTravel(Mobile from, Point3D dest, Map destMap)
        {
            if (from.Criminal)
            {
                from.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
                return(false);
            }
            else if (SpellHelper.CheckCombat(from))
            {
                from.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
                return(false);
            }
            else if (destMap == Map.Felucca && from is PlayerMobile && ((PlayerMobile)from).Young)
            {
                from.SendLocalizedMessage(1049543); // You decide against traveling to Felucca while you are still young.
                return(false);
            }
            else if (SpellHelper.RestrictRedTravel && from.Murderer && destMap.Rules != MapRules.FeluccaRules && !Siege.SiegeShard)
            {
                from.SendLocalizedMessage(1019004); // You are not allowed to travel there.
                return(false);
            }
            else if (CityTradeSystem.HasTrade(from))
            {
                from.SendLocalizedMessage(1151733); // You cannot do that while carrying a Trade Order.
                return(false);
            }
            else if (from.Holding != null)
            {
                from.SendLocalizedMessage(1071955); // You cannot teleport while dragging an object.
                return(false);
            }
            else if (from.Target != null)
            {
                from.SendLocalizedMessage(500310); // You are too busy with something else.
                return(false);
            }

            return(true);
        }
Beispiel #5
0
        public override void OnDoubleClickDead(Mobile m)
        {
            if (m.InRange(this.GetWorldLocation(), 2))
            {
                if (m_Active)
                {
                    if (!m_Creatures && !m.Player)
                    {
                    }
                    else if (m_CombatCheck && SpellHelper.CheckCombat(m))
                    {
                        m.SendLocalizedMessage(1005564, "", 0x22);                           // Wouldst thou flee during the heat of battle??
                    }

                    StartTeleport(m);
                }
            }
            else
            {
                m.SendLocalizedMessage(502138);                   // That is too far away for you to use
            }
        }
Beispiel #6
0
        public static bool CanTravel(Mobile from, Map map, Point3D p)
        {
            bool NonGM = from.AccessLevel < AccessLevel.GameMaster;

            // if (NonGM && Factions.Sigil.ExistsOn(from))
            if (NonGM)
            {
                from.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
                return(false);
            }
            if (NonGM && from.Criminal)
            {
                from.SendLocalizedMessage(1005561, "", 0x22);
                // Thou'rt a criminal and cannot escape so easily.
                return(false);
            }
            if (NonGM && SpellHelper.CheckCombat(from))
            {
                from.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
                return(false);
            }
            if (NonGM && Misc.WeightOverloading.IsOverloaded(from))
            {
                from.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
                return(false);
            }
            if (!map.CanSpawnMobile(p.X, p.Y, p.Z))
            {
                from.SendLocalizedMessage(501942); // That location is blocked.
                return(false);
            }
            if (from.Holding != null)
            {
                from.SendLocalizedMessage(1071955); // You cannot teleport while dragging an object.
                return(false);
            }

            return(true);
        }
Beispiel #7
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);
            }

            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(1061282); // You cannot use the Sacred Journey ability to flee from combat.
                return(false);
            }

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

            return(SpellHelper.CheckTravel(Caster, TravelCheckType.RecallFrom));
        }
Beispiel #8
0
        public override bool OnMoveOver(Mobile m)
        {
            if (this.Movable)
            {
                m.SendMessage("This must be locked down in a house to use!");
            }
            else if (m_Active)
            {
                if (!m_Creatures && !m.Player)
                {
                    return(true);
                }
                else if (m_Owner == null)
                {
                    m.SendMessage("This teleporter does not lead anywhere.");
                    return(true);
                }
                else if (m_CombatCheck && SpellHelper.CheckCombat(m))
                {
                    m.SendLocalizedMessage(1005564, "", 0x22);                       // Wouldst thou flee during the heat of battle??
                    return(true);
                }
                else if (!SpellHelper.CheckMulti(m_PointDest, m_MapDest))
                {
                    m_Owner     = null;
                    m_MapDest   = null;
                    m_PointDest = new Point3D(0, 0, 0);
                    m.SendMessage("The home at the other end must have been demolished!");
                    return(true);
                }
                else if (CheckAccess(m))
                {
                    StartTeleport(m);
                    return(false);
                }
            }

            return(true);
        }
Beispiel #9
0
        public virtual bool CanTeleport(Mobile m)
        {
            if (!m_Creatures && !m.Player)
            {
                return(false);
            }
            else if (m_CriminalCheck && m.Criminal)
            {
                m.SendLocalizedMessage(1005561, "", 0x22);                 // Thou'rt a criminal and cannot escape so easily.
                return(false);
            }
            else if (m_CombatCheck && SpellHelper.CheckCombat(m))
            {
                m.SendLocalizedMessage(1005564, "", 0x22);                 // Wouldst thou flee during the heat of battle??
                return(false);
            }
            else if (Siege.SiegeShard && m_MapDest == Map.Trammel)
            {
            }

            return(true);
        }
Beispiel #10
0
        public virtual bool CanUseGate(Mobile m, bool message)
        {
            if (m.IsStaff())
            {
                //Staff can always use a gate!
                return(true);
            }

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

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

            if (m.Spell != null)
            {
                // You are too busy to do that at the moment.
                m.SendLocalizedMessage(1049616);
                return(false);
            }

            if (m.Holding != null)
            {
                // You cannot teleport while dragging an object.
                m.SendLocalizedMessage(1071955);
                return(false);
            }

            return(true);
        }
Beispiel #11
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m_Active)
            {
                if (m_Creatures || m.Player)
                {
                    //return true;
                    if (m_CombatCheck && SpellHelper.CheckCombat(m))
                    {
                        m.SendLocalizedMessage(1005564, "", 0x22);                           // Wouldst thou flee during the heat of battle??
                        //return true;
                    }
                    else
                    {
                        StartTeleport(m);
                        return(m_Delay != TimeSpan.Zero);
                    }
                    //return false;
                }
            }

            return(true);
        }
Beispiel #12
0
        public virtual bool CanTeleport(Mobile m)
        {
            if (!m_Active)
            {
                return(false);
            }

            if (!m_Creatures && !m.Player)
            {
                return(false);
            }

            if (m.Holding != null)
            {
                m.SendLocalizedMessage(1071955); // You cannot teleport while dragging an object.
                return(false);
            }

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

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

            if (!CheckDestination(m) || (Siege.SiegeShard && m_MapDest == Map.Trammel))
            {
                return(false);
            }

            return(true);
        }
Beispiel #13
0
            private bool CheckTravel(Point3D p)
            {
                if (!User.InRange(Jawbone.GetWorldLocation(), 2) || User.Map != Jawbone.Map)
                {
                    User.SendLocalizedMessage(500295); // You are too far away to do that.
                }
                else if (SpellHelper.RestrictRedTravel && User.Murderer)
                {
                    User.SendLocalizedMessage(1019004); // You are not allowed to travel there.
                }
                else if (Factions.Sigil.ExistsOn(User))
                {
                    User.SendLocalizedMessage(1019004); // You are not allowed to travel there.
                }
                else if (User.Criminal)
                {
                    User.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
                }
                else if (SpellHelper.CheckCombat(User))
                {
                    User.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
                }
                else if (User.Spell != null)
                {
                    User.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
                }
                else if (User.Map == Map.Ilshenar && User.InRange(p, 1))
                {
                    User.SendLocalizedMessage(1019003); // You are already there.
                }
                else
                {
                    return(true);
                }

                return(false);
            }
Beispiel #14
0
        public bool UseGate(Mobile m)
        {
            if (m.IsStaff())
            {
                //Staff can always use a gate!
            }
            else if (m.Criminal)
            {
                m.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
                return(false);
            }
            else if (SpellHelper.CheckCombat(m))
            {
                m.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
                return(false);
            }
            else if (m.Spell != null)
            {
                m.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
                return(false);
            }
            else if (m.Holding != null)
            {
                m.SendLocalizedMessage(1071955); // You cannot teleport while dragging an object.
                return(false);
            }

            m.CloseGump(typeof(MoongateGump));
            m.SendGump(new MoongateGump(m, this));

            if (!m.Hidden || m.IsPlayer())
            {
                Effects.PlaySound(m.Location, m.Map, 0x20E);
            }

            return(true);
        }
Beispiel #15
0
        public override bool OnMoveOver(Mobile m)
        {
            if (Movable)
            {
                m.SendMessage("This must be locked down in a house to use!");
            }
            else if (m_Active)
            {
                if (!m_Creatures && !m.Player)
                {
                    return(true);
                }
                if (m_CombatCheck && SpellHelper.CheckCombat(m))
                {
                    m.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
                    return(true);
                }

                StartTeleport(m);
                return(false);
            }

            return(true);
        }
        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 (CheckSequence())
            {
                Caster.SendMessage("You open a mystical portal in a mushroom circle");                   // You open a magical gate to another location

                Effects.PlaySound(Caster.Location, Caster.Map, 0x1);
                int mushx;
                int mushy;
                int mushz;


                InternalItem firstGatea = new InternalItem(loc, map);
                mushx             = Caster.X;
                mushy             = Caster.Y;
                mushz             = Caster.Z;
                firstGatea.ItemID = 0xD10;
                Point3D mushxyz = new Point3D(mushx, mushy, mushz);
                firstGatea.MoveToWorld(mushxyz, Caster.Map);
                InternalItem firstGateb = new InternalItem(loc, map);
                mushx             = Caster.X;
                mushy             = Caster.Y;
                firstGateb.ItemID = 0x373A;
                mushz             = Caster.Z + 1;
                Point3D mushxyza = new Point3D(mushx, mushy, mushz);
                firstGateb.MoveToWorld(mushxyza, Caster.Map);
                InternalItem firstGatec = new InternalItem(loc, map);
                mushx             = Caster.X - 1;
                firstGatec.ItemID = 0xD11;
                mushy             = Caster.Y + 1;
                mushz             = Caster.Z;
                Point3D mushxyzb = new Point3D(mushx, mushy, mushz);
                firstGatec.MoveToWorld(mushxyzb, Caster.Map);
                InternalItem firstGated = new InternalItem(loc, map);
                firstGated.ItemID = 0xD0C;
                mushx             = Caster.X;
                mushy             = Caster.Y + 2;
                mushz             = Caster.Z;
                Point3D mushxyzc = new Point3D(mushx, mushy, mushz);
                firstGated.MoveToWorld(mushxyzc, Caster.Map);
                InternalItem firstGatee = new InternalItem(loc, map);
                mushx             = Caster.X + 1;
                firstGatee.ItemID = 0xD0D;
                mushy             = Caster.Y + 1;
                mushz             = Caster.Z;
                Point3D mushxyzd = new Point3D(mushx, mushy, mushz);
                firstGatee.MoveToWorld(mushxyzd, Caster.Map);
                InternalItem firstGatef = new InternalItem(loc, map);
                firstGatef.ItemID = 0xD0E;
                mushx             = Caster.X + 2;
                mushy             = Caster.Y;
                mushz             = Caster.Z;
                Point3D mushxyze = new Point3D(mushx, mushy, mushz);
                firstGatef.MoveToWorld(mushxyze, Caster.Map);
                InternalItem firstGateg = new InternalItem(loc, map);
                mushx             = Caster.X + 1;
                firstGateg.ItemID = 0xD0F;

                mushy = Caster.Y - 1;
                mushz = Caster.Z;
                Point3D mushxyzf = new Point3D(mushx, mushy, mushz);
                firstGateg.MoveToWorld(mushxyzf, Caster.Map);



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

                InternalItem secondGatea = new InternalItem(Caster.Location, Caster.Map);
                mushx = loc.X;
                mushy = loc.Y;
                mushz = loc.Z;
                secondGatea.ItemID = 0xD10;

                Point3D mushaxyz = new Point3D(mushx, mushy, mushz);
                secondGatea.MoveToWorld(mushaxyz, map);
                InternalItem secondGateb = new InternalItem(Caster.Location, Caster.Map);
                mushx = loc.X;
                mushy = loc.Y;
                secondGateb.ItemID = 0x373A;
                mushz = loc.Z + 1;
                Point3D mushaxyza = new Point3D(mushx, mushy, mushz);
                secondGateb.MoveToWorld(mushaxyza, map);
                InternalItem secondGatec = new InternalItem(Caster.Location, Caster.Map);
                mushx = loc.X - 1;
                secondGatec.ItemID = 0xD11;
                mushy = loc.Y + 1;
                mushz = loc.Z - 1;
                Point3D mushaxyzb = new Point3D(mushx, mushy, mushz);
                secondGatec.MoveToWorld(mushaxyzb, map);
                InternalItem secondGated = new InternalItem(Caster.Location, Caster.Map);
                mushx = loc.X;
                mushy = loc.Y + 2;
                secondGated.ItemID = 0xD0C;
                mushz = loc.Z;
                Point3D mushaxyzc = new Point3D(mushx, mushy, mushz);
                secondGated.MoveToWorld(mushaxyzc, map);
                InternalItem secondGatee = new InternalItem(Caster.Location, Caster.Map);
                mushx = loc.X + 1;
                mushy = loc.Y + 1;
                mushz = loc.Z;
                secondGatee.ItemID = 0xD0D;
                Point3D mushaxyzd = new Point3D(mushx, mushy, mushz);
                secondGatee.MoveToWorld(mushaxyzd, map);
                InternalItem secondGatef = new InternalItem(Caster.Location, Caster.Map);
                mushx = loc.X + 2;
                mushy = loc.Y;
                mushz = loc.Z;
                secondGatef.ItemID = 0xD0E;
                Point3D mushaxyze = new Point3D(mushx, mushy, mushz);
                secondGatef.MoveToWorld(mushaxyze, map);
                InternalItem secondGateg = new InternalItem(Caster.Location, Caster.Map);
                mushx = loc.X + 1;
                secondGateg.ItemID = 0xD0F;
                mushy = loc.Y - 1;
                mushz = loc.Z;
                Point3D mushaxyzf = new Point3D(mushx, mushy, mushz);
                secondGateg.MoveToWorld(mushaxyzf, map);
            }

            FinishSequence();
        }
Beispiel #17
0
        public void Effect(Point3D loc, Map map, bool checkMulti, bool isboatkey = false)
        {
            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(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 (SpellHelper.RestrictRedTravel && Caster.Murderer && map.Rules != MapRules.FeluccaRules)
            {
                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 (Misc.WeightOverloading.IsOverloaded(Caster))
            {
                Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
            }
            else if (!map.CanSpawnMobile(loc.X, loc.Y, loc.Z) && !isboatkey)
            {
                Caster.SendLocalizedMessage(501025); // Something is blocking the location.
            }
            else if (checkMulti && SpellHelper.CheckMulti(loc, map) && !isboatkey)
            {
                Caster.SendLocalizedMessage(501025); // Something is blocking the location.
            }
            else if (m_Book != null && m_Book.CurCharges <= 0)
            {
                Caster.SendLocalizedMessage(502412); // There are no charges left on that item.
            }
            else if (Caster.Holding != null)
            {
                Caster.SendLocalizedMessage(1071955); // You cannot teleport while dragging an object.
            }
            else if (Engines.CityLoyalty.CityTradeSystem.HasTrade(Caster))
            {
                Caster.SendLocalizedMessage(1151733); // You cannot do that while carrying a Trade Order.
            }
            else if (CheckSequence())
            {
                BaseCreature.TeleportPets(Caster, loc, map, true);

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

                if (m_SearchMap != null)
                {
                    m_SearchMap.OnBeforeTravel(Caster);
                }

                if (m_AuctionMap != null)
                {
                    m_AuctionMap.OnBeforeTravel(Caster);
                }

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

            FinishSequence();
        }
Beispiel #18
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            m_From.CloseGump(typeof(ShardTravelGump));
            int     id = info.ButtonID;
            Point3D p;
            Map     map;

            if (id < 100)
            {
                if (id == 2)
                {
                    m_From.SendGump(new ShardTravelGump(m_From, m_Page - 1, X, Y, m_TravelMap));
                }
                if (id == 3)
                {
                    m_From.SendGump(new ShardTravelGump(m_From, m_Page + 1, X, Y, m_TravelMap));
                }
                if (id == 4)
                {
                    m_From.SendGump(new ShardTravelGump(m_From, m_Page, X, Y, m_TravelMap));
                    m_From.SendGump(new MapTravelHelp(X, Y));
                }
            }
            else if (id < 10000)
            {
                m_From.SendGump(new ShardTravelGump(m_From, m_Page, X, Y, m_TravelMap, id));
            }
            else if (id < 20000)
            {
                // Here begins the teleport

                string message = "";

                try
                {
                    id -= 10000;
                    bool             NonGM = m_From.AccessLevel < AccessLevel.GameMaster;
                    ShardTravelEntry entry = m_TravelMap.GetEntry(id);
                    if (entry == null)
                    {
                        return;
                    }

                    p   = entry.Destination;
                    map = entry.Map;

                    if (NonGM && Factions.Sigil.ExistsOn(m_From))
                    {
                        m_From.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
                    }
                    else if (NonGM && map == Map.Felucca && m_From is PlayerMobile && ((PlayerMobile)m_From).Young)
                    {
                        m_From.SendLocalizedMessage(1049543);
                        // You decide against traveling to Felucca while you are still young.
                    }
                    else if (NonGM && m_From.Kills >= 5 && map != Map.Felucca)
                    {
                        m_From.SendLocalizedMessage(1019004); // You are not allowed to travel there.
                    }
                    else if (NonGM && m_From.Criminal)
                    {
                        m_From.SendLocalizedMessage(1005561, "", 0x22);
                        // Thou'rt a criminal and cannot escape so easily.
                    }
                    else if (NonGM && SpellHelper.CheckCombat(m_From))
                    {
                        m_From.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
                    }
                    else if (NonGM && Misc.WeightOverloading.IsOverloaded(m_From))
                    {
                        m_From.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
                    }
                    else if (!map.CanSpawnMobile(p.X, p.Y, p.Z))
                    {
                        m_From.SendLocalizedMessage(501942); // That location is blocked.
                    }
                    else if (m_From.Holding != null)
                    {
                        m_From.SendLocalizedMessage(1071955); // You cannot teleport while dragging an object.
                    }
                    else if (entry.Unlocked || !NonGM)
                    {
                        if (NonGM && CHARGE)                         // Do not charge GMs - they might complain...
                        {
                            Container pack = m_From.Backpack;
                            if (pack == null || (pack.ConsumeTotal(payTypes, payAmounts) > 0))
                            {
                                if (pack == null)
                                {
                                    message = "Your pack is null???";
                                }
                                else
                                {
                                    message = string.Format("Using the map to teleport costs {0}.", PAYTHIS);
                                }
                                m_From.SendGump(new ShardTravelGump(m_From, m_Page, X, Y, m_TravelMap, m_Detail, message));
                                return;
                            }
                            // Payment was successful if we reach here ...
                        }
                        m_From.MoveToWorld(p, map);
                        message = string.Format("{0} have been moved to X:{1}, Y:{2}, Z:{3}, Map: {4}",
                                                CHARGE ? "You paid " + PAYTHIS + " and" : "You", p.X, p.Y, p.Z, map);
                    }
                }
                catch
                {
                    message = string.Format("Teleport failed.");
                }

                m_From.SendGump(new ShardTravelGump(m_From, m_Page, X, Y, m_TravelMap, m_Detail, message));
            }
            else if (id >= 30000 && id < 40000)
            {
                id -= 30000;

                ShardTravelEntry entry = m_TravelMap.GetEntry(id);
                if (entry == null)
                {
                    return;
                }

                p   = entry.Destination;
                map = entry.Map;

                string message = "";
                if (map != m_From.Map)
                {
                    message = "You must be on the same map to Explore there.";
                }
                else
                {
                    if (m_From.InRange(p, 7))
                    {
                        entry.Unlocked   = true;
                        entry.Discovered = true; // We do this in case a GM unlocked the location before it was discovered.
                        message          = string.Format("You have unlocked a new location: {0}.", entry.Name);
                    }
                    else
                    {
                        int distance = (int)m_From.GetDistanceToSqrt(p);
                        message = string.Format("That location is still approximately {0} paces to the {1}.",
                                                distance, MapTravelHelp.GetDirection(m_From, p));
                    }
                }
                m_From.SendGump(new ShardTravelGump(m_From, m_Page, X, Y, m_TravelMap, m_Detail, message));
            }
        }
Beispiel #19
0
        public void Effect(Point3D loc, Map map, bool checkMulti, bool isboatkey = false)
        {
            if (Server.Engines.VvV.VvVSigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
            }
            else if (map == null)
            {
                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 (SpellHelper.RestrictRedTravel && Caster.Murderer && map.Rules != MapRules.FeluccaRules)
            {
                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(1061282); // You cannot use the Sacred Journey ability to flee from combat.
            }
            else if (Misc.WeightOverloading.IsOverloaded(Caster))
            {
                Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
            }
            else if (!map.CanSpawnMobile(loc.X, loc.Y, loc.Z) && !isboatkey)
            {
                Caster.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if ((checkMulti && SpellHelper.CheckMulti(loc, map)) && !isboatkey)
            {
                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 (Engines.CityLoyalty.CityTradeSystem.HasTrade(Caster))
            {
                Caster.SendLocalizedMessage(1151733); // You cannot do that while carrying a Trade Order.
            }
            else if (CheckSequence())
            {
                BaseCreature.TeleportPets(Caster, loc, map, true);

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

                Effects.SendLocationParticles(EffectItem.Create(Caster.Location, Caster.Map, EffectItem.DefaultDuration), 0, 0, 0, 5033);

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

            FinishSequence();
        }
Beispiel #20
0
        private bool CheckUse(Mobile from, bool successMessage)
        {
            BraceletOfBinding bound = Bound;

            if (bound == null)
            {
                return(false);
            }

            Mobile boundRoot = bound.RootParent as Mobile;

            if (Charges == 0)
            {
                from.SendLocalizedMessage(1054005);                   // The bracelet glows black. It must be charged before it can be used again.
                return(false);
            }
            else if (from.FindItemOnLayer(Layer.Bracelet) != this)
            {
                from.SendLocalizedMessage(1054004);                   // You must equip the bracelet in order to use its power.
                return(false);
            }
            else if (boundRoot == null || boundRoot.NetState == null || boundRoot.FindItemOnLayer(Layer.Bracelet) != bound)
            {
                from.SendLocalizedMessage(1054006);                   // The bracelet emits a red glow. The bracelet's twin is not available for transport.
                return(false);
            }
            else if (!Core.AOS && from.Map != boundRoot.Map)
            {
                from.SendLocalizedMessage(1054014);                   // The bracelet glows black. The bracelet's target is on another facet.
                return(false);
            }
            else if (Sigil.ExistsOn(from))
            {
                from.SendLocalizedMessage(1061632);                   // You can't do that while carrying the sigil.
                return(false);
            }
            else if (!SpellHelper.CheckTravel(from, TravelCheckType.RecallFrom))
            {
                return(false);
            }
            else if (!SpellHelper.CheckTravel(from, boundRoot.Map, boundRoot.Location, TravelCheckType.RecallTo))
            {
                return(false);
            }
            else if (from.Region is CustomRegion && !((CustomRegion)from.Region).Controller.CanUseStuckMenu)
            {
                from.SendAsciiMessage("You can't use the bracelet in this region");
                return(false);
            }
            else if (boundRoot.Region is CustomRegion && !((CustomRegion)boundRoot.Region).Controller.CanUseStuckMenu)
            {
                from.SendLocalizedMessage(1019004); // You are not allowed to travel there.
                return(false);
            }

            /*
             *          else if ( boundRoot.Map == Map.Felucca && from is PlayerMobile && ((PlayerMobile)from).Young )
             *          {
             *                  from.SendLocalizedMessage( 1049543 ); // You decide against traveling to Felucca while you are still young.
             *                  return false;
             *          }
             *          else if ( Misc.NotorietyHandlers.IsGuardCandidate(from) && boundRoot.Map != Map.Felucca )
             *          {
             *                  from.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
             *                  return false;
             *          }*/
            else if (from.Criminal)
            {
                from.SendLocalizedMessage(1005561, "", 0x22);                   // Thou'rt a criminal and cannot escape so easily.
                return(false);
            }
            else if (SpellHelper.CheckCombat(from))
            {
                from.SendLocalizedMessage(1005564, "", 0x22);                   // Wouldst thou flee during the heat of battle??
                return(false);
            }
            else if (WeightOverloading.IsOverloaded(from))
            {
                from.SendLocalizedMessage(502359, "", 0x22);                   // Thou art too encumbered to move.
                return(false);
            }
            else if (from.Region.IsPartOf(typeof(Jail)))
            {
                from.SendLocalizedMessage(1114345, "", 0x35); // You'll need a better jailbreak plan than that!
                return(false);
            }
            else if (boundRoot.Region.IsPartOf(typeof(Jail)))
            {
                from.SendLocalizedMessage(1019004);                   // You are not allowed to travel there.
                return(false);
            }
            else
            {
                if (successMessage)
                {
                    from.SendLocalizedMessage(1054015);                       // The bracelet's twin is available for transport.
                }
                return(true);
            }
        }
Beispiel #21
0
        public void Effect(Point3D loc, Map map, bool checkMulti)
        {
            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(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();
        }
Beispiel #22
0
        public void Effect(Point3D loc, Map map, bool checkMulti)
        {
            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 (!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.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.
            }
            // Genova: restricao para magia em mundos restritos.
            else if (PersonagemEmMundoRestrito.Confirmar(Caster))
            {
                Caster.SendMessage(PersonagemEmMundoRestrito.Mensagem);
            }
            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();
        }
        public bool UseGate(Mobile from)
        {
            //PMEntry m_entry;
            //PMList m_list;

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

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

            else if (from.Spell != null)
            {
                from.SendLocalizedMessage(1049616);                   // You are too busy to do that at the moment.
                return(false);
            }

            PlayerMobile player = from as PlayerMobile;

            if (player != null)
            {
                if (player.RecallRestrictionExpiration > DateTime.UtcNow)
                {
                    int minutes = player.RecallRestrictionExpiration.Subtract(DateTime.UtcNow).Minutes;
                    int seconds = player.RecallRestrictionExpiration.Subtract(DateTime.UtcNow).Seconds;

                    string sTime = "";

                    if (minutes > 1)
                    {
                        sTime += minutes.ToString() + " minutes ";
                    }

                    else if (minutes == 1)
                    {
                        sTime += minutes.ToString() + " minute ";
                    }

                    if (seconds > 1)
                    {
                        sTime += seconds.ToString() + " seconds ";
                    }

                    else if (seconds == 1)
                    {
                        sTime += seconds.ToString() + " second ";
                    }

                    sTime = sTime.Trim();

                    if (sTime != "")
                    {
                        player.SendMessage("You are unable to use this moongate for another " + sTime + ".");
                    }

                    return(false);
                }
            }

            from.CloseGump(typeof(MoongateGump));
            from.SendGump(new MoongateGump(from, this));

            if (!from.Hidden || from.AccessLevel == AccessLevel.Player)
            {
                Effects.PlaySound(from.Location, from.Map, 0x20E);
            }

            return(true);
        }
Beispiel #24
0
        public void Effect(Point3D loc, Map map, bool checkMulti, bool isboatkey = false)
        {
            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(1005570); // You can not gate to another facet.
            }
            else if (!SpellHelper.CheckTravel(this.Caster, TravelCheckType.GateFrom))
            {
            }
            else if (!SpellHelper.CheckTravel(this.Caster, map, loc, TravelCheckType.GateTo))
            {
            }
            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 (!map.CanSpawnMobile(loc.X, loc.Y, loc.Z) && !isboatkey)
            {
                this.Caster.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if ((checkMulti && SpellHelper.CheckMulti(loc, map)) && !isboatkey)
            {
                this.Caster.SendLocalizedMessage(501942);                                                                  // That location is blocked.
            }
            else if (Core.SE && (this.GateExistsAt(map, loc) || this.GateExistsAt(this.Caster.Map, this.Caster.Location))) // SE restricted stacking gates
            {
                this.Caster.SendLocalizedMessage(1071242);                                                                 // There is already a gate there.
            }
            else if (Server.Engines.CityLoyalty.CityTradeSystem.HasTrade(Caster))
            {
                Caster.SendLocalizedMessage(1151733); // You cannot do that while carrying a Trade Order.
            }
            else if (this.CheckSequence())
            {
                this.Caster.SendLocalizedMessage(501024); // You open a magical gate to another location

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

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

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

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

                firstGate.LinkedGate  = secondGate;
                secondGate.LinkedGate = firstGate;

                firstGate.BoatGate  = BaseBoat.FindBoatAt(firstGate, firstGate.Map) != null;
                secondGate.BoatGate = BaseBoat.FindBoatAt(secondGate, secondGate.Map) != null;
            }

            this.FinishSequence();
        }
Beispiel #25
0
        public static void EventSink_Speech(SpeechEventArgs args)
        {
            Mobile       from    = args.Mobile;
            PlayerMobile speaker = from as PlayerMobile;

            if (speaker == null)
            {
                return;                  // in case they are pseudoseering
            }
            int[] keywords = args.Keywords;

            if (args.Speech.ToLower().IndexOf("i wish to buy my head") > -1)
            {
                var turnedinhead = BaseShieldGuard.PendingStatloss.FirstOrDefault(x => x.HeadOwner == speaker);
                if (turnedinhead != null)
                {
                    if (Banker.Withdraw(speaker, typeof(Gold), 30000))
                    {
                        BaseShieldGuard.PendingStatloss.Remove(turnedinhead);
                        from.SendMessage(61, "You have successfully purchased your head back from the guards.");
                        turnedinhead.TurnedIn.BankBox.DropItem(new Gold(25000));
                        turnedinhead.TurnedIn.SendMessage(61, "You have received 25,000gp for the head of " + from.RawName + ".");
                    }
                    else
                    {
                        from.SendMessage(61, "You do not have enough gold to buy back your head from the guards!");
                    }
                }
                else
                {
                    foreach (Head2 head in Head2.AllHeads)
                    {
                        if (head == null)
                        {
                            continue;
                        }
                        if (head.Player == from)
                        {
                            from.SendMessage("Select a player with whom you wish to negotiate for your head!");
                            from.CloseGump(typeof(HeadOwnerListGump));
                            from.SendGump(new HeadOwnerListGump(from));
                            return;
                        }
                    }
                    from.SendMessage("Nobody in possession of your head was found.");
                }
            }

            for (int i = 0; i < keywords.Length; ++i)
            {
                switch (keywords[i])
                {
                case 0x002A:                         // *i resign from my guild*
                {
                    if (from.Guild != null)
                    {
                        if (SpellHelper.CheckCombat(from) || PublicMoongate.CheckCombat(from))
                        {
                            from.SendMessage("You cannot leave your guild while in combat.");
                        }
                        else
                        {
                            ((Guild)from.Guild).RemoveMember(from);
                        }
                    }

                    break;
                }

                case 0x0032:                         // *i must consider my sins*
                {
                    speaker.CheckKillDecay();
                    from.SendMessage(32, "Murder Counts : {0}", from.Kills);
                    if (speaker.InStat)      //check to see if statend time is still greater than current time
                    {
                        TimeSpan remaining = (speaker.StatEnd - DateTime.UtcNow);
                        from.SendMessage(32, "You are in statloss for: {0}", FormatTimeSpan(remaining));
                    }
                    else
                    {      //always try to clear the stat loss at this time
                        // note that it's checked on a 30 minute timer (in FoodDecay.cs)
                        // so this could save them a little time
                        BaseShieldGuard.StatLossDecay(speaker);
                    }

                    /*if ( from.ShortTermMurders < Mobile.MurderCount )
                     * {
                     *      if ( from.Kills < Mobile.MurderCount ) // not red, no stat loss
                     *      {
                     *              if ( from.ShortTermMurders <= 0 )
                     *                      from.SendLocalizedMessage( 502122, Notoriety.Hues[Notoriety.Innocent] ); // Fear not, thou hast not slain the innocent.
                     *              else
                     *                      from.SendLocalizedMessage( 502124, Notoriety.Hues[Notoriety.Innocent] ); // Fear not, thou hast not slain the innocent in some time...
                     *      }
                     *      else
                     *              from.SendLocalizedMessage( 502123, Notoriety.Hues[Notoriety.Innocent] ); // You are known throughout the land as a murderous brigand.
                     * }
                     * else // stat loss
                     * {
                     *      if ( from.Kills < Mobile.MurderCount ) //not red
                     *              from.SendLocalizedMessage( 502126, Notoriety.Hues[Notoriety.Murderer] ); // If thou should return to the land of the living, the innocent shall wreak havoc upon thy soul.
                     *      else
                     *              from.SendLocalizedMessage( 502123, Notoriety.Hues[Notoriety.Murderer] ); // You are known throughout the land as a murderous brigand.
                     * }
                     * /*
                     * if( !Core.SE )
                     * {
                     *      from.SendMessage( "Short Term Murders : {0}", from.ShortTermMurders );
                     *      from.SendMessage( "Long Term Murders : {0}",  from.Kills );
                     * }
                     * else
                     * {
                     *      from.SendMessage( 0x3B2, "Short Term Murders: {0} Long Term Murders: {1}", from.ShortTermMurders, from.Kills );
                     * }
                     */
                    break;
                }

                case 0x0035:                         // i renounce my young player status*
                {
                    if (from is PlayerMobile && ((PlayerMobile)from).Young && !from.HasGump(typeof(RenounceYoungGump)))
                    {
                        from.SendGump(new RenounceYoungGump());
                    }

                    break;
                }
                }
            }
        }
Beispiel #26
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (info.ButtonID == 0) // Cancel
            {
                return;
            }
            if (m_Mobile.Deleted || m_Moongate.Deleted || m_Mobile.Map == null)
            {
                return;
            }

            int[] switches = info.Switches;

            if (switches.Length == 0)
            {
                return;
            }

            int switchID  = switches[0];
            int listIndex = switchID / 100;
            int listEntry = switchID % 100;

            if (listIndex < 0 || listIndex >= m_Lists.Length)
            {
                return;
            }

            var list = m_Lists[listIndex];

            if (listEntry < 0 || listEntry >= list.Entries.Length)
            {
                return;
            }

            var entry = list.Entries[listEntry];
            var map   = entry.Map ?? list.Map;

            if (m_Mobile.Map == map && m_Mobile.InRange(entry.Location, 1))
            {
                m_Mobile.SendLocalizedMessage(1019003); // You are already there.
                return;
            }
            if (m_Mobile.IsStaff())
            {
                //Staff can always use a gate!
            }
            else if (!m_Mobile.InRange(m_Moongate.GetWorldLocation(), 1) || m_Mobile.Map != m_Moongate.Map)
            {
                m_Mobile.SendLocalizedMessage(1019002); // You are too far away to use the gate.
                return;
            }
            else if (m_Mobile.Player && SpellHelper.RestrictRedTravel && m_Mobile.Murderer && map != Map.Felucca && !Siege.SiegeShard)
            {
                m_Mobile.SendLocalizedMessage(1019004); // You are not allowed to travel there.
                return;
            }
            else if (Engines.VvV.VvVSigil.ExistsOn(m_Mobile) && map != Engines.VvV.ViceVsVirtueSystem.Facet)
            {
                m_Mobile.SendLocalizedMessage(1019004); // You are not allowed to travel there.
                return;
            }
            else if (m_Mobile.Criminal)
            {
                m_Mobile.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
                return;
            }
            else if (SpellHelper.CheckCombat(m_Mobile))
            {
                m_Mobile.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
                return;
            }
            else if (m_Mobile.Spell != null)
            {
                m_Mobile.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
                return;
            }

            BaseCreature.TeleportPets(m_Mobile, entry.Location, map);

            m_Mobile.Combatant = null;
            m_Mobile.Warmode   = false;
            m_Mobile.Hidden    = true;

            m_Mobile.MoveToWorld(entry.Location, map);

            Effects.PlaySound(entry.Location, map, 0x1FE);

            CityTradeSystem.OnQuickTravelUsed(m_Mobile);
        }
        private bool CheckUse(Mobile from, bool successMessage)
        {
            BraceletOfBinding bound = Bound;

            if (bound == null)
            {
                return(false);
            }

            Mobile boundRoot = bound.RootParent as Mobile;

            if (Charges == 0)
            {
                from.SendLocalizedMessage(1054005); // The bracelet glows black. It must be charged before it can be used again.
                return(false);
            }
            else if (from.FindItemOnLayer(Layer.Bracelet) != this)
            {
                from.SendLocalizedMessage(1054004); // You must equip the bracelet in order to use its power.
                return(false);
            }
            else if (boundRoot == null || boundRoot.NetState == null || boundRoot.FindItemOnLayer(Layer.Bracelet) != bound)
            {
                from.SendLocalizedMessage(1054006); // The bracelet emits a red glow. The bracelet's twin is not available for transport.
                return(false);
            }
            else if (!Core.AOS && from.Map != boundRoot.Map)
            {
                from.SendLocalizedMessage(1054014); // The bracelet glows black. The bracelet's target is on another facet.
                return(false);
            }
            else if (!SpellHelper.CheckTravel(from, TravelCheckType.RecallFrom))
            {
                return(false);
            }
            else if (!SpellHelper.CheckTravel(from, boundRoot.Map, boundRoot.Location, TravelCheckType.RecallTo))
            {
                return(false);
            }
            else if (boundRoot.Map == Map.Felucca && from is PlayerMobile && ((PlayerMobile)from).Young)
            {
                from.SendLocalizedMessage(1049543); // You decide against traveling to Felucca while you are still young.
                return(false);
            }
            else if (SpellHelper.RestrictRedTravel && from.Murderer && boundRoot.Map != Map.Felucca)
            {
                from.SendLocalizedMessage(1019004); // You are not allowed to travel there.
                return(false);
            }
            else if (from.Criminal)
            {
                from.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
                return(false);
            }
            else if (SpellHelper.CheckCombat(from))
            {
                from.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
                return(false);
            }
            else if (Server.Misc.WeightOverloading.IsOverloaded(from))
            {
                from.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
                return(false);
            }
            else if (from.Region.IsPartOf <Server.Regions.Jail>())
            {
                from.SendLocalizedMessage(1114345, "", 0x35); // You'll need a better jailbreak plan than that!
                return(false);
            }
            else if (boundRoot.Region.IsPartOf <Server.Regions.Jail>())
            {
                from.SendLocalizedMessage(1019004); // You are not allowed to travel there.
                return(false);
            }
            else
            {
                if (successMessage)
                {
                    from.SendLocalizedMessage(1054015); // The bracelet's twin is available for transport.
                }
                return(true);
            }
        }
Beispiel #28
0
        public virtual bool ValidateUse(Mobile m, bool message)
        {
            BaseHouse house = BaseHouse.FindHouseAt(this);

            if (house == null || !IsLockedDown)
            {
                if (message)
                {
                    m.SendMessage("This must be locked down in a house to use!");
                }

                return(false);
            }

            if (!house.HasSecureAccess(m, m_Level))
            {
                if (message)
                {
                    m.SendLocalizedMessage(503301, "", 0x22); // You don't have permission to do that.
                }

                return(false);
            }

            if (Sigil.ExistsOn(m))
            {
                if (message)
                {
                    m.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
                }

                return(false);
            }

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

                return(false);
            }

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

                return(false);
            }

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

                return(false);
            }

            if (m.Spell != null)
            {
                if (message)
                {
                    m.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
                }

                return(false);
            }

            if (Server.Engines.CityLoyalty.CityTradeSystem.HasTrade(m))
            {
                if (message)
                {
                    m.SendLocalizedMessage(1151733); // You cannot do that while carrying a Trade Order.
                }

                return(false);
            }

            return(true);
        }
Beispiel #29
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (info.ButtonID == 0)               // Cancel
            {
                return;
            }
            else if (m_Mobile.Deleted || m_Moongate.Deleted || m_Mobile.Map == null)
            {
                return;
            }

            int[] switches = info.Switches;

            if (switches.Length == 0)
            {
                return;
            }

            int switchID  = switches[0];
            int listIndex = switchID / 100;
            int listEntry = switchID % 100;

            if (listIndex < 0 || listIndex >= m_Lists.Length)
            {
                return;
            }

            PMList list = m_Lists[listIndex];

            if (listEntry < 0 || listEntry >= list.Entries.Length)
            {
                return;
            }

            PMEntry entry = list.Entries[listEntry];

            if (!m_Mobile.InRange(m_Moongate.GetWorldLocation(), 1) || m_Mobile.Map != m_Moongate.Map)
            {
                m_Mobile.SendLocalizedMessage(1019002);                   // You are too far away to use the gate.
            }
            else if (m_Mobile.Player && m_Mobile.Kills >= 5 && list.Map != Map.Felucca)
            {
                m_Mobile.SendLocalizedMessage(1019004);                   // You are not allowed to travel there.
            }
            else if (Factions.Sigil.ExistsOn(m_Mobile) && list.Map != Factions.Faction.Facet)
            {
                m_Mobile.SendLocalizedMessage(1019004);                   // You are not allowed to travel there.
            }
            else if (m_Mobile.Criminal)
            {
                m_Mobile.SendLocalizedMessage(1005561, "", 0x22);                   // Thou'rt a criminal and cannot escape so easily.
            }
            else if (SpellHelper.CheckCombat(m_Mobile))
            {
                m_Mobile.SendLocalizedMessage(1005564, "", 0x22);                   // Wouldst thou flee during the heat of battle??
            }
            else if (m_Mobile.Spell != null)
            {
                m_Mobile.SendLocalizedMessage(1049616);                   // You are too busy to do that at the moment.
            }
            else if (m_Mobile.Map == list.Map && m_Mobile.InRange(entry.Location, 1))
            {
                m_Mobile.SendLocalizedMessage(1019003);                   // You are already there.
            }
            else
            {
                BaseCreature.TeleportPets(m_Mobile, entry.Location, list.Map);

                m_Mobile.Combatant = null;
                m_Mobile.Warmode   = false;
                m_Mobile.Hidden    = true;

                m_Mobile.MoveToWorld(entry.Location, list.Map);

                Effects.PlaySound(entry.Location, list.Map, 0x1FE);
            }
        }
Beispiel #30
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from        = state.Mobile;
            int    buyInAmount = 0;

            // check for casting / combat

            if (from.Spell != null)
            {
                from.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
                return;
            }
            else if (from.Criminal)
            {
                from.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
                return;
            }
            else if (SpellHelper.CheckCombat(from, true))
            {
                from.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
                return;
            }
            else if (!SpellHelper.CheckTravel(from, TravelCheckType.RecallFrom))
            {
                from.SendLocalizedMessage(1019004); // You are not allowed to travel there.
                return;
            }

            if (info.ButtonID == 1)
            {
                int balance = Banker.GetBalance(from);
                if (balance >= m_Game.Dealer.MinBuyIn)
                {
                    try
                    {
                        buyInAmount = Convert.ToInt32((info.TextEntries[0]).Text);
                    }
                    catch
                    {
                        from.SendMessage(0x22, "Use numbers without commas to input your buy-in amount (ie 25000)");
                        return;
                    }

                    if (buyInAmount <= balance && buyInAmount >= m_Game.Dealer.MinBuyIn && buyInAmount <= m_Game.Dealer.MaxBuyIn)
                    {
                        PokerPlayer player = new PokerPlayer(from);
                        player.Gold = buyInAmount;
                        m_Game.AddPlayer(player);
                    }
                    else
                    {
                        from.SendMessage(0x22, "You may not join with that amount of gold. Minimum buy-in: " + Convert.ToString(m_Game.Dealer.MinBuyIn) +
                                         ", Maximum buy-in: " + Convert.ToString(m_Game.Dealer.MaxBuyIn));
                    }
                }
                else
                {
                    from.SendMessage(0x22, "You may not join with that amount of gold. Minimum buy-in: " + Convert.ToString(m_Game.Dealer.MinBuyIn) +
                                     ", Maximum buy-in: " + Convert.ToString(m_Game.Dealer.MaxBuyIn));
                }
            }
            else if (info.ButtonID == 2)
            {
                return;
            }
        }