// Argh's Skyscraper5 Script

// This script is hereby released under GPL v. 2 or later by Wolfe Games, 2007
// All contents were created by Wolfe Games.

// This Include is absolutely VITAL.  
// You must call it FIRST.  PERIOD.
// Don't say I didn't warn you ;-)
#include "STANDARD_COMMANDS_WORLDBUILDER.h"
#include "BUILDING_INCLUDES.h"

piece base;
piece floor01, floor02, floor03, floor04, floor05, floor06;
piece explode_point01, explode_point02, explode_point03, explode_point04, explode_point05, explode_point06, ground_explode_point, top_explode_point;
piece topfloor, topglass, groundfloor;

// SmokeUnit_WORLDBUILDER is a completely optional Include.  It *requires* STANDARD_COMMANDS_WORLDBUILDER.h
// ...to be included (or the code) *BEFORE* you call it.
// And SMOKEPIECE1 through SMOKEPIECE4 MUST BE DEFINED!
// It doesn't matter if they all refer to the same part.
#define SMOKEPIECE1 groundfloor
#define SMOKEPIECE2 topfloor
#define SMOKEPIECE3 floor01
#define SMOKEPIECE4 floor02
#include "SmokeUnit_WORLDBUILDER.h"

#define DEADBUILDING_DUST_FX 1024+1

lua_makePOP(arg) { return (0); }

Create()
{				
	start-script SmokeUnit_WORLDBUILDER();
}


Killed(severity, corpsetype)
{
		//Call P.O.P.S. 
		call-script lua_makePOP(ground_explode_point, 1);
		call-script lua_makePOP(top_explode_point, 1);
		call-script lua_makePOP(ground_explode_point, 1);
		call-script lua_makePOP(explode_point01, 1);	
		call-script lua_makePOP(explode_point02, 1);	
		call-script lua_makePOP(explode_point03, 1);
		call-script lua_makePOP(explode_point04, 1);	
		call-script lua_makePOP(explode_point05, 1);	
		call-script lua_makePOP(explode_point06, 1);
		
		sleep 1000;
		
		explode top_explode_point type FALL;

		explode explode_point01 type FALL;						

		explode explode_point02 type FALL;						

		explode explode_point03 type FALL;						

		explode explode_point04 type FALL;						

		explode explode_point05 type FALL;						

		explode explode_point06 type FALL;						

		move base to y-axis [-500] speed [60];
		
		call-script lua_makePOP(ground_explode_point, 1);
		sleep 500;
		call-script lua_makePOP(ground_explode_point, 1);
		sleep 500;
		call-script lua_makePOP(ground_explode_point, 1);
		
		wait-for-move base along y-axis;
						
	return (0);
							
	return (0);
}
