Switch to edit mode.
Name(s): @extend1: if (this != player)
2: return $msg:mtell("huh")
3: elseif ($command_utils:object_match_failed(dobj, dobjstr))
4: return
5: elseif (dobj.owner == $repo_man)
6: return player:tell(dobj:nn(), " is owned by ", $repo_man:nn(), ", and can therefore not be @extended.")
7: elseif (dobj:isa($accountable))
8: return player:tell("Can't extend players!")
9: endif
10: count = 0
11: interval = dobj.extend_expiry_time
12: iobjstr = $time_utils:english_time(interval)
13: if (dobj:_get_solidified() || dobj:_get_petrified())
14: player:tell($string_utils:nn(dobj), " is already permanent.")
15: if (!player:controls(dobj) || !$command_utils:yes_or_no(tostr("Make temporary with shelf-life ", iobjstr, "?")))
16: return player:tell("Aborted.")
17: endif
18: endif
19: ext = time() + interval
20: if (ext < dobj.best_before)
21: if (!player:controls(dobj))
22: return player:tell(dobj:nn(), " is currently extended beyond ", iobjstr, "; aborting.")
23: elseif (!$command_utils:yes_or_no(tostr($string_utils:nn(dobj), " is currently extended beyond ", iobjstr, ". Do you wish to REDUCE its time to live?")))
24: return player:sub_tell("%D (#%D~#) is unchanged.")
25: endif
26: endif
27: if (!(e = $building_utils:set_best_before(dobj, ext)))
28: player:tell(e)
29: else
30: player:tell(dobj:nn(), " extended ", "till ", iobjstr, ".", ". Will expire ", ctime(ext), ".")
31: endif
32: "Last modified by Raptor (#6319) on Wed Mar 17 01:56:24 1999 MST."