#W# Treasure: DungeonBags/Crates. Bags are trapped level 0-3 loot. Crates are trapped and locked with level 4-6 loot.
This commit is contained in:
parent
9704edebc9
commit
aedf8d276f
11 changed files with 626 additions and 650 deletions
|
|
@ -49,7 +49,6 @@ public static class TaskManager
|
|||
// ==========================================
|
||||
public static void On4HourTick(Mobile from = null)
|
||||
{
|
||||
RespawnPedestals(from);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -107,33 +106,4 @@ public static class TaskManager
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void RespawnPedestals(Mobile from = null)
|
||||
{
|
||||
string targetFolder = Path.Combine(Core.BaseDirectory, "Data", "Spawns", "Pedestals");
|
||||
if (!Directory.Exists(targetFolder))
|
||||
{
|
||||
Directory.CreateDirectory(targetFolder);
|
||||
return;
|
||||
}
|
||||
string[] jsonFiles = Directory.GetFiles(targetFolder, "*.json", SearchOption.AllDirectories);
|
||||
if (jsonFiles.Length == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Utility.PushColor(ConsoleColor.Green);
|
||||
Console.WriteLine($"[PedestalBootTask] Refreshing {jsonFiles.Length} pedestal spawner file(s)...");
|
||||
Utility.PopColor();
|
||||
Mobile executer = from ?? World.Mobiles.Values.FirstOrDefault(m => m.AccessLevel >= AccessLevel.GameMaster);
|
||||
if (executer == null)
|
||||
{
|
||||
Console.WriteLine("[TaskManager] Automated pedestal respawn skipped. A GM must be online to execute the [is command.");
|
||||
return;
|
||||
}
|
||||
foreach (string filePath in jsonFiles)
|
||||
{
|
||||
string relativePath = Path.GetRelativePath(Core.BaseDirectory, filePath);
|
||||
CommandSystem.Handle(executer, $"[is {relativePath}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue