@LabelIndex 421907
@StringIndex 0
class 1 stonehenge_maker : default_maker {
parameter:
	int	IncreaseTotal = 7;

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::AddTimerEx(3000,2000);
				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 ) {
			if( myself.i_ai4 == 0 ) {
				myself.i_ai4 = 1;
				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(100);
					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) {
		if( reply == 0 ) {
			myself.i_ai0 = 0;
			myself.i_ai1 = 0;
			myself.i_ai2 = 0;
			myself.i_ai3 = 0;
			myself.i_ai4 = 0;
		}
	}

}
