Exemple #1
0
        private void SpawnKrampus(Mobile m)
        {
            SpawnMap = m.Map;
            Point3D p = m.Location;

            for (int i = 0; i < 25; i++)
            {
                int x = p.X + (Utility.RandomMinMax(-3, 3));
                int y = p.Y + (Utility.RandomMinMax(-3, 3));
                int z = m.Map.GetAverageZ(x, y);

                if (SpawnMap.CanSpawnMobile(x, y, z))
                {
                    p = new Point3D(x, y, z);
                    break;
                }
            }

            SpawnLocation = p;

            foreach (NetState ns in NetState.Instances)
            {
                Mobile mob = ns.Mobile;

                if (mob != null && CityTradeSystem.HasTrade(mob))
                {
                    mob.LocalOverheadMessage(MessageType.Regular, 1150, 1158832, String.Format("{0}\t{1}", WorldLocationInfo.GetLocationString(SpawnLocation, SpawnMap), Sextant.GetCoords(SpawnLocation, SpawnMap))); // *You sense Krampus has been spotted near ~2_where~ at ~1_coords~!*
                }
            }

            Timer.DelayCall(TimeSpan.FromMinutes(5), () =>
            {
                SpawnKrampus();
            });
        }
Exemple #2
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            StopClose();

            if (info.ButtonID == 0)
            {
                if (m_Mobile == m_Sender)
                {
                    m_Mobile.SendLocalizedMessage(1010588); // You choose not to go to any city.
                }
            }
            else if (CityTradeSystem.HasTrade(m_Mobile))
            {
                m_Mobile.SendLocalizedMessage(1151733); // You cannot do that while carrying a Trade Order.
            }
            else
            {
                int index = info.ButtonID - 1;
                StuckMenuEntry[] entries = IsTerMur(m_Mobile) ? m_TerMurEntries : IsInSecondAgeArea(m_Mobile) ? m_T2AEntries : m_Entries;

                if (index >= 0 && index < entries.Length)
                {
                    Teleport(entries[index]);
                }
            }
        }
Exemple #3
0
        public virtual void UseGate(Mobile m)
        {
            ClientFlags flags = m.NetState == null ? ClientFlags.None : m.NetState.Flags;

            if (Engines.VvV.VvVSigil.ExistsOn(m))
            {
                m.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
            }
            else if (CityTradeSystem.HasTrade(m))
            {
                m.SendLocalizedMessage(1151733); // You cannot do that while carrying a Trade Order.
            }
            else if (TargetMap == Map.Felucca && m is PlayerMobile mobile && mobile.Young)
            {
                mobile.SendLocalizedMessage(1049543); // You decide against traveling to Felucca while you are still young.
            }
Exemple #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 (Region.FindRegions(dest, destMap).Any(r => r.Name == "Abyss") && from is PlayerMobile && !((PlayerMobile)from).AbyssEntry)
            {
                from.SendLocalizedMessage(1112226); // Thou must be on a Sacred Quest to pass through.
                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);
        }
Exemple #5
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);
            }

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

            return(true);
        }
Exemple #6
0
        public virtual void UseGate(Mobile m)
        {
            ClientFlags flags = m.NetState == null ? ClientFlags.None : m.NetState.Flags;

            if (Server.Engines.VvV.VvVSigil.ExistsOn(m))
            {
                m.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
            }
            else if (CityTradeSystem.HasTrade(m))
            {
                m.SendLocalizedMessage(1151733); // You cannot do that while carrying a Trade Order.
            }
            else if (TargetMap == Map.Felucca && m is PlayerMobile && ((PlayerMobile)m).Young)
            {
                m.SendLocalizedMessage(1049543); // You decide against traveling to Felucca while you are still young.
            }
            else if ((SpellHelper.RestrictRedTravel && m.Murderer && TargetMap != Map.Felucca && !Siege.SiegeShard) ||
                     (TargetMap == Map.Tokuno && (flags & ClientFlags.Tokuno) == 0) ||
                     (TargetMap == Map.Malas && (flags & ClientFlags.Malas) == 0) ||
                     (TargetMap == Map.Ilshenar && (flags & ClientFlags.Ilshenar) == 0))
            {
                m.SendLocalizedMessage(1019004); // You are not allowed to travel there.
            }
            else if (m.Spell != null || BaseBoat.IsDriving(m))
            {
                m.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
            }
            else if (m.Holding != null)
            {
                m.SendLocalizedMessage(1071955); // You cannot teleport while dragging an object.
            }
            else if (TargetMap != null && TargetMap != Map.Internal)
            {
                OnGateUsed(m);
            }
            else
            {
                m.SendLocalizedMessage(1113744); // This moongate is not yet bonded to the magics of Sosaria.
            }
        }
Exemple #7
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);
        }
        public static void ConstructSystems()
        {
            Moonglow = new Moonglow();
            Britain = new Britain();
            Jhelom = new Jhelom();
            Yew = new Yew();
            Minoc = new Minoc();
            Trinsic = new Trinsic();
            SkaraBrae = new SkaraBrae();
            NewMagincia = new NewMagincia();
            Vesper = new Vesper();

            CityTrading = new CityTradeSystem();
        }
Exemple #9
0
            protected override void OnTick()
            {
                if (DateTime.UtcNow < m_End)
                {
                    m_Mobile.Frozen = true;
                }
                else if (CityTradeSystem.HasTrade(m_Mobile))
                {
                    m_Mobile.Frozen = false;
                    Stop();
                    m_Mobile.SendLocalizedMessage(1151733);                     // You cannot do that while carrying a Trade Order.
                }
                else
                {
                    m_Mobile.Frozen = false;
                    Stop();

                    int     idx  = Utility.Random(m_Destination.Locations.Length);
                    Point3D dest = m_Destination.Locations[idx];

                    Map destMap;
                    if (m_Mobile.Map == Map.Trammel || SpellHelper.IsEodon(m_Mobile.Map, m_Mobile.Location))
                    {
                        destMap = Map.Trammel;
                    }
                    else if (m_Mobile.Map == Map.Felucca)
                    {
                        destMap = Map.Felucca;
                    }
                    else if (m_Mobile.Map == Map.TerMur && !SpellHelper.IsEodon(m_Mobile.Map, m_Mobile.Location))
                    {
                        destMap = Map.TerMur;
                    }
                    else if (m_Mobile.Map == Map.Internal)
                    {
                        destMap = m_Mobile.LogoutMap == Map.Felucca ? Map.Felucca : Map.Trammel;
                    }
                    else
                    {
                        destMap = m_Mobile.Murderer ? Map.Felucca : Map.Trammel;
                    }

                    if (destMap == Map.Trammel && Siege.SiegeShard)
                    {
                        destMap = Map.Felucca;
                    }

                    if (m_Mobile.Map != Map.Internal)
                    {
                        Mobiles.BaseCreature.TeleportPets(m_Mobile, dest, destMap);
                        m_Mobile.MoveToWorld(dest, destMap);
                    }
                    else
                    {
                        // for shards without auto stabling
                        MovePetsOfLoggedCharacter(dest, destMap);

                        m_Mobile.LogoutLocation = dest;
                        m_Mobile.LogoutMap      = destMap;
                    }
                }
            }