示例#1
0
        public override void OnThink()
        {
            if (!m_HasTeleportedAway && Hits < (HitsMax / 2) && Poisoned == false)
            {
                Map map = this.Map;

                if (map != null)
                {
                    for (int i = 0; i < 10; ++i)
                    {
                        int x = X + (Utility.RandomMinMax(5, 10) * (Utility.RandomBool() ? 1 : -1));
                        int y = Y + (Utility.RandomMinMax(5, 10) * (Utility.RandomBool() ? 1 : -1));
                        int z = Z;

                        if (!map.CanFit(x, y, z, 16, false, false))
                        {
                            continue;
                        }

                        Point3D from = this.Location;
                        Point3D to   = new Point3D(x, y, z);

                        this.Location = to;
                        this.ProcessDelta();
                        this.Hidden    = true;
                        this.Combatant = null;

                        Effects.SendLocationParticles(EffectItem.Create(from, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                        Effects.SendLocationParticles(EffectItem.Create(to, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);

                        Effects.PlaySound(to, map, 0x1FE);

                        m_HasTeleportedAway = true;
                        m_SoundTimer        = Timer.DelayCall(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(2.5), new TimerCallback(SendTrackingSound));

                        this.UseSkill(SkillName.Stealth);
                        AIObject.Action = ActionType.Flee;

                        break;
                    }
                }
            }

            if (this.Hits < (this.HitsMax - 10) && m_Bandage == false)
            {
                m_Bandage = true;

                Container backpack = this.Backpack;

                Bandage bandage = (Bandage)backpack.FindItemByType(typeof(Bandage));

                if (bandage != null)
                {
                    if (BandageContext.BeginHeal(this, this) != null)
                    {
                        bandage.Consume();
                    }

                    BandageTimer bt = new BandageTimer(this);
                    bt.Start();
                }
            }

            base.OnThink();
        }
示例#2
0
        //[Constructable]
        public DummyTheif() : base(/*AIType.AI_Thief*/ AIType.AI_Melee, FightMode.All | FightMode.Closest, 15, 1, 0.2, 0.6)
        {
            // A Dummy Hybrid Theif
            int iHue = 20 + Team * 40;
            int jHue = 25 + Team * 40;

            // Skills and Stats
            this.InitStats(105, 105, 105);
            this.Skills[SkillName.Healing].Base    = 120;
            this.Skills[SkillName.Anatomy].Base    = 120;
            this.Skills[SkillName.Stealing].Base   = 120;
            this.Skills[SkillName.ArmsLore].Base   = 100;
            this.Skills[SkillName.Meditation].Base = 120;
            this.Skills[SkillName.Wrestling].Base  = 120;

            // Name
            this.Name = "Hybrid Theif";

            // Equip
            Spellbook book = new Spellbook();

            book.Movable  = false;
            book.LootType = LootType.Newbied;
            book.Content  = 0xFFFFFFFFFFFFFFFF;
            AddItem(book);

            LeatherArms lea = new LeatherArms();

            lea.Movable  = false;
            lea.LootType = LootType.Newbied;
            lea.Crafter  = this;
            lea.Quality  = ArmorQuality.Regular;
            AddItem(lea);

            LeatherChest lec = new LeatherChest();

            lec.Movable  = false;
            lec.LootType = LootType.Newbied;
            lec.Crafter  = this;
            lec.Quality  = ArmorQuality.Regular;
            AddItem(lec);

            LeatherGorget leg = new LeatherGorget();

            leg.Movable  = false;
            leg.LootType = LootType.Newbied;
            leg.Crafter  = this;
            leg.Quality  = ArmorQuality.Regular;
            AddItem(leg);

            LeatherLegs lel = new LeatherLegs();

            lel.Movable  = false;
            lel.LootType = LootType.Newbied;
            lel.Crafter  = this;
            lel.Quality  = ArmorQuality.Regular;
            AddItem(lel);

            Sandals snd = new Sandals();

            snd.Hue      = iHue;
            snd.LootType = LootType.Newbied;
            AddItem(snd);

            Cap cap = new Cap();

            cap.Hue = iHue;
            AddItem(cap);

            Robe robe = new Robe();

            robe.Hue = iHue;
            AddItem(robe);

            Bandage band = new Bandage(50);

            AddToBackpack(band);
        }
示例#3
0
        public override bool DoActionCombat()
        {
            Mobile combatant = m_Mobile.Combatant;

            if (combatant == null || combatant.Deleted || combatant.Map != m_Mobile.Map || !combatant.Alive || combatant.IsDeadBondedPet)
            {
                m_Mobile.DebugSay("My combatant is gone, so my guard is up");

                Action = ActionType.Guard;

                return(true);
            }

            if (!m_Mobile.InRange(combatant, m_Mobile.RangePerception))
            {
                // They are somewhat far away, can we find something else?

                if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true))
                {
                    m_Mobile.Combatant = m_Mobile.FocusMob;
                    m_Mobile.FocusMob  = null;
                }
                else if (!m_Mobile.InRange(combatant, m_Mobile.RangePerception * 3))
                {
                    m_Mobile.Combatant = null;
                }

                combatant = m_Mobile.Combatant;

                if (combatant == null)
                {
                    m_Mobile.DebugSay("My combatant has fled, so I am on guard");
                    Action = ActionType.Guard;

                    return(true);
                }
            }

            /*if ( !m_Mobile.InLOS( combatant ) )
             * {
             *      if ( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
             *      {
             *              m_Mobile.Combatant = combatant = m_Mobile.FocusMob;
             *              m_Mobile.FocusMob = null;
             *      }
             * }*/

            if (MoveTo(combatant, true, m_Mobile.RangeFight))
            {
                m_Mobile.Direction = m_Mobile.GetDirectionTo(combatant);
            }
            else if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true))
            {
                if (m_Mobile.Debug)
                {
                    m_Mobile.DebugSay("My move is blocked, so I am going to attack {0}", m_Mobile.FocusMob.Name);
                }

                m_Mobile.Combatant = m_Mobile.FocusMob;
                Action             = ActionType.Combat;

                return(true);
            }
            else if (m_Mobile.GetDistanceToSqrt(combatant) > m_Mobile.RangePerception + 1)
            {
                if (m_Mobile.Debug)
                {
                    m_Mobile.DebugSay("I cannot find {0}, so my guard is up", combatant.Name);
                }

                Action = ActionType.Guard;

                return(true);
            }
            else
            {
                if (m_Mobile.Debug)
                {
                    m_Mobile.DebugSay("I should be closer to {0}", combatant.Name);
                }
            }

            if ((m_Mobile.Hits < m_Mobile.HitsMax * 0.75 || m_Mobile.Poisoned) && m_Mobile.Backpack != null)              //75% health
            {
                if (BandageContext.GetContext(m_Mobile) == null && m_Mobile.Backpack.GetAmount(typeof(Server.Items.Bandage), true) >= 1)
                {
                    Bandage b = null;

                    for (int i = 0; i < m_Mobile.Backpack.Items.Count; i++)
                    {
                        if (m_Mobile.Backpack.Items[i] is Bandage)
                        {
                            b = m_Mobile.Backpack.Items[i] as Bandage;
                            break;
                        }
                    }

                    if (b != null && BandageContext.BeginHeal(m_Mobile, m_Mobile) != null)
                    {
                        b.Consume(1);
                    }
                }
            }

            if (!m_Mobile.Controlled && !m_Mobile.Summoned)
            {
                if (m_Mobile.Hits < m_Mobile.HitsMax * 20 / 100)
                {
                    // We are low on health, should we flee?

                    bool flee = false;

                    if (m_Mobile.Hits < combatant.Hits)
                    {
                        // We are more hurt than them

                        int diff = combatant.Hits - m_Mobile.Hits;

                        flee = (Utility.Random(0, 100) < (10 + diff));                           // (10 + diff)% chance to flee
                    }
                    else
                    {
                        flee = Utility.Random(0, 100) < 10;                           // 10% chance to flee
                    }

                    if (flee)
                    {
                        if (m_Mobile.Debug)
                        {
                            m_Mobile.DebugSay("I am going to flee from {0}", combatant.Name);
                        }

                        Action = ActionType.Flee;
                    }
                }
            }

            return(true);
        }
示例#4
0
        public DummyAssassin() : base(AIType.AI_Melee, FightMode.All | FightMode.Closest, 15, 1, 0.2, 0.6)
        {
            // A Dummy Hybrid Assassin
            int iHue = 20 + Team * 40;
            int jHue = 25 + Team * 40;

            // Skills and Stats
            this.InitStats(105, 105, 105);
            this.Skills[SkillName.Magery].Base     = 120;
            this.Skills[SkillName.EvalInt].Base    = 120;
            this.Skills[SkillName.Swords].Base     = 120;
            this.Skills[SkillName.Tactics].Base    = 120;
            this.Skills[SkillName.Meditation].Base = 120;
            this.Skills[SkillName.Poisoning].Base  = 100;

            // Name
            this.Name = "Hybrid Assassin";

            // Equip
            Spellbook book = new Spellbook();

            book.Movable  = false;
            book.LootType = LootType.Newbied;
            book.Content  = 0xFFFFFFFFFFFFFFFF;
            AddToBackpack(book);

            Katana kat = new Katana();

            kat.Movable       = false;
            kat.LootType      = LootType.Newbied;
            kat.Crafter       = this;
            kat.Poison        = Poison.Deadly;
            kat.PoisonCharges = 12;
            kat.Quality       = WeaponQuality.Regular;
            AddToBackpack(kat);

            LeatherArms lea = new LeatherArms();

            lea.Movable  = false;
            lea.LootType = LootType.Newbied;
            lea.Crafter  = this;
            lea.Quality  = ArmorQuality.Regular;
            AddItem(lea);

            LeatherChest lec = new LeatherChest();

            lec.Movable  = false;
            lec.LootType = LootType.Newbied;
            lec.Crafter  = this;
            lec.Quality  = ArmorQuality.Regular;
            AddItem(lec);

            LeatherGorget leg = new LeatherGorget();

            leg.Movable  = false;
            leg.LootType = LootType.Newbied;
            leg.Crafter  = this;
            leg.Quality  = ArmorQuality.Regular;
            AddItem(leg);

            LeatherLegs lel = new LeatherLegs();

            lel.Movable  = false;
            lel.LootType = LootType.Newbied;
            lel.Crafter  = this;
            lel.Quality  = ArmorQuality.Regular;
            AddItem(lel);

            Sandals snd = new Sandals();

            snd.Hue      = iHue;
            snd.LootType = LootType.Newbied;
            AddItem(snd);

            Cap cap = new Cap();

            cap.Hue = iHue;
            AddItem(cap);

            Robe robe = new Robe();

            robe.Hue = iHue;
            AddItem(robe);

            DeadlyPoisonPotion pota = new DeadlyPoisonPotion();

            pota.LootType = LootType.Newbied;
            AddToBackpack(pota);

            DeadlyPoisonPotion potb = new DeadlyPoisonPotion();

            potb.LootType = LootType.Newbied;
            AddToBackpack(potb);

            DeadlyPoisonPotion potc = new DeadlyPoisonPotion();

            potc.LootType = LootType.Newbied;
            AddToBackpack(potc);

            DeadlyPoisonPotion potd = new DeadlyPoisonPotion();

            potd.LootType = LootType.Newbied;
            AddToBackpack(potd);

            Bandage band = new Bandage(50);

            AddToBackpack(band);
        }
示例#5
0
        public DummyThief() : base(AIType.AI_Thief, FightMode.Closest, 15, 1, 0.2, 0.6)
        {
            // A Dummy Hybrid Thief
            var iHue = 20 + Team * 40;
            var jHue = 25 + Team * 40;

            // Skills and Stats
            InitStats(105, 105, 105);
            Skills.Healing.Base    = 120;
            Skills.Anatomy.Base    = 120;
            Skills.Stealing.Base   = 120;
            Skills.ArmsLore.Base   = 100;
            Skills.Meditation.Base = 120;
            Skills.Wrestling.Base  = 120;

            // Equip
            var book = new Spellbook();

            book.Movable  = false;
            book.LootType = LootType.Newbied;
            book.Content  = 0xFFFFFFFFFFFFFFFF;
            AddItem(book);

            var lea = new LeatherArms();

            lea.Movable  = false;
            lea.LootType = LootType.Newbied;
            lea.Crafter  = this;
            lea.Quality  = ArmorQuality.Regular;
            AddItem(lea);

            var lec = new LeatherChest();

            lec.Movable  = false;
            lec.LootType = LootType.Newbied;
            lec.Crafter  = this;
            lec.Quality  = ArmorQuality.Regular;
            AddItem(lec);

            var leg = new LeatherGorget();

            leg.Movable  = false;
            leg.LootType = LootType.Newbied;
            leg.Crafter  = this;
            leg.Quality  = ArmorQuality.Regular;
            AddItem(leg);

            var lel = new LeatherLegs();

            lel.Movable  = false;
            lel.LootType = LootType.Newbied;
            lel.Crafter  = this;
            lel.Quality  = ArmorQuality.Regular;
            AddItem(lel);

            var snd = new Sandals();

            snd.Hue      = iHue;
            snd.LootType = LootType.Newbied;
            AddItem(snd);

            var cap = new Cap();

            cap.Hue = iHue;
            AddItem(cap);

            var robe = new Robe();

            robe.Hue = iHue;
            AddItem(robe);

            var band = new Bandage(50);

            AddToBackpack(band);
        }
示例#6
0
        public DummyAssassin() : base(AIType.AI_Melee, FightMode.Closest, 15, 1, 0.2, 0.6)
        {
            // A Dummy Hybrid Assassin
            var iHue = 20 + Team * 40;
            var jHue = 25 + Team * 40;

            // Skills and Stats
            InitStats(105, 105, 105);
            Skills.Magery.Base     = 120;
            Skills.EvalInt.Base    = 120;
            Skills.Swords.Base     = 120;
            Skills.Tactics.Base    = 120;
            Skills.Meditation.Base = 120;
            Skills.Poisoning.Base  = 100;

            // Equip
            var book = new Spellbook();

            book.Movable  = false;
            book.LootType = LootType.Newbied;
            book.Content  = 0xFFFFFFFFFFFFFFFF;
            AddToBackpack(book);

            var kat = new Katana();

            kat.Movable       = false;
            kat.LootType      = LootType.Newbied;
            kat.Crafter       = this;
            kat.Poison        = Poison.Deadly;
            kat.PoisonCharges = 12;
            kat.Quality       = WeaponQuality.Regular;
            AddToBackpack(kat);

            var lea = new LeatherArms();

            lea.Movable  = false;
            lea.LootType = LootType.Newbied;
            lea.Crafter  = this;
            lea.Quality  = ArmorQuality.Regular;
            AddItem(lea);

            var lec = new LeatherChest();

            lec.Movable  = false;
            lec.LootType = LootType.Newbied;
            lec.Crafter  = this;
            lec.Quality  = ArmorQuality.Regular;
            AddItem(lec);

            var leg = new LeatherGorget();

            leg.Movable  = false;
            leg.LootType = LootType.Newbied;
            leg.Crafter  = this;
            leg.Quality  = ArmorQuality.Regular;
            AddItem(leg);

            var lel = new LeatherLegs();

            lel.Movable  = false;
            lel.LootType = LootType.Newbied;
            lel.Crafter  = this;
            lel.Quality  = ArmorQuality.Regular;
            AddItem(lel);

            var snd = new Sandals();

            snd.Hue      = iHue;
            snd.LootType = LootType.Newbied;
            AddItem(snd);

            var cap = new Cap();

            cap.Hue = iHue;
            AddItem(cap);

            var robe = new Robe();

            robe.Hue = iHue;
            AddItem(robe);

            var pota = new DeadlyPoisonPotion();

            pota.LootType = LootType.Newbied;
            AddToBackpack(pota);

            var potb = new DeadlyPoisonPotion();

            potb.LootType = LootType.Newbied;
            AddToBackpack(potb);

            var potc = new DeadlyPoisonPotion();

            potc.LootType = LootType.Newbied;
            AddToBackpack(potc);

            var potd = new DeadlyPoisonPotion();

            potd.LootType = LootType.Newbied;
            AddToBackpack(potd);

            var band = new Bandage(50);

            AddToBackpack(band);
        }
示例#7
0
 public InternalTarget(Bandage bandage) : base(Bandage.Range, false, TargetFlags.Beneficial)
 {
     m_Bandage = bandage;
 }
示例#8
0
        public ArmyBaseThief(int Team) : base(Team, AIType.AI_Thief, FightMode.Closest, 15, 1, 0.2, 0.6)
        {
            // An ArmyBase Hybrid Thief
            int iHue = 20 + Team * 40;
            int jHue = 25 + Team * 40;

            // Skills and Stats
            this.InitStats((90 + Utility.Random(15)), (90 + Utility.Random(15)), (90 + Utility.Random(15)));
            this.Skills[SkillName.Healing].Base    = (90 + Utility.Random(30));
            this.Skills[SkillName.Anatomy].Base    = (90 + Utility.Random(30));
            this.Skills[SkillName.Stealing].Base   = (90 + Utility.Random(30));
            this.Skills[SkillName.ArmsLore].Base   = (80 + Utility.Random(20));
            this.Skills[SkillName.Meditation].Base = (90 + Utility.Random(30));
            this.Skills[SkillName.Wrestling].Base  = (90 + Utility.Random(30));

            // Name
            this.Name = "Thief";

            // Equip
            Spellbook book = new Spellbook();

            book.Movable  = false;
            book.LootType = LootType.Newbied;
            book.Content  = 0xFFFFFFFFFFFFFFFF;
            AddItem(book);

            LeatherArms lea = new LeatherArms();

            lea.Movable  = false;
            lea.LootType = LootType.Newbied;
            lea.Crafter  = this;
            lea.Quality  = ArmorQuality.Regular;
            AddItem(lea);

            LeatherChest lec = new LeatherChest();

            lec.Movable  = false;
            lec.LootType = LootType.Newbied;
            lec.Crafter  = this;
            lec.Quality  = ArmorQuality.Regular;
            AddItem(lec);

            LeatherGorget leg = new LeatherGorget();

            leg.Movable  = false;
            leg.LootType = LootType.Newbied;
            leg.Crafter  = this;
            leg.Quality  = ArmorQuality.Regular;
            AddItem(leg);

            LeatherLegs lel = new LeatherLegs();

            lel.Movable  = false;
            lel.LootType = LootType.Newbied;
            lel.Crafter  = this;
            lel.Quality  = ArmorQuality.Regular;
            AddItem(lel);

            Sandals snd = new Sandals();

            snd.Hue      = iHue;
            snd.LootType = LootType.Newbied;
            AddItem(snd);

            Cap cap = new Cap();

            cap.Hue = iHue;
            AddItem(cap);

            Robe robe = new Robe();

            robe.Hue = iHue;
            AddItem(robe);

            Bandage band = new Bandage(50);

            AddToBackpack(band);
        }