@LabelIndex 420344
@StringIndex 0
class 1 exclusive_spawn_normal : default_maker {
parameter:
	int	unique_npc = 0;
	string	maker_name = "exclusive_spawn_normal_default";

handler:
	EventHandler ON_START(i0,def0) {
		myself.i_ai0 = 0;
		super;
	}

	EventHandler ON_NPC_CREATED(created_def,created_npc,maker0) {
		if( created_npc.sm.class_id == unique_npc ) {
			myself.i_ai0 = 1;
			maker0 = gg::GetNpcMaker(maker_name);
			if( gg::IsNull(maker0) == 0 ) {
				gg::SendMakerScriptEvent(maker0,1000,1,0);
			}
		} else if( myself.i_ai0 == 1 ) {
			created_def::Despawn();
		}
	}

	EventHandler ON_NPC_DELETED(deleted_def,deleted_npc,i0,i1,maker0) {
		if( deleted_npc.sm.class_id == unique_npc ) {
			myself.i_ai0 = 0;
			maker0 = gg::GetNpcMaker(maker_name);
			if( gg::IsNull(maker0) == 0 ) {
				gg::SendMakerScriptEvent(maker0,1001,0,0);
			}
			super;
		} else if( myself.i_ai0 == 0 ) {
			if( myself::AtomicIncreaseTotal(deleted_def,1,1) ) {
				deleted_def::Spawn2(1,deleted_def.respawn_time,deleted_def.respawn_rand);
			}
		}
	}

	EventHandler ON_SCRIPT_EVENT(script_event_arg1,script_event_arg2,script_event_arg3,def0,i0,i1) {
		myself.i_ai0 = script_event_arg2;
		super;
	}

}
