@LabelIndex 110437
@StringIndex 13206
class 0 c_tower_basic_trap : default_trap {
parameter:
	string	AreaName = "keep_damage_trap_default";
	int	IdentityNumber = 0;
	int	IsDetected = 0;
	int	IsDefused = 0;
	int	trap_skill = 458752001;

handler:
	EventHandler CREATED() {
		myself::SetWorldTrapVisibleByClassId(myself.sm.class_id,1);
		if( AreaName != "" ) {
			myself.i_ai0 = 0;
			myself::AddTimerEx(9099,10000);
		}
	}

	EventHandler TRAP_DEFUSED(i0) {
		myself.c_ai0 = gg::GetCreatureFromID(i0);
		myself::ShowSystemMessage(myself.c_ai0,2285);
	}

	EventHandler TIMER_FIRED_EX(timer_id) {
		if( timer_id == 9099 && myself.i_ai0 == 0 ) {
			gg::Area_SetOnOff(AreaName,1);
			myself::SetWorldTrapVisibleByClassId(myself.sm.class_id,1);
		} else if( timer_id == 9099 && myself.i_ai0 == 1 ) {
			gg::Area_SetOnOff(AreaName,0);
			myself::SetWorldTrapVisibleByClassId(myself.sm.class_id,0);
			myself.i_ai0 = 0;
		}
		myself::AddTimerEx(9099,20000);
	}

	EventHandler SCRIPT_EVENT(script_event_arg1,script_event_arg2) {
		if( script_event_arg1 == 88011 && script_event_arg2 == IdentityNumber ) {
			myself.i_ai0 = 1;
		}
	}

}
