public static void Animate_OnCommand( Server.Commands.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.SendAsciiMessage( "Format: Animate <action> <frameCount> <repeatCount> <forward> <repeat> <delay>" ); } }
public static void Randomize_OnCommand( Server.Commands.CommandEventArgs args ) { Mobile m = args.Mobile; if( args.Length != 4 ) { m.SendMessage( "Format: Randomize <starting itemID> <ending itemID> <Z level> <bool includeNonFlooring>" ); return; } int start = args.GetInt32( 0 ); int end = args.GetInt32( 1 ); int z = args.GetInt32( 2 ); bool walls = args.GetBoolean( 3 ); object[] state = new object[4] { start, end, z, walls }; BoundingBoxPicker.Begin( m, new BoundingBoxCallback( BoxPickerCallback ), state ); }
public override void Execute( Server.Commands.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>" ); } }
private static void Go_OnCommand( Server.Commands.CommandEventArgs e ) { Mobile from = e.Mobile; if ( e.Length == 0 ) { GoGump.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.SendAsciiMessage( "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.SendAsciiMessage( "You can not go to what you can not see." ); return; } else if ( !FixMap( ref map, ref loc, item ) ) { from.SendAsciiMessage( "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) && !from.CanSee( owner ) ) { from.SendAsciiMessage( "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.SendAsciiMessage( "You can not go to what you can not see." ); return; } else if ( !FixMap( ref map, ref loc, m ) ) { from.SendAsciiMessage( "That is an internal mobile and you cannot go to it." ); return; } from.MoveToWorld( 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.Location = new Point3D( r.GoLocation ); return; } } if ( ser != 0 ) from.SendAsciiMessage( "No object with that serial was found." ); else from.SendAsciiMessage( "No region with that name was found." ); return; } } catch { } from.SendAsciiMessage( "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.Location = new Point3D( x, y, z ); } } else if ( e.Length == 3 ) { from.Location = new Point3D( e.GetInt32( 0 ), e.GetInt32( 1 ), e.GetInt32( 2 ) ); } 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.SendAsciiMessage( "Sextant reverse lookup failed." ); } } else { from.SendAsciiMessage( "Format: Go [name | serial | (x y [z]) | (deg min (N | S) deg min (E | W)]" ); } }
public static void Sound_OnCommand( Server.Commands.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.SendAsciiMessage( "Format: Sound <index> [toAll]" ); }
public static void Light_OnCommand( Server.Commands.CommandEventArgs e ) { e.Mobile.LightLevel = e.GetInt32( 0 ); }
private static void Light_OnCommand( Server.Commands.CommandEventArgs e ) { if ( e.Length >= 1 ) { LevelOverride = e.GetInt32( 0 ); e.Mobile.SendAsciiMessage( "Global light level override has been changed to {0}.", m_LevelOverride ); } else { LevelOverride = int.MinValue; e.Mobile.SendAsciiMessage( "Global light level override has been cleared." ); } }
public static void TileZ_OnCommand( Server.Commands.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> ...}]" ); } }
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> ...}]" ); } }
private static void Props_OnCommand( Server.Commands.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( true ); } }
public static void CheckLos_OnCommand( Server.Commands.CommandEventArgs args ) { try { DateTime start = DateTime.Now; ClearLOS_OnCommand( args ); LOSItemPacket.Reset(); Mobile m = args.Mobile; Map map = m.Map; int range = 12; if ( args.Length > 0 ) range = args.GetInt32( 0 ); if ( range > 20 ) range = 20; else if ( range < 1 ) range = 1; m.SendMessage( "Calculating..." ); int minx, maxx; int miny, maxy; Point3D from = map.GetPoint( m, true ); minx = m.Location.X - range; maxx = m.Location.X + range; miny = m.Location.Y - range; maxy = m.Location.Y + range; for(int x=minx;x<=maxx;x++) { for (int y=miny;y<=maxy;y++) { { LandTile tile = map.Tiles.GetLandTile(x, y); ItemData id = TileData.ItemTable[tile.ID & 0x3FFF]; if (!tile.Ignored && id.Surface) { int z = tile.Z + id.CalcHeight; Point3D loc = new Point3D(x, y, z); int hue; if (loc == m.Location) hue = 0x35; // yellow else if (map.LineOfSight(from, loc)) hue = 0x3F; // green else hue = 0x26; // red m.Send(new LOSItemPacket(hue, loc)); } } StaticTile[] tiles = map.Tiles.GetStaticTiles(x, y, true); for (int i = 0; i < tiles.Length; i++) { StaticTile tile = (StaticTile)tiles[i]; ItemData id = TileData.ItemTable[tile.ID & 0x3FFF]; if (id.Surface) // land doesnt use same flags, so just allow it { int z = tile.Z + id.CalcHeight; Point3D loc = new Point3D(x, y, z); int hue; if (loc == m.Location) hue = 0x35; // yellow else if (map.LineOfSight(from, loc)) hue = 0x3F; // green else hue = 0x26; // red m.Send(new LOSItemPacket(hue, loc)); } } } } m.SendAsciiMessage( "Completed LOS check in {0}s", (DateTime.Now-start).TotalSeconds ); } catch ( Exception e ) { args.Mobile.SendMessage( "CRASHED : {0}", e.Message ); } }