コード例 #1
0
ファイル: CorgulRegion.cs プロジェクト: pallop/Servuo
        public void RemovePlayers(bool message)
        {
            List <Mobile> list = GetMobiles();

            foreach (Mobile m in list)
            {
                if (message && m is PlayerMobile)
                {
                    m.SendMessage("You have failed to meet the deadline.");
                }

                if (BaseBoat.FindBoatAt(m, m.Map) != null)
                {
                    continue;
                }

                if (m is PlayerMobile || (m is BaseCreature && ((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned))
                {
                    Point3D go = CorgulAltar.GetRandomPoint(CorgulAltar.LandKickLocation, this.Map);
                    BaseCreature.TeleportPets(m, go, this.Map);
                    m.MoveToWorld(go, this.Map);
                }
            }

            foreach (BaseBoat b in this.GetEnumeratedMultis().OfType <BaseBoat>())
            {
                if (b != null)
                {
                    RemoveBoat(b);
                }
            }
        }
コード例 #2
0
ファイル: CorgulRegion.cs プロジェクト: travismills82/TrueUO
        public void RemovePlayers(bool message)
        {
            List <Mobile> list = GetMobiles();

            for (var index = 0; index < list.Count; index++)
            {
                Mobile m = list[index];

                if (message && m is PlayerMobile)
                {
                    m.SendMessage("You have failed to meet the deadline.");
                }

                if (BaseBoat.FindBoatAt(m, m.Map) != null)
                {
                    continue;
                }

                if (m is PlayerMobile || m is BaseCreature creature && creature.Controlled || ((BaseCreature)m).Summoned)
                {
                    Point3D go = CorgulAltar.GetRandomPoint(CorgulAltar.LandKickLocation, Map);
                    BaseCreature.TeleportPets(m, go, Map);
                    m.MoveToWorld(go, Map);
                }
            }

            foreach (BaseMulti multi in GetEnumeratedMultis())
            {
                if (multi is BaseBoat b)
                {
                    RemoveBoat(b);
                }
            }
        }
コード例 #3
0
ファイル: CorgulRegion.cs プロジェクト: pallop/Servuo
        public static void OnLogin(LoginEventArgs e)
        {
            Mobile from = e.Mobile;

            Region reg = Region.Find(from.Location, from.Map);

            if (reg is CorgulRegion)
            {
                CorgulAltar altar = ((CorgulRegion)reg).Altar;

                if (altar != null && !altar.Activated)
                {
                    Point3D pnt = CorgulAltar.GetRandomPoint(CorgulAltar.LandKickLocation, from.Map);

                    BaseCreature.TeleportPets(from, pnt, from.Map);
                    from.MoveToWorld(pnt, from.Map);
                }
            }
        }
コード例 #4
0
ファイル: CorgulRegion.cs プロジェクト: pallop/Servuo
        public void RemoveBoat(BaseBoat boat)
        {
            if (boat == null)
            {
                return;
            }

            //First, we'll try and put the boat in the cooresponding location where it warped in
            if (boat.Map != null && boat.Map != Map.Internal && m_Altar != null && m_Altar.WarpRegion != null)
            {
                Map         map = boat.Map;
                Rectangle2D rec = m_Altar.WarpRegion.Bounds;

                int x = boat.X - m_Bounds.X;
                int y = boat.Y - m_Bounds.Y;
                int z = map.GetAverageZ(x, y);

                Point3D ePnt = new Point3D(rec.X + x, rec.Y + y, -5);

                int offsetX = ePnt.X - boat.X;
                int offsetY = ePnt.Y - boat.Y;
                int offsetZ = map.GetAverageZ(ePnt.X, ePnt.Y) - boat.Z;

                if (boat.CanFit(ePnt, this.Map, boat.ItemID))
                {
                    boat.Teleport(offsetX, offsetY, offsetZ);

                    //int z = this.Map.GetAverageZ(boat.X, boat.Y);
                    if (boat.Z != -5)
                    {
                        boat.Z = -5;
                    }

                    if (boat.TillerMan != null)
                    {
                        boat.TillerManSay(501425); //Ar, turbulent water!
                    }
                    return;
                }
            }

            //Plan B, lets kick to some random location who-knows-where
            for (int i = 0; i < 25; i++)
            {
                Rectangle2D rec  = CorgulAltar.BoatKickLocation;
                Point3D     ePnt = CorgulAltar.GetRandomPoint(rec, Map);

                int offsetX = ePnt.X - boat.X;
                int offsetY = ePnt.Y - boat.Y;
                int offsetZ = ePnt.Z - boat.Z;

                if (boat.CanFit(ePnt, this.Map, boat.ItemID))
                {
                    boat.Teleport(offsetX, offsetY, -5);
                    boat.SendMessageToAllOnBoard("A rough patch of sea has disoriented the crew!");

                    //int z = this.Map.GetAverageZ(boat.X, boat.Y);
                    if (boat.Z != -5)
                    {
                        boat.Z = -5;
                    }

                    if (boat.TillerMan != null)
                    {
                        boat.TillerManSay(501425); //Ar, turbulent water!
                    }
                    break;
                }
            }
        }