I want to prevent PlayerMobiles from being able to engage in combat with BaseHires in their employ, and was hoping someone might point me to the right script and method.

I made BaseHires a bit more powerful (and hopefully useful), and want to prevent characters from using Hireables to train combat skills, resist, etc.

Thanks in advance for any help.
 
You need to edit /misc/Notoriety.cs

Find this section:
Code:
public static bool Mobile_AllowHarmful( Mobile from, Mobile target )

and add something like:

Code:
if( from is PlayerMobile && target is BaseHire)
            {
            from.SendMessage( 33, "You cannot attack your hire!" );    
            return false; 
            }
 
It might need a little more polish in the logic department, like

Code:
if( from is PlayerMobile && target is BaseHire  && (target.ControlMaster == from) )

to make sure it's the hire's controller doing the attacking and not another player. That's off the top of my head -- if it doesn't work, it should get you close.

There are other checks that can be done, like in case another player attacks a basehire. Just remember the checks are done in order they're in the script. The logic here can get pretty involved!
 
Thanks! Yes, I will have to fiddle with it once I decide exactly how I want it to work, but now know which script and method to use. Many thanks again! I will likely modify BaseAI as well to disallow having BaseHires attack blue PlayerMobiles or BaseCreatures.
 
Back