@LabelIndex 422295
@StringIndex 0
class 1 crystal_piece_drop_maker : inzone_maker {
parameter:
	int	enter_x = 0;
	int	position = 0;

handler:
	EventHandler ON_SCRIPT_EVENT(script_event_arg1,script_event_arg2,script_event_arg3,def0,i0,i1) {
		switch(script_event_arg1) {
			case 1001: {
				for(i0 = 0; i0 < myself.def_count; i0++) {
					def0 = myself::GetSpawnDefine(i0);
					if( gg::IsNull(def0) == 0 ) {
						i1 = ( def0.total - def0.npc_count );
						if( i1 > 0 ) {
							if( myself::AtomicIncreaseTotal(def0,i1,1) ) {
								def0::Spawn2(i1,script_event_arg2,0);
								myself::AddTimerEx(2001,3000);
							}
						}
					}
				}
				break;
			}
		}
		super;
	}

	EventHandler ON_TIMER(timer_id,def0,maker0,i0,i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11) {
		if( timer_id == 2001 ) {
			def0 = myself::GetSpawnDefine(0);
			if( gg::IsNull(def0) == 0 ) {
				def0::SendScriptEvent(12539,position,enter_x);
			}
		}
	}

}
