Ejemplo n.º 1
0
 public static void Animate_OnCommand(CommandEventArgs e)
 {
     if (e.Length == 6)
     {
         e.Mobile.Animate(e.GetInt32(0), e.GetInt32(1), e.GetInt32(2), e.GetBoolean(3), e.GetBoolean(4), e.GetInt32(5));
     }
     else
     {
         e.Mobile.SendMessage("Format: Animate <action> <frameCount> <repeatCount> <forward> <repeat> <delay>");
     }
 }
Ejemplo n.º 2
0
 private static void Dupe_OnCommand(CommandEventArgs e)
 {
     int amount = 1;
     if (e.Length >= 1)
         amount = e.GetInt32(0);
     e.Mobile.Target = new DupeTarget(false, amount > 0 ? amount : 1);
     e.Mobile.SendMessage("What do you wish to dupe?");
 }
Ejemplo n.º 3
0
		public static void RandomTalisman_OnCommand(CommandEventArgs e)
		{
			Mobile m = e.Mobile;
			int count = e.GetInt32(0);

			for (int i = 0; i < count; i++)
			{
				m.AddToBackpack(Loot.RandomTalisman());
			}
		}
Ejemplo n.º 4
0
 public static void AnimateMe_OnCommand(CommandEventArgs e)
 {
     if (e.Length == 1)
     {
         e.Mobile.Animate(e.GetInt32(0), 8, 1, true, false, 0);
     }
     else
     {
         e.Mobile.SendMessage("Format: AnimateMe <action> ");
     }
 }
Ejemplo n.º 5
0
        public static void TileXYZ_OnCommand(Server.Commands.CommandEventArgs e)
        {
            if (e.Length >= 6)
            {
                Point3D p  = new Point3D(e.GetInt32(0), e.GetInt32(1), e.GetInt32(4));
                Point3D p2 = new Point3D(p.X + e.GetInt32(2) - 1, p.Y + e.GetInt32(3) - 1, e.GetInt32(4));

                string[] subArgs = new string[e.Length - 5];

                for (int i = 0; i < subArgs.Length; ++i)
                {
                    subArgs[i] = e.Arguments[i + 5];
                }

                Add.Invoke(e.Mobile, p, p2, subArgs);
            }
            else
            {
                e.Mobile.SendMessage("Format: TileXYZ <x> <y> <w> <h> <z> <type> [params] [set {<propertyName> <value> ...}]");
            }
        }
Ejemplo n.º 6
0
        private static void OnCommandMusic(CommandEventArgs e)
        {
            e.Mobile.SendMessage("Tocando musiquinha :B");
            var musicId = e.GetInt32(0);

            try
            {
                e.Mobile.NetState.Send(PlayMusic.GetInstance(musicId));
            } catch (Exception ex)
            {
                e.Mobile.SendMessage("Achei a musica nao veih " + ex.Message);
            }
        }
Ejemplo n.º 7
0
        private static void OnCommandMusic(CommandEventArgs e)
        {
            var animType = e.GetString(0);
            var action   = e.GetInt32(1);

            try
            {
                var a = (AnimationType)System.Enum.Parse(typeof(AnimationType), animType);
                e.Mobile.Animate(a, action);
            } catch (Exception ex)
            {
                e.Mobile.SendMessage("Achei a musica nao veih " + ex.Message);
            }
        }
        public static void CrimiSegovia_OnCommand(CommandEventArgs e)
        {
            Mobile from = e.Mobile;

            e.GetInt32(0);

            if (from != null)
            {
                from.SendMessage("¿A quien deseas hacer enemigo de Segovia?");


                from.Target = new InternalTarget();
            }
        }
Ejemplo n.º 9
0
        private static void InternalXYZ_OnCommand(CommandEventArgs e, bool outline)
        {
            if (e.Length >= 6)
            {
                Point3D p  = new Point3D(e.GetInt32(0), e.GetInt32(1), e.GetInt32(4));
                Point3D p2 = new Point3D(p.X + e.GetInt32(2) - 1, p.Y + e.GetInt32(3) - 1, e.GetInt32(4));

                string[] subArgs = new string[e.Length - 5];

                for (int i = 0; i < subArgs.Length; ++i)
                {
                    subArgs[i] = e.Arguments[i + 5];
                }

                Invoke(e.Mobile, p, p2, subArgs, null, outline);
            }
            else
            {
                e.Mobile.SendMessage(
                    "Format: {0}XYZ <x> <y> <w> <h> <z> <type> [params] [set {{<propertyName> <value> ...}}]",
                    outline ? "Outline" : "Tile");
            }
        }
Ejemplo n.º 10
0
        //"Let you control a NPC."
        private static void Control_OnCommand(CommandEventArgs e)
        {
            Mobile from = e.Mobile;

            e.GetInt32(0);

            if (from != null)
            {
                from.SendMessage("Was willst du kontrollieren?");
                //"Choose the target to control..."

                from.Target = new InternalTarget(e.Arguments);
            }
        }
Ejemplo n.º 11
0
        private static void PrintMessage_OnCommand(CommandEventArgs arg)
        {
            Mobile from = arg.Mobile;

            if (arg.Length <= 0)
            {
                from.SendMessage("Usage: PrintMessage <msg_number>");
                return;
            }

            // What message do we print
            int message = arg.GetInt32(0);

            from.SendLocalizedMessage(message);
            from.SendMessage("Done.");
        }
Ejemplo n.º 12
0
        public override void Execute(CommandEventArgs e, object obj)
        {
            Mobile from = e.Mobile;

            if (e.Length == 1)
            {
                int    index = e.GetInt32(0);
                Mobile mob   = (Mobile)obj;

                CommandLogging.WriteLine(from, "{0} {1} playing sound {2} for {3}", from.AccessLevel, CommandLogging.Format(from), index, CommandLogging.Format(mob));
                mob.Send(new PlaySound(index, mob.Location));
            }
            else
            {
                from.SendMessage("Format: PrivSound <index>");
            }
        }
Ejemplo n.º 13
0
		private static void Props_OnCommand( CommandEventArgs e )
		{
			if ( e.Length == 1 )
			{
				IEntity ent = World.FindEntity( e.GetInt32( 0 ) );

				if ( ent == null )
					e.Mobile.SendMessage( "No object with that serial was found." );
				else if ( !BaseCommand.IsAccessible( e.Mobile, ent ) )
					e.Mobile.SendMessage( "That is not accessible." );
				else
					e.Mobile.SendGump( new PropertiesGump( e.Mobile, ent ) );
			}
			else
			{
				e.Mobile.Target = new PropsTarget();
			}
		}
        public static void AcquireRare_OnCommand(CommandEventArgs e)
        {
            try
            {
                if (e.Length != 1 && e.Length != 2)
                {
                    e.Mobile.SendMessage("Incorrect number of arguments. Format : [acquirerare (<rare level>) <rare group name>");
                    return;
                }

                Regex ValidRarityPatt = new Regex("^[0-9]$");

                if (!ValidRarityPatt.IsMatch(e.GetString(0)))
                {
                    // Invalid
                    e.Mobile.SendMessage("You may only enter an number to represent a rarity level. Format : [acquirerare (<rare level>) <rare group name>");
                    return;
                }

                int iRarity = e.GetInt32(0);

                // Check rarity level is ok
                if (iRarity < 0 || iRarity > 10)
                {
                    // Invalid
                    e.Mobile.SendMessage("Item rarity is scaled from 0 (most common) to 10 (most rare).");
                    return;
                }

                e.Mobile.Backpack.AddItem(
                    (e.Length == 1
                                                ?
                     RareFactory.AcquireRare((short)iRarity)                                            // only have rarity
                                                :
                     RareFactory.AcquireRare((short)iRarity, e.GetString(1))                            // rarity + group
                    ));
            }
            catch (Exception ex)
            {
                LogHelper.LogException(ex);
                e.Mobile.SendMessage(ex.Message);
            }
        }
Ejemplo n.º 15
0
        private static void FindSkill_OnCommand(CommandEventArgs arg)
        {
            Mobile    from = arg.Mobile;
            SkillName skill;

            // Init elapsed with 2nd of arguments passed to command
            int elapsed = arg.GetInt32(1);

            // Test the skill argument input to make sure it's valid

            try
            {
                // Try to set var holding skill arg to enum equivalent
                skill = (SkillName)Enum.Parse(typeof(SkillName), arg.GetString(0), true);
            }
            catch
            {
                // Skill not valid, return without performing mob search
                from.SendMessage("You have specified an invalid skill.");
                return;
            }

            ArrayList MobsMatched = FindSkillMobs(skill, elapsed);

            if (MobsMatched.Count > 0)
            {
                // Found some, so loop and display

                foreach (PlayerMobile pm in MobsMatched)
                {
                    if (!pm.Hidden || from.AccessLevel > pm.AccessLevel || pm == from)
                    {
                        from.SendMessage("{0}, x:{1}, y:{2}, z:{3}", pm.Name, pm.Location.X, pm.Location.Y, pm.Location.Z);
                    }
                }
            }
            else
            {
                // Found none, so inform.
                from.SendMessage("Nobody online has used that skill recently.");
            }
        }
Ejemplo n.º 16
0
 public override void Execute(CommandEventArgs e, object obj)
 {
     /*if (e.Length == 1)
      * {
      *      string result = Properties.GetValue(e.Mobile, obj, e.GetString(0));
      *
      *      if (result == "Property not found." || result == "Property is write only." || result.StartsWith("Getting this property"))
      *              LogFailure(result);
      *      else
      *              AddResponse(result);
      * }
      * else
      * {
      *      LogFailure("Format: Get <propertyName>");
      * }*/
     m_Amount = 1;
     if (e.Length >= 1)
     {
         m_Amount = e.GetInt32(0);
     }
     PerItem(e.Mobile, obj);
 }
Ejemplo n.º 17
0
        public static void RepeatSoundCommand_OnCommand(CommandEventArgs args)
        {
            if (args.Length == 2)
            {
                Timer  timer      = null;
                bool   foundValue = false;
                int    soundID    = args.GetInt32(0);
                double interval   = args.GetDouble(1);

                if (m_Table.ContainsKey(soundID))
                {
                    foundValue = m_Table.TryGetValue(soundID, out timer);
                }

                if (foundValue || timer != null)
                {
                    if (timer != null)
                    {
                        timer.Stop();
                    }

                    if (m_Table.Remove(soundID))
                    {
                        args.Mobile.SendMessage("RepeatSound process with sound index {0} halted.", soundID);
                    }
                }
                else
                {
                    timer = new InternalTimer(args.Mobile, soundID, interval);
                    timer.Start();

                    m_Table.Add(soundID, timer);
                }
            }
            else
            {
                args.Mobile.SendMessage("Usage: RepeatSound <int soundID> <double intervalDelay>");
            }
        }
Ejemplo n.º 18
0
        public static void Season_OnCommand(CommandEventArgs e)
        {
            Map map;

            if (e.Length == 1)
            {
                for (int i = 1; i < 5; i++)
                {
                    map        = Map.AllMaps[i];
                    map.Season = (e.GetInt32(0));

                    foreach (NetState state in NetState.Instances)
                    {
                        Mobile m = state.Mobile;
                        if (m != null)
                        {
                            state.Send(SeasonChange.Instantiate(m.GetSeason(), true));
                            m.SendEverything();
                        }
                    }
                }
            }
        }
Ejemplo n.º 19
0
        private static void SplashGold_OnCommand(CommandEventArgs e)
        {
            int amount = 1;

            if (e.Length >= 1)
            {
                amount = e.GetInt32(0);
            }

            if (amount < 100)
            {
                e.Mobile.SendMessage("Splash at least 100 gold.");
            }
            else if (amount > 2800000)
            {
                e.Mobile.SendMessage("Amount exceeded.  Use an amount less than 2800000.");
            }
            else
            {
                e.Mobile.Target = new SplashTarget(amount > 0 ? amount : 1);
                e.Mobile.SendMessage("Where do you want the center of the gold splash to be?");
            }
        }
Ejemplo n.º 20
0
        private static void Props_OnCommand(CommandEventArgs e)
        {
            if (e.Length == 1)
            {
                IEntity ent = World.FindEntity(e.GetInt32(0));

                if (ent == null)
                {
                    e.Mobile.SendMessage("No object with that serial was found.");
                }
                else if (!BaseCommand.IsAccessible(e.Mobile, ent))
                {
                    e.Mobile.SendMessage("That is not accessible.");
                }
                else
                {
                    e.Mobile.SendGump(new PropertiesGump(e.Mobile, ent));
                }
            }
            else
            {
                e.Mobile.Target = new PropsTarget();
            }
        }
Ejemplo n.º 21
0
        public static void Cast_OnCommand(CommandEventArgs e)
        {
            if (e.Length == 1)
            {
                if (!Multis.DesignContext.Check(e.Mobile))
                {
                    return;                     // They are customizing
                }
                Spell spell = SpellRegistry.NewSpell(e.GetInt32(0), e.Mobile, null);

                if (spell != null)
                {
                    spell.Cast();
                }
                else
                {
                    e.Mobile.SendMessage("That spell was not found.");
                }
            }
            else
            {
                e.Mobile.SendMessage("Format: Cast <ID>");
            }
        }
Ejemplo n.º 22
0
        private static void Particle_OnCommand(CommandEventArgs e)
        {
            int partID     = 0;
            int speed      = 0;
            int duration   = 0;
            int effect     = 0;
            int hue        = 0;
            int rendermode = 0;

            if (e.Length >= 6)
            {
                partID     = e.GetInt32(0);
                speed      = e.GetInt32(1);
                duration   = e.GetInt32(2);
                effect     = e.GetInt32(3);
                hue        = e.GetInt32(4);
                rendermode = e.GetInt32(5);
            }
            else
            {
                e.Mobile.SendMessage("Particle [itemid] [speed] [duration] [effect] [hue] [rendermode]");
            }
            e.Mobile.FixedParticles(partID, speed, duration, effect, hue, rendermode, EffectLayer.Waist);
        }
Ejemplo n.º 23
0
		public static void GrantTownSilver_OnCommand( CommandEventArgs e )
		{
			Town town = FromRegion( e.Mobile.Region );

			if ( town == null )
				e.Mobile.SendMessage( "You are not in a faction town." );
			else if ( e.Length == 0 )
				e.Mobile.SendMessage( "Format: GrantTownSilver <amount>" );
			else
			{
				town.Silver += e.GetInt32( 0 );
				e.Mobile.SendMessage( "You have granted {0:N0} silver to the town. It now has {1:N0} silver.", e.GetInt32( 0 ), town.Silver );
			}
		}
Ejemplo n.º 24
0
		public static void IncZ_OnCommand( CommandEventArgs e )
		{
			if( e.Length == 1 )
			{
				e.Mobile.Target = new IncXYZTarget( 0, 0, e.GetInt32( 0 ) );
			}
			else
			{
				e.Mobile.SendMessage( "Format: IncZ <z>" );
			}
		}
Ejemplo n.º 25
0
		private static void InternalZ_OnCommand( CommandEventArgs e, bool outline )
		{
			if ( e.Length >= 2 )
			{
				string[] subArgs = new string[e.Length - 1];

				for ( int i = 0; i < subArgs.Length; ++i )
					subArgs[i] = e.Arguments[i + 1];

				BoundingBoxPicker.Begin( e.Mobile, new BoundingBoxCallback( TileBox_Callback ), new TileState( TileZType.Fixed, e.GetInt32( 0 ), subArgs, outline ) );
			}
			else
			{
				e.Mobile.SendMessage( "Format: {0}Z <z> <type> [params] [set {{<propertyName> <value> ...}}]", outline ? "Outline" : "Tile" );
			}
		}
Ejemplo n.º 26
0
		private static void InternalXYZ_OnCommand( CommandEventArgs e, bool outline )
		{
			if ( e.Length >= 6 )
			{
				Point3D p = new Point3D( e.GetInt32( 0 ), e.GetInt32( 1 ), e.GetInt32( 4 ) );
				Point3D p2 = new Point3D( p.X + e.GetInt32( 2 ) - 1, p.Y + e.GetInt32( 3 ) - 1, e.GetInt32( 4 ) );

				string[] subArgs = new string[e.Length - 5];

				for ( int i = 0; i < subArgs.Length; ++i )
					subArgs[i] = e.Arguments[i + 5];

				Add.Invoke( e.Mobile, p, p2, subArgs, null, outline, false );
			}
			else
			{
				e.Mobile.SendMessage( "Format: {0}XYZ <x> <y> <w> <h> <z> <type> [params] [set {{<propertyName> <value> ...}}]", outline ? "Outline" : "Tile" );
			}
		}
Ejemplo n.º 27
0
		private static void SpawnEditorGo_OnCommand(CommandEventArgs e)
		{
			if (e == null)
			{
				return;
			}

			Mobile from = e.Mobile;

			// Make sure a map name was given at least
			if (from != null && e.Length >= 1)
			{
				// Get the map
				Map NewMap = null;
				string MapName = e.Arguments[0];

				// Convert the xml map value to a real map object
				if (string.Compare(MapName, Map.Trammel.Name, true) == 0)
				{
					NewMap = Map.Trammel;
				}
				else if (string.Compare(MapName, Map.Felucca.Name, true) == 0)
				{
					NewMap = Map.Felucca;
				}
				else if (string.Compare(MapName, Map.Ilshenar.Name, true) == 0)
				{
					NewMap = Map.Ilshenar;
				}
				else if (string.Compare(MapName, Map.Malas.Name, true) == 0)
				{
					NewMap = Map.Malas;
				}
				else if (string.Compare(MapName, Map.Tokuno.Name, true) == 0)
				{
					NewMap = Map.Tokuno;
				}
				else
				{
					from.SendMessage("Map '{0}' does not exist!", MapName);
					return;
				}

				// Now that the map has been determined, continue
				// Check if the request is to simply change maps
				if (e.Length == 1)
				{
					// Map Change ONLY
					from.Map = NewMap;
				}
				else if (e.Length == 3)
				{
					// Map & X Y ONLY
					if (NewMap != null)
					{
						int x = e.GetInt32(1);
						int y = e.GetInt32(2);
						int z = NewMap.GetAverageZ(x, y);
						from.Map = NewMap;
						from.Location = new Point3D(x, y, z);
					}
				}
				else if (e.Length == 4)
				{
					// Map & X Y Z
					from.Map = NewMap;
					from.Location = new Point3D(e.GetInt32(1), e.GetInt32(2), e.GetInt32(3));
				}
				else
				{
					from.SendMessage("Format: XmlGo <map> | <map> <x> <y> [z]");
				}
			}
		}
Ejemplo n.º 28
0
		public static void IncXYZ_OnCommand( CommandEventArgs e )
		{
			if( e.Length == 3 )
			{
				e.Mobile.Target = new IncXYZTarget( e.GetInt32( 0 ), e.GetInt32( 1 ), e.GetInt32( 2 ) );
			}
			else
			{
				e.Mobile.SendMessage( "Format: IncXYZ <x> <y> <z>" );
			}
		}
Ejemplo n.º 29
0
		private static void OnCommand_RemoveIssue( CommandEventArgs e )
		{
			Mobile m = e.Mobile;

			if ( m == null )
				return;

			if ( !TrackerSystem.Enabled && m.AccessLevel == AccessLevel.Player )
			{
				m.SendMessage( "The tracker is currently offline." );
				return;
			}

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

				TrackerEntry entry = TrackerPersistance.FindIssue( id );
				if ( entry != null )
				{
					entry.Delete();
					e.Mobile.SendMessage( "The tracker entry has been removed." );
				}
				else
				{
					e.Mobile.SendMessage( "There was no tracker entry by that id." );
				}
			}
			else
			{
				e.Mobile.SendMessage( "Usage: [RemoveIssue <IssueID>" );
			}
		}
Ejemplo n.º 30
0
 public static void Light_OnCommand(CommandEventArgs e)
 {
     e.Mobile.LightLevel = e.GetInt32(0);
 }
Ejemplo n.º 31
0
        private static void SendTo_OnCommand(CommandEventArgs e)
        {
            Mobile from = e.Mobile;

            if (e.Length == 0)
            {
                SendToGump.DisplayTo(from);
            }
            else 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) && !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.Target = new SendToTarget(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) && !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.Target = new SendToTarget(loc, map);

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

                        System.Collections.Generic.Dictionary <string, Region> dict = from.Map.Regions;

                        foreach (System.Collections.Generic.KeyValuePair <string, Region> kvp in dict)
                        {
                            Region r = kvp.Value;

                            if (Insensitive.Equals(r.Name, name))
                            {
                                from.Target = new SendToTarget(new Point3D(r.GoLocation), from.Map);
                                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)
            {
                Map map = from.Map;

                if (map != null)
                {
                    int x = e.GetInt32(0), y = e.GetInt32(1);
                    int z = map.GetAverageZ(x, y);

                    from.Target = new SendToTarget(new Point3D(x, y, z), map);
                }
            }
            else if (e.Length == 3)
            {
                from.Target = new SendToTarget(new Point3D(e.GetInt32(0), e.GetInt32(1), e.GetInt32(2)), from.Map);
            }
            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.Target = new SendToTarget(p, map);
                    }
                    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)]");
            }
        }
Ejemplo n.º 32
0
        private static void Control_OnCommand(CommandEventArgs e)
        {
            Mobile from = e.Mobile;

            e.GetInt32(0);

            if (from != null)
            {
                from.SendMessage("Ciblez le mobile à controler ?");
                //"Choose the target to control..."

                from.Target = new ControlTarget(e.Arguments);
            }
        }
Ejemplo n.º 33
0
 public static void Sound_OnCommand(CommandEventArgs e)
 {
     if (e.Length == 1)
         PlaySound(e.Mobile, e.GetInt32(0), true);
     else if (e.Length == 2)
         PlaySound(e.Mobile, e.GetInt32(0), e.GetBoolean(1));
     else
         e.Mobile.SendMessage("Format: Sound <index> [toAll]");
 }
Ejemplo n.º 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)]");
            }
        }
Ejemplo n.º 35
0
 public static void Light_OnCommand(CommandEventArgs e)
 {
     e.Mobile.LightLevel = e.GetInt32(0);
 }
Ejemplo n.º 36
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)]");
            }
        }
Ejemplo n.º 37
0
        private static void InternalZ_OnCommand(CommandEventArgs e, bool outline)
        {
            var from = e.Mobile;

            if (e.Length >= 2)
            {
                var subArgs = new string[e.Length - 1];

                for (var i = 0; i < subArgs.Length; ++i)
                {
                    subArgs[i] = e.Arguments[i + 1];
                }

                BoundingBoxPicker.Begin(
                    from,
                    (map, start, end) =>
                    TileBox_Callback(from, start, end, new TileState(TileZType.Fixed, e.GetInt32(0), subArgs, outline))
                    );
            }
            else
            {
                from.SendMessage(
                    "Format: {0}Z <z> <type> [params] [set {{<propertyName> <value> ...}}]",
                    outline ? "Outline" : "Tile"
                    );
            }
        }
Ejemplo n.º 38
0
        public static void TileZ_OnCommand(CommandEventArgs e)
        {
            if (e.Length >= 2)
            {
                string[] subArgs = new string[e.Length - 1];

                for (int i = 0; i < subArgs.Length; ++i)
                {
                    subArgs[i] = e.Arguments[i + 1];
                }

                BoundingBoxPicker.Begin(e.Mobile, new BoundingBoxCallback(TileBox_Callback), new TileState(e.GetInt32(0), subArgs));
            }
            else
            {
                e.Mobile.SendMessage("Format: TileZ <z> <type> [params] [set {<propertyName> <value> ...}]");
            }
        }
Ejemplo n.º 39
0
        private static void OnAction(CommandEventArgs e)
        {
            var action = e.GetInt32(0);

            e.Mobile.Animate(AnimationType.Attack, action);
        }
Ejemplo n.º 40
0
        private static void Control_OnCommand( CommandEventArgs e )
        {
            Mobile from = e.Mobile;

            e.GetInt32( 0 );

            if ( from != null )
            {
                from.SendMessage( "Wybierz kogo chcesz kontrolowac" );
                //"Choose the target to control..."

                from.Target = new InternalTarget( e.Arguments );
            }
        }
Ejemplo n.º 41
0
		public static void PrivSound_OnCommand( CommandEventArgs e )
		{
			if( e.Length == 1 )
				e.Mobile.Target = new PrivSoundTarget( e.GetInt32( 0 ) );
			else
				e.Mobile.SendMessage( "Format: PrivSound <index>" );
		}