obj809 ; broom script ; Axel 2003-Jan-21 q tryflee ; n room,err ;--- quit, if you are not wearing/holding it i who'=$$wornby^%obj(me) q ;--- put broom on the floor s room=$$room^%char(who) s err=$$toroom^%obj(me,room) ;--- messages d sendchar^%comm(who,"You panic and attempt to flee!"_$c(10,13)) d sendchar^%comm(who,"Not being able to keep your concentration, you fall off your broom."_$c(10,13)) d room^%act("$n panics and attempts to flee.",1,who,0) d room^%act("$n is not able to hold to %s broom and falls down.",1,who,0) s override=1 q move ; imported vars: =obj, =carrier =0,1,2.. (N,E,S..) n ro,ds,err,rider ;--- only for immortals i $$level^%char(who)<101 q ;--- quit, if you are not wearing/holding it i who'=$$wornby^%obj(me) q ;--- override, since we handle stuff ourselves now s override=1 ;--- get the room# which is to the given direction s ro=$$exroom^%room($$room^%char(who),dir) ;--- appropriate 'leaves-direction' string s ds=$$gostr^util(dir,0) ;--- check if someone is riding me! s rider=$$rider^%char(who) i rider>0 d . d vict^%act("You get throw off, as $n readies $s broom!",1,who,rider) ;--- send echo to user d sendchar^%comm(who,"Woosh-woosh... You ride your broom."_$c(10,13)) ;--- send echo to the room d room^%act("Woosh-woosh... $n leaves "_ds_" riding $s broom.",1,who,0) ;--- move the character to the new room s err=$$toroom^%char(who,ro) ;--- force the character to look d force^%char(who,"l") ;--- set enter_event to be triggered when with the script. We have to ;--- do that, because since we move the char by script, it won't ;--- trigger an event. d event^%comm(6,ro,me) ;--- appropriate 'arrives-from-direction' string s ds=$$gostr^util(dir,1) ;--- echo to the new room d room^%act("Woosh-woosh... $n has arrived "_ds_" riding $s broom.",1,who,0) q