Esempio n. 1
0
        public override bool OnDragLift(Mobile from)
        {
            #region Mondain's Legacy Sets
            if (Parent is Mobile && from == Parent)
            {
                if (IsSetItem && m_SetEquipped)
                {
                    SetHelper.RemoveSetBonus(from, SetID, this);
                }
            }
            #endregion

            return(base.OnDragLift(from));
        }
Esempio n. 2
0
        public void IntersectWith(IEnumerable <T> other)
        {
            TSetBase <T> otherAsSet = other as TSetBase <T>;

            if (otherAsSet != null)
            {
                if (otherAsSet.Count == 0)
                {
                    Clear();
                    return;
                }

                int maxIndex = SetHelper.GetMaxIndex();
                for (int i = maxIndex - 1; i >= 0; --i)
                {
                    if (SetHelper.IsValidIndex(i))
                    {
                        T item = Get(i);
                        if (!otherAsSet.Contains(item))
                        {
                            RemoveAtInternal(i);
                        }
                    }
                }
            }
            else
            {
                // HashSet to avoid duplicates
                HashSet <T> set = new HashSet <T>(other);
                if (set.Count == 0)
                {
                    Clear();
                    return;
                }

                int maxIndex = SetHelper.GetMaxIndex();
                for (int i = maxIndex - 1; i >= 0; --i)
                {
                    if (SetHelper.IsValidIndex(i))
                    {
                        T item = Get(i);
                        if (!set.Contains(item))
                        {
                            RemoveAtInternal(i);
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        public override void OnRemoved(object parent)
        {
            if (parent is Mobile)
            {
                Mobile mob = (Mobile)parent;

                m_Attributes.RemoveStatBonuses(mob);
                m_AosSkillBonuses.Remove();

                if (IsSetItem && m_SetEquipped)
                {
                    SetHelper.RemoveSetBonus(mob, SetID, this);
                }
            }
        }
        public void IntersectionSet_ValidInput_ReturnsCorrectSet(Set left, Set right, Set exp)
        {
            IInterpreterSet        parent           = Substitute.For <IInterpreterSet>();
            SetHelper              setHelper        = SetUpHelper(parent);
            SetExpression          leftExpr         = new SetExpression(null, null, null, 0, 0);
            SetExpression          rightExpr        = new SetExpression(null, null, null, 0, 0);
            IntersectionExpression intersectionExpr = new IntersectionExpression(leftExpr, rightExpr, 0, 0);

            parent.DispatchSet(leftExpr, Arg.Any <List <object> >()).Returns(left);
            parent.DispatchSet(rightExpr, Arg.Any <List <object> >()).Returns(right);

            Set result = setHelper.IntersectionSet(intersectionExpr, new List <object>());

            result.Should().BeEquivalentTo(exp);
        }
        public void SubtractionSet_f_f(int[,] left, int[,] right, int[,] expected)
        {
            IInterpreterSet       parent    = Substitute.For <IInterpreterSet>();
            SetHelper             setHelper = SetUpHelper(parent);
            SetExpression         lhsExpr   = new SetExpression(null, null, null, 1, 1);
            SetExpression         rhsExpr   = new SetExpression(null, null, null, 1, 1);
            SubtractionExpression expr      = new SubtractionExpression(lhsExpr, rhsExpr, 0, 0);

            parent.DispatchSet(lhsExpr, Arg.Any <List <object> >()).Returns(getSetFrom2dArray(left));
            parent.DispatchSet(rhsExpr, Arg.Any <List <object> >()).Returns(getSetFrom2dArray(right));

            Set res = setHelper.SubtractionSet(expr, new List <object>());

            res.Should().BeEquivalentTo(getSetFrom2dArray(expected));
        }
        public void UnionSet_SetsWithVaryingNumberOfElementIndices_(Set left, Set right, Set expected)
        {
            IInterpreterSet parent           = Substitute.For <IInterpreterSet>();
            SetHelper       setHelper        = SetUpHelper(parent);
            SetExpression   leftExpr         = new SetExpression(null, null, null, 0, 0);
            SetExpression   rightExpr        = new SetExpression(null, null, null, 0, 0);
            UnionExpression intersectionExpr = new UnionExpression(leftExpr, rightExpr, 0, 0);

            parent.DispatchSet(leftExpr, Arg.Any <List <object> >()).Returns(left);
            parent.DispatchSet(rightExpr, Arg.Any <List <object> >()).Returns(right);

            Set result = setHelper.UnionSet(intersectionExpr, new List <object>());

            result.Should().BeEquivalentTo(expected);
        }
        public async Task Inclue()
        {
            var(b, p, c) = SetHelper.GetBasicData();
            var ctx = new Mock <Context>();

            ctx.Setup(_ => _.Blogs).Returns(b.Object);
            ctx.Setup(_ => _.Posts).Returns(p.Object);
            ctx.Setup(_ => _.Comments).Returns(c.Object);

            var svc = new Service(ctx.Object);

            var actual = await svc.UseInclude();

            Assert.NotNull(actual);
        }
Esempio n. 8
0
        public override void OnAdded(object parent)
        {
            if (parent is Mobile)
            {
                Mobile from = (Mobile)parent;

                m_AosSkillBonuses.AddTo(from);

                int strBonus = m_AosAttributes.BonusStr;
                int dexBonus = m_AosAttributes.BonusDex;
                int intBonus = m_AosAttributes.BonusInt;

                if (strBonus != 0 || dexBonus != 0 || intBonus != 0)
                {
                    string modName = Serial.ToString();

                    if (strBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
                    }

                    if (dexBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
                    }

                    if (intBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
                    }
                }

                from.CheckStatTimers();

                #region Mondain's Legacy Sets
                if (IsSetItem)
                {
                    m_SetEquipped = SetHelper.FullSetEquipped(from, SetID, Pieces);

                    if (m_SetEquipped)
                    {
                        m_LastEquipped = true;
                        SetHelper.AddSetBonus(from, SetID);
                    }
                }
                #endregion
            }
        }
Esempio n. 9
0
        public override bool OnDragLift(Mobile from)
        {
            #region Set Armor
            if (Parent is Mobile && from == Parent)
            {
                Mobile m = (Mobile)Parent;

                if (IsSetItem ? m_SetEquipped : false)
                {
                    SetHelper.RemoveSetBonus(from, SetID, this);
                }
            }
            #endregion

            return(base.OnDragLift(from));
        }
Esempio n. 10
0
        public override void OnRemoved(object parent)
        {
            if (parent is Mobile)
            {
                Mobile mob = (Mobile)parent;

                m_Attributes.RemoveStatBonuses(mob);

                #region Mondain's Legacy Sets
                if (IsSetItem && m_SetEquipped)
                {
                    SetHelper.RemoveSetBonus(mob, SetID, this);
                }
                #endregion
            }
        }
        public void EdgesField_EdgesGraphFieldAndListOfObjects_ReturnsCorrectResult()
        {
            IdentifierExpression identifier = new IdentifierExpression("test", 0, 0);
            EdgesGraphField      input1     = new EdgesGraphField(identifier, 0, 0);
            List <Object>        list       = new List <Object>();
            Set   expected = new Set(new Element(1));
            Graph graph    = new Graph(null, expected, null, null);

            IInterpreterSet parent = Substitute.For <IInterpreterSet>();

            parent.DispatchGraph(identifier, Arg.Any <List <object> >()).Returns(graph);
            SetHelper setHelper = SetUpHelper(parent);

            Set res = setHelper.EdgesField(input1, list);

            res.Should().BeEquivalentTo(expected);
        }
        public void SetExpression_f_f(List <int> min, List <int> max, List <List <object> > indexPairs)
        {
            IInterpreterSet  parent           = Substitute.For <IInterpreterSet>();
            SetHelper        setHelper        = SetUpHelper(parent);
            List <BoundNode> bounds           = GetBounds(parent, min, max);
            LessExpression   expr             = new LessExpression(null, null, 0, 0);
            SetExpression    setExpr          = new SetExpression(new ElementNode(null, null, 0, 0), bounds, expr, 0, 0);
            List <Element>   expectedElements = new List <Element>();

            for (int i = 0; i < indexPairs.Count; i++)
            {
                expectedElements.Add(new Element(indexPairs[i].ConvertAll(x => (int)x)));
            }
            Set expected = new Set(expectedElements);

            parent.DispatchBoolean(expr, Arg.Any <List <Object> >()).Returns(x => IsContained(indexPairs, (List <Object>)x[1]));

            Set result = setHelper.SetExpression(setExpr, new List <object>());

            result.Should().BeEquivalentTo(expected);
        }
Esempio n. 13
0
        private static SetValue <T> getSetMethodFromInitialReflection <T>(T obj)
            where T : class
        {
            var type = typeof(T);

            if (setMethods.ContainsKey(type))
            {
                var found = (SetValue <T>)setMethods[typeof(T)];
                return(found);
            }
            else
            {
                var built = SetHelper.Value <T>(type);
                if (built != null)
                {
                    setMethods.Add(typeof(T), built);
                    return(built);
                }
            }
            return(null);
        }
Esempio n. 14
0
        public override void OnRemoved(object parent)
        {
            if (parent is Mobile from)
            {
                m_AosSkillBonuses.Remove();

                string modName = Serial.ToString();

                from.RemoveStatMod(modName + "Str");
                from.RemoveStatMod(modName + "Dex");
                from.RemoveStatMod(modName + "Int");

                from.CheckStatTimers();

                #region Mondain's Legacy Sets
                if (IsSetItem && m_SetEquipped)
                {
                    SetHelper.RemoveSetBonus(from, SetID, this);
                }
                #endregion
            }
        }
Esempio n. 15
0
 public virtual void GetSetProperties(ObjectPropertyList list)
 {
     SetHelper.GetSetProperties(list, this);
 }
Esempio n. 16
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            #region Mondain's Legacy
            if (m_Quality == ArmorQuality.Exceptional)
            {
                list.Add(1063341);                   // exceptional
            }
            if (m_Crafter != null)
            {
                list.Add(1050043, m_Crafter.Name);                   // crafted by ~1_NAME~
            }
            #endregion

            #region Mondain's Legacy Sets
            if (IsSetItem)
            {
                list.Add(1080240, Pieces.ToString());                   // Part of a Jewelry Set (~1_val~ pieces)

                if (m_SetEquipped)
                {
                    list.Add(1080241);                       // Full Jewelry Set Present
                    SetHelper.GetSetProperties(list, this);
                }
            }
            #endregion

            m_AosSkillBonuses.GetProperties(list);

            int prop;

            #region SA
            if (RequiredRace == Race.Elf)
            {
                list.Add(1075086);                   // Elves Only
            }
            else if (RequiredRace == Race.Gargoyle)
            {
                list.Add(1111709);                   // Gargoyles Only
            }
            #endregion

            if ((prop = ArtifactRarity) > 0)
            {
                list.Add(1061078, prop.ToString());                   // artifact rarity ~1_val~
            }
            if ((prop = m_AosAttributes.WeaponDamage) != 0)
            {
                list.Add(1060401, prop.ToString());                   // damage increase ~1_val~%
            }
            if ((prop = m_AosAttributes.DefendChance) != 0)
            {
                list.Add(1060408, prop.ToString());                   // defense chance increase ~1_val~%
            }
            if ((prop = m_AosAttributes.BonusDex) != 0)
            {
                list.Add(1060409, prop.ToString());                   // dexterity bonus ~1_val~
            }
            if ((prop = m_AosAttributes.EnhancePotions) != 0)
            {
                list.Add(1060411, prop.ToString());                   // enhance potions ~1_val~%
            }
            if ((prop = m_AosAttributes.CastRecovery) != 0)
            {
                list.Add(1060412, prop.ToString());                   // faster cast recovery ~1_val~
            }
            if ((prop = m_AosAttributes.CastSpeed) != 0)
            {
                list.Add(1060413, prop.ToString());                   // faster casting ~1_val~
            }
            if ((prop = m_AosAttributes.AttackChance) != 0)
            {
                list.Add(1060415, prop.ToString());                   // hit chance increase ~1_val~%
            }
            if ((prop = m_AosAttributes.BonusHits) != 0)
            {
                list.Add(1060431, prop.ToString());                   // hit point increase ~1_val~
            }
            if ((prop = m_AosAttributes.BonusInt) != 0)
            {
                list.Add(1060432, prop.ToString());                   // intelligence bonus ~1_val~
            }
            if ((prop = m_AosAttributes.LowerManaCost) != 0)
            {
                list.Add(1060433, prop.ToString());                   // lower mana cost ~1_val~%
            }
            if ((prop = m_AosAttributes.LowerRegCost) != 0)
            {
                list.Add(1060434, prop.ToString());                   // lower reagent cost ~1_val~%
            }
            if ((prop = m_AosAttributes.Luck) != 0)
            {
                list.Add(1060436, prop.ToString());                   // luck ~1_val~
            }
            if ((prop = m_AosAttributes.BonusMana) != 0)
            {
                list.Add(1060439, prop.ToString());                   // mana increase ~1_val~
            }
            if ((prop = m_AosAttributes.RegenMana) != 0)
            {
                list.Add(1060440, prop.ToString());                   // mana regeneration ~1_val~
            }
            if ((prop = m_AosAttributes.NightSight) != 0)
            {
                list.Add(1060441);                   // night sight
            }
            if ((prop = m_AosAttributes.ReflectPhysical) != 0)
            {
                list.Add(1060442, prop.ToString());                   // reflect physical damage ~1_val~%
            }
            if ((prop = m_AosAttributes.RegenStam) != 0)
            {
                list.Add(1060443, prop.ToString());                   // stamina regeneration ~1_val~
            }
            if ((prop = m_AosAttributes.RegenHits) != 0)
            {
                list.Add(1060444, prop.ToString());                   // hit point regeneration ~1_val~
            }
            if ((prop = m_AosAttributes.SpellChanneling) != 0)
            {
                list.Add(1060482);                   // spell channeling
            }
            if ((prop = m_AosAttributes.SpellDamage) != 0)
            {
                list.Add(1060483, prop.ToString());                   // spell damage increase ~1_val~%
            }
            if ((prop = m_AosAttributes.BonusStam) != 0)
            {
                list.Add(1060484, prop.ToString());                   // stamina increase ~1_val~
            }
            if ((prop = m_AosAttributes.BonusStr) != 0)
            {
                list.Add(1060485, prop.ToString());                   // strength bonus ~1_val~
            }
            if ((prop = m_AosAttributes.WeaponSpeed) != 0)
            {
                list.Add(1060486, prop.ToString());                   // swing speed increase ~1_val~%
            }
            #region SA
            if ((prop = m_SAAbsorptionAttributes.CastingFocus) != 0)
            {
                list.Add(1113696, prop.ToString());                   // Casting Focus ~1_val~%
            }
            if ((prop = m_SAAbsorptionAttributes.EaterFire) != 0)
            {
                list.Add(1113593, prop.ToString());                   // Fire Eater ~1_Val~%
            }
            if ((prop = m_SAAbsorptionAttributes.EaterCold) != 0)
            {
                list.Add(1113594, prop.ToString());                   // Cold Eater ~1_Val~%
            }
            if ((prop = m_SAAbsorptionAttributes.EaterPoison) != 0)
            {
                list.Add(1113595, prop.ToString());                   // Poison Eater ~1_Val~%
            }
            if ((prop = m_SAAbsorptionAttributes.EaterEnergy) != 0)
            {
                list.Add(1113596, prop.ToString());                   // Energy Eater ~1_Val~%
            }
            if ((prop = m_SAAbsorptionAttributes.EaterKinetic) != 0)
            {
                list.Add(1113597, prop.ToString());                   // Kinetic Eater ~1_Val~%
            }
            if ((prop = m_SAAbsorptionAttributes.EaterDamage) != 0)
            {
                list.Add(1113598, prop.ToString());                   // Damage Eater ~1_Val~%
            }
            if ((prop = m_SAAbsorptionAttributes.ResonanceFire) != 0)
            {
                list.Add(1113691, prop.ToString());                   // Fire Resonance ~1_val~%
            }
            if ((prop = m_SAAbsorptionAttributes.ResonanceCold) != 0)
            {
                list.Add(1113692, prop.ToString());                   // Cold Resonance ~1_val~%
            }
            if ((prop = m_SAAbsorptionAttributes.ResonancePoison) != 0)
            {
                list.Add(1113693, prop.ToString());                   // Poison Resonance ~1_val~%
            }
            if ((prop = m_SAAbsorptionAttributes.ResonanceEnergy) != 0)
            {
                list.Add(1113694, prop.ToString());                   // Energy Resonance ~1_val~%
            }
            if ((prop = m_SAAbsorptionAttributes.ResonanceKinetic) != 0)
            {
                list.Add(1113695, prop.ToString());                   // Kinetic Resonance ~1_val~%
            }
            #endregion

            base.AddResistanceProperties(list);

            if (m_HitPoints >= 0 && m_MaxHitPoints > 0)
            {
                list.Add(1060639, "{0}\t{1}", m_HitPoints, m_MaxHitPoints);                   // durability ~1_val~ / ~2_val~
            }
            if (IsSetItem && !m_SetEquipped)
            {
                list.Add(1072378);                   // <br>Only when full set is present:
                GetSetProperties(list);
            }
        }
Esempio n. 17
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            #region Mondain's Legacy
            if (m_Quality == ArmorQuality.Exceptional)
            {
                list.Add(1063341);                   // exceptional
            }
            if (m_Crafter != null)
            {
                list.Add(1050043, m_Crafter.Name);                   // crafted by ~1_NAME~
            }
            #endregion

            #region Mondain's Legacy Sets
            if (IsSetItem)
            {
                list.Add(1080240, Pieces.ToString());                   // Part of a Jewelry Set (~1_val~ pieces)

                if (m_SetEquipped)
                {
                    list.Add(1080241);                       // Full Jewelry Set Present
                    SetHelper.GetSetProperties(list, this);
                }
            }
            #endregion

            m_AosSkillBonuses.GetProperties(list);

            int prop;

            if ((prop = ArtifactRarity) > 0)
            {
                list.Add(1061078, prop.ToString());                   // artifact rarity ~1_val~
            }
            if ((prop = m_AosAttributes.WeaponDamage) != 0)
            {
                list.Add(1060401, prop.ToString());                   // damage increase ~1_val~%
            }
            if ((prop = m_AosAttributes.DefendChance) != 0)
            {
                list.Add(1060408, prop.ToString());                   // defense chance increase ~1_val~%
            }
            if ((prop = m_AosAttributes.BonusDex) != 0)
            {
                list.Add(1060409, prop.ToString());                   // dexterity bonus ~1_val~
            }
            if ((prop = m_AosAttributes.EnhancePotions) != 0)
            {
                list.Add(1060411, prop.ToString());                   // enhance potions ~1_val~%
            }
            if ((prop = m_AosAttributes.CastRecovery) != 0)
            {
                list.Add(1060412, prop.ToString());                   // faster cast recovery ~1_val~
            }
            if ((prop = m_AosAttributes.CastSpeed) != 0)
            {
                list.Add(1060413, prop.ToString());                   // faster casting ~1_val~
            }
            if ((prop = m_AosAttributes.AttackChance) != 0)
            {
                list.Add(1060415, prop.ToString());                   // hit chance increase ~1_val~%
            }
            if ((prop = m_AosAttributes.BonusHits) != 0)
            {
                list.Add(1060431, prop.ToString());                   // hit point increase ~1_val~
            }
            if ((prop = m_AosAttributes.BonusInt) != 0)
            {
                list.Add(1060432, prop.ToString());                   // intelligence bonus ~1_val~
            }
            if ((prop = m_AosAttributes.LowerManaCost) != 0)
            {
                list.Add(1060433, prop.ToString());                   // lower mana cost ~1_val~%
            }
            if ((prop = m_AosAttributes.LowerRegCost) != 0)
            {
                list.Add(1060434, prop.ToString());                   // lower reagent cost ~1_val~%
            }
            if ((prop = m_AosAttributes.Luck) != 0)
            {
                list.Add(1060436, prop.ToString());                   // luck ~1_val~
            }
            if ((prop = m_AosAttributes.BonusMana) != 0)
            {
                list.Add(1060439, prop.ToString());                   // mana increase ~1_val~
            }
            if ((prop = m_AosAttributes.RegenMana) != 0)
            {
                list.Add(1060440, prop.ToString());                   // mana regeneration ~1_val~
            }
            if ((prop = m_AosAttributes.NightSight) != 0)
            {
                list.Add(1060441);                   // night sight
            }
            if ((prop = m_AosAttributes.ReflectPhysical) != 0)
            {
                list.Add(1060442, prop.ToString());                   // reflect physical damage ~1_val~%
            }
            if ((prop = m_AosAttributes.RegenStam) != 0)
            {
                list.Add(1060443, prop.ToString());                   // stamina regeneration ~1_val~
            }
            if ((prop = m_AosAttributes.RegenHits) != 0)
            {
                list.Add(1060444, prop.ToString());                   // hit point regeneration ~1_val~
            }
            if ((prop = m_AosAttributes.SpellChanneling) != 0)
            {
                list.Add(1060482);                   // spell channeling
            }
            if ((prop = m_AosAttributes.SpellDamage) != 0)
            {
                list.Add(1060483, prop.ToString());                   // spell damage increase ~1_val~%
            }
            if ((prop = m_AosAttributes.BonusStam) != 0)
            {
                list.Add(1060484, prop.ToString());                   // stamina increase ~1_val~
            }
            if ((prop = m_AosAttributes.BonusStr) != 0)
            {
                list.Add(1060485, prop.ToString());                   // strength bonus ~1_val~
            }
            if ((prop = m_AosAttributes.WeaponSpeed) != 0)
            {
                list.Add(1060486, prop.ToString());                   // swing speed increase ~1_val~%
            }
            base.AddResistanceProperties(list);

            if (m_HitPoints >= 0 && m_MaxHitPoints > 0)
            {
                list.Add(1060639, "{0}\t{1}", m_HitPoints, m_MaxHitPoints);                   // durability ~1_val~ / ~2_val~
            }
        }
        public void TestPermutations(string input, int expectedPermutationsCount)
        {
            var perms = SetHelper.Permutations(input.Split(',').ToList());

            Assert.AreEqual(expectedPermutationsCount, perms.Count);
        }
Esempio n. 19
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            if (m_Crafter != null)
            {
                list.Add(1050043, m_Crafter.Name);                   // crafted by ~1_NAME~
            }
            if (m_Quality == ClothingQuality.Exceptional)
            {
                list.Add(1063341);                   // exceptional
            }
            if (Ammo != null)
            {
                if (Ammo.GetType() == typeof(Arrow))
                {
                    list.Add(1075265, "{0}\t{1}", Ammo.Amount, Capacity);                       // Ammo: ~1_QUANTITY~/~2_CAPACITY~ arrows
                }
                else if (Ammo.GetType() == typeof(Bolt))
                {
                    list.Add(1075266, "{0}\t{1}", Ammo.Amount, Capacity);                       // Ammo: ~1_QUANTITY~/~2_CAPACITY~ bolts
                }
            }
            else
            {
                list.Add(1075265, "{0}\t{1}", 0, Capacity);                   // Ammo: ~1_QUANTITY~/~2_CAPACITY~ arrows
            }
            int prop;

            if ((prop = m_DamageIncrease) != 0)
            {
                list.Add(1074762, prop.ToString());                   // Damage modifier: ~1_PERCENT~%
            }
            if ((prop = m_DamageModifier.Direct) != 0)
            {
                list.Add(1079978, prop.ToString());                   // Direct Damage: ~1_PERCENT~%
            }
            if ((prop = m_DamageModifier.Chaos) != 0)
            {
                list.Add(1072846, prop.ToString());                   // chaos damage ~1_val~%
            }
            if ((prop = m_DamageModifier.Physical) != 0)
            {
                list.Add(1060403, prop.ToString());                   // physical damage ~1_val~%
            }
            if ((prop = m_DamageModifier.Fire) != 0)
            {
                list.Add(1060405, prop.ToString());                   // fire damage ~1_val~%
            }
            if ((prop = m_DamageModifier.Cold) != 0)
            {
                list.Add(1060404, prop.ToString());                   // cold damage ~1_val~%
            }
            if ((prop = m_DamageModifier.Poison) != 0)
            {
                list.Add(1060406, prop.ToString());                   // poison damage ~1_val~%
            }
            if ((prop = m_DamageModifier.Energy) != 0)
            {
                list.Add(1060407, prop.ToString()); // energy damage ~1_val~%
            }
            list.Add(1075085);                      // Requirement: Mondain's Legacy

            if ((prop = m_Attributes.DefendChance) != 0)
            {
                list.Add(1060408, prop.ToString());                   // defense chance increase ~1_val~%
            }
            if ((prop = m_Attributes.BonusDex) != 0)
            {
                list.Add(1060409, prop.ToString());                   // dexterity bonus ~1_val~
            }
            if ((prop = m_Attributes.EnhancePotions) != 0)
            {
                list.Add(1060411, prop.ToString());                   // enhance potions ~1_val~%
            }
            if ((prop = m_Attributes.CastRecovery) != 0)
            {
                list.Add(1060412, prop.ToString());                   // faster cast recovery ~1_val~
            }
            if ((prop = m_Attributes.CastSpeed) != 0)
            {
                list.Add(1060413, prop.ToString());                   // faster casting ~1_val~
            }
            if ((prop = m_Attributes.AttackChance) != 0)
            {
                list.Add(1060415, prop.ToString());                   // hit chance increase ~1_val~%
            }
            if ((prop = m_Attributes.BonusHits) != 0)
            {
                list.Add(1060431, prop.ToString());                   // hit point increase ~1_val~
            }
            if ((prop = m_Attributes.BonusInt) != 0)
            {
                list.Add(1060432, prop.ToString());                   // intelligence bonus ~1_val~
            }
            if ((prop = m_Attributes.LowerManaCost) != 0)
            {
                list.Add(1060433, prop.ToString());                   // lower mana cost ~1_val~%
            }
            if ((prop = m_Attributes.LowerRegCost) != 0)
            {
                list.Add(1060434, prop.ToString());                   // lower reagent cost ~1_val~%
            }
            if ((prop = m_Attributes.Luck) != 0)
            {
                list.Add(1060436, prop.ToString());                   // luck ~1_val~
            }
            if ((prop = m_Attributes.BonusMana) != 0)
            {
                list.Add(1060439, prop.ToString());                   // mana increase ~1_val~
            }
            if ((prop = m_Attributes.RegenMana) != 0)
            {
                list.Add(1060440, prop.ToString());                   // mana regeneration ~1_val~
            }
            if ((prop = m_Attributes.NightSight) != 0)
            {
                list.Add(1060441);                   // night sight
            }
            if ((prop = m_Attributes.ReflectPhysical) != 0)
            {
                list.Add(1060442, prop.ToString());                   // reflect physical damage ~1_val~%
            }
            if ((prop = m_Attributes.RegenStam) != 0)
            {
                list.Add(1060443, prop.ToString());                   // stamina regeneration ~1_val~
            }
            if ((prop = m_Attributes.RegenHits) != 0)
            {
                list.Add(1060444, prop.ToString());                   // hit point regeneration ~1_val~
            }
            if ((prop = m_Attributes.SpellDamage) != 0)
            {
                list.Add(1060483, prop.ToString());                   // spell damage increase ~1_val~%
            }
            if ((prop = m_Attributes.BonusStam) != 0)
            {
                list.Add(1060484, prop.ToString());                   // stamina increase ~1_val~
            }
            if ((prop = m_Attributes.BonusStr) != 0)
            {
                list.Add(1060485, prop.ToString());                   // strength bonus ~1_val~
            }
            if ((prop = m_Attributes.WeaponSpeed) != 0)
            {
                list.Add(1060486, prop.ToString());                   // swing speed increase ~1_val~%
            }
            if ((prop = m_LowerAmmoCost) > 0)
            {
                list.Add(1075208, prop.ToString());                   // Lower Ammo Cost ~1_Percentage~%
            }
            #region Mondain's Legacy Sets
            if (IsSetItem)
            {
                list.Add(1073491, Pieces.ToString());                   // Part of a Weapon/Armor Set (~1_val~ pieces)

                if (m_SetEquipped)
                {
                    list.Add(1073492);                       // Full Weapon/Armor Set Present
                    SetHelper.GetSetProperties(list, this);
                }
            }
            #endregion

            double weight = 0;

            if (Items.Count > 0)
            {
                weight = Items[0].Weight;
            }

            list.Add(1072241, "{0}\t{1}\t{2}\t{3}", Items.Count, DefaultMaxItems, TotalWeight - Weight, DefaultMaxWeight);               // Contents: ~1_COUNT~/~2_MAXCOUNT items, ~3_WEIGHT~/~4_MAXWEIGHT~ stones

            if ((prop = m_WeightReduction) != 0)
            {
                list.Add(1072210, prop.ToString());                   // Weight reduction: ~1_PERCENTAGE~%
            }
            #region Mondain's Legacy Sets
            if (IsSetItem && !m_SetEquipped)
            {
                list.Add(1072378);                   // <br>Only when full set is present:
                SetHelper.GetSetProperties(list, this);
            }
            #endregion
        }
Esempio n. 20
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            if (OwnerName != null)
            {
                list.Add(1153213, OwnerName);
            }

            if (m_Crafter != null)
            {
                list.Add(1050043, m_Crafter.TitleName); // crafted by ~1_NAME~
            }
            if (m_Quality == ItemQuality.Exceptional)
            {
                list.Add(1063341); // exceptional
            }
            if (IsImbued)
            {
                list.Add(1080418); // (Imbued)
            }
            #region Factions
            FactionEquipment.AddFactionProperties(this, list);
            #endregion

            if (m_GorgonLenseCharges > 0)
            {
                list.Add(1112590, m_GorgonLenseCharges.ToString()); //Gorgon Lens Charges: ~1_val~
            }
            #region Mondain's Legacy Sets
            if (IsSetItem)
            {
                list.Add(1080240, Pieces.ToString()); // Part of a Jewelry Set (~1_val~ pieces)

                if (SetID == SetItem.Bestial)
                {
                    list.Add(1151541, BestialSetHelper.GetTotalBerserk(this).ToString()); // Berserk ~1_VAL~
                }
                if (BardMasteryBonus)
                {
                    list.Add(1151553); // Activate: Bard Mastery Bonus x2<br>(Effect: 1 min. Cooldown: 30 min.)
                }
                if (m_SetEquipped)
                {
                    list.Add(1080241); // Full Jewelry Set Present
                    SetHelper.GetSetProperties(list, this);
                }
            }
            #endregion

            m_NegativeAttributes.GetProperties(list, this);
            m_AosSkillBonuses.GetProperties(list);

            int prop;

            #region Stygian Abyss
            if (RequiredRace == Race.Elf)
            {
                list.Add(1075086); // Elves Only
            }
            else if (RequiredRace == Race.Gargoyle)
            {
                list.Add(1111709); // Gargoyles Only
            }
            #endregion

            if ((prop = ArtifactRarity) > 0)
            {
                list.Add(1061078, prop.ToString()); // artifact rarity ~1_val~
            }
            if (m_TalismanProtection != null && !m_TalismanProtection.IsEmpty && m_TalismanProtection.Amount > 0)
            {
                list.Add(1072387, "{0}\t{1}", m_TalismanProtection.Name != null ? m_TalismanProtection.Name.ToString() : "Unknown", m_TalismanProtection.Amount); // ~1_NAME~ Protection: +~2_val~%
            }
            if ((prop = m_AosAttributes.WeaponDamage) != 0)
            {
                list.Add(1060401, prop.ToString()); // damage increase ~1_val~%
            }
            if ((prop = m_AosAttributes.DefendChance) != 0)
            {
                list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~%
            }
            if ((prop = m_AosAttributes.BonusDex) != 0)
            {
                list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~
            }
            if ((prop = m_AosAttributes.EnhancePotions) != 0)
            {
                list.Add(1060411, prop.ToString()); // enhance potions ~1_val~%
            }
            if ((prop = m_AosAttributes.CastRecovery) != 0)
            {
                list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~
            }
            if ((prop = m_AosAttributes.CastSpeed) != 0)
            {
                list.Add(1060413, prop.ToString()); // faster casting ~1_val~
            }
            if ((prop = m_AosAttributes.AttackChance) != 0)
            {
                list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~%
            }
            if ((prop = m_AosAttributes.BonusHits) != 0)
            {
                list.Add(1060431, prop.ToString()); // hit point increase ~1_val~
            }
            if ((prop = m_AosAttributes.BonusInt) != 0)
            {
                list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~
            }
            if ((prop = m_AosAttributes.LowerManaCost) != 0)
            {
                list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~%
            }
            if ((prop = m_AosAttributes.LowerRegCost) != 0)
            {
                list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~%
            }
            if ((prop = m_AosAttributes.Luck) != 0)
            {
                list.Add(1060436, prop.ToString()); // luck ~1_val~
            }
            if ((prop = m_AosAttributes.BonusMana) != 0)
            {
                list.Add(1060439, prop.ToString()); // mana increase ~1_val~
            }
            if ((prop = m_AosAttributes.RegenMana) != 0)
            {
                list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~
            }
            if ((prop = m_AosAttributes.NightSight) != 0)
            {
                list.Add(1060441); // night sight
            }
            if ((prop = m_AosAttributes.ReflectPhysical) != 0)
            {
                list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~%
            }
            if ((prop = m_AosAttributes.RegenStam) != 0)
            {
                list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~
            }
            if ((prop = m_AosAttributes.RegenHits) != 0)
            {
                list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~
            }
            if ((prop = m_AosAttributes.SpellChanneling) != 0)
            {
                list.Add(1060482); // spell channeling
            }
            if ((prop = m_AosAttributes.SpellDamage) != 0)
            {
                list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~%
            }
            if ((prop = m_AosAttributes.BonusStam) != 0)
            {
                list.Add(1060484, prop.ToString()); // stamina increase ~1_val~
            }
            if ((prop = m_AosAttributes.BonusStr) != 0)
            {
                list.Add(1060485, prop.ToString()); // strength bonus ~1_val~
            }
            if ((prop = m_AosAttributes.WeaponSpeed) != 0)
            {
                list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~%
            }
            if (Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0)
            {
                list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~%
            }
            #region SA
            if ((prop = m_SAAbsorptionAttributes.CastingFocus) != 0)
            {
                list.Add(1113696, prop.ToString()); // Casting Focus ~1_val~%
            }
            if ((prop = m_SAAbsorptionAttributes.EaterFire) != 0)
            {
                list.Add(1113593, prop.ToString()); // Fire Eater ~1_Val~%
            }
            if ((prop = m_SAAbsorptionAttributes.EaterCold) != 0)
            {
                list.Add(1113594, prop.ToString()); // Cold Eater ~1_Val~%
            }
            if ((prop = m_SAAbsorptionAttributes.EaterPoison) != 0)
            {
                list.Add(1113595, prop.ToString()); // Poison Eater ~1_Val~%
            }
            if ((prop = m_SAAbsorptionAttributes.EaterEnergy) != 0)
            {
                list.Add(1113596, prop.ToString()); // Energy Eater ~1_Val~%
            }
            if ((prop = m_SAAbsorptionAttributes.EaterKinetic) != 0)
            {
                list.Add(1113597, prop.ToString()); // Kinetic Eater ~1_Val~%
            }
            if ((prop = m_SAAbsorptionAttributes.EaterDamage) != 0)
            {
                list.Add(1113598, prop.ToString()); // Damage Eater ~1_Val~%
            }
            if ((prop = m_SAAbsorptionAttributes.ResonanceFire) != 0)
            {
                list.Add(1113691, prop.ToString()); // Fire Resonance ~1_val~%
            }
            if ((prop = m_SAAbsorptionAttributes.ResonanceCold) != 0)
            {
                list.Add(1113692, prop.ToString()); // Cold Resonance ~1_val~%
            }
            if ((prop = m_SAAbsorptionAttributes.ResonancePoison) != 0)
            {
                list.Add(1113693, prop.ToString()); // Poison Resonance ~1_val~%
            }
            if ((prop = m_SAAbsorptionAttributes.ResonanceEnergy) != 0)
            {
                list.Add(1113694, prop.ToString()); // Energy Resonance ~1_val~%
            }
            if ((prop = m_SAAbsorptionAttributes.ResonanceKinetic) != 0)
            {
                list.Add(1113695, prop.ToString()); // Kinetic Resonance ~1_val~%
            }
            #endregion

            base.AddResistanceProperties(list);

            Server.Engines.XmlSpawner2.XmlAttach.AddAttachmentProperties(this, list);

            if (m_HitPoints >= 0 && m_MaxHitPoints > 0)
            {
                list.Add(1060639, "{0}\t{1}", m_HitPoints, m_MaxHitPoints); // durability ~1_val~ / ~2_val~
            }
            EnchantedHotItem.AddProperties(this, list);

            if (IsSetItem && !m_SetEquipped)
            {
                list.Add(1072378); // <br>Only when full set is present:
                SetHelper.GetSetProperties(list, this);
            }

            AddHonestyProperty(list);

            if (m_ItemPower != ItemPower.None)
            {
                if (m_ItemPower <= ItemPower.LegendaryArtifact)
                {
                    list.Add(1151488 + ((int)m_ItemPower - 1));
                }
                else
                {
                    list.Add(1152281 + ((int)m_ItemPower - 9));
                }
            }
        }
Esempio n. 21
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            if (this.m_Crafter != null)
            {
                list.Add(1050043, this.m_Crafter.Name); // crafted by ~1_NAME~
            }
            if (this.m_Quality == ClothingQuality.Exceptional)
            {
                list.Add(1063341); // exceptional
            }
            this.m_AosSkillBonuses.GetProperties(list);

            Item ammo = this.Ammo;

            if (ammo != null)
            {
                if (ammo is Arrow)
                {
                    list.Add(1075265, "{0}\t{1}", ammo.Amount, this.Capacity); // Ammo: ~1_QUANTITY~/~2_CAPACITY~ arrows
                }
                else if (ammo is Bolt)
                {
                    list.Add(1075266, "{0}\t{1}", ammo.Amount, this.Capacity); // Ammo: ~1_QUANTITY~/~2_CAPACITY~ bolts
                }
            }
            else
            {
                list.Add(1075265, "{0}\t{1}", 0, this.Capacity); // Ammo: ~1_QUANTITY~/~2_CAPACITY~ arrows
            }
            int prop;

            if ((prop = this.m_DamageIncrease) != 0)
            {
                list.Add(1074762, prop.ToString()); // Damage modifier: ~1_PERCENT~%
            }
            int phys, fire, cold, pois, nrgy, chaos, direct;

            phys = fire = cold = pois = nrgy = chaos = direct = 0;

            this.AlterBowDamage(ref phys, ref fire, ref cold, ref pois, ref nrgy, ref chaos, ref direct);

            if (phys != 0)
            {
                list.Add(1060403, phys.ToString()); // physical damage ~1_val~%
            }
            if (fire != 0)
            {
                list.Add(1060405, fire.ToString()); // fire damage ~1_val~%
            }
            if (cold != 0)
            {
                list.Add(1060404, cold.ToString()); // cold damage ~1_val~%
            }
            if (pois != 0)
            {
                list.Add(1060406, pois.ToString()); // poison damage ~1_val~%
            }
            if (nrgy != 0)
            {
                list.Add(1060407, nrgy.ToString()); // energy damage ~1_val
            }
            if (chaos != 0)
            {
                list.Add(1072846, chaos.ToString()); // chaos damage ~1_val~%
            }
            if (direct != 0)
            {
                list.Add(1079978, direct.ToString()); // Direct Damage: ~1_PERCENT~%
            }
            list.Add(1075085);                        // Requirement: Mondain's Legacy

            if ((prop = this.m_Attributes.DefendChance) != 0)
            {
                list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~%
            }
            if ((prop = this.m_Attributes.BonusDex) != 0)
            {
                list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~
            }
            if ((prop = this.m_Attributes.EnhancePotions) != 0)
            {
                list.Add(1060411, prop.ToString()); // enhance potions ~1_val~%
            }
            if ((prop = this.m_Attributes.CastRecovery) != 0)
            {
                list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~
            }
            if ((prop = this.m_Attributes.CastSpeed) != 0)
            {
                list.Add(1060413, prop.ToString()); // faster casting ~1_val~
            }
            if ((prop = this.m_Attributes.AttackChance) != 0)
            {
                list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~%
            }
            if ((prop = this.m_Attributes.BonusHits) != 0)
            {
                list.Add(1060431, prop.ToString()); // hit point increase ~1_val~
            }
            if ((prop = this.m_Attributes.BonusInt) != 0)
            {
                list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~
            }
            if ((prop = this.m_Attributes.LowerManaCost) != 0)
            {
                list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~%
            }
            if ((prop = this.m_Attributes.LowerRegCost) != 0)
            {
                list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~%
            }
            if ((prop = this.m_Attributes.Luck) != 0)
            {
                list.Add(1060436, prop.ToString()); // luck ~1_val~
            }
            if ((prop = this.m_Attributes.BonusMana) != 0)
            {
                list.Add(1060439, prop.ToString()); // mana increase ~1_val~
            }
            if ((prop = this.m_Attributes.RegenMana) != 0)
            {
                list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~
            }
            if ((prop = this.m_Attributes.NightSight) != 0)
            {
                list.Add(1060441); // night sight
            }
            if ((prop = this.m_Attributes.ReflectPhysical) != 0)
            {
                list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~%
            }
            if ((prop = this.m_Attributes.RegenStam) != 0)
            {
                list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~
            }
            if ((prop = this.m_Attributes.RegenHits) != 0)
            {
                list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~
            }
            if ((prop = this.m_Attributes.SpellDamage) != 0)
            {
                list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~%
            }
            if ((prop = this.m_Attributes.BonusStam) != 0)
            {
                list.Add(1060484, prop.ToString()); // stamina increase ~1_val~
            }
            if ((prop = this.m_Attributes.BonusStr) != 0)
            {
                list.Add(1060485, prop.ToString()); // strength bonus ~1_val~
            }
            if ((prop = this.m_Attributes.WeaponSpeed) != 0)
            {
                list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~%
            }
            if ((prop = this.m_LowerAmmoCost) > 0)
            {
                list.Add(1075208, prop.ToString()); // Lower Ammo Cost ~1_Percentage~%
            }
            #region Mondain's Legacy Sets
            if (this.IsSetItem)
            {
                list.Add(1073491, this.Pieces.ToString()); // Part of a Weapon/Armor Set (~1_val~ pieces)

                if (this.m_SetEquipped)
                {
                    list.Add(1073492); // Full Weapon/Armor Set Present
                    SetHelper.GetSetProperties(list, this);
                }
            }
            #endregion

            base.AddResistanceProperties(list);

            double weight = 0;

            if (ammo != null)
            {
                weight = ammo.Weight * ammo.Amount;
            }

            list.Add(1072241, "{0}\t{1}\t{2}\t{3}", this.Items.Count, this.DefaultMaxItems, (int)weight, this.DefaultMaxWeight); // Contents: ~1_COUNT~/~2_MAXCOUNT items, ~3_WEIGHT~/~4_MAXWEIGHT~ stones

            if ((prop = this.m_WeightReduction) != 0)
            {
                list.Add(1072210, prop.ToString()); // Weight reduction: ~1_PERCENTAGE~%
            }
            #region Mondain's Legacy Sets
            if (this.IsSetItem && !this.m_SetEquipped)
            {
                list.Add(1072378); // <br>Only when full set is present:
                SetHelper.GetSetProperties(list, this);
            }
            #endregion
        }
Esempio n. 22
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            XmlLevelItem levitem = XmlAttach.FindAttachment(this, typeof(XmlLevelItem)) as XmlLevelItem;

            if (levitem != null)
            {
                list.Add(1060658, "Level\t{0}", levitem.Level);

                if (LevelItems.DisplayExpProp)
                {
                    list.Add(1060659, "Experience\t{0}", levitem.Experience);
                }
            }

            #region SF Imbuing
            if (this.m_TimesImbued > 0)
            {
                list.Add(1080418); // (Imbued)
            }

/*
 *               if (m_AosAttributes.Brittle > 0)
 *              list.Add(1116209); // Brittle
 *
 *          if (m_AosAttributes.NoRepairs > 0)
 *              list.Add("Cannot Be Repaired");
 */
            #endregion

            #region Mondain's Legacy
            if (this.m_Quality == ArmorQuality.Exceptional)
            {
                list.Add(1063341); // exceptional
            }
            if (this.m_Crafter != null)
            {
                list.Add(1050043, this.m_Crafter.Name); // crafted by ~1_NAME~
            }
            #endregion

            #region Mondain's Legacy Sets
            if (this.IsSetItem)
            {
                list.Add(1080240, this.Pieces.ToString()); // Part of a Jewelry Set (~1_val~ pieces)

                if (this.m_SetEquipped)
                {
                    list.Add(1080241); // Full Jewelry Set Present
                    SetHelper.GetSetProperties(list, this);
                }
            }
            #endregion

            this.m_AosSkillBonuses.GetProperties(list);

            int prop;

            #region Stygian Abyss
            if (this.RequiredRace == Race.Elf)
            {
                list.Add(1075086); // Elves Only
            }
            else if (this.RequiredRace == Race.Gargoyle)
            {
                list.Add(1111709); // Gargoyles Only
            }
            #endregion

            if ((prop = this.ArtifactRarity) > 0)
            {
                list.Add(1061078, prop.ToString()); // artifact rarity ~1_val~
            }
//            if ((prop = this.m_AosAttributes.CritChance) != 0)
//                list.Add("Critical Chance Increase " + prop.ToString() + "%"); // crit chance increase ~1_val~%

            if ((prop = this.m_AosAttributes.WeaponDamage) != 0)
            {
                list.Add(1060401, prop.ToString()); // damage increase ~1_val~%
            }
            if ((prop = this.m_AosAttributes.DefendChance) != 0)
            {
                list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~%
            }
            if ((prop = this.m_AosAttributes.BonusDex) != 0)
            {
                list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~
            }
            if ((prop = this.m_AosAttributes.EnhancePotions) != 0)
            {
                list.Add(1060411, prop.ToString()); // enhance potions ~1_val~%
            }
            if ((prop = this.m_AosAttributes.CastRecovery) != 0)
            {
                list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~
            }
            if ((prop = this.m_AosAttributes.CastSpeed) != 0)
            {
                list.Add(1060413, prop.ToString()); // faster casting ~1_val~
            }
            if ((prop = this.m_AosAttributes.AttackChance) != 0)
            {
                list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~%
            }
            if ((prop = this.m_AosAttributes.BonusHits) != 0)
            {
                list.Add(1060431, prop.ToString()); // hit point increase ~1_val~
            }
            if ((prop = this.m_AosAttributes.BonusInt) != 0)
            {
                list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~
            }
            if ((prop = this.m_AosAttributes.LowerManaCost) != 0)
            {
                list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~%
            }
            if ((prop = this.m_AosAttributes.LowerRegCost) != 0)
            {
                list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~%
            }
            if ((prop = this.m_AosAttributes.Luck) != 0)
            {
                list.Add(1060436, prop.ToString()); // luck ~1_val~
            }
            if ((prop = this.m_AosAttributes.BonusMana) != 0)
            {
                list.Add(1060439, prop.ToString()); // mana increase ~1_val~
            }
            if ((prop = this.m_AosAttributes.RegenMana) != 0)
            {
                list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~
            }
            if ((prop = this.m_AosAttributes.NightSight) != 0)
            {
                list.Add(1060441); // night sight
            }
            if ((prop = this.m_AosAttributes.ReflectPhysical) != 0)
            {
                list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~%
            }
            if ((prop = this.m_AosAttributes.RegenStam) != 0)
            {
                list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~
            }
            if ((prop = this.m_AosAttributes.RegenHits) != 0)
            {
                list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~
            }
            if ((prop = this.m_AosAttributes.SpellChanneling) != 0)
            {
                list.Add(1060482); // spell channeling
            }
            if ((prop = this.m_AosAttributes.SpellDamage) != 0)
            {
                list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~%
            }
            if ((prop = this.m_AosAttributes.BonusStam) != 0)
            {
                list.Add(1060484, prop.ToString()); // stamina increase ~1_val~
            }
            if ((prop = this.m_AosAttributes.BonusStr) != 0)
            {
                list.Add(1060485, prop.ToString()); // strength bonus ~1_val~
            }
            if ((prop = this.m_AosAttributes.WeaponSpeed) != 0)
            {
                list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~%
            }
            if (Core.ML && (prop = this.m_AosAttributes.IncreasedKarmaLoss) != 0)
            {
                list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~%
            }
            #region SA
            if ((prop = this.m_SAAbsorptionAttributes.CastingFocus) != 0)
            {
                list.Add(1113696, prop.ToString()); // Casting Focus ~1_val~%
            }
            if ((prop = this.m_SAAbsorptionAttributes.EaterFire) != 0)
            {
                list.Add(1113593, prop.ToString()); // Fire Eater ~1_Val~%
            }
            if ((prop = this.m_SAAbsorptionAttributes.EaterCold) != 0)
            {
                list.Add(1113594, prop.ToString()); // Cold Eater ~1_Val~%
            }
            if ((prop = this.m_SAAbsorptionAttributes.EaterPoison) != 0)
            {
                list.Add(1113595, prop.ToString()); // Poison Eater ~1_Val~%
            }
            if ((prop = this.m_SAAbsorptionAttributes.EaterEnergy) != 0)
            {
                list.Add(1113596, prop.ToString()); // Energy Eater ~1_Val~%
            }
            if ((prop = this.m_SAAbsorptionAttributes.EaterKinetic) != 0)
            {
                list.Add(1113597, prop.ToString()); // Kinetic Eater ~1_Val~%
            }
            if ((prop = this.m_SAAbsorptionAttributes.EaterDamage) != 0)
            {
                list.Add(1113598, prop.ToString()); // Damage Eater ~1_Val~%
            }
            if ((prop = this.m_SAAbsorptionAttributes.ResonanceFire) != 0)
            {
                list.Add(1113691, prop.ToString()); // Fire Resonance ~1_val~%
            }
            if ((prop = this.m_SAAbsorptionAttributes.ResonanceCold) != 0)
            {
                list.Add(1113692, prop.ToString()); // Cold Resonance ~1_val~%
            }
            if ((prop = this.m_SAAbsorptionAttributes.ResonancePoison) != 0)
            {
                list.Add(1113693, prop.ToString()); // Poison Resonance ~1_val~%
            }
            if ((prop = this.m_SAAbsorptionAttributes.ResonanceEnergy) != 0)
            {
                list.Add(1113694, prop.ToString()); // Energy Resonance ~1_val~%
            }
            if ((prop = this.m_SAAbsorptionAttributes.ResonanceKinetic) != 0)
            {
                list.Add(1113695, prop.ToString()); // Kinetic Resonance ~1_val~%
            }
            #endregion

            base.AddResistanceProperties(list);

            Server.Engines.XmlSpawner2.XmlAttach.AddAttachmentProperties(this, list);

            if (this.m_HitPoints >= 0 && this.m_MaxHitPoints > 0)
            {
                list.Add(1060639, "{0}\t{1}", this.m_HitPoints, this.m_MaxHitPoints); // durability ~1_val~ / ~2_val~
            }
        }
Esempio n. 23
0
        public override void AddNameProperties(ObjectPropertyList list)
        {
            base.AddNameProperties(list);

            m_AosSkillBonuses.GetProperties(list);

            Item ammo = Ammo;

            if (ammo != null)
            {
                if (ammo is Arrow)
                {
                    list.Add(1075265, "{0}\t{1}", ammo.Amount, Capacity); // Ammo: ~1_QUANTITY~/~2_CAPACITY~ arrows
                }
                else if (ammo is Bolt)
                {
                    list.Add(1075266, "{0}\t{1}", ammo.Amount, Capacity); // Ammo: ~1_QUANTITY~/~2_CAPACITY~ bolts
                }
            }
            else
            {
                list.Add(1075265, "{0}\t{1}", 0, Capacity); // Ammo: ~1_QUANTITY~/~2_CAPACITY~ arrows
            }
            if (ArtifactRarity > 0)
            {
                list.Add(1061078, ArtifactRarity.ToString()); // artifact rarity ~1_val~
            }

            int prop;

            if ((prop = m_DamageIncrease) != 0)
            {
                list.Add(1074762, prop.ToString()); // Damage modifier: ~1_PERCENT~%
            }
            int phys, fire, cold, pois, nrgy, chaos, direct;

            phys = fire = cold = pois = nrgy = chaos = direct = 0;

            AlterRangedDamage(ref phys, ref fire, ref cold, ref pois, ref nrgy, ref chaos, ref direct);

            if (phys != 0)
            {
                list.Add(1060403, phys.ToString()); // physical damage ~1_val~%
            }
            if (fire != 0)
            {
                list.Add(1060405, fire.ToString()); // fire damage ~1_val~%
            }
            if (cold != 0)
            {
                list.Add(1060404, cold.ToString()); // cold damage ~1_val~%
            }
            if (pois != 0)
            {
                list.Add(1060406, pois.ToString()); // poison damage ~1_val~%
            }
            if (nrgy != 0)
            {
                list.Add(1060407, nrgy.ToString()); // energy damage ~1_val
            }
            if (chaos != 0)
            {
                list.Add(1072846, chaos.ToString()); // chaos damage ~1_val~%
            }
            if (direct != 0)
            {
                list.Add(1079978, direct.ToString()); // Direct Damage: ~1_PERCENT~%
            }
            if ((prop = m_Attributes.DefendChance) != 0)
            {
                list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~%
            }
            if ((prop = m_Attributes.BonusDex) != 0)
            {
                list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~
            }
            if ((prop = m_Attributes.EnhancePotions) != 0)
            {
                list.Add(1060411, prop.ToString()); // enhance potions ~1_val~%
            }
            if ((prop = m_Attributes.CastRecovery) != 0)
            {
                list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~
            }
            if ((prop = m_Attributes.CastSpeed) != 0)
            {
                list.Add(1060413, prop.ToString()); // faster casting ~1_val~
            }
            if ((prop = m_Attributes.AttackChance) != 0)
            {
                list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~%
            }
            if ((prop = m_Attributes.BonusHits) != 0)
            {
                list.Add(1060431, prop.ToString()); // hit point increase ~1_val~
            }
            if ((prop = m_Attributes.BonusInt) != 0)
            {
                list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~
            }
            if ((prop = m_Attributes.LowerManaCost) != 0)
            {
                list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~%
            }
            if ((prop = m_Attributes.LowerRegCost) != 0)
            {
                list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~%
            }
            if ((prop = m_Attributes.Luck) != 0)
            {
                list.Add(1060436, prop.ToString()); // luck ~1_val~
            }
            if ((prop = m_Attributes.BonusMana) != 0)
            {
                list.Add(1060439, prop.ToString()); // mana increase ~1_val~
            }
            if ((prop = m_Attributes.RegenMana) != 0)
            {
                list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~
            }
            if ((prop = m_Attributes.NightSight) != 0)
            {
                list.Add(1060441); // night sight
            }
            if ((prop = m_Attributes.ReflectPhysical) != 0)
            {
                list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~%
            }
            if ((prop = m_Attributes.RegenStam) != 0)
            {
                list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~
            }
            if ((prop = m_Attributes.RegenHits) != 0)
            {
                list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~
            }
            if ((prop = m_Attributes.SpellDamage) != 0)
            {
                list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~%
            }
            if ((prop = m_Attributes.BonusStam) != 0)
            {
                list.Add(1060484, prop.ToString()); // stamina increase ~1_val~
            }
            if ((prop = m_Attributes.BonusStr) != 0)
            {
                list.Add(1060485, prop.ToString()); // strength bonus ~1_val~
            }
            if ((prop = m_Attributes.WeaponSpeed) != 0)
            {
                list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~%
            }
            if ((prop = m_Attributes.LowerAmmoCost) > 0)
            {
                list.Add(1075208, prop.ToString()); // Lower Ammo Cost ~1_Percentage~%
            }
            if (IsSetItem)
            {
                list.Add(1073491, Pieces.ToString()); // Part of a Weapon/Armor Set (~1_val~ pieces)

                if (SetID == SetItem.Bestial)
                {
                    list.Add(1151541, BestialSetHelper.GetTotalBerserk(this).ToString()); // Berserk ~1_VAL~
                }
                if (BardMasteryBonus)
                {
                    list.Add(1151553); // Activate: Bard Mastery Bonus x2<br>(Effect: 1 min. Cooldown: 30 min.)
                }
                if (m_SetEquipped)
                {
                    list.Add(1073492); // Full Weapon/Armor Set Present
                    SetHelper.GetSetProperties(list, this);
                }
            }

            base.AddResistanceProperties(list);

            double weight = 0;

            if (ammo != null)
            {
                weight = ammo.Weight * ammo.Amount;
            }

            list.Add(1072241, "{0}\t{1}\t{2}\t{3}", Items.Count, DefaultMaxItems, (int)weight, DefaultMaxWeight); // Contents: ~1_COUNT~/~2_MAXCOUNT items, ~3_WEIGHT~/~4_MAXWEIGHT~ stones

            if ((prop = m_WeightReduction) != 0)
            {
                list.Add(1072210, prop.ToString()); // Weight reduction: ~1_PERCENTAGE~%
            }
            if (IsSetItem && !m_SetEquipped)
            {
                list.Add(1072378); // <br>Only when full set is present:
                SetHelper.GetSetProperties(list, this);
            }
        }
        private string BreachSecurity(Droid droid, ShipGraph shipGraph)
        {
            var    pressurePlate = shipGraph.GetUnexploredDoorsOf(droid.Room).First();
            string password      = "******";
            var    allItems      = droid.Inventory;

            droid.DropItems(allItems);

            //Try each item individually
            //Remember items that are too heavy these are useless
            var uselessItems = new HashSet <string>();

            foreach (var item in allItems)
            {
                droid.TakeItem(item);
                var weightAdjustment = TryBreach();
                if (weightAdjustment == RequiredWeightAdjustment.None)
                {
                    return(password);
                }
                else if (weightAdjustment == RequiredWeightAdjustment.Lighter)
                {
                    uselessItems.Add(item);
                }
                droid.DropItem(item);
            }

            var remainingItems = allItems.Except(uselessItems);

            droid.TakeItems(remainingItems);

            //Try removing each item individually
            //Remember which items make the droid too light when dropped (these are essential)
            var essentialItems = new HashSet <string>();

            foreach (var item in remainingItems)
            {
                droid.DropItem(item);
                var weightAdjustment = TryBreach();
                if (weightAdjustment == RequiredWeightAdjustment.None)
                {
                    return(password);
                }
                else if (weightAdjustment != RequiredWeightAdjustment.Lighter)
                {
                    essentialItems.Add(item);
                }
                droid.TakeItem(item);
            }

            var undecidedItems = remainingItems.Except(essentialItems);

            droid.DropItems(undecidedItems);

            //Try all combinations of remaining items
            //(if this is an extremely large number of combinations I suggest using a priori algorithm instead, but in practice this is not needed)
            var itemCombinations = SetHelper.Subsets(undecidedItems);

            foreach (var combination in itemCombinations)
            {
                droid.TakeItems(combination);
                var weightAdjustment = TryBreach();
                if (weightAdjustment == RequiredWeightAdjustment.None)
                {
                    return(password);
                }
                droid.DropItems(combination);
            }

            RequiredWeightAdjustment TryBreach()
            {
                droid.TakeDoor(pressurePlate);
                var responseLines = droid.LastResponse.Split('\n', StringSplitOptions.RemoveEmptyEntries);
                var weightMessage = responseLines[4];

                if (weightMessage == "A loud, robotic voice says \"Alert! Droids on this ship are heavier than the detected value!\" and you are ejected back to the checkpoint.")
                {
                    return(RequiredWeightAdjustment.Heavier);
                }
                if (weightMessage == "A loud, robotic voice says \"Alert! Droids on this ship are lighter than the detected value!\" and you are ejected back to the checkpoint.")
                {
                    return(RequiredWeightAdjustment.Lighter);
                }
                password = responseLines[6].Split(' ')[11];
                return(RequiredWeightAdjustment.None);
            }

            throw new Exception("breach failed");
        }