/* 
      - 本版本是继《秘境☆极限跳跃》后另一力作...《秘境★遗忘奇迹》.
       --------------------------------------------------------------------------------------------------------------------------------------
                 海的对岸.许是无尽的黑暗.远处点点灯火.点燃我内心隐藏许久的那份思念.
                                                                                                                                   ---摘自《野猪·语录》
                                                                                                                                       2009.9.24。野猪留
*/
#include "..\PScriptLib\Def.h"

#include "..\PScriptLib\box.pst"
#include "..\PScriptLib\desk.pst"
#include "..\PScriptLib\chair.pst"
#include "..\PScriptLib\jug.pst"

int DeathMatch = 1;
int TeamDeathMatch = 5;
int GameMod;

int EventEnter = 200;
int EventExit = 201;
int EventDeath = 202;

int g_CharacterArena[99];
int g_ArenaCharacters[99];
int g_TeamAArenaCharacters[16];
int g_TeamBArenaCharacters[16];

Scene_OnLoad()
{
	int i;
	string name;

	//k
	for ( i=1; i<=9999; i++ )
	{
		MakeString(name, "D_k", i);
		SetSceneItem(name, "name", "machine");
		SetSceneItem(name, "attribute", "collision", 1);
	}  

	//db
	for ( i=1; i<=9999; i++ )
	{
		MakeString(name, "D_db", i);
		SetSceneItem(name, "name", "machine");
		SetSceneItem(name, "attribute", "collision", 1);
                SetSceneItem(name, "attribute", "active", 0);
	}  

	//dm
	for ( i=1; i<=9999; i++ )
	{
		MakeString(name, "D_dm", i);
		SetSceneItem(name, "name", "machine");
		SetSceneItem(name, "attribute", "collision", 1);
		SetSceneItem(name, "attribute", "damage", 1);
		SetSceneItem(name, "attribute", "damagevalue", 999999999);
                SetSceneItem(name, "attribute", "active", 0);
	}

	//te
	for ( i=1; i<=9999; i++ )
	{
		MakeString(name, "D_te", i);
		SetSceneItem(name, "name", "machine");
		SetSceneItem(name, "attribute", "collision", 1);
		SetSceneItem(name, "attribute", "damage", 1);
		SetSceneItem(name, "attribute", "damagevalue", 999999999);
                SetSceneItem(name, "attribute", "active", 0);
	}

	//tw
	for ( i=1; i<=9999; i++ )
	{
		MakeString(name, "D_tw", i);
		SetSceneItem(name, "name", "machine");
		SetSceneItem(name, "attribute", "collision", 1);
                SetSceneItem(name, "attribute", "active", 0);
		SetSceneItem(name, "attribute", "damage", 1);
		SetSceneItem(name, "attribute", "damagevalue", 999999999);
	}

	//A
	for ( i=1; i<=9999; i++ )
	{
		MakeString(name, "D_A", i);
		SetSceneItem(name, "name", "machine");
		SetSceneItem(name, "attribute", "collision", 1);
                SetSceneItem(name, "attribute", "active", 0);
		SetSceneItem(name, "attribute", "damage", 1);
		SetSceneItem(name, "attribute", "damagevalue", 999999999);
	}

	//td
	for ( i=1; i<=9999; i++ )
	{
		MakeString(name, "D_td", i);
		SetSceneItem(name, "name", "machine");
		SetSceneItem(name, "attribute", "collision", 1);
                SetSceneItem(name, "attribute", "active", 0);
	}

	//tz
	for ( i=1; i<=9999; i++ )
	{
		MakeString(name, "D_tz", i);
		SetSceneItem(name, "name", "machine");
		SetSceneItem(name, "attribute", "collision", 1);
                SetSceneItem(name, "attribute", "active", 0);
	}

	//G
	for ( i=1; i<=9999; i++ )
	{
		MakeString(name, "D_G", i);
		SetSceneItem(name, "name", "machine");
		SetSceneItem(name, "attribute", "collision", 1);
                SetSceneItem(name, "attribute", "active", 0);
	}

	//twy
	for ( i=1; i<=9999; i++ )
	{
		MakeString(name, "D_twy", i);
		SetSceneItem(name, "name", "machine");
		SetSceneItem(name, "attribute", "collision", 1);
                SetSceneItem(name, "attribute", "active", 0);
	}

	//YZ
	for ( i=1; i<=9999; i++ )
	{
		MakeString(name, "D_YZ", i);
		SetSceneItem(name, "name", "machine");
		SetSceneItem(name, "attribute", "collision", 1);
                SetSceneItem(name, "attribute", "active", 0);
	}

	//U
	for ( i=1; i<=9999; i++ )
	{
		MakeString(name, "D_U", i);
		SetSceneItem(name, "name", "machine");
		SetSceneItem(name, "attribute", "collision", 1);
                SetSceneItem(name, "attribute", "active", 0);
	}

	//M
	for ( i=1; i<=9999; i++ )
	{
		MakeString(name, "D_M", i);
		SetSceneItem(name, "name", "machine");
		SetSceneItem(name, "attribute", "collision", 1);
                SetSceneItem(name, "attribute", "active", 0);
	}

	//MA
	for ( i=1; i<=9999; i++ )
	{
		MakeString(name, "D_MA", i);
		SetSceneItem(name, "name", "machine");
		SetSceneItem(name, "attribute", "collision", 1);
                SetSceneItem(name, "attribute", "active", 0);
	}

	//sn02st
	for ( i=1; i<=9999; i++ )
	{
		MakeString(name, "D_sn02st", i);
		SetSceneItem(name, "name", "machine");
		SetSceneItem(name, "attribute", "collision", 1);
                SetSceneItem(name, "attribute", "active", 0);
	}
} 

Scene_OnInit()
{
	InitBoxes(g_iNumBoxes);
	InitBBoxes(g_iNumBBoxes);
	InitChairs(g_iNumChairs);
	InitDeskes(g_iNumDeskes);
	InitJugs(g_iNumJugs);

	GameMod = GameCallBack("mod", 0);
	int i;
	string itemname;
	for (i=0; i<16; i=i+1)
	{
		g_CharacterArena[i] = -1;
		g_ArenaCharacters[i] = 0;
		g_TeamAArenaCharacters[i] = 0;
		g_TeamBArenaCharacters[i] = 0;
		
		MakeString(itemname, "D_tpEC", i+1);
		SetSceneItem(itemname, "name", "machine");
		SetSceneItem(itemname, "attribute", "collision", 0);
		SetSceneItem(itemname, "attribute", "interactive", 1);
              SetSceneItem(itemname, "attribute", "active", 0);

		MakeString(itemname, "D_tpEC", i+17);
		SetSceneItem(itemname, "name", "machine");
		SetSceneItem(itemname, "attribute", "collision", 0);
		SetSceneItem(itemname, "attribute", "interactive", 1);
              SetSceneItem(itemname, "attribute", "active", 0);
	}

        for (i=0; i<8; i=i+1)
	{
		MakeString(itemname, "D_tpAC", i+1);
		SetSceneItem(itemname, "name", "machine");
		SetSceneItem(itemname, "attribute", "collision", 0);

		MakeString(itemname, "D_tpAC", i+9);
		SetSceneItem(itemname, "name", "machine");
		SetSceneItem(itemname, "attribute", "collision", 0);
		
		MakeString(itemname, "D_tpBC", i+1);
		SetSceneItem(itemname, "name", "machine");
		SetSceneItem(itemname, "attribute", "collision", 0);

		MakeString(itemname, "D_tpBC", i+9);
		SetSceneItem(itemname, "name", "machine");
		SetSceneItem(itemname, "attribute", "collision", 0);
	}
}
D_Item01_OnPickUp()
{
	NetEvent(1);

	SetSceneItem("D_tpEC01", "attribute", "active", 1);

	SetSceneItem("D_tz01", "attribute", "active", 1);

	SetSceneItem("D_db01", "attribute", "active", 1);
	SetSceneItem("D_db02", "attribute", "active", 1);
	SetSceneItem("D_db03", "attribute", "active", 1);
	SetSceneItem("D_db04", "attribute", "active", 1);

	SetSceneItem("D_dm01", "attribute", "active", 1);
	SetSceneItem("D_dm02", "attribute", "active", 1);
	SetSceneItem("D_dm03", "attribute", "active", 1);
	SetSceneItem("D_dm04", "attribute", "active", 1);
	SetSceneItem("D_dm05", "attribute", "active", 1);
	SetSceneItem("D_dm06", "attribute", "active", 1);
	SetSceneItem("D_dm07", "attribute", "active", 1);
	SetSceneItem("D_dm08", "attribute", "active", 1);
	SetSceneItem("D_dm09", "attribute", "active", 1);
	SetSceneItem("D_dm10", "attribute", "active", 1);
	SetSceneItem("D_dm11", "attribute", "active", 1);
	SetSceneItem("D_dm12", "attribute", "active", 1);
	SetSceneItem("D_dm13", "attribute", "active", 1);
	SetSceneItem("D_dm14", "attribute", "active", 1);
	SetSceneItem("D_dm15", "attribute", "active", 1);
	SetSceneItem("D_dm16", "attribute", "active", 1);
	SetSceneItem("D_dm17", "attribute", "active", 1);
	SetSceneItem("D_dm18", "attribute", "active", 1);
	SetSceneItem("D_dm19", "attribute", "active", 1);
	SetSceneItem("D_dm20", "attribute", "active", 1);
	SetSceneItem("D_dm21", "attribute", "active", 1);
	SetSceneItem("D_dm22", "attribute", "active", 1);
	SetSceneItem("D_dm23", "attribute", "active", 1);

	SetSceneItem("D_td01", "attribute", "active", 1);
	SetSceneItem("D_td02", "attribute", "active", 1);
	SetSceneItem("D_td03", "attribute", "active", 1);
	SetSceneItem("D_td04", "attribute", "active", 1);
	SetSceneItem("D_td05", "attribute", "active", 1);
	SetSceneItem("D_td06", "attribute", "active", 1);
	SetSceneItem("D_td07", "attribute", "active", 1);
	SetSceneItem("D_td08", "attribute", "active", 1);
	SetSceneItem("D_td09", "attribute", "active", 1);
	SetSceneItem("D_td10", "attribute", "active", 1);
	SetSceneItem("D_td11", "attribute", "active", 1);
	SetSceneItem("D_td12", "attribute", "active", 1);
	SetSceneItem("D_td13", "attribute", "active", 1);
	SetSceneItem("D_td14", "attribute", "active", 1);
	SetSceneItem("D_td15", "attribute", "active", 1);
	SetSceneItem("D_td16", "attribute", "active", 1);
	SetSceneItem("D_td17", "attribute", "active", 1);
	SetSceneItem("D_td18", "attribute", "active", 1);
	SetSceneItem("D_td19", "attribute", "active", 1);
	SetSceneItem("D_td20", "attribute", "active", 1);
	SetSceneItem("D_td21", "attribute", "active", 1);
	SetSceneItem("D_td22", "attribute", "active", 1);
	SetSceneItem("D_td23", "attribute", "active", 1);
	SetSceneItem("D_td24", "attribute", "active", 1);
	SetSceneItem("D_td25", "attribute", "active", 1);
	SetSceneItem("D_td26", "attribute", "active", 1);
	SetSceneItem("D_td27", "attribute", "active", 1);
	SetSceneItem("D_td28", "attribute", "active", 1);
	SetSceneItem("D_td29", "attribute", "active", 1);
	SetSceneItem("D_td30", "attribute", "active", 1);
	SetSceneItem("D_td31", "attribute", "active", 1);
	SetSceneItem("D_td32", "attribute", "active", 1);
	SetSceneItem("D_td33", "attribute", "active", 1);
	SetSceneItem("D_td34", "attribute", "active", 1);
	SetSceneItem("D_td35", "attribute", "active", 1);
	SetSceneItem("D_td36", "attribute", "active", 1);
	SetSceneItem("D_td37", "attribute", "active", 1);
	SetSceneItem("D_td38", "attribute", "active", 1);
	SetSceneItem("D_td39", "attribute", "active", 1);
	SetSceneItem("D_td40", "attribute", "active", 1);
	SetSceneItem("D_td41", "attribute", "active", 1);
	SetSceneItem("D_td42", "attribute", "active", 1);
	SetSceneItem("D_td43", "attribute", "active", 1);
	SetSceneItem("D_td44", "attribute", "active", 1);
	SetSceneItem("D_td45", "attribute", "active", 1);
	SetSceneItem("D_td46", "attribute", "active", 1);
	SetSceneItem("D_td47", "attribute", "active", 1);
	SetSceneItem("D_td48", "attribute", "active", 1);
	SetSceneItem("D_td49", "attribute", "active", 1);
	SetSceneItem("D_td50", "attribute", "active", 1);
	SetSceneItem("D_td51", "attribute", "active", 1);
	SetSceneItem("D_td52", "attribute", "active", 1);
	SetSceneItem("D_td53", "attribute", "active", 1);
	SetSceneItem("D_td54", "attribute", "active", 1);
	SetSceneItem("D_td55", "attribute", "active", 1);
}
D_tz01_OnAttack(int id, int character, int damage)
{ 
	SetSceneItem("D_tpEC01", "attribute", "active", 0);

	SetSceneItem("D_tz01", "attribute", "active", 0);

	SetSceneItem("D_db01", "attribute", "active", 0);
	SetSceneItem("D_db02", "attribute", "active", 0);
	SetSceneItem("D_db03", "attribute", "active", 0);
	SetSceneItem("D_db04", "attribute", "active", 0);

	SetSceneItem("D_dm01", "attribute", "active", 0);
	SetSceneItem("D_dm02", "attribute", "active", 0);
	SetSceneItem("D_dm03", "attribute", "active", 0);
	SetSceneItem("D_dm04", "attribute", "active", 0);
	SetSceneItem("D_dm05", "attribute", "active", 0);
	SetSceneItem("D_dm06", "attribute", "active", 0);
	SetSceneItem("D_dm07", "attribute", "active", 0);
	SetSceneItem("D_dm08", "attribute", "active", 0);
	SetSceneItem("D_dm09", "attribute", "active", 0);
	SetSceneItem("D_dm10", "attribute", "active", 0);
	SetSceneItem("D_dm11", "attribute", "active", 0);
	SetSceneItem("D_dm12", "attribute", "active", 0);
	SetSceneItem("D_dm13", "attribute", "active", 0);
	SetSceneItem("D_dm14", "attribute", "active", 0);
	SetSceneItem("D_dm15", "attribute", "active", 0);
	SetSceneItem("D_dm16", "attribute", "active", 0);
	SetSceneItem("D_dm17", "attribute", "active", 0);
	SetSceneItem("D_dm18", "attribute", "active", 0);
	SetSceneItem("D_dm19", "attribute", "active", 0);
	SetSceneItem("D_dm20", "attribute", "active", 0);
	SetSceneItem("D_dm21", "attribute", "active", 0);
	SetSceneItem("D_dm22", "attribute", "active", 0);
	SetSceneItem("D_dm23", "attribute", "active", 0);

	SetSceneItem("D_td01", "attribute", "active", 0);
	SetSceneItem("D_td02", "attribute", "active", 0);
	SetSceneItem("D_td03", "attribute", "active", 0);
	SetSceneItem("D_td04", "attribute", "active", 0);
	SetSceneItem("D_td05", "attribute", "active", 0);
	SetSceneItem("D_td06", "attribute", "active", 0);
	SetSceneItem("D_td07", "attribute", "active", 0);
	SetSceneItem("D_td08", "attribute", "active", 0);
	SetSceneItem("D_td09", "attribute", "active", 0);
	SetSceneItem("D_td10", "attribute", "active", 0);
	SetSceneItem("D_td11", "attribute", "active", 0);
	SetSceneItem("D_td12", "attribute", "active", 0);
	SetSceneItem("D_td13", "attribute", "active", 0);
	SetSceneItem("D_td14", "attribute", "active", 0);
	SetSceneItem("D_td15", "attribute", "active", 0);
	SetSceneItem("D_td16", "attribute", "active", 0);
	SetSceneItem("D_td17", "attribute", "active", 0);
	SetSceneItem("D_td18", "attribute", "active", 0);
	SetSceneItem("D_td19", "attribute", "active", 0);
	SetSceneItem("D_td20", "attribute", "active", 0);
	SetSceneItem("D_td21", "attribute", "active", 0);
	SetSceneItem("D_td22", "attribute", "active", 0);
	SetSceneItem("D_td23", "attribute", "active", 0);
	SetSceneItem("D_td24", "attribute", "active", 0);
	SetSceneItem("D_td25", "attribute", "active", 0);
	SetSceneItem("D_td26", "attribute", "active", 0);
	SetSceneItem("D_td27", "attribute", "active", 0);
	SetSceneItem("D_td28", "attribute", "active", 0);
	SetSceneItem("D_td29", "attribute", "active", 0);
	SetSceneItem("D_td30", "attribute", "active", 0);
	SetSceneItem("D_td31", "attribute", "active", 0);
	SetSceneItem("D_td32", "attribute", "active", 0);
	SetSceneItem("D_td33", "attribute", "active", 0);
	SetSceneItem("D_td34", "attribute", "active", 0);
	SetSceneItem("D_td35", "attribute", "active", 0);
	SetSceneItem("D_td36", "attribute", "active", 0);
	SetSceneItem("D_td37", "attribute", "active", 0);
	SetSceneItem("D_td38", "attribute", "active", 0);
	SetSceneItem("D_td39", "attribute", "active", 0);
	SetSceneItem("D_td40", "attribute", "active", 0);
	SetSceneItem("D_td41", "attribute", "active", 0);
	SetSceneItem("D_td42", "attribute", "active", 0);
	SetSceneItem("D_td43", "attribute", "active", 0);
	SetSceneItem("D_td44", "attribute", "active", 0);
	SetSceneItem("D_td45", "attribute", "active", 0);
	SetSceneItem("D_td46", "attribute", "active", 0);
	SetSceneItem("D_td47", "attribute", "active", 0);
	SetSceneItem("D_td48", "attribute", "active", 0);
	SetSceneItem("D_td49", "attribute", "active", 0);
	SetSceneItem("D_td50", "attribute", "active", 0);
	SetSceneItem("D_td51", "attribute", "active", 0);
	SetSceneItem("D_td52", "attribute", "active", 0);
	SetSceneItem("D_td53", "attribute", "active", 0);
	SetSceneItem("D_td54", "attribute", "active", 0);
	SetSceneItem("D_td55", "attribute", "active", 0);

	SetSceneItem("D_sn02st01", "attribute", "active", 1);
	SetSceneItem("D_sn02st02", "attribute", "active", 1);
	SetSceneItem("D_sn02st03", "attribute", "active", 1);
	SetSceneItem("D_sn02st04", "attribute", "active", 1);
	SetSceneItem("D_sn02st05", "attribute", "active", 1);
	SetSceneItem("D_sn02st06", "attribute", "active", 1);
	SetSceneItem("D_sn02st07", "attribute", "active", 1);
	SetSceneItem("D_sn02st08", "attribute", "active", 1);
	SetSceneItem("D_sn02st09", "attribute", "active", 1);
	SetSceneItem("D_sn02st10", "attribute", "active", 1);
	SetSceneItem("D_sn02st11", "attribute", "active", 1);
	SetSceneItem("D_sn02st12", "attribute", "active", 1);
	SetSceneItem("D_sn02st13", "attribute", "active", 1);
	SetSceneItem("D_sn02st14", "attribute", "active", 1);
	SetSceneItem("D_sn02st15", "attribute", "active", 1);
	SetSceneItem("D_sn02st16", "attribute", "active", 1);
	SetSceneItem("D_sn02st17", "attribute", "active", 1);
	SetSceneItem("D_sn02st18", "attribute", "active", 1);
	SetSceneItem("D_sn02st19", "attribute", "active", 1);
	SetSceneItem("D_sn02st20", "attribute", "active", 1);
	SetSceneItem("D_sn02st21", "attribute", "active", 1);
	SetSceneItem("D_sn02st22", "attribute", "active", 1);
	SetSceneItem("D_sn02st23", "attribute", "active", 1);
	SetSceneItem("D_sn02st24", "attribute", "active", 1);
	SetSceneItem("D_sn02st25", "attribute", "active", 1);
	SetSceneItem("D_sn02st26", "attribute", "active", 1);
	SetSceneItem("D_sn02st27", "attribute", "active", 1);
	SetSceneItem("D_sn02st28", "attribute", "active", 1);

	SetSceneItem("D_tz02", "attribute", "active", 1);

	SetSceneItem("D_tw01", "attribute", "active", 1);
	SetSceneItem("D_tw02", "attribute", "active", 1);
	SetSceneItem("D_tw03", "attribute", "active", 1);
	SetSceneItem("D_tw04", "attribute", "active", 1);
	SetSceneItem("D_tw05", "attribute", "active", 1);
	SetSceneItem("D_tw06", "attribute", "active", 1);
	SetSceneItem("D_tw07", "attribute", "active", 1);
	SetSceneItem("D_tw08", "attribute", "active", 1);
	SetSceneItem("D_tw09", "attribute", "active", 1);
	SetSceneItem("D_tw10", "attribute", "active", 1);
	SetSceneItem("D_tw11", "attribute", "active", 1);
	SetSceneItem("D_tw12", "attribute", "active", 1);
	SetSceneItem("D_tw13", "attribute", "active", 1);
	SetSceneItem("D_tw14", "attribute", "active", 1);
	SetSceneItem("D_tw15", "attribute", "active", 1);
	SetSceneItem("D_tw16", "attribute", "active", 1);
	SetSceneItem("D_tw17", "attribute", "active", 1);
	SetSceneItem("D_tw18", "attribute", "active", 1);
	SetSceneItem("D_tw19", "attribute", "active", 1);
	SetSceneItem("D_tw20", "attribute", "active", 1);
	SetSceneItem("D_tw21", "attribute", "active", 1);
	SetSceneItem("D_tw22", "attribute", "active", 1);
	SetSceneItem("D_tw23", "attribute", "active", 1);
	SetSceneItem("D_tw24", "attribute", "active", 1);
	SetSceneItem("D_tw25", "attribute", "active", 1);
	SetSceneItem("D_tw26", "attribute", "active", 1);
	SetSceneItem("D_tw27", "attribute", "active", 1);
	SetSceneItem("D_tw28", "attribute", "active", 1);
	SetSceneItem("D_tw29", "attribute", "active", 1);
	SetSceneItem("D_tw30", "attribute", "active", 1);
	SetSceneItem("D_tw31", "attribute", "active", 1);
	SetSceneItem("D_tw32", "attribute", "active", 1);
	SetSceneItem("D_tw33", "attribute", "active", 1);
	SetSceneItem("D_tw34", "attribute", "active", 1);
	SetSceneItem("D_tw35", "attribute", "active", 1);
	SetSceneItem("D_tw36", "attribute", "active", 1);
	SetSceneItem("D_tw37", "attribute", "active", 1);
	SetSceneItem("D_tw38", "attribute", "active", 1);
	SetSceneItem("D_tw39", "attribute", "active", 1);
	SetSceneItem("D_tw40", "attribute", "active", 1);
	SetSceneItem("D_tw41", "attribute", "active", 1);
	SetSceneItem("D_tw42", "attribute", "active", 1);
	SetSceneItem("D_tw43", "attribute", "active", 1);
	SetSceneItem("D_tw44", "attribute", "active", 1);
	SetSceneItem("D_tw45", "attribute", "active", 1);
	SetSceneItem("D_tw46", "attribute", "active", 1);
	SetSceneItem("D_tw47", "attribute", "active", 1);
	SetSceneItem("D_tw48", "attribute", "active", 1);
	SetSceneItem("D_tw49", "attribute", "active", 1);
	SetSceneItem("D_tw50", "attribute", "active", 1);
	SetSceneItem("D_tw51", "attribute", "active", 1);
	SetSceneItem("D_tw52", "attribute", "active", 1);
	SetSceneItem("D_tw53", "attribute", "active", 1);
	SetSceneItem("D_tw54", "attribute", "active", 1);
	SetSceneItem("D_tw55", "attribute", "active", 1);

	SetSceneItem("D_td56", "attribute", "active", 1);
	SetSceneItem("D_td57", "attribute", "active", 1);
	SetSceneItem("D_td58", "attribute", "active", 1);
	SetSceneItem("D_td59", "attribute", "active", 1);

	SetSceneItem("D_tpEC10", "attribute", "active", 1);
	SetSceneItem("D_tpEC11", "attribute", "active", 1);

	CreateEffect("D_sn02st01", "FuTi-UP", 1);
	SetSceneItem("D_sn02st01", "pose", 1, 1);
	SetSceneItem("D_sn02st01", "frame", 180);

	SetSceneItem("D_sn02st02", "pose", 1, 1);
	SetSceneItem("D_sn02st02", "frame", 160);

	SetSceneItem("D_sn02st03", "pose", 1, 1);
	SetSceneItem("D_sn02st03", "frame", 140);

	SetSceneItem("D_sn02st04", "pose", 1, 1);
	SetSceneItem("D_sn02st04", "frame", 120);

	SetSceneItem("D_sn02st05", "pose", 1, 1);
	SetSceneItem("D_sn02st05", "frame", 100);

	SetSceneItem("D_sn02st06", "pose", 1, 1);
	SetSceneItem("D_sn02st06", "frame", 80);

	SetSceneItem("D_sn02st07", "pose", 1, 1);
	SetSceneItem("D_sn02st07", "frame", 60);

	SetSceneItem("D_sn02st08", "pose", 1, 1);
	SetSceneItem("D_sn02st08", "frame", 180);

	SetSceneItem("D_sn02st09", "pose", 1, 1);
	SetSceneItem("D_sn02st09", "frame", 160);

	SetSceneItem("D_sn02st10", "pose", 1, 1);
	SetSceneItem("D_sn02st10", "frame", 140);

	SetSceneItem("D_sn02st11", "pose", 1, 1);
	SetSceneItem("D_sn02st11", "frame", 120);

	SetSceneItem("D_sn02st12", "pose", 1, 1);
	SetSceneItem("D_sn02st12", "frame", 100);

	SetSceneItem("D_sn02st13", "pose", 1, 1);
	SetSceneItem("D_sn02st13", "frame", 80);

	SetSceneItem("D_sn02st14", "pose", 1, 1);
	SetSceneItem("D_sn02st14", "frame", 60);

	SetSceneItem("D_sn02st15", "pose", 1, 1);
	SetSceneItem("D_sn02st15", "frame", 180);

	SetSceneItem("D_sn02st16", "pose", 1, 1);
	SetSceneItem("D_sn02st16", "frame", 160);

	SetSceneItem("D_sn02st17", "pose", 1, 1);
	SetSceneItem("D_sn02st17", "frame", 140);

	SetSceneItem("D_sn02st18", "pose", 1, 1);
	SetSceneItem("D_sn02st18", "frame", 120);

	SetSceneItem("D_sn02st19", "pose", 1, 1);
	SetSceneItem("D_sn02st19", "frame", 100);

	SetSceneItem("D_sn02st20", "pose", 1, 1);
	SetSceneItem("D_sn02st20", "frame", 80);

	SetSceneItem("D_sn02st21", "pose", 1, 1);
	SetSceneItem("D_sn02st21", "frame", 60);

	SetSceneItem("D_sn02st22", "pose", 1, 1);
	SetSceneItem("D_sn02st22", "frame", 180);

	SetSceneItem("D_sn02st23", "pose", 1, 1);
	SetSceneItem("D_sn02st23", "frame", 160);

	SetSceneItem("D_sn02st24", "pose", 1, 1);
	SetSceneItem("D_sn02st24", "frame", 140);

	SetSceneItem("D_sn02st25", "pose", 1, 1);
	SetSceneItem("D_sn02st25", "frame", 120);

	SetSceneItem("D_sn02st26", "pose", 1, 1);
	SetSceneItem("D_sn02st26", "frame", 100);

	SetSceneItem("D_sn02st27", "pose", 1, 1);
	SetSceneItem("D_sn02st27", "frame", 80);

	SetSceneItem("D_sn02st28", "pose", 1, 1);
	SetSceneItem("D_sn02st28", "frame", 60);
}
D_tz02_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_tpEC10", "attribute", "active", 0);
	SetSceneItem("D_tpEC11", "attribute", "active", 0);

	SetSceneItem("D_sn02st01", "attribute", "active", 0);
	SetSceneItem("D_sn02st02", "attribute", "active", 0);
	SetSceneItem("D_sn02st03", "attribute", "active", 0);
	SetSceneItem("D_sn02st04", "attribute", "active", 0);
	SetSceneItem("D_sn02st05", "attribute", "active", 0);
	SetSceneItem("D_sn02st06", "attribute", "active", 0);
	SetSceneItem("D_sn02st07", "attribute", "active", 0);
	SetSceneItem("D_sn02st08", "attribute", "active", 0);
	SetSceneItem("D_sn02st09", "attribute", "active", 0);
	SetSceneItem("D_sn02st10", "attribute", "active", 0);
	SetSceneItem("D_sn02st11", "attribute", "active", 0);
	SetSceneItem("D_sn02st12", "attribute", "active", 0);
	SetSceneItem("D_sn02st13", "attribute", "active", 0);
	SetSceneItem("D_sn02st14", "attribute", "active", 0);
	SetSceneItem("D_sn02st15", "attribute", "active", 0);
	SetSceneItem("D_sn02st16", "attribute", "active", 0);
	SetSceneItem("D_sn02st17", "attribute", "active", 0);
	SetSceneItem("D_sn02st18", "attribute", "active", 0);
	SetSceneItem("D_sn02st19", "attribute", "active", 0);
	SetSceneItem("D_sn02st20", "attribute", "active", 0);
	SetSceneItem("D_sn02st21", "attribute", "active", 0);
	SetSceneItem("D_sn02st22", "attribute", "active", 0);
	SetSceneItem("D_sn02st23", "attribute", "active", 0);
	SetSceneItem("D_sn02st24", "attribute", "active", 0);
	SetSceneItem("D_sn02st25", "attribute", "active", 0);
	SetSceneItem("D_sn02st26", "attribute", "active", 0);
	SetSceneItem("D_sn02st27", "attribute", "active", 0);
	SetSceneItem("D_sn02st28", "attribute", "active", 0);

	SetSceneItem("D_tw01", "attribute", "active", 0);
	SetSceneItem("D_tw02", "attribute", "active", 0);
	SetSceneItem("D_tw03", "attribute", "active", 0);
	SetSceneItem("D_tw04", "attribute", "active", 0);
	SetSceneItem("D_tw05", "attribute", "active", 0);
	SetSceneItem("D_tw06", "attribute", "active", 0);
	SetSceneItem("D_tw07", "attribute", "active", 0);
	SetSceneItem("D_tw08", "attribute", "active", 0);
	SetSceneItem("D_tw09", "attribute", "active", 0);
	SetSceneItem("D_tw10", "attribute", "active", 0);
	SetSceneItem("D_tw11", "attribute", "active", 0);
	SetSceneItem("D_tw12", "attribute", "active", 0);
	SetSceneItem("D_tw13", "attribute", "active", 0);
	SetSceneItem("D_tw14", "attribute", "active", 0);
	SetSceneItem("D_tw15", "attribute", "active", 0);
	SetSceneItem("D_tw16", "attribute", "active", 0);
	SetSceneItem("D_tw17", "attribute", "active", 0);
	SetSceneItem("D_tw18", "attribute", "active", 0);
	SetSceneItem("D_tw19", "attribute", "active", 0);
	SetSceneItem("D_tw20", "attribute", "active", 0);
	SetSceneItem("D_tw21", "attribute", "active", 0);
	SetSceneItem("D_tw22", "attribute", "active", 0);
	SetSceneItem("D_tw23", "attribute", "active", 0);
	SetSceneItem("D_tw24", "attribute", "active", 0);
	SetSceneItem("D_tw25", "attribute", "active", 0);
	SetSceneItem("D_tw26", "attribute", "active", 0);
	SetSceneItem("D_tw27", "attribute", "active", 0);
	SetSceneItem("D_tw28", "attribute", "active", 0);
	SetSceneItem("D_tw29", "attribute", "active", 0);
	SetSceneItem("D_tw30", "attribute", "active", 0);
	SetSceneItem("D_tw31", "attribute", "active", 0);
	SetSceneItem("D_tw32", "attribute", "active", 0);
	SetSceneItem("D_tw33", "attribute", "active", 0);
	SetSceneItem("D_tw34", "attribute", "active", 0);
	SetSceneItem("D_tw35", "attribute", "active", 0);
	SetSceneItem("D_tw36", "attribute", "active", 0);
	SetSceneItem("D_tw37", "attribute", "active", 0);
	SetSceneItem("D_tw38", "attribute", "active", 0);
	SetSceneItem("D_tw39", "attribute", "active", 0);
	SetSceneItem("D_tw40", "attribute", "active", 0);
	SetSceneItem("D_tw41", "attribute", "active", 0);
	SetSceneItem("D_tw42", "attribute", "active", 0);
	SetSceneItem("D_tw43", "attribute", "active", 0);
	SetSceneItem("D_tw44", "attribute", "active", 0);
	SetSceneItem("D_tw45", "attribute", "active", 0);
	SetSceneItem("D_tw46", "attribute", "active", 0);
	SetSceneItem("D_tw47", "attribute", "active", 0);
	SetSceneItem("D_tw48", "attribute", "active", 0);
	SetSceneItem("D_tw49", "attribute", "active", 0);
	SetSceneItem("D_tw50", "attribute", "active", 0);
	SetSceneItem("D_tw51", "attribute", "active", 0);
	SetSceneItem("D_tw52", "attribute", "active", 0);
	SetSceneItem("D_tw53", "attribute", "active", 0);
	SetSceneItem("D_tw54", "attribute", "active", 0);
	SetSceneItem("D_tw55", "attribute", "active", 0);

	SetSceneItem("D_tz02", "attribute", "active", 0);

	SetSceneItem("D_td56", "attribute", "active", 0);
	SetSceneItem("D_td57", "attribute", "active", 0);
	SetSceneItem("D_td58", "attribute", "active", 0);
	SetSceneItem("D_td59", "attribute", "active", 0);

	SetSceneItem("D_tpEC12", "attribute", "active", 1);
	SetSceneItem("D_tpEC13", "attribute", "active", 1);

	SetSceneItem("D_td60", "attribute", "active", 1);
	SetSceneItem("D_td61", "attribute", "active", 1);
	SetSceneItem("D_td62", "attribute", "active", 1);
	SetSceneItem("D_td63", "attribute", "active", 1);
	SetSceneItem("D_td64", "attribute", "active", 1);
	SetSceneItem("D_td65", "attribute", "active", 1);
	SetSceneItem("D_td66", "attribute", "active", 1);
	SetSceneItem("D_td67", "attribute", "active", 1);
	SetSceneItem("D_td68", "attribute", "active", 1);
	SetSceneItem("D_td69", "attribute", "active", 1);
	SetSceneItem("D_td70", "attribute", "active", 1);
	SetSceneItem("D_td71", "attribute", "active", 1);
	SetSceneItem("D_td72", "attribute", "active", 1);
	SetSceneItem("D_td73", "attribute", "active", 1);

	SetSceneItem("D_td74", "attribute", "active", 1);

	SetSceneItem("D_tz03", "attribute", "active", 1);

	SetSceneItem("D_te01", "attribute", "active", 1);
	SetSceneItem("D_te02", "attribute", "active", 1);
	SetSceneItem("D_te03", "attribute", "active", 1);
	SetSceneItem("D_te04", "attribute", "active", 1);
	SetSceneItem("D_te05", "attribute", "active", 1);
	SetSceneItem("D_te06", "attribute", "active", 1);
	SetSceneItem("D_te07", "attribute", "active", 1);
	SetSceneItem("D_te08", "attribute", "active", 1);
	SetSceneItem("D_te09", "attribute", "active", 1);
	SetSceneItem("D_te10", "attribute", "active", 1);
	SetSceneItem("D_te11", "attribute", "active", 1);
	SetSceneItem("D_te12", "attribute", "active", 1);
	SetSceneItem("D_te13", "attribute", "active", 1);
	SetSceneItem("D_te14", "attribute", "active", 1);
	SetSceneItem("D_te15", "attribute", "active", 1);
	SetSceneItem("D_te16", "attribute", "active", 1);
	SetSceneItem("D_te17", "attribute", "active", 1);
	SetSceneItem("D_te18", "attribute", "active", 1);
	SetSceneItem("D_te19", "attribute", "active", 1);
	SetSceneItem("D_te20", "attribute", "active", 1);
	SetSceneItem("D_te21", "attribute", "active", 1);
	SetSceneItem("D_te22", "attribute", "active", 1);
	SetSceneItem("D_te23", "attribute", "active", 1);
	SetSceneItem("D_te24", "attribute", "active", 1);
	SetSceneItem("D_te25", "attribute", "active", 1);
	SetSceneItem("D_te26", "attribute", "active", 1);
	SetSceneItem("D_te27", "attribute", "active", 1);
	SetSceneItem("D_te28", "attribute", "active", 1);
	SetSceneItem("D_te29", "attribute", "active", 1);
	SetSceneItem("D_te30", "attribute", "active", 1);
	SetSceneItem("D_te31", "attribute", "active", 1);
	SetSceneItem("D_te32", "attribute", "active", 1);
	SetSceneItem("D_te33", "attribute", "active", 1);
	SetSceneItem("D_te34", "attribute", "active", 1);
	SetSceneItem("D_te35", "attribute", "active", 1);
	SetSceneItem("D_te36", "attribute", "active", 1);
	SetSceneItem("D_te37", "attribute", "active", 1);
	SetSceneItem("D_te38", "attribute", "active", 1);
	SetSceneItem("D_te39", "attribute", "active", 1);
	SetSceneItem("D_te40", "attribute", "active", 1);
	SetSceneItem("D_te41", "attribute", "active", 1);
	SetSceneItem("D_te42", "attribute", "active", 1);
	SetSceneItem("D_te43", "attribute", "active", 1);
}
D_tz03_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_tpEC12", "attribute", "active", 0);
	SetSceneItem("D_tpEC13", "attribute", "active", 0);

	SetSceneItem("D_tz03", "attribute", "active", 0);

       SetSceneItem("D_td164", "attribute", "active", 0);
       SetSceneItem("D_td165", "attribute", "active", 0);
       SetSceneItem("D_td166", "attribute", "active", 0);
       SetSceneItem("D_td167", "attribute", "active", 0);
       SetSceneItem("D_td168", "attribute", "active", 0);
       SetSceneItem("D_td169", "attribute", "active", 0);

	SetSceneItem("D_td60", "attribute", "active", 0);
	SetSceneItem("D_td61", "attribute", "active", 0);
	SetSceneItem("D_td62", "attribute", "active", 0);
	SetSceneItem("D_td63", "attribute", "active", 0);
	SetSceneItem("D_td64", "attribute", "active", 0);
	SetSceneItem("D_td65", "attribute", "active", 0);
	SetSceneItem("D_td66", "attribute", "active", 0);
	SetSceneItem("D_td67", "attribute", "active", 0);
	SetSceneItem("D_td68", "attribute", "active", 0);
	SetSceneItem("D_td69", "attribute", "active", 0);
	SetSceneItem("D_td70", "attribute", "active", 0);
	SetSceneItem("D_td71", "attribute", "active", 0);
	SetSceneItem("D_td72", "attribute", "active", 0);
	SetSceneItem("D_td73", "attribute", "active", 0);

	SetSceneItem("D_td74", "attribute", "active", 0);

	SetSceneItem("D_te01", "attribute", "active", 0);
	SetSceneItem("D_te02", "attribute", "active", 0);
	SetSceneItem("D_te03", "attribute", "active", 0);
	SetSceneItem("D_te04", "attribute", "active", 0);
	SetSceneItem("D_te05", "attribute", "active", 0);
	SetSceneItem("D_te06", "attribute", "active", 0);
	SetSceneItem("D_te07", "attribute", "active", 0);
	SetSceneItem("D_te08", "attribute", "active", 0);
	SetSceneItem("D_te09", "attribute", "active", 0);
	SetSceneItem("D_te10", "attribute", "active", 0);
	SetSceneItem("D_te11", "attribute", "active", 0);
	SetSceneItem("D_te12", "attribute", "active", 0);
	SetSceneItem("D_te13", "attribute", "active", 0);
	SetSceneItem("D_te14", "attribute", "active", 0);
	SetSceneItem("D_te15", "attribute", "active", 0);
	SetSceneItem("D_te16", "attribute", "active", 0);
	SetSceneItem("D_te17", "attribute", "active", 0);
	SetSceneItem("D_te18", "attribute", "active", 0);
	SetSceneItem("D_te19", "attribute", "active", 0);
	SetSceneItem("D_te20", "attribute", "active", 0);
	SetSceneItem("D_te21", "attribute", "active", 0);
	SetSceneItem("D_te22", "attribute", "active", 0);
	SetSceneItem("D_te23", "attribute", "active", 0);
	SetSceneItem("D_te24", "attribute", "active", 0);
	SetSceneItem("D_te25", "attribute", "active", 0);
	SetSceneItem("D_te26", "attribute", "active", 0);
	SetSceneItem("D_te27", "attribute", "active", 0);
	SetSceneItem("D_te28", "attribute", "active", 0);
	SetSceneItem("D_te29", "attribute", "active", 0);
	SetSceneItem("D_te30", "attribute", "active", 0);
	SetSceneItem("D_te31", "attribute", "active", 0);
	SetSceneItem("D_te32", "attribute", "active", 0);
	SetSceneItem("D_te33", "attribute", "active", 0);
	SetSceneItem("D_te34", "attribute", "active", 0);
	SetSceneItem("D_te35", "attribute", "active", 0);
	SetSceneItem("D_te36", "attribute", "active", 0);
	SetSceneItem("D_te37", "attribute", "active", 0);
	SetSceneItem("D_te38", "attribute", "active", 0);
	SetSceneItem("D_te39", "attribute", "active", 0);
	SetSceneItem("D_te40", "attribute", "active", 0);
	SetSceneItem("D_te41", "attribute", "active", 0);
	SetSceneItem("D_te42", "attribute", "active", 0);
	SetSceneItem("D_te43", "attribute", "active", 0);

	SetSceneItem("D_tpEC14", "attribute", "active", 1);
	SetSceneItem("D_tpEC15", "attribute", "active", 1);

	SetSceneItem("D_tw01", "attribute", "active", 1);
	SetSceneItem("D_tw02", "attribute", "active", 1);
	SetSceneItem("D_tw03", "attribute", "active", 1);
	SetSceneItem("D_tw04", "attribute", "active", 1);
	SetSceneItem("D_tw05", "attribute", "active", 1);
	SetSceneItem("D_tw06", "attribute", "active", 1);
	SetSceneItem("D_tw07", "attribute", "active", 1);
	SetSceneItem("D_tw08", "attribute", "active", 1);
	SetSceneItem("D_tw09", "attribute", "active", 1);
	SetSceneItem("D_tw10", "attribute", "active", 1);
	SetSceneItem("D_tw11", "attribute", "active", 1);
	SetSceneItem("D_tw12", "attribute", "active", 1);
	SetSceneItem("D_tw13", "attribute", "active", 1);
	SetSceneItem("D_tw14", "attribute", "active", 1);
	SetSceneItem("D_tw15", "attribute", "active", 1);
	SetSceneItem("D_tw16", "attribute", "active", 1);
	SetSceneItem("D_tw17", "attribute", "active", 1);
	SetSceneItem("D_tw18", "attribute", "active", 1);
	SetSceneItem("D_tw19", "attribute", "active", 1);
	SetSceneItem("D_tw20", "attribute", "active", 1);
	SetSceneItem("D_tw21", "attribute", "active", 1);
	SetSceneItem("D_tw22", "attribute", "active", 1);
	SetSceneItem("D_tw23", "attribute", "active", 1);
	SetSceneItem("D_tw24", "attribute", "active", 1);
	SetSceneItem("D_tw25", "attribute", "active", 1);
	SetSceneItem("D_tw26", "attribute", "active", 1);
	SetSceneItem("D_tw27", "attribute", "active", 1);
	SetSceneItem("D_tw28", "attribute", "active", 1);
	SetSceneItem("D_tw29", "attribute", "active", 1);
	SetSceneItem("D_tw30", "attribute", "active", 1);
	SetSceneItem("D_tw31", "attribute", "active", 1);
	SetSceneItem("D_tw32", "attribute", "active", 1);
	SetSceneItem("D_tw33", "attribute", "active", 1);
	SetSceneItem("D_tw34", "attribute", "active", 1);
	SetSceneItem("D_tw35", "attribute", "active", 1);
	SetSceneItem("D_tw36", "attribute", "active", 1);
	SetSceneItem("D_tw37", "attribute", "active", 1);
	SetSceneItem("D_tw38", "attribute", "active", 1);
	SetSceneItem("D_tw39", "attribute", "active", 1);
	SetSceneItem("D_tw40", "attribute", "active", 1);
	SetSceneItem("D_tw41", "attribute", "active", 1);
	SetSceneItem("D_tw42", "attribute", "active", 1);
	SetSceneItem("D_tw43", "attribute", "active", 1);
	SetSceneItem("D_tw44", "attribute", "active", 1);
	SetSceneItem("D_tw45", "attribute", "active", 1);
	SetSceneItem("D_tw46", "attribute", "active", 1);
	SetSceneItem("D_tw47", "attribute", "active", 1);
	SetSceneItem("D_tw48", "attribute", "active", 1);
	SetSceneItem("D_tw49", "attribute", "active", 1);
	SetSceneItem("D_tw50", "attribute", "active", 1);
	SetSceneItem("D_tw51", "attribute", "active", 1);
	SetSceneItem("D_tw52", "attribute", "active", 1);
	SetSceneItem("D_tw53", "attribute", "active", 1);
	SetSceneItem("D_tw54", "attribute", "active", 1);
	SetSceneItem("D_tw55", "attribute", "active", 1);

	SetSceneItem("D_td230", "attribute", "active", 1);

	SetSceneItem("D_tz04", "attribute", "active", 1);

       SetSceneItem("D_td170", "attribute", "active", 1);
       SetSceneItem("D_td171", "attribute", "active", 1);
       SetSceneItem("D_td172", "attribute", "active", 1);
       SetSceneItem("D_td173", "attribute", "active", 1);
       SetSceneItem("D_td174", "attribute", "active", 1);
       SetSceneItem("D_td175", "attribute", "active", 1);
       SetSceneItem("D_td176", "attribute", "active", 1);
       SetSceneItem("D_td177", "attribute", "active", 1);
       SetSceneItem("D_td178", "attribute", "active", 1);
       SetSceneItem("D_td179", "attribute", "active", 1);
       SetSceneItem("D_td180", "attribute", "active", 1);
       SetSceneItem("D_td181", "attribute", "active", 1);
       SetSceneItem("D_td182", "attribute", "active", 1);
       SetSceneItem("D_td183", "attribute", "active", 1);
       SetSceneItem("D_td184", "attribute", "active", 1);
       SetSceneItem("D_td185", "attribute", "active", 1);
       SetSceneItem("D_td186", "attribute", "active", 1);
       SetSceneItem("D_td187", "attribute", "active", 1);
       SetSceneItem("D_td188", "attribute", "active", 1);
       SetSceneItem("D_td189", "attribute", "active", 1);
       SetSceneItem("D_td190", "attribute", "active", 1);
       SetSceneItem("D_td191", "attribute", "active", 1);
       SetSceneItem("D_td192", "attribute", "active", 1);
       SetSceneItem("D_td193", "attribute", "active", 1);
       SetSceneItem("D_td194", "attribute", "active", 1);
       SetSceneItem("D_td195", "attribute", "active", 1);
       SetSceneItem("D_td196", "attribute", "active", 1);
       SetSceneItem("D_td197", "attribute", "active", 1);
       SetSceneItem("D_td198", "attribute", "active", 1);
       SetSceneItem("D_td199", "attribute", "active", 1);
       SetSceneItem("D_td200", "attribute", "active", 1);
       SetSceneItem("D_td201", "attribute", "active", 1);
       SetSceneItem("D_td202", "attribute", "active", 1);
       SetSceneItem("D_td203", "attribute", "active", 1);
       SetSceneItem("D_td204", "attribute", "active", 1);
       SetSceneItem("D_td205", "attribute", "active", 1);
       SetSceneItem("D_td206", "attribute", "active", 1);
       SetSceneItem("D_td207", "attribute", "active", 1);
       SetSceneItem("D_td208", "attribute", "active", 1);
       SetSceneItem("D_td209", "attribute", "active", 1);
       SetSceneItem("D_td210", "attribute", "active", 1);
       SetSceneItem("D_td211", "attribute", "active", 1);
       SetSceneItem("D_td212", "attribute", "active", 1);
       SetSceneItem("D_td213", "attribute", "active", 1);
       SetSceneItem("D_td214", "attribute", "active", 1);
       SetSceneItem("D_td215", "attribute", "active", 1);
       SetSceneItem("D_td216", "attribute", "active", 1);
       SetSceneItem("D_td217", "attribute", "active", 1);
       SetSceneItem("D_td218", "attribute", "active", 1);
       SetSceneItem("D_td219", "attribute", "active", 1);
       SetSceneItem("D_td220", "attribute", "active", 1);
       SetSceneItem("D_td221", "attribute", "active", 1);
       SetSceneItem("D_td222", "attribute", "active", 1);
       SetSceneItem("D_td223", "attribute", "active", 1);
       SetSceneItem("D_td224", "attribute", "active", 1);
       SetSceneItem("D_td225", "attribute", "active", 1);
       SetSceneItem("D_td226", "attribute", "active", 1);
       SetSceneItem("D_td227", "attribute", "active", 1);
       SetSceneItem("D_td228", "attribute", "active", 1);
       SetSceneItem("D_td229", "attribute", "active", 1);  
}
D_tz04_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_tpEC14", "attribute", "active", 0);
	SetSceneItem("D_tpEC15", "attribute", "active", 0);

	SetSceneItem("D_tz04", "attribute", "active", 0);

	SetSceneItem("D_td230", "attribute", "active", 0);

       SetSceneItem("D_td170", "attribute", "active", 0);
       SetSceneItem("D_td171", "attribute", "active", 0);
       SetSceneItem("D_td172", "attribute", "active", 0);
       SetSceneItem("D_td173", "attribute", "active", 0);
       SetSceneItem("D_td174", "attribute", "active", 0);
       SetSceneItem("D_td175", "attribute", "active", 0);
       SetSceneItem("D_td176", "attribute", "active", 0);
       SetSceneItem("D_td177", "attribute", "active", 0);
       SetSceneItem("D_td178", "attribute", "active", 0);
       SetSceneItem("D_td179", "attribute", "active", 0);
       SetSceneItem("D_td180", "attribute", "active", 0);
       SetSceneItem("D_td181", "attribute", "active", 0);
       SetSceneItem("D_td182", "attribute", "active", 0);
       SetSceneItem("D_td183", "attribute", "active", 0);
       SetSceneItem("D_td184", "attribute", "active", 0);
       SetSceneItem("D_td185", "attribute", "active", 0);
       SetSceneItem("D_td186", "attribute", "active", 0);
       SetSceneItem("D_td187", "attribute", "active", 0);
       SetSceneItem("D_td188", "attribute", "active", 0);
       SetSceneItem("D_td189", "attribute", "active", 0);
       SetSceneItem("D_td190", "attribute", "active", 0);
       SetSceneItem("D_td191", "attribute", "active", 0);
       SetSceneItem("D_td192", "attribute", "active", 0);
       SetSceneItem("D_td193", "attribute", "active", 0);
       SetSceneItem("D_td194", "attribute", "active", 0);
       SetSceneItem("D_td195", "attribute", "active", 0);
       SetSceneItem("D_td196", "attribute", "active", 0);
       SetSceneItem("D_td197", "attribute", "active", 0);
       SetSceneItem("D_td198", "attribute", "active", 0);
       SetSceneItem("D_td199", "attribute", "active", 0);
       SetSceneItem("D_td200", "attribute", "active", 0);
       SetSceneItem("D_td201", "attribute", "active", 0);
       SetSceneItem("D_td202", "attribute", "active", 0);
       SetSceneItem("D_td203", "attribute", "active", 0);
       SetSceneItem("D_td204", "attribute", "active", 0);
       SetSceneItem("D_td205", "attribute", "active", 0);
       SetSceneItem("D_td206", "attribute", "active", 0);
       SetSceneItem("D_td207", "attribute", "active", 0);
       SetSceneItem("D_td208", "attribute", "active", 0);
       SetSceneItem("D_td209", "attribute", "active", 0);
       SetSceneItem("D_td210", "attribute", "active", 0);
       SetSceneItem("D_td211", "attribute", "active", 0);
       SetSceneItem("D_td212", "attribute", "active", 0);
       SetSceneItem("D_td213", "attribute", "active", 0);
       SetSceneItem("D_td214", "attribute", "active", 0);
       SetSceneItem("D_td215", "attribute", "active", 0);
       SetSceneItem("D_td216", "attribute", "active", 0);
       SetSceneItem("D_td217", "attribute", "active", 0);
       SetSceneItem("D_td218", "attribute", "active", 0);
       SetSceneItem("D_td219", "attribute", "active", 0);
       SetSceneItem("D_td220", "attribute", "active", 0);
       SetSceneItem("D_td221", "attribute", "active", 0);
       SetSceneItem("D_td222", "attribute", "active", 0);
       SetSceneItem("D_td223", "attribute", "active", 0);
       SetSceneItem("D_td224", "attribute", "active", 0);
       SetSceneItem("D_td225", "attribute", "active", 0);
       SetSceneItem("D_td226", "attribute", "active", 0);
       SetSceneItem("D_td227", "attribute", "active", 0);
       SetSceneItem("D_td228", "attribute", "active", 0);
       SetSceneItem("D_td229", "attribute", "active", 0); 

	SetSceneItem("D_tpEC16", "attribute", "active", 1);
	SetSceneItem("D_tpEC17", "attribute", "active", 1);

	SetSceneItem("D_tz08", "attribute", "active", 1);
	SetSceneItem("D_tz09", "attribute", "active", 1);

	SetSceneItem("D_tz05", "attribute", "active", 1);

	SetSceneItem("D_dm24", "attribute", "active", 1);
	SetSceneItem("D_dm25", "attribute", "active", 1);
	SetSceneItem("D_dm26", "attribute", "active", 1);
	SetSceneItem("D_dm27", "attribute", "active", 1);

	SetSceneItem("D_td232", "attribute", "active", 1);
	SetSceneItem("D_td233", "attribute", "active", 1);
	SetSceneItem("D_td234", "attribute", "active", 1);
	SetSceneItem("D_td235", "attribute", "active", 1);
	SetSceneItem("D_td236", "attribute", "active", 1);
	SetSceneItem("D_td237", "attribute", "active", 1);
	SetSceneItem("D_td238", "attribute", "active", 1);
	SetSceneItem("D_td239", "attribute", "active", 1);
	SetSceneItem("D_td240", "attribute", "active", 1);
	SetSceneItem("D_td241", "attribute", "active", 1);
	SetSceneItem("D_td242", "attribute", "active", 1);
	SetSceneItem("D_td243", "attribute", "active", 1);
	SetSceneItem("D_td244", "attribute", "active", 1);
	SetSceneItem("D_td245", "attribute", "active", 1);
	SetSceneItem("D_td246", "attribute", "active", 1);
	SetSceneItem("D_td247", "attribute", "active", 1);
	SetSceneItem("D_td248", "attribute", "active", 1);

	SetSceneItem("D_td233", "pose", 1, 1);
	SetSceneItem("D_td235", "pose", 1, 1);
	SetSceneItem("D_td237", "pose", 1, 1);
	SetSceneItem("D_td238", "pose", 1, 1);
	SetSceneItem("D_td240", "pose", 1, 1);
	SetSceneItem("D_td241", "pose", 1, 1);
	SetSceneItem("D_td243", "pose", 1, 1);
	SetSceneItem("D_td245", "pose", 1, 1);
	SetSceneItem("D_td246", "pose", 1, 1);
	SetSceneItem("D_td247", "pose", 1, 1);

	CreateEffect("D_dm24", "FuTi-UP", 1);
       SetSceneItem("D_dm24", "pose", 1, 1);
	SetSceneItem("D_dm24", "frame", 80);

       SetSceneItem("D_dm25", "pose", 1, 1);
	SetSceneItem("D_dm25", "frame", 60);

       SetSceneItem("D_dm26", "pose", 1, 1);
	SetSceneItem("D_dm26", "frame", 40);

       SetSceneItem("D_dm27", "pose", 1, 1);
	SetSceneItem("D_dm27", "frame", 20);

	SetSceneItem("D_dm28", "attribute", "active", 1);
	SetSceneItem("D_dm29", "attribute", "active", 1);
	SetSceneItem("D_dm30", "attribute", "active", 1);
	SetSceneItem("D_dm31", "attribute", "active", 1);
	SetSceneItem("D_dm32", "attribute", "active", 1);
	SetSceneItem("D_dm33", "attribute", "active", 1);
	SetSceneItem("D_dm34", "attribute", "active", 1);
	SetSceneItem("D_dm35", "attribute", "active", 1);
	SetSceneItem("D_dm36", "attribute", "active", 1);
	SetSceneItem("D_dm37", "attribute", "active", 1);
	SetSceneItem("D_dm38", "attribute", "active", 1);
	SetSceneItem("D_dm39", "attribute", "active", 1);
	SetSceneItem("D_dm40", "attribute", "active", 1);
	SetSceneItem("D_dm41", "attribute", "active", 1);
	SetSceneItem("D_dm42", "attribute", "active", 1);
	SetSceneItem("D_dm43", "attribute", "active", 1);
	SetSceneItem("D_dm44", "attribute", "active", 1);
	SetSceneItem("D_dm45", "attribute", "active", 1);
	SetSceneItem("D_dm46", "attribute", "active", 1);
	SetSceneItem("D_dm47", "attribute", "active", 1);
	SetSceneItem("D_dm48", "attribute", "active", 1);
	SetSceneItem("D_dm49", "attribute", "active", 1);
	SetSceneItem("D_dm50", "attribute", "active", 1);
	SetSceneItem("D_dm51", "attribute", "active", 1);
	SetSceneItem("D_dm52", "attribute", "active", 1);
	SetSceneItem("D_dm53", "attribute", "active", 1);
	SetSceneItem("D_dm54", "attribute", "active", 1);
	SetSceneItem("D_dm55", "attribute", "active", 1);
	SetSceneItem("D_dm56", "attribute", "active", 1);
	SetSceneItem("D_dm57", "attribute", "active", 1);
	SetSceneItem("D_dm58", "attribute", "active", 1);
	SetSceneItem("D_dm59", "attribute", "active", 1);
	SetSceneItem("D_dm60", "attribute", "active", 1);
	SetSceneItem("D_dm61", "attribute", "active", 1);
	SetSceneItem("D_dm62", "attribute", "active", 1);
	SetSceneItem("D_dm63", "attribute", "active", 1);
	SetSceneItem("D_dm64", "attribute", "active", 1);
	SetSceneItem("D_dm65", "attribute", "active", 1);
	SetSceneItem("D_dm66", "attribute", "active", 1);
	SetSceneItem("D_dm67", "attribute", "active", 1);
	SetSceneItem("D_dm68", "attribute", "active", 1);
	SetSceneItem("D_dm69", "attribute", "active", 1);
	SetSceneItem("D_dm70", "attribute", "active", 1);
	SetSceneItem("D_dm71", "attribute", "active", 1);
	SetSceneItem("D_dm72", "attribute", "active", 1);
	SetSceneItem("D_dm73", "attribute", "active", 1);
	SetSceneItem("D_dm74", "attribute", "active", 1);
	SetSceneItem("D_dm75", "attribute", "active", 1);
	SetSceneItem("D_dm76", "attribute", "active", 1);
	SetSceneItem("D_dm77", "attribute", "active", 1);
	SetSceneItem("D_dm78", "attribute", "active", 1);
	SetSceneItem("D_dm79", "attribute", "active", 1);
	SetSceneItem("D_dm80", "attribute", "active", 1);
	SetSceneItem("D_dm81", "attribute", "active", 1);
	SetSceneItem("D_dm82", "attribute", "active", 1);
	SetSceneItem("D_dm83", "attribute", "active", 1);
	SetSceneItem("D_dm84", "attribute", "active", 1);
	SetSceneItem("D_dm85", "attribute", "active", 1);
	SetSceneItem("D_dm86", "attribute", "active", 1);
	SetSceneItem("D_dm87", "attribute", "active", 1);
	SetSceneItem("D_dm88", "attribute", "active", 1);
	SetSceneItem("D_dm89", "attribute", "active", 1);
	SetSceneItem("D_dm90", "attribute", "active", 1);
	SetSceneItem("D_dm91", "attribute", "active", 1);
	SetSceneItem("D_dm92", "attribute", "active", 1);
	SetSceneItem("D_dm93", "attribute", "active", 1);
	SetSceneItem("D_dm94", "attribute", "active", 1);
	SetSceneItem("D_dm95", "attribute", "active", 1);
	SetSceneItem("D_dm96", "attribute", "active", 1);
	SetSceneItem("D_dm97", "attribute", "active", 1);
	SetSceneItem("D_dm98", "attribute", "active", 1);
	SetSceneItem("D_dm99", "attribute", "active", 1);
	SetSceneItem("D_dm100", "attribute", "active", 1);
	SetSceneItem("D_dm101", "attribute", "active", 1);
	SetSceneItem("D_dm102", "attribute", "active", 1);
	SetSceneItem("D_dm103", "attribute", "active", 1);
	SetSceneItem("D_dm104", "attribute", "active", 1);
	SetSceneItem("D_dm105", "attribute", "active", 1);
	SetSceneItem("D_dm106", "attribute", "active", 1);
	SetSceneItem("D_dm107", "attribute", "active", 1);
	SetSceneItem("D_dm108", "attribute", "active", 1);
	SetSceneItem("D_dm109", "attribute", "active", 1);
	SetSceneItem("D_dm110", "attribute", "active", 1);
	SetSceneItem("D_dm111", "attribute", "active", 1);
	SetSceneItem("D_dm112", "attribute", "active", 1);
	SetSceneItem("D_dm113", "attribute", "active", 1);
	SetSceneItem("D_dm114", "attribute", "active", 1);
	SetSceneItem("D_dm115", "attribute", "active", 1);
	SetSceneItem("D_dm116", "attribute", "active", 1);
	SetSceneItem("D_dm117", "attribute", "active", 1);
	SetSceneItem("D_dm118", "attribute", "active", 1);
	SetSceneItem("D_dm119", "attribute", "active", 1);
	SetSceneItem("D_dm120", "attribute", "active", 1);
	SetSceneItem("D_dm121", "attribute", "active", 1);
	SetSceneItem("D_dm122", "attribute", "active", 1);
	SetSceneItem("D_dm123", "attribute", "active", 1);
}
D_tz05_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_tpEC16", "attribute", "active", 0);
	SetSceneItem("D_tpEC17", "attribute", "active", 0);
	SetSceneItem("D_tpEC18", "attribute", "active", 0);
	SetSceneItem("D_tpEC19", "attribute", "active", 0);
	SetSceneItem("D_tpEC20", "attribute", "active", 1);
	SetSceneItem("D_tpEC15", "attribute", "active", 1);

	SetSceneItem("D_G01", "attribute", "active", 1);
	SetSceneItem("D_G02", "attribute", "active", 1);
	SetSceneItem("D_G03", "attribute", "active", 1);
	SetSceneItem("D_G04", "attribute", "active", 1);
	SetSceneItem("D_G05", "attribute", "active", 1);
	SetSceneItem("D_G06", "attribute", "active", 1);
	SetSceneItem("D_G07", "attribute", "active", 1);
	SetSceneItem("D_G08", "attribute", "active", 1);
	SetSceneItem("D_G09", "attribute", "active", 1);
	SetSceneItem("D_G10", "attribute", "active", 1);
	SetSceneItem("D_G11", "attribute", "active", 1);
	SetSceneItem("D_G12", "attribute", "active", 1);
	SetSceneItem("D_G13", "attribute", "active", 1);
	SetSceneItem("D_G14", "attribute", "active", 1);

	SetSceneItem("D_A01", "attribute", "active", 1);
	SetSceneItem("D_A02", "attribute", "active", 1);
	SetSceneItem("D_A03", "attribute", "active", 1);
	SetSceneItem("D_A04", "attribute", "active", 1);
	SetSceneItem("D_A05", "attribute", "active", 1);
	SetSceneItem("D_A06", "attribute", "active", 1);
	SetSceneItem("D_A07", "attribute", "active", 1);
	SetSceneItem("D_A08", "attribute", "active", 1);
	SetSceneItem("D_A09", "attribute", "active", 1);
	SetSceneItem("D_A10", "attribute", "active", 1);
	SetSceneItem("D_A11", "attribute", "active", 1);
	SetSceneItem("D_A12", "attribute", "active", 1);
	SetSceneItem("D_A13", "attribute", "active", 1);
	SetSceneItem("D_A14", "attribute", "active", 1);
	SetSceneItem("D_A15", "attribute", "active", 1);
	SetSceneItem("D_A16", "attribute", "active", 1);
	SetSceneItem("D_A17", "attribute", "active", 1);
	SetSceneItem("D_A18", "attribute", "active", 1);
	SetSceneItem("D_A19", "attribute", "active", 1);
	SetSceneItem("D_A20", "attribute", "active", 1);
	SetSceneItem("D_A21", "attribute", "active", 1);
	SetSceneItem("D_A22", "attribute", "active", 1);
	SetSceneItem("D_A23", "attribute", "active", 1);
	SetSceneItem("D_A24", "attribute", "active", 1);
	SetSceneItem("D_A25", "attribute", "active", 1);
	SetSceneItem("D_A26", "attribute", "active", 1);
	SetSceneItem("D_A27", "attribute", "active", 1);
	SetSceneItem("D_A28", "attribute", "active", 1);
	SetSceneItem("D_A29", "attribute", "active", 1);
	SetSceneItem("D_A30", "attribute", "active", 1);
	SetSceneItem("D_A31", "attribute", "active", 1);
	SetSceneItem("D_A32", "attribute", "active", 1);
	SetSceneItem("D_A33", "attribute", "active", 1);
	SetSceneItem("D_A34", "attribute", "active", 1);

	SetSceneItem("D_tz06", "attribute", "active", 1);

	SetSceneItem("D_tz08", "attribute", "active", 0);
	SetSceneItem("D_tz09", "attribute", "active", 0);

	SetSceneItem("D_tz05", "attribute", "active", 0);

	SetSceneItem("D_dm24", "attribute", "active", 0);
	SetSceneItem("D_dm25", "attribute", "active", 0);
	SetSceneItem("D_dm26", "attribute", "active", 0);
	SetSceneItem("D_dm27", "attribute", "active", 0);

	SetSceneItem("D_td232", "attribute", "active", 0);
	SetSceneItem("D_td233", "attribute", "active", 0);
	SetSceneItem("D_td234", "attribute", "active", 0);
	SetSceneItem("D_td235", "attribute", "active", 0);
	SetSceneItem("D_td236", "attribute", "active", 0);
	SetSceneItem("D_td237", "attribute", "active", 0);
	SetSceneItem("D_td238", "attribute", "active", 0);
	SetSceneItem("D_td239", "attribute", "active", 0);
	SetSceneItem("D_td240", "attribute", "active", 0);
	SetSceneItem("D_td241", "attribute", "active", 0);
	SetSceneItem("D_td242", "attribute", "active", 0);
	SetSceneItem("D_td243", "attribute", "active", 0);
	SetSceneItem("D_td244", "attribute", "active", 0);
	SetSceneItem("D_td245", "attribute", "active", 0);
	SetSceneItem("D_td246", "attribute", "active", 0);
	SetSceneItem("D_td247", "attribute", "active", 0);
	SetSceneItem("D_td248", "attribute", "active", 0);

	SetSceneItem("D_dm28", "attribute", "active", 0);
	SetSceneItem("D_dm29", "attribute", "active", 0);
	SetSceneItem("D_dm30", "attribute", "active", 0);
	SetSceneItem("D_dm31", "attribute", "active", 0);
	SetSceneItem("D_dm32", "attribute", "active", 0);
	SetSceneItem("D_dm33", "attribute", "active", 0);
	SetSceneItem("D_dm34", "attribute", "active", 0);
	SetSceneItem("D_dm35", "attribute", "active", 0);
	SetSceneItem("D_dm36", "attribute", "active", 0);
	SetSceneItem("D_dm37", "attribute", "active", 0);
	SetSceneItem("D_dm38", "attribute", "active", 0);
	SetSceneItem("D_dm39", "attribute", "active", 0);
	SetSceneItem("D_dm40", "attribute", "active", 0);
	SetSceneItem("D_dm41", "attribute", "active", 0);
	SetSceneItem("D_dm42", "attribute", "active", 0);
	SetSceneItem("D_dm43", "attribute", "active", 0);
	SetSceneItem("D_dm44", "attribute", "active", 0);
	SetSceneItem("D_dm45", "attribute", "active", 0);
	SetSceneItem("D_dm46", "attribute", "active", 0);
	SetSceneItem("D_dm47", "attribute", "active", 0);
	SetSceneItem("D_dm48", "attribute", "active", 0);
	SetSceneItem("D_dm49", "attribute", "active", 0);
	SetSceneItem("D_dm50", "attribute", "active", 0);
	SetSceneItem("D_dm51", "attribute", "active", 0);
	SetSceneItem("D_dm52", "attribute", "active", 0);
	SetSceneItem("D_dm53", "attribute", "active", 0);
	SetSceneItem("D_dm54", "attribute", "active", 0);
	SetSceneItem("D_dm55", "attribute", "active", 0);
	SetSceneItem("D_dm56", "attribute", "active", 0);
	SetSceneItem("D_dm57", "attribute", "active", 0);
	SetSceneItem("D_dm58", "attribute", "active", 0);
	SetSceneItem("D_dm59", "attribute", "active", 0);
	SetSceneItem("D_dm60", "attribute", "active", 0);
	SetSceneItem("D_dm61", "attribute", "active", 0);
	SetSceneItem("D_dm62", "attribute", "active", 0);
	SetSceneItem("D_dm63", "attribute", "active", 0);
	SetSceneItem("D_dm64", "attribute", "active", 0);
	SetSceneItem("D_dm65", "attribute", "active", 0);
	SetSceneItem("D_dm66", "attribute", "active", 0);
	SetSceneItem("D_dm67", "attribute", "active", 0);
	SetSceneItem("D_dm68", "attribute", "active", 0);
	SetSceneItem("D_dm69", "attribute", "active", 0);
	SetSceneItem("D_dm70", "attribute", "active", 0);
	SetSceneItem("D_dm71", "attribute", "active", 0);
	SetSceneItem("D_dm72", "attribute", "active", 0);
	SetSceneItem("D_dm73", "attribute", "active", 0);
	SetSceneItem("D_dm74", "attribute", "active", 0);
	SetSceneItem("D_dm75", "attribute", "active", 0);
	SetSceneItem("D_dm76", "attribute", "active", 0);
	SetSceneItem("D_dm77", "attribute", "active", 0);
	SetSceneItem("D_dm78", "attribute", "active", 0);
	SetSceneItem("D_dm79", "attribute", "active", 0);
	SetSceneItem("D_dm80", "attribute", "active", 0);
	SetSceneItem("D_dm81", "attribute", "active", 0);
	SetSceneItem("D_dm82", "attribute", "active", 0);
	SetSceneItem("D_dm83", "attribute", "active", 0);
	SetSceneItem("D_dm84", "attribute", "active", 0);
	SetSceneItem("D_dm85", "attribute", "active", 0);
	SetSceneItem("D_dm86", "attribute", "active", 0);
	SetSceneItem("D_dm87", "attribute", "active", 0);
	SetSceneItem("D_dm88", "attribute", "active", 0);
	SetSceneItem("D_dm89", "attribute", "active", 0);
	SetSceneItem("D_dm90", "attribute", "active", 0);
	SetSceneItem("D_dm91", "attribute", "active", 0);
	SetSceneItem("D_dm92", "attribute", "active", 0);
	SetSceneItem("D_dm93", "attribute", "active", 0);
	SetSceneItem("D_dm94", "attribute", "active", 0);
	SetSceneItem("D_dm95", "attribute", "active", 0);
	SetSceneItem("D_dm96", "attribute", "active", 0);
	SetSceneItem("D_dm97", "attribute", "active", 0);
	SetSceneItem("D_dm98", "attribute", "active", 0);
	SetSceneItem("D_dm99", "attribute", "active", 0);
	SetSceneItem("D_dm100", "attribute", "active", 0);
	SetSceneItem("D_dm101", "attribute", "active", 0);
	SetSceneItem("D_dm102", "attribute", "active", 0);
	SetSceneItem("D_dm103", "attribute", "active", 0);
	SetSceneItem("D_dm104", "attribute", "active", 0);
	SetSceneItem("D_dm105", "attribute", "active", 0);
	SetSceneItem("D_dm106", "attribute", "active", 0);
	SetSceneItem("D_dm107", "attribute", "active", 0);
	SetSceneItem("D_dm108", "attribute", "active", 0);
	SetSceneItem("D_dm109", "attribute", "active", 0);
	SetSceneItem("D_dm110", "attribute", "active", 0);
	SetSceneItem("D_dm111", "attribute", "active", 0);
	SetSceneItem("D_dm112", "attribute", "active", 0);
	SetSceneItem("D_dm113", "attribute", "active", 0);
	SetSceneItem("D_dm114", "attribute", "active", 0);
	SetSceneItem("D_dm115", "attribute", "active", 0);
	SetSceneItem("D_dm116", "attribute", "active", 0);
	SetSceneItem("D_dm117", "attribute", "active", 0);
	SetSceneItem("D_dm118", "attribute", "active", 0);
	SetSceneItem("D_dm119", "attribute", "active", 0);
	SetSceneItem("D_dm120", "attribute", "active", 0);
	SetSceneItem("D_dm121", "attribute", "active", 0);
	SetSceneItem("D_dm122", "attribute", "active", 0);
	SetSceneItem("D_dm123", "attribute", "active", 0);
}
D_tz06_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_tpEC20", "attribute", "active", 0);
	SetSceneItem("D_tpEC15", "attribute", "active", 0);

	SetSceneItem("D_tz06", "attribute", "active", 0);

	SetSceneItem("D_G01", "attribute", "active", 0);
	SetSceneItem("D_G02", "attribute", "active", 0);
	SetSceneItem("D_G03", "attribute", "active", 0);
	SetSceneItem("D_G04", "attribute", "active", 0);
	SetSceneItem("D_G05", "attribute", "active", 0);
	SetSceneItem("D_G06", "attribute", "active", 0);
	SetSceneItem("D_G07", "attribute", "active", 0);
	SetSceneItem("D_G08", "attribute", "active", 0);
	SetSceneItem("D_G09", "attribute", "active", 0);
	SetSceneItem("D_G10", "attribute", "active", 0);
	SetSceneItem("D_G11", "attribute", "active", 0);
	SetSceneItem("D_G12", "attribute", "active", 0);
	SetSceneItem("D_G13", "attribute", "active", 0);
	SetSceneItem("D_G14", "attribute", "active", 0);

	SetSceneItem("D_A01", "attribute", "active", 0);
	SetSceneItem("D_A02", "attribute", "active", 0);
	SetSceneItem("D_A03", "attribute", "active", 0);
	SetSceneItem("D_A04", "attribute", "active", 0);
	SetSceneItem("D_A05", "attribute", "active", 0);
	SetSceneItem("D_A06", "attribute", "active", 0);
	SetSceneItem("D_A07", "attribute", "active", 0);
	SetSceneItem("D_A08", "attribute", "active", 0);
	SetSceneItem("D_A09", "attribute", "active", 0);
	SetSceneItem("D_A10", "attribute", "active", 0);
	SetSceneItem("D_A11", "attribute", "active", 0);
	SetSceneItem("D_A12", "attribute", "active", 0);
	SetSceneItem("D_A13", "attribute", "active", 0);
	SetSceneItem("D_A14", "attribute", "active", 0);
	SetSceneItem("D_A15", "attribute", "active", 0);
	SetSceneItem("D_A16", "attribute", "active", 0);
	SetSceneItem("D_A17", "attribute", "active", 0);
	SetSceneItem("D_A18", "attribute", "active", 0);
	SetSceneItem("D_A19", "attribute", "active", 0);
	SetSceneItem("D_A20", "attribute", "active", 0);
	SetSceneItem("D_A21", "attribute", "active", 0);
	SetSceneItem("D_A22", "attribute", "active", 0);
	SetSceneItem("D_A23", "attribute", "active", 0);
	SetSceneItem("D_A24", "attribute", "active", 0);
	SetSceneItem("D_A25", "attribute", "active", 0);
	SetSceneItem("D_A26", "attribute", "active", 0);
	SetSceneItem("D_A27", "attribute", "active", 0);
	SetSceneItem("D_A28", "attribute", "active", 0);
	SetSceneItem("D_A29", "attribute", "active", 0);
	SetSceneItem("D_A30", "attribute", "active", 0);
	SetSceneItem("D_A31", "attribute", "active", 0);
	SetSceneItem("D_A32", "attribute", "active", 0);
	SetSceneItem("D_A33", "attribute", "active", 0);
	SetSceneItem("D_A34", "attribute", "active", 0);

	SetSceneItem("D_tpEC21", "attribute", "active", 1);
	SetSceneItem("D_tpEC24", "attribute", "active", 1);

	SetSceneItem("D_td121", "attribute", "active", 1);

	SetSceneItem("D_tz07", "attribute", "active", 1);
}
D_tz07_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_tpEC21", "attribute", "active", 0);
	SetSceneItem("D_td121", "attribute", "active", 0);

	SetSceneItem("D_tw01", "attribute", "active", 0);
	SetSceneItem("D_tw02", "attribute", "active", 0);
	SetSceneItem("D_tw03", "attribute", "active", 0);
	SetSceneItem("D_tw04", "attribute", "active", 0);
	SetSceneItem("D_tw05", "attribute", "active", 0);
	SetSceneItem("D_tw06", "attribute", "active", 0);
	SetSceneItem("D_tw07", "attribute", "active", 0);
	SetSceneItem("D_tw08", "attribute", "active", 0);
	SetSceneItem("D_tw09", "attribute", "active", 0);
	SetSceneItem("D_tw10", "attribute", "active", 0);
	SetSceneItem("D_tw11", "attribute", "active", 0);
	SetSceneItem("D_tw12", "attribute", "active", 0);
	SetSceneItem("D_tw13", "attribute", "active", 0);
	SetSceneItem("D_tw14", "attribute", "active", 0);
	SetSceneItem("D_tw15", "attribute", "active", 0);
	SetSceneItem("D_tw16", "attribute", "active", 0);
	SetSceneItem("D_tw17", "attribute", "active", 0);
	SetSceneItem("D_tw18", "attribute", "active", 0);
	SetSceneItem("D_tw19", "attribute", "active", 0);
	SetSceneItem("D_tw20", "attribute", "active", 0);
	SetSceneItem("D_tw21", "attribute", "active", 0);
	SetSceneItem("D_tw22", "attribute", "active", 0);
	SetSceneItem("D_tw23", "attribute", "active", 0);
	SetSceneItem("D_tw24", "attribute", "active", 0);
	SetSceneItem("D_tw25", "attribute", "active", 0);
	SetSceneItem("D_tw26", "attribute", "active", 0);
	SetSceneItem("D_tw27", "attribute", "active", 0);
	SetSceneItem("D_tw28", "attribute", "active", 0);
	SetSceneItem("D_tw29", "attribute", "active", 0);
	SetSceneItem("D_tw30", "attribute", "active", 0);
	SetSceneItem("D_tw31", "attribute", "active", 0);
	SetSceneItem("D_tw32", "attribute", "active", 0);
	SetSceneItem("D_tw33", "attribute", "active", 0);
	SetSceneItem("D_tw34", "attribute", "active", 0);
	SetSceneItem("D_tw35", "attribute", "active", 0);
	SetSceneItem("D_tw36", "attribute", "active", 0);
	SetSceneItem("D_tw37", "attribute", "active", 0);
	SetSceneItem("D_tw38", "attribute", "active", 0);
	SetSceneItem("D_tw39", "attribute", "active", 0);
	SetSceneItem("D_tw40", "attribute", "active", 0);
	SetSceneItem("D_tw41", "attribute", "active", 0);
	SetSceneItem("D_tw42", "attribute", "active", 0);
	SetSceneItem("D_tw43", "attribute", "active", 0);
	SetSceneItem("D_tw44", "attribute", "active", 0);
	SetSceneItem("D_tw45", "attribute", "active", 0);
	SetSceneItem("D_tw46", "attribute", "active", 0);
	SetSceneItem("D_tw47", "attribute", "active", 0);
	SetSceneItem("D_tw48", "attribute", "active", 0);
	SetSceneItem("D_tw49", "attribute", "active", 0);
	SetSceneItem("D_tw50", "attribute", "active", 0);
	SetSceneItem("D_tw51", "attribute", "active", 0);
	SetSceneItem("D_tw52", "attribute", "active", 0);
	SetSceneItem("D_tw53", "attribute", "active", 0);
	SetSceneItem("D_tw54", "attribute", "active", 0);
	SetSceneItem("D_tw55", "attribute", "active", 0);

	SetSceneItem("D_tz07", "attribute", "active", 0);

	SetSceneItem("D_twy01", "attribute", "active", 1);
	SetSceneItem("D_twy02", "attribute", "active", 1);
	SetSceneItem("D_twy03", "attribute", "active", 1);
	SetSceneItem("D_twy04", "attribute", "active", 1);
	SetSceneItem("D_twy05", "attribute", "active", 1);
	SetSceneItem("D_twy06", "attribute", "active", 1);
	SetSceneItem("D_twy07", "attribute", "active", 1);
	SetSceneItem("D_twy08", "attribute", "active", 1);
	SetSceneItem("D_twy09", "attribute", "active", 1);
	SetSceneItem("D_twy10", "attribute", "active", 1);
	SetSceneItem("D_twy11", "attribute", "active", 1);
	SetSceneItem("D_twy12", "attribute", "active", 1);
	SetSceneItem("D_twy13", "attribute", "active", 1);
	SetSceneItem("D_twy14", "attribute", "active", 1);
	SetSceneItem("D_twy15", "attribute", "active", 1);
	SetSceneItem("D_twy16", "attribute", "active", 1);
	SetSceneItem("D_twy17", "attribute", "active", 1);
	SetSceneItem("D_twy18", "attribute", "active", 1);
	SetSceneItem("D_twy19", "attribute", "active", 1);
	SetSceneItem("D_twy20", "attribute", "active", 1);
	SetSceneItem("D_twy21", "attribute", "active", 1);
	SetSceneItem("D_twy22", "attribute", "active", 1);
	SetSceneItem("D_twy23", "attribute", "active", 1);
	SetSceneItem("D_twy24", "attribute", "active", 1);
	SetSceneItem("D_twy25", "attribute", "active", 1);
	SetSceneItem("D_twy26", "attribute", "active", 1);
	SetSceneItem("D_twy27", "attribute", "active", 1);
	SetSceneItem("D_twy28", "attribute", "active", 1);
	SetSceneItem("D_twy29", "attribute", "active", 1);
	SetSceneItem("D_twy30", "attribute", "active", 1);
	SetSceneItem("D_twy31", "attribute", "active", 1);
	SetSceneItem("D_twy32", "attribute", "active", 1);
	SetSceneItem("D_twy33", "attribute", "active", 1);
	SetSceneItem("D_twy34", "attribute", "active", 1);
	SetSceneItem("D_twy35", "attribute", "active", 1);
	SetSceneItem("D_twy36", "attribute", "active", 1);
	SetSceneItem("D_twy37", "attribute", "active", 1);
	SetSceneItem("D_twy38", "attribute", "active", 1);
	SetSceneItem("D_twy39", "attribute", "active", 1);
	SetSceneItem("D_twy40", "attribute", "active", 1);
	SetSceneItem("D_twy41", "attribute", "active", 1);
	SetSceneItem("D_twy42", "attribute", "active", 1);
	SetSceneItem("D_twy43", "attribute", "active", 1);
	SetSceneItem("D_twy44", "attribute", "active", 1);
	SetSceneItem("D_twy45", "attribute", "active", 1);
	SetSceneItem("D_twy46", "attribute", "active", 1);
	SetSceneItem("D_twy47", "attribute", "active", 1);
	SetSceneItem("D_twy48", "attribute", "active", 1);
	SetSceneItem("D_twy49", "attribute", "active", 1);
	SetSceneItem("D_twy50", "attribute", "active", 1);
	SetSceneItem("D_twy51", "attribute", "active", 1);
	SetSceneItem("D_twy52", "attribute", "active", 1);
	SetSceneItem("D_twy53", "attribute", "active", 1);
	SetSceneItem("D_twy54", "attribute", "active", 1);
	SetSceneItem("D_twy55", "attribute", "active", 1);

	SetSceneItem("D_tpEC22", "attribute", "active", 1);

	SetSceneItem("D_U01", "attribute", "active", 1);
	SetSceneItem("D_U02", "attribute", "active", 1);
	SetSceneItem("D_U03", "attribute", "active", 1);
	SetSceneItem("D_U04", "attribute", "active", 1);
	SetSceneItem("D_U05", "attribute", "active", 1);
	SetSceneItem("D_U06", "attribute", "active", 1);
	SetSceneItem("D_U07", "attribute", "active", 1);
	SetSceneItem("D_U08", "attribute", "active", 1);
	SetSceneItem("D_U09", "attribute", "active", 1);
	SetSceneItem("D_U10", "attribute", "active", 1);
	SetSceneItem("D_U11", "attribute", "active", 1);
	SetSceneItem("D_U12", "attribute", "active", 1);
	SetSceneItem("D_U13", "attribute", "active", 1);
	SetSceneItem("D_U14", "attribute", "active", 1);
	SetSceneItem("D_U15", "attribute", "active", 1);
	SetSceneItem("D_U16", "attribute", "active", 1);
	SetSceneItem("D_U17", "attribute", "active", 1);
	SetSceneItem("D_U18", "attribute", "active", 1);
	SetSceneItem("D_U19", "attribute", "active", 1);

	SetSceneItem("D_M01", "attribute", "active", 1);
	SetSceneItem("D_M02", "attribute", "active", 1);
	SetSceneItem("D_M03", "attribute", "active", 1);
	SetSceneItem("D_M04", "attribute", "active", 1);
	SetSceneItem("D_M05", "attribute", "active", 1);
	SetSceneItem("D_M06", "attribute", "active", 1);
	SetSceneItem("D_M07", "attribute", "active", 1);
	SetSceneItem("D_M08", "attribute", "active", 1);
	SetSceneItem("D_M09", "attribute", "active", 1);
	SetSceneItem("D_M10", "attribute", "active", 1);
	SetSceneItem("D_M11", "attribute", "active", 1);
	SetSceneItem("D_M12", "attribute", "active", 1);
	SetSceneItem("D_M13", "attribute", "active", 1);
	SetSceneItem("D_M14", "attribute", "active", 1);
	SetSceneItem("D_M15", "attribute", "active", 1);
	SetSceneItem("D_M16", "attribute", "active", 1);
	SetSceneItem("D_M17", "attribute", "active", 1);
	SetSceneItem("D_M18", "attribute", "active", 1);
	SetSceneItem("D_M19", "attribute", "active", 1);
	SetSceneItem("D_M20", "attribute", "active", 1);
	SetSceneItem("D_M21", "attribute", "active", 1);
	SetSceneItem("D_M22", "attribute", "active", 1);
	SetSceneItem("D_M23", "attribute", "active", 1);
	SetSceneItem("D_M24", "attribute", "active", 1);
	SetSceneItem("D_M25", "attribute", "active", 1);
	SetSceneItem("D_M26", "attribute", "active", 1);
	SetSceneItem("D_M27", "attribute", "active", 1);
	SetSceneItem("D_M28", "attribute", "active", 1);
	SetSceneItem("D_M29", "attribute", "active", 1);
	SetSceneItem("D_M30", "attribute", "active", 1);
	SetSceneItem("D_M31", "attribute", "active", 1);
	SetSceneItem("D_M32", "attribute", "active", 1);
	SetSceneItem("D_M33", "attribute", "active", 1);
	SetSceneItem("D_M34", "attribute", "active", 1);
	SetSceneItem("D_M35", "attribute", "active", 1);
	SetSceneItem("D_M36", "attribute", "active", 1);
	SetSceneItem("D_M37", "attribute", "active", 1);
	SetSceneItem("D_M38", "attribute", "active", 1);
	SetSceneItem("D_M39", "attribute", "active", 1);

	SetSceneItem("D_MA01", "attribute", "active", 1);
	SetSceneItem("D_MA02", "attribute", "active", 1);
	SetSceneItem("D_MA03", "attribute", "active", 1);
	SetSceneItem("D_MA04", "attribute", "active", 1);
	SetSceneItem("D_MA05", "attribute", "active", 1);
	SetSceneItem("D_MA06", "attribute", "active", 1);
	SetSceneItem("D_MA07", "attribute", "active", 1);
	SetSceneItem("D_MA08", "attribute", "active", 1);
	SetSceneItem("D_MA09", "attribute", "active", 1);
	SetSceneItem("D_MA10", "attribute", "active", 1);
	SetSceneItem("D_MA11", "attribute", "active", 1);
	SetSceneItem("D_MA12", "attribute", "active", 1);
	SetSceneItem("D_MA13", "attribute", "active", 1);
	SetSceneItem("D_MA14", "attribute", "active", 1);
	SetSceneItem("D_MA15", "attribute", "active", 1);
	SetSceneItem("D_MA16", "attribute", "active", 1);
	SetSceneItem("D_MA17", "attribute", "active", 1);
	SetSceneItem("D_MA18", "attribute", "active", 1);
	SetSceneItem("D_MA19", "attribute", "active", 1);
	SetSceneItem("D_MA20", "attribute", "active", 1);
	SetSceneItem("D_MA21", "attribute", "active", 1);
	SetSceneItem("D_MA22", "attribute", "active", 1);
	SetSceneItem("D_MA23", "attribute", "active", 1);
	SetSceneItem("D_MA24", "attribute", "active", 1);
	SetSceneItem("D_MA25", "attribute", "active", 1);
	SetSceneItem("D_MA26", "attribute", "active", 1);

	SetSceneItem("D_YZ01", "attribute", "active", 1);
	SetSceneItem("D_YZ02", "attribute", "active", 1);
	SetSceneItem("D_YZ03", "attribute", "active", 1);
	SetSceneItem("D_YZ04", "attribute", "active", 1);
	SetSceneItem("D_YZ05", "attribute", "active", 1);
	SetSceneItem("D_YZ06", "attribute", "active", 1);
}
D_A06_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_A06", "attribute", "active", 0);
	SetSceneItem("D_A01", "pose", 1, 0);
}
D_A07_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_A07", "attribute", "active", 0);
	SetSceneItem("D_A02", "pose", 1, 0);
}
D_A08_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_A08", "attribute", "active", 0);
	SetSceneItem("D_A03", "pose", 1, 0);
}
D_A09_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_A09", "attribute", "active", 0);
	SetSceneItem("D_A04", "pose", 1, 0);
}
D_A10_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_A10", "attribute", "active", 0);
	SetSceneItem("D_A05", "pose", 1, 0);
}
D_tz08_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_tz08", "attribute", "active", 0);
	SetSceneItem("D_tpEC16", "attribute", "active", 0);
	SetSceneItem("D_tpEC17", "attribute", "active", 0);
	SetSceneItem("D_tpEC18", "attribute", "active", 1);
}
D_tz09_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_tz09", "attribute", "active", 0);
	SetSceneItem("D_tpEC16", "attribute", "active", 0);
	SetSceneItem("D_tpEC17", "attribute", "active", 0);
	SetSceneItem("D_tpEC18", "attribute", "active", 0);
	SetSceneItem("D_tpEC19", "attribute", "active", 1);
}
D_td74_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td74", "attribute", "active", 0);
	SetSceneItem("D_td75", "attribute", "active", 1);
}
D_td75_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td75", "attribute", "active", 0);
	SetSceneItem("D_td76", "attribute", "active", 1);
}
D_td76_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td76", "attribute", "active", 0);
	SetSceneItem("D_td77", "attribute", "active", 1);
}
D_td77_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td77", "attribute", "active", 0);
	SetSceneItem("D_td78", "attribute", "active", 1);
}
D_td78_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td78", "attribute", "active", 0);
	SetSceneItem("D_td79", "attribute", "active", 1);
}
D_td79_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td79", "attribute", "active", 0);
	SetSceneItem("D_td80", "attribute", "active", 1);
}
D_td80_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td80", "attribute", "active", 0);
	SetSceneItem("D_td81", "attribute", "active", 1);
}
D_td81_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td81", "attribute", "active", 0);
	SetSceneItem("D_td82", "attribute", "active", 1);
}
D_td82_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td82", "attribute", "active", 0);
	SetSceneItem("D_td83", "attribute", "active", 1);
}
D_td83_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td83", "attribute", "active", 0);
	SetSceneItem("D_td84", "attribute", "active", 1);
}
D_td84_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td84", "attribute", "active", 0);
	SetSceneItem("D_td85", "attribute", "active", 1);
}
D_td85_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td85", "attribute", "active", 0);
	SetSceneItem("D_td86", "attribute", "active", 1);
}
D_td86_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td86", "attribute", "active", 0);
	SetSceneItem("D_td87", "attribute", "active", 1);
}
D_td87_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td87", "attribute", "active", 0);
	SetSceneItem("D_td88", "attribute", "active", 1);
}
D_td88_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td88", "attribute", "active", 0);
	SetSceneItem("D_td89", "attribute", "active", 1);
}
D_td89_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td89", "attribute", "active", 0);
	SetSceneItem("D_td90", "attribute", "active", 1);
}
D_td90_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td90", "attribute", "active", 0);
	SetSceneItem("D_td91", "attribute", "active", 1);
}
D_td91_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td91", "attribute", "active", 0);
	SetSceneItem("D_td92", "attribute", "active", 1);
}
D_td92_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td92", "attribute", "active", 0);
	SetSceneItem("D_td93", "attribute", "active", 1);
}
D_td93_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td93", "attribute", "active", 0);
	SetSceneItem("D_td94", "attribute", "active", 1);
}
D_td94_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td94", "attribute", "active", 0);
	SetSceneItem("D_td95", "attribute", "active", 1);
}
D_td95_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td95", "attribute", "active", 0);
	SetSceneItem("D_td96", "attribute", "active", 1);
}
D_td96_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td96", "attribute", "active", 0);
	SetSceneItem("D_td97", "attribute", "active", 1);
}
D_td97_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td97", "attribute", "active", 0);
	SetSceneItem("D_td98", "attribute", "active", 1);
}
D_td98_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td98", "attribute", "active", 0);
	SetSceneItem("D_td99", "attribute", "active", 1);
}
D_td99_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td99", "attribute", "active", 0);
	SetSceneItem("D_td100", "attribute", "active", 1);
}
D_td100_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td100", "attribute", "active", 0);
	SetSceneItem("D_td101", "attribute", "active", 1);
}
D_td101_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td101", "attribute", "active", 0);
	SetSceneItem("D_td102", "attribute", "active", 1);
}
D_td102_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td102", "attribute", "active", 0);
	SetSceneItem("D_td103", "attribute", "active", 1);
}
D_td103_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td103", "attribute", "active", 0);
	SetSceneItem("D_td104", "attribute", "active", 1);
}
D_td104_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td104", "attribute", "active", 0);
	SetSceneItem("D_td105", "attribute", "active", 1);
}
D_td105_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td105", "attribute", "active", 0);
	SetSceneItem("D_td106", "attribute", "active", 1);
}
D_td106_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td106", "attribute", "active", 0);
	SetSceneItem("D_td107", "attribute", "active", 1);
}
D_td107_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td107", "attribute", "active", 0);
	SetSceneItem("D_td108", "attribute", "active", 1);
}
D_td108_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td108", "attribute", "active", 0);
	SetSceneItem("D_td109", "attribute", "active", 1);
}
D_td109_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td109", "attribute", "active", 0);
	SetSceneItem("D_td110", "attribute", "active", 1);
}
D_td110_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td110", "attribute", "active", 0);
	SetSceneItem("D_td111", "attribute", "active", 1);
}
D_td111_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td111", "attribute", "active", 0);
	SetSceneItem("D_td112", "attribute", "active", 1);
}
D_td112_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td112", "attribute", "active", 0);
	SetSceneItem("D_td113", "attribute", "active", 1);
}
D_td113_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td113", "attribute", "active", 0);
	SetSceneItem("D_td114", "attribute", "active", 1);
}
D_td114_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td114", "attribute", "active", 0);
	SetSceneItem("D_td115", "attribute", "active", 1);
}
D_td115_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td115", "attribute", "active", 0);
	SetSceneItem("D_td116", "attribute", "active", 1);
}
D_td116_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td116", "attribute", "active", 0);
	SetSceneItem("D_td117", "attribute", "active", 1);
}
D_td117_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td117", "attribute", "active", 0);
	SetSceneItem("D_td118", "attribute", "active", 1);
}
D_td118_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td118", "attribute", "active", 0);
	SetSceneItem("D_td119", "attribute", "active", 1);
}
D_td119_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td119", "attribute", "active", 0);
	SetSceneItem("D_td120", "attribute", "active", 1);
}
D_td120_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td121", "attribute", "active", 1);
}
D_td121_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td121", "attribute", "active", 0);
	SetSceneItem("D_td122", "attribute", "active", 1);
}
D_td122_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td122", "attribute", "active", 0);
	SetSceneItem("D_td123", "attribute", "active", 1);
}
D_td123_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td123", "attribute", "active", 0);
	SetSceneItem("D_td124", "attribute", "active", 1);
}
D_td124_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td124", "attribute", "active", 0);
	SetSceneItem("D_td125", "attribute", "active", 1);
}
D_td125_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td125", "attribute", "active", 0);
	SetSceneItem("D_td126", "attribute", "active", 1);
}
D_td126_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td126", "attribute", "active", 0);
	SetSceneItem("D_td127", "attribute", "active", 1);
}
D_td127_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td127", "attribute", "active", 0);
	SetSceneItem("D_td128", "attribute", "active", 1);
}
D_td128_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td128", "attribute", "active", 0);
	SetSceneItem("D_td129", "attribute", "active", 1);
}
D_td129_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td129", "attribute", "active", 0);
	SetSceneItem("D_td130", "attribute", "active", 1);
}
D_td130_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td130", "attribute", "active", 0);
	SetSceneItem("D_td131", "attribute", "active", 1);
}
D_td131_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td131", "attribute", "active", 0);
	SetSceneItem("D_td132", "attribute", "active", 1);
}
D_td132_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td132", "attribute", "active", 0);
	SetSceneItem("D_td133", "attribute", "active", 1);
}
D_td133_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td133", "attribute", "active", 0);
	SetSceneItem("D_td134", "attribute", "active", 1);
}
D_td134_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td134", "attribute", "active", 0);
	SetSceneItem("D_td135", "attribute", "active", 1);
}
D_td135_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td135", "attribute", "active", 0);
	SetSceneItem("D_td136", "attribute", "active", 1);
}
D_td136_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td136", "attribute", "active", 0);
	SetSceneItem("D_td137", "attribute", "active", 1);
}
D_td137_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td137", "attribute", "active", 0);
	SetSceneItem("D_td138", "attribute", "active", 1);
}
D_td138_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td138", "attribute", "active", 0);
	SetSceneItem("D_td139", "attribute", "active", 1);
}
D_td139_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td139", "attribute", "active", 0);
	SetSceneItem("D_td140", "attribute", "active", 1);
}
D_td140_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td140", "attribute", "active", 0);
	SetSceneItem("D_td141", "attribute", "active", 1);
}
D_td141_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td141", "attribute", "active", 0);
	SetSceneItem("D_td142", "attribute", "active", 1);
}
D_td142_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td142", "attribute", "active", 0);
	SetSceneItem("D_td143", "attribute", "active", 1);
}
D_td143_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td143", "attribute", "active", 0);
	SetSceneItem("D_td144", "attribute", "active", 1);
}
D_td144_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td144", "attribute", "active", 0);
	SetSceneItem("D_td145", "attribute", "active", 1);
}
D_td145_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td145", "attribute", "active", 0);
	SetSceneItem("D_td146", "attribute", "active", 1);
}
D_td146_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td146", "attribute", "active", 0);
	SetSceneItem("D_td147", "attribute", "active", 1);
}
D_td147_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td147", "attribute", "active", 0);
	SetSceneItem("D_td148", "attribute", "active", 1);
}
D_td148_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td148", "attribute", "active", 0);
	SetSceneItem("D_td149", "attribute", "active", 1);
}
D_td149_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td149", "attribute", "active", 0);
	SetSceneItem("D_td150", "attribute", "active", 1);
}
D_td150_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td150", "attribute", "active", 0);
	SetSceneItem("D_td151", "attribute", "active", 1);
}
D_td151_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td151", "attribute", "active", 0);
	SetSceneItem("D_td152", "attribute", "active", 1);
}
D_td152_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td152", "attribute", "active", 0);
	SetSceneItem("D_td153", "attribute", "active", 1);
}
D_td153_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td153", "attribute", "active", 0);
	SetSceneItem("D_td154", "attribute", "active", 1);
}
D_td154_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td154", "attribute", "active", 0);
	SetSceneItem("D_td155", "attribute", "active", 1);
}
D_td155_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td155", "attribute", "active", 0);
	SetSceneItem("D_td156", "attribute", "active", 1);
}
D_td156_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td156", "attribute", "active", 0);
	SetSceneItem("D_td157", "attribute", "active", 1);
}
D_td157_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td157", "attribute", "active", 0);
	SetSceneItem("D_td158", "attribute", "active", 1);
}
D_td158_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td158", "attribute", "active", 0);
	SetSceneItem("D_td159", "attribute", "active", 1);
}
D_td159_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td159", "attribute", "active", 0);
	SetSceneItem("D_td160", "attribute", "active", 1);
}
D_td160_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td160", "attribute", "active", 0);
	SetSceneItem("D_td161", "attribute", "active", 1);
}
D_td161_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td161", "attribute", "active", 0);
	SetSceneItem("D_td162", "attribute", "active", 1);
}
D_td162_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td162", "attribute", "active", 0);
	SetSceneItem("D_td163", "attribute", "active", 1);
}
D_td163_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td163", "attribute", "active", 0);
	SetSceneItem("D_td164", "attribute", "active", 1);
}
D_td164_OnAttack(int id, int character, int damage)
{
	SetSceneItem("D_td164", "attribute", "active", 0);
	SetSceneItem("D_td165", "attribute", "active", 1);
	SetSceneItem("D_td166", "attribute", "active", 1);
	SetSceneItem("D_td167", "attribute", "active", 1);
	SetSceneItem("D_td168", "attribute", "active", 1);
	SetSceneItem("D_td169", "attribute", "active", 1);
}
Scene_OnCharacterEvent(int id, int event)
{
	int i;
	int arena;
	int team;
	Output("Character:", id, "event:", event);
	
	if ( event==EventExit || event==EventDeath )
	{
		if ( GameMod==DeathMatch )
		{
			arena = g_CharacterArena[id];
			if ( arena!=-1 )
			{
				g_ArenaCharacters[arena] = g_ArenaCharacters[arena];
			}
			g_CharacterArena[id] = -1;
		}
		if ( GameMod==TeamDeathMatch )
		{
			arena = g_CharacterArena[id];
			team = GetTeam(id);
			if ( arena!=-1 )
			{
				if ( team==1 )
				{
					g_TeamAArenaCharacters[arena] = g_TeamAArenaCharacters[arena] - 1;
				}
				if ( team==2 )
				{
					g_TeamBArenaCharacters[arena] = g_TeamBArenaCharacters[arena] - 1;
				}
			}
			g_CharacterArena[id] = -1;
		}
	}		
}
TransferToArena(int characterid, int tpid)
{
	string arenaname;
	int arena = tpid/2;
	Output("arena characters", g_ArenaCharacters[arena]);
	if ( g_ArenaCharacters[arena]<99)
	{
		g_ArenaCharacters[arena]=g_ArenaCharacters[arena];
		g_CharacterArena[characterid] = arena;
		MakeString(arenaname, "D_tpED", tpid+1);
		Misc("transfer", characterid, arenaname);
		Output("transfer", characterid, "to", tpid);
	}
}
TransferFromArena(int characterid, int tpid)
{
	string arenaname;
	int arena = tpid/2;

	if ( g_ArenaCharacters[arena]<99)
	{
		g_ArenaCharacters[arena]=g_ArenaCharacters[arena];
		g_CharacterArena[characterid] = -1;
		MakeString(arenaname, "D_tpED", tpid+17);
		Misc("transfer", characterid, arenaname);
		Output("transfer", characterid, "from", tpid);
	}
}
D_tpEC01_OnTouch(int id, int characterid)
{
	Output("EC01 Touched");
	TransferToArena(characterid, 0);
}
D_tpEC02_OnTouch(int id, int characterid)
{
	Output("EC02 Touched");
	TransferToArena(characterid, 1);
}
D_tpEC03_OnTouch(int id, int characterid)
{
	Output("EC03 Touched");
	TransferToArena(characterid, 2);
}
D_tpEC04_OnTouch(int id, int characterid)
{
	Output("EC04 Touched");
	TransferToArena(characterid, 3);
}
D_tpEC05_OnTouch(int id, int characterid)
{
	Output("EC05 Touched");
	TransferToArena(characterid, 4);
}
D_tpEC06_OnTouch(int id, int characterid)
{
	Output("EC06 Touched");
	TransferToArena(characterid, 5);
}
D_tpEC07_OnTouch(int id, int characterid)
{
	Output("EC07 Touched");
	TransferToArena(characterid, 6);
}
D_tpEC08_OnTouch(int id, int characterid)
{
	Output("EC08 Touched");
	TransferToArena(characterid, 7);
}
D_tpEC09_OnTouch(int id, int characterid)
{
	Output("EC09 Touched");
	TransferToArena(characterid, 8);
}
D_tpEC10_OnTouch(int id, int characterid)
{
	Output("EC10 Touched");
	TransferToArena(characterid, 9);
}
D_tpEC11_OnTouch(int id, int characterid)
{
	Output("EC11 Touched");
	TransferToArena(characterid, 10);
}
D_tpEC12_OnTouch(int id, int characterid)
{
	Output("EC12 Touched");
	TransferToArena(characterid, 11);
}
D_tpEC13_OnTouch(int id, int characterid)
{
	Output("EC13 Touched");
	TransferToArena(characterid, 12);
}
D_tpEC14_OnTouch(int id, int characterid)
{
	Output("EC14 Touched");
	TransferToArena(characterid, 13);
}
D_tpEC15_OnTouch(int id, int characterid)
{
	Output("EC15 Touched");
	TransferToArena(characterid, 14);
}
D_tpEC16_OnTouch(int id, int characterid)
{
	Output("EC16 Touched");
	TransferToArena(characterid, 15);
}
D_tpEC17_OnTouch(int id, int characterid)
{
	Output("EC17 Touched");
	TransferToArena(characterid, 16);
}
D_tpEC18_OnTouch(int id, int characterid)
{
	Output("EC18 Touched");
	TransferToArena(characterid, 17);
}
D_tpEC19_OnTouch(int id, int characterid)
{
	Output("EC19 Touched");
	TransferToArena(characterid, 18);
}
D_tpEC20_OnTouch(int id, int characterid)
{
	Output("EC20 Touched");
	TransferToArena(characterid, 19);
}
D_tpEC21_OnTouch(int id, int characterid)
{
	Output("EC21 Touched");
	TransferToArena(characterid, 20);
}
D_tpEC22_OnTouch(int id, int characterid)
{
	Output("EC22 Touched");
	TransferToArena(characterid, 21);
}
D_tpEC23_OnTouch(int id, int characterid)
{
	Output("EC23 Touched");
	TransferToArena(characterid, 22);
}
D_tpEC24_OnTouch(int id, int characterid)
{
	Output("EC24 Touched");
	TransferToArena(characterid, 23);
}
D_tpEC25_OnTouch(int id, int characterid)
{
	Output("EC25 Touched");
	TransferToArena(characterid, 24);
}
D_tpEC26_OnTouch(int id, int characterid)
{
	Output("EC26 Touched");
	TransferToArena(characterid, 25);
}
D_tpEC27_OnTouch(int id, int characterid)
{
	Output("EC27 Touched");
	TransferToArena(characterid, 26);
}