Hi, I found this old thing:
web.archive.org/web/20070209101021/http:.../players/fishing.txt
and decided to use it as inspiration for this set of triggers.
this works for the most part.
enjoy
-mojo
Trigger: 5312
Intended Assignment: Objects
Trigger Type: Command
Num Arg 2
Arg List: castout reelin
Code:
if %cmd%==castout && %actor.varexists(fishing)%
%send% %actor% You're already fishing!
return 1
halt
end
if %cmd%==castout
if !(%self.is_inroom.vnum%==5351)
%send% %actor% This is not a good place to fish.
return 1
halt
end
eval fail %random.10%
if %fail% <= 3
%send% %actor% You pull your arm back and try to cast out your line, but it gets all tangled up.
%echoaround% %actor% You pulls %actor.hisher% arm back trying to cast %self.shortdesc%, but ends up tangling it.
return 1
halt
end
if %fail% >= 4
%send% %actor% You cast your line out into the water hoping for a bite.
%echoaround% %actor% %actor.name% casts out %actor.hisher% line into the water, hoping to catch something.
set fishing 1
remote fishing %actor.id%
attach 5313 %self.is_inroom.id%
attach 5314 %self.is_inroom.id%
return 1
halt
end
halt
end
if %cmd%==reelin && !%actor.varexists(fishing)%
%send% %actor% You're not even fishing!
return 1
halt
end
if %cmd%==reelin && !%actor.varexists(hooked)%
%send% %actor% You reel in your line, and discover that there is nothing on the end of the line.
%echoaround% %actor% %actor.name% reels in %actor.hisher% line and finds nothing.
rdelete fishing %actor.id%
detach 5313 %self.is_inroom.id%
return 1
halt
end
if %cmd%==reelin && %actor.varexists(hooked)%
eval fail %random.10%
if %fail% <= 3
%send% %actor% You reel in your line, putting up a good fight, but the line breaks!
%echoaround% %actor% %actor.name% reels in %actor.hisher% line but the line breaks and %actor.heshe% loses the catch.
rdelete fishing %actor.id%
rdelete hooked %actor.id%
detach 5313 %self.is_inroom.id%
return 1
halt
end
if %fail% >= 4
switch %random.3%
case 1
%load% o 5317 %actor%
break
case 2
%load% o 5318 %actor%
break
case 3
%load% o 5319 %actor%
break
case default
%load% o 5317 %actor%
break
done
%send% %actor% Nice catch! You reel in %lastloaded.shortdesc%!
%echoaround% %actor% %actor.name% reels in %lastloaded.shortdesc%!
rdelete fishing %actor.id%
rdelete hooked %actor.id%
detach 5313 %self.is_inroom.id%
return 1
halt
end
detach 5313 %self.is_inroom.id%
return 1
Trigger: 5313
Trigger Intended Assignment: Rooms
Trigger Type: Random, Num Arg: 100 Arglist: None
Code:
eval folks %self.people%
while %folks%
if (%folks.varexists(fishing)%)
eval foundafisherman 1
%echo% %folks.name% is fishing....
eval bite %random.5%
switch %bite%
case 1
%send% %folks% Time goes by, not even a nibble
set hooked 0
remote hooked %folks.id%
rdelete hooked %folks.id%
break
case 2
%send% %folks% You feel a slight jiggle on your line.
set hooked 0
remote hooked %folks.id%
rdelete hooked %folks.id%
break
case 3
%send% %folks% You feel a solid pull on your line!
%echoaround% %folks% The bobber at the end of %folks.name%'s line goes underwater!
set hooked 1
remote hooked %folks.id%
break
case 4
%send% %folks% You take some of the slack out of your line
%echoaround% %folks% %folks.name% pulls some of the slack out of his fishing line.
set hooked 0
remote hooked %folks.id%
rdelete hooked %folks.id%
break
case 5
%send% %folks% Still fishin' havent caught a thing!
set hooked 0
remote hooked %folks.id%
rdelete hooked %folks.id%
break
case default
halt
break
done
end
eval folks %folks.next_in_room%
done
if !%foundafisherman%
%echo% Couldnt find any fishermen, going to detach the trigger from the room.
detach room all
end
Trigger 5314
Trigger Intended Assignment: Rooms
Trigger Type: Leave, Num Arg: 100, Arg list: None
Code:
if (%actor.varexists(fishing)%)
rdelete fishing %actor.id%
%send% %actor% You pack your fishing gear away.
end
if (%actor.varexists(hooked)%)
rdelete hooked %actor.id%
%send% %actor% You let the big one get away.
end