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>"); } }
private static void SetGuarded_OnCommand( CommandEventArgs e ) { Mobile from = e.Mobile; if ( e.Length == 1 ) { GuardedRegion reg = (GuardedRegion) from.Region.GetRegion( typeof( GuardedRegion ) ); if ( reg == null ) { from.SendMessage( "You are not in a guardable region." ); } else { reg.Disabled = !e.GetBoolean( 0 ); if ( reg.Disabled ) from.SendMessage( "The guards in this region have been disabled." ); else from.SendMessage( "The guards in this region have been enabled." ); } } else { from.SendMessage( "Format: SetGuarded <true|false>" ); } }
public static void SetProfiles_OnCommand(CommandEventArgs e) { if (e.Length == 1) Core.Profiling = e.GetBoolean(0); else Core.Profiling = !Core.Profiling; e.Mobile.SendMessage("Profiling has been {0}.", Core.Profiling ? "enabled" : "disabled"); }
public static void SetSaves_OnCommand(CommandEventArgs e) { if (e.Length == 1) { m_SavesEnabled = e.GetBoolean(0); e.Mobile.SendMessage("Saves have been {0}.", m_SavesEnabled ? "enabled" : "disabled"); } else { e.Mobile.SendMessage("Format: SetSaves <true | false>"); } }
private static void SpeedBoost_OnCommand(CommandEventArgs e) { Mobile from = e.Mobile; if (e.Length <= 1) { if (e.Length == 1 && !e.GetBoolean(0)) { from.Send(SpeedControl.Disable); from.SendMessage("Speed boost has been disabled."); } else { from.Send(SpeedControl.MountSpeed); from.SendMessage("Speed boost has been enabled."); } } else { from.SendMessage("Format: SpeedBoost [true|false]"); } }
private static void SpeedBoost_OnCommand(CommandEventArgs e) { Mobile from = e.Mobile; if (e.Length <= 1) { bool on = e.GetBoolean(0) || e.ArgString.Trim().ToLower() == "on"; if (e.Length == 1 && !on) { from.Send(SpeedControl.Disable); from.SendMessage("Speed boost has been disabled."); } else { from.Send(SpeedControl.MountSpeed); from.SendMessage("Speed boost has been enabled."); } } else { from.SendMessage("Format: SpeedBoost [true|false]"); } }
private static void SetGuarded_OnCommand(Server.Commands.CommandEventArgs e) { Mobile from = e.Mobile; if (e.Length == 1) { GuardedRegion reg = from.Region as GuardedRegion; if (reg == null) { from.SendAsciiMessage("You are not in a guardable region."); } else { reg.Disabled = !e.GetBoolean(0); from.SendAsciiMessage("After your changes:"); reg.TellGuardStatus(from); } } else { from.SendAsciiMessage("Format: SetGuarded <true|false>"); } }
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]"); }
public static void SaveAllQuests_OnCommand( CommandEventArgs e ) { Mobile m = e.Mobile; if ( e.Length > 1 ) { m.SendMessage( "Syntax: SaveAllQuests [saveEnabled=true]" ); return; } bool enable = ( e.Length == 1 ) ? e.GetBoolean( 0 ) : true; foreach ( MLQuest quest in m_Quests.Values ) quest.SaveEnabled = enable; m.SendMessage( "Serialization for all quests is now {0}.", enable ? "enabled" : "disabled" ); if ( AutoGenerateNew && !enable ) m.SendMessage( "Please note that automatic generation of new quests is ON. All quests will be regenerated on the next server start." ); }
public static void SaveQuest_OnCommand( CommandEventArgs e ) { Mobile m = e.Mobile; if ( e.Length == 0 || e.Length > 2 ) { m.SendMessage( "Syntax: SaveQuest <id> [saveEnabled=true]" ); return; } Type index = ScriptCompiler.FindTypeByName( e.GetString( 0 ) ); MLQuest quest; if ( index == null || !m_Quests.TryGetValue( index, out quest ) ) { m.SendMessage( "Invalid quest type name." ); return; } bool enable = ( e.Length == 2 ) ? e.GetBoolean( 1 ) : true; quest.SaveEnabled = enable; m.SendMessage( "Serialization for quest {0} is now {1}.", quest.GetType().Name, enable ? "enabled" : "disabled" ); if ( AutoGenerateNew && !enable ) m.SendMessage( "Please note that automatic generation of new quests is ON. This quest will be regenerated on the next server start." ); }
public static void Unhide_OnCommand( CommandEventArgs e ) { if( e.Arguments.Length == 1 ) { e.Mobile.Target = new SetHiddenTarget( false, e.GetBoolean( 0 ) ); } else { e.Mobile.Target = new SetHiddenTarget( false, true ); e.Mobile.SendMessage( "Usage: Unhide <bool effects>\nUnhiding with effects anyway..." ); } }