Chest KillTile is now subject to region protection.
Non-working /buff
This commit is contained in:
parent
e4bcadcdc4
commit
473d554de1
4 changed files with 54 additions and 0 deletions
|
|
@ -163,6 +163,7 @@ namespace TShockAPI
|
||||||
ChatCommands.Add(new Command("item", Item, "item", "i"));
|
ChatCommands.Add(new Command("item", Item, "item", "i"));
|
||||||
ChatCommands.Add(new Command("item", Give, "give"));
|
ChatCommands.Add(new Command("item", Give, "give"));
|
||||||
ChatCommands.Add(new Command("heal", Heal, "heal"));
|
ChatCommands.Add(new Command("heal", Heal, "heal"));
|
||||||
|
//ChatCommands.Add(new Command("buff", Buff, "buff"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1662,6 +1663,22 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void Buff(CommandArgs args)
|
||||||
|
{
|
||||||
|
if (!args.Player.RealPlayer)
|
||||||
|
{
|
||||||
|
args.Player.SendMessage("You cant buff yourself!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (args.Parameters.Count > 0)
|
||||||
|
{
|
||||||
|
args.Player.SendMessage("Invalid syntax! Proper syntax: /buff", Color.Red);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
args.Player.Buff();
|
||||||
|
args.Player.SendMessage("You have been buffed.", Color.Lime);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Cheat Comamnds
|
#endregion Cheat Comamnds
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,8 @@ namespace TShockAPI
|
||||||
|
|
||||||
public int MaximumLoginAttempts = 3;
|
public int MaximumLoginAttempts = 3;
|
||||||
|
|
||||||
|
public int[] Buffs = { 1, 2, 3, 5, 6, 9, 12, 14, 17, 18 };
|
||||||
|
|
||||||
public static ConfigFile Read(string path)
|
public static ConfigFile Read(string path)
|
||||||
{
|
{
|
||||||
if (!File.Exists(path))
|
if (!File.Exists(path))
|
||||||
|
|
|
||||||
|
|
@ -505,6 +505,34 @@ namespace TShockAPI
|
||||||
Tools.ForceKick(args.Player, string.Format("Tile Kill abuse ({0})", Main.tile[tilex, tiley].type));
|
Tools.ForceKick(args.Player, string.Format("Tile Kill abuse ({0})", Main.tile[tilex, tiley].type));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (!args.Player.Group.HasPermission("editspawn") && RegionManager.InProtectedArea(tilex, tiley, Tools.GetPlayerIP(args.Player.Name)))
|
||||||
|
{
|
||||||
|
args.Player.SendMessage("Region protected from changes.", Color.Red);
|
||||||
|
args.Player.SendTileSquare(tilex, tiley);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (TShock.Config.DisableBuild)
|
||||||
|
{
|
||||||
|
if (!args.Player.Group.HasPermission("editspawn"))
|
||||||
|
{
|
||||||
|
args.Player.SendMessage("World protected from changes.", Color.Red);
|
||||||
|
args.Player.SendTileSquare(tilex, tiley);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (TShock.Config.SpawnProtection)
|
||||||
|
{
|
||||||
|
if (!args.Player.Group.HasPermission("editspawn"))
|
||||||
|
{
|
||||||
|
var flag = TShock.CheckSpawn(tilex, tiley);
|
||||||
|
if (flag)
|
||||||
|
{
|
||||||
|
args.Player.SendMessage("Spawn protected from changes.", Color.Red);
|
||||||
|
args.Player.SendTileSquare(tilex, tiley);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -259,6 +259,13 @@ namespace TShockAPI
|
||||||
return;
|
return;
|
||||||
NetMessage.SendData((int)msgType, Index, -1, text, number, number2, number3, number4, number5);
|
NetMessage.SendData((int)msgType, Index, -1, text, number, number2, number3, number4, number5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Buff()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 10; i++)
|
||||||
|
TPlayer.buffType[i] = TShock.Config.Buffs[i];
|
||||||
|
NetMessage.SendData(50, -1, -1, "", Index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TSServerPlayer : TSPlayer
|
public class TSServerPlayer : TSPlayer
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue