From bbca61cea1a84a5915a1078a3b01e4fe67f5b509 Mon Sep 17 00:00:00 2001 From: webmilio Date: Fri, 1 Jul 2016 18:30:22 -0400 Subject: [PATCH] Added the SetDungeon command. --- TShockAPI/Commands.cs | 17 +++++++++++++++-- TShockAPI/Permissions.cs | 3 +++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 7c547a05..615576c5 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -512,7 +512,12 @@ namespace TShockAPI AllowServer = false, 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." }); @@ -3612,7 +3617,15 @@ namespace TShockAPI 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); diff --git a/TShockAPI/Permissions.cs b/TShockAPI/Permissions.cs index 8f6bf446..ccc02ed3 100644 --- a/TShockAPI/Permissions.cs +++ b/TShockAPI/Permissions.cs @@ -305,6 +305,9 @@ namespace TShockAPI [Description("User can set the world spawn.")] 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.")] public static readonly string dropmeteor = "tshock.world.time.dropmeteor";