That shouldn't work.
If it does there's something wrong in Quest, seeing as how you don't have an opening bracket on your second if.
You also have two sections of code doing exactly the same thing, even though one's in the "then" of an if, and the other is in the "else".
Better code would be two bits, like so:
[b]startscript {
' Added to startscript so only defined once at game start[/b]
set string <direction[1]; north>
set string <direction[2]; south>
set string <direction[3]; east>
set string <direction[4]; west>
set string <direction[5]; northwest>
set string <direction[6]; northeast>
set string <direction[7]; southwest>
set string <direction[8]; southeast>
set string <direction[9]; up>
set string <direction[10]; down>
}
define procedure <npc_move>
set string <temp; $parameter(1)$>
set string <locob; $locationof(#temp#)$>
[b]' Deleted uneeded line[/b]
set numeric <rand; $rand(1;10)$>
if property <#locob#; #direction[rand]#> then {
if [b]not ( #locob# = #quest.currentroom# ) then do <npc_move(#temp#)>[/b]
}
if ( [b]#locob#[/b] = #quest.currentroom# ) then {
doaction <#temp#; move>
move <#temp#; $objectproperty(#locob#;#direction[rand]#)$>
}
end define
Should do exactly what you had before - just about.
Then again that is a totally odd procedure... You're saying:
"if the property is (north/south/whatever) then do the object action and move the object... If it's NOT the property (north/south/whatever) then STILL do the object action and move the object.
Oh, and go into a loop if the room property is north/south/whatever and the location isn't the current room.
That's really strange.
I'm taking it the object action is just a script that the game maker usually should use to print a message of "#object# leaps to the #direction# gracefully" or something similar...