@LabelIndex 422362
@StringIndex 0
class 1 b_time_renew3_maker : inzone_maker {
parameter:
	int	on_start_spawn = 0;

handler:
	EventHandler ON_START(i0,def0) {
		myself.i_ai0 = 0;
		myself.i_ai1 = 0;
		super;
	}

	EventHandler ON_SCRIPT_EVENT(script_event_arg1,script_event_arg2,script_event_arg3,i0,i1,i2,def0) {
		if( script_event_arg1 == 12544 ) {
			myself.i_ai0 = ( script_event_arg2 - 1 );
		} else if( script_event_arg1 == 12545 ) {
			myself.i_ai1 = script_event_arg2;
		} else if( script_event_arg1 == 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) ) {
							if( myself.i_ai0 != i0 && myself.i_ai1 != i0 ) {
								def0::Spawn2(i1,script_event_arg2,0);
								myself::AddTimerEx(2001,5000);
							}
						}
					}
				}
			}
		}
	}

	EventHandler ON_TIMER(timer_id,def0,maker0,i0,i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11) {
		if( timer_id == 2001 ) {
			for(i0 = 0; i0 < myself.def_count; i0++) {
				def0 = myself::GetSpawnDefine(i0);
				if( gg::IsNull(def0) == 0 ) {
					def0::SendScriptEvent(12543,3,0);
				}
			}
		}
	}

	EventHandler ON_ALL_NPC_DELETED(i0,def0,maker0) {
		myself.i_ai0 = 0;
		myself.i_ai1 = 0;
	}

}
