class 2 exclusive_spawn_normal : default_maker
{
parameter:
	int	unique_npc = 0;
	string	maker_name = "";

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

	EventHandler ON_NPC_CREATED(created_def,created_npc,maker0)
	{
		if( created_npc.sm.npc_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.npc_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
		{
			i0 = myself::DecreaseTotal(1);
			deleted_def::DecCount(1);
			if( myself.i_ai0 == 0 )
			{
				if( myself::IncreaseTotal(1) )
				{
					deleted_def::IncCount(1);
					deleted_def::Spawn(1,deleted_def.respawn_time);
				}
			}
		}
	}

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

}
