Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Xaphan
Newbie


Joined: 22 May 2006
Posts: 2

PostPosted: Wed Jun 07, 2006 12:18 am   

trigger for multiple mobs
 
Hi guys
wondering if possible for a trigger to differentiate between mutiples of a mob in the same room.

when entering a room i will see:

A Black knight is here.
A Black knight is here.
(Target) A Black knight is here.

I would like tio be able to attack the 3.knight but not the other two.
the fact that its a quest mob or the target doesnt change how its recognised btw so i can attack target or quest.

hope this is clear thanks fior any help given :)
]
Reply with quote
Glorida
Newbie


Joined: 10 Mar 2006
Posts: 7

PostPosted: Wed Jun 07, 2006 1:58 am   
 
#ALIAS Target {#var GroundString %-1}
#TRIGGER {~(Target~) @GroundString is here.} {#CLASS Mobs 1;look}
#CLASS Mobs
#TRIGGER {%1 is here.} {#var Mobs {%additem(%-1,@Mobs);#alarm +1 {FindMob}}
#ALIAS FindMob {#var check {(Target) @GroundString is here.};#var check {%subchar(@check," ","|")};#var count 0;#var attack "";#forall @mobs {#add count 1;#var Sub {%subchar( %i, " ", "|")};#IF (@Sub != @check) {} {#var attack @count}};kill @attack;#class Mobs 0}
#CLASS 0

This was surprisingly harder than I had anticipated, but hey this seems to work.

When you receive a new quest, and the target is a mob, let's say for example today it's A Black knight. You would type "target A Black knight" Now, this is case sensitive, remember.

What this does is assigns the mob you're looking for with the (target) flag thing on it, is the black knight, and when you find him, you'll attack the correct one in the room, assuming they didn't move.

This also assumes the groundstring of the mob is MobName is here. If it's different in some cases, you'll have to modify the triggers a bit to include that string as well.

Glorida
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net