public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            var pm = m as PlayerMobile;
            if (m.InRange(Location, 1) && m.Backpack != null && pm != null && DateTime.UtcNow >= pm.AsylumDoorNextUse)
            {
                if (KeyType == AsylumKeyType.None)
                {
                    if (TeleportLocation != Point3D.Zero)
                    {
                        pm.AsylumDoorNextUse = DateTime.UtcNow + TimeSpan.FromSeconds(60);
                        BaseCreature.TeleportPets(m, TeleportLocation, m.Map, false);
                        m.MoveToWorld(TeleportLocation, Map);
                    }
                }
                else
                {
                    if (SearchPackForItem(m.Backpack))
                    {
                        if (TeleportLocation != Point3D.Zero)
                        {
                            pm.AsylumDoorNextUse = DateTime.UtcNow + TimeSpan.FromSeconds(60);
                            BaseCreature.TeleportPets(m, TeleportLocation, m.Map, false);
                            m.MoveToWorld(TeleportLocation, Map);
                        }
                    }
                }
            }
            else if (pm != null && pm.InRange(Location, 1))
            {
                TimeSpan nextuse = pm.AsylumDoorNextUse - DateTime.UtcNow;
                pm.SendMessage("You cannot use an asylum door for another " + nextuse.Seconds + " seconds.");
            }

            base.OnMovement(m, oldLocation);
        }
示例#2
0
		public override void OnDoubleClick( Mobile m )
		{
			if ( !m_Active )
				return;

			Map map = m_MapDest;

			if ( map == null || map == Map.Internal )
				map = m.Map;

			Point3D p = m_PointDest;

			if ( p == Point3D.Zero )
				p = m.Location;

			if ( m.InRange( this, 3 ) )
			{
				Server.Mobiles.BaseCreature.TeleportPets( m, m_PointDest, m_MapDest );

				m.MoveToWorld( m_PointDest, m_MapDest );
			}
			else
			{
				m.SendLocalizedMessage( 1019045 ); // I can't reach that.
			}
		}
示例#3
0
		public override bool OnMoveOver( Mobile m )
		{
			if( m.SolidHueOverride != -1 )
				return true;
			else if( m.Player && !m.Alive ) // mobile is dead
			{
				m.SolidHueOverride = -1;

				if( m_TargetMap != null && m_TargetMap != Map.Internal )
				{
					m.MoveToWorld( m_Target, m_TargetMap );
					BaseCreature.TeleportPets( m, m_Target, m_TargetMap );
				}
				else
					m.SendAsciiMessage( "This has not yet been activated" );

				m.Combatant = null;
				m.Warmode = false;
				m.Resurrect();
				return false;
			}
			else if( ( m.Player ) && ( m.Hits < m.HitsMax ) )
				m.LocalOverheadMessage( MessageType.Regular, 906, true, "For liablity issues, we require all visitors to be in perfect health!" );
			else if( m.Player && m.SolidHueOverride != 2544 )
			{
                m_CasinoTimer = new CasinoTimer(this, m);
                m_CasinoTimer.Start();				
				m.SolidHueOverride = 2544;
				m.SendAsciiMessage( "You are about to enter the Casino!" );
			}

			return true;
		}
示例#4
0
		public override bool OnMoveOver( Mobile m )
		{
			if( m.SolidHueOverride != -1 )
				return true;
		    if( m.Player && !m.Alive ) // mobile is dead
		    {
		        m.SolidHueOverride = -1;

		        if( m_TargetMap != null && m_TargetMap != Map.Internal )
		        {
		            m.MoveToWorld( m_Target, m_TargetMap );
		            BaseCreature.TeleportPets( m, m_Target, m_TargetMap );
		        }
		        else
		            m.SendAsciiMessage( "This has not yet been activated" );

		        m.Combatant = null;
		        m.Warmode = false;
		        m.Resurrect();
		        return false;
		    }
		    if( ( m.Player ) && ( m.Hits < m.HitsMax ) )
		        m.LocalOverheadMessage( MessageType.Regular, 906, true, "You do not have full HP." );
		    else if( m.Player && m.SolidHueOverride != 2535 )
		    {
		        new RuneTimer( this, m ).Start();
		        m.SolidHueOverride = 2535;
		    }

		    return true;
		}
        public bool Teleport(Mobile m)
        {
            if (m_TargetMap != null && m_TargetMap != Map.Internal && m_TargetLocation != Point3D.Zero)
            {
                m.MoveToWorld(m_TargetLocation, m_TargetMap);
                return false;
            }

            return true;
        }
示例#6
0
        public static void TeleportToFerry(Mobile from)
        {
            Point3D loc = new Point3D(408, 251, 2);
            Map map = Map.Malas;

            Effects.SendLocationParticles(EffectItem.Create(loc, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 0, 0, 2023, 0);
            Effects.PlaySound(loc, map, 0x1FE);

            BaseCreature.TeleportPets(from, loc, map);

            from.MoveToWorld(loc, map);
        }
示例#7
0
 public override void OnDoubleClick(Mobile from)
 {
     if (from.InRange(this.Location, 2))
     {
         if (!this.m_Locked && this.m_Active)
         {
             from.MoveToWorld(this.m_PointDest, this.m_MapDest);
             from.SendLocalizedMessage(1072790); // The wall becomes transparent, and you push your way through it.
         }
         else
             from.Say(502684); // This door appears to be locked.
     }
 }
示例#8
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( from.InRange( this, 2 ) )
			{
				Map map = Map;

				if ( map == Map.Trammel || map == Map.Felucca )
				{
					from.MoveToWorld( new Point3D( 5922, 2024, 0 ), map );
					PublicOverheadMessage( MessageType.Regular, 0x3B2, true, String.Format( "* {0} dives into the hole and disappears!*", from.Name ) ); 
				}
			}
			else
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
		}
		public override void OnDoubleClick( Mobile m )
		{
			if ( !m.InRange( this.GetWorldLocation(), 3 ) )
				return;
			if ( m_Controller.Enabled )
				return;

			if ( (m_Wanderer == null || !m_Wanderer.Alive) )
			{
				m_Wanderer = new WandererOfTheVoid();
				m_Wanderer.MoveToWorld( LeverPuzzleController.lr_Enter, Map.Malas );
				m_Wanderer.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1060002, "" ); // I am the guardian of...
				Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback( CallBackMessage ) );
			}
		}
示例#10
0
			protected override void OnTarget(Mobile from, object o)
			{
				if (o is BaseCreature)
				{
					if (((BaseCreature)o).Spawner != null)
					{
						BaseCreature bc = (BaseCreature)o;
						from.MoveToWorld(bc.Spawner.Location, bc.Spawner.Map);
					}
					else
					{
						from.SendMessage("That mobile is homeless");
					}
				}
				else
				{
					from.SendMessage("Why would that have a spawner?");
				}
			}
示例#11
0
		public override void UseGate( Mobile m )
		{
			if ( MateGate == null || MateGate.Deleted )
			{
				Console.WriteLine( "The Gate at {0} is missing it's mate", this.Location.ToString() );
				return;
			}
			m_Target = MateGate.Location;
			m_TargetMap = MateGate.Map;
			
			int flags = m.NetState == null ? 0 : (int)m.NetState.Flags;

			if ( Factions.Sigil.ExistsOn( m ) )
			{
				m.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
			}
			else if ( m_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 ( (m.Kills >= 5 && m_TargetMap != Map.Felucca) || ( m_TargetMap == Map.Tokuno && (flags & 0x10) == 0 ) || ( m_TargetMap == Map.Malas && (flags & 0x8) == 0 ) || ( m_TargetMap == Map.Ilshenar && (flags & 0x4) == 0 ) )
			{
				m.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
			}
			else if ( m.Spell != null )
			{
				m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
			}
			else if ( m_TargetMap != null && m_TargetMap != Map.Internal )
			{
				BaseCreature.TeleportPets( m, m_Target, m_TargetMap );

				m.MoveToWorld( m_Target, m_TargetMap );

				m.PlaySound( 0x1FE );

				OnGateUsed( m );
			}
			else
			{
				m.SendMessage( "This moongate does not seem to go anywhere." );
			}
		}
示例#12
0
 public override void OnDoubleClick(Mobile from)
 {
     if (from.InRange(GetWorldLocation(), 2) && from.InLOS(this))
     {
         if (GuildID != -1 && from.Guild != null && !(from.Guild.Disbanded))
         {
             if (from.Guild.Id == GuildID)
             {
                 from.MoveToWorld(this.Location, this.Map);
                 Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                 from.PlaySound(510);
                 return;
             }
         }
         else
         from.SendAsciiMessage("You cannot use that!");
     }
     else
         from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
 }
示例#13
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.InRange( GetWorldLocation(), 2 ) )
			{
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
				return;
			}

			MLQuestContext context;

			if ( from is PlayerMobile && ( context = MLQuestSystem.GetContext( (PlayerMobile)from ) ) != null && context.BedlamAccess )
			{
				BaseCreature.TeleportPets( from, PointDest, MapDest );
				from.MoveToWorld( PointDest, MapDest );
			}
			else
			{
				from.SendLocalizedMessage( 1074276 ); // You press and push on the iron maiden, but nothing happens.
			}
		}
示例#14
0
        public static void Followers_OnTarget(Mobile from, object obj)
        {
            if (from == null || from.Deleted)
            {
                return;
            }

            var master = obj as PlayerMobile;
            var pet = obj as BaseCreature;

            if (master != null)
            {
                var pets = World.Mobiles.Values.OfType<BaseCreature>().Where(bc => (bc.Controlled && bc.ControlMaster == master) || (bc.Summoned && bc.SummonMaster == master)).ToList();

                from.CloseGump(typeof(FollowersGump));
                from.SendGump(new FollowersGump(pets, master));
            }
            else if (pet != null)
            {
                if (pet.Controlled && pet.ControlMaster != null)
                {
                    if (pet.ControlMaster == from)
                    {
                        from.SendMessage("You found your own pet!");
                    }
                    if (pet.ControlMaster.Map == Map.Internal)
                    {
                        from.SendMessage("The owner of this pet is currently not online.");
                    }
                    else
                    {
                        from.MoveToWorld(pet.ControlMaster.Location, pet.ControlMaster.Map);
                        from.SendMessage("You have been moved to the creatures master: {0}.", pet.ControlMaster.Name);
                    }
                }
                else
                {
                    from.SendMessage("That creature is unowned.");
                }
            }
        }
示例#15
0
 public override void OnDoubleClick(Mobile from)
 {
     Container pack = from.Backpack;
     if (from.InRange(this, 1))
     {
         if (pack != null && pack.ConsumeTotal(typeof(CasinoMembershipCard), 1))
         {
             from.SendAsciiMessage("Welcome to the V.I.P area.");
             from.PlaySound(510);
             from.MoveToWorld(new Point3D(1340, 1717, 20), Map.Felucca);
             from.Backpack.DropItem(new CasinoMembershipCard());
         }
         else
         {
             from.SendAsciiMessage("You need to have a:");
             from.SendAsciiMessage("Casino Membership Card to get pass.");
         }
     }
     else
         from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
 }
示例#16
0
        public override void OnDoubleClick(Mobile from)
        { 
            if (from.NetState == null || !from.NetState.SupportsExpansion(Expansion.ML))
            {
                from.SendLocalizedMessage(1072608); // You must upgrade to the Mondain's Legacy expansion in order to enter here.				
                return;
            }
            else if (!MondainsLegacy.Labyrinth && (int)from.AccessLevel < (int)AccessLevel.GameMaster)
            {
                from.SendLocalizedMessage(1042753, "Labyrinth"); // ~1_SOMETHING~ has been temporarily disabled.
                return;
            }
		
            if (from.InRange(this.Location, 2))
            {
                Point3D p = new Point3D(330, 1973, 0);
				
                BaseCreature.TeleportPets(from, p, this.Map);
                from.MoveToWorld(p, this.Map);
            }
        }
示例#17
0
        private static void ShowOff(Mobile staff)
        {
            if (staff.BodyMod != 897)
                return;
            
            if (m_TargetList.Count == 0)
            {
                CollectTargets();

                if (m_TargetList.Count == 0)
                {
                    staff.SendMessage(33, "No more players online to follow.");
                    staff.BodyMod = 0;
                    return;
                }
            }

            Mobile player = m_TargetList[Utility.Random(m_TargetList.Count)];

            m_TargetList.Remove(player);

            if (!player.Deleted && player.NetState != null && player.NetState.Running)
            {
                staff.Hidden = true;
                
                staff.MoveToWorld(player.Location, player.Map);

                Timer.DelayCall(Delay, delegate
                {
                    if (!staff.Deleted && staff.NetState != null && staff.NetState.Running)
                        ShowOff(staff);
                });
            }
            else
            {
                ShowOff(staff);
            }
        }
示例#18
0
        public static void GoTo(Mobile from, Point3D dest)
        {
            Map destMap;

            if (from.Map == Map.Trammel)
            {
                destMap = Map.Trammel;
            }
            else if (from.Map == Map.Felucca)
            {
                destMap = Map.Felucca;
            }
            else if (from.Map == Map.Internal)
            {
                destMap = from.LogoutMap == Map.Felucca ? Map.Felucca : Map.Trammel;
            }
            else
            {
                destMap = from.Kills >= 5 ? Map.Felucca : Map.Trammel;
            }

            Mobiles.BaseCreature.TeleportPets(from, dest, destMap);
            from.MoveToWorld(dest, destMap);
        }
示例#19
0
        public override bool OnMoveOver(Mobile m)
        {
            if (!m_AllowCreatures && !m.Player)
            {
                return(true);
            }

            if (m.Backpack.ConsumeTotal(typeof(DantesBracelet), 1))

            {
                if (m_TelePets)
                {
                    Server.Mobiles.BaseCreature.TeleportPets(m, m_DestLoc, m_DestMap);
                }

                m.PlaySound(0x1F7);
                m.MoveToWorld(m_DestLoc, m_DestMap);

                return(false);
            }

            m.SendMessage(" You must have Dante's Bracelet if you wish to pass.");
            return(true);
        }
示例#20
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!(from is PlayerMobile))
            {
                return;
            }

            DestructionOfZipactriotlQuest q = QuestHelper.GetQuest((PlayerMobile)from, typeof(DestructionOfZipactriotlQuest)) as DestructionOfZipactriotlQuest;

            if (q != null || from.AccessLevel > AccessLevel.Player)
            {
                BaseCreature.TeleportPets(from, _Destination, Map.TerMur);
                from.MoveToWorld(_Destination, Map.TerMur);

                Effects.SendLocationParticles(EffectItem.Create(from.Location, Map.TerMur, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                Effects.SendLocationParticles(EffectItem.Create(_Destination, Map.TerMur, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);

                from.PlaySound(0x1FE);
            }
            else
            {
                from.SendLocalizedMessage(1156841); // You must be on the "Destruction of Zipactriotl" quest to enter. Visit the Barrabian Tinker in the Barrab village to the Southwest.
            }
        }
示例#21
0
        public override void OnDoubleClick(Mobile from)
        {
            Container pack = from.Backpack;

            if (from.InRange(this, 1))
            {
                if (pack != null && pack.ConsumeTotal(typeof(CasinoMembershipCard), 1))
                {
                    from.SendAsciiMessage("Welcome to the V.I.P area.");
                    from.PlaySound(510);
                    from.MoveToWorld(new Point3D(1340, 1717, 20), Map.Felucca);
                    from.Backpack.DropItem(new CasinoMembershipCard());
                }
                else
                {
                    from.SendAsciiMessage("You need to have a:");
                    from.SendAsciiMessage("Casino Membership Card to get pass.");
                }
            }
            else
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
            }
        }
示例#22
0
        public void CheckQueen()
        {
            if (Map == null)
            {
                return;
            }

            if (!m_SpawnedQueen)
            {
                Say(1042153); // Come forth my queen!

                m_Queen = new Silvani();

                ((BaseCreature)m_Queen).Team = Team;

                m_Queen.MoveToWorld(Location, Map);

                m_SpawnedQueen = true;
            }
            else if (m_Queen != null && m_Queen.Deleted)
            {
                m_Queen = null;
            }
        }
示例#23
0
 public override void OnDoubleClick(Mobile from)
 {
     if (from.InRange(GetWorldLocation(), 2) && from.InLOS(this))
     {
         if (GuildID != -1 && from.Guild != null && !(from.Guild.Disbanded))
         {
             if (from.Guild.Id == GuildID)
             {
                 from.MoveToWorld(this.Location, this.Map);
                 Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                 from.PlaySound(510);
                 return;
             }
         }
         else
         {
             from.SendAsciiMessage("You cannot use that!");
         }
     }
     else
     {
         from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
     }
 }
示例#24
0
        protected override ISpawnable Construct(SpawnEntry entry, Point3D loc, Map map)
        {
            Mobile mobile = CreateMobile();

            BaseCreature creature = mobile as BaseCreature;

            if (creature != null)
            {
                creature.Home      = entry.HomeLocation;
                creature.HomeMap   = map;
                creature.RangeHome = entry.HomeRange;
            }

            if (entry.Direction != SpawnEntry.InvalidDirection)
            {
                mobile.Direction = entry.Direction;
            }

            mobile.OnBeforeSpawn(loc, map);
            mobile.MoveToWorld(loc, map);
            mobile.OnAfterSpawn();

            return(mobile);
        }
示例#25
0
        private void KickFromRegion(Mobile m, bool telepet)
        {
            while (true)
            {
                int     x = Utility.RandomMinMax(m_KickBounds.X, m_KickBounds.X + m_KickBounds.Width);
                int     y = Utility.RandomMinMax(m_KickBounds.Y, m_KickBounds.Y + m_KickBounds.Height);
                int     z = Map.Trammel.GetAverageZ(x, y);
                Point3D p = new Point3D(x, y, z);

                if (Map.CanSpawnMobile(p))
                {
                    if (m.Corpse != null)
                    {
                        m.Corpse.MoveToWorld(p, Map.Trammel);
                    }

                    m.MoveToWorld(p, Map.Trammel);

                    if (telepet)
                    {
                        WispOrb.TeleportPet(m);
                    }
                    else
                    {
                        WispOrb orb = DespiseController.GetWispOrb(m);

                        if (orb != null && orb.Pet != null)
                        {
                            orb.Pet.Kill();
                        }
                    }

                    break;
                }
            }
        }
示例#26
0
        public void KickToEntrance(Mobile from)
        {
            if (from == null || from.Map == null)
            {
                return;
            }

            int x = Utility.RandomMinMax(m_Entrance.X, m_Entrance.X + m_Entrance.Width);
            int y = Utility.RandomMinMax(m_Entrance.Y, m_Entrance.Y + m_Entrance.Height);
            int z = from.Map.GetAverageZ(x, y);

            Point3D loc = from.Location;
            Point3D p   = new Point3D(x, y, z);

            if (from is PlayerMobile)
            {
                BaseCreature.TeleportPets(from, p, Map.TerMur);
            }

            from.MoveToWorld(p, Map.TerMur);

            Effects.SendLocationParticles(EffectItem.Create(loc, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
            Effects.SendLocationParticles(EffectItem.Create(p, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);
        }
        public virtual void Teleport(Mobile from)
        {
            if (from.Region != null && from.Region.IsPartOf("Prism of Light"))
            {
                // teleport pets
                Region region = from.Region.GetRegion("Prism of Light");

                if (region != null)
                {
                    List <Mobile> mobiles = region.GetMobiles();

                    foreach (Mobile m in mobiles)
                    {
                        if (m is BaseCreature && ((BaseCreature)m).ControlMaster == from)
                        {
                            m.MoveToWorld(new Point3D(3785, 1107, 20), Map);
                        }
                    }
                }

                // teleport player
                from.MoveToWorld(new Point3D(3785, 1107, 20), Map);
            }
        }
示例#28
0
        public virtual void DoTeleport(Mobile m)
        {
            Map map = m_MapDest;

            if (map == null || map == Map.Internal)
            {
                map = Map;
            }

            Point3D p = m_PointDest;

            if (p == Point3D.Zero)
            {
                p = m.Location;
            }

            bool sendEffect = (!m.Hidden || m.IsPlayer());

            if (m_SourceEffect && sendEffect)
            {
                Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);
            }

            BaseCreature.TeleportPets(m, p, map);
            m.MoveToWorld(p, map);

            if (m_DestEffect && sendEffect)
            {
                Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);
            }

            if (m_SoundID > 0 && sendEffect)
            {
                Effects.PlaySound(m.Location, m.Map, m_SoundID);
            }
        }
示例#29
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            switch (info.ButtonID)
            {
            case 1:
                CityInfo city = new CityInfo("Britain", "Town Center", 1475, 1645, 20);

                from.MoveToWorld(city.Location, Map.Felucca);
                break;

            case 2:
                CityInfo city1 = new CityInfo("Britain", "Town Center", 1475, 1645, 20);

                from.MoveToWorld(city1.Location, Map.Trammel);
                break;

            case 3:
                CityInfo city2 = new CityInfo("Lakeshire", "Town Center", 1203, 1124, -25);

                from.MoveToWorld(city2.Location, Map.Ilshenar);
                break;

            case 4:
                CityInfo city3 = new CityInfo("Luna", "Town Center", 989, 519, -50);

                from.MoveToWorld(city3.Location, Map.Malas);
                break;

            case 5:
                CityInfo city4 = new CityInfo("Zento", "Town Center", 735, 1257, 30);

                from.MoveToWorld(city4.Location, Map.Tokuno);
                break;

            case 6:
                CityInfo city5 = new CityInfo("Test", "Test", 852, 3526, -43);

                from.MoveToWorld(city5.Location, Map.TerMur);
                break;
            }
        }
示例#30
0
		public virtual void UseGate( Mobile m )
		{
			ClientFlags flags = m.NetState == null ? ClientFlags.None : m.NetState.Flags;

			if ( Factions.Sigil.ExistsOn( m ) )
			{
				m.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
			}
			else if ( m_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 ( (m.Kills >= 5 && m_TargetMap != Map.Felucca) || ( m_TargetMap == Map.Tokuno && (flags & ClientFlags.Tokuno) == 0 ) || ( m_TargetMap == Map.Malas && (flags & ClientFlags.Malas) == 0 ) || ( m_TargetMap == Map.Ilshenar && (flags & ClientFlags.Ilshenar) == 0 ) )
			{
				m.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
			}
			else if ( m.Spell != null )
			{
				m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
			}
//added to stop player from teleporting if draging something.
			else if (m.Holding != null)
			{
				m.SendLocalizedMessage(1071955); // You cannot teleport while dragging an object.
			}
//added end
			else if ( m_TargetMap != null && m_TargetMap != Map.Internal )
			{
				BaseCreature.TeleportPets( m, m_Target, m_TargetMap );

				m.MoveToWorld( m_Target, m_TargetMap );

				if ( m.AccessLevel == AccessLevel.Player || !m.Hidden )
					m.PlaySound( 0x1FE );

				OnGateUsed( m );
			}
			else
			{
				m.SendMessage( "This moongate does not seem to go anywhere." );
			}
		}
示例#31
0
        public override void OnDoubleClick(Mobile from)
        {
            if (Boat == null || from == null)
            {
                return;
            }

            BaseBoat boat = BaseBoat.FindBoatAt(from, from.Map);

            int  range   = boat != null && boat == Boat ? 3 : 8;
            bool canMove = false;

            if (!Boat.IsRowBoat)
            {
                Boat.Refresh(from);
            }

            if (!from.InRange(Location, range))
            {
                from.SendLocalizedMessage(500295); //You are too far away to do that.
            }
            else if (!from.InLOS(Location))
            {
                from.SendLocalizedMessage(500950); //You cannot see that.
            }
            else if (Boat.IsMoving || Boat.IsTurning)
            {
                from.SendLocalizedMessage(1116611); //You can't use that while the ship is moving!
            }
            else if (BaseBoat.IsDriving(from))
            {
                from.SendLocalizedMessage(1116610); //You can't do that while piloting a ship!
            }
            else if (BaseHouse.FindHouseAt(from) != null)
            {
                from.SendLocalizedMessage(1149795); //You may not dock a ship while on another ship or inside a house.
            }
            else if (Boat == boat && !MoveToNearestDockOrLand(from))
            {
                from.SendLocalizedMessage(1149796); //You can not dock a ship this far out to sea. You must be near land or shallow water.
            }
            else if (boat == null || boat != null && Boat != boat)
            {
                if (Boat.HasAccess(from))
                {
                    canMove = true;
                }
                else
                {
                    from.SendLocalizedMessage(1116617); //You do not have permission to board this ship.
                }
            }

            if (canMove)
            {
                BaseCreature.TeleportPets(from, Location, Map);
                from.MoveToWorld(Location, Map);

                Boat.SendContainerPacket();
            }
        }
		public override void OnResponse(NetState state, RelayInfo info)
		{
			NetState sender = state;
			m_From = state.Mobile;
			PlayerMobile m_PMobile = (PlayerMobile)m_From;

			if ( m_From == null || m_From.Deleted || !m_PMobile.Young || info.ButtonID < 0 )
				return;

			switch (info.ButtonID)
			{

			case 0:
			case 1:
			case 2:
				sender.Mobile.SendGump(new NewPlayerGump( sender.Mobile, info.ButtonID ));
				break;
			case 11:
				if (CanYoungTeleport(m_PMobile)) m_From.MoveToWorld(loc1, loc1map);
    		    sender.Mobile.SendGump(new NewPlayerGump( sender.Mobile, 2 ));
				break;
			case 12:
				if (CanYoungTeleport(m_PMobile)) m_From.MoveToWorld(loc2, loc2map);
				sender.Mobile.SendGump(new NewPlayerGump( sender.Mobile, 2 ));
				break;
			case 13:
                if (CanYoungTeleport(m_PMobile)) m_From.MoveToWorld(loc3, loc3map);
                sender.Mobile.SendGump(new NewPlayerGump(sender.Mobile, 2));
				break;
			}

			return;

		}
示例#33
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));
            }
        }
示例#34
0
        private static void Go_OnCommand(CommandEventArgs e)
        {
            Mobile from = e.Mobile;

            if (e.Length == 0)
            {
                GoGump.DisplayTo(from);
                return;
            }

            if (e.Length == 1)
            {
                try
                {
                    int ser = e.GetInt32(0);

                    IEntity ent = World.FindEntity(ser);

                    if (ent is Item)
                    {
                        Item item = (Item)ent;

                        Map     map = item.Map;
                        Point3D loc = item.GetWorldLocation();

                        Mobile owner = item.RootParent as Mobile;

                        if (owner != null && (owner.Map != null && owner.Map != Map.Internal) && !BaseCommand.IsAccessible(from, owner) /* !from.CanSee( owner )*/)
                        {
                            from.SendMessage("You can not go to what you can not see.");
                            return;
                        }
                        else if (owner != null && (owner.Map == null || owner.Map == Map.Internal) && owner.Hidden && owner.AccessLevel >= from.AccessLevel)
                        {
                            from.SendMessage("You can not go to what you can not see.");
                            return;
                        }
                        else if (!FixMap(ref map, ref loc, item))
                        {
                            from.SendMessage("That is an internal item and you cannot go to it.");
                            return;
                        }

                        from.MoveToWorld(loc, map);

                        return;
                    }
                    else if (ent is Mobile)
                    {
                        Mobile m = (Mobile)ent;

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

                        Mobile owner = m;

                        if (owner != null && (owner.Map != null && owner.Map != Map.Internal) && !BaseCommand.IsAccessible(from, owner) /* !from.CanSee( owner )*/)
                        {
                            from.SendMessage("You can not go to what you can not see.");
                            return;
                        }
                        else if (owner != null && (owner.Map == null || owner.Map == Map.Internal) && owner.Hidden && owner.AccessLevel >= from.AccessLevel)
                        {
                            from.SendMessage("You can not go to what you can not see.");
                            return;
                        }
                        else if (!FixMap(ref map, ref loc, m))
                        {
                            from.SendMessage("That is an internal mobile and you cannot go to it.");
                            return;
                        }

                        from.MoveToWorld(loc, map);

                        return;
                    }
                    else
                    {
                        string name = e.GetString(0);
                        Map    map;

                        for (int i = 0; i < Map.AllMaps.Count; ++i)
                        {
                            map = Map.AllMaps[i];

                            if (map.MapIndex == 0x7F || map.MapIndex == 0xFF)
                            {
                                continue;
                            }

                            if (Insensitive.Equals(name, map.Name))
                            {
                                from.Map = map;
                                return;
                            }
                        }

                        Dictionary <string, Region> list = from.Map.Regions;

                        foreach (KeyValuePair <string, Region> kvp in list)
                        {
                            Region r = kvp.Value;

                            if (Insensitive.Equals(r.Name, name))
                            {
                                from.Location = new Point3D(r.GoLocation);
                                return;
                            }
                        }

                        for (int i = 0; i < Map.AllMaps.Count; ++i)
                        {
                            Map m = Map.AllMaps[i];

                            if (m.MapIndex == 0x7F || m.MapIndex == 0xFF || from.Map == m)
                            {
                                continue;
                            }

                            foreach (Region r in m.Regions.Values)
                            {
                                if (Insensitive.Equals(r.Name, name))
                                {
                                    from.MoveToWorld(r.GoLocation, m);
                                    return;
                                }
                            }
                        }

                        if (ser != 0)
                        {
                            from.SendMessage("No object with that serial was found.");
                        }
                        else
                        {
                            from.SendMessage("No region with that name was found.");
                        }

                        return;
                    }
                }
                catch
                {
                }

                from.SendMessage("Region name not found");
            }
            else if (e.Length == 2 || e.Length == 3)
            {
                Map map = from.Map;

                if (map != null)
                {
                    try
                    {
                        /*
                         * This to avoid being teleported to (0,0) if trying to teleport
                         * to a region with spaces in its name.
                         */
                        int x = int.Parse(e.GetString(0));
                        int y = int.Parse(e.GetString(1));
                        int z = (e.Length == 3) ? int.Parse(e.GetString(2)) : map.GetAverageZ(x, y);

                        from.Location = new Point3D(x, y, z);
                    }
                    catch
                    {
                        from.SendMessage("Region name not found.");
                    }
                }
            }
            else if (e.Length == 6)
            {
                Map map = from.Map;

                if (map != null)
                {
                    Point3D p = Sextant.ReverseLookup(map, e.GetInt32(3), e.GetInt32(0), e.GetInt32(4), e.GetInt32(1), Insensitive.Equals(e.GetString(5), "E"), Insensitive.Equals(e.GetString(2), "S"));

                    if (p != Point3D.Zero)
                    {
                        from.Location = p;
                    }
                    else
                    {
                        from.SendMessage("Sextant reverse lookup failed.");
                    }
                }
            }
            else
            {
                from.SendMessage("Format: Go [name | serial | (x y [z]) | (deg min (N | S) deg min (E | W)]");
            }
        }
示例#35
0
        public void Ban(Mobile from, Mobile targ)
        {
            if (!this.IsFriend(from) || this.m_Bans == null)
                return;

            if (targ.IsStaff() && from.AccessLevel <= targ.AccessLevel)
            {
                from.SendLocalizedMessage(501354); // Uh oh...a bigger boot may be required.
            }
            else if (this.IsFriend(targ))
            {
                from.SendLocalizedMessage(501348); // You cannot eject a friend of the house!
            }
            else if (targ is PlayerVendor)
            {
                from.SendLocalizedMessage(501351); // You cannot eject a vendor.
            }
            else if (this.m_Bans.Count >= MaxBans)
            {
                from.SendLocalizedMessage(501355); // The ban limit for this house has been reached!
            }
            else if (this.IsBanned(targ))
            {
                from.SendLocalizedMessage(501356); // This person is already banned!
            }
            else if (!this.IsInside(targ))
            {
                from.SendLocalizedMessage(501352); // You may not eject someone who is not in your house!
            }
            else if (!this.Public && this.IsAosRules)
            {
                from.SendLocalizedMessage(1062521); // You cannot ban someone from a private house.  Revoke their access instead.
            }
            else if (targ is BaseCreature && ((BaseCreature)targ).NoHouseRestrictions)
            {
                from.SendLocalizedMessage(1062040); // You cannot ban that.
            }
            else
            {
                this.m_Bans.Add(targ);

                from.SendLocalizedMessage(1042839, targ.Name); // ~1_PLAYER_NAME~ has been banned from this house.
                targ.SendLocalizedMessage(501340); // You have been banned from this house.

                targ.MoveToWorld(this.BanLocation, this.Map);
            }
        }
示例#36
0
        public override void OnDoubleClick( Mobile from )
        {
            /* List<Item> list = new List<Item>();

            foreach (Item item in World.Items.Values )
            {
                if (item is BaseBulletinBoard)
                {
                    BaseBulletinBoard board = item as BaseBulletinBoard;
                    list.Add(board);
                }
            }

            foreach (BaseBulletinBoard b in list)
            {
                b.GetPosts(b);
            }*/

            if(from == null) return;

            if(HomeMap != Map.Internal && HomeMap != null && from.AccessLevel == StaffLevel)
            {
                // teleport them to the specific location
                from.MoveToWorld(HomeLoc, HomeMap);
            }
        }
示例#37
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            int          page  = m_Page;
            Mobile       from  = m_From;
            BaseHouse    house = m_House;
            BasePlayerBB board = m_Board;

            if (house == null || !house.IsLockedDown(board))
            {
                from.SendLocalizedMessage(1062396);                   // This bulletin board must be locked down in a house to be usable.
                return;
            }
            else if (!from.InRange(board.GetWorldLocation(), 2) || !from.InLOS(board))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045);                   // I can't reach that.
                return;
            }
            else if (!BasePlayerBB.CheckAccess(house, from))
            {
                from.SendLocalizedMessage(1062398);                   // You are not allowed to post to this bulletin board.
                return;
            }

            switch (info.ButtonID)
            {
            case 1:                     // Post message
            {
                from.Prompt = new BasePlayerBB.PostPrompt(page, house, board, false);
                from.SendLocalizedMessage(1062397);                           // Please enter your message:

                break;
            }

            case 2:                     // Set title
            {
                if (house.IsOwner(from))
                {
                    from.Prompt = new BasePlayerBB.SetTitlePrompt(page, house, board);
                    from.SendLocalizedMessage(1062402);                               // Enter new title:
                }

                break;
            }

            case 3:                     // Post greeting
            {
                if (house.IsOwner(from))
                {
                    from.Prompt = new BasePlayerBB.PostPrompt(page, house, board, true);
                    from.SendLocalizedMessage(1062404);                               // Enter new greeting (this will always be the first post):
                }

                break;
            }

            case 4:                     // Scroll up
            {
                if (page == 0)
                {
                    page = board.Messages.Count;
                }
                else
                {
                    page -= 1;
                }

                from.SendGump(new PlayerBBGump(from, house, board, page));

                break;
            }

            case 5:                     // Scroll down
            {
                page += 1;
                page %= board.Messages.Count + 1;

                from.SendGump(new PlayerBBGump(from, house, board, page));

                break;
            }

            case 6:                     // Banish poster
            {
                if (house.IsOwner(from))
                {
                    if (page >= 1 && page <= board.Messages.Count)
                    {
                        PlayerBBMessage message = (PlayerBBMessage)board.Messages[page - 1];
                        Mobile          poster  = message.Poster;

                        if (poster == null)
                        {
                            from.SendGump(new PlayerBBGump(from, house, board, page));
                            return;
                        }

                        if (poster.AccessLevel > AccessLevel.Player && from.AccessLevel <= poster.AccessLevel)
                        {
                            from.SendLocalizedMessage(501354);                                       // Uh oh...a bigger boot may be required.
                        }
                        else if (house.IsFriend(poster))
                        {
                            from.SendLocalizedMessage(1060750);                                       // That person is a friend, co-owner, or owner of this house, and therefore cannot be banished!
                        }
                        else if (poster is PlayerVendor)
                        {
                            from.SendLocalizedMessage(501351);                                       // You cannot eject a vendor.
                        }
                        else if (house.Bans.Count >= BaseHouse.MaxBans)
                        {
                            from.SendLocalizedMessage(501355);                                       // The ban limit for this house has been reached!
                        }
                        else if (house.IsBanned(poster))
                        {
                            from.SendLocalizedMessage(501356);                                       // This person is already banned!
                        }
                        else if (poster is BaseCreature && ((BaseCreature)poster).NoHouseRestrictions)
                        {
                            from.SendLocalizedMessage(1062040);                                       // You cannot ban that.
                        }
                        else
                        {
                            if (!house.Bans.Contains(poster))
                            {
                                house.Bans.Add(poster);
                            }

                            from.SendLocalizedMessage(1062417);                                       // That person has been banned from this house.

                            if (house.IsInside(poster) && !BasePlayerBB.CheckAccess(house, poster))
                            {
                                poster.MoveToWorld(house.BanLocation, house.Map);
                            }
                        }
                    }

                    from.SendGump(new PlayerBBGump(from, house, board, page));
                }

                break;
            }

            case 7:                     // Delete message
            {
                if (house.IsOwner(from))
                {
                    if (page >= 1 && page <= board.Messages.Count)
                    {
                        board.Messages.RemoveAt(page - 1);
                    }

                    from.SendGump(new PlayerBBGump(from, house, board, 0));
                }

                break;
            }

            case 8:                     // Post props
            {
                if (from.AccessLevel >= AccessLevel.GameMaster)
                {
                    PlayerBBMessage message = board.Greeting;

                    if (page >= 1 && page <= board.Messages.Count)
                    {
                        message = (PlayerBBMessage)board.Messages[page - 1];
                    }

                    from.SendGump(new PlayerBBGump(from, house, board, page));
                    from.SendGump(new PropertiesGump(from, message));
                }

                break;
            }
            }
        }
示例#38
0
        private static void EventSink_CharacterCreated(CharacterCreatedEventArgs args)
        {
            if (!VerifyProfession(args.Profession))
            {
                args.Profession = 0;
            }

            Mobile newChar = CreateMobile(args.Account as Account);

            if (newChar == null)
            {
                Console.WriteLine("Login: {0}: Character creation failed, account full", args.State);
                return;
            }

            args.Mobile = newChar;
            m_Mobile    = newChar;

            newChar.Player      = true;
            newChar.AccessLevel = args.Account.AccessLevel;
            newChar.Female      = args.Female;
            newChar.Body        = newChar.Female ? 0x191 : 0x190;
            newChar.Hue         = Utility.ClipSkinHue(args.Hue & 0x3FFF) | 0x8000;
            newChar.Hunger      = 20;
            newChar.Thirst      = 20;
            newChar.SkillsCap   = 9000;
            newChar.StatCap     = 325;
            newChar.Name        = args.Name;
            newChar.RawInt      = 75;
            newChar.RawDex      = 75;
            newChar.RawStr      = 75;

            ((Player)newChar).EoC += 20000;
            ((Player)newChar).Race = Race.Human;

            newChar.CantWalk = false;
            newChar.Frozen   = false;

            newChar.Hits = newChar.HitsMax;
            newChar.Mana = newChar.ManaMax;
            newChar.Stam = newChar.StamMax;

            AddBackpack(newChar);

            newChar.AddToBackpack(new Silver(100));
            newChar.AddToBackpack(new Copper(500));

            newChar.AddToBackpack(new SkillScroll());

            SkillName[] emptySkills = new SkillName[]
            {
                #region SkillNames
                SkillName.Alchemy,
                SkillName.Anatomy,
                SkillName.AnimalLore,
                SkillName.ItemID,
                SkillName.ArmsLore,
                SkillName.Parry,
                SkillName.Begging,
                SkillName.Blacksmith,
                SkillName.Fletching,
                SkillName.Peacemaking,
                SkillName.Camping,
                SkillName.Carpentry,
                SkillName.Cartography,
                SkillName.Cooking,
                SkillName.DetectHidden,
                SkillName.Discordance,
                SkillName.EvalInt,
                SkillName.Healing,
                SkillName.Fishing,
                SkillName.Forensics,
                SkillName.Herding,
                SkillName.Hiding,
                SkillName.Provocation,
                SkillName.Inscribe,
                SkillName.Lockpicking,
                SkillName.Magery,
                SkillName.MagicResist,
                SkillName.Tactics,
                SkillName.Snooping,
                SkillName.Musicianship,
                SkillName.Poisoning,
                SkillName.Archery,
                SkillName.SpiritSpeak,
                SkillName.Stealing,
                SkillName.Tailoring,
                SkillName.AnimalTaming,
                SkillName.TasteID,
                SkillName.Tinkering,
                SkillName.Tracking,
                SkillName.Veterinary,
                SkillName.Swords,
                SkillName.Macing,
                SkillName.Fencing,
                SkillName.Wrestling,
                SkillName.Lumberjacking,
                SkillName.Mining,
                SkillName.Meditation,
                SkillName.Stealth,
                SkillName.RemoveTrap,
                SkillName.Necromancy,
                SkillName.Focus,
                //SkillName.Chivalry,
                //SkillName.Bushido,
                //SkillName.Ninjitsu,
                //SkillName.Spellweaving,
                //SkillName.Mysticism,
                //SkillName.Imbuing,
                //SkillName.Throwing
                #endregion
            };

            for (int i = 0; i < SkillInfo.Table.Length; i++)
            {
                newChar.Skills[i].Base = 0;

                if (Array.IndexOf <SkillName>(emptySkills, newChar.Skills[i].SkillName) > -1)
                {
                    newChar.Skills[i].Cap = 100;
                }

                else
                {
                    newChar.Skills[i].Cap = 0;
                }
            }

            newChar.HairItemID       = args.HairID;
            newChar.FacialHairItemID = args.BeardID;

            newChar.HairHue       = Utility.ClipHairHue(args.HairHue & 0x3FFF);
            newChar.FacialHairHue = Utility.ClipHairHue(args.BeardHue & 0x3FFF);

            AddShirt(newChar, args.ShirtHue);
            AddPants(newChar, args.PantsHue);
            AddShoes(newChar);

            FillBankbox(newChar);

            newChar.MoveToWorld(StartingCity.Location, StartingCity.Map);

            ((Player)newChar).RespawnLocation = StartingCity.Location;
            ((Player)newChar).RespawnMap      = StartingCity.Map;

            Console.WriteLine("Login: {0}: New character being created (account={1})", args.State, args.Account.Username);
            Console.WriteLine(" - Character: {0} (serial={1})", newChar.Name, newChar.Serial);
            Console.WriteLine(" - Started: {0} {1} in {2}", StartingCity.City, StartingCity.Location, StartingCity.Map.ToString());

            new WelcomeTimer(newChar).Start();
        }
示例#39
0
		public void SendOutside( Mobile mob )
		{
			if ( m_Arena == null )
				return;

			mob.Combatant = null;
			mob.MoveToWorld( m_Arena.Outside, m_Arena.Facet );
		}
示例#40
0
        public void RemovePlayer(Mobile m, bool kicked)
        {
            SupplySystem.RemoveEventGear(m);
            m.IsInEvent = false;
            m.Frozen    = false;

            if (!m.Alive && m is PlayerMobile)
            {
                ((PlayerMobile)m).ForceResurrect();
            }

            m.MoveToWorld(m_LeaveLocation, m_LeaveMap);

            if (m_MountCollection.ContainsKey(m.Serial))
            {
                BaseCreature bc = m_MountCollection[m.Serial];
                if (bc != null)
                {
                    bc.ControlTarget = m;
                    bc.ControlOrder  = OrderType.Stay;
                    bc.SetControlMaster(m);
                    bc.SummonMaster = m;
                    bc.IsStabled    = false;
                    bc.MoveToWorld(m.Location, m.Map);
                    m.Stabled.Remove(bc);

                    m.Aggressed.Clear();
                    m.Aggressors.Clear();

                    m.Hits = m.HitsMax;
                    m.Stam = m.StamMax;
                    m.Mana = m.ManaMax;

                    m.DamageEntries.Clear();

                    m.Combatant = null;
                }
            }

            if (m_Contestants.Contains(m))
            {
                m_Contestants.Remove(m);
            }

            if (m.NetState != null)
            {
                if (kicked)
                {
                    m.SendMessage(38, "You have been kicked from the deathmatch");
                }
                else
                {
                    m.SendMessage(38, "You have left the deathmatch");
                }
            }

            DMHorse.TryRemoveHorse(m);

            if (m_ResurrectionTimers.ContainsKey(m.Serial))
            {
                Timer t = m_ResurrectionTimers[m.Serial];
                if (t != null)
                {
                    t.Stop();
                    m_ResurrectionTimers.Remove(m.Serial);
                }
            }

            //Only print the message if the match is onging
            if (!m_Started)
            {
                return;
            }

            string leaveMessage = "";

            if (kicked)
            {
                leaveMessage = string.Format("{0} has been kicked from a deathmatch", m.Name);
            }
            else
            {
                leaveMessage = string.Format("{0} has left a deathmatch", m.Name);
            }
            PvpCore.SendMessage(Contestants, leaveMessage, true);
        }
示例#41
0
        public virtual void Enter(Mobile fighter)
        {
            if (this.CanEnter(fighter))
            {
                // teleport party member's pets
                if (this.m_Pets.ContainsKey(fighter))
                {
                    for (int i = 0; i < this.m_Pets[fighter].Count; i ++)
                    {
                        BaseCreature pet = this.m_Pets[fighter][i] as BaseCreature;

                        if (pet != null && pet.Alive && pet.InRange(fighter.Location, 5) && !(pet is BaseMount && ((BaseMount)pet).Rider != null) && this.CanEnter(pet))
                        {
                            pet.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                            pet.PlaySound(0x1FE);
                            pet.MoveToWorld(this.m_TeleportDest, this.Map);
                        }
                    }
                }

                // teleport party member
                fighter.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                fighter.PlaySound(0x1FE);
                fighter.MoveToWorld(this.m_TeleportDest, this.Map);
            }
        }
示例#42
0
        public virtual void Exit(Mobile fighter)
        {
            // teleport fighter
            if (fighter.NetState == null)
                fighter.LogoutLocation = this.m_ExitDest;
            else
            {
                fighter.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                fighter.PlaySound(0x1FE);

                if (this is CitadelAltar)
                    fighter.MoveToWorld(this.m_ExitDest, Map.Tokuno);
                else
                    fighter.MoveToWorld(this.m_ExitDest, this.Map);
            }

            // teleport his pets
            if (this.m_Pets.ContainsKey(fighter))
            {
                for (int i = 0; i < this.m_Pets[fighter].Count; i ++)
                {
                    BaseCreature pet = this.m_Pets[fighter][i] as BaseCreature;

                    if (pet != null && (pet.Alive || pet.IsBonded) && pet.Map != Map.Internal)
                    {
                        if (pet is BaseMount)
                        {
                            BaseMount mount = (BaseMount)pet;

                            if (mount.Rider != null && mount.Rider != fighter)
                            {
                                mount.Rider.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                                mount.Rider.PlaySound(0x1FE);

                                if (this is CitadelAltar)
                                    mount.Rider.MoveToWorld(this.m_ExitDest, Map.Tokuno);
                                else
                                    mount.Rider.MoveToWorld(this.m_ExitDest, this.Map);

                                continue;
                            }
                            else if (mount.Rider != null)
                                continue;
                        }

                        pet.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                        pet.PlaySound(0x1FE);

                        if (this is CitadelAltar)
                            pet.MoveToWorld(this.m_ExitDest, Map.Tokuno);
                        else
                            pet.MoveToWorld(this.m_ExitDest, this.Map);
                    }
                }
            }

            this.m_Fighters.Remove(fighter);
            this.m_Pets.Remove(fighter);

            fighter.SendLocalizedMessage(1072677); // You have been transported out of this room.

            if (this.m_Fighters.Count == 0)
                this.FinishSequence();
        }
示例#43
0
        public void Evict()
        {
            Point3D loc;
            Map     facet;

            if (m_Facet == null)
            {
                loc   = new Point3D(2715, 2165, 0);
                facet = Map.Felucca;
            }
            else
            {
                loc   = m_Outside;
                facet = m_Facet;
            }

            bool hasBounds = (m_Bounds.Start != Point2D.Zero && m_Bounds.End != Point2D.Zero);

            for (int i = 0; i < m_Players.Count; ++i)
            {
                Mobile mob = m_Players[i];

                if (mob == null)
                {
                    continue;
                }

                if (mob.Map == Map.Internal)
                {
                    if ((m_Facet == null || mob.LogoutMap == m_Facet) && (!hasBounds || m_Bounds.Contains(mob.LogoutLocation)))
                    {
                        mob.LogoutLocation = loc;
                    }
                }
                else if ((m_Facet == null || mob.Map == m_Facet) && (!hasBounds || m_Bounds.Contains(mob.Location)))
                {
                    mob.MoveToWorld(loc, facet);
                }

                mob.Combatant = null;
                mob.Frozen    = false;
                DuelContext.Debuff(mob);
                DuelContext.CancelSpell(mob);
            }

            if (hasBounds)
            {
                List <Mobile> pets = new List <Mobile>();

                foreach (Mobile mob in facet.GetMobilesInBounds(m_Bounds))
                {
                    BaseCreature pet = mob as BaseCreature;

                    if (pet != null && pet.Controlled && pet.ControlMaster != null)
                    {
                        if (m_Players.Contains(pet.ControlMaster))
                        {
                            pets.Add(pet);
                        }
                    }
                }

                foreach (Mobile pet in pets)
                {
                    pet.Combatant = null;
                    pet.Frozen    = false;

                    pet.MoveToWorld(loc, facet);
                }
            }

            m_Players.Clear();
        }
示例#44
0
        public void RemovePlayer(Mobile m, bool kicked)
        {
            SupplySystem.RemoveEventGear(m);
            m.IsInEvent = false;
            m.Frozen = false;

            if (!m.Alive && m is PlayerMobile)
                ((PlayerMobile)m).ForceResurrect();

            m.MoveToWorld(m_LeaveLocation, m_LeaveMap);

            if (m_MountCollection.ContainsKey(m.Serial))
            {
                BaseCreature bc = m_MountCollection[m.Serial];
                if (bc != null)
                {
                    bc.ControlTarget = m;
                    bc.ControlOrder = OrderType.Stay;
                    bc.SetControlMaster(m);
                    bc.SummonMaster = m;
                    bc.IsStabled = false;
                    bc.MoveToWorld(m.Location, m.Map);
                    m.Stabled.Remove(bc);

                    m.Aggressed.Clear();
                    m.Aggressors.Clear();

                    m.Hits = m.HitsMax;
                    m.Stam = m.StamMax;
                    m.Mana = m.ManaMax;

                    m.DamageEntries.Clear();

                    m.Combatant = null;
                }
            }

            if (m_Contestants.Contains(m))
                m_Contestants.Remove(m);

            if (m.NetState != null)
            {
                if (kicked)
                    m.SendMessage(38, "You have been kicked from the deathmatch");
                else
                    m.SendMessage(38, "You have left the deathmatch");
            }

            DMHorse.TryRemoveHorse(m);

            if (m_ResurrectionTimers.ContainsKey(m.Serial))
            {
                Timer t = m_ResurrectionTimers[m.Serial];
                if (t != null)
                {
                    t.Stop();
                    m_ResurrectionTimers.Remove(m.Serial);
                }
            }

            //Only print the message if the match is onging
            if (!m_Started) 
                return;

            string leaveMessage = "";
            if (kicked)
                leaveMessage = string.Format("{0} has been kicked from a deathmatch", m.Name);
            else
                leaveMessage = string.Format("{0} has left a deathmatch", m.Name);
            PvpCore.SendMessage(Contestants, leaveMessage, true);
        }
示例#45
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;
            }

            if (info.ButtonID == 2)               //City
            {
                ArrayList a = new ArrayList();

                foreach (Item i in World.Items.Values)
                {
                    if (i is CityManagementStone)
                    {
                        CityManagementStone s = (CityManagementStone)i;

                        if (s.HasMoongate == true && s.IsRegistered == true)
                        {
                            a.Add(i);
                        }
                    }
                }

                if (a.Count == 0)
                {
                    m_Mobile.SendGump(new NoCitiesGump());
                }
                else
                {
                    m_Mobile.SendGump(new PCMoongateGump(m_Moongate, 0, null, null));
                }
            }

            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 (Server.Spells.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
            {
                CityManagementStone outgoingCity = null;
                Region currentRegion             = Region.Find(m_Mobile.Location, m_Mobile.Map);

                if (currentRegion != null)
                {
                    if (currentRegion is PlayerCityRegion)
                    {
                        PlayerCityRegion pcr = (PlayerCityRegion)currentRegion;

                        outgoingCity = pcr.Stone;
                    }
                }

                if (outgoingCity != null && outgoingCity.TravelTax >= 1)
                {
                    m_Mobile.SendGump(new PCMoongateToll2Gump(m_Moongate, outgoingCity, entry.Location, list.Map));
                }
                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);
                }
            }
        }
示例#46
0
        public void SpawnMobile(Mobile m)
        {
            if (DMSpawnPoints.Count > 0)
            {
                DMSpawnPoint spawnPoint;
                do
                {
                    spawnPoint = m_DMSpawnPoints[Utility.RandomMinMax(0, DMSpawnPoints.Count - 1)];
                    if (spawnPoint.Deleted || spawnPoint.StoneLink != this)
                        m_DMSpawnPoints.Remove(spawnPoint);
                    else
                    {
                        if (LatestSpawnPoint != null)
                        {
                            if (LatestSpawnPoint.ContainsKey(m.Serial))
                            {
                                DMSpawnPoint latestSpawn;
                                LatestSpawnPoint.TryGetValue(m.Serial, out latestSpawn);
                                LatestSpawnPoint[m.Serial] = spawnPoint;

                                if (m_DMSpawnPoints.Count > 1 && latestSpawn != null && spawnPoint == latestSpawn)
                                    continue;
                            }
                            else
                                LatestSpawnPoint.Add(m.Serial, spawnPoint);
                        }
                        else
                            LatestSpawnPoint = new Dictionary<Serial, DMSpawnPoint> {{m.Serial, spawnPoint}};

                        break;
                    }

                } while (m_DMSpawnPoints.Count > 0);

                if (m_DMSpawnPoints.Count != 0)
                    m.MoveToWorld(spawnPoint.Location, spawnPoint.Map);
                else
                {
                    PvpCore.SendMessage(Contestants, string.Format("Error: Cannot spawn player {0} to deathmatch, no spawn points exists.", m));
                    RemovePlayer(m, false);
                }
            }
            else
            {
                PvpCore.SendMessage(Contestants, string.Format("Error: Cannot spawn player {0} to deathmatch, no spawn points exists.", m));
                RemovePlayer(m, false);
            }
        }
示例#47
0
        public virtual void Exit(Mobile fighter)
        {
            // teleport fighter
            if (fighter.NetState == null)
            {
                fighter.LogoutLocation = this.m_ExitDest;
            }
            else
            {
                fighter.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                fighter.PlaySound(0x1FE);

                if (this is CitadelAltar)
                {
                    fighter.MoveToWorld(this.m_ExitDest, Map.Tokuno);
                }
                else
                {
                    fighter.MoveToWorld(this.m_ExitDest, this.Map);
                }
            }

            // teleport his pets
            if (this.m_Pets.ContainsKey(fighter))
            {
                for (int i = 0; i < this.m_Pets[fighter].Count; i++)
                {
                    BaseCreature pet = this.m_Pets[fighter][i] as BaseCreature;

                    if (pet != null && (pet.Alive || pet.IsBonded) && pet.Map != Map.Internal)
                    {
                        if (pet is BaseMount)
                        {
                            BaseMount mount = (BaseMount)pet;

                            if (mount.Rider != null && mount.Rider != fighter)
                            {
                                mount.Rider.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                                mount.Rider.PlaySound(0x1FE);

                                if (this is CitadelAltar)
                                {
                                    mount.Rider.MoveToWorld(this.m_ExitDest, Map.Tokuno);
                                }
                                else
                                {
                                    mount.Rider.MoveToWorld(this.m_ExitDest, this.Map);
                                }

                                continue;
                            }
                            else if (mount.Rider != null)
                            {
                                continue;
                            }
                        }

                        pet.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                        pet.PlaySound(0x1FE);

                        if (this is CitadelAltar)
                        {
                            pet.MoveToWorld(this.m_ExitDest, Map.Tokuno);
                        }
                        else
                        {
                            pet.MoveToWorld(this.m_ExitDest, this.Map);
                        }
                    }
                }
            }

            this.m_Fighters.Remove(fighter);
            this.m_Pets.Remove(fighter);

            fighter.SendLocalizedMessage(1072677); // You have been transported out of this room.

            if (this.m_Fighters.Count == 0)
            {
                this.FinishSequence();
            }
        }
示例#48
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (from == targeted)
                {
                    from.SendMessage("Possess yourself? Hmm, interesting concept.");
                }
                else if (targeted is Mobile) // we only possess mobiles. If you want to possess a house, find another script
                {
                    if (targeted is PlayerMobile)
                    {
                        from.SendMessage("You can't possess a player. They are already possessed by Satan.");
                    }
                    else
                    {
                        ps.m_Possessed = targeted as Mobile;

                        // take everything off and put it in a white backpack
                        ps.m_Stuff     = new Backpack();
                        ps.m_Stuff.Hue = 1153;
                        Container packy = from.Backpack;
                        packy.DropItem(ps.m_Stuff);

                        RemoveLayer(from, Layer.FirstValid, ps.m_Stuff);
                        RemoveLayer(from, Layer.TwoHanded, ps.m_Stuff);
                        RemoveLayer(from, Layer.OneHanded, ps.m_Stuff);
                        // wing layer on my shard
                        RemoveLayer(from, Layer.Unused_xF, ps.m_Stuff);
                        RemoveLayer(from, Layer.Shoes, ps.m_Stuff);
                        RemoveLayer(from, Layer.Pants, ps.m_Stuff);
                        RemoveLayer(from, Layer.Shirt, ps.m_Stuff);
                        RemoveLayer(from, Layer.Helm, ps.m_Stuff);
                        RemoveLayer(from, Layer.Gloves, ps.m_Stuff);
                        RemoveLayer(from, Layer.Ring, ps.m_Stuff);
                        RemoveLayer(from, Layer.Neck, ps.m_Stuff);
                        RemoveLayer(from, Layer.Hair, ps.m_Stuff);
                        RemoveLayer(from, Layer.Waist, ps.m_Stuff);
                        RemoveLayer(from, Layer.InnerTorso, ps.m_Stuff);
                        RemoveLayer(from, Layer.Bracelet, ps.m_Stuff);
                        RemoveLayer(from, Layer.FacialHair, ps.m_Stuff);
                        RemoveLayer(from, Layer.MiddleTorso, ps.m_Stuff);
                        RemoveLayer(from, Layer.Earrings, ps.m_Stuff);
                        RemoveLayer(from, Layer.Arms, ps.m_Stuff);
                        RemoveLayer(from, Layer.Cloak, ps.m_Stuff);
                        RemoveLayer(from, Layer.OuterTorso, ps.m_Stuff);
                        RemoveLayer(from, Layer.OuterLegs, ps.m_Stuff);
                        RemoveLayer(from, Layer.LastUserValid, ps.m_Stuff);

                        // now copy everything from the mobile you are possessing and equip it
                        CopyLayer(ps.m_Possessed, from, Layer.FirstValid);
                        CopyLayer(ps.m_Possessed, from, Layer.TwoHanded);
                        CopyLayer(ps.m_Possessed, from, Layer.OneHanded);
                        // wing layer on my shard
                        CopyLayer(ps.m_Possessed, from, Layer.Unused_xF);
                        CopyLayer(ps.m_Possessed, from, Layer.Shoes);
                        CopyLayer(ps.m_Possessed, from, Layer.Pants);
                        CopyLayer(ps.m_Possessed, from, Layer.Shirt);
                        CopyLayer(ps.m_Possessed, from, Layer.Helm);
                        CopyLayer(ps.m_Possessed, from, Layer.Gloves);
                        CopyLayer(ps.m_Possessed, from, Layer.Ring);
                        CopyLayer(ps.m_Possessed, from, Layer.Neck);
                        CopyLayer(ps.m_Possessed, from, Layer.Hair);
                        CopyLayer(ps.m_Possessed, from, Layer.Waist);
                        CopyLayer(ps.m_Possessed, from, Layer.InnerTorso);
                        CopyLayer(ps.m_Possessed, from, Layer.Bracelet);
                        CopyLayer(ps.m_Possessed, from, Layer.FacialHair);
                        CopyLayer(ps.m_Possessed, from, Layer.MiddleTorso);
                        CopyLayer(ps.m_Possessed, from, Layer.Earrings);
                        CopyLayer(ps.m_Possessed, from, Layer.Arms);
                        CopyLayer(ps.m_Possessed, from, Layer.Cloak);
                        CopyLayer(ps.m_Possessed, from, Layer.OuterTorso);
                        CopyLayer(ps.m_Possessed, from, Layer.OuterLegs);
                        CopyLayer(ps.m_Possessed, from, Layer.LastUserValid);

                        // save and set basics
                        ps.m_Possessor = from;

                        ps.m_Name = from.Name;
                        from.Name = ps.m_Possessed.Name;

                        ps.m_Title = from.Title;
                        from.Title = ps.m_Possessed.Title;

                        ps.m_Hue = from.Hue;
                        from.Hue = ps.m_Possessed.Hue;

                        ps.m_SpeechHue = from.SpeechHue;
                        from.SpeechHue = ps.m_Possessed.SpeechHue;

                        ps.m_BodyValue = from.BodyValue;
                        from.BodyValue = ps.m_Possessed.BodyValue;

                        ps.m_Female = from.Female;
                        from.Female = ps.m_Possessed.Female;

                        ps.m_Karma = from.Karma;
                        from.Karma = ps.m_Possessed.Karma;

                        ps.m_Fame = from.Fame;
                        from.Fame = ps.m_Possessed.Fame;

                        ps.m_Kills = from.Kills;
                        from.Kills = ps.m_Possessed.Kills;

                        // if mounted, dismount.
                        // Just be sure you are riding an ethy or you will abandon your mount
                        IMount ride = from.Mount;
                        if (ride != null)
                        {
                            ride.Rider = null;
                        }

                        // orient and display
                        Point3D m_Location = new Point3D(ps.m_Possessed.Location.X, ps.m_Possessed.Location.Y, ps.m_Possessed.Location.Z);
                        from.Direction = ps.m_Possessed.Direction;
                        from.MoveToWorld(m_Location, ps.m_Possessed.Map);
                        from.Hidden = false;
                        // hide the mobile
                        ps.m_Possessed.Hidden   = true;
                        ps.m_Possessed.CantWalk = true;
                        ps.m_Possessing         = true;
                    }
                }
                else
                {
                    from.SendMessage("You can't possess that!");
                }
            }
示例#49
0
        public static void GetFollowers_OnTarget(Mobile from, object obj)
        {
            if (obj is PlayerMobile)
            {
                PlayerMobile  master = (PlayerMobile)obj;
                List <Mobile> pets   = master.AllFollowers;

                if (pets.Count > 0)
                {
                    CommandLogging.WriteLine(from, "{0} {1} getting all followers of {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(master));

                    from.SendMessage("That player has {0} pet{1}.", pets.Count, pets.Count != 1 ? "s" : "");

                    for (int i = 0; i < pets.Count; ++i)
                    {
                        Mobile pet = (Mobile)pets[i];

                        if (pet is IMount)
                        {
                            ((IMount)pet).Rider = null;                             // make sure it's dismounted
                        }
                        pet.MoveToWorld(from.Location, from.Map);
                    }
                }
                else
                {
                    from.SendMessage("There were no pets found for that player.");
                }
            }
            else if (obj is Mobile && ((Mobile)obj).Player)
            {
                Mobile    master = (Mobile)obj;
                ArrayList pets   = new ArrayList();

                foreach (Mobile m in World.Mobiles.Values)
                {
                    if (m is BaseCreature)
                    {
                        BaseCreature bc = (BaseCreature)m;

                        if ((bc.Controlled && bc.ControlMaster == master) || (bc.Summoned && bc.SummonMaster == master))
                        {
                            pets.Add(bc);
                        }
                    }
                }

                if (pets.Count > 0)
                {
                    CommandLogging.WriteLine(from, "{0} {1} getting all followers of {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(master));

                    from.SendMessage("That player has {0} pet{1}.", pets.Count, pets.Count != 1 ? "s" : "");

                    for (int i = 0; i < pets.Count; ++i)
                    {
                        Mobile pet = (Mobile)pets[i];

                        if (pet is IMount)
                        {
                            ((IMount)pet).Rider = null;                             // make sure it's dismounted
                        }
                        pet.MoveToWorld(from.Location, from.Map);
                    }
                }
                else
                {
                    from.SendMessage("There were no pets found for that player.");
                }
            }
            else
            {
                from.BeginTarget(-1, false, TargetFlags.None, new TargetCallback(GetFollowers_OnTarget));
                from.SendMessage("That is not a player. Try again.");
            }
        }
示例#50
0
        public override void OnDoubleClick(Mobile from)
        {
            // if not a player
            Mobile      m_Mob       = (Mobile)from;
            AccessLevel al_MobLevel = m_Mob.AccessLevel;
            Account     a_Account   = (Account)m_Mob.Account;
            AccessLevel al_AccLevel = a_Account.AccessLevel;

            if (al_AccLevel > AccessLevel.Player)
            {
                // if not already possessing a mobile
                if (!m_Possessing)
                {
                    from.SendMessage("Who or What do you want to possess?");
                    from.Target = new InternalTarget(this);
                }
                // restore your self and unhide the previously possessed mobile
                else
                {
                    // restore basics
                    m_Possessing   = false;
                    from.Karma     = m_Karma;
                    from.Fame      = m_Fame;
                    from.Name      = m_Name;
                    from.Title     = m_Title;
                    from.Hue       = m_Hue;
                    from.BodyValue = m_BodyValue;
                    from.Female    = m_Female;
                    from.Hidden    = true;
                    // Delete eveything you have equipped which is just a copy of what the NPC had
                    ArrayList equipitems = new ArrayList(from.Items);
                    foreach (Item item in equipitems)
                    {
                        if ((item.Layer != Layer.Bank) && (item.Layer != Layer.Backpack))
                        {
                            item.Delete();
                        }
                    }
                    // get dressed and delete that white backpack
                    for (int i = m_Stuff.Items.Count - 1; i >= 0; --i)
                    {
                        if (i >= m_Stuff.Items.Count)
                        {
                            continue;
                        }
                        from.EquipItem((Item)m_Stuff.Items[i]);
                    }
// do we really want to delete the backpack?
                    m_Stuff.Delete();

                    // get your location, orient, enabale and show the mobile
                    Point3D from_Location = new Point3D(from.Location.X, from.Location.Y, from.Location.Z);
                    if (m_Possessed != null)
                    {
                        m_Possessed.Direction = from.Direction;
                        m_Possessed.MoveToWorld(from_Location, from.Map);
                        m_Possessed.Hidden   = false;
                        m_Possessed.CantWalk = false;
                    }
                }
            }
            else // somehow a player got one of these which should never happen, just delete it and put a scare into them
            {
                from.SendMessage("You are trying to access a restricted item. The item has been removed and your account has been scheduled for deletion.");
                this.Delete();
            }
        }
示例#51
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (m_State == null)
            {
                return;
            }

            Mobile focus = m_State.Mobile;
            Mobile from  = state.Mobile;

            if (focus == null)
            {
                from.SendMessage("That character is no longer online.");
                return;
            }
            if (focus.Deleted)
            {
                from.SendMessage("That character no longer exists.");
                return;
            }
            if (from != focus && focus.Hidden && from.AccessLevel < focus.AccessLevel)
            {
                from.SendMessage("That character is no longer visible.");
                return;
            }

            switch (info.ButtonID)
            {
            case 1:                     // Tell
            {
                TextRelay text = info.GetTextEntry(0);

                if (text != null)
                {
                    focus.SendGump(new MessageSentGump(focus, from.Name, text.Text, false));
                    from.SendAsciiMessage("You sent a message to " + focus.Name);
                    //focus.SendMessage( 0x482, "{0} tells you:", from.Name );
                    //focus.SendMessage( 0x482, text.Text );

                    CommandLogging.WriteLine(from, "{0} {1} sent a message to {2}: \"{3}\" ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus), text.Text);
                }

                from.SendGump(new ClientGump(from, m_State));

                break;
            }

            case 4:                     // Props
            {
                Resend(from, info);

                if (!BaseCommand.IsAccessible(from, focus))
                {
                    from.SendMessage("That is not accessible.");
                }
                else
                {
                    from.SendGump(new PropertiesGump(from, focus));
                    CommandLogging.WriteLine(from, "{0} {1} opening properties gump of {2} ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus));
                }

                break;
            }

            case 5:                     // Go to
            {
                if (focus.Map == null || focus.Map == Map.Internal)
                {
                    from.SendMessage("That character is not in the world.");
                }
                else
                {
                    from.MoveToWorld(focus.Location, focus.Map);
                    Resend(from, info);

                    CommandLogging.WriteLine(from, "{0} {1} going to {2}, Location {3}, Map {4}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus), focus.Location, focus.Map);
                }

                break;
            }

            case 6:                     // Get
            {
                if (from.Map == null || from.Map == Map.Internal)
                {
                    from.SendMessage("You cannot bring that person here.");
                }
                else if (!BaseCommand.IsAccessible(from, focus))
                {
                    from.SendMessage("That is not accessible.");
                }
                else
                {
                    focus.MoveToWorld(from.Location, from.Map);
                    CommandLogging.WriteLine(from, "{0} {1} bringing {2} to Location {3}, Map {4}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus), from.Location, from.Map);
                }
                Resend(from, info);

                break;
            }

            case 7:                     // Move
            {
                from.Target = new MoveTarget(focus);
                Resend(from, info);

                break;
            }

            case 8:                     // Kick
            {
                if (from.AccessLevel >= AccessLevel.GameMaster && from.AccessLevel > focus.AccessLevel)
                {
                    focus.Say("I've been kicked!");

                    m_State.Dispose();

                    CommandLogging.WriteLine(from, "{0} {1} kicking {2} ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus));
                }

                break;
            }

            case 9:                     // Kill
            {
                if (from.AccessLevel >= AccessLevel.GameMaster && from.AccessLevel > focus.AccessLevel)
                {
                    focus.Kill();
                    CommandLogging.WriteLine(from, "{0} {1} killing {2} ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus));
                }

                Resend(from, info);

                break;
            }

            case 10:                     //Res
            {
                if (from.AccessLevel >= AccessLevel.GameMaster && from.AccessLevel > focus.AccessLevel)
                {
                    focus.PlaySound(0x214);
                    focus.FixedEffect(0x376A, 10, 16);

                    focus.Resurrect();

                    CommandLogging.WriteLine(from, "{0} {1} resurrecting {2} ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus));
                }

                Resend(from, info);

                break;
            }

            case 11:                     // Skills
            {
                Resend(from, info);

                if (from.AccessLevel > focus.AccessLevel)
                {
                    from.SendGump(new SkillsGump(from, focus));
                    CommandLogging.WriteLine(from, "{0} {1} Opening Skills gump of {2} ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus));
                }

                break;
            }
            }
        }
示例#52
0
        public bool MoveToNearestDockOrLand(Mobile from)
        {
            if ((Boat != null && !Boat.Contains(from)) || !ValidateDockOrLand())
            {
                return(false);
            }

            Map map = Map;

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

            Rectangle2D rec;
            Point3D     nearest = Point3D.Zero;
            Point3D     p       = Point3D.Zero;

            if (Boat.IsRowBoat)
            {
                rec = new Rectangle2D(Boat.X - 8, Boat.Y - 8, 16, 16);
            }
            else
            {
                switch (Boat.Facing)
                {
                default:
                case Direction.North:
                case Direction.South:
                    if (X < Boat.X)
                    {
                        rec = new Rectangle2D(X - 8, Y - 8, 8, 16);
                    }
                    else
                    {
                        rec = new Rectangle2D(X, Y - 8, 8, 16);
                    }
                    break;

                case Direction.West:
                case Direction.East:
                    if (Y < Boat.Y)
                    {
                        rec = new Rectangle2D(X - 8, Y - 8, 16, 8);
                    }
                    else
                    {
                        rec = new Rectangle2D(X - 8, Y, 16, 8);
                    }
                    break;
                }
            }

            for (int x = rec.X; x <= rec.X + rec.Width; x++)
            {
                for (int y = rec.Y; y <= rec.Y + rec.Height; y++)
                {
                    p = new Point3D(x, y, map.GetAverageZ(x, y));

                    if (ValidateTile(from, ref p))
                    {
                        if (nearest == Point3D.Zero || from.GetDistanceToSqrt(p) < from.GetDistanceToSqrt(nearest))
                        {
                            nearest = p;
                        }
                    }
                }
            }

            if (nearest != Point3D.Zero)
            {
                BaseCreature.TeleportPets(from, nearest, Map);
                from.MoveToWorld(nearest, Map);

                return(true);
            }

            return(false);
        }
示例#53
0
        public static int Build(Mobile from, Point3D start, Point3D end, ConstructorInfo ctor, object[] values, string[,] props, PropertyInfo[] realProps, ArrayList packs)
        {
            try
            {
                Map map = from.Map;

                int objectCount = (packs == null ? (((end.X - start.X) + 1) * ((end.Y - start.Y) + 1)) : packs.Count);

                if (objectCount >= 20)
                {
                    from.SendMessage("Constructing {0} objects, please wait.", objectCount);
                }

                bool sendError = true;

                if (packs != null)
                {
                    for (int i = 0; i < packs.Count; ++i)
                    {
                        object built = Build(from, ctor, values, props, realProps, ref sendError);

                        if (built is Item)
                        {
                            Container pack = (Container)packs[i];

                            pack.DropItem((Item)built);
                        }
                        else if (built is Mobile)
                        {
                            Mobile m = (Mobile)built;

                            m.MoveToWorld(new Point3D(start.X, start.Y, start.Z), map);
                        }
                    }
                }
                else
                {
                    for (int x = start.X; x <= end.X; ++x)
                    {
                        for (int y = start.Y; y <= end.Y; ++y)
                        {
                            object built = Build(from, ctor, values, props, realProps, ref sendError);

                            if (built is Item)
                            {
                                Item item = (Item)built;
                                item.MoveToWorld(new Point3D(x, y, start.Z), map);
                                AddItemEventArgs e = new AddItemEventArgs(built as Item, from);
                                EventSink.InvokeAddItem(e);

                                // erl: stores person adding it if Spawner
                                // or ChestItemSpawner type + calls change log

                                if (built is Spawner)
                                {
                                    Spawner sp = (Spawner)built;
                                    sp.LastProps = from;
                                    sp.LogChange("Spawner added");
                                }
                                else if (built is ChestItemSpawner)
                                {
                                    ChestItemSpawner sp = (ChestItemSpawner)built;
                                    sp.LastProps = from;
                                    sp.LogChange("ChestItemSpawner added");
                                }
                                else if (built is ChestLootPackSpawner)
                                {
                                    ChestLootPackSpawner sp = (ChestLootPackSpawner)built;
                                    sp.LastProps = from;
                                    sp.LogChange("ChestLootPackSpawner added");
                                }
                            }
                            else if (built is Mobile)
                            {
                                Mobile m = (Mobile)built;

                                m.MoveToWorld(new Point3D(x, y, start.Z), map);
                            }
                        }
                    }
                }

                return(objectCount);
            }
            catch (Exception ex)
            {
                LogHelper.LogException(ex);
                Console.WriteLine(ex);
                return(0);
            }
        }
示例#54
0
		public override void OnDoubleClick( Mobile m )
		{
			if ( !m_Active || m_TeleDest == null || m_TeleDest.Deleted || m_TeleDest.Map == Map.Internal )
				return;

			if ( m.InRange( this, 3 ) )
			{
				Map map = m_TeleDest.Map;
				Point3D p = m_TeleDest.TelePoint;

				Server.Mobiles.BaseCreature.TeleportPets( m, p, map );

				m.MoveToWorld( p, map );
			}
			else
			{
				m.SendLocalizedMessage( 1019045 ); // I can't reach that.
			}
		}
示例#55
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            PageType type = (PageType)(-1);

            switch (info.ButtonID)
            {
            case 0:                                          // Close/Cancel
            {
                from.SendLocalizedMessage(501235, "", 0x35); // Help request aborted.

                break;
            }

            case 1:                     // General question
            {
                type = PageType.Question;
                break;
            }

            case 2:                     // Stuck
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (house != null && house.IsAosRules)
                {
                    from.Location = house.BanLocation;
                }
                else if (from.Region.IsPartOf(typeof(Server.Regions.Jail)))
                {
                    from.SendLocalizedMessage(1114345, "", 0x35);                               // You'll need a better jailbreak plan than that!
                }
                else if (Factions.Sigil.ExistsOn(from))
                {
                    from.SendLocalizedMessage(1061632);                               // You can't do that while carrying the sigil.
                }
                else if (from.CanUseStuckMenu() && from.Region.CanUseStuckMenu(from) && !CheckCombat(from) && !from.Frozen && !from.Criminal && (Core.AOS || from.Kills < 5))
                {
                    StuckMenu menu = new StuckMenu(from, from, true);

                    menu.BeginClose();

                    from.SendGump(menu);
                }
                else
                {
                    type = PageType.Stuck;
                }

                break;
            }

            case 3:                     // Report bug or contact Origin
            {
                type = PageType.Bug;
                break;
            }

            case 4:                     // Game suggestion
            {
                type = PageType.Suggestion;
                break;
            }

            case 5:                     // Account management
            {
                type = PageType.Account;
                break;
            }

            case 6:                     // Other
            {
                type = PageType.Other;
                break;
            }

            case 7:                     // Harassment: verbal/exploit
            {
                type = PageType.VerbalHarassment;
                break;
            }

            case 8:                     // Harassment: physical
            {
                type = PageType.PhysicalHarassment;
                break;
            }

            case 9:                     // Young player transport
            {
                if (IsYoung(from))
                {
                    if (from.Region.IsPartOf(typeof(Regions.Jail)))
                    {
                        from.SendLocalizedMessage(1114345, "", 0x35);                                   // You'll need a better jailbreak plan than that!
                    }
                    else if (from.Region.IsPartOf("Haven Island"))
                    {
                        from.SendLocalizedMessage(1041529);                                   // You're already in Haven
                    }
                    else
                    {
                        from.MoveToWorld(new Point3D(3503, 2574, 14), Map.Felucca);
                    }
                }

                break;
            }
            }

            if (type != (PageType)(-1) && PageQueue.CheckAllowedToPage(from))
            {
                from.SendGump(new PagePromptGump(from, type));
            }
        }
示例#56
0
		public virtual void UseGate( Mobile m )
		{
			ClientFlags flags = m.NetState == null ? ClientFlags.None : m.NetState.Flags;

			if ( (m.Kills >= 5 && m_TargetMap != Map.Felucca) )
			{
				m.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
			}
			else if ( m.Spell != null )
			{
				m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
			}
			else if ( m_TargetMap != null && m_TargetMap != Map.Internal )
			{
				BaseCreature.TeleportPets( m, m_Target, m_TargetMap );

				m.MoveToWorld( m_Target, m_TargetMap );

				if ( m.AccessLevel == AccessLevel.Player || !m.Hidden )
					m.PlaySound( 0x1FE );

				OnGateUsed( m );
			}
			else
			{
				m.SendMessage( "This moongate does not seem to go anywhere." );
			}
		}
示例#57
0
 public static void CabinDoor(Mobile m, Point3D loc, Map map)
 {
     BaseCreature.TeleportPets(m, loc, map, false);
     m.MoveToWorld(loc, map);
     m.PlaySound(234);
 }
示例#58
0
		public virtual void DoTeleport(Mobile m)
		{
			Map map = m_MapDest;

			if (map == null || map == Map.Internal)
			{
				map = m.Map;
			}

			Point3D p = m_PointDest;

			if (p == Point3D.Zero)
			{
				p = m.Location;
			}

			BaseCreature.TeleportPets(m, p, map);

			bool sendEffect = (!m.Hidden || m.IsPlayer());

			if (m_SourceEffect && sendEffect)
			{
				Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);
			}

			m.MoveToWorld(p, map);

			if (m_DestEffect && sendEffect)
			{
				Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);
			}

			if (m_SoundID > 0 && sendEffect)
			{
				Effects.PlaySound(m.Location, m.Map, m_SoundID);
			}
		}
示例#59
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);
            }
        }
示例#60
0
        public virtual void AddMobile(Mobile m, int wanderRange, int xOffset, int yOffset, int zOffset)
        {
            this.m_Mobiles.Add(m);

            int zavg = this.Map.GetAverageZ(this.X + xOffset, this.Y + yOffset);
            Point3D loc = new Point3D(this.X + xOffset, this.Y + yOffset, zavg + zOffset);
            BaseCreature bc = m as BaseCreature;

            if (bc != null)
            {
                bc.RangeHome = wanderRange;
                bc.Home = loc;
            }

            if (m is BaseVendor || m is Banker)
                m.Direction = Direction.South;

            m.MoveToWorld(loc, this.Map);
        }