scn NPC_Script
short cast
ref myself
begin gamemode
if cast==1
set myself to getself
if myself.getisreference apo1a==1
cast xyPort1 myself
elseif myself.getisreference apo2a==1
cast xyPort2 myself
elseif myself.getisreference apo3a==1
cast xyPort3 myself
endif
set cast to 2
else
return
endif
end