Mob coding assistance

  • Apocmud.org
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
1 month 19 hours ago #8404 by Apocmud.org
Mob coding assistance was created by Apocmud.org
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
3 weeks 14 hours ago #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.

  • Apocmud.org
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
1 week 1 day ago #8409 by Apocmud.org
Replied by Apocmud.org 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.998 seconds