tbamud-3.67/bin/
tbamud-3.67/cnf/
tbamud-3.67/lib/etc/
tbamud-3.67/lib/misc/
tbamud-3.67/lib/plrfiles/A-E/
tbamud-3.67/lib/plrfiles/F-J/
tbamud-3.67/lib/plrfiles/K-O/
tbamud-3.67/lib/plrfiles/P-T/
tbamud-3.67/lib/plrfiles/U-Z/
tbamud-3.67/lib/plrfiles/ZZZ/
tbamud-3.67/lib/plrobjs/A-E/
tbamud-3.67/lib/plrobjs/F-J/
tbamud-3.67/lib/plrobjs/K-O/
tbamud-3.67/lib/plrobjs/P-T/
tbamud-3.67/lib/plrobjs/U-Z/
tbamud-3.67/lib/plrobjs/ZZZ/
tbamud-3.67/lib/text/
tbamud-3.67/lib/text/help/
tbamud-3.67/lib/world/qst/
tbamud-3.67/lib/world/shp/
tbamud-3.67/log/
tbamud-3.67/src/
#65400
Keychain takes you to Housing~
1 j 1
~
* Thanks to bakarus for suggesting the return, to Vatiken
*  for helping him with it and to Rumble for adding it to
*  trigger 176 where I could copy it.
*  http://www.tbamud.com/forum/3-building/355-dg-script-question#371
wait 1 sec
* Adjust zone to proper zone number
set zone 654
set roomvnummin %zone%00
set roomvnummax %zone%99
* if person hasn't used the key before, send to Midgaard Temple
*   instead of returning.
set defaultroom 3001
* if person uses key in apartment zone, return player to last room
*   out of the zone where the key was used.
if %actor.room.vnum% >= %zone%00 && %actor.room.vnum% <= %zone%99
  if %actor.varexists(keychain_return_room)%
    %send% %actor% You return to your previous location.
    %echoaround% %actor% %actor.name% heads back out into the world.
    %teleport% %actor% %actor.keychain_return_room%
    %force% %actor% look
    %echoaround% %actor% %actor.name% appears in the room.
  else
    %send% %actor% You head back out into the world.
    %echoaround% %actor% %actor.name% heads back out into the world.
    %teleport% %actor% %defaultroom%
    %force% %actor% look
    %echoaround% %actor% %actor.name% appears in the room.
  end
else
  eval keychain_return_room %actor.room.vnum%
  remote  keychain_return_room %actor.id%
  %send% %actor% You head for home.
  %echoaround% %actor% %actor.name% heads for home.
  %teleport% %actor% %self.vnum%
  %force% %actor% look
  %echoaround% %actor% %actor.name% appears, heading for home.
end
%force% %actor% remove keychain
~
$~