@LabelIndex 423679
@StringIndex 0
class 1 maker_fav_8_sub : default_maker {
parameter:
	string	my_main_maker_name = "gludio58_1926_800m1";
	int	room_no = 0;
	int	sinmaster_def = 1;

handler:
	EventHandler ON_START(def0) {
		myself.i_ai0 = 0;
		def0 = myself::GetSpawnDefine(0);
		if( gg::IsNull(def0) == 0 ) {
			if( myself::AtomicIncreaseTotal(def0,def0.total,1) ) {
				def0::Spawn2(def0.total,0,0);
			}
		}
		def0 = myself::GetSpawnDefine(sinmaster_def);
		if( gg::IsNull(def0) == 0 ) {
			if( myself::AtomicIncreaseTotal(def0,1,1) ) {
				def0::Spawn2(1,0,0);
			}
		}
	}

	EventHandler ON_NPC_DELETED(deleted_def,died,i0,i1,maker0,reply,def0) {
		def0 = myself::GetSpawnDefine(sinmaster_def);
		if( gg::IsNull(def0) == 0 ) {
			if( deleted_def == def0 ) {
				maker0 = gg::GetNpcMaker(my_main_maker_name);
				if( gg::IsNull(maker0) == 0 ) {
					gg::SendMakerScriptEvent(maker0,78010019,0,room_no);
					if( myself::AtomicIncreaseTotal(def0,1,1) && def0.respawn_time != 0 ) {
						def0::Spawn2(1,def0.respawn_time,def0.respawn_rand);
					}
				}
			}
		}
		def0 = myself::GetSpawnDefine(( sinmaster_def + 1 ));
		if( gg::IsNull(def0) == 0 ) {
			if( deleted_def == def0 ) {
				maker0 = gg::GetNpcMaker(my_main_maker_name);
				if( gg::IsNull(maker0) == 0 ) {
					if( died == 0 ) {
						gg::SendMakerScriptEvent(maker0,78010040,1,room_no);
					} else {
						gg::SendMakerScriptEvent(maker0,78010016,1,room_no);
					}
				}
			}
		}
		def0 = myself::GetSpawnDefine(( sinmaster_def + 2 ));
		if( gg::IsNull(def0) == 0 ) {
			if( deleted_def == def0 ) {
				maker0 = gg::GetNpcMaker(my_main_maker_name);
				if( gg::IsNull(maker0) == 0 ) {
					if( died == 0 ) {
						gg::SendMakerScriptEvent(maker0,78010040,2,room_no);
					} else {
						gg::SendMakerScriptEvent(maker0,78010016,2,room_no);
					}
				}
			}
		}
		def0 = myself::GetSpawnDefine(( sinmaster_def + 3 ));
		if( gg::IsNull(def0) == 0 ) {
			if( deleted_def == def0 ) {
				maker0 = gg::GetNpcMaker(my_main_maker_name);
				if( gg::IsNull(maker0) == 0 ) {
					if( died == 0 ) {
						gg::SendMakerScriptEvent(maker0,78010040,3,room_no);
					} else {
						gg::SendMakerScriptEvent(maker0,78010016,3,room_no);
					}
				}
			}
		}
		def0 = myself::GetSpawnDefine(( sinmaster_def - 1 ));
		if( gg::IsNull(def0) == 0 ) {
			if( deleted_def == def0 ) {
				if( myself::AtomicIncreaseTotal(def0,1,1) ) {
					def0::Spawn2(1,def0.respawn_time,def0.respawn_rand);
				}
			}
		}
	}

	EventHandler ON_SCRIPT_EVENT(script_event_arg1,script_event_arg2,script_event_arg3,def0,i0,i1) {
		if( room_no == script_event_arg3 ) {
			if( script_event_arg1 == 78010018 ) {
				def0 = myself::GetSpawnDefine(( sinmaster_def + script_event_arg2 ));
				if( gg::IsNull(def0) == 0 ) {
					if( myself::AtomicIncreaseTotal(def0,1,1) ) {
						def0::Spawn2(1,0,0);
					}
				}
			} else if( script_event_arg1 == 78010003 ) {
				def0 = myself::GetSpawnDefine(( sinmaster_def + 4 ));
				if( gg::IsNull(def0) == 0 ) {
					if( myself::AtomicIncreaseTotal(def0,1,1) ) {
						def0::Spawn2(1,0,0);
					}
				}
			} else if( script_event_arg1 == 78010039 ) {
				myself.i_ai1 = 1;
			}
		}
	}

}
