Skip to content

Instantly share code, notes, and snippets.

@MrBluePotato
Last active January 3, 2016 18:09
Show Gist options
  • Save MrBluePotato/8500295 to your computer and use it in GitHub Desktop.
Save MrBluePotato/8500295 to your computer and use it in GitHub Desktop.
static void DragonHandler(Player player, Command cmd)
{
string DragonCMD = cmd.Next();
switch (DragonCMD.toLower())
{
case "on":
if (!player.Info.isDragon)
{
//Great dragon is off
//Turns Dragon On until the user turns it off
//Gets the coords of the player
short x = (short)(player.Position.X / 32 * 32 + 16);
short y = (short)(player.Position.Y / 32 * 32 + 16);
short z = (short)(player.Position.Z / 32 * 32);
Vector3I Pos = new Vector3I(player.Position.X / 32, player.Position.Y / 32, (player.Position.Z - 32) / 32);
//If the HeartBeat was sent to ClassiCube
if (Heartbeat.ClassiCube())
{
//Places the block at the players current location
BlockUpdate blockUpdate = new BlockUpdate(null, Pos, Block.Fire);
player.World.Map.QueueUpdate(blockUpdate);
player.WorldMap.SetBlock(Pos, playerBlock);
}
else
{
//Places the block at the players current location
BlockUpdate blockUpdate = new BlockUpdate(null, Pos, Block.Fire);
player.World.Map.QueueUpdate(blockUpdate);
player.WorldMap.SetBlock(Pos, playerBlock);
}
}
else
{
player.Message("&4Dragon is already on!&s");
}
break;
case "off":
if (player.Info.isDragon == true)
{
//Turn dragon off
player.Info.isDragon = false;
}
else
{
player.Message("&4Dragon is already off");
}
break;
else
{
CdDragon.PrintUsage(player);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment