@LabelIndex 422606
@StringIndex 0
class 1 c_tower_maker_normal : (null) {
handler:
	EventHandler ON_SCRIPT_EVENT(script_event_arg1,script_event_arg2,i0,def0) {
		if( script_event_arg1 == 88008 ) {
			myself.i_ai0 = script_event_arg2;
			myself.i_ai4 = 0;
			for(i0 = 0; i0 < myself.def_count; i0++) {
				def0 = myself::GetSpawnDefine(i0);
				if( gg::IsNull(def0) == 0 ) {
					if( myself::AtomicIncreaseTotal(def0,def0.total,1) ) {
						def0::Spawn2(def0.total,0,0);
					}
				}
			}
		}
		if( script_event_arg1 == 1000 ) {
			myself.i_ai4 = 1;
			for(i0 = 0; i0 < myself.def_count; i0++) {
				def0 = myself::GetSpawnDefine(i0);
				if( gg::IsNull(def0) == 0 ) {
					def0::Despawn();
				}
			}
		}
	}

	EventHandler ON_ALL_NPC_DELETED(c0) {
		c0 = gg::GetCreatureFromIndex(myself.i_ai0);
		if( gg::IsNull(c0) == 0 && myself.i_ai4 == 0 ) {
			gg::SendScriptEvent(c0,88009,0);
		}
	}

}
