Aberdeen will face Spanish side Real Sociedad if they reach the third qualifying round of the Europa League.
The Pittodrie side drew 0-0 in the first leg of their second-round tie against Dutch club Groningen.
If St Johnstone get past FC Luzern, they will meet FC Zestafoni of Georgia or Slovakia's Spartak Trnava. Motherwell would face Estonia's JK Nomme Kalju or Poland's Lech Poznan if they can beat Iceland's FC Stjarnan. Hull City will play Slovakia's FK AS Trencin or Vojvodina of Serbia.
Northern Irish side Linfield will face either FC Astana of Kazakhstan or Israeli club Hapoel Tel Aviv if can get the better of Sweden's AIK Solna after winning the first leg 1-0.
But Crusaders,who lost 4-0 to Swedish side IF Brommapojkarna, face a miracle if they are to meet Serie A club Torino.
League of Ireland side Derry City will face either Belgium's Zulte Waregem or Polish side Zawisza Bydgoszcz if they can overcome Shakhtyor Soligorsk.
Nomme Kalju lead 1-0 from the first leg in Estonia, while St Johnstone's possible opponents drew 0-0 in Georgia.
Aberdeen would be in Spain for the first leg against Real Sociedad, while Motherwell and St Johnstone would both be at home in their first legs.
Hull will also be away first, as would Linfield, Crusaders and Derry.