Added the SetDungeon command.

This commit is contained in:
webmilio 2016-07-01 18:30:22 -04:00
parent 79484f1378
commit bbca61cea1
2 changed files with 18 additions and 2 deletions

View file

@ -512,7 +512,12 @@ namespace TShockAPI
AllowServer = false, AllowServer = false,
HelpText = "Sets the world's spawn point to your location." HelpText = "Sets the world's spawn point to your location."
}); });
add(new Command(Permissions.worldsettle, Settle, "settle") add(new Command(Permissions.worldspawn, SetDungeon, "setdungeon")
{
AllowServer = false,
HelpText = "Sets the dungeon's position to your location."
});
add(new Command(Permissions.worldsettle, Settle, "settle")
{ {
HelpText = "Forces all liquids to update immediately." HelpText = "Forces all liquids to update immediately."
}); });
@ -3612,7 +3617,15 @@ namespace TShockAPI
args.Player.SendSuccessMessage("Spawn has now been set at your location."); args.Player.SendSuccessMessage("Spawn has now been set at your location.");
} }
private static void Reload(CommandArgs args) private static void SetDungeon(CommandArgs args)
{
Main.dungeonX = args.Player.TileX + 1;
Main.dungeonY = args.Player.TileY + 3;
SaveManager.Instance.SaveWorld(false);
args.Player.SendSuccessMessage("The dungeon's position has now been set at your location.");
}
private static void Reload(CommandArgs args)
{ {
TShock.Utils.Reload(args.Player); TShock.Utils.Reload(args.Player);

View file

@ -305,6 +305,9 @@ namespace TShockAPI
[Description("User can set the world spawn.")] [Description("User can set the world spawn.")]
public static readonly string worldspawn = "tshock.world.setspawn"; public static readonly string worldspawn = "tshock.world.setspawn";
[Description( "User can set the dungeon's location." )]
public static readonly string dungeonposition = "tshock.world.setdungeon";
[Description("User can drop a meteor.")] [Description("User can drop a meteor.")]
public static readonly string dropmeteor = "tshock.world.time.dropmeteor"; public static readonly string dropmeteor = "tshock.world.time.dropmeteor";