@LabelIndex 422152
@StringIndex 0
class 1 dark_house_stonehenge_maker : inzone_maker {
parameter:
	int	inzone_type_param = 0;
	int	spawn_event_id = -2;
	int	despawn_event_id = -1;
	int	on_start_spawn = 1;
	int	script_event_enable = 1;
	int	IncreaseTotal = 0;
	string	maker_name = "innadril19_2423_008m2";
	string	DoorName = "island_of_oracle_c";

handler:
	EventHandler ON_START(i0,i1,i2,i3,i4,i5,i6,i7,i8,i9,def0) {
		myself.i_ai0 = 0;
		myself.i_ai1 = 0;
		myself.i_ai2 = 0;
		myself.i_ai3 = 0;
		myself.i_ai4 = 0;
		super;
	}

	EventHandler ON_SCRIPT_EVENT(script_event_arg1,script_event_arg2,script_event_arg3,def0,i0,i1,i2,i3,i4,i5,i6,i7,i8,i9) {
		switch(script_event_arg1) {
			case 12509: {
				myself.i_ai4 = ( myself.i_ai4 + 1 );
				if( myself.i_ai4 == IncreaseTotal ) {
					myself::AddTimerEx(3000,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 == 3000 ) {
			i2 = 0;
			i3 = 0;
			i4 = 0;
			i5 = 0;
			i6 = 0;
			i7 = 0;
			i8 = IncreaseTotal;
			i9 = 0;
			i10 = 0;
			i11 = 0;
			for(i0 = 1; i0 < ( IncreaseTotal + 1 ); i0++) {
				i1 = gg::Rand(96);
				if( IncreaseTotal >= 1 && i1 <= gg::FloatToInt(( 100 / i8 )) && myself.i_ai0 == 0 ) {
					myself.i_ai0 = 1;
					def0 = myself::GetSpawnDefine(0);
					if( gg::IsNull(def0) == 0 ) {
						def0::SendScriptEvent(12508,i0,0);
					}
					i2 = 1;
				} else if( IncreaseTotal >= 2 && i1 <= gg::FloatToInt(( ( 100 / i8 ) * ( 2 - i2 ) )) && myself.i_ai1 == 0 ) {
					myself.i_ai1 = 1;
					def0 = myself::GetSpawnDefine(1);
					if( gg::IsNull(def0) == 0 ) {
						def0::SendScriptEvent(12508,i0,0);
					}
					i3 = 1;
				} else if( IncreaseTotal >= 3 && i1 <= gg::FloatToInt(( ( 100 / i8 ) * ( ( 3 - i2 ) - i3 ) )) && myself.i_ai2 == 0 ) {
					myself.i_ai2 = 1;
					def0 = myself::GetSpawnDefine(2);
					if( gg::IsNull(def0) == 0 ) {
						def0::SendScriptEvent(12508,i0,0);
					}
					i4 = 1;
				} else if( IncreaseTotal >= 4 && i1 <= gg::FloatToInt(( ( 100 / i8 ) * ( ( ( 4 - i2 ) - i3 ) - i4 ) )) && myself.i_ai3 == 0 ) {
					myself.i_ai3 = 1;
					def0 = myself::GetSpawnDefine(3);
					if( gg::IsNull(def0) == 0 ) {
						def0::SendScriptEvent(12508,i0,0);
					}
					i5 = 1;
				} else if( IncreaseTotal >= 5 && i1 <= gg::FloatToInt(( ( 100 / i8 ) * ( ( ( ( 5 - i2 ) - i3 ) - i4 ) - i5 ) )) && i9 == 0 ) {
					i9 = 1;
					def0 = myself::GetSpawnDefine(4);
					if( gg::IsNull(def0) == 0 ) {
						def0::SendScriptEvent(12508,i0,0);
					}
					i6 = 1;
				} else if( IncreaseTotal >= 6 && i1 <= gg::FloatToInt(( ( 100 / i8 ) * ( ( ( ( ( 6 - i2 ) - i3 ) - i4 ) - i5 ) - i6 ) )) && i7 == 0 ) {
					i7 = 1;
					def0 = myself::GetSpawnDefine(5);
					if( gg::IsNull(def0) == 0 ) {
						def0::SendScriptEvent(12508,i0,0);
					}
					i11 = 1;
				} else if( IncreaseTotal >= 7 && i1 <= gg::FloatToInt(( ( 100 / i8 ) * ( ( ( ( ( ( 7 - i2 ) - i3 ) - i4 ) - i5 ) - i6 ) - i11 ) )) && i10 == 0 ) {
					i10 = 1;
					def0 = myself::GetSpawnDefine(6);
					if( gg::IsNull(def0) == 0 ) {
						def0::SendScriptEvent(12508,i0,0);
					}
				}
				i8 = ( IncreaseTotal - i0 );
			}
		}
	}

	EventHandler ON_NPC_DELETED(deleted_def,i0,i1,i2,maker0,maker1,def0,reply) {
	}

	EventHandler ON_ALL_NPC_DELETED(i0,def0,maker0) {
		myself.i_ai0 = 0;
		myself.i_ai1 = 0;
		myself.i_ai2 = 0;
		myself.i_ai3 = 0;
		myself.i_ai4 = 0;
		i0 = myself::GetInZoneID();
		maker0 = gg::InstantZone_GetNpcMaker(i0,maker_name);
		if( gg::IsNull(maker0) == 0 ) {
			gg::SendMakerScriptEvent(maker0,1001,0,0);
		}
	}

}
