Exemplo n.º 1
0
        public BestiaryBook(object o) : base(0x2252)
        {
            Mobile m_Object = (Mobile)o;

            Weight = 1.0;
            Hue    = 17;
            Name   = "Bestiary of " + m_Object.Name;

            m_NameID   = "" + m_Object.Name;
            m_ItemID   = (ShrinkTable.Lookup(m_Object));
            m_HueID    = m_Object.Hue;
            m_StrID    = m_Object.RawStr;
            m_DexID    = m_Object.RawDex;
            m_IntID    = m_Object.RawInt;
            m_ARID     = m_Object.VirtualArmor;
            m_HitsID   = m_Object.Hits;
            m_ManaID   = m_Object.Mana;
            m_StamID   = m_Object.Stam;
            m_WGHTID   = (m_Object.TotalWeight + m_Object.RawStr);
            m_PhyID    = m_Object.PhysicalResistance;
            m_FireID   = m_Object.FireResistance;
            m_ColdID   = m_Object.ColdResistance;
            m_PoisonID = m_Object.PoisonResistance;
            m_ElecID   = m_Object.EnergyResistance;
        }
Exemplo n.º 2
0
 public ShrunkenCreature(Mobile owner, BaseCreature creature) : base(ShrinkTable.Lookup(creature.Body))
 {
     m_Owner    = owner;
     m_Creature = creature;
     Name       = SphereUtils.GenericComputeName(this);
     Hue        = creature.Hue;
 }
Exemplo n.º 3
0
            public SummonCreatureGump(Mobile from)
                : base(20, 30)
            {
                m_From = from;

                AddPage(0);

                AddBackground(0, 0, 440, 155, 5054);
                AddBackground(10, 10, 420, 75, 2620);
                AddBackground(10, 85, 420, 45, 3000);

                AddBackground(0, 155, 440, 155, 5054);
                AddBackground(10, 165, 420, 75, 2620);
                AddBackground(10, 240, 420, 45, 3000);

                AddBackground(0, 310, 440, 155, 5054);
                AddBackground(10, 320, 420, 75, 2620);
                AddBackground(10, 395, 420, 45, 3000);

                for (int i = 0; i < 12; ++i)
                {
                    Mobile m = (Mobile)Activator.CreateInstance(m_Types[i]);

                    AddItem(20 + ((i % 4) * 100), 20 + ((i / 4) * 155), ShrinkTable.Lookup(m));
                    AddButton(20 + ((i % 4) * 100), 130 + ((i / 4) * 155), 4005, 4007, i + 1, GumpButtonType.Reply, 0);

                    if (m.Name != null)
                    {
                        AddHtml(20 + ((i % 4) * 100), 90 + ((i / 4) * 155), 90, 40, m.Name, false, false);
                    }
                }
            }
Exemplo n.º 4
0
        private static void LoadLists()
        {
            m_Monster = new ArrayList();
            m_Animal  = new ArrayList();
            m_Sea     = new ArrayList();
            m_Human   = new ArrayList();

            List <BodyEntry> entries = Docs.LoadBodies();

            for (int i = 0; i < entries.Count; ++i)
            {
                BodyEntry oldEntry = (BodyEntry)entries[i];
                int       bodyID   = oldEntry.Body.BodyID;

                if (((Body)bodyID).IsEmpty)
                {
                    continue;
                }

                ArrayList list = null;

                switch (oldEntry.BodyType)
                {
                case ModelBodyType.Monsters:
                    list = m_Monster;
                    break;

                case ModelBodyType.Animals:
                    list = m_Animal;
                    break;

                case ModelBodyType.Sea:
                    list = m_Sea;
                    break;

                case ModelBodyType.Human:
                    list = m_Human;
                    break;
                }

                if (list == null)
                {
                    continue;
                }

                int itemID = ShrinkTable.Lookup(bodyID, -1);

                if (itemID != -1)
                {
                    list.Add(new InternalEntry(bodyID, itemID, oldEntry.Name));
                }
            }

            m_Monster.Sort();
            m_Animal.Sort();
            m_Sea.Sort();
            m_Human.Sort();
        }
Exemplo n.º 5
0
        private static void LoadLists()
        {
            m_Monster = new List <InternalEntry>();
            m_Animal  = new List <InternalEntry>();
            m_Sea     = new List <InternalEntry>();
            m_Human   = new List <InternalEntry>();

            var entries = Docs.LoadBodies();

            for (var i = 0; i < entries.Count; ++i)
            {
                var oldEntry = entries[i];
                var bodyID   = oldEntry.Body.BodyID;

                if (((Body)bodyID).IsEmpty)
                {
                    continue;
                }

                List <InternalEntry> list;

                switch (oldEntry.BodyType)
                {
                default: continue;

                case ModelBodyType.Monsters:
                    list = m_Monster;
                    break;

                case ModelBodyType.Animals:
                    list = m_Animal;
                    break;

                case ModelBodyType.Sea:
                    list = m_Sea;
                    break;

                case ModelBodyType.Human:
                    list = m_Human;
                    break;
                }

                var itemID = ShrinkTable.Lookup(bodyID, -1);

                if (itemID != -1)
                {
                    list.Add(new InternalEntry(bodyID, itemID, oldEntry.Name));
                }
            }

            m_Monster.Sort();
            m_Animal.Sort();
            m_Sea.Sort();
            m_Human.Sort();
        }
        public AdvancedBuyInfo(
            AdvancedSBInfo parent,
            Type type,
            int price,
            string name   = null,
            int amount    = 100,
            object[] args = null)
            : base(name, type, price, amount, 0x14F0, 0, args)
        {
            Parent = parent;

            var e = GetDisplayEntity();

            if (e is Mobile)
            {
                var m = (Mobile)e;

                if (String.IsNullOrWhiteSpace(name))
                {
                    Name = m.RawName ?? type.Name.SpaceWords();
                }
                else
                {
                    m.RawName = name;
                }

                ItemID = ShrinkTable.Lookup(m);
                Hue    = m.Hue;

                if (m is BaseCreature)
                {
                    Slots = ((BaseCreature)m).ControlSlots;
                }
            }
            else if (e is Item)
            {
                var i = (Item)e;

                if (String.IsNullOrWhiteSpace(name))
                {
                    Name = i.ResolveName();
                }
                else
                {
                    i.Name = name;
                }

                ItemID = i.ItemID;
                Hue    = i.Hue;
            }
            else if (String.IsNullOrWhiteSpace(name))
            {
                Name = type.Name.SpaceWords();
            }
        }
Exemplo n.º 7
0
 public ShrinkItem(BaseCreature c)
 {
     m_toDeletePet = true;
     m_link        = c;
     if (!(c.Body == 400 || c.Body == 401))
     {
         Hue = c.Hue;
     }
     Name   = c.Name + " [shrunk]";
     ItemID = ShrinkTable.Lookup(c);
 }
Exemplo n.º 8
0
        private void CustomTransformButton(bool empty, int button, int number, string name, int bodyvalue)
        {
            AddAlphaRegion(244 + (number * 98), 24, 50, 50);

            if (!empty)
            {
                AddLabel(236 + (number * 98), 72, 2930, name);
                AddItem(245 + (number * 98), 30, ShrinkTable.Lookup(bodyvalue));
                AddButton(246 + (number * 98), 94, 2074, 2075, button, GumpButtonType.Reply, 0);
            }
            else
            {
                AddLabel(248 + (number * 98), 72, 2930, "Empty");
                AddButton(239 + (number * 98), 94, 5533, 5535, button, GumpButtonType.Reply, 0);
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// Creates a new MobileStatuette object - for internal use only
        /// </summary>
        private MobileStatuette(BaseCreature creature)
        {
            m_Creature = creature;
            ItemID     = ShrinkTable.Lookup(m_Creature);
            Hue        = m_Creature.Hue;

            m_Creature.ControlTarget = null;
            m_Creature.ControlOrder  = OrderType.Stay;
            m_Creature.Internalize();
            m_Creature.SetControlMaster(null);
            m_Creature.SummonMaster = null;
            m_Creature.IsStabled    = true;

            // Set the type of the creature as the name for this item
            Name = InsertSpaces(creature.GetType().Name);
        }
Exemplo n.º 10
0
        /// <summary>
        /// Creates a new MobileStatuette object - for internal use only
        /// </summary>
        private MobileStatuette(BaseCreature creature)
        {
            m_Creature = creature;
            ItemID     = ShrinkTable.Lookup(m_Creature);
            Hue        = m_Creature.Hue;

            m_Creature.ControlTarget = null;
            m_Creature.ControlOrder  = OrderType.Stay;
            m_Creature.Internalize();
            m_Creature.SetControlMaster(null);
            m_Creature.SummonMaster = null;
            m_Creature.IsStabled    = true;

            // Set the type of the creature as the name for this item
            Name = Xanthos.Utilities.Misc.GetFriendlyClassName(creature.GetType().Name);
        }
Exemplo n.º 11
0
        private TrackWhoGump(Mobile from, List <Mobile> list, int range)
            : base(20, 30)
        {
            this.m_From  = from;
            this.m_List  = list;
            this.m_Range = range;

            this.AddPage(0);

            this.AddBackground(0, 0, 440, 155, 5054);

            this.AddBackground(10, 10, 420, 75, 2620);
            this.AddBackground(10, 85, 420, 45, 3000);

            if (list.Count > 4)
            {
                this.AddBackground(0, 155, 440, 155, 5054);

                this.AddBackground(10, 165, 420, 75, 2620);
                this.AddBackground(10, 240, 420, 45, 3000);

                if (list.Count > 8)
                {
                    this.AddBackground(0, 310, 440, 155, 5054);

                    this.AddBackground(10, 320, 420, 75, 2620);
                    this.AddBackground(10, 395, 420, 45, 3000);
                }
            }

            for (int i = 0; i < list.Count && i < 12; ++i)
            {
                Mobile m = list[i];

                this.AddItem(20 + ((i % 4) * 100), 20 + ((i / 4) * 155), ShrinkTable.Lookup(m));
                this.AddButton(20 + ((i % 4) * 100), 130 + ((i / 4) * 155), 4005, 4007, i + 1, GumpButtonType.Reply, 0);

                if (m.Name != null)
                {
                    this.AddHtml(20 + ((i % 4) * 100), 90 + ((i / 4) * 155), 90, 40, m.Name, false, false);
                }
            }
        }
Exemplo n.º 12
0
        private TrackWhoGump(Mobile from, List <Mobile> list, int range) : base(20, 30)
        {
            m_From  = from;
            m_List  = list;
            m_Range = range;

            AddPage(0);

            AddBackground(0, 0, 440, 155, 5054);

            AddBackground(10, 10, 420, 75, 2620);
            AddBackground(10, 85, 420, 45, 3000);

            if (list.Count > 4)
            {
                AddBackground(0, 155, 440, 155, 5054);

                AddBackground(10, 165, 420, 75, 2620);
                AddBackground(10, 240, 420, 45, 3000);

                if (list.Count > 8)
                {
                    AddBackground(0, 310, 440, 155, 5054);

                    AddBackground(10, 320, 420, 75, 2620);
                    AddBackground(10, 395, 420, 45, 3000);
                }
            }

            for (var i = 0; i < list.Count && i < 12; ++i)
            {
                var m = list[i];

                AddItem(20 + i % 4 * 100, 20 + i / 4 * 155, ShrinkTable.Lookup(m));
                AddButton(20 + i % 4 * 100, 130 + i / 4 * 155, 4005, 4007, i + 1);

                if (m.Name != null)
                {
                    AddHtml(20 + i % 4 * 100, 90 + i / 4 * 155, 90, 40, m.Name);
                }
            }
        }
Exemplo n.º 13
0
        protected override void Compile()
        {
            if (Entity != null)
            {
                var id = 0;

                if (Entity is Mobile)
                {
                    id = ShrinkTable.Lookup((Mobile)Entity);
                }
                else if (Entity is Item)
                {
                    id = ((Item)Entity).ItemID;
                }

                int hue;

                if (Entity.GetPropertyValue("Hue", out hue))
                {
                    Icon = IconDefinition.FromItem(id, hue);
                }
                else
                {
                    Icon = IconDefinition.FromItem(id);
                }

                Properties = Entity.GetOPLStrings(User).ToArray();
            }

            if (Icon == null || Icon.IsEmpty)
            {
                Icon = _DefIcon;
            }

            if (Properties.IsNullOrEmpty())
            {
                Properties = _DefProperties;
            }

            base.Compile();
        }
Exemplo n.º 14
0
        private TrackWhoGump(Mobile from, ArrayList list, int range)
            : base(20, 30)
        {
            m_From  = from;
            m_List  = list;
            m_Range = range;

            AddBackground(0, 0, 440, 155, 5054);
            AddBackground(10, 10, 420, 75, 2620);
            AddBackground(10, 85, 420, 45, 3000);

            for (int i = 0; i < list.Count && i < 12; ++i)
            {
                if (i == 4)
                {
                    AddBackground(0, 155, 440, 155, 5054);
                    AddBackground(10, 165, 420, 75, 2620);
                    AddBackground(10, 240, 420, 45, 3000);
                }
                else if (i == 8)
                {
                    AddBackground(0, 310, 440, 155, 5054);
                    AddBackground(10, 320, 420, 75, 2620);
                    AddBackground(10, 395, 420, 45, 3000);
                }

                Mobile m = (Mobile)list[i];

                AddItem(20 + ((i % 4) * 100), 20 + ((i / 4) * 155), ShrinkTable.Lookup(m));
                AddButton(20 + ((i % 4) * 100), 130 + ((i / 4) * 155), 4005, 4007, i + 1, GumpButtonType.Reply, 0);

                if (m.Name != null)
                {
                    AddHtml(20 + ((i % 4) * 100), 90 + ((i / 4) * 155), 90, 40, m.Name, false, false);
                }
            }
        }
Exemplo n.º 15
0
        public ConfirmBuyPetGump(PetBroker broker, PetBrokerEntry entry)
        {
            m_Broker = broker;
            m_Entry  = entry;

            AddHtmlLocalized(215, 10, 200, 18, 1150311, RedColor16, false, false); // Animal Broker

            if (m_Broker.Plot.ShopName != null && m_Broker.Plot.ShopName.Length > 0)
            {
                AddHtml(173, 40, 173, 18, Color(FormatStallName(m_Broker.Plot.ShopName), BlueColor), false, false);
            }
            else
            {
                AddHtmlLocalized(180, 40, 200, 18, 1150314, BlueColor16, false, false); // This Shop Has No Name
            }
            AddHtml(173, 65, 173, 18, Color(FormatBrokerName(String.Format("Proprietor: {0}", broker.Name)), BlueColor), false, false);

            AddHtmlLocalized(10, 100, 500, 40, 1150370, RedColor16, false, false);             // Please confirm your purchase order below, and click "ACCEPT" if you wish to purchase this animal.

            AddHtmlLocalized(150, 160, 200, 18, 1150371, OrangeColor16, false, false);         // Animal Type:
            AddHtmlLocalized(145, 180, 200, 18, 1150372, OrangeColor16, false, false);         // Animal Name:
            AddHtmlLocalized(157, 200, 150, 18, 1150373, OrangeColor16, false, false);         // Sale Price:

            AddHtml(240, 160, 200, 18, Color(entry.TypeName, BlueColor), false, false);
            AddHtml(240, 180, 200, 18, Color(entry.Pet.Name, BlueColor), false, false);
            AddHtml(240, 200, 200, 18, Color(FormatAmt(entry.SalePrice), BlueColor), false, false);

            int itemID = ShrinkTable.Lookup(entry.Pet);

            //if (entry.Pet is WildTiger)
            //    itemID = 0x9844;

            AddItem(240, 250, itemID);

            AddHtmlLocalized(240, 360, 150, 18, 1150375, OrangeColor16, false, false);             // Purchas Pet
            AddButton(200, 360, 4005, 4007, 1, GumpButtonType.Reply, 0);
        }
Exemplo n.º 16
0
        public override string Compile()
        {
            var compiled = String.Format(_Format0, _X, _Y, Width, Height, " ".WrapUOHtmlBG(Color.Transparent));

            var hue = _BodyHue;

            if (_SolidHue >= 0)
            {
                hue = _SolidHue;
            }

            var gump = ArtworkSupport.LookupGump(_Body);

            if (gump <= 0)
            {
                gump = ShrinkTable.Lookup(_Body, 0);

                if (gump > 0)
                {
                    if (hue > 0 || (_SolidHue >= 0 && hue == _SolidHue))
                    {
                        compiled += String.Format(_Format3, _X, _Y, gump, FixHue(hue));
                    }
                    else
                    {
                        compiled += String.Format(_Format2, _X, _Y, gump);
                    }
                }

                return(compiled);
            }

            if (hue > 0 || (_SolidHue >= 0 && hue == _SolidHue))
            {
                compiled += String.Format(_Format1B, _X, _Y, gump, FixHue(hue));
            }
            else
            {
                compiled += String.Format(_Format1A, _X, _Y, gump);
            }

            var hideHair  = _Body.IsGhost;
            var hidePants = false;
            var props     = String.Empty;

            compiled += Compile(ref props, ref hidePants, ref hideHair);

            if (!_Body.IsGhost && _FacialHairID > 0)
            {
                gump = ArtworkSupport.LookupGump(_FacialHairID, _Body.IsFemale);

                if (gump > 0)
                {
                    hue = _SolidHue >= 0 ? _SolidHue : _FacialHairHue;

                    if (hue > 0 || (_SolidHue >= 0 && hue == _SolidHue))
                    {
                        compiled += String.Format(_Format1B, _X, _Y, gump, FixHue(hue));
                    }
                    else
                    {
                        compiled += String.Format(_Format1A, _X, _Y, gump);
                    }
                }
            }

            if (!hideHair && _HairID > 0)
            {
                gump = ArtworkSupport.LookupGump(_HairID, _Body.IsFemale);

                if (gump > 0)
                {
                    hue = _SolidHue >= 0 ? _SolidHue : _HairHue;

                    if (hue > 0 || (_SolidHue >= 0 && hue == _SolidHue))
                    {
                        compiled += String.Format(_Format1B, _X, _Y, gump, FixHue(hue));
                    }
                    else
                    {
                        compiled += String.Format(_Format1A, _X, _Y, gump);
                    }
                }
            }

            return(compiled + props);
        }
Exemplo n.º 17
0
        public override void OnCast()
        {
            if (!Caster.CanBeginAction(typeof(AlterationSpell)))
            {
                if (Caster is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)Caster;
                    pm.Transformation.OnTransformationChange(0, null, -1, true);
                }
                else
                {
                    Caster.BodyMod = 0;
                    Caster.NameMod = null;
                }

                Caster.EndAction(typeof(AlterationSpell));

                Effects.SendTargetParticles(Caster, 0x373A, 10, 15, 5036, EffectLayer.Head);
                Caster.PlaySound(0x3BD);

                if (Caster is PlayerMobile)
                {
                    ((PlayerMobile)Caster).CheckRaceSkin();
                }

                BaseArmor.ValidateMobile(Caster);
            }
            else if (m_NewBody == 0)
            {
                ArrayList entries = new ArrayList();
                entries.Add(new MetamorphoseGump.MetamorphoseEntry("Chien", ShrinkTable.Lookup(0xD9), 0xD9, 1015237, 0, 0, 0, 0, 0));
                entries.Add(new MetamorphoseGump.MetamorphoseEntry("Chat", ShrinkTable.Lookup(0xC9), 0xC9, 1015246, 0, 0, 0, 0, 0));
                entries.Add(new MetamorphoseGump.MetamorphoseEntry("Diablotin", ShrinkTable.Lookup(0x4A), 0x4A, 1015246, 0, 0, 0, 0, 0));
                entries.Add(new MetamorphoseGump.MetamorphoseEntry("Morlask", ShrinkTable.Lookup(0x27), 0x27, 1015246, 0, 0, 0, 0, 0));

                Caster.SendGump(new MetamorphoseGump(Caster, Scroll, entries, 1));
            }
            else if (!CheckTransformation(Caster, Caster))
            {
                DoFizzle();
            }
            else if (CheckSequence())
            {
                if (Caster.BeginAction(typeof(AlterationSpell)))
                {
                    if (m_NewBody != 0)
                    {
                        if (!((Body)m_NewBody).IsHuman)
                        {
                            Mobiles.IMount mt = Caster.Mount;

                            if (mt != null)
                            {
                                mt.Rider = null;
                            }
                        }

                        if (Caster is PlayerMobile)
                        {
                            PlayerMobile pm = (PlayerMobile)Caster;
                            pm.Transformation.OnTransformationChange(m_NewBody, m_NameMod, m_HueMod, true);
                        }
                        else
                        {
                            Caster.BodyMod = m_NewBody;
                            Caster.NameMod = m_NameMod;
                            Caster.HueMod  = m_HueMod;
                        }

                        Effects.SendTargetParticles(Caster, 0x373A, 10, 15, 5036, EffectLayer.Head);
                        Caster.PlaySound(0x3BD);
                    }
                }
            }

            FinishSequence();
        }
Exemplo n.º 18
0
        private TrackWhoGump(Mobile from, List <Mobile> list, int range)
            : base(20, 30)
        {
            m_From  = from;
            m_List  = list;
            m_Range = range;

            AddPage(0);

            AddBackground(0, 0, 440, 155, 5054);

            AddBackground(10, 10, 420, 75, 2620);
            AddBackground(10, 85, 420, 45, 3000);

            if (list.Count > 4)
            {
                AddBackground(0, 155, 440, 155, 5054);

                AddBackground(10, 165, 420, 75, 2620);
                AddBackground(10, 240, 420, 45, 3000);
            }

            if (list.Count > 8)
            {
                AddBackground(0, 310, 440, 155, 5054);

                AddBackground(10, 320, 420, 75, 2620);
                AddBackground(10, 395, 420, 45, 3000);
            }

            if (list.Count > 12)
            {
                AddBackground(0, 465, 440, 155, 5054);

                AddBackground(10, 475, 420, 75, 2620);
                AddBackground(10, 550, 420, 45, 3000);
            }

            if (list.Count > 16)
            {
                AddBackground(0, 620, 440, 155, 5054);

                AddBackground(10, 630, 420, 75, 2620);
                AddBackground(10, 705, 420, 45, 3000);
            }

            for (int i = 0; i < list.Count && i < TotalTargetsBySkill(from); ++i)
            {
                Mobile m = list[i];

                var displayHue = m.Hue > 0x8000 ? 0 : m.Hue;

                AddItem(20 + i % 4 * 100, 20 + i / 4 * 155, ShrinkTable.Lookup(m), displayHue);
                AddButton(20 + i % 4 * 100, 130 + i / 4 * 155, 4005, 4007, i + 1, GumpButtonType.Reply, 0);

                string name = m.Name;

                if (m.Player && (m.Body.IsAnimal || m.Body.IsMonster) && bodyNames.ContainsKey(m.Body))
                {
                    bodyNames.TryGetValue(m.Body, out name);
                }

                if (!m.Player && m is BaseCreature bc && !(bc.Controlled && bc.ControlMaster is PlayerMobile) && name != null && name.StartsWith("a "))
                {
                    name = name.Substring(2);
                }

                AddHtml(20 + i % 4 * 100, 90 + i / 4 * 155, 90, 40, name, false, false);
            }
        }
Exemplo n.º 19
0
        public static void RecurseExport(List <CAGJson> list, CategoryEntry ce, string category)
        {
            category = string.IsNullOrWhiteSpace(category) ? ce.Title : $"{category}{ce.Title}";

            if (ce.Matched.Count > 0)
            {
                list.Add(
                    new CAGJson
                {
                    Category = category,
                    Objects  = ce.Matched.Select(
                        cte =>
                    {
                        if (cte.Object is Item item)
                        {
                            var itemID = item.ItemID;

                            if (item is BaseAddon addon && addon.Components.Count == 1)
                            {
                                itemID = addon.Components[0].ItemID;
                            }

                            if (itemID > TileData.MaxItemValue)
                            {
                                itemID = 1;
                            }

                            int?hue = item.Hue & 0x7FFF;

                            if ((hue & 0x4000) != 0)
                            {
                                hue = 0;
                            }

                            return(new CAGObject
                            {
                                Type = cte.Type,
                                ItemID = itemID,
                                Hue = hue == 0 ? null : hue
                            });
                        }

                        if (cte.Object is Mobile m)
                        {
                            var itemID = ShrinkTable.Lookup(m, 1);

                            int?hue = m.Hue & 0x7FFF;

                            if ((hue & 0x4000) != 0)
                            {
                                hue = 0;
                            }

                            return(new CAGObject
                            {
                                Type = cte.Type,
                                ItemID = itemID,
                                Hue = hue == 0 ? null : hue
                            });
                        }

                        throw new InvalidCastException(
                            $"Categorization Type Entry: {cte.Type.Name} is not a valid type."
                            );
                    }
                        )
                               .ToArray()
                }
Exemplo n.º 20
0
 public override int GetPreviewIcon(TMobile t)
 {
     return(t == null ? HueSelector.DefaultIcon : ShrinkTable.Lookup(t));
 }
Exemplo n.º 21
0
        protected override void OnTarget(Mobile from, object target)
        {
            BaseCreature pet = target as BaseCreature;

            if (target == from)
            {
                from.SendMessage("You cannot shrink yourself!");
            }

            else if (target is Item)
            {
                from.SendMessage("You cannot shrink that!");
            }

            else if (target is PlayerMobile)
            {
                from.SendMessage("That person gives you a dirty look!");
            }

            else if (Server.Spells.SpellHelper.CheckCombat(from))
            {
                from.SendMessage("You cannot shrink your pet while you are fighting.");
            }

            else if (null == pet)
            {
                from.SendMessage("That is not a pet!");
            }

            else if ((pet.BodyValue == 400 || pet.BodyValue == 401) && pet.Controlled == false)
            {
                from.SendMessage("That person gives you a dirty look!");
            }

            else if (pet.IsDeadPet)
            {
                from.SendMessage("You cannot shrink the dead!");
            }

            else if (pet.Summoned)
            {
                from.SendMessage("You cannot shrink a summoned creature!");
            }

            else if (!m_StaffCommand && pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map)
            {
                from.SendMessage("Your pet is fighting; you cannot shrink it yet.");
            }

            else if (pet.BodyMod != 0)
            {
                from.SendMessage("You cannot shrink your pet while it is polymorphed.");
            }

            else if (!m_StaffCommand && pet.Controlled == false)
            {
                from.SendMessage("You cannot not shrink wild creatures.");
            }

            else if (!m_StaffCommand && pet.ControlMaster != from)
            {
                from.SendMessage("That is not your pet.");
            }

            else if (!m_StaffCommand && ShrinkItem.IsPackAnimal(pet) && (null != pet.Backpack && pet.Backpack.Items.Count > 0))
            {
                from.SendMessage("You must unload this pet's pack before it can be shrunk.");
            }

            else
            {
                if (pet.ControlMaster != from && !pet.Controlled)
                {
                    SpawnEntry se = pet.Spawner as SpawnEntry;
                    if (se != null && se.UnlinkOnTaming)
                    {
                        pet.Spawner.Remove((ISpawnable)pet);
                        pet.Spawner = null;
                    }

                    pet.CurrentWayPoint = null;
                    pet.ControlMaster   = from;
                    pet.Controlled      = true;
                    pet.ControlTarget   = null;
                    pet.ControlOrder    = OrderType.Come;
                    pet.Guild           = null;
                    pet.Delta(MobileDelta.Noto);
                }

                IEntity p1 = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z), from.Map);
                IEntity p2 = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z + 50), from.Map);

                Effects.SendMovingParticles(p2, p1, ShrinkTable.Lookup(pet), 1, 0, true, false, 0, 3, 1153, 1, 0, EffectLayer.Head, 0x100);
                from.PlaySound(492);
                from.AddToBackpack(new ShrinkItem(pet));

                if (!m_StaffCommand && null != m_ShrinkTool && m_ShrinkTool.ShrinkCharges > 0)
                {
                    m_ShrinkTool.ShrinkCharges--;
                }
            }
        }
Exemplo n.º 22
0
        public static void RecurseExport(XmlTextWriter xml, CategoryEntry ce)
        {
            xml.WriteStartElement("category");

            xml.WriteAttributeString("title", ce.Title);

            List <CategoryEntry> subCats = new List <CategoryEntry>(ce.SubCategories);

            subCats.Sort(new CategorySorter());

            for (int i = 0; i < subCats.Count; ++i)
            {
                RecurseExport(xml, subCats[i]);
            }

            ce.Matched.Sort(new CategoryTypeSorter());

            for (int i = 0; i < ce.Matched.Count; ++i)
            {
                CategoryTypeEntry cte = ce.Matched[i];

                xml.WriteStartElement("object");

                xml.WriteAttributeString("type", cte.Type.ToString());

                if (cte.Object is Item item)
                {
                    int itemID = item.ItemID;

                    if (item is BaseAddon addon && addon.Components.Count == 1)
                    {
                        itemID = addon.Components[0].ItemID;
                    }

                    if (itemID > TileData.MaxItemValue)
                    {
                        itemID = 1;
                    }

                    xml.WriteAttributeString("gfx", XmlConvert.ToString(itemID));

                    int hue = item.Hue & 0x7FFF;

                    if ((hue & 0x4000) != 0)
                    {
                        hue = 0;
                    }

                    if (hue != 0)
                    {
                        xml.WriteAttributeString("hue", XmlConvert.ToString(hue));
                    }

                    item.Delete();
                }
                else if (cte.Object is Mobile mob)
                {
                    int itemID = ShrinkTable.Lookup(mob, 1);

                    xml.WriteAttributeString("gfx", XmlConvert.ToString(itemID));

                    int hue = mob.Hue & 0x7FFF;

                    if ((hue & 0x4000) != 0)
                    {
                        hue = 0;
                    }

                    if (hue != 0)
                    {
                        xml.WriteAttributeString("hue", XmlConvert.ToString(hue));
                    }

                    mob.Delete();
                }

                xml.WriteEndElement();
            }

            xml.WriteEndElement();
        }
Exemplo n.º 23
0
        private static ConquestRewardInfo CreateInstance(Type t)
        {
            if (t == null)
            {
                return(null);
            }

            return(VitaNexCore.TryCatchGet(
                       () =>
            {
                ConquestRewardInfo info;

                if (t.IsEqualOrChildOf <TitleScroll>())
                {
                    var scroll = t.CreateInstanceSafe <TitleScroll>();

                    if (scroll != null)
                    {
                        string name = scroll.ResolveName();

                        if (scroll.Title != null)
                        {
                            name += " - " +
                                    (scroll.Title.MaleTitle == scroll.Title.FemaleTitle
                                            ? scroll.Title.MaleTitle
                                            : (scroll.Title.MaleTitle + ":" + scroll.Title.FemaleTitle));
                        }

                        info = new ConquestRewardInfo(
                            t, scroll.LabelNumber, name, scroll.Amount, scroll.Stackable, scroll.Hue, scroll.ItemID);

                        scroll.Delete();
                        return info;
                    }
                }
                else if (t.IsEqualOrChildOf <HueScroll>())
                {
                    var scroll = t.CreateInstanceSafe <HueScroll>();

                    if (scroll != null)
                    {
                        string name = scroll.ResolveName();

                        if (scroll.TitleHue != null)
                        {
                            name += ": #" + scroll.TitleHue;
                        }

                        info = new ConquestRewardInfo(
                            t, scroll.LabelNumber, name, scroll.Amount, scroll.Stackable, scroll.Hue, scroll.ItemID);

                        scroll.Delete();
                        return info;
                    }
                }
                else if (t.IsEqualOrChildOf <Item>())
                {
                    var item = t.CreateInstanceSafe <Item>();

                    if (item != null)
                    {
                        info = new ConquestRewardInfo(
                            t, item.LabelNumber, item.ResolveName().ToUpperWords(), item.Amount, item.Stackable,
                            item.Hue, item.ItemID);

                        item.Delete();
                        return info;
                    }
                }
                else if (t.IsEqualOrChildOf <Mobile>())
                {
                    var mob = t.CreateInstanceSafe <Mobile>();

                    if (mob != null)
                    {
                        info = new ConquestRewardInfo(t, 0, mob.RawName.ToUpperWords(), 1, false, mob.Hue,
                                                      ShrinkTable.Lookup(mob));

                        mob.Delete();

                        return info;
                    }
                }
                else if (t.IsEqualOrChildOf <IEntity>())
                {
                    var ent = t.CreateInstanceSafe <IEntity>();

                    if (ent != null)
                    {
                        info = new ConquestRewardInfo(t, 0, t.Name.SpaceWords());

                        ent.Delete();
                        return info;
                    }
                }
                else if (t.IsEqualOrChildOf <XmlAttachment>())
                {
                    var xml = t.CreateInstanceSafe <XmlAttachment>();

                    if (xml != null)
                    {
                        info = new ConquestRewardInfo(t, 0, xml.Name.ToUpperWords());

                        xml.Delete();
                        return info;
                    }
                }

                info = new ConquestRewardInfo(t, 0, t.Name.SpaceWords());

                return info;
            },
                       Conquests.CMOptions.ToConsole));
        }
Exemplo n.º 24
0
            protected override void OnTarget(Mobile from, object target)
            {
                if (target == from)
                {
                    from.SendMessage("You cant shrink yourself!");
                }

                else if (target is PlayerMobile)
                {
                    from.SendMessage("That person gives you a dirty look.");
                }

                else if (target is Item)
                {
                    from.SendMessage("You can only shrink pets that you own");
                }

                else if (target is BaseBioCreature && FSATS.EnableBioShrink == false)
                {
                    from.SendMessage("Unnatural creatures cannot be shrunk");
                }

                else if (Server.Spells.SpellHelper.CheckCombat(from))
                {
                    from.SendMessage("You cannot shrink your pet while your fighting.");
                }

                else if (target is BaseCreature)
                {
                    BaseCreature c = (BaseCreature)target;

                    bool   packanimal = false;
                    Type   typ        = c.GetType();
                    string nam        = typ.Name;

                    foreach (string ispack in FSATS.PackAnimals)
                    {
                        if (ispack == nam)
                        {
                            packanimal = true;
                        }
                    }

                    if (c.BodyValue == 400 || c.BodyValue == 401 && c.Controlled == false)
                    {
                        from.SendMessage("That person gives you a dirty look.");
                    }
                    else if (c.ControlMaster != from && c.Controlled == false)
                    {
                        from.SendMessage("This is not your pet.");
                    }
                    else if (packanimal == true && (c.Backpack != null && c.Backpack.Items.Count > 0))
                    {
                        from.SendMessage("You must unload your pets backpack first.");
                    }
                    else if (c.IsDeadPet)
                    {
                        from.SendMessage("You cannot shrink the dead.");
                    }
                    else if (c.Summoned)
                    {
                        from.SendMessage("You cannot shrink a summoned creature.");
                    }
                    else if (c.Combatant != null && c.InRange(c.Combatant, 12) && c.Map == c.Combatant.Map)
                    {
                        from.SendMessage("Your pet is fighting, You cannot shrink it yet.");
                    }
                    else if (c.BodyMod != 0)
                    {
                        from.SendMessage("You cannot shrink your pet while its polymorphed.");
                    }
                    //else if ( Server.Spells.LostArts.CharmBeastSpell.IsCharmed( c ) )
                    //{
                    //	from.SendMessage( "Your hold over this pet is not strong enough to shrink it." );
                    //}
                    else if (c.Controlled == true && c.ControlMaster == from)
                    {
                        Type       type = c.GetType();
                        ShrinkItem si   = new ShrinkItem();
                        si.MobType  = type;
                        si.Pet      = c;
                        si.PetOwner = from;

                        if (c is BaseMount)
                        {
                            BaseMount mount = (BaseMount)c;
                            si.MountID = mount.ItemID;
                        }

                        from.AddToBackpack(si);

                        IEntity p1 = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z), from.Map);
                        IEntity p2 = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z + 50), from.Map);

                        Effects.SendMovingParticles(p2, p1, ShrinkTable.Lookup(c), 1, 0, true, false, 0, 3, 1153, 1, 0, EffectLayer.Head, 0x100);
                        from.PlaySound(492);

                        c.Controlled    = true;
                        c.ControlMaster = null;
                        c.Internalize();

                        c.OwnerAbandonTime = DateTime.MinValue;

                        c.IsStabled = true;

                        m_Powder.Charges -= 1;
                        if (m_Powder.Charges == 0)
                        {
                            m_Powder.Delete();
                        }
                    }
                }
            }
Exemplo n.º 25
0
            private static ItemListEntry[] MakeItemList(ArrayList list)
            {
                ArrayList newList = new ArrayList(list.Count);

                for (int i = 0; i < list.Count; i++)
                {
                    Mobile m = (Mobile)list[i];
                    newList.Add(new ItemListEntry(m.Name != null && m.Name.Length > 0 ? m.Name : "-no name-", ShrinkTable.Lookup(m)));
                }
                return((ItemListEntry[])newList.ToArray(typeof(ItemListEntry)));
            }
Exemplo n.º 26
0
        public override void OnDoubleClick(Mobile from)
        {
            if (MountID > 0)
            {
                BioMount bio = new BioMount();

                bio.Str = this.DNAStr;
                bio.Dex = this.DNADex;
                bio.Int = this.DNAInt;

                bio.HitsMaxSeed = this.DNAHits;
                bio.StamMaxSeed = this.DNAStam;
                bio.ManaMaxSeed = this.DNAMana;

                bio.DamageMin = this.DNADamageMin;
                bio.DamageMax = this.DNADamageMax;

                bio.VirtualArmor = this.DNAArmor;

                bio.FireResistSeed         = this.DNAFireResist;
                bio.ColdResistSeed         = this.DNAColdResist;
                bio.EnergyResistSeed       = this.DNAEnergyResist;
                bio.PoisonResistSeed       = this.DNAPoisonResist;
                bio.PhysicalResistanceSeed = this.DNAPhysicalResist;

                bio.Skills[SkillName.Magery].Base      = this.DNAMagery;
                bio.Skills[SkillName.EvalInt].Base     = this.DNAEvalInt;
                bio.Skills[SkillName.Meditation].Base  = this.DNAMeditation;
                bio.Skills[SkillName.MagicResist].Base = this.DNAMagicResist;
                bio.Skills[SkillName.Poisoning].Base   = this.DNAPoisoning;
                bio.Skills[SkillName.Anatomy].Base     = this.DNAAnatomy;
                bio.Skills[SkillName.Tactics].Base     = this.DNATactics;
                bio.Skills[SkillName.Wrestling].Base   = this.DNAWrestling;

                bio.BodyValue   = this.DNABodyValue;
                bio.BaseSoundID = this.DNASoundID;

                bio.BluntAttack  = this.DNABluntAttack;
                bio.Healing      = this.DNAHealAttack;
                bio.PoisonAttack = this.DNAPoisonAttack;

                bio.TrialByFire  = this.DNATrialByFire;
                bio.IceBlast     = this.DNAIceBlast;
                bio.CometAttack  = this.DNACometAttack;
                bio.CallOfNature = this.DNACallOfNature;
                bio.AcidRain     = this.DNAAcidRain;

                bio.ControlSlots = this.DNAControlSlots;
                bio.MinTameSkill = this.DNAMinTame;

                bio.ControlMaster = from;
                bio.Controlled    = true;

                bio.ItemID = MountID;

                IEntity p1 = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z), from.Map);
                IEntity p2 = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z + 50), from.Map);

                Effects.SendMovingParticles(p1, p2, ShrinkTable.Lookup(DNABodyValue), 1, 0, true, false, 0, 3, 1153, 1, 0, EffectLayer.Head, 0x100);
                from.PlaySound(492);

                bio.MoveToWorld(from.Location, from.Map);
                this.Delete();
            }
            else
            {
                BioCreature bio = new BioCreature();

                bio.Str = this.DNAStr;
                bio.Dex = this.DNADex;
                bio.Int = this.DNAInt;

                bio.HitsMaxSeed = this.DNAHits;
                bio.StamMaxSeed = this.DNAStam;
                bio.ManaMaxSeed = this.DNAMana;

                bio.DamageMin = this.DNADamageMin;
                bio.DamageMax = this.DNADamageMax;

                bio.VirtualArmor = this.DNAArmor;

                bio.FireResistSeed         = this.DNAFireResist;
                bio.ColdResistSeed         = this.DNAColdResist;
                bio.EnergyResistSeed       = this.DNAEnergyResist;
                bio.PoisonResistSeed       = this.DNAPoisonResist;
                bio.PhysicalResistanceSeed = this.DNAPhysicalResist;

                bio.Skills[SkillName.Magery].Base      = this.DNAMagery;
                bio.Skills[SkillName.EvalInt].Base     = this.DNAEvalInt;
                bio.Skills[SkillName.Meditation].Base  = this.DNAMeditation;
                bio.Skills[SkillName.MagicResist].Base = this.DNAMagicResist;
                bio.Skills[SkillName.Poisoning].Base   = this.DNAPoisoning;
                bio.Skills[SkillName.Anatomy].Base     = this.DNAAnatomy;
                bio.Skills[SkillName.Tactics].Base     = this.DNATactics;
                bio.Skills[SkillName.Wrestling].Base   = this.DNAWrestling;

                bio.BodyValue   = this.DNABodyValue;
                bio.BaseSoundID = this.DNASoundID;

                bio.BluntAttack  = this.DNABluntAttack;
                bio.Healing      = this.DNAHealAttack;
                bio.PoisonAttack = this.DNAPoisonAttack;

                bio.TrialByFire  = this.DNATrialByFire;
                bio.IceBlast     = this.DNAIceBlast;
                bio.CometAttack  = this.DNACometAttack;
                bio.CallOfNature = this.DNACallOfNature;
                bio.AcidRain     = this.DNAAcidRain;

                bio.ControlSlots = this.DNAControlSlots;
                bio.MinTameSkill = this.DNAMinTame;

                bio.ControlMaster = from;
                bio.Controlled    = true;

                IEntity p1 = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z), from.Map);
                IEntity p2 = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z + 50), from.Map);

                Effects.SendMovingParticles(p1, p2, ShrinkTable.Lookup(DNABodyValue), 1, 0, true, false, 0, 3, 1153, 1, 0, EffectLayer.Head, 0x100);
                from.PlaySound(492);

                bio.MoveToWorld(from.Location, from.Map);
                this.Delete();
            }
        }
Exemplo n.º 27
0
        protected override void OnTarget(Mobile from, object target)
        {
            if (target is DNAItem)
            {
                DNAItem dna = (DNAItem)target;
                if (dna.DNAType != DNAType.None)
                {
                    if (dna.DNAType == DNAType.Prowess && m_VialSet.Prowess == false)
                    {
                        m_VialSet.Prowess = true;
                        from.PlaySound(0x240);
                        from.SendMessage("The DNA was successfully added to the DNA Set");

                        m_VialSet.DNAStr            = dna.DNAStr;
                        m_VialSet.DNAHits           = dna.DNAHits;
                        m_VialSet.DNAPhysicalResist = dna.DNAPhysicalResist;
                        m_VialSet.DNADamageMin      = dna.DNADamageMin;
                        m_VialSet.DNADamageMax      = dna.DNADamageMax;
                        m_VialSet.DNAArmor          = dna.DNAArmor;

                        m_VialSet.DNAAnatomy   = dna.DNAAnatomy;
                        m_VialSet.DNATactics   = dna.DNATactics;
                        m_VialSet.DNAWrestling = dna.DNAWrestling;

                        dna.Delete();
                    }
                    else if (dna.DNAType == DNAType.Environment && m_VialSet.Environment == false)
                    {
                        m_VialSet.Environment = true;
                        from.PlaySound(0x240);
                        from.SendMessage("The DNA was successfully added to the DNA Set");

                        m_VialSet.DNADex        = dna.DNADex;
                        m_VialSet.DNAStam       = dna.DNAStam;
                        m_VialSet.DNAFireResist = dna.DNAFireResist;
                        m_VialSet.DNAColdResist = dna.DNAColdResist;

                        m_VialSet.DNAPoisoning   = dna.DNAPoisoning;
                        m_VialSet.DNAMagicResist = dna.DNAMagicResist;

                        dna.Delete();
                    }
                    else if (dna.DNAType == DNAType.Mental && m_VialSet.Mental == false)
                    {
                        m_VialSet.Mental = true;
                        from.PlaySound(0x240);
                        from.SendMessage("The DNA was successfully added to the DNA Set");

                        m_VialSet.DNAInt          = dna.DNAInt;
                        m_VialSet.DNAMana         = dna.DNAMana;
                        m_VialSet.DNAEnergyResist = dna.DNAEnergyResist;
                        m_VialSet.DNAPoisonResist = dna.DNAPoisonResist;

                        m_VialSet.DNAMagery     = dna.DNAMagery;
                        m_VialSet.DNAEvalInt    = dna.DNAEvalInt;
                        m_VialSet.DNAMeditation = dna.DNAMeditation;

                        dna.Delete();
                    }
                    else if (dna.DNAType == DNAType.Mimic && m_VialSet.Mimic == false)
                    {
                        m_VialSet.Mimic = true;
                        from.PlaySound(0x240);
                        from.SendMessage("The DNA was successfully added to the DNA Set");

                        m_VialSet.DNABodyValue = dna.DNABodyValue;
                        m_VialSet.DNASoundID   = dna.DNASoundID;

                        m_VialSet.DNABluntAttack  = dna.DNABluntAttack;
                        m_VialSet.DNAHealAttack   = dna.DNAHealAttack;
                        m_VialSet.DNAPoisonAttack = dna.DNAPoisonAttack;

                        m_VialSet.DNATrialByFire  = dna.DNATrialByFire;
                        m_VialSet.DNAIceBlast     = dna.DNAIceBlast;
                        m_VialSet.DNACometAttack  = dna.DNACometAttack;
                        m_VialSet.DNACallOfNature = dna.DNACallOfNature;
                        m_VialSet.DNAAcidRain     = dna.DNAAcidRain;

                        m_VialSet.MountID = dna.MountID;

                        dna.Delete();
                    }
                    else
                    {
                        from.SendMessage("This DNA Set already has this type of DNA.");
                    }


                    if (m_VialSet.Prowess == true && m_VialSet.Environment == true && m_VialSet.Mental == true && m_VialSet.Mimic == true)
                    {
                        m_VialSet.ItemID = 6237;
                        from.SendMessage("You have filled this DNA vial set.");

                        m_VialSet.Prowess     = false;
                        m_VialSet.Environment = false;
                        m_VialSet.Mental      = false;
                        m_VialSet.Mimic       = false;

                        int qua = m_VialSet.DNAStr + m_VialSet.DNADex + m_VialSet.DNAInt + m_VialSet.DNAHits + m_VialSet.DNAStam + m_VialSet.DNAMana + m_VialSet.DNAPhysicalResist + m_VialSet.DNAFireResist + m_VialSet.DNAColdResist + m_VialSet.DNAEnergyResist + m_VialSet.DNAPoisonResist + m_VialSet.DNADamageMin + m_VialSet.DNADamageMax + m_VialSet.DNAArmor;

                        if (qua <= 250)
                        {
                            m_VialSet.DNAQuality      = DNAQuality.VeryLow;
                            m_VialSet.DNAMinTame      = 0;
                            m_VialSet.DNAControlSlots = 3;
                        }
                        else if (qua <= 500)
                        {
                            m_VialSet.DNAQuality      = DNAQuality.Low;
                            m_VialSet.DNAMinTame      = 0;
                            m_VialSet.DNAControlSlots = 3;
                        }
                        else if (qua <= 1250)
                        {
                            m_VialSet.DNAQuality      = DNAQuality.BelowAverage;
                            m_VialSet.DNAMinTame      = 0;
                            m_VialSet.DNAControlSlots = 3;
                        }
                        else if (qua <= 2500)
                        {
                            m_VialSet.DNAQuality      = DNAQuality.Average;
                            m_VialSet.DNAMinTame      = Utility.RandomMinMax(0, 5);
                            m_VialSet.DNAControlSlots = 3;
                        }
                        else if (qua <= 3500)
                        {
                            m_VialSet.DNAQuality      = DNAQuality.AboveAverage;
                            m_VialSet.DNAMinTame      = Utility.RandomMinMax(0, 25);
                            m_VialSet.DNAControlSlots = 3;
                        }
                        else if (qua <= 4500)
                        {
                            m_VialSet.DNAQuality      = DNAQuality.High;
                            m_VialSet.DNAMinTame      = Utility.RandomMinMax(0, 50);
                            m_VialSet.DNAControlSlots = 3;
                        }
                        else if (qua <= 5000000)
                        {
                            m_VialSet.DNAQuality      = DNAQuality.VeryHigh;
                            m_VialSet.DNAMinTame      = Utility.RandomMinMax(0, 100);
                            m_VialSet.DNAControlSlots = 3;
                        }

                        //Cap Skills if over 100
                        if (m_VialSet.DNAMagery >= 100.0)
                        {
                            m_VialSet.DNAMagery = 100.0;
                        }

                        if (m_VialSet.DNAEvalInt >= 100.0)
                        {
                            m_VialSet.DNAEvalInt = 100.0;
                        }

                        if (m_VialSet.DNAMeditation >= 100.0)
                        {
                            m_VialSet.DNAMeditation = 100.0;
                        }

                        if (m_VialSet.DNAPoisoning >= 100.0)
                        {
                            m_VialSet.DNAPoisoning = 100.0;
                        }

                        if (m_VialSet.DNAMagicResist >= 100.0)
                        {
                            m_VialSet.DNAMagicResist = 100.0;
                        }

                        if (m_VialSet.DNAWrestling >= 100.0)
                        {
                            m_VialSet.DNAWrestling = 100.0;
                        }

                        if (m_VialSet.DNAAnatomy >= 100.0)
                        {
                            m_VialSet.DNAAnatomy = 100.0;
                        }

                        if (m_VialSet.DNATactics >= 100.0)
                        {
                            m_VialSet.DNATactics = 100.0;
                        }

                        if (m_VialSet.DNAStr >= FSATS.BioSTR)
                        {
                            m_VialSet.DNAStr = FSATS.BioSTR;
                        }

                        if (m_VialSet.DNADex >= FSATS.BioDEX)
                        {
                            m_VialSet.DNADex = FSATS.BioDEX;
                        }

                        if (m_VialSet.DNAInt >= FSATS.BioINT)
                        {
                            m_VialSet.DNAInt = FSATS.BioINT;
                        }

                        if (m_VialSet.DNAHits >= FSATS.BioHITS)
                        {
                            m_VialSet.DNAHits = FSATS.BioHITS;
                        }

                        if (m_VialSet.DNAStam >= FSATS.BioSTAM)
                        {
                            m_VialSet.DNAStam = FSATS.BioSTAM;
                        }

                        if (m_VialSet.DNAMana >= FSATS.BioMANA)
                        {
                            m_VialSet.DNAMana = FSATS.BioMANA;
                        }

                        if (m_VialSet.DNAFireResist >= 0 && m_VialSet.DNABodyValue == 400 || m_VialSet.DNABodyValue == 400)
                        {
                            m_VialSet.DNAFireResist = 0;
                        }
                        else if (m_VialSet.DNAFireResist >= FSATS.BioFire)
                        {
                            m_VialSet.DNAFireResist = FSATS.BioFire;
                        }

                        if (m_VialSet.DNAColdResist >= 0 && m_VialSet.DNABodyValue == 400 || m_VialSet.DNABodyValue == 400)
                        {
                            m_VialSet.DNAColdResist = 0;
                        }
                        else if (m_VialSet.DNAColdResist >= FSATS.BioCold)
                        {
                            m_VialSet.DNAColdResist = FSATS.BioCold;
                        }

                        if (m_VialSet.DNAEnergyResist >= 0 && m_VialSet.DNABodyValue == 400 || m_VialSet.DNABodyValue == 400)
                        {
                            m_VialSet.DNAEnergyResist = 0;
                        }
                        else if (m_VialSet.DNAEnergyResist >= FSATS.BioEnergy)
                        {
                            m_VialSet.DNAEnergyResist = FSATS.BioEnergy;
                        }

                        if (m_VialSet.DNAPoisonResist >= 0 && m_VialSet.DNABodyValue == 400 || m_VialSet.DNABodyValue == 400)
                        {
                            m_VialSet.DNAPoisonResist = 0;
                        }
                        else if (m_VialSet.DNAPoisonResist >= FSATS.BioPoison)
                        {
                            m_VialSet.DNAPoisonResist = FSATS.BioPoison;
                        }

                        if (m_VialSet.DNAPhysicalResist >= 0 && m_VialSet.DNABodyValue == 400 || m_VialSet.DNABodyValue == 400)
                        {
                            m_VialSet.DNAPhysicalResist = 0;
                        }
                        else if (m_VialSet.DNAPhysicalResist >= FSATS.BioPhys)
                        {
                            m_VialSet.DNAPhysicalResist = FSATS.BioPhys;
                        }

                        if (m_VialSet.DNADamageMin >= FSATS.BioMinDam)
                        {
                            m_VialSet.DNADamageMin = FSATS.BioMinDam;
                        }

                        if (m_VialSet.DNADamageMax >= FSATS.BioMaxDam)
                        {
                            m_VialSet.DNADamageMax = FSATS.BioMaxDam;
                        }

                        if (m_VialSet.DNAArmor >= FSATS.BioVArmor)
                        {
                            m_VialSet.DNAArmor = FSATS.BioVArmor;
                        }

                        m_VialSet.IsFull = true;

                        if (m_VialSet.IsFull == true)
                        {
                            BioPetItem bio = new BioPetItem();

                            bio.DNAStr = m_VialSet.DNAStr;
                            bio.DNADex = m_VialSet.DNADex;
                            bio.DNAInt = m_VialSet.DNAInt;

                            bio.DNAHits = m_VialSet.DNAHits;
                            bio.DNAStam = m_VialSet.DNAStam;
                            bio.DNAMana = m_VialSet.DNAMana;

                            bio.DNADamageMin = m_VialSet.DNADamageMin;
                            bio.DNADamageMax = m_VialSet.DNADamageMax;

                            bio.DNAArmor = m_VialSet.DNAArmor;

                            bio.DNAFireResist     = m_VialSet.DNAFireResist;
                            bio.DNAColdResist     = m_VialSet.DNAColdResist;
                            bio.DNAEnergyResist   = m_VialSet.DNAEnergyResist;
                            bio.DNAPoisonResist   = m_VialSet.DNAPoisonResist;
                            bio.DNAPhysicalResist = m_VialSet.DNAPhysicalResist;

                            bio.DNAMagery      = m_VialSet.DNAMagery;
                            bio.DNAEvalInt     = m_VialSet.DNAEvalInt;
                            bio.DNAMeditation  = m_VialSet.DNAMeditation;
                            bio.DNAMagicResist = m_VialSet.DNAMagicResist;
                            bio.DNAPoisoning   = m_VialSet.DNAPoisoning;
                            bio.DNAAnatomy     = m_VialSet.DNAAnatomy;
                            bio.DNATactics     = m_VialSet.DNATactics;
                            bio.DNAWrestling   = m_VialSet.DNAWrestling;

                            bio.DNABodyValue = m_VialSet.DNABodyValue;
                            bio.DNASoundID   = m_VialSet.DNASoundID;

                            bio.DNABluntAttack  = m_VialSet.DNABluntAttack;
                            bio.DNAHealAttack   = m_VialSet.DNAHealAttack;
                            bio.DNAPoisonAttack = m_VialSet.DNAPoisonAttack;

                            bio.DNATrialByFire  = m_VialSet.DNATrialByFire;
                            bio.DNAIceBlast     = m_VialSet.DNAIceBlast;
                            bio.DNACometAttack  = m_VialSet.DNACometAttack;
                            bio.DNACallOfNature = m_VialSet.DNACallOfNature;
                            bio.DNAAcidRain     = m_VialSet.DNAAcidRain;

                            bio.DNAControlSlots = 5;
                            bio.DNAMinTame      = 120.0;

                            bio.MountID = m_VialSet.MountID;

                            bio.ItemID = ShrinkTable.Lookup(m_VialSet.DNABodyValue);

                            bio.Visible = false;
                            from.AddToBackpack(bio);
                            m_VialSet.Delete();

                            from.SendGump(new BioExpGump(-1, from, bio, 0, 0, 0, 0, 0));
                        }
                    }
                }
            }
            else
            {
                from.SendMessage("That cannot be added to this DNA set.");
            }
        }
Exemplo n.º 28
0
        public override void AppendTo(IGumpWriter disp)
        {
            disp.AppendLayout(_Layout0);
            disp.AppendLayout(_X);
            disp.AppendLayout(_Y);
            disp.AppendLayout(Width);
            disp.AppendLayout(Height);
            disp.AppendLayout(Parent.Intern(" ".WrapUOHtmlBG(Color.Transparent)));
            disp.AppendLayout(false);
            disp.AppendLayout(false);

            var hue = _BodyHue;

            if (_SolidHue >= 0)
            {
                hue = _SolidHue;
            }

            var gump = ArtworkSupport.LookupGump(_Body);

            if (gump <= 0)
            {
                gump = ShrinkTable.Lookup(_Body, 0);

                if (gump > 0)
                {
                    disp.AppendLayout(hue == 0 ? _Layout3A : _Layout4A);
                    disp.AppendLayout(_X);
                    disp.AppendLayout(_Y);
                    disp.AppendLayout(gump);

                    if (hue > 0 || (_SolidHue >= 0 && hue == _SolidHue))
                    {
                        disp.AppendLayout(FixHue(hue));
                    }
                }

                return;
            }

            disp.AppendLayout(_Layout2A);
            disp.AppendLayout(_X);
            disp.AppendLayout(_Y);
            disp.AppendLayout(gump);

            if (hue != 0)
            {
                disp.AppendLayout(_Layout2Hue);
                disp.AppendLayoutNS(FixHue(hue));
            }

            var hideHair  = _Body.IsGhost;
            var hidePants = false;
            var props     = String.Empty;

            AppendTo(disp, ref props, ref hidePants, ref hideHair);

            if (!_Body.IsGhost && _FacialHairID > 0)
            {
                gump = ArtworkSupport.LookupGump(_FacialHairID, _Body.IsFemale);

                if (gump > 0)
                {
                    disp.AppendLayout(_Layout2B);
                    disp.AppendLayout(_X);
                    disp.AppendLayout(_Y);
                    disp.AppendLayout(gump);

                    hue = _SolidHue >= 0 ? _SolidHue : _FacialHairHue;

                    if (hue > 0 || (_SolidHue >= 0 && hue == _SolidHue))
                    {
                        disp.AppendLayout(_Layout2Hue);
                        disp.AppendLayoutNS(FixHue(hue));
                    }
                }
            }

            if (!hideHair && _HairID > 0)
            {
                gump = ArtworkSupport.LookupGump(_HairID, _Body.IsFemale);

                if (gump > 0)
                {
                    disp.AppendLayout(_Layout2B);
                    disp.AppendLayout(_X);
                    disp.AppendLayout(_Y);
                    disp.AppendLayout(gump);

                    hue = _SolidHue >= 0 ? _SolidHue : _HairHue;

                    if (hue > 0 || (_SolidHue >= 0 && hue == _SolidHue))
                    {
                        disp.AppendLayout(_Layout2Hue);
                        disp.AppendLayoutNS(FixHue(hue));
                    }
                }
            }

            if (!_Properties || String.IsNullOrWhiteSpace(props))
            {
                return;
            }

            var noHue  = FixHue(0);
            var noText = Parent.Intern(" ");

            props = props.Trim(',');

            foreach (var item in props.Split(',').Select(Int32.Parse).Select(s => _Items.Find(i => i.Serial.Value == s)))
            {
                foreach (var b in item.GetPaperdollBounds())
                {
                    disp.AppendLayout(_Layout5);
                    disp.AppendLayout(_X + b.X);
                    disp.AppendLayout(_Y + b.Y);
                    disp.AppendLayout(b.Width);
                    disp.AppendLayout(b.Height);
                    disp.AppendLayout(noHue);
                    disp.AppendLayout(noText);

                    disp.AppendLayout(_Layout6);
                    disp.AppendLayout(item.Serial.Value);
                }
            }
        }
Exemplo n.º 29
0
 private static void AddCreature(BaseCreature mob, List <CreatureInfo> list)
 {
     if (mob.Body == 0x190 || mob.Body == 0x191 || string.IsNullOrWhiteSpace(mob.Name))
     {
         return;
     }
     list.Add(new CreatureInfo()
     {
         Name = mob.Name, Difficulty = MonsterLevels.GetMonsterDifficultyLevelText(mob), Hits = mob.Hits, GraphicID = ShrinkTable.Lookup(mob)
     });
 }
Exemplo n.º 30
0
        public static void RecurseExport(XmlTextWriter xml, CategoryEntry ce)
        {
            xml.WriteStartElement("category");

            xml.WriteAttributeString("title", ce.Title);

            ArrayList subCats = new ArrayList(ce.SubCategories);

            subCats.Sort(new CategorySorter());

            for (int i = 0; i < subCats.Count; ++i)
            {
                RecurseExport(xml, (CategoryEntry)subCats[i]);
            }

            ce.Matched.Sort(new CategorySorter());

            for (int i = 0; i < ce.Matched.Count; ++i)
            {
                CategoryTypeEntry cte = (CategoryTypeEntry)ce.Matched[i];

                xml.WriteStartElement("object");

                xml.WriteAttributeString("type", cte.Type.ToString());

                object obj = cte.Object;

                if (obj is Item)
                {
                    Item item = (Item)obj;

                    int itemID = item.ItemID;

                    if (item is BaseAddon && ((BaseAddon)item).Components.Count == 1)
                    {
                        itemID = ((AddonComponent)(((BaseAddon)item).Components[0])).ItemID;
                    }

                    if (itemID >= 0x4000)
                    {
                        itemID = 1;
                    }

                    xml.WriteAttributeString("gfx", XmlConvert.ToString(itemID));

                    int hue = item.Hue & 0x7FFF;

                    if ((hue & 0x4000) != 0)
                    {
                        hue = 0;
                    }

                    if (hue != 0)
                    {
                        xml.WriteAttributeString("hue", XmlConvert.ToString(hue));
                    }

                    item.Delete();
                }
                else if (obj is Mobile)
                {
                    Mobile mob = (Mobile)obj;

                    int itemID = ShrinkTable.Lookup(mob, 1);

                    xml.WriteAttributeString("gfx", XmlConvert.ToString(itemID));

                    int hue = mob.Hue & 0x7FFF;

                    if ((hue & 0x4000) != 0)
                    {
                        hue = 0;
                    }

                    if (hue != 0)
                    {
                        xml.WriteAttributeString("hue", XmlConvert.ToString(hue));
                    }

                    mob.Delete();
                }

                xml.WriteEndElement();
            }

            xml.WriteEndElement();
        }