コード例 #1
0
ファイル: Handlers.cs プロジェクト: notsentient/RunZHA
 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>" );
     }
 }
コード例 #2
0
 public static void Anim_OnCommand(CommandEventArgs e)
 {
     if (e.Length == 1)
         e.Mobile.Animate(e.GetInt32(0), 5, 1, true, false, 1);
     else
         e.Mobile.SendMessage("Format: Anim <action>");
 }
コード例 #3
0
ファイル: Squelch.cs プロジェクト: FreeReign/imaginenation
        public override void Execute(CommandEventArgs e, object obj)
        {
            Mobile from = e.Mobile;
            PlayerMobile target = obj as PlayerMobile;

            if (target != null)
            {
                if (e.Length != 1)
                {
                    e.Mobile.SendAsciiMessage("Format:");
                    e.Mobile.SendAsciiMessage("Squelch int minutes");
                    return;
                }

                if (target.CurrentSquelchTimer != null)
                {
                    target.CurrentSquelchTimer.Stop();
                    target.CurrentSquelchTimer = null;
                }

                target.Squelched = true;
                int index = e.GetInt32(0);
                from.SendAsciiMessage("You squelched {0} for {1} minute{2}", target.Name, index, index == 1 ? "" : "s");
                target.SendAsciiMessage("You have been squelched for {0} minute{1}", index, index == 1 ? "" : "s");
                new SquelchDelayTimer(target, TimeSpan.FromMinutes(index)).Start();
            }
            else
                from.SendAsciiMessage("This only works on players!");
        }
コード例 #4
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>" );
			}
		}
コード例 #5
0
ファイル: SetSay.cs プロジェクト: Telm/RunUO_EME
        private static void SetSay_OnCommand( CommandEventArgs e )
        {
            Mobile m_Mobile = e.Mobile;
            int languageIndex = Language.CommonLanguageIndex;
            if ( e.Length >= 1 )
                languageIndex = e.GetInt32( 0 );
            if (languageIndex >= 11)
            {
                m_Mobile.SendMessage("Podales nieprawidlowa wartosc jezyka");
                return;
            }
            //LanguageKnowledge Lkl = new LanguageKnowledge();
            if (m_Mobile.AccessLevel <= AccessLevel.GameMaster)
            {
                if (m_Mobile.Race.LanguageKnowledgeValue(languageIndex) == 0)
                {
                    m_Mobile.SendMessage("Nie znasz tego jezyka");
                    return;
                }
            }

            if (languageIndex == 0 || Server.Language.Languages[languageIndex] == null)
            {
                m_Mobile.SendMessage("Podales nieprawidlowa wartosc jezyka");
                return;
            }

                m_Mobile.ActualLanguage = languageIndex;

            m_Mobile.SendMessage( "Teraz mowisz w {0}.", Server.Language.Languages[languageIndex].Name );
        }
コード例 #6
0
ファイル: ClientCommands.cs プロジェクト: greeduomacro/annox
		private static void NudgeSelfUp_OnCommand( CommandEventArgs e )
		{
			if(e.Arguments.Length > 0)
			{
				int zoffset = e.GetInt32(0);
				e.Mobile.Location = new Point3D(e.Mobile.Location, e.Mobile.Location.Z + zoffset);
			}
		}
コード例 #7
0
		private static void DupeMob_OnCommand( CommandEventArgs e )
		{
			int amount = 1;
			if ( e.Length >= 1 )
				amount = e.GetInt32( 0 );
			e.Mobile.Target = new DupeTarget();
			e.Mobile.SendMessage( "What do you wish to dupe?" );
		}
コード例 #8
0
		private static void AddBountyCommand_OnCommand( CommandEventArgs e )
		{
			int amount = 1;
			if ( e.Length >= 1 )
				amount = e.GetInt32( 0 );
			e.Mobile.Target = new InternalTarget( amount > 0 ? amount : 1 );
			e.Mobile.SendMessage( "Who should have a bounty on his head?" );
		}
コード例 #9
0
ファイル: BaseTalisman.cs プロジェクト: PepeBiondi/runsa
		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() );
			}
		}
コード例 #10
0
ファイル: Dupe.cs プロジェクト: Ravenwolfe/xrunuo
        private static void DupeInBag_OnCommand( CommandEventArgs e )
        {
            int amount = 1;
            if ( e.Length >= 1 )
            {
                amount = e.GetInt32( 0 );
            }

            e.Mobile.Target = new DupeTarget( true, amount > 0 ? amount : 1 );
            e.Mobile.SendMessage( "What do you wish to dupe?" );
        }
コード例 #11
0
ファイル: SendTo.cs プロジェクト: FreeReign/imaginenation
        public override void Execute(CommandEventArgs e, object obj)
        {
            Mobile from = e.Mobile;
            Mobile target = obj as Mobile;
            Map map = from.Map;
            Point3D location = Point3D.Zero;

            if (target == null || map == Map.Internal || map == null)
            {
                from.SendAsciiMessage("Invalid target.");
                return;
            }
            else if (e.Length == 0)
            {
                from.SendAsciiMessage("Format:");
                from.SendAsciiMessage("SendTo int x int y");
                from.SendAsciiMessage("SendTo int x int y int z");
                from.SendAsciiMessage("SendTo int yLat int yMins (N|S) ySount int xLong int xMins (E|W) xEast");
                return;
            }
            else if (e.Length == 2)
            {
                int x = e.GetInt32(0);
                int y = e.GetInt32(1);

                location = new Point3D(x, y, map.GetAverageZ(x, y));
            }
            else if (e.Length == 3)
                location = new Point3D(e.GetInt32(0), e.GetInt32(1), e.GetInt32(2));
            else if (e.Length == 6)
            {
                location = 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 (location == Point3D.Zero)
                    from.SendMessage("Sextant reverse lookup failed.");
            }

            if (location != Point3D.Zero)
            {
                target.MoveToWorld(location, map);
                from.SendAsciiMessage(string.Format("Sent {0} to {1}.", target.Name, location));
            }
            else
                from.SendAsciiMessage("Invalid location.");
        }
コード例 #12
0
        public override void Execute(CommandEventArgs e)
        {
            if (e.Length >= 2)
            {
                Serial serial = e.GetInt32(0);

                object obj = null;

                if (serial.IsItem)
                {
                    obj = World.FindItem(serial);
                }
                else if (serial.IsMobile)
                {
                    obj = World.FindMobile(serial);
                }

                if (obj == null)
                {
                    e.Mobile.SendMessage("That is not a valid serial.");
                }
                else
                {
                    BaseCommand command = (BaseCommand)this.Commands[e.GetString(1)];

                    if (command == null)
                    {
                        e.Mobile.SendMessage("That is either an invalid command name or one that does not support this modifier.");
                    }
                    else if (e.Mobile.AccessLevel < command.AccessLevel)
                    {
                        e.Mobile.SendMessage("You do not have access to that command.");
                    }
                    else
                    {
                        string[] oldArgs = e.Arguments;
                        string[] args    = new string[oldArgs.Length - 2];

                        for (int i = 0; i < args.Length; ++i)
                        {
                            args[i] = oldArgs[i + 2];
                        }

                        RunCommand(e.Mobile, obj, command, args);
                    }
                }
            }
            else
            {
                e.Mobile.SendMessage("You must supply an object serial and a command name.");
            }
        }
コード例 #13
0
 private static void Light_OnCommand(CommandEventArgs e)
 {
     if (e.Length >= 1)
     {
         LevelOverride = e.GetInt32(0);
         e.Mobile.SendMessage("Global light level override has been changed to {0}.", m_LevelOverride);
     }
     else
     {
         LevelOverride = int.MinValue;
         e.Mobile.SendMessage("Global light level override has been cleared.");
     }
 }
コード例 #14
0
ファイル: LightCycle.cs プロジェクト: greeduomacro/vivre-uo
		private static void Light_OnCommand( CommandEventArgs e )
		{
			if ( e.Length >= 1 )
			{
				LevelOverride = e.GetInt32( 0 );
				e.Mobile.SendMessage( "Global light level override has been changed to {0}.", m_LevelOverride );
			}
			else
			{
				LevelOverride = int.MinValue;
				e.Mobile.SendMessage( "Global light level override has been cleared." );
			}
		}
コード例 #15
0
ファイル: Control.cs プロジェクト: UltimaShards/RunUO-BackUp
        private static void Control_OnCommand(CommandEventArgs e)
        {
            Mobile from = e.Mobile;

            e.GetInt32(0);

            if (from != null)
            {
                from.SendMessage("Choose the Mobile to control");

                from.Target = new InternalTarget(e.Arguments);
            }
        }
コード例 #16
0
        public static void SetThrottle(CommandEventArgs e)
        {
            if (e.Length != 2)
            {
                e.Mobile.SendMessage("Invalid Command Format. Should be [SetThrottle <packetID> <timeInMilliseconds>");
                return;
            }

            int packetID = e.GetInt32(0);
            int delay    = e.GetInt32(1);

            if (packetID < 0 || packetID > 0x100)
            {
                e.Mobile.SendMessage("Invalid Command Format. PacketID must be between 0 and 0x100.");
                return;
            }


            if (delay > 5000)
            {
                e.Mobile.SendMessage("Invalid Command Format. Delay cannot exceed 5000 milliseconds.");
                return;
            }

            long oldDelay = Delays[packetID];

            if (oldDelay == 0 && delay > 0)
            {
                IncomingPackets.RegisterThrottler(packetID, Throttle);
            }
            else if (oldDelay > 0 && delay == 0)
            {
                IncomingPackets.RegisterThrottler(packetID, null);
            }

            Delays[packetID] = delay;
            SaveDelays();
        }
コード例 #17
0
        public static void GenerateKeyFor_OnCommand(CommandEventArgs e)
        {
            ActionLockable i      = GenerateKeyFor;
            int            nbKeys = e.GetInt32(0);

            if (CheckNbKeys(nbKeys))
            {
                e.Mobile.Target = new TargetLockable(e.Mobile, i, nbKeys);
            }
            else
            {
                e.Mobile.SendMessage("Vous ne pouvez créer qu'entre 0 et 10 clefs à la fois.");
            }
        }
コード例 #18
0
        public override void ExecuteList(CommandEventArgs e, ArrayList list)
        {
            if (e.Arguments.Length == 6)
            {
                int  action  = e.GetInt32(0);
                int  frames  = e.GetInt32(1);
                int  repeats = e.GetInt32(2);
                bool forward = e.GetBoolean(3);
                bool repeat  = e.GetBoolean(4);
                int  delay   = e.GetInt32(5);

                for (int i = 0; i < list.Count; i++)
                {
                    if (list[i] is Mobile && ((Mobile)list[i]).Alive)
                    {
                        ((Mobile)list[i]).Animate(action, frames, repeats, forward, repeat, delay);
                    }
                }
            }
            else
            {
                LogFailure(Usage);
            }
        }
コード例 #19
0
        private static void LootGen_OnCommand(CommandEventArgs e)
        {
            if (e.Arguments.Length != 3)
            {
                return;
            }

            var table      = e.GetString(0);
            var itemLevel  = e.GetInt32(1);
            var itemChance = e.GetDouble(2);


            e.Mobile.SendMessage("Target a container.");
            e.Mobile.Target = new InternalTarget(table, itemLevel, itemChance);
        }
コード例 #20
0
        private static void SeasonChange_OnCommand(CommandEventArgs e)
        {
            int x = 1;

            if (e.Length >= 1)
            {
                x = e.GetInt32(0);
                Map.Felucca.Season  = x;
                Map.Trammel.Season  = x;
                Map.Ilshenar.Season = x;
            }
            else
            {
                e.Mobile.SendMessage("Seasons: {0}, {1}, {2}", Map.Felucca.Season, Map.Trammel.Season, Map.Ilshenar.Season);
            }
        }
コード例 #21
0
ファイル: DupeSpawner.cs プロジェクト: evildude807/kaltar
        public static void DupeMS_OnCommand( CommandEventArgs e )
        {
            Mobile from = e.Mobile;
            int count = 1;

            try
            {
                count = e.GetInt32( 0 );
            }
            catch{}

            if( count <= 0 )
                count = 1;

            from.Target = new InternalTarget( count );
        }
コード例 #22
0
        public override void Execute(CommandEventArgs e)
        {
            if (e.Length >= 2)
            {
                Serial serial = e.GetInt32(0);

                object obj = null;

                if (serial.IsItem)
                    obj = World.FindItem(serial);
                else if (serial.IsMobile)
                    obj = World.FindMobile(serial);

                if (obj == null)
                {
                    e.Mobile.SendMessage("That is not a valid serial.");
                }
                else
                {
                    BaseCommand command = null;
                    Commands.TryGetValue(e.GetString(1), out command);

                    if (command == null)
                    {
                        e.Mobile.SendMessage("That is either an invalid command name or one that does not support this modifier.");
                    }
                    else if (e.Mobile.AccessLevel < command.AccessLevel)
                    {
                        e.Mobile.SendMessage("You do not have access to that command.");
                    }
                    else
                    {
                        string[] oldArgs = e.Arguments;
                        string[] args = new string[oldArgs.Length - 2];

                        for (int i = 0; i < args.Length; ++i)
                            args[i] = oldArgs[i + 2];

                        RunCommand(e.Mobile, obj, command, args);
                    }
                }
            }
            else
            {
                e.Mobile.SendMessage("You must supply an object serial and a command name.");
            }
        }
コード例 #23
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>");
            }
        }
コード例 #24
0
        public static void DupeMS_OnCommand(CommandEventArgs e)
        {
            Mobile from  = e.Mobile;
            int    count = 1;

            try
            {
                count = e.GetInt32(0);
            }
            catch {}

            if (count <= 0)
            {
                count = 1;
            }

            from.Target = new InternalTarget(count);
        }
コード例 #25
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();
			}
		}
コード例 #26
0
        public static void GetThrottle(CommandEventArgs e)
        {
            if (e.Length != 1)
            {
                e.Mobile.SendMessage("Invalid Command Format. Should be [GetThrottle <packetID>");
                return;
            }

            int packetID = e.GetInt32(0);

            if (packetID is < 0 or > 0x100)
            {
                e.Mobile.SendMessage("Invalid Command Format. PacketID must be between 0 and 0x100.");
                return;
            }

            e.Mobile.SendMessage("Packet 0x{0:X} throttle is currently {1}ms.", packetID, Delays[packetID]);
        }
コード例 #27
0
ファイル: Town.cs プロジェクト: OrbitStorm/Defiance-UOR-1.10
        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);
            }
        }
コード例 #28
0
        public static void OnRestoreCommand(CommandEventArgs e)
        {
            if (e.Mobile == null || e.Mobile.Deleted)
            {
                return;
            }

            var serial = Serial.MinusOne;

            var moveExisting = false;
            var logging      = true;

            if (e.Arguments.Length > 0)
            {
                serial = e.GetInt32(0);
            }

            if (e.Arguments.Length > 1)
            {
                moveExisting = e.GetBoolean(1);
            }

            if (e.Arguments.Length > 2)
            {
                logging = e.GetBoolean(2);
            }

            e.Mobile.SendMessage("Target a PlayerMobile to restore...");
            e.Mobile.BeginTarget <PlayerMobile>(
                (m, t) =>
            {
                int created, deleted, ignored, moved;

                RestoreState(t, serial, moveExisting, logging, out created, out deleted, out ignored, out moved);

                e.Mobile.SendMessage(
                    "Restore: {0:#,0} created, {1:#,0} deleted, {2:#,0} ignored, and {3:#,0} moved item states.",
                    created,
                    deleted,
                    ignored,
                    moved);
            },
                null);
        }
コード例 #29
0
        public override void Execute(CommandEventArgs e)
        {
            if (e.Length >= 2)
            {
                var range = e.GetInt32(0);

                if (range < 0)
                {
                    e.Mobile.SendMessage("The range must not be negative.");
                }
                else
                {
                    Commands.TryGetValue(e.GetString(1), out var command);

                    if (command == null)
                    {
                        e.Mobile.SendMessage(
                            "That is either an invalid command name or one that does not support this modifier."
                            );
                    }
                    else if (e.Mobile.AccessLevel < command.AccessLevel)
                    {
                        e.Mobile.SendMessage("You do not have access to that command.");
                    }
                    else
                    {
                        var oldArgs = e.Arguments;
                        var args    = new string[oldArgs.Length - 2];

                        for (var i = 0; i < args.Length; ++i)
                        {
                            args[i] = oldArgs[i + 2];
                        }

                        Process(range, e.Mobile, command, args);
                    }
                }
            }
            else
            {
                e.Mobile.SendMessage("You must supply a range and a command name.");
            }
        }
コード例 #30
0
		public override void Execute( CommandEventArgs e )
		{
			if ( e.Length >= 2 )
			{
				int range = e.GetInt32( 0 );

				if ( range < 0 )
				{
					e.Mobile.SendMessage( "The range must not be negative." );
				}
				else
				{
					BaseCommand command = null;
					Commands.TryGetValue( e.GetString( 1 ), out command );

					if ( command == null )
					{
						e.Mobile.SendMessage( "That is either an invalid command name or one that does not support this modifier." );
					}
					else if ( e.Mobile.AccessLevel < command.AccessLevel )
					{
						e.Mobile.SendMessage( "You do not have access to that command." );
					}
					else
					{
						string[] oldArgs = e.Arguments;
						string[] args = new string[oldArgs.Length - 2];

						for ( int i = 0; i < args.Length; ++i )
							args[i] = oldArgs[i + 2];

						Process( range, e.Mobile, command, args );
					}
				}
			}
			else
			{
				e.Mobile.SendMessage( "You must supply a range and a command name." );
			}
		}
コード例 #31
0
		private static void SetCharSlots_OnCommand( CommandEventArgs e )
		{
			if ( e.Mobile is PlayerMobile )
			{
				if ( e.Length > 0 )
				{
                  			try 
                  			{ 
                     				int amount = e.GetInt32( 0 );
						e.Mobile.Target = new CharSlotTarget( amount );
					}
                 	 		catch 
                 			{ 
						e.Mobile.SendMessage( "You must enter a number amount." ); 
                  			} 
				}
			}
			else
			{
				e.Mobile.SendMessage( "This command only works on players." );
			}
		}
コード例 #32
0
ファイル: Season.cs プロジェクト: greeduomacro/uodarktimes-1
		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();
						}
					}
				}
			}
		}
コード例 #33
0
		public static void GetBox_OnCommand( CommandEventArgs e ) 
		{
			Mobile from = e.Mobile;
			if ( e.Length == 0 )
				from.SendMessage( "You must include a serial" );
			else
			{
				int ser = e.GetInt32( 0 );
				ArrayList list = new ArrayList( World.Items.Values );
						foreach ( Item item in list )
						{
							if ( item is MovingBox )
							{
								MovingBox box = (MovingBox)item;
								if ( box.Serial == ser )
								{
									box.Map = from.Map;
									box.Location = from.Location;
									break;
								}
							}
						}
			}
		}
コード例 #34
0
ファイル: Particle.cs プロジェクト: greeduomacro/hubroot
		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 );
		}
コード例 #35
0
ファイル: Add.cs プロジェクト: nathanvy/runuo
		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" );
			}
		}
コード例 #36
0
ファイル: Add.cs プロジェクト: nathanvy/runuo
		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" );
			}
		}
コード例 #37
0
ファイル: Add.cs プロジェクト: Godkong/Origins
		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> ...}]" );
			}
		}
コード例 #38
0
ファイル: SendTo.cs プロジェクト: greeduomacro/hubroot
		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)]" );
			}
		}
コード例 #39
0
        public override void Execute(CommandEventArgs e)
        {
            if (e.Length >= 2)
            {
                Serial serial = e.GetInt32(0);

                object obj = null;

                if (serial.IsItem)
                {
                    obj = World.FindItem(serial);
                }
                else if (serial.IsMobile)
                {
                    obj = World.FindMobile(serial);
                }

                if (obj == null)
                {
                    e.Mobile.SendMessage("That is not a valid serial.");
                }
                else
                {
                    BaseCommand command = null;
                    Commands.TryGetValue(e.GetString(1), out command);

                    if (command == null)
                    {
                        e.Mobile.SendMessage("That is either an invalid command name or one that does not support this modifier.");
                    }
                    else if (e.Mobile.AccessLevel < command.AccessLevel)
                    {
                        e.Mobile.SendMessage("You do not have access to that command.");
                    }
                    else
                    {
                        switch (command.ObjectTypes)
                        {
                        case ObjectTypes.Both:
                        {
                            break;
                        }

                        case ObjectTypes.Items:
                        {
                            if (!(obj is Item))
                            {
                                e.Mobile.SendMessage("This command only works on items.");
                                return;
                            }

                            break;
                        }

                        case ObjectTypes.Mobiles:
                        {
                            if (!(obj is Mobile))
                            {
                                e.Mobile.SendMessage("This command only works on mobiles.");
                                return;
                            }

                            break;
                        }
                        }

                        string[] oldArgs = e.Arguments;
                        string[] args    = new string[oldArgs.Length - 2];

                        for (int i = 0; i < args.Length; ++i)
                        {
                            args[i] = oldArgs[i + 2];
                        }

                        RunCommand(e.Mobile, obj, command, args);
                    }
                }
            }
            else
            {
                e.Mobile.SendMessage("You must supply an object serial and a command name.");
            }
        }
コード例 #40
0
ファイル: Handlers.cs プロジェクト: notsentient/RunZHA
 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]" );
 }
コード例 #41
0
ファイル: XmlSpawner2.cs プロジェクト: greeduomacro/hubroot
		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]" );
				}
			}
		}
コード例 #42
0
ファイル: Town.cs プロジェクト: Godkong/RunUO
		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 );
			}
		}
コード例 #43
0
ファイル: SendTo.cs プロジェクト: Orion321/unknown-shard
    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);


                    List <Region> list = new List <Region>(from.Map.Regions.Values);


                    for (int i = 0; i < list.Count; ++i)
                    {
                        Region r = (Region)list[i];

                        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)]");
        }
    }
コード例 #44
0
ファイル: Handlers.cs プロジェクト: notsentient/RunZHA
 public static void Light_OnCommand( CommandEventArgs e )
 {
     e.Mobile.LightLevel = e.GetInt32( 0 );
 }
コード例 #45
0
        private static void OnRaceBag(CommandEventArgs e)
        {
            int amount = 0;

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

            Mobile      from      = e.Mobile;
            bool        r_active  = false;
            RaceOrb     r_orb     = null;
            Bag         m_bag     = null;
            RaceControl r_control = null;

            foreach (Item i in World.Items.Values)
            {
                if (i is RCChest)
                {
                    r_active = true;
                }
            }

            foreach (Item i in World.Items.Values)
            {
                if (i is RaceControl)
                {
                    r_control = i as RaceControl;
                }
            }

            if (r_active)
            {
                foreach (Item i in World.Items.Values)
                {
                    if (i is RaceOrb)
                    {
                        r_orb = i as RaceOrb;
                        if (r_orb.RaceNumber == amount)
                        {
                            Bag r_bag = new Bag();
                            r_bag.Name = r_orb.RaceName + " Race";
                            Bag i_bag = new Bag();
                            i_bag.Name = r_orb.RaceName + " Items";
                            r_bag.AddItem(i_bag);
                            r_bag.AddItem(r_orb);
                            foreach (Item k in World.Items.Values)
                            {
                                if (k is Bag && k.Name == "RACES")
                                {
                                    m_bag = k as Bag;
                                    m_bag.AddItem(r_bag);
                                    break;
                                }
                            }
                            r_orb.Activated = true;
                            break;
                        }
                    }
                }
            }
        }
コード例 #46
0
ファイル: Handlers.cs プロジェクト: notsentient/RunZHA
        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)]" );
            }
        }
コード例 #47
0
ファイル: Add.cs プロジェクト: Godkong/Origins
		public static void TileXYZ_OnCommand( 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> ...}]" );
			}
		}