Beispiel #1
0
 public Pincer()
 {
     Hue = 2500;
     Attributes.BalancedWeapon = 1;
     Slayer2 = BaseRunicTool.GetRandomSlayer();
     SetSkillBonuses.SetValues(0, SkillName.Lumberjacking, 10);
     WeaponAttributes.HitLeechHits = 87;
     Attributes.RegenStam          = 6;
     Attributes.RegenMana          = 6;
     Attributes.WeaponDamage       = 40;
 }
Beispiel #2
0
 public Equivocation()
 {
     Attributes.BalancedWeapon = 1;
     Slayer2 = BaseRunicTool.GetRandomSlayer();
     Attributes.AttackChance   = 10;
     Attributes.RegenHits      = 6;
     Attributes.Brittle        = 1;
     Attributes.WeaponSpeed    = 35;
     Attributes.WeaponDamage   = 50;
     WeaponAttributes.HitCurse = 15;
     Hue = 1365;
 }
        public HailstormGargoyle()
        {
            Hue = 2714;

            Slayer = BaseRunicTool.GetRandomSlayer();
            WeaponAttributes.HitLightning = 15;
            WeaponAttributes.HitColdArea  = 100;
            WeaponAttributes.HitLeechMana = 30;
            Attributes.AttackChance       = 20;
            Attributes.WeaponSpeed        = 25;
            Attributes.WeaponDamage       = 50;
            AosElementDamages.Cold        = 100;
        }
Beispiel #4
0
        public Item Mutate(IEntity from, int luckChance, Item item)
        {
            if (item != null)
            {
                if (item is BaseWeapon && 1 > Utility.Random(100))
                {
                    item.Delete();
                    item = new FireHorn();
                    return(item);
                }

                if (StandardLootItem && (item is BaseWeapon || item is BaseArmor || item is BaseJewel || item is BaseHat))
                {
                    // Try to generate a random item based on the creature killed
                    if (from is BaseCreature creature)
                    {
                        if (RandomItemGenerator.GenerateRandomItem(item, creature.LastKiller, creature))
                        {
                            return(item);
                        }
                    }
                }
                else if (item is BaseInstrument instr)
                {
                    SlayerName slayer = SlayerName.None;

                    slayer = BaseRunicTool.GetRandomSlayer();

                    if (slayer == SlayerName.None)
                    {
                        instr.Delete();
                        return(null);
                    }

                    instr.Quality = ItemQuality.Normal;
                    instr.Slayer  = slayer;
                }

                if (item.Stackable)
                {
                    item.Amount = Quantity.Roll();
                }
            }

            return(item);
        }
Beispiel #5
0
        public Item Mutate(Mobile from, Item item)
        {
            if (item != null && !(item is BaseWand))
            {
                if (item is BaseWeapon && 1 > Utility.Random(100))
                {
                    item.Delete();
                    item = new FireHorn();
                    return(item);
                }

                if (item is BaseWeapon || item is BaseArmor || item is BaseJewel || item is BaseHat)
                {
                    if (item is BaseWeapon)
                    {
                        var weapon = (BaseWeapon)item;

                        if (55 > Utility.Random(100))
                        {
                            weapon.AccuracyLevel = (WeaponAccuracyLevel)GetRandomOldBonus();
                        }

                        if (45 > Utility.Random(100))
                        {
                            int damageLevel = GetRandomOldBonus();

                            if (PseudoSeerStone.Instance != null && PseudoSeerStone.Instance._HighestDamageLevelSpawn < damageLevel)
                            {
                                if (damageLevel == 5 && PseudoSeerStone.ReplaceVanqWithSkillScrolls)
                                {
                                    return(PuzzleChest.CreateRandomSkillScroll());
                                }
                                int platAmount = PseudoSeerStone.PlatinumPerMissedDamageLevel *
                                                 (damageLevel - PseudoSeerStone.Instance._HighestDamageLevelSpawn);
                                if (platAmount > 0)
                                {
                                    return(new Platinum(platAmount));
                                }
                                damageLevel = PseudoSeerStone.Instance._HighestDamageLevelSpawn;
                            }
                            weapon.DamageLevel = (WeaponDamageLevel)damageLevel;
                        }

                        if (25 > Utility.Random(100))
                        {
                            weapon.DurabilityLevel = (WeaponDurabilityLevel)GetRandomOldBonus();
                        }

                        if (5 > Utility.Random(100))
                        {
                            weapon.Slayer = SlayerName.Silver;
                        }

                        if (1 > Utility.Random(1000) ||
                            (weapon.AccuracyLevel == 0 && weapon.DamageLevel == 0 && weapon.DurabilityLevel == 0 &&
                             weapon.Slayer == SlayerName.None && 5 > Utility.Random(100)))
                        {
                            weapon.Slayer = from != null?SlayerGroup.GetLootSlayerType(from.GetType()) : BaseRunicTool.GetRandomSlayer();
                        }

                        if (weapon.AccuracyLevel == 0 && weapon.DamageLevel == 0 && weapon.DurabilityLevel == 0 &&
                            weapon.Slayer == SlayerName.None)
                        {
                            weapon.Identified = true;
                        }
                    }
                    else if (item is BaseArmor)
                    {
                        var armor = (BaseArmor)item;

                        if (55 > Utility.Random(100))
                        {
                            armor.ProtectionLevel = (ArmorProtectionLevel)GetRandomOldBonus();
                        }

                        if (25 > Utility.Random(100))
                        {
                            armor.Durability = (ArmorDurabilityLevel)GetRandomOldBonus();
                        }

                        if (armor.ProtectionLevel == 0 && armor.Durability == 0)
                        {
                            armor.Identified = true;
                        }
                    }
                }
                else if (item is BaseInstrument)
                {
                    SlayerName slayer = from == null || from.EraAOS
                                                                                        ? BaseRunicTool.GetRandomSlayer()
                                                                                        : SlayerGroup.GetLootSlayerType(from.GetType());

                    var instr = (BaseInstrument)item;

                    instr.Quality = InstrumentQuality.Regular;
                    instr.Slayer  = slayer;
                }
                else if (item is Spellbook)                 //Randomize spellbook
                {
                    var book = item as Spellbook;

                    if (MaxIntensity == 100 && MinIntensity / 1000.0 > Utility.RandomDouble())
                    {
                        book.LootType = LootType.Blessed;
                    }

                    if (MaxIntensity == 100 && MinIntensity >= 50 && (MinIntensity / 3000.0 > Utility.RandomDouble()))
                    {
                        book.Dyable = true;
                    }

                    int rnd    = Utility.RandomMinMax(MinIntensity, MaxIntensity);
                    var circle = (int)((rnd / 12.5) + 1.0);

                    if (circle >= 8 && 0.33 > Utility.RandomDouble())
                    {
                        book.Content = ulong.MaxValue;
                    }
                    else
                    {
                        circle = Math.Min(circle, 8);

                        //do we fill this circle?
                        for (int i = 0; i < circle; i++)
                        {
                            if (Utility.RandomBool())
                            {
                                book.Content |= (ulong)Utility.Random(0x100) << (i * 8);
                            }
                        }
                    }
                }

                if (item.Stackable)
                {
                    // Note: do not check hits max here if you want to multiply against gold
                    // the max hits have not been set when this function is called
                    // The inital loot is added to the BaseCreature before the attributes are set
                    // for the specific mob type
                    if (item is Gold)
                    {
                        item.Amount = (int)Math.Ceiling(Quantity.Roll() * DynamicSettingsController.GoldMulti);
                    }
                    else
                    {
                        item.Amount = Quantity.Roll();
                    }
                }
            }

            return(item);
        }
Beispiel #6
0
        public Item Mutate(Mobile from, int luckChance, Item item)
        {
            if (item != null)
            {
                if (item is BaseWeapon && 1 > Utility.Random(100))
                {
                    item.Delete();
                    item = new FireHorn();
                    return(item);
                }

                if (item is BaseWeapon || item is BaseArmor || item is BaseJewel || item is BaseHat)
                {
                    if (Core.AOS)
                    {
                        int bonusProps = GetBonusProperties();
                        int min        = m_MinIntensity;
                        int max        = m_MaxIntensity;

                        if (bonusProps < m_MaxProps && LootPack.CheckLuck(luckChance))
                        {
                            ++bonusProps;
                        }

                        int props = 1 + bonusProps;

                        // Make sure we're not spawning items with 6 properties.
                        if (props > m_MaxProps)
                        {
                            props = m_MaxProps;
                        }

                        // Try to generate a new random item
                        if (from is BaseCreature)
                        {
                            if (RandomItemGenerator.GenerateRandomItem(item, ((BaseCreature)from).LastKiller, (BaseCreature)from))
                            {
                                return(item);
                            }
                        }
                        else if (RandomItemGenerator.GenerateRandomItem(item, null, null))
                        {
                            return(item);
                        }

                        // Otherwise use the older style random generation
                        if (item is BaseWeapon)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }
                        else if (item is BaseArmor)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseArmor)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }
                        else if (item is BaseJewel)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseJewel)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }
                        else if (item is BaseHat)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseHat)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }
                    }
                    else                     // not aos
                    {
                        if (item is BaseWeapon)
                        {
                            BaseWeapon weapon = (BaseWeapon)item;

                            if (80 > Utility.Random(100))
                            {
                                weapon.AccuracyLevel = (WeaponAccuracyLevel)GetRandomOldBonus();
                            }

                            if (60 > Utility.Random(100))
                            {
                                weapon.DamageLevel = (WeaponDamageLevel)GetRandomOldBonus();
                            }

                            if (40 > Utility.Random(100))
                            {
                                weapon.DurabilityLevel = (WeaponDurabilityLevel)GetRandomOldBonus();
                            }

                            if (5 > Utility.Random(100))
                            {
                                weapon.Slayer = SlayerName.Silver;
                            }

                            if (from != null && weapon.AccuracyLevel == 0 && weapon.DamageLevel == 0 && weapon.DurabilityLevel == 0 &&
                                weapon.Slayer == SlayerName.None && 5 > Utility.Random(100))
                            {
                                weapon.Slayer = SlayerGroup.GetLootSlayerType(from.GetType());
                            }
                        }
                        else if (item is BaseArmor)
                        {
                            BaseArmor armor = (BaseArmor)item;

                            if (80 > Utility.Random(100))
                            {
                                armor.ProtectionLevel = (ArmorProtectionLevel)GetRandomOldBonus();
                            }

                            if (40 > Utility.Random(100))
                            {
                                armor.Durability = (ArmorDurabilityLevel)GetRandomOldBonus();
                            }
                        }
                    }
                }
                else if (item is BaseInstrument)
                {
                    SlayerName slayer = SlayerName.None;

                    if (Core.AOS)
                    {
                        slayer = BaseRunicTool.GetRandomSlayer();
                    }
                    else
                    {
                        slayer = SlayerGroup.GetLootSlayerType(from.GetType());
                    }

                    if (slayer == SlayerName.None)
                    {
                        item.Delete();
                        return(null);
                    }

                    BaseInstrument instr = (BaseInstrument)item;

                    instr.Quality = InstrumentQuality.Regular;
                    instr.Slayer  = slayer;
                }

                if (item.Stackable)
                {
                    item.Amount = m_Quantity.Roll();
                }
            }

            return(item);
        }
Beispiel #7
0
        public Item Mutate(Mobile from, int luckChance, Item item)
        {
            if (item != null)
            {
                if (item is BaseWeapon && 1 > Utility.Random(100))
                {
                    item.Delete();
                    item = new FireHorn();
                    return(item);
                }

                if (item is BaseWeapon || item is BaseArmor || item is BaseJewel || item is BaseHat || item is BaseEarrings)
                {
                    if (Core.AOS)
                    {
                        int bonusProps = GetBonusProperties();
                        int min        = m_MinIntensity;
                        int max        = m_MaxIntensity;

                        if (bonusProps < m_MaxProps && LootPack.CheckLuck(luckChance))
                        {
                            ++bonusProps;
                        }

                        int props = 1 + bonusProps;

                        // Make sure we're not spawning items with too many properties.
                        if (props > m_MaxProps)
                        {
                            props = m_MaxProps;
                        }

                        if (item is BaseWeapon)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }
                        else if (item is BaseArmor)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseArmor)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }
                        else if (item is BaseJewel)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseJewel)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }
                        else if (item is BaseHat)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseHat)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }
                        else if (item is BaseEarrings)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseEarrings)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }

                        if (bonusProps >= 5 || item is BaseEarrings)  //Item is epic and should be cursed 95% chance
                        {
                            if (Utility.RandomDouble() > .05)
                            {
                                item.LootType = LootType.Cursed;
                            }
                        }
                    }
                    else                     // not aos
                    {
                        if (item is BaseWeapon)
                        {
                            BaseWeapon weapon = (BaseWeapon)item;

                            if (80 > Utility.Random(100))
                            {
                                weapon.AccuracyLevel = (WeaponAccuracyLevel)GetRandomOldBonus();
                            }

                            if (60 > Utility.Random(100))
                            {
                                weapon.DamageLevel = (WeaponDamageLevel)GetRandomOldBonus();
                            }

                            if (40 > Utility.Random(100))
                            {
                                weapon.DurabilityLevel = (WeaponDurabilityLevel)GetRandomOldBonus();
                            }

                            if (5 > Utility.Random(100))
                            {
                                weapon.Slayer = SlayerName.Silver;
                            }

                            if (from != null && weapon.AccuracyLevel == 0 && weapon.DamageLevel == 0 && weapon.DurabilityLevel == 0 && weapon.Slayer == SlayerName.None && 5 > Utility.Random(100))
                            {
                                weapon.Slayer = SlayerGroup.GetLootSlayerType(from.GetType());
                            }
                        }
                        else if (item is BaseArmor)
                        {
                            BaseArmor armor = (BaseArmor)item;

                            if (80 > Utility.Random(100))
                            {
                                armor.ProtectionLevel = (ArmorProtectionLevel)GetRandomOldBonus();
                            }

                            if (40 > Utility.Random(100))
                            {
                                armor.Durability = (ArmorDurabilityLevel)GetRandomOldBonus();
                            }
                        }
                    }
                }
                else if (item is BaseInstrument)
                {
                    SlayerName slayer = SlayerName.None;
                    if (Core.AOS)
                    {
                        slayer = BaseRunicTool.GetRandomSlayer();
                    }
                    else
                    {
                        slayer = SlayerGroup.GetLootSlayerType(from.GetType());
                    }

                    if (slayer == SlayerName.None)
                    {
                        item.Delete();
                        return(null);
                    }

                    BaseInstrument instr = (BaseInstrument)item;

                    instr.Quality = InstrumentQuality.Regular;
                    if (instr.Slayer == SlayerName.None)
                    {
                        instr.Slayer = slayer;
                    }
                    else
                    {
                        instr.Slayer2 = slayer;
                    }
                    if (instr.Slayer2 != SlayerName.None)
                    {
                        if (Utility.RandomDouble() > .05)
                        {
                            item.LootType = LootType.Cursed;
                        }
                    }
                }

                if (item.Stackable)
                {
                    item.Amount = m_Quantity.Roll();
                }
            }

            return(item);
        }
Beispiel #8
0
        public static void GetBookProperties(Spellbook book)
        {
            int cycle  = 3;
            int chance = 25;

            if (book is MySpellbook)
            {
                if (Utility.Random(100) > 25)
                {
                    book.SkillBonuses.SetValues(0, m_MageSkills[Utility.Random(m_MageSkills.Length)], Utility.RandomMinMax(1, 10));
                }
            }
            else if (book is MyNecromancerSpellbook)
            {
                if (Utility.Random(100) > 25)
                {
                    book.SkillBonuses.SetValues(0, m_NecroSkills[Utility.Random(m_NecroSkills.Length)], Utility.RandomMinMax(1, 10));
                }
            }
            else if (book is DeathKnightSpellbook)
            {
                if (Utility.Random(100) > 25)
                {
                    book.SkillBonuses.SetValues(0, m_DeathSkills[Utility.Random(m_DeathSkills.Length)], Utility.RandomMinMax(1, 10));
                }
            }
            else if (book is MySongbook)
            {
                if (Utility.Random(100) > 25)
                {
                    book.SkillBonuses.SetValues(0, m_BardSkills[Utility.Random(m_BardSkills.Length)], Utility.RandomMinMax(1, 10));
                }
            }
            else if (book is MyPaladinbook)
            {
                if (Utility.Random(100) > 25)
                {
                    book.SkillBonuses.SetValues(0, m_PaladinSkills[Utility.Random(m_PaladinSkills.Length)], Utility.RandomMinMax(1, 10));
                }
            }
            else if (book is MySamuraibook)
            {
                if (Utility.Random(100) > 25)
                {
                    book.SkillBonuses.SetValues(0, m_BushidoSkills[Utility.Random(m_BushidoSkills.Length)], Utility.RandomMinMax(1, 10));
                }
            }
            else if (book is MyNinjabook)
            {
                if (Utility.Random(100) > 25)
                {
                    book.SkillBonuses.SetValues(0, m_NinjaSkills[Utility.Random(m_NinjaSkills.Length)], Utility.RandomMinMax(1, 10));
                }
            }

            if (book is MyNecromancerSpellbook || book is MySpellbook)
            {
                if (50 > Utility.Random(100))
                {
                    SlayerName slayer = BaseRunicTool.GetRandomSlayer();

                    if (slayer != SlayerName.None)
                    {
                        book.Slayer = slayer;
                    }
                }

                cycle = 3; chance = 25;

                while (cycle > 0)
                {
                    if (Utility.RandomMinMax(1, 100) >= chance)
                    {
                        switch (Utility.RandomMinMax(0, 16))
                        {
                        case 0: book.Attributes.BonusDex = Utility.RandomMinMax(1, 5); break;

                        case 1: book.Attributes.BonusHits = Utility.RandomMinMax(5, 20); break;

                        case 2: book.Attributes.BonusInt = Utility.RandomMinMax(1, 5); break;

                        case 3: book.Attributes.BonusMana = Utility.RandomMinMax(5, 20); break;

                        case 4: book.Attributes.BonusStam = Utility.RandomMinMax(5, 20); break;

                        case 5: book.Attributes.BonusStr = Utility.RandomMinMax(1, 5); break;

                        case 6: book.Attributes.CastRecovery = Utility.RandomMinMax(1, 5); break;

                        case 7: book.Attributes.CastSpeed = Utility.RandomMinMax(1, 5); break;

                        case 8: book.Attributes.LowerManaCost = Utility.RandomMinMax(2, 20); break;

                        case 9: book.Attributes.LowerRegCost = Utility.RandomMinMax(2, 20); break;

                        case 10: book.Attributes.Luck = Utility.RandomMinMax(1, 20); break;

                        case 11: book.Attributes.NightSight = 1; break;

                        case 12: book.Attributes.ReflectPhysical = Utility.RandomMinMax(5, 25); break;

                        case 13: book.Attributes.RegenHits = Utility.RandomMinMax(1, 5); break;

                        case 14: book.Attributes.RegenMana = Utility.RandomMinMax(1, 5); break;

                        case 15: book.Attributes.RegenStam = Utility.RandomMinMax(1, 5); break;

                        case 16: book.Attributes.SpellDamage = Utility.RandomMinMax(5, 25); break;
                        }
                    }

                    cycle--;
                    chance = chance + 25;
                }
            }
            else
            {
                cycle = 3; chance = 25;

                while (cycle > 0)
                {
                    if (Utility.RandomMinMax(1, 100) >= chance)
                    {
                        switch (Utility.RandomMinMax(0, 15))
                        {
                        case 0: book.Attributes.BonusDex = Utility.RandomMinMax(1, 5); break;

                        case 1: book.Attributes.BonusHits = Utility.RandomMinMax(5, 20); break;

                        case 2: book.Attributes.BonusInt = Utility.RandomMinMax(1, 5); break;

                        case 3: book.Attributes.BonusMana = Utility.RandomMinMax(5, 20); break;

                        case 4: book.Attributes.BonusStam = Utility.RandomMinMax(5, 20); break;

                        case 5: book.Attributes.AttackChance = Utility.RandomMinMax(1, 15); break;

                        case 6: book.Attributes.DefendChance = Utility.RandomMinMax(1, 15); break;

                        case 7: book.Attributes.EnhancePotions = Utility.RandomMinMax(5, 25); break;

                        case 8: book.Attributes.WeaponDamage = Utility.RandomMinMax(1, 25); break;

                        case 9: book.Attributes.WeaponSpeed = Utility.RandomMinMax(1, 2); break;

                        case 10: book.Attributes.Luck = Utility.RandomMinMax(1, 20); break;

                        case 11: book.Attributes.NightSight = 1; break;

                        case 12: book.Attributes.ReflectPhysical = Utility.RandomMinMax(5, 25); break;

                        case 13: book.Attributes.RegenHits = Utility.RandomMinMax(1, 5); break;

                        case 14: book.Attributes.RegenMana = Utility.RandomMinMax(1, 5); break;

                        case 15: book.Attributes.RegenStam = Utility.RandomMinMax(1, 5); break;
                        }
                    }

                    cycle--;
                    chance = chance + 25;
                }
            }

            if (Utility.Random(100) > 75)
            {
                if (book is DeathKnightSpellbook)
                {
                    book.SkillBonuses.SetValues(1, m_MiscDeadSkills[Utility.Random(m_MiscDeadSkills.Length)], Utility.RandomMinMax(1, 10));
                }
                else
                {
                    book.SkillBonuses.SetValues(1, m_MiscSkills[Utility.Random(m_MiscSkills.Length)], Utility.RandomMinMax(1, 10));
                }
            }
        }
Beispiel #9
0
        public Item Mutate(Mobile from, int luckChance, Item item)
        {
            if (item != null && !(item is BaseWand))
            {
                if (item is BaseWeapon && 1 > Utility.Random(100))
                {
                    item.Delete();
                    item = new FireHorn();
                    return(item);
                }

                if (item is BaseWeapon || item is BaseArmor || item is BaseJewel || item is BaseHat)
                {
                    /*
                     * if ( Core.AOS )
                     * {
                     *      int bonusProps = GetBonusProperties();
                     *      int min = m_MinIntensity;
                     *      int max = m_MaxIntensity;
                     *
                     *      if ( bonusProps < m_MaxProps && LootPack.CheckLuck( luckChance ) )
                     ++bonusProps;
                     *
                     *      int props = 1 + bonusProps;
                     *
                     *      // Make sure we're not spawning items with 6 properties.
                     *      if ( props > m_MaxProps )
                     *              props = m_MaxProps;
                     *
                     *      if ( item is BaseWeapon )
                     *              BaseRunicTool.ApplyAttributesTo( (BaseWeapon)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity );
                     *      else if ( item is BaseArmor )
                     *              BaseRunicTool.ApplyAttributesTo( (BaseArmor)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity );
                     *      else if ( item is BaseJewel )
                     *              BaseRunicTool.ApplyAttributesTo( (BaseJewel)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity );
                     *      else if ( item is BaseHat )
                     *              BaseRunicTool.ApplyAttributesTo( (BaseHat)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity );
                     * }
                     * else // not aos
                     * { */
                    if (item is BaseWeapon)
                    {
                        BaseWeapon weapon = (BaseWeapon)item;

                        if (55 > Utility.Random(100))
                        {
                            weapon.AccuracyLevel = (WeaponAccuracyLevel)GetRandomOldBonus();
                        }

                        if (45 > Utility.Random(100))
                        {
                            weapon.DamageLevel = (WeaponDamageLevel)GetRandomOldBonus();
                        }

                        if (25 > Utility.Random(100))
                        {
                            weapon.DurabilityLevel = (WeaponDurabilityLevel)GetRandomOldBonus();
                        }

                        if (5 > Utility.Random(100))
                        {
                            weapon.Slayer = SlayerName.Silver;
                        }

                        if (1 > Utility.Random(1000) || (weapon.AccuracyLevel == 0 && weapon.DamageLevel == 0 && weapon.DurabilityLevel == 0 && weapon.Slayer == SlayerName.None && 5 > Utility.Random(100)))
                        {
                            if (from != null)
                            {
                                weapon.Slayer = SlayerGroup.GetLootSlayerType(from.GetType());
                            }
                            else
                            {
                                weapon.Slayer = BaseRunicTool.GetRandomSlayer();
                            }
                        }
                    }
                    else if (item is BaseArmor)
                    {
                        BaseArmor armor = (BaseArmor)item;

                        if (55 > Utility.Random(100))
                        {
                            armor.ProtectionLevel = (ArmorProtectionLevel)GetRandomOldBonus();
                        }

                        if (25 > Utility.Random(100))
                        {
                            armor.Durability = (ArmorDurabilityLevel)GetRandomOldBonus();
                        }
                    }
                    //}
                }
                else if (item is BaseInstrument)
                {
                    SlayerName slayer = SlayerName.None;

                    if (/*Core.AOS ||*/ from == null)
                    {
                        slayer = BaseRunicTool.GetRandomSlayer();
                    }
                    else
                    {
                        slayer = SlayerGroup.GetLootSlayerType(from.GetType());
                    }

/*
 *                                      if ( slayer == SlayerName.None )
 *                                      {
 *                                              item.Delete();
 *                                              return null;
 *                                      }
 */
                    BaseInstrument instr = (BaseInstrument)item;

                    instr.Quality = InstrumentQuality.Regular;
                    instr.Slayer  = slayer;
                }

                if (item.Stackable)
                {
                    item.Amount = m_Quantity.Roll();
                }
            }

            return(item);
        }
        public override Tuple <Item[], int> GenerateLootItem(Mobile creature)
        {
            Type       type   = m_WeaponTypes[Utility.Random(m_WeaponTypes.Length)];
            BaseWeapon weapon = Activator.CreateInstance(type) as BaseWeapon;

            if (weapon == null)
            {
                throw new Exception(String.Format("Type {0} is not BaseWeapon or could not be instantiated.", type));
            }

            int value = 100;

            if (0.40 > Utility.RandomDouble())
            {
                int bonus = GetBonus();
                weapon.AccuracyLevel = (WeaponAccuracyLevel)bonus;
                value += 20 * bonus;
            }

            if (0.30 > Utility.RandomDouble())
            {
                int bonus = GetBonus();
                if (PseudoSeerStone.Instance != null && PseudoSeerStone.Instance._HighestDamageLevelSpawn < bonus)
                {
                    bonus = PseudoSeerStone.Instance._HighestDamageLevelSpawn;
                }
                weapon.DamageLevel = (WeaponDamageLevel)bonus;
                value += 20 * bonus;
            }

            if (0.25 > Utility.RandomDouble())
            {
                int bonus = GetBonus();
                weapon.DurabilityLevel = (WeaponDurabilityLevel)bonus;
                value += 20 * bonus;
            }

            if (GetBonus() > 2)
            {
                if (0.10 > Utility.RandomDouble())
                {
                    weapon.Slayer = SlayerName.Silver;
                    value        += 100;
                }

                if (0.01 > Utility.RandomDouble() || (weapon.AccuracyLevel == 0 && weapon.DamageLevel == 0 && weapon.DurabilityLevel == 0 && weapon.Slayer == SlayerName.None && 0.15 > Utility.RandomDouble()))
                {
                    if (creature != null)
                    {
                        weapon.Slayer = SlayerGroup.GetLootSlayerType(creature.GetType());
                    }
                    else
                    {
                        weapon.Slayer = BaseRunicTool.GetRandomSlayer();
                    }

                    value += 100;
                }
            }

            if (weapon.Hue == 0 && 0.01 > Utility.RandomDouble())
            {
                int bonus = GetBonus();

                if (bonus > 2 && 0.045 > Utility.RandomDouble())
                {
                    weapon.Hue = Math.Max(0, GetLowRareHue());
                    value     += 600;
                }
                else if (bonus > 3 && 0.005 > Utility.RandomDouble())
                {
                    weapon.Hue = Math.Max(0, GetHighRareHue());
                    value     += 1200;
                }
                else if (weapon.Resource != CraftResource.RegularWood && bonus == 5 && 0.001 > Utility.RandomDouble())
                {
                    weapon.Hue = Math.Max(0, GetVeryRareHue());
                    value     += 1550;
                }
            }

            return(new Tuple <Item[], int>(new Item[] { weapon }, value));
        }
Beispiel #11
0
        public Item Mutate(Mobile from, int luckChance, Item item)
        {
            if (item != null)
            {
                if (item is BaseWeapon && Utility.Random(100) < 1)
                {
                    item.Delete();
                    item = new FireHorn();
                    return(item);
                }

                if (item is BaseWeapon || item is BaseArmor || item is BaseJewel || item is BaseHat)
                {
                    if (Core.AOS)
                    {
                        var bonusProps = GetBonusProperties();
                        var min        = MinIntensity;
                        var max        = MaxIntensity;

                        if (bonusProps < MaxProps && LootPack.CheckLuck(luckChance))
                        {
                            ++bonusProps;
                        }

                        var props = 1 + bonusProps;

                        // Make sure we're not spawning items with 6 properties.
                        if (props > MaxProps)
                        {
                            props = MaxProps;
                        }

                        if (item is BaseWeapon weapon)
                        {
                            BaseRunicTool.ApplyAttributesTo(weapon, false, luckChance, props, MinIntensity, MaxIntensity);
                        }
                        else if (item is BaseArmor armor)
                        {
                            BaseRunicTool.ApplyAttributesTo(armor, false, luckChance, props, MinIntensity, MaxIntensity);
                        }
                        else if (item is BaseJewel jewel)
                        {
                            BaseRunicTool.ApplyAttributesTo(jewel, false, luckChance, props, MinIntensity, MaxIntensity);
                        }
                        else
                        {
                            BaseRunicTool.ApplyAttributesTo(
                                (BaseHat)item,
                                false,
                                luckChance,
                                props,
                                MinIntensity,
                                MaxIntensity
                                );
                        }
                    }
                    else // not aos
                    {
                        if (item is BaseWeapon weapon)
                        {
                            if (Utility.Random(100) < 80)
                            {
                                weapon.AccuracyLevel = (WeaponAccuracyLevel)GetRandomOldBonus();
                            }

                            if (Utility.Random(100) < 60)
                            {
                                weapon.DamageLevel = (WeaponDamageLevel)GetRandomOldBonus();
                            }

                            if (Utility.Random(100) < 40)
                            {
                                weapon.DurabilityLevel = (WeaponDurabilityLevel)GetRandomOldBonus();
                            }

                            if (Utility.Random(100) < 5)
                            {
                                weapon.Slayer = SlayerName.Silver;
                            }

                            if (from != null && weapon.AccuracyLevel == 0 && weapon.DamageLevel == 0 &&
                                weapon.DurabilityLevel == 0 && weapon.Slayer == SlayerName.None && Utility.Random(100) < 5)
                            {
                                weapon.Slayer = SlayerGroup.GetLootSlayerType(from.GetType());
                            }
                        }
                        else if (item is BaseArmor armor)
                        {
                            if (Utility.Random(100) < 80)
                            {
                                armor.ProtectionLevel = (ArmorProtectionLevel)GetRandomOldBonus();
                            }

                            if (Utility.Random(100) < 40)
                            {
                                armor.Durability = (ArmorDurabilityLevel)GetRandomOldBonus();
                            }
                        }
                    }
                }
                else if (item is BaseInstrument instr)
                {
                    SlayerName slayer;

                    if (Core.AOS)
                    {
                        slayer = BaseRunicTool.GetRandomSlayer();
                    }
                    else
                    {
                        slayer = SlayerGroup.GetLootSlayerType(from.GetType());
                    }

                    if (slayer == SlayerName.None)
                    {
                        instr.Delete();
                        return(null);
                    }

                    instr.Quality = InstrumentQuality.Regular;
                    instr.Slayer  = slayer;
                }

                if (item.Stackable)
                {
                    item.Amount = Quantity.Roll();
                }
            }

            return(item);
        }
Beispiel #12
0
        public Item Mutate(Mobile from, int luckChance, Item item)
        {
            if (item != null)
            {
                if (item is BaseWeapon && 1 > Utility.Random(100))
                {
                    item.Delete();
                    item = new FireHorn();
                    return(item);
                }

                if (item is BaseWeapon || item is BaseArmor || item is BaseJewel)
                {
                    if (Core.AOS)
                    {
                        int bonusProps = GetBonusProperties();

                        if (bonusProps < m_MaxProps && LootPack.CheckLuck(luckChance))
                        {
                            ++bonusProps;
                        }

                        int props = 1 + bonusProps;

                        if (item is BaseWeapon)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }
                        else if (item is BaseArmor)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseArmor)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }
                        else if (item is BaseJewel)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseJewel)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }
                    }
                    else                     // not aos
                    {
                        if (item is BaseWeapon)
                        {
                            BaseWeapon weapon = (BaseWeapon)item;

                            if (80 > Utility.Random(100))
                            {
                                weapon.AccuracyLevel = (WeaponAccuracyLevel)GetRandomOldBonus();
                            }

                            if (60 > Utility.Random(100))
                            {
                                weapon.DamageLevel = (WeaponDamageLevel)GetRandomOldBonus();
                            }

                            if (40 > Utility.Random(100))
                            {
                                weapon.DurabilityLevel = (WeaponDurabilityLevel)GetRandomOldBonus();
                            }

                            if (5 > Utility.Random(100))
                            {
                                weapon.Slayer = SlayerName.Silver;
                            }

                            if (weapon.AccuracyLevel == 0 && weapon.DamageLevel == 0 && weapon.DurabilityLevel == 0 && weapon.Slayer == SlayerName.None && 5 > Utility.Random(100))
                            {
                                weapon.Slayer = SlayerGroup.GetLootSlayerType(from.GetType());
                            }
                        }
                        else if (item is BaseArmor)
                        {
                            BaseArmor armor = (BaseArmor)item;

                            if (80 > Utility.Random(100))
                            {
                                armor.ProtectionLevel = (ArmorProtectionLevel)GetRandomOldBonus();
                            }

                            if (40 > Utility.Random(100))
                            {
                                armor.Durability = (ArmorDurabilityLevel)GetRandomOldBonus();
                            }
                        }
                    }
                }
                else if (item is BaseInstrument)
                {
                    SlayerName slayer = SlayerName.None;

                    if (Core.AOS)
                    {
                        slayer = BaseRunicTool.GetRandomSlayer();
                    }
                    else
                    {
                        slayer = SlayerGroup.GetLootSlayerType(from.GetType());
                    }

                    if (slayer == SlayerName.None)
                    {
                        item.Delete();
                        return(null);
                    }

                    BaseInstrument instr = (BaseInstrument)item;

                    instr.Quality = InstrumentQuality.Regular;
                    instr.Slayer  = slayer;
                }

                if (item.Stackable)
                {
                    item.Amount = m_Quantity.Roll();
                }
            }

            return(item);
        }
Beispiel #13
0
        public Item Mutate(Mobile from, int luckChance, Item item)
        {
            if (item != null)
            {
                if (item is BaseWeapon && 1 > Utility.Random(100))
                {
                    item.Delete();
                    item = new FireHorn();
                    return(item);
                }

                if (item is BaseWeapon || item is BaseArmor || item is BaseJewel || item is BaseHat)
                {
                    // Try to generate a new random item based on the creature killed
                    if (RandomItemGenerator.Enabled && from is BaseCreature)
                    {
                        if (RandomItemGenerator.GenerateRandomItem(item, ((BaseCreature)from).LastKiller, (BaseCreature)from))
                        {
                            return(item);
                        }
                    }

                    int bonusProps = GetBonusProperties();
                    int min        = m_MinIntensity;
                    int max        = m_MaxIntensity;

                    if (bonusProps < m_MaxProps && LootPack.CheckLuck(luckChance))
                    {
                        ++bonusProps;
                    }

                    int props = 1 + bonusProps;

                    // Make sure we're not spawning items with 6 properties.
                    if (props > m_MaxProps)
                    {
                        props = m_MaxProps;
                    }

                    // Use the older style random generation
                    if (item is BaseWeapon)
                    {
                        BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                    }
                    else if (item is BaseArmor)
                    {
                        BaseRunicTool.ApplyAttributesTo((BaseArmor)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                    }
                    else if (item is BaseJewel)
                    {
                        BaseRunicTool.ApplyAttributesTo((BaseJewel)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                    }
                    else if (item is BaseHat)
                    {
                        BaseRunicTool.ApplyAttributesTo((BaseHat)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                    }
                }
                else if (item is BaseInstrument)
                {
                    SlayerName slayer = SlayerName.None;

                    slayer = BaseRunicTool.GetRandomSlayer();

                    if (slayer == SlayerName.None)
                    {
                        item.Delete();
                        return(null);
                    }

                    BaseInstrument instr = (BaseInstrument)item;

                    instr.Quality = ItemQuality.Normal;
                    instr.Slayer  = slayer;
                }

                if (item.Stackable)
                {
                    item.Amount = m_Quantity.Roll();
                }
            }

            return(item);
        }
Beispiel #14
0
        public Item Mutate(Mobile from, int luckChance, Item item)
        {
            if (item != null)
            {
                if (item is BaseWeapon || item is BaseArmor || item is BaseJewel)
                {
                    if (Core.AOS)
                    {
                        int bonusProps = GetBonusProperties();
                        int min        = m_MinIntensity;
                        int max        = m_MaxIntensity;

                        if (bonusProps < m_MaxProps && LootPack.CheckLuck(luckChance))
                        {
                            ++bonusProps;
                        }

                        int props = 1 + bonusProps;

                        if (item is BaseWeapon)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }
                        else if (item is BaseArmor)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseArmor)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }
                        else if (item is BaseJewel)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseJewel)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }
                    }
                    else                     // not aos
                    {
                        if (item is BaseWeapon)
                        {
                            BaseWeapon weapon = (BaseWeapon)item;

                            if (80 > Utility.Random(100))
                            {
                                weapon.AccuracyLevel = (WeaponAccuracyLevel)GetRandomOldBonus();
                            }

                            if (60 > Utility.Random(100))
                            {
                                weapon.DamageLevel = (WeaponDamageLevel)GetRandomOldBonus();
                            }

                            if (40 > Utility.Random(100))
                            {
                                weapon.DurabilityLevel = (WeaponDurabilityLevel)GetRandomOldBonus();
                            }

                            if (20 > Utility.Random(100))
                            {
                                weapon.Slayer = SlayerName.Silver;
                            }

                            if (weapon.AccuracyLevel == 0 && weapon.DamageLevel == 0 && weapon.DurabilityLevel == 0 && 35 > Utility.Random(100))
                            {
                                switch (Utility.Random(25))
                                {
                                case 0:
                                {
                                    weapon.Slayer = SlayerName.Silver;
                                    break;
                                }

                                case 1:
                                {
                                    weapon.Slayer = SlayerName.OrcSlaying;
                                    break;
                                }

                                case 2:
                                {
                                    weapon.Slayer = SlayerName.TrollSlaughter;
                                    break;
                                }

                                case 3:
                                {
                                    weapon.Slayer = SlayerName.OgreTrashing;
                                    break;
                                }

                                case 4:
                                {
                                    weapon.Slayer = SlayerName.Repond;
                                    break;
                                }

                                case 5:
                                {
                                    weapon.Slayer = SlayerName.DragonSlaying;
                                    break;
                                }

                                case 6:
                                {
                                    weapon.Slayer = SlayerName.Terathan;
                                    break;
                                }

                                case 7:
                                {
                                    weapon.Slayer = SlayerName.LizardmanSlaughter;
                                    break;
                                }

                                case 8:
                                {
                                    weapon.Slayer = SlayerName.ReptilianDeath;
                                    break;
                                }

                                case 9:
                                {
                                    weapon.Slayer = SlayerName.DaemonDismissal;
                                    break;
                                }

                                case 10:
                                {
                                    weapon.Slayer = SlayerName.GargoylesFoe;
                                    break;
                                }

                                case 11:
                                {
                                    weapon.Slayer = SlayerName.BalronDamnation;
                                    break;
                                }

                                case 12:
                                {
                                    weapon.Slayer = SlayerName.Exorcism;
                                    break;
                                }

                                case 13:
                                {
                                    weapon.Slayer = SlayerName.Ophidian;
                                    break;
                                }

                                case 14:
                                {
                                    weapon.Slayer = SlayerName.SpidersDeath;
                                    break;
                                }

                                case 15:
                                {
                                    weapon.Slayer = SlayerName.ScorpionsBane;
                                    break;
                                }

                                case 16:
                                {
                                    weapon.Slayer = SlayerName.ArachnidDoom;
                                    break;
                                }

                                case 17:
                                {
                                    weapon.Slayer = SlayerName.FlameDousing;
                                    break;
                                }

                                case 18:
                                {
                                    weapon.Slayer = SlayerName.WaterDissipation;
                                    break;
                                }

                                case 19:
                                {
                                    weapon.Slayer = SlayerName.Vacuum;
                                    break;
                                }

                                case 20:
                                {
                                    weapon.Slayer = SlayerName.ElementalHealth;
                                    break;
                                }

                                case 21:
                                {
                                    weapon.Slayer = SlayerName.EarthShatter;
                                    break;
                                }

                                case 22:
                                {
                                    weapon.Slayer = SlayerName.BloodDrinking;
                                    break;
                                }

                                case 23:
                                {
                                    weapon.Slayer = SlayerName.SummerWind;
                                    break;
                                }

                                case 24:
                                {
                                    weapon.Slayer = SlayerName.ElementalBan;
                                    break;
                                }

                                case 25:
                                {
                                    weapon.Slayer = SlayerName.Fey;
                                    break;
                                }
                                }
                            }
                        }
                        else if (item is BaseArmor)
                        {
                            BaseArmor armor = (BaseArmor)item;

                            if (80 > Utility.Random(100))
                            {
                                armor.ProtectionLevel = (ArmorProtectionLevel)GetRandomOldBonus();
                            }

                            if (40 > Utility.Random(100))
                            {
                                armor.Durability = (ArmorDurabilityLevel)GetRandomOldBonus();
                            }
                        }
                        else if (item is BaseJewel)
                        {
                            BaseJewel jewel = (BaseJewel)item;

                            if (80 > Utility.Random(100))
                            {
                                jewel.Effect = (MagicEffect)Utility.Random(0, 11);
                                jewel.Uses   = Utility.Random(1, 10);
                            }
                        }
                    }
                }
                else if (item is BaseInstrument)
                {
                    SlayerName slayer = SlayerName.None;

                    if (Core.AOS)
                    {
                        slayer = BaseRunicTool.GetRandomSlayer();
                    }
                    else
                    {
                        slayer = SlayerGroup.GetLootSlayerType(from.GetType());
                    }

                    if (slayer == SlayerName.None)
                    {
                        item.Delete();
                        return(null);
                    }

                    BaseInstrument instr = (BaseInstrument)item;

                    instr.Quality = InstrumentQuality.Regular;
                    instr.Slayer  = slayer;
                }

                if (item.Stackable)
                {
                    item.Amount = m_Quantity.Roll();
                }
            }

            return(item);
        }
Beispiel #15
0
        public Item Mutate(Mobile m, int luckChance, Item item, int index, int itemIndex)
        {
            if (item != null)
            {
                //Console.WriteLine("Mutate: Existance Check Passed");
                if (item is BaseWeapon && 1 > Utility.Random(100))
                {
                    //Console.WriteLine("Mutate: Created Fire Horn");
                    item.Delete();
                    item = new FireHorn();
                    return(item);
                }

                if (item is BaseWeapon || item is BaseArmor || item is BaseJewel || item is BaseHat)
                {
                    int m_MinIntensity = m_Entries[index].AttributeAmount;
                    int m_MaxIntensity = (int)m_Entries[index].AttributeChance + (int)m_Entries[index].AttributeAmount;
                    //Console.WriteLine("Mutate: Intensity ({0},{1})", m_MinIntensity, m_MaxIntensity);

                    if (Core.AOS)
                    {
                        //Console.WriteLine("Mutate: -(AOS)-");
                        int bonusProps = Custom.ItemProps.BonusCount(item); //GetBonusProperties();
                        //int min = m_MinIntensity;
                        //int max = m_MaxIntensity;
                        int m_MaxProps = m_Entries[index].AttributeAmount;
                        //Console.WriteLine("Mutate: Current Props {0} :: Max Props {1}", bonusProps, m_MaxProps);

                        if (bonusProps < m_MaxProps)// && LootPack.CheckLuck(luckChance))
                        {
                            ++bonusProps;
                        }


                        int props = 1 + bonusProps;

                        // Make sure we're not spawning items with to many properties.
                        if (props > m_MaxProps)
                        {
                            props = m_MaxProps;
                        }

                        //Console.WriteLine("Mutate: Prop Check Passed");

                        if (item is BaseWeapon)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }
                        else if (item is BaseArmor)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseArmor)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }
                        else if (item is BaseJewel)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseJewel)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }
                        else if (item is BaseHat)
                        {
                            BaseRunicTool.ApplyAttributesTo((BaseHat)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity);
                        }
                    }
                    else // not aos
                    {
                        if (item is BaseWeapon)
                        {
                            BaseWeapon weapon = (BaseWeapon)item;

                            if (80 > Utility.Random(100))
                            {
                                weapon.AccuracyLevel = (WeaponAccuracyLevel)GetRandomOldBonus(m_MinIntensity, m_MaxIntensity);
                            }

                            if (60 > Utility.Random(100))
                            {
                                weapon.DamageLevel = (WeaponDamageLevel)GetRandomOldBonus(m_MinIntensity, m_MaxIntensity);
                            }

                            if (40 > Utility.Random(100))
                            {
                                weapon.DurabilityLevel = (WeaponDurabilityLevel)GetRandomOldBonus(m_MinIntensity, m_MaxIntensity);
                            }

                            if (5 > Utility.Random(100))
                            {
                                weapon.Slayer = SlayerName.Silver;
                            }

                            if (m != null && weapon.AccuracyLevel == 0 && weapon.DamageLevel == 0 && weapon.DurabilityLevel == 0 && weapon.Slayer == SlayerName.None && 5 > Utility.Random(100))
                            {
                                weapon.Slayer = SlayerGroup.GetLootSlayerType(m.GetType());
                            }
                        }
                        else if (item is BaseArmor)
                        {
                            BaseArmor armor = (BaseArmor)item;

                            if (80 > Utility.Random(100))
                            {
                                armor.ProtectionLevel = (ArmorProtectionLevel)GetRandomOldBonus(m_MinIntensity, m_MaxIntensity);
                            }

                            if (40 > Utility.Random(100))
                            {
                                armor.Durability = (ArmorDurabilityLevel)GetRandomOldBonus(m_MinIntensity, m_MaxIntensity);
                            }
                        }
                    }
                }
                else if (item is BaseInstrument)
                {
                    SlayerName slayer = SlayerName.None;

                    if (Core.AOS)
                    {
                        slayer = BaseRunicTool.GetRandomSlayer();
                    }
                    else
                    {
                        slayer = SlayerGroup.GetLootSlayerType(m.GetType());
                    }

                    if (slayer == SlayerName.None)
                    {
                        item.Delete();
                        return(null);
                    }

                    BaseInstrument instr = (BaseInstrument)item;

                    instr.Quality = InstrumentQuality.Regular;
                    instr.Slayer  = slayer;
                }

                if (item.Stackable)
                {
                    item.Amount = m_Entries[index].DropAmount; //m_Quantity.Roll();
                }
            }

            return(item);
        }
Beispiel #16
0
 public SlayerLongbow()
 {
     Slayer2 = BaseRunicTool.GetRandomSlayer();
 }