I have mhunt working where a mobile hunts a character if they flee, and I have also made other scenarios where say a mobile flees at 35% health and begins a backstab/flee loop on players (so awesome!). The issue that I am encountering is when another player enters the mix and is then attached to the mobiles memory/the mob is trying to hunt 2 players at once. It crashes the mud every time.
Does anyone know a way to create a check for a mobile that is already hunting a player so that it doesn't trigger another hunting query/memory addition? Even a workaround is fine as long as it works. Included below is one of the examples of the triggers I am using currently that makes a mob backstab/flee. This does work on my mud, but if I have another character in the room where the mob flees to and that 2nd player hits the mob, they are added to the mobiles memory as well and it crashes the game.
I need a mob hunt memory setup that doesn't allow for multiple names to be added to mobs memory, and I need to make it where a mobile seeing the player again isn't necessary for the mob to hunt them. Any help is greatly appreciated!
Code:
Name: 'Hunt: Danar Wimpy Hunt', VNum: [17016], RNum: [ 220]
Trigger Intended Assignment: Mobiles
Trigger Type: HitPrcnt Memory , Numeric Arg: 35, Arg list: None
Commands:
eval pc_lev %char.level%
if %actor.is_pc% && %pc_lev% > 40
halt
end
mforget %actor.name%
eval pc_lev %char.level%
if %actor.canbeseen% && %actor.is_pc% && %pc_lev% <= 40
wait 3 sec
mremember %actor% mhunt %actor.name%
flee
wait 2 sec
mhunt %actor%