Welcome to the Builder Academy

Question Mob coding assistance

More
15 Jun 2019 07:22 #8404 by Nero
Mob coding assistance was created by Nero
Need some assistance on how to code these two mobs to identify and help each other in combat/in the room.

I have two mobs a king and queen.

Here is how I want it to go:
The king rescues the queen when she is being targeted by players, the queen heals the king if he is being targeted by players. The idea is to focus down the queen first then kill the king.

How do I edit this in triggers to ensure that this happens? How do I get each mob to identify that the other one is being attacked and vice versa? Any help would be very much appreciated!

Please Log in or Create an account to join the conversation.

More
24 Jun 2019 13:10 #8407 by rudeboyrave
Replied by rudeboyrave on topic Mob coding assistance
you could use dg scripts to check the victim for pos_fighting

CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.

Please Log in or Create an account to join the conversation.

More
07 Jul 2019 03:52 #8409 by Nero
Replied by Nero on topic Mob coding assistance
We were able to solve this with this:


set room %self.room%
set target %room.people%
while %target%
set tmp_target %target.next_in_room%
if %target.vnum(-1)%
elseif !%target.vnum(8013)%
elseif %target.vnum(8013)% && %target.fighting%
%echoaround% %self% %self.name% shouts, 'None shall harm the Queen while I draw breath!'
rescue %target.name%
%force% %target% assist %self.name%
elseif %target.vnum(8013)% && !%target.fighting%
end
set target %tmp_target%
done
halt
end

Please Log in or Create an account to join the conversation.

Time to create page: 0.241 seconds