@program newhide.muf 1 1000 d i $include $lib/rp $include $lib/alynna $def AVATAR #21 $def STEALTHENV "$env/stealth" match $def x-handle me @ "nstealth/id" getstat $def x-obj me @ "nstealth/obj" getstat $def x-room me @ "nstealth/room" getstat $def x-loc x-obj location $def do-nothing-loop 0 pop lvar param : hidden-move ( d1 d2 -- ) ( Move d1 to d2 totally hidden ) var target var targetdest targetdest ! target ! ( wheres the fifo at? ) #0 "quiet_moves_fifo" over over over over getprop 1 + setprop getprop ( If I am the first, turn on quiet moves ) 1 = if #21 "@tune quiet_moves=yes" force then ( Move me ) target @ targetdest @ moveto ( now wheres the fifo at? ) #0 "quiet_moves_fifo" over over over over getprop 1 - setprop getprop ( If I am the last, turn off quiet moves ) 0 = if #21 "@tune quiet_moves=no" force then ; : alternate-dimension ( -- ) ( Create a pocket dimension for sneaking ) var xbox var xbox-obj var xbox-room ( Create a dimension handle ) systime xbox ! ( Create a dark zombie ) me @ xbox @ tostr newobject xbox-obj ! STEALTHENV str "[OOC]: Stealth handle " xbox @ tostr cat newroom xbox-room ! ( Register it ) me @ "nstealth/id" xbox @ setstat me @ "nstealth/obj" xbox-obj @ setstat me @ "nstealth/room" xbox-room @ setstat ( Prepare the puppet ) xbox-obj @ "D" set xbox-obj @ "Z" set xbox-obj @ "" setdesc xbox-obj @ "_/pecho" ">" setprop xbox-obj @ "stealth?" 1 setstat xbox-obj @ "owner" me @ int setstat xbox-obj @ me @ location moveto xbox-obj @ "nstealth/room" xbox-room @ setstat xbox-obj @ "nstealth/obj" xbox-obj @ setstat xbox-obj @ "nstealth/owner" me @ setstat ( Prepare the room ) xbox-room @ str "You are hidden. Use the following commands while you are hidden:{nl}" " +move +m Move through the specified exit{nl}" " +shadow Follow a person around (use just '+shadow' to stop){nl}" " +look +l Look around at where you are at or at an object.{nl}" " +spoof +s Spoof anonymously to the current room{nl}" " +act +a Executes a command in the room{nl}" " +unhide Come out of hiding.{nl}" "{nl}" "All of the above commands cause another hide check to see if your noticed, so its best to stay quiet.{nl}" "In addition, every movement to another room of the person being shadowed causes a check.{nl}" cat setdesc xbox-room @ "D" set xbox-room @ "H" set xbox-room @ "Z" set xbox-room @ "_private?" "yes" setprop xbox-room @ "nstealth/room" xbox-room @ setstat xbox-room @ "nstealth/obj" xbox-obj @ setstat xbox-room @ "nstealth/owner" me @ setstat ( last thing we do is turn on the listener.. ) xbox-obj @ "_alisten" prog setprop ; : destroy-pocket-dimension ( first if I am hiding get me out of there ) me @ location x-room dbcmp if me @ x-room location moveto then ( first thing we do is turn off the listener.. ) x-obj "_alisten" 0 setprop ( Kill the support structs ) x-room recycle x-obj recycle ( Kill the props ) me @ 0 over over "nstealth/id" swap setstat over over "nstealth/room" swap setstat over over "nstealth/obj" swap setstat over over "nstealth/shadow" swap setstat "stealthbox" swap setstat ; : hide-me me @ x-room moveto ; : show-me me @ x-loc moveto ; : notice-check 0 "+glance" match getlink "pulse" queue ; : internal-listener me @ "nstealth/room" getstat me @ "nstealth/owner" getstat and if me @ "nstealth/room" getstat room? me @ "nstealth/owner" getstat player? and if me @ "nstealth/room" getstat me @ "nstealth/owner" getstat str "> " param @ cat ansi_notify_except then then ; : cmd-hide x-handle if "You are already hidden!" "Hide" pretty tellme exit then alternate-dimension hide-me #0 str "nstealth/" x-handle cat me @ setprop ; : cmd-look x-handle not if "You are not hiding." "Hide" pretty tellme exit then param @ not if x-obj "look" force else x-loc param @ rmatch if x-loc param @ rmatch "_/de" getprop me @ swap "Hide" 0 parsempi tellme then then notice-check ; : cmd-move var target x-handle not if "You are not hiding." "Hide" pretty tellme exit then x-loc param @ rmatch target ! target @ exit? if x-obj target @ getlink hidden-move else "You can't go that way." "Move" pretty tellme then notice-check ; : cmd-unhide x-handle not if "You are not hiding." "Hide" pretty tellme exit then cmd-shadow show-me destroy-pocket-dimension #0 str "nstealth/" x-handle cat 0 setprop ; : cmd-unhidefix #0 str "nstealth/" x-handle cat 0 setprop me @ 0 over over "nstealth/id" swap setstat over over "nstealth/room" swap setstat over over "nstealth/obj" swap setstat "stealthbox" swap setstat "All hideprops reset." "Unhide" pretty tellme ; : cmd-spoof x-handle not if "You are not hiding." "Hide" pretty tellme exit then x-obj str "spoof " param @ cat force str "> " param @ cat tellhere notice-check ; : cmd-act x-handle not if "You are not hiding." "Hide" pretty tellme exit then x-obj param @ force notice-check ; : cmd-shadow var target param @ not if "You discontinue shadowing." "Shadow" pretty tellme x-obj "nstealth/shadow" getstat if x-obj "nstealth/shadow" getstat "_arrive/shadow" 0 setprop x-obj "nstealth/shadow" getstat "nstealth/shadowedby" 0 setstat x-obj "nstealth/shadow" 0 setstat then else x-loc param @ rmatch if x-loc param @ rmatch target ! else "Cant match target." "Shadow" pretty tellme exit then x-handle not if cmd-hide then x-obj "nstealth/shadow" target @ setstat x-obj "nstealth/shadow" getstat "_arrive/shadow" prog setprop x-obj "nstealth/shadow" getprop "nstealth/shadowedby" x-obj setstat str "You are now shadowing " target @ cat "Shadow" pretty tellme then ; : glance-pulse var handle var target #0 str "nstealth/" array_get_propvals foreach target ! atoi handle ! target @ player? if target @ awake? if target @ "nstealth/obj" getstat "+glance pulse" force else target @ "+unhide" force str me @ "'s sleeping body falls out of +hiding." cat "Hide" pretty tellhere then then repeat ; : shadow me @ "nstealth/shadowedby" getstat loc @ hidden-move notice-check ; : main param ! command @ "+hide" smatch if cmd-hide exit then command @ "+shadow" smatch if cmd-shadow exit then command @ "{+move|+m}" smatch if cmd-move exit then command @ "{+look|+l}" smatch if cmd-look exit then command @ "{+spoof|+s}" smatch if cmd-spoof exit then command @ "{+act|+a}" smatch if cmd-act exit then command @ "+unhide" smatch if cmd-unhide exit then command @ "+unhide/fix" smatch if cmd-unhidefix exit then command @ "Queued Event." smatch if param @ "Arrive" smatch if shadow exit then then param @ "glance-pulse" smatch if glance-pulse exit then internal-listener ; . c q