So this is some old code and can probably be improved but I wrote it almost 2 years ago and it's still working.. so use it if you want.

In BaseCreature.cs in the CanBeHarmful section right above the first if statement, add this:

C#:
            #region Iomega0318 - Pet Attack Changes
            //Prevent pets from harming you or each other
            if (Controlled)
            {
                if (target is BaseCreature)
                {
                    BaseCreature bc = target as BaseCreature;

                    if (bc.Controlled && ControlMaster == bc.ControlMaster && bc !=this)
                    {
                        Combatant = null;
                        bc.Combatant = null;
                        Warmode = false;
                        bc.Warmode = false;
                        ControlTarget = ControlMaster;
                        bc.ControlTarget = bc.ControlMaster;
                        ControlOrder = OrderType.Follow;
                        bc.ControlOrder = OrderType.Follow;

                        return false;
                    }
                }
                else if (target is PlayerMobile)
                {
                    PlayerMobile pm = target as PlayerMobile;

                    if (ControlMaster == pm)
                    {
                        Combatant = null;
                        Warmode = false;
                        ControlTarget = ControlMaster;
                        ControlOrder = OrderType.Follow;

                        return false;
                    }
                }
            }
            #endregion
 
So this is some old code and can probably be improved but I wrote it almost 2 years ago and it's still working.. so use it if you want.

In BaseCreature.cs in the CanBeHarmful section right above the first if statement, add this:

C#:
            #region Iomega0318 - Pet Attack Changes
            //Prevent pets from harming you or each other
            if (Controlled)
            {
                if (target is BaseCreature)
                {
                    BaseCreature bc = target as BaseCreature;

                    if (bc.Controlled && ControlMaster == bc.ControlMaster && bc !=this)
                    {
                        Combatant = null;
                        bc.Combatant = null;
                        Warmode = false;
                        bc.Warmode = false;
                        ControlTarget = ControlMaster;
                        bc.ControlTarget = bc.ControlMaster;
                        ControlOrder = OrderType.Follow;
                        bc.ControlOrder = OrderType.Follow;

                        return false;
                    }
                }
                else if (target is PlayerMobile)
                {
                    PlayerMobile pm = target as PlayerMobile;

                    if (ControlMaster == pm)
                    {
                        Combatant = null;
                        Warmode = false;
                        ControlTarget = ControlMaster;
                        ControlOrder = OrderType.Follow;

                        return false;
                    }
                }
            }
            #endregion
Thank you)
 
Back