Izex

Member
I have a script I downloaded called Peacemakers, strong guards that will attack criminals, and right now they spawn gray instead of blue. I tried adding the code to make them innocent but they still do not spawn blue. Here is the code. Search for the text innocent to find the added code.

Code:
// Peacemaker v1.6.0
// Author: Felladrin
// Started: 2007-07-08
// Updated: 2016-01-23

using Server;
using Server.Items;
using Server.Mobiles;

namespace Felladrin.Mobiles
{
    [CorpseName("the corpse of a peacemaker")]
    public class BasePeacemaker : BaseCreature
    {
        public BasePeacemaker(AIType aiType, int rangeFight) : base(aiType, FightMode.Closest, 10, rangeFight, 0.2, 0.4)
        {
            Title = "the Peacemaker";

            Fame = 3000;
            Karma = 3000;

            SpeechHue = Utility.RandomDyedHue();

            Female = Utility.RandomBool();

            Hue = Utility.RandomSkinHue();

            Utility.AssignRandomHair(this);

            if (Female)
            {
                Body = 0x191;
                Name = NameList.RandomName("female");
            }
            else
            {
                Body = 0x190;
                Name = NameList.RandomName("male");

                if (Utility.RandomBool())
                    Utility.AssignRandomFacialHair(this, HairHue);
            }

            SetResistance(ResistanceType.Physical, 65, 70);
            SetResistance(ResistanceType.Fire, 65, 70);
            SetResistance(ResistanceType.Cold, 65, 70);
            SetResistance(ResistanceType.Poison, 65, 70);
            SetResistance(ResistanceType.Energy, 65, 70);

            AddItem(new DragonChest());
            AddItem(new DragonArms());
            AddItem(new DragonGloves());
            AddItem(new PlateGorget());
            AddItem(new DragonLegs());
            AddItem(new DragonHelm());
            AddItem(new Sandals());

            PackGold(1000, 2000);
            new DreadWarHorse().Rider = this;
        }
       
        public override void OnBeforeSpawn( Point3D location, Map m ) { IsParagon = false; }

        public override bool AlwaysAttackable{ get { return true; } }

        public override void AggressiveAction(Mobile aggressor, bool criminal)
        {
            base.AggressiveAction(aggressor, criminal);
            aggressor.Criminal = true;
        }

        public override bool OnBeforeDeath()
        {
            IMount mount = this.Mount;
       
            if (Combatant is PlayerMobile)
                Combatant.Kills += 1;   
       
            if (mount != null)
                mount.Rider = null;

            return base.OnBeforeDeath();
        }

        public override double WeaponAbilityChance { get { return 0.7; } }

        public override bool IsEnemy(Mobile m)
        {
            if (m is BasePeacemaker || m is BaseVendor)
                return false;
       
            if (m.Criminal)
                return true;
       
            var baseCreature = m as BaseCreature;

            if (baseCreature != null)
            {
                if (baseCreature.Karma < 0 && baseCreature.FightMode != FightMode.Aggressor && !baseCreature.Controlled)
                    return true;
           
                if (baseCreature.AlwaysMurderer)
                    return true;
            }
       
            var playerMobile = m as PlayerMobile;

            if (playerMobile != null)
            {
                if (playerMobile.ShortTermMurders > 0)
                    return true;
            }

            return false;
        }

        public override bool HandlesOnSpeech(Mobile from) { return true; }

        public override void OnSpeech(SpeechEventArgs e)
        {
            if (e.Handled || !e.Mobile.InRange(Location, 18))
                return;

            if (e.Speech.ToLower().Contains("guard") || e.Speech.ToLower().Contains("help") || e.Speech.ToLower().Contains("peacemaker"))
            {
                Direction = GetDirectionTo(e.Mobile);

                if (e.Mobile.Combatant != null && IsEnemy(e.Mobile.Combatant))
                {
                    Say(speech[Utility.Random(speech.Length)]);
                    Warmode = true;
                    Combatant = e.Mobile.Combatant;
                }
                else if (IsEnemy(e.Mobile))
                {
                    Say(speech[Utility.Random(speech.Length)]);
                    Warmode = true;
                    Combatant = e.Mobile;
                }
                else
                {
                    Emote("Looks around");
                    Warmode = false;
                    Combatant = null;
                }
            }
        }

        static string[] speech =
        {
            "To the fight!",
            "To arms!",
            "Attack!",
            "The battle is on!",
            "To your weapons!",
            "I have my eye on my enemy!",
            "Time to die!",
            "Nothing walks away!",
            "I have sight of my enemy!",
            "You will not prevail!",
            "To my side!",
            "We must defend our land!",
            "Fight for our people!",
            "I see them!",
            "Destroy them all!"
        };

        public BasePeacemaker(Serial serial) : base(serial) { }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write(0);
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            reader.ReadInt();
        }
    }

    public class FighterPeacemaker : BasePeacemaker
    {
        [Constructable]
        public FighterPeacemaker() : base(AIType.AI_Melee, 1)
   
        {
            SetStr(320, 400);
            SetDex(140, 160);
            SetInt(140, 160);

            Item weapon;
            switch (Utility.Random(6))
            {
                case 0:
                    weapon = new DreadSword();
                    break;
                default:
                    weapon = new VikingSword();
                    break;
            }
            AddItem(weapon);

            AddItem(new OrderShield());

            SetDamageType(ResistanceType.Physical, 100);

            SetSkill(SkillName.Tactics, 100, 120);
            SetSkill(SkillName.Swords, 100, 120);
            SetSkill(SkillName.Fencing, 100, 120);
            SetSkill(SkillName.MagicResist, 100, 120);
            SetSkill(SkillName.Macing, 100, 120);
            SetSkill(SkillName.Wrestling, 100, 120);
            SetSkill(SkillName.Parry, 100, 120);
            SetSkill(SkillName.Healing, 100, 120);
            SetSkill(SkillName.Anatomy, 100, 120);
            SetSkill(SkillName.AnimalTaming, 100, 120);
            SetSkill(SkillName.AnimalLore, 100, 120);
        }

        public override bool InitialInnocent ////added innocent
        {
            get
            {
                return true;
            }
        }   
   
        public FighterPeacemaker(Serial serial) : base(serial) { }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write(0);
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            reader.ReadInt();
        }
    }

    public class ArcherPeacemaker : BasePeacemaker
    {
        [Constructable]
        public ArcherPeacemaker() : base(AIType.AI_Archer, 8)
        {
            SetStr(190, 250);
            SetDex(190, 280);
            SetInt(100, 130);

            Item weapon;
            switch (Utility.Random(4))
            {
                case 0:
                    weapon = new BarbedLongbow();
                    break;
                case 1:
                    weapon = new CompositeBow();
                    break;
                case 2:
                    weapon = new JukaBow();
                    break;
                default:
                    weapon = new Bow();
                    break;
            }
            AddItem(weapon);

            SetSkill(SkillName.Tactics, 100, 150);
            SetSkill(SkillName.Archery, 100, 150);
            SetSkill(SkillName.Fencing, 100, 120);
            SetSkill(SkillName.MagicResist, 100, 120);
            SetSkill(SkillName.Macing, 100, 120);
            SetSkill(SkillName.Wrestling, 100, 120);
            SetSkill(SkillName.Healing, 100, 120);
            SetSkill(SkillName.Anatomy, 100, 150);
        }


        public ArcherPeacemaker(Serial serial) : base(serial) { }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write(0);
        }

        public override bool InitialInnocent ////added innocent
        {
            get
            {
                return true;
            }
        }   
   
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            reader.ReadInt();
        }
    }

    public class MagePeacemaker : BasePeacemaker
    {
        [Constructable]
        public MagePeacemaker() : base(AIType.AI_Mage, 5)
        {
            SetStr(140, 160);
            SetDex(140, 160);
            SetInt(320, 400);

            BaseWeapon weapon;
            switch (Utility.Random(2))
            {
                case 0:
                    weapon = new Scepter();
                    break;
                default:
                    weapon = new MagicWand();
                    break;
            }
       
            weapon.Attributes.SpellChanneling = 1;
            AddItem(weapon);

            SetDamageType(ResistanceType.Physical, 0);

            if (Utility.RandomBool())
                SetDamageType(ResistanceType.Cold, 60);
            else
                SetDamageType(ResistanceType.Fire, 60);

            if (Utility.RandomBool())
                SetDamageType(ResistanceType.Energy, 40);
            else
                SetDamageType(ResistanceType.Poison, 40);

            SetSkill(SkillName.EvalInt, 120, 150);
            SetSkill(SkillName.Magery, 120, 150);
            SetSkill(SkillName.Necromancy, 120, 150);
            SetSkill(SkillName.SpiritSpeak, 120, 150);
            SetSkill(SkillName.MagicResist, 120, 150);
            SetSkill(SkillName.Tactics, 120, 150);
            SetSkill(SkillName.Macing, 120, 150);
        }

        public MagePeacemaker(Serial serial) : base(serial) { }

        public override bool InitialInnocent ////added innocent
        {
            get
            {
                return true;
            }
        }   
   
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write(0);
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            reader.ReadInt();
        }

    }
}
 
Last edited:
I believe your issue lies here inside your base class:
Code:
publicoverridebool AlwaysAttackable{get{returntrue;}}
This should make them spawn as Gray. InitialInnocence true is what makes them Blue. Check the MLDryad.cs file.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back