class 1 royal_rush_area_controller : royal_rush_default_npc
{
parameter:
	string	AreaName = "";
	int	StatusEffect = 1184769;
	int	type = 0;

handler:
	EventHandler CREATED()
	{
		myself::Area_SetOnOff(AreaName,0);
		switch(type)
		{
			case 0:
			{
				myself::AddTimerEx(3001,( ( 1000 * 60 ) * 2 ));
				myself::Shout(myself::MakeFString(1010474,"","","","",""));
				break;
			}
			case 1:
			{
				myself::AddTimerEx(3001,( 1000 * 60 ));
				myself::Shout(myself::MakeFString(1010473,"","","","",""));
				break;
			}
			case 2:
			{
				myself::Area_SetOnOff(AreaName,1);
				myself::AddUseSkillDesire(myself.sm,StatusEffect,1,0,1000000);
				myself::Shout(myself::MakeFString(1010472,"","","","",""));
				myself::AddTimerEx(3002,( 1000 * 30 ));
				break;
			}
			case 3:
			{
				myself::AddTimerEx(3001,( ( 1000 * 60 ) * 3 ));
				myself::Shout(myself::MakeFString(1010475,"","","","",""));
				break;
			}
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id,i0)
	{
		if( timer_id == 3001 )
		{
			myself::Area_SetOnOff(AreaName,1);
			myself::AddUseSkillDesire(myself.sm,StatusEffect,1,0,1000000);
			switch(type)
			{
				case 0:
				{
					myself::Shout(myself::MakeFString(1010477,"","","","",""));
					myself::AddTimerEx(3002,( 1000 * 30 ));
					break;
				}
				case 1:
				{
					myself::Shout(myself::MakeFString(1010476,"","","","",""));
					myself::AddTimerEx(3002,( 1000 * 30 ));
					break;
				}
				case 2:
				{
					myself::Shout(myself::MakeFString(1010472,"","","","",""));
					break;
				}
				case 3:
				{
					myself::Shout(myself::MakeFString(1010478,"","","","",""));
					myself::AddTimerEx(3002,( 1000 * 30 ));
					break;
				}
			}
		}
		if( timer_id == 3002 )
		{
			myself::AddUseSkillDesire(myself.sm,StatusEffect,1,0,1000000);
			myself::AddTimerEx(3002,( 1000 * 30 ));
		}
		super;
	}

	EventHandler MY_DYING()
	{
		myself::Area_SetOnOff(AreaName,0);
		switch(type)
		{
			case 0:
			{
				myself::Shout(myself::MakeFString(1010481,"","","","",""));
				break;
			}
			case 1:
			{
				myself::Shout(myself::MakeFString(1010480,"","","","",""));
				break;
			}
			case 2:
			{
				myself::Shout(myself::MakeFString(1010479,"","","","",""));
				break;
			}
			case 3:
			{
				myself::Shout(myself::MakeFString(1010482,"","","","",""));
				break;
			}
		}
	}

	EventHandler USE_SKILL_FINISHED(target,skill_name_id)
	{
		myself::AddUseSkillDesire(myself.sm,StatusEffect,1,0,1000000);
	}

}
