Added /king to spawn king slime.

/eater, /eye, /king, /skeletron and /hardcore accept an optional amount arg
/skeletron changes time to night before spawning (still have to set time manually if using /spawnmob "Skeletron Head")
This commit is contained in:
ricky 2011-06-17 14:29:48 +10:00
parent e1aa43179b
commit 8dc1bcff0d
3 changed files with 99 additions and 55 deletions

View file

@ -24,13 +24,6 @@ using Terraria;
namespace TShockAPI
{
internal enum NPCList
{
WORLD_EATER = 0,
EYE = 1,
SKELETRON = 2
}
internal class Tools
{
private static Random random = new Random();
@ -222,33 +215,6 @@ namespace TShockAPI
return found;
}
/// <summary>
/// Creates an NPC
/// </summary>
/// <param name="type">Type is defined in the enum NPC list</param>
/// <param name="player">int player that the npc targets</param>
public static void NewNPC(NPCList type, TSPlayer player)
{
switch (type)
{
case NPCList.WORLD_EATER:
WorldGen.shadowOrbSmashed = true;
WorldGen.shadowOrbCount = 3;
int w = NPC.NewNPC((int)player.X, (int)player.Y, 13, 1);
Main.npc[w].target = player.Index;
break;
case NPCList.EYE:
Main.time = 4861;
Main.dayTime = false;
WorldGen.spawnEye = true;
break;
case NPCList.SKELETRON:
int enpeecee = NPC.NewNPC((int)player.X, (int)player.Y, 0x23, 0);
Main.npc[enpeecee].netUpdate = true;
break;
}
}
/// <summary>
/// Kicks all player from the server without checking for immunetokick permission.
/// </summary>