Exemple #1
0
        public static void MimicThem(BaseCreature from, Mobile targ, bool allowskillchanges, bool allowAIchanges)
        {
            if (targ == null)
                return;

            if (from.BodyMod == 0)
            {
                from.BodyMod = targ.Body;
                from.Hue = targ.Hue;

                from.NameMod = targ.Name;
                from.Title = targ.Title;

                from.HairItemID = targ.HairItemID;
                from.FacialHairItemID = targ.FacialHairItemID;

                from.VirtualArmor = targ.VirtualArmor;

                foreach (var item in targ.Items)
                {
                    if (item.Layer != Layer.Backpack && item.Layer != Layer.Mount)
                    {
                        /*
                        We don't dupe armor because the creatures base seed stacks with armor
                        By duping a high resistance player we shoot the creature up into the 100's in res
                        Imagine being the player facing your 400+ HP creature and EVERY attack & spell only deals 1 damage to them.
                        */
                        if (item is BaseShield)
                        {
                            var shieldtomake = new Buckler();
                            shieldtomake.PoisonBonus = 0;
                            shieldtomake.ItemID = item.ItemID;
                            shieldtomake.Hue = item.Hue;
                            shieldtomake.Layer = item.Layer;
                            shieldtomake.Movable = false;
                            shieldtomake.Name = item.Name;
                            from.EquipItem(shieldtomake);
                        }
                        else if (item is BaseWeapon)
                        {
                            var weapontomake = new Broadsword();
                            weapontomake.ItemID = item.ItemID;
                            weapontomake.Hue = item.Hue;
                            weapontomake.Layer = item.Layer;
                            weapontomake.Movable = false;
                            weapontomake.Name = item.Name;

                            var weapon = item as BaseWeapon;
                            weapontomake.Animation = weapon.Animation;
                            weapontomake.HitSound = weapon.HitSound;
                            weapontomake.MissSound = weapon.MissSound;
                            weapontomake.MinDamage = weapon.MinDamage;
                            weapontomake.MaxDamage = weapon.MaxDamage;
                            weapontomake.Speed = weapon.Speed;
                            from.EquipItem(weapontomake);
                        }
                        else
                        {
                            var itemtomake = new Item(item.ItemID);
                            itemtomake.Hue = item.Hue;
                            itemtomake.Layer = item.Layer;
                            itemtomake.Movable = false;
                            itemtomake.Name = item.Name;
                            from.EquipItem(itemtomake);
                        }
                    }
                }

                /*
                Duping skills can mess up the AI.
                What good is trying to melee when you have 0 tactics?
                On the other side, What good is stopping it's attack to try and cast something it can't do?
                The bool allows you to use it as a staff command or spell or make clone creatures that don't run around with the same exact skills as the others.
                */

                if (allowskillchanges)
                    for (var i = 0; i < targ.Skills.Length && i < from.Skills.Length; i++)
                        from.Skills[i].Base = targ.Skills[i].Base;
            }
            else
            {
                from.BodyMod = 0;
                from.Hue = 0;

                from.NameMod = null;
                from.Title = null;

                from.HairItemID = 0;
                from.FacialHairItemID = 0;

                from.VirtualArmor = 0;

                var list = new List<Item>(from.Items);

                foreach (var item in list)
                {
                    if (item != null)
                        item.Delete();
                }

                if (allowskillchanges)
                {
                    for (var i = 0; i < targ.Skills.Length; ++i)
                        from.Skills[i].Base = 50.0;
                }
            }
        }