@LabelIndex 420404
@StringIndex 0
class 1 random_bomb_spawn : default_maker {
parameter:
	string	maker_name1 = "random_bomb_spawn_default1";
	string	maker_name2 = "random_bomb_spawn_default2";
	string	maker_name3 = "random_bomb_spawn_default3";
	int	spawn_rate1 = 0;
	int	spawn_rate2 = 0;
	int	spawn_rate3 = 0;
	int	maker_cnt = 1;

handler:
	EventHandler ON_START(i0,i1,def0,maker0) {
		i0 = ( ( spawn_rate1 + spawn_rate2 ) + spawn_rate3 );
		i1 = gg::Rand(i0);
		if( i1 < spawn_rate1 ) {
			maker0 = gg::GetNpcMaker(maker_name1);
			gg::SendMakerScriptEvent(maker0,1001,0,0);
		} else if( i1 < ( spawn_rate1 + spawn_rate2 ) ) {
			maker0 = gg::GetNpcMaker(maker_name2);
			gg::SendMakerScriptEvent(maker0,1001,0,0);
		} else {
			maker0 = gg::GetNpcMaker(maker_name3);
			gg::SendMakerScriptEvent(maker0,1001,0,0);
		}
	}

	EventHandler ON_SCRIPT_EVENT(script_event_arg1,script_event_arg2,script_event_arg3,def0,i0,i1,maker0) {
		switch(script_event_arg1) {
			case 1000: {
				for(i0 = 0; i0 < myself.def_count; i0++) {
					def0 = myself::GetSpawnDefine(i0);
					if( gg::IsNull(def0) == 0 ) {
						def0::Despawn();
					}
				}
				break;
			}
			case 1001: {
				i0 = ( ( spawn_rate1 + spawn_rate2 ) + spawn_rate3 );
				i1 = gg::Rand(i0);
				if( i1 < spawn_rate1 ) {
					maker0 = gg::GetNpcMaker(maker_name1);
					gg::SendMakerScriptEvent(maker0,1001,0,0);
				} else if( i1 < ( spawn_rate1 + spawn_rate2 ) ) {
					maker0 = gg::GetNpcMaker(maker_name2);
					gg::SendMakerScriptEvent(maker0,1001,0,0);
				} else {
					maker0 = gg::GetNpcMaker(maker_name3);
					gg::SendMakerScriptEvent(maker0,1001,0,0);
				}
				break;
			}
		}
	}

}
