I've been working on a MOB trigger on my local copy of the MUD as follows:
Code:
Name: 'Windmill Technician - Atmosphere Z600', VNum: [60008], RNum: [ 1441]
Trigger Intended Assignment: Mobiles
Trigger Type: Random , Numeric Arg: 50, Arg list: None
Commands:
*
* Windmill Technician - Atmosphere
* Krell - Clockwerx z600
*
context %self.id%
set short 1
set long 5
set v_long 10
if !%actor.varexists(windmill_quest_z600)% || !%quest_busy_z600%
switch %random.6%
.
.
.
case 3
* Get the ID of the room the MOB is in.
set room_id %self.room%
* Get the ID of present PCs as seen by the MOB.
set next_char %room_id.people%
set count 0
* Count the number of people in the room. The MOB will count
* itself last.
while %next_char%
set tmp_char %next_char.next_in_room%
* now STUFF all of the people into a list, 1 to n!
eval count %count% + 1
set victim[%count%] %next_char%
set next_char %tmp_char%
done
* Decrement the count by 1 so MOB doesn't talk/act toward itself.
eval count %count% - 1
* Randomly pick a PC to torment.
random.%count%
eval do_vict %%victim[%count%]%%
%send% %do_vict% %self.name% glares at your intrusion.
%echoaround% %do_vict% %self.name% glares at %do_vict.name%.
wait %short% s
say You'd better not be involved with those trouble makers who've been lurking around here.
break
.
.
.
done
end
My question revolves around this particular snip.
Code:
* Randomly pick a PC to torment.
random.%count%
eval do_vict %%victim[%count%]%%
%send% %do_vict% %self.name% glares at your intrusion.
%echoaround% %do_vict% %self.name% glares at %do_vict.name%.
wait %short% s
say You'd better not be involved with those trouble makers who've been lurking around here.
It seems to solely pick the first character in the list. I've only tested it so far with two PCs in the same room at the same time. I was under the impression that random.# tried to be as truly random as possible,but this doesn't seem to bear that out.
Can anybody comment to clear this matter up for me, or test it? Perhaps I've fixed the result of random.# in some way?
Thanks in advance.