public static void GenTeleporter_OnCommand(CommandEventArgs e) { var from = e.Mobile; from.SendMessage("Generating teleporters, please wait."); var c = new TeleportersCreator(); if (!ProcessTeleporterData(from, c.CreateTeleporter)) { if (c.DelCount > 0) { from.SendMessage(WarningHue, $"Partial Completion: {c.DelCount} Teleporters Removed."); } if (c.Count > 0) { from.SendMessage(WarningHue, $"Partial Completion: {c.Count} Teleporters Added."); } return; } from.SendMessage(SuccessHue, "Teleporter generating complete."); from.SendMessage(WarningHue, $"{c.DelCount} Teleporters Removed."); from.SendMessage(SuccessHue, $"{c.Count} Teleporters Added."); }
public static void TelGenDelete_OnCommand(CommandEventArgs e) { var from = e.Mobile; from.SendMessage("Removing teleporters, please wait."); var count = 0; void ProcessDeletion(TeleporterDefinition x) { count += TeleportersCreator.DeleteTeleporters(x.Source); if (x.Back) { count += TeleportersCreator.DeleteTeleporters(x.Destination); } } if (!ProcessTeleporterData(from, ProcessDeletion)) { if (count > 0) { from.SendMessage(WarningHue, $"Partial Completion, {count} Teleporters Removed."); } return; } from.SendMessage(WarningHue, $"{count} Teleporters Removed."); }
public static void GenTeleporter_OnCommand(CommandEventArgs e) { e.Mobile.SendMessage("Generating teleporters, please wait."); int count = new TeleportersCreator().CreateTeleporters(); e.Mobile.SendMessage("Teleporter generating complete. {0} teleporters were generated.", count); }
public static void GenTeleporter_OnCommand( CommandEventArgs e ) { e.Mobile.SendMessage( "Generating teleporters, please wait." ); int count = new TeleportersCreator().CreateTeleporters(); e.Mobile.SendMessage( "Teleporter generating complete. {0} teleporters were generated.", count ); }
public static void GenTeleporterDelete_OnCommand(CommandEventArgs e) { e.Mobile.SendMessage("Deleting teleporters, please wait."); int count = new TeleportersCreator().CreateTeleporters(); count += new SHGenTeleporterDelete.SHTeleporterCreator().CreateSHTeleporters(); e.Mobile.SendMessage("Teleporter deleting complete. {0} teleporters were deleted.", count); }
public static void CreateDawnwatchTeleporters_OnCommand(CommandEventArgs e) { e.Mobile.SendMessage("Generating teleporters, please wait."); TeleportersCreator c = new TeleportersCreator(); c.CreateDawnwatchTeleporters(); e.Mobile.SendMessage("Teleporter generating complete."); }
public static void GenTeleporter_OnCommand(CommandEventArgs e) { e.Mobile.SendMessage("Generating teleporters, please wait."); TeleportersCreator c = new TeleportersCreator(); int count = 0; StreamReader reader = new StreamReader(m_Path); string line; int lineNum = 0; while ((line = reader.ReadLine()) != null) { ++lineNum; line = line.Trim(); if (line.StartsWith("#")) { continue; } string[] parts = line.Split(m_Sep); if (parts.Length != 9) { e.Mobile.SendMessage(33, String.Format("Bad teleporter definition on line {0}", lineNum)); continue; } try { c.CreateTeleporter( int.Parse(parts[0]), int.Parse(parts[1]), int.Parse(parts[2]), int.Parse(parts[4]), int.Parse(parts[5]), int.Parse(parts[6]), Map.Parse(parts[3]), Map.Parse(parts[7]), bool.Parse(parts[8]) ); } catch (FormatException) { e.Mobile.SendMessage(33, String.Format("Bad number format on line {0}", lineNum)); } catch (ArgumentException ex) { e.Mobile.SendMessage(33, String.Format("Argument Execption {0} on line {1}", ex.Message, lineNum)); } } reader.Close(); e.Mobile.SendMessage("Teleporter generating complete."); }
public static void GenTeleporter_OnCommand(CommandEventArgs e) { e.Mobile.SendMessage("Generating teleporters, please wait."); TeleportersCreator c = new TeleportersCreator(); StreamReader reader = new StreamReader(m_Path); string line; int lineNum = 0; while((line = reader.ReadLine()) != null) { ++lineNum; line = line.Trim(); if (line.StartsWith("#")) continue; string[] parts = line.Split(m_Sep); if(parts.Length != 9) { e.Mobile.SendMessage(33, String.Format("Bad teleporter definition on line {0}", lineNum)); continue; } try { c.CreateTeleporter( int.Parse(parts[0]), int.Parse(parts[1]), int.Parse(parts[2]), int.Parse(parts[4]), int.Parse(parts[5]), int.Parse(parts[6]), Map.Parse(parts[3]), Map.Parse(parts[7]), bool.Parse(parts[8]) ); } catch (FormatException) { e.Mobile.SendMessage(33, String.Format("Bad number format on line {0}", lineNum)); } catch(ArgumentException ex) { e.Mobile.SendMessage(33, String.Format("Argument Execption {0} on line {1}", ex.Message, lineNum)); } } reader.Close(); e.Mobile.SendMessage("Teleporter generating complete."); }