@LabelIndex 423303
@StringIndex 0
class 1 naia_lock_maker : default_maker {
parameter:

handler:
	EventHandler ON_START(def0,i0) {
		def0 = myself::GetSpawnDefine(0);
		if( gg::IsNull(def0) == 0 ) {
			if( myself::AtomicIncreaseTotal(def0,1,1) ) {
				def0::Spawn2(1,0,0);
			}
		}
		def0 = myself::GetSpawnDefine(1);
		if( gg::IsNull(def0) == 0 ) {
			if( myself::AtomicIncreaseTotal(def0,1,1) ) {
				def0::Spawn2(1,0,0);
			}
		}
		myself.i_ai1 = 1;
		myself.i_ai2 = 0;
	}

	EventHandler ON_SCRIPT_EVENT(script_event_arg1,script_event_arg2,script_event_arg3,def0) {
		if( script_event_arg1 == 33033 ) {
			if( myself.i_ai1 == 0 ) {
				def0 = myself::GetSpawnDefine(1);
				if( gg::IsNull(def0) == 0 ) {
					if( myself::AtomicIncreaseTotal(def0,1,1) ) {
						def0::Spawn2(1,0,0);
					}
				}
				myself.i_ai1 = 1;
				myself.i_ai2 = 0;
			}
		} else if( script_event_arg1 == 78010026 ) {
			def0 = myself::GetSpawnDefine(1);
			if( gg::IsNull(def0) == 0 ) {
				def0::SendScriptEvent(script_event_arg1,0,0);
			}
		} else if( script_event_arg1 == 78010008 ) {
			def0 = myself::GetSpawnDefine(0);
			if( gg::IsNull(def0) == 0 ) {
				def0::SendScriptEvent(script_event_arg1,0,0);
			}
			def0 = myself::GetSpawnDefine(1);
			if( gg::IsNull(def0) == 0 ) {
				def0::Despawn();
				myself.i_ai1 = 0;
			}
			myself::AddTimerEx(78002,( ( 20 * 60 ) * 1000 ));
		} else if( script_event_arg1 == 78010009 ) {
			def0 = myself::GetSpawnDefine(0);
			if( gg::IsNull(def0) == 0 ) {
				def0::SendScriptEvent(script_event_arg1,0,0);
			}
			def0 = myself::GetSpawnDefine(1);
			if( gg::IsNull(def0) == 0 ) {
				def0::Despawn();
				myself.i_ai1 = 0;
			}
			myself::AddTimerEx(78002,( ( 5 * 60 ) * 1000 ));
		} else if( script_event_arg1 == 78010041 ) {
			def0 = myself::GetSpawnDefine(0);
			if( gg::IsNull(def0) == 0 ) {
				def0::SendScriptEvent(78010041,script_event_arg2,script_event_arg3);
			}
			if( myself.i_ai2 == 0 ) {
				myself::AddTimerEx(78001,( ( 20 * 60 ) * 1000 ));
				myself.i_ai2 = 1;
			}
		}
	}

	EventHandler ON_TIMER(timer_id,def0) {
		if( timer_id == 78001 ) {
			def0 = myself::GetSpawnDefine(1);
			if( gg::IsNull(def0) == 0 ) {
				def0::Despawn();
				myself.i_ai1 = 0;
			}
			myself.i_ai0 = 1;
			myself.i_ai2 = 0;
			myself::AddTimerEx(78002,( 3 * 1000 ));
		} else if( timer_id == 78002 ) {
			gg::SendMakerScriptEvent(myself,33033,0,0);
		}
	}

	EventHandler ON_NPC_DELETED(deleted_def,def0,died) {
		def0 = myself::GetSpawnDefine(1);
		if( deleted_def == def0 && died != 0 ) {
			gg::SendMakerScriptEvent(myself,78010009,0,0);
		}
	}

}
