#W# Added: [ESA command exports all spawners on the map. [IS </path/*.json> imports spawners from specified file.
This commit is contained in:
parent
ec93eeb4fb
commit
4170f92bdc
2 changed files with 34 additions and 2 deletions
|
|
@ -0,0 +1,32 @@
|
|||
// Exports all spawners on the map.
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Commands;
|
||||
|
||||
namespace Server.Custom
|
||||
{
|
||||
public class ExportSpawnersAlias
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("EAS", AccessLevel.Administrator, new CommandEventHandler(OnCommand));
|
||||
}
|
||||
|
||||
[Usage("EAS [filename]")]
|
||||
[Description("A quick shortcut for [global ExportSpawners")]
|
||||
public static void OnCommand(CommandEventArgs e)
|
||||
{
|
||||
Mobile m = e.Mobile;
|
||||
|
||||
string commandToRun = $"{CommandSystem.Prefix}global exportspawners";
|
||||
string args = e.ArgString.Trim();
|
||||
if (!string.IsNullOrEmpty(args))
|
||||
{
|
||||
commandToRun += " " + args;
|
||||
}
|
||||
|
||||
m.SendMessage(68, $"Running shortcut: {commandToRun}");
|
||||
CommandSystem.Handle(m, commandToRun);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@ public static class ImportSpawnersCommand
|
|||
}
|
||||
|
||||
[Usage("ImportSpawners <relative search pattern to distribution>")]
|
||||
[Aliases("ImportSpawner", "GenerateSpawners", "GenSpawners")]
|
||||
[Aliases("ImportSpawner", "GenerateSpawners", "GenSpawners", "IS")]
|
||||
[Description("Imports JSON, Nerun Premium, and RunUO spawner files. Supports basic globbing.")]
|
||||
private static void GenerateSpawners_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
|
|
@ -350,7 +350,7 @@ public static class ImportSpawnersCommand
|
|||
{
|
||||
var parts = line.Split('|');
|
||||
var mapId = mapIdOverride != -1 ? mapIdOverride : int.Parse(parts[10]);
|
||||
Map[] maps = mapId == 0 ? [Map.Felucca, Map.Trammel] : [Map.Maps[mapId - 1]];
|
||||
Map[] maps = mapId == 0 ? [Map.Trammel, Map.Felucca] : [Map.Maps[mapId - 1]];
|
||||
|
||||
foreach (var map in maps)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue