RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Mob ignores tamed/controlled creatures, attacks players

seraph035

Sorceror
You know how it is ... You spend hours setting up the perfect scenario, getting the dungeon just right, and here comes some tamer with their beetle and mare combo ... in seconds flat, they wreck all of your hard work, swipe the loot, and are off down the trail looking for the next easy score.

Frustrating, isn't it? Yet, tamers are a legitimate class, and one cannot simply increase the monster value in order to give the tamer a challenge, else the hardworking mages, archers, and warriors will miss out on the fun ... what to do, oh what to do? If only there was a way to create a monster that would happily aggro on players without jumping on every fully trained and leveled uberpet that wanders into their domain.

Well, it seems there IS a way: simply drop this little piece of code into your monster's script, make sure it has fightmode.Aggressor set, and your creation will happily ignore that WW, but jump on the tamer like ugly on an ape as soon as the tamer gets close enough:

//Mob aggro on player instead of pets by Seraph035//
public override void OnMovement( Mobile m, Point3D oldLocation )
{
if ( m.InRange( this, 10 ) && m is PlayerMobile)
{
if ( this.Combatant == null )
{
this.Combatant = m;
}
}
}
//Share and enjoy//
 

Attachments

  • RabidRabbit.cs
    2 KB · Views: 23
nice little adding in there
but you should also add in a line for OnMovement( m, oldLocation )
because other things could be affected as well by their movement

also, if they are all ready fighting something - like a tamed critter, it will not change
and if they are surrounded by tames, specially on fel, they can not move and will just attack the ones attacking them all ready

also as players get smart to them, they just run around them while their tames still kill it off, since they are trying to attack the druid (if they had ranged attack, would probably work better) they do not attack the tames

but to actually move this into an override on damage taken and check for their control/summon/bard master and set the combatant as the master would work better (this way they are going after the druid instead of maybe some one else just wondering into the combat, or a fighter that is actually in their fighting, that is not the druid

now one of the things i did that made a difference for this purpose, that those with "fire breath", and decent intelligence, to recognize that the druid was over there and shoot their fire breath at them instead of the tames attacking it
 

seraph035

Sorceror
TY, Greywolf ...
On the real mob (a wild elf) basecreatures that are controlled have a better than fair chance to turn on their control master ... setting the elf to go after the controlmaster as well should be no hard feat, good suggestion!
I really came up with this as a means of allowing an npc mob to simulate the behavior of a pc with pets
(without this add-in, and with fightmode closest,weakest,strongest the npc winds up attacking it's own [controlled ] pets) ... the possibilities of using it for other purposes seemed to be worth a seperate mention, hence the Rabbit, which is really just an example creature, not intended as a finished product.
 
to simulate more of druid with pets attacking players, try setting their team to the same number (0 is default, and works up to 999 - for some reason never got higher numbers to work, even though to 65k should)

as for them attacking other monsters using closest, etc -- make sure they are not mixed reds and blues - make sure all have either positive or negative karma
and can add in overrides for murderer or innocent

those might get you a more of a group that will not attack each other
and do not use the necro AI - it is bugged that they will start attacking each other (one of the spells they cast does it)
 
Top