Greetings and I hope this is the correct section for this thread/topic. Newish to posting. I've created a series of combat related triggers for the MUD I'm building on. I've done limited testing myself and the appear to be working as intended, however due to the small number of players on the MUD I'm hoping to get some others to look them over and provide pointers on optimizing them or fixing them if there are any issues I don't see/haven't encountered. Thanks Kastil
Trigger 1 Goal - Have a mob that will pick a random target and damage them. Possible targets to include player(s) and pet(s) that are engaged with the mob but not NPC's that might be 'in the area'.
Code:
Trigger Intended Assignment: Mobiles
Trigger Type: Fight, Numeric Arg: 5, Arg list: none
Commands:
*Mob does unresisted damage to random player or follower
*To provide a simple plug and play template damage is based on 2 x the mobs level
eval mob_damage %self.level% * 2
set entity %random.char%
*Line 4 randomly selects random char in room. If statements to just affect players/pets
if %entity.is_pc%
%damage% %entity% %mob_damage%
*Change lines 9,10,13 and 14 to something appropriate for the mobs special
%send% %entity% %self.name% slashes your face with it's razor sharp claws!
%echoaround% %entity% %self.name% slashes %entity.name%'s face with it's razor sharp claws!
elseif !%entity.is_pc% && %entity.master%
%damage% %entity% %mob_damage%
%send% %entity% %self.name% slashes your face with it's razor sharp claws@n!
%echoaround% %entity% %self.name% slashes %entity.name%'s face with it's razor sharp claws!
end