View/Edit #12:home

Switch to edit mode.

Name(s): home
1:  "Sends the player back to his/her/its home."
2:  if (valid(caller_perms()) && caller != this && !caller_perms().wizard)
3:    return
4:  elseif (this.location == this.home)
5:    return player:tell("You're already there!")
6:  elseif (this:contains(this.home))
7:    return player:tell("You're holding your home!  Put it down somewhere!")
8:  elseif (!`this.home:accept_for_abode(this) ! ANY => 0')
9:    player:tell("Your home ", this.home:nn(), " doesn't seem to want you.")
10:   this.home = $player_start
11: endif
12: player:tell(player:msg_gohome())
13: old_loc = this.location
14: dobjstr = tostr(dobj = this)
15: iobjstr = tostr(iobj = this.home)
16: if (old_loc != $player_start && old_loc != iobj)
17:   fork t (3)
18:     if (this.location == old_loc && $object_utils:isa(this.home, $room) && this.home:accept_for_abode(this))
19:       this:tell("Hmm... It seems you can't get home.")
20:       if (this.anchor != this.location)
21:         this:moveto(this.home)
22:         old_loc:sub_announce(this:msg_odepart())
23:         $msg:mtell(this, "arrive_quack", old_loc)
24:       endif
25:     endif
26:   endfork
27: else
28:   t = 0
29: endif
30: "Changed from _move!_obj to avoid VVers fleeing from @summon's"
31: this:_move_obj(dobj, iobjstr)
32: if (t && (this.location == $player_start || this.location == iobj))
33:   `kill_task(t) ! E_INVARG => "Oh.  Oops."'
34: endif
35: "Last modified by Dax (#789) on Sat Aug 26 20:35:06 2006 MDT."

Verb arguments: none none none
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Slacker (#55)

You are not logged in.

[home | help | who | search | setup | code]