- Posts: 138
- Thank you received: 7
Mob coding assistance
- Nero
-
Topic Author
- Offline
- Premium Member
-
Less
More
4 years 3 months ago #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!
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.
- rudeboyrave
-
- Offline
- Premium Member
-
4 years 3 months ago #8407
by rudeboyrave
CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.
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.
- Nero
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 138
- Thank you received: 7
4 years 2 months ago #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
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.091 seconds