public CharredSprite() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.175, 0.350)
        {
            Name        = "a charred sprite";
            BaseSoundID = 0x57B;
            Body        = 264;
            Hue         = 1908;

            SetStr(150, 160);
            SetDex(24, 38);
            SetInt(12, 19);

            SetHits(470, 595);
            SetMana(0);

            SetDamage(8, 12);

            SetDamageType(ResistanceType.Physical, 40);
            SetDamageType(ResistanceType.Fire, 60);

            SetResistance(ResistanceType.Physical, 10);
            SetResistance(ResistanceType.Fire, 70);
            SetResistance(ResistanceType.Cold, -50);
            SetResistance(ResistanceType.Poison, 10);
            SetResistance(ResistanceType.Energy, 10);

            SetSkill(SkillName.MagicResist, 11.5, 21.1);
            SetSkill(SkillName.Tactics, 56.5, 62.2);
            SetSkill(SkillName.Wrestling, 70.2, 77.3);

            Fame  = 2000;
            Karma = -2000;

            AddItem(new LightSource());

            PackReg(1, 5);

            Container pack = new Backpack();

            pack.DropItem(new Gold(Utility.RandomMinMax(13, 28)));
            pack.DropItem(Loot.RandomClothing());
            pack.DropItem(Loot.RandomClothing());


            if (Utility.RandomDouble() < 0.05)
            {
                BaseArmor armor = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor, 5, 15, 30);

                pack.DropItem(armor);
            }

            Container bag = new Bag();

            bag.DropItem(new Gold(Utility.RandomMinMax(215, 345)));
            bag.DropItem(new SulfurousAsh(Utility.RandomMinMax(39, 58)));
            bag.DropItem(Loot.RandomWand());
            bag.DropItem(new HealPotion());
            bag.DropItem(Loot.RandomPotion());
            bag.DropItem(Loot.RandomGem());

            if (Utility.RandomDouble() < 0.05)
            {
                BaseClothing clothing = Loot.RandomClothing(true);
                BaseRunicTool.ApplyAttributesTo(clothing, 2, 15, 20);

                clothing.Attributes.ReflectPhysical = 3;

                bag.DropItem(clothing);
            }

            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel jewel = new GoldRing();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(jewel, 4, 15, 20);
                }

                jewel.Attributes.SpellDamage = 5;
                jewel.Resistances.Energy     = 9;

                bag.DropItem(jewel);
            }

            Item ScrollLoot = Loot.RandomScroll(0, 50, SpellbookType.Regular);

            ScrollLoot.Amount = Utility.Random(2, 5);
            bag.DropItem(ScrollLoot);

            pack.DropItem(bag);

            PackItem(pack);
        }
Esempio n. 2
0
        public bool GiveReward(Mobile to)
        {
            Bag bag = new Bag();

            bag.DropItem(new Gold(Utility.RandomMinMax(500, 1000)));

            if (Utility.RandomBool())
            {
                BaseWeapon weapon = Loot.RandomWeapon();

                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(weapon, 2, 20, 30);
                }
                else
                {
                    weapon.DamageLevel     = (WeaponDamageLevel)BaseCreature.RandomMinMaxScaled(2, 3);
                    weapon.AccuracyLevel   = (WeaponAccuracyLevel)BaseCreature.RandomMinMaxScaled(2, 3);
                    weapon.DurabilityLevel = (WeaponDurabilityLevel)BaseCreature.RandomMinMaxScaled(2, 3);
                }

                bag.DropItem(weapon);
            }
            else
            {
                Item item;

                if (Core.AOS)
                {
                    item = Loot.RandomArmorOrShieldOrJewelry();

                    if (item is BaseArmor)
                    {
                        BaseRunicTool.ApplyAttributesTo((BaseArmor)item, 2, 20, 30);
                    }
                    else if (item is BaseJewel)
                    {
                        BaseRunicTool.ApplyAttributesTo((BaseJewel)item, 2, 20, 30);
                    }
                }
                else
                {
                    BaseArmor armor = Loot.RandomArmorOrShield();
                    item = armor;

                    armor.ProtectionLevel = (ArmorProtectionLevel)BaseCreature.RandomMinMaxScaled(2, 3);
                    armor.Durability      = (ArmorDurabilityLevel)BaseCreature.RandomMinMaxScaled(2, 3);
                }

                bag.DropItem(item);
            }

            bag.DropItem(new Obsidian());

            if (to.PlaceInBackpack(bag))
            {
                return(true);
            }
            else
            {
                bag.Delete();
                return(false);
            }
        }
Esempio n. 3
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);
        }
Esempio n. 4
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            QuestSystem qs = player.Quest;

            if (qs is DarkTidesQuest)
            {
                if (DarkTidesQuest.HasLostCallingScroll(player))
                {
                    qs.AddConversation(new LostCallingScrollConversation(true));
                }
                else
                {
                    QuestObjective obj = qs.FindObjective(typeof(FindMardothAboutVaultObjective));

                    if (obj != null && !obj.Completed)
                    {
                        obj.Complete();
                    }
                    else
                    {
                        obj = qs.FindObjective(typeof(FindMardothAboutKronusObjective));

                        if (obj != null && !obj.Completed)
                        {
                            obj.Complete();
                        }
                        else
                        {
                            obj = qs.FindObjective(typeof(FindMardothEndObjective));

                            if (obj != null && !obj.Completed)
                            {
                                Container cont = GetNewContainer();

                                cont.DropItem(new PigIron(20));
                                cont.DropItem(new NoxCrystal(20));
                                cont.DropItem(new BatWing(25));
                                cont.DropItem(new DaemonBlood(20));
                                cont.DropItem(new GraveDust(20));

                                BaseWeapon weapon = new BoneHarvester();

                                weapon.Slayer = SlayerName.OrcSlaying;

                                if (Core.AOS)
                                {
                                    BaseRunicTool.ApplyAttributesTo(weapon, 3, 20, 40);
                                }
                                else
                                {
                                    weapon.DamageLevel     = (WeaponDamageLevel)BaseCreature.RandomMinMaxScaled(2, 4);
                                    weapon.AccuracyLevel   = (WeaponAccuracyLevel)BaseCreature.RandomMinMaxScaled(2, 4);
                                    weapon.DurabilityLevel = (WeaponDurabilityLevel)BaseCreature.RandomMinMaxScaled(2, 4);
                                }

                                cont.DropItem(weapon);

                                cont.DropItem(new BankCheck(2000));
                                cont.DropItem(new EnchantedSextant());

                                if (!player.PlaceInBackpack(cont))
                                {
                                    cont.Delete();
                                    player.SendLocalizedMessage(1046260);                                       // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                                }
                                else
                                {
                                    obj.Complete();
                                }
                            }
                            else if (contextMenu)
                            {
                                FocusTo(player);
                                player.SendLocalizedMessage(1061821);                                   // Mardoth has nothing more for you at this time.
                            }
                        }
                    }
                }
            }
            else if (qs == null && QuestSystem.CanOfferQuest(player, typeof(DarkTidesQuest)))
            {
                new DarkTidesQuest(player).SendOffer();
            }
        }
Esempio n. 5
0
        public override void GenerateLoot()
        {
            AddLoot(LootPack.FilthyRich, 5);
            AddLoot(LootPack.HighScrolls, 3);
            AddLoot(LootPack.MedScrolls, 4);
            AddLoot(LootPack.LowScrolls, 6);
            AddLoot(LootPack.Gems, 5);

            if (Utility.RandomDouble() < 0.20)
            {
                BaseWeapon weapon = Loot.RandomWeapon(true);
                switch (Utility.Random(33))
                {
                case 0: weapon = new BattleAxe(); break;

                case 1: weapon = new ExecutionersAxe(); break;

                case 2: weapon = new LargeBattleAxe(); break;

                case 3: weapon = new WarAxe(); break;

                case 4: weapon = new Bow(); break;

                case 5: weapon = new Crossbow(); break;

                case 6: weapon = new HeavyCrossbow(); break;

                case 7: weapon = new WarHammer(); break;

                case 8: weapon = new WarMace(); break;

                case 9: weapon = new Bardiche(); break;

                case 10: weapon = new Halberd(); break;

                case 11: weapon = new Spear(); break;

                case 12: weapon = new QuarterStaff(); break;

                case 13: weapon = new Katana(); break;

                case 14: weapon = new Longsword(); break;

                case 15: weapon = new VikingSword(); break;

                case 16: weapon = new CompositeBow(); break;

                case 17: weapon = new CrescentBlade(); break;

                case 18: weapon = new DoubleBladedStaff(); break;

                case 19: weapon = new Lance(); break;

                case 20: weapon = new PaladinSword(); break;

                case 21: weapon = new Scythe(); break;

                case 22: weapon = new Daisho(); break;

                case 23: weapon = new Lajatang(); break;

                case 24: weapon = new NoDachi(); break;

                case 25: weapon = new Tetsubo(); break;

                case 26: weapon = new Yumi(); break;

                case 27: weapon = new ElvenCompositeLongbow(); break;

                case 28: weapon = new OrnateAxe(); break;

                case 29: weapon = new RadiantScimitar(); break;

                case 30: weapon = new WarCleaver(); break;

                case 31: weapon = new WildStaff(); break;

                default: weapon = new DiamondMace(); break;
                }

                BaseRunicTool.ApplyAttributesTo(weapon, 5, 35, 50);
                weapon.Hue = 1461;

                PackItem(weapon);
            }

            if (Utility.RandomDouble() < 0.20)
            {
                BaseArmor armor = Loot.RandomArmor(true);
                switch (Utility.Random(5))
                {
                case 0: armor = new CrusaderGauntlets(); break;

                case 1: armor = new CrusaderGorget(); break;

                case 2: armor = new CrusaderLeggings(); break;

                case 3: armor = new CrusaderSleeves(); break;

                default: armor = new CrusaderBreastplate(); break;
                }

                BaseRunicTool.ApplyAttributesTo(armor, 5, 35, 50);
                armor.Hue = 1461;

                PackItem(armor);
            }

            if (Utility.RandomDouble() < 0.20)
            {
                BaseClothing clothing = Loot.RandomClothing(true);
                BaseRunicTool.ApplyAttributesTo(clothing, 5, 35, 50);
                clothing.Hue = 1461;

                PackItem(clothing);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseShield shield = new MetalKiteShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield, 5, 35, 50);
                }
                shield.Hue = 1461;

                PackItem(shield);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel bracelet = new GoldBracelet();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(bracelet, 5, 35, 50);
                }
                bracelet.Hue = 1461;

                PackItem(bracelet);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel earrings = new GoldEarrings();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(earrings, 5, 35, 50);
                }
                earrings.Hue = 1461;

                PackItem(earrings);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel necklace = new GoldNecklace();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(necklace, 5, 35, 50);
                }
                necklace.Hue = 1461;

                PackItem(necklace);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel ring = new GoldRing();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(ring, 5, 35, 50);
                }
                ring.Hue = 1461;

                PackItem(ring);
            }
        }
Esempio n. 6
0
        public override void AddComponents()
        {
            BaseCreature bc;

            AddItem(new Static(0xFAC), 0, 0, 0); // fire pit
            AddItem(new Static(0xDE3), 0, 0, 0); // camp fire
            AddItem(new Static(0x974), 0, 0, 1); // cauldron

            // Chest
            MetalChest chest = new MetalChest();

            switch (Utility.Random(3))
            {
            case 0: chest.ItemID = 0x9AB; break;     // MetalChest

            case 1: chest.ItemID = 0xe43; break;     // WoodenChest

            case 2: chest.ItemID = 0x9A9; break;     // SmallCrate
            }

            chest.Movable       = false;
            chest.Locked        = true;
            chest.TrapType      = TrapType.ExplosionTrap;
            chest.TrapPower     = Utility.RandomMinMax(30, 40);
            chest.TrapLevel     = 2;
            chest.RequiredSkill = 76;
            chest.LockLevel     = 66;
            chest.MaxLockLevel  = 116;
            chest.DropItem(new Gold(Utility.RandomMinMax(100, 400)));
            chest.DropItem(new Arrow(10));
            chest.DropItem(new Bolt(10));

            if (Utility.RandomDouble() < 0.8)
            {
                switch (Utility.Random(4))
                {
                case 0: chest.DropItem(new LesserCurePotion()); break;

                case 1: chest.DropItem(new LesserExplosionPotion()); break;

                case 2: chest.DropItem(new LesserHealPotion()); break;

                case 3: chest.DropItem(new LesserPoisonPotion()); break;
                }
            }

            if (Utility.RandomDouble() < 0.5)
            {
                Item item = Loot.RandomArmorOrShieldOrWeapon();

                if (item is BaseWeapon)
                {
                    BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, false, 0, Utility.RandomMinMax(1, 5), 10, 100);
                }
                else if (item is BaseArmor)
                {
                    BaseRunicTool.ApplyAttributesTo((BaseArmor)item, false, 0, Utility.RandomMinMax(1, 5), 10, 100);
                }

                chest.DropItem(item);
            }

            AddItem(chest, 1, 1, 1);

            // Brigands
            AddMobile(new Brigand(), 15, 0, -2, 0);
            AddMobile(new Brigand(), 15, 0, 1, 0);
            AddMobile(new Brigand(), 15, 0, -1, 0);
            AddMobile(new Brigand(), 15, 0, 0, 0);
            AddMobile(new Brigand(), 15, 0, -1, 0);
            AddMobile(new Brigand(), 15, 0, 0, 0);

            // prisioner
            switch (Utility.Random(2))
            {
            case 0: m_Prisoner = new Noble(); break;

            case 1: m_Prisoner = new SeekerOfAdventure(); break;
            }

            bc                 = (BaseCreature)m_Prisoner;
            bc.IsPrisoner      = true;
            m_Prisoner.YellHue = Utility.RandomList(0x57, 0x67, 0x77, 0x87, 0x117);

            AddMobile(m_Prisoner, 2, -2, 0, 0);
        }
Esempio n. 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);
        }
Esempio n. 8
0
        private void Fill(int level)
        {
            TrapType  = TrapType.ExplosionTrap;
            TrapPower = level * 25;
            TrapLevel = level;
            Locked    = true;

            RequiredSkill = level switch
            {
                1 => 36,
                2 => 76,
                3 => 84,
                4 => 92,
                5 => 100,
                _ => RequiredSkill
            };

            LockLevel    = RequiredSkill - 10;
            MaxLockLevel = RequiredSkill + 40;

            DropItem(new Gold(level * 200));

            for (int i = 0; i < level; ++i)
            {
                DropItem(Loot.RandomScroll(0, 63, SpellbookType.Regular));
            }

            for (int i = 0; i < level * 2; ++i)
            {
                Item item;

                if (Core.AOS)
                {
                    item = Loot.RandomArmorOrShieldOrWeaponOrJewelry();
                }
                else
                {
                    item = Loot.RandomArmorOrShieldOrWeapon();
                }

                if (item is BaseWeapon weapon)
                {
                    if (Core.AOS)
                    {
                        GetRandomAOSStats(out int attributeCount, out int min, out int max);
                        BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);
                    }
                    else
                    {
                        weapon.DamageLevel     = (WeaponDamageLevel)Utility.Random(6);
                        weapon.AccuracyLevel   = (WeaponAccuracyLevel)Utility.Random(6);
                        weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6);
                    }

                    DropItem(weapon);
                }
                else if (item is BaseArmor armor)
                {
                    if (Core.AOS)
                    {
                        GetRandomAOSStats(out int attributeCount, out int min, out int max);
                        BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);
                    }
                    else
                    {
                        armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6);
                        armor.Durability      = (ArmorDurabilityLevel)Utility.Random(6);
                    }

                    DropItem(armor);
                }
                else if (item is BaseHat hat)
                {
                    if (Core.AOS)
                    {
                        GetRandomAOSStats(out int attributeCount, out int min, out int max);
                        BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max);
                    }

                    DropItem(hat);
                }
                else if (item is BaseJewel jewel)
                {
                    GetRandomAOSStats(out int attributeCount, out int min, out int max);
                    BaseRunicTool.ApplyAttributesTo(jewel, attributeCount, min, max);

                    DropItem(jewel);
                }
            }

            for (int i = 0; i < level; i++)
            {
                Item item = Loot.RandomPossibleReagent();
                item.Amount = Utility.RandomMinMax(40, 60);
                DropItem(item);
            }

            for (int i = 0; i < level; i++)
            {
                Item item = Loot.RandomGem();
                DropItem(item);
            }

            DropItem(new TreasureMap(level + 1, Utility.RandomBool() ? Map.Felucca : Map.Trammel));
        }
Esempio n. 9
0
        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));
        }
Esempio n. 10
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            Direction = this.GetDirectionTo(player);

            QuestSystem qs = player.Quest;

            if (qs is TerribleHatchlingsQuest)
            {
                if (qs.IsObjectiveInProgress(typeof(ReturnToAnsellaGryenObjective)))
                {
                    Container cont = GetNewContainer();

                    cont.DropItem(new Gold(Utility.RandomMinMax(100, 200)));

                    switch (Utility.Random(1))
                    {
                    case 0:
                    {
                        BaseWeapon weapon = Loot.RandomWeapon(true);

                        BaseRunicTool.ApplyAttributesTo(weapon, 3, 10, 30);

                        cont.DropItem(weapon);

                        break;
                    }

                    case 1:
                    {
                        BaseArmor armor = Loot.RandomArmor(true);

                        BaseRunicTool.ApplyAttributesTo(armor, 1, 10, 20);

                        cont.DropItem(armor);

                        break;
                    }
                    }

                    player.AddToBackpack(cont);

                    qs.AddConversation(new RewardsConversation());
                }
                else
                {
                    qs.AddConversation(new DeathwatchBeetlesLocationConversation());
                }
            }
            else
            {
                QuestSystem newQuest        = new TerribleHatchlingsQuest(player);
                bool        inRestartPeriod = false;

                if (qs != null)
                {
                    SayTo(player, 1063322);                       // Before you can help me with the Terrible Hatchlings, you'll need to finish the quest you've already taken!
                }
                else if (QuestSystem.CanOfferQuest(player, typeof(TerribleHatchlingsQuest), out inRestartPeriod))
                {
                    PlaySound(0x2A3);

                    newQuest.SendOffer();
                }
                else if (inRestartPeriod && contextMenu)
                {
                    SayTo(player, 1049357);                       // I have nothing more for you at this time.
                }
            }
        }
        public DragonianZealot() : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
        {
            Name        = NameList.RandomName("dragon");
            Title       = "the dragonian zealot";
            Body        = 454;
            BaseSoundID = 362;

            SetStr(792, 825);
            SetDex(88, 110);
            SetInt(437, 475);

            SetHits(956, 990);
            SetMana(2185, 2375);

            SetDamage(16, 22);

            SetDamageType(ResistanceType.Physical, 100);

            SetResistance(ResistanceType.Physical, 60);
            SetResistance(ResistanceType.Fire, 60);
            SetResistance(ResistanceType.Cold, 30);
            SetResistance(ResistanceType.Poison, 25);
            SetResistance(ResistanceType.Energy, 35);

            SetSkill(SkillName.EvalInt, 58.0, 80.4);
            SetSkill(SkillName.Magery, 87.5, 99.4);
            SetSkill(SkillName.MagicResist, 99.2, 100.0);
            SetSkill(SkillName.Tactics, 97.6, 100.0);
            SetSkill(SkillName.Wrestling, 91.0, 93.2);

            Fame  = 88000;
            Karma = -88000;

////////////////////////////////Main Pack////////////////////////////////

            PackGold(75, 92);
            PackReg(25, 35);

////////////////////////////////1st Backpack////////////////////////////////

            Container pack1 = new Backpack();

            pack1.DropItem(new Cloak(532));
            pack1.DropItem(new Circlet());

            if (Utility.RandomDouble() < 0.25)
            {
                BaseArmor armor1 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor1, 5, 15, 30);

                pack1.DropItem(armor1);
            }

            if (Utility.RandomDouble() < 0.25)
            {
                BaseArmor armor2 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor2, 5, 15, 30);

                pack1.DropItem(armor2);
            }

            if (Utility.RandomDouble() < 0.25)
            {
                BaseArmor armor3 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor3, 5, 15, 30);

                pack1.DropItem(armor3);
            }

            if (Utility.RandomDouble() < 0.25)
            {
                BaseArmor armor4 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor4, 5, 15, 30);

                pack1.DropItem(armor4);
            }

            if (Utility.RandomDouble() < 0.20)
            {
                BaseArmor armor5 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor5, 5, 15, 30);

                pack1.DropItem(armor5);
            }

            if (Utility.RandomDouble() < 0.50)
            {
                BaseWeapon weapon = Loot.RandomWeapon(true);
                BaseRunicTool.ApplyAttributesTo(weapon, 5, 25, 30);

                pack1.DropItem(weapon);
            }

            Container bag1 = new Bag();

            bag1.DropItem(new Gold(Utility.RandomMinMax(50, 100)));
            bag1.DropItem(new Bandage(Utility.RandomMinMax(9, 18)));
            bag1.DropItem(Loot.RandomGem());
            bag1.DropItem(Loot.RandomGem());
            pack1.DropItem(bag1);

            PackItem(pack1);

////////////////////////////////2nd Backpack////////////////////////////////

            Container pack2 = new Backpack();

            if (Utility.RandomDouble() < 0.10)
            {
                BaseWeapon weapon = Loot.RandomWeapon(true);
                BaseRunicTool.ApplyAttributesTo(weapon, 5, 15, 30);

                pack2.DropItem(weapon);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseArmor armor1 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor1, 5, 15, 30);

                pack2.DropItem(armor1);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseArmor armor2 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor2, 5, 15, 30);

                pack2.DropItem(armor2);
            }

            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel earrings = new GoldEarrings();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(earrings, 5, 15, 30);
                }

                pack2.DropItem(earrings);
            }

            Container bag2 = new Bag();

            bag2.DropItem(new Gold(Utility.RandomMinMax(100, 250)));
            bag2.DropItem(new DragonScale(Utility.RandomMinMax(15, 25)));
            bag2.DropItem(Loot.RandomPotion());
            bag2.DropItem(new GreaterCurePotion());
            bag2.DropItem(new GreaterStrengthPotion());
            bag2.DropItem(new HealPotion());
            bag2.DropItem(Loot.RandomGem());
            bag2.DropItem(Loot.RandomGem());
            pack2.DropItem(bag2);

            PackItem(pack2);

////////////////////////////////3rd Backpack////////////////////////////////

            Container pack3 = new Backpack();

            pack3.DropItem(new Spellbook());
            pack3.DropItem(Loot.RandomWand());
            pack3.DropItem(Loot.RandomClothing());
            pack3.DropItem(Loot.RandomClothing());

            if (Utility.RandomDouble() < 0.10)
            {
                BaseClothing clothing = Loot.RandomClothing(true);
                BaseRunicTool.ApplyAttributesTo(clothing, 3, 15, 30);

                pack3.DropItem(clothing);
            }

            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel necklace = new GoldNecklace();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(necklace, 3, 15, 30);
                }

                pack3.DropItem(necklace);
            }

            Container bag3 = new Bag();

            bag3.DropItem(new Gold(Utility.RandomMinMax(25, 50)));
            bag3.DropItem(new Bandage(Utility.RandomMinMax(5, 15)));
            bag3.DropItem(Loot.RandomGem());

            Item ScrollLoot1 = Loot.RandomScroll(0, 50, SpellbookType.Regular);

            ScrollLoot1.Amount = Utility.Random(2, 5);
            bag3.DropItem(ScrollLoot1);

            Item ScrollLoot2 = Loot.RandomScroll(0, 50, SpellbookType.Regular);

            ScrollLoot2.Amount = Utility.Random(2, 5);
            bag3.DropItem(ScrollLoot2);

            Item ScrollLoot3 = Loot.RandomScroll(0, 50, SpellbookType.Regular);

            ScrollLoot3.Amount = Utility.Random(2, 5);
            bag3.DropItem(ScrollLoot3);

            pack3.DropItem(bag3);

            PackItem(pack3);
        }
Esempio n. 12
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            Direction = GetDirectionTo(player);

            QuestSystem qs = player.Quest;

            if (qs is EminosUndertakingQuest)
            {
                if (qs.IsObjectiveInProgress(typeof(FindDaimyoEminoObjective)))
                {
                    QuestObjective obj = qs.FindObjective(typeof(FindDaimyoEminoObjective));

                    if (obj != null)
                    {
                        obj.Complete();
                    }

                    qs.AddConversation(new DaimyoEminoBeginConversation());

                    qs.AddObjective(new FindEliteNinjaZoelObjective());
                }

                if (qs.IsObjectiveInProgress(typeof(TakeGreenTeleporterObjective)))
                {
                    QuestObjective obj = qs.FindObjective(typeof(TakeGreenTeleporterObjective));

                    if (obj != null)
                    {
                        obj.Complete();
                    }

                    qs.AddConversation(new EminoSecondConversation());

                    player.AddToBackpack(new NoteForZoel());

                    player.AddToBackpack(new LeatherNinjaPants());

                    player.AddToBackpack(new LeatherNinjaMitts());

                    qs.AddObjective(new BringNoteToZoelObjective());
                }

                if (qs.IsObjectiveInProgress(typeof(GoBackBlueTeleporterObjective)))
                {
                    QuestObjective obj = qs.FindObjective(typeof(GoBackBlueTeleporterObjective));

                    if (obj != null)
                    {
                        obj.Complete();
                    }

                    qs.AddConversation(new FrownsConversation());

                    Bag bag = new Bag();

                    bag.Hue = 0x660;

                    bag.DropItem(new LeatherNinjaJacket());
                    bag.DropItem(new LeatherNinjaHood());

                    for (int i = 0; i < 10; i++)
                    {
                        bag.DropItem(new LesserHealPotion());
                    }

                    player.AddToBackpack(bag);

                    qs.AddObjective(new TakeWhiteTeleporterObjective());
                }

                if (qs.IsObjectiveInProgress(typeof(KillHenchmensObjective)))
                {
                    qs.AddConversation(new ContinueKillHenchmensConversation());
                }

                if (qs.IsObjectiveInProgress(typeof(ReturnToDaimyoObjective)))
                {
                    ArrayList list = player.Backpack.Items;

                    DaimyoEminosKatana katana = null;

                    for (int i = 0; i < list.Count; i++)
                    {
                        if ((Item)list[i] is DaimyoEminosKatana)
                        {
                            katana = list[i] as DaimyoEminosKatana;

                            break;
                        }
                    }

                    if (katana == null)
                    {
                        qs.AddConversation(new TakeSwordAgainConversation());
                    }
                    else
                    {
                        katana.Delete();

                        QuestObjective obj = qs.FindObjective(typeof(ReturnToDaimyoObjective));

                        if (obj != null)
                        {
                            obj.Complete();
                        }

                        qs.AddConversation(new GiftsConversation());

                        Kama kama = new Kama();

                        BaseRunicTool.ApplyAttributesTo(kama, 1, 10, 30);

                        player.AddToBackpack(kama);

                        qs.Complete();
                    }
                }
            }
        }
        public Ogre() : base(AIType.AI_Melee, FightMode.Closest, 5, 1, 0.3, 0.6)
        {
            Name        = "an ogre";
            Body        = 1;
            BaseSoundID = 427;

            SetStr(148, 194);
            SetDex(48, 60);
            SetInt(49, 65);

            SetHits(200, 234);
            SetMana(0);

            SetDamage(5, 10);

            SetDamageType(ResistanceType.Physical, 100);

            SetResistance(ResistanceType.Physical, 32);
            SetResistance(ResistanceType.Fire, 15);
            SetResistance(ResistanceType.Cold, 15);
            SetResistance(ResistanceType.Poison, 15);
            SetResistance(ResistanceType.Energy, 25);

            SetSkill(SkillName.Macing, 74.1, 81.3);
            SetSkill(SkillName.MagicResist, 56.3, 69.8);
            SetSkill(SkillName.Tactics, 60.5, 69.1);
            SetSkill(SkillName.Wrestling, 74.1, 81.3);

            Fame  = 3000;
            Karma = -3000;

            VirtualArmor = 32;

            PackGold(216, 221);

            if (Utility.RandomDouble() < 0.15)
            {
                BaseWeapon weapon = new Club();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(weapon, 3, 15, 30);
                }

                AddItem(weapon);
            }

            Container pack = new Backpack();

            pack.DropItem(new Arrow(Utility.RandomMinMax(8, 13)));
            pack.DropItem(new Bandage(Utility.RandomMinMax(5, 10)));

            if (Utility.RandomDouble() < 0.15)
            {
                BaseJewel ring = new GoldRing();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(ring, 2, 15, 30);
                }

                pack.DropItem(ring);
            }

            if (0.05 > Utility.RandomDouble())
            {
                pack.DropItem(new Peridot());
            }

            PackItem(pack);
        }
Esempio n. 14
0
        public override void OnDeath(Container c)
        {
            base.OnDeath(c);

            Mobile killer = this.LastKiller;

            if (killer != null)
            {
                if (killer is BaseCreature)
                {
                    killer = ((BaseCreature)killer).GetMaster();
                }

                if (killer is PlayerMobile)
                {
                    if (GetPlayerInfo.LuckyKiller(killer.Luck) && Utility.RandomMinMax(1, 4) == 1)
                    {
                        LootChest MyChest = new LootChest(Server.Misc.IntelligentAction.FameBasedLevel(this));
                        MyChest.Name   = "bone carved chest";
                        MyChest.ItemID = Utility.RandomList(0x2DF1, 0x2DF1);
                        MyChest.Hue    = 0;
                        c.DropItem(MyChest);
                    }
                    if (GetPlayerInfo.LuckyKiller(killer.Luck) && Utility.RandomMinMax(1, 4) == 1)
                    {
                        switch (Utility.RandomMinMax(0, 5))
                        {
                        case 0: MagicBoneLegs leg = new MagicBoneLegs();                BaseRunicTool.ApplyAttributesTo((BaseArmor)leg, false, 1000, 5, 25, 100);     c.DropItem(leg);              break;

                        case 1: MagicBoneGloves glv = new MagicBoneGloves();    BaseRunicTool.ApplyAttributesTo((BaseArmor)glv, false, 1000, 5, 25, 100);     c.DropItem(glv);              break;

                        case 2: MagicBoneArms arm = new MagicBoneArms();                BaseRunicTool.ApplyAttributesTo((BaseArmor)arm, false, 1000, 5, 25, 100);     c.DropItem(arm);              break;

                        case 3: MagicBoneChest tun = new MagicBoneChest();              BaseRunicTool.ApplyAttributesTo((BaseArmor)tun, false, 1000, 5, 25, 100);     c.DropItem(tun);              break;

                        case 4: MagicBoneHelm hlm = new MagicBoneHelm();                BaseRunicTool.ApplyAttributesTo((BaseArmor)hlm, false, 1000, 5, 25, 100);     c.DropItem(hlm);              break;

                        case 5: MagicBoneSkirt skt = new MagicBoneSkirt();              BaseRunicTool.ApplyAttributesTo((BaseArmor)skt, false, 1000, 5, 25, 100);     c.DropItem(skt);              break;
                        }
                    }
                }
            }
        }
Esempio n. 15
0
        private void DoRestock()
        {
            List <Item> list = new List <Item>(Backpack.Items);

            m_ItemTable.Clear();

            InternalGump.Clear();

            foreach (Item item in list)
            {
                item.Delete();
            }

            int count = Utility.RandomMinMax(m_ItemCountMin, m_ItemCountMax);

            for (int i = 0; i < count; i++)
            {
                Item item;

                switch (Utility.Random(3))
                {
                default:
                case 0: item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(false, false, true); break;

                case 1: item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(false, true, false); break;

                case 2: item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(true, false, false); break;
                }

                int weight = 0;

                if (0.10 > Utility.RandomDouble())
                {
                    int budget = Utility.RandomMinMax(500, 860);
                    RunicReforging.GenerateRandomItem(item, null, Utility.RandomMinMax(500, 860), 0, ReforgedPrefix.None, ReforgedSuffix.None);
                    weight += budget / 3;
                }
                else
                {
                    int props = Utility.RandomMinMax(3, 5);

                    if (props == 5 && 0.05 > Utility.RandomDouble())
                    {
                        props++;
                        weight += 100;
                    }

                    if (item is BaseWeapon)
                    {
                        BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, false, 0, props, m_IntensityMin, m_IntensityMax);
                    }
                    else if (item is BaseArmor)
                    {
                        BaseRunicTool.ApplyAttributesTo((BaseArmor)item, false, 0, props, m_IntensityMin, m_IntensityMax);
                    }
                    else if (item is BaseJewel)
                    {
                        BaseRunicTool.ApplyAttributesTo((BaseJewel)item, false, 0, props, m_IntensityMin, m_IntensityMax);
                    }
                    else if (item is BaseHat)
                    {
                        BaseRunicTool.ApplyAttributesTo((BaseHat)item, false, 0, props, m_IntensityMin, m_IntensityMax);
                    }
                }

                m_ItemTable[item] = (int)((weight + Server.SkillHandlers.Imbuing.GetTotalWeight(item, -1, false, true)) * 31.5);
                item.Movable      = false;
                Backpack.DropItem(item);
            }

            m_NextRestock = DateTime.UtcNow + TimeSpan.FromMinutes(Utility.RandomMinMax(m_RestockMin, m_RestockMax));
        }
Esempio n. 16
0
        public RunicReforgingGump(Mobile from, Item toReforge, BaseRunicTool tool)
            : base(100, 100)
        {
            from.CloseGump(typeof(RunicReforgingGump));
            from.CloseGump(typeof(ImbueGump));

            m_Context = ReforgingContext.GetContext(from);

            if (!m_Context.Contexts.ContainsKey(tool))
            {
                m_Context.Contexts[tool] = ReforgingOption.None;
            }

            m_Tool      = tool;
            m_ToReforge = toReforge;
            m_Options   = m_Context.Contexts[tool];

            m_Prefix = m_Context.Prefix;
            m_Suffix = m_Context.Suffix;

            AddBackground(0, 0, 370, 440, 83);
            AddHtmlLocalized(10, 10, 350, 18, 1114513, "#1151952", 0x4BB7, false, false); // Runic Crafting Options

            int buttonHue = 0x4BB2;
            int buttonID  = 0x4005;
            int y         = 40;
            int idx       = 0;

            for (int i = 0; i < Options.Length; i++)
            {
                ReforgingOption option = Options[i];

                if ((m_Options & option) != 0)
                {
                    if (CanReforge(from, option) && HasMetPrerequisite(option))
                    {
                        buttonHue = 0x4BB2;
                        buttonID  = 4006;
                    }
                    else
                    {
                        buttonHue = 0x7652;
                        buttonID  = 4006;
                    }
                }
                else
                {
                    if (CanReforge(from, option) && HasMetPrerequisite(option))
                    {
                        buttonHue = 0x6F7B;
                        buttonID  = 4005;
                    }
                    else
                    {
                        buttonHue = 0x7652;
                        buttonID  = 4006;
                    }
                }

                if (HasMetPrerequisite(option) && CanReforge(from, option))
                {
                    AddButton(15, y, buttonID, buttonID, i + 100, GumpButtonType.Reply, 0);
                }

                AddHtmlLocalized(55, y, 250, 20, GetCliloc(option), buttonHue, false, false);

                y += 25;
                idx++;
            }

            int totalCharges = GetTotalCharges();

            if ((m_Options & ReforgingOption.InspiredArtifice) != 0)
            {
                AddButton(15, 305, 4005, 4007, 1, GumpButtonType.Reply, 0);
                AddHtmlLocalized(55, 305, 250, 20, 1152087, 0x6F7B, false, false);
                AddHtmlLocalized(190, 305, 250, 20, RunicReforging.GetName((int)m_Prefix), 0x5757, false, false);
            }

            if ((m_Options & ReforgingOption.SublimeArtifice) != 0)
            {
                AddButton(15, 330, 4005, 4007, 2, GumpButtonType.Reply, 0);
                AddHtmlLocalized(55, 330, 250, 20, 1152088, 0x6F7B, false, false);
                AddHtmlLocalized(190, 330, 250, 20, RunicReforging.GetName((int)m_Suffix), 0x5757, false, false);
            }

            AddHtmlLocalized(10, 363, 140, 22, 1114514, "#1152078", 0x4BB2, false, false); // CHARGES NEEDED:
            AddLabel(160, 363, 0x113, totalCharges.ToString());

            AddHtmlLocalized(10, 385, 140, 22, 1114514, "#1152077", 0x6F7B, false, false); // TOOL CHARGES:
            AddLabel(160, 385, 0x44E, m_Tool.UsesRemaining.ToString());

            AddButton(10, 412, 4017, 4018, 0, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 410, 200, 20, 1060675, 0x6F7B, false, false); // CLOSE

            AddButton(330, 363, 4014, 4016, 3, GumpButtonType.Reply, 0);
            AddHtmlLocalized(190, 363, 135, 22, 1114514, "#1152080", 0x6F7B, false, false); // REFORGE ITEM

            AddButton(330, 412, 4011, 4013, 4, GumpButtonType.Reply, 0);
            AddHtmlLocalized(185, 412, 140, 18, 1114514, "#1149735", 0x6F7B, false, false); // HELP
        }
Esempio n. 17
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));
                }
            }
        }
Esempio n. 18
0
        private void Fill(int level)
        {
            TrapType  = TrapType.ExplosionTrap;
            TrapPower = level * 25;
            TrapLevel = level;
            Locked    = true;

            switch (level)
            {
            case 1: RequiredSkill = 36; break;

            case 2: RequiredSkill = 76; break;

            case 3: RequiredSkill = 84; break;

            case 4: RequiredSkill = 92; break;

            case 5: RequiredSkill = 100; break;
            }

            LockLevel    = RequiredSkill - 10;
            MaxLockLevel = RequiredSkill + 40;

            DropItem(new Gold(level * 200));

            for (int i = 0; i < level; ++i)
            {
                DropItem(Loot.RandomScroll(0, 63, SpellbookType.Regular));
            }

            for (int i = 0; i < level * 2; ++i)
            {
                Item item;

                if (Core.AOS)
                {
                    item = Loot.RandomArmorOrShieldOrWeaponOrJewelry();
                }
                else
                {
                    item = Loot.RandomArmorOrShieldOrWeapon();
                }

                if (item is BaseWeapon)
                {
                    BaseWeapon weapon = (BaseWeapon)item;

                    if (Core.AOS)
                    {
                        int attributeCount;
                        int min, max;

                        GetRandomAOSStats(out attributeCount, out min, out max);

                        BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);
                    }
                    else
                    {
                        weapon.DamageLevel     = (WeaponDamageLevel)Utility.Random(6);
                        weapon.AccuracyLevel   = (WeaponAccuracyLevel)Utility.Random(6);
                        weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6);
                    }

                    DropItem(item);
                }
                else if (item is BaseArmor)
                {
                    BaseArmor armor = (BaseArmor)item;

                    if (Core.AOS)
                    {
                        int attributeCount;
                        int min, max;

                        GetRandomAOSStats(out attributeCount, out min, out max);

                        BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);
                    }
                    else
                    {
                        armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6);
                        armor.Durability      = (ArmorDurabilityLevel)Utility.Random(6);
                    }

                    DropItem(item);
                }
                else if (item is BaseHat)
                {
                    BaseHat hat = (BaseHat)item;

                    if (Core.AOS)
                    {
                        int attributeCount;
                        int min, max;

                        GetRandomAOSStats(out attributeCount, out min, out max);

                        BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max);
                    }

                    DropItem(item);
                }
                else if (item is BaseJewel)
                {
                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats(out attributeCount, out min, out max);

                    BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max);

                    DropItem(item);
                }
            }

            for (int i = 0; i < level; i++)
            {
                Item item = Loot.RandomPossibleReagent();
                item.Amount = Utility.RandomMinMax(40, 60);
                DropItem(item);
            }

            for (int i = 0; i < level; i++)
            {
                Item item = Loot.RandomGem();
                DropItem(item);
            }

            DropItem(new TreasureMap(level + 1, (Utility.RandomBool() ? Map.Felucca : Map.Trammel)));
        }
Esempio n. 19
0
        public static void GiveRewards(Mobile from, PlayerFishingEntry entry, double points)
        {
            Container pack = from.Backpack;

            if (pack == null)
            {
                pack = from.BankBox;
            }

            int tier     = 1;
            int category = 1;

            double roll = Utility.RandomDouble();

            if (points >= 100)
            {
                tier = 2;
            }
            else if (points >= 150)
            {
                tier = 3;
            }
            else if (points >= 210)
            {
                tier = 4;
            }

            if (roll < .10)
            {
                category = 4;
            }
            else if (roll < .25)
            {
                category = 3;
            }
            else if (roll < .50)
            {
                category = 2;
            }

            Type type = m_RewardTable[tier - 1][category - 1][Utility.Random(m_RewardTable[tier - 1][category - 1].Length)];

            Item item = Loot.Construct(type);

            if (item != null)
            {
                if (item is PowerScroll)
                {
                    int    value;
                    double chance = Utility.RandomDouble();

                    switch (tier)
                    {
                    default:
                    case 1:
                        if (0.01 > chance)
                        {
                            value = 120;
                        }
                        else if (0.05 > chance)
                        {
                            value = 115;
                        }
                        else if (chance > 0.25)
                        {
                            value = 110;
                        }
                        else
                        {
                            value = 105;
                        }
                        break;

                    case 2:
                        if (0.05 > chance)
                        {
                            value = 120;
                        }
                        else if (0.25 > chance)
                        {
                            value = 115;
                        }
                        else
                        {
                            value = 110;
                        }
                        break;

                    case 3:
                        if (0.10 > chance)
                        {
                            value = 120;
                        }
                        else
                        {
                            value = 115;
                        }
                        break;

                    case 4:
                        value = 120;
                        break;
                    }

                    ((PowerScroll)item).Skill = SkillName.Fishing;
                    ((PowerScroll)item).Value = value;
                    from.SendLocalizedMessage(1149591); //
                }
                else if (item is BaseBook)
                {
                    from.SendLocalizedMessage(1149590); //You receive a rare book.
                }
                else if (item is Bait)
                {
                    Bait bait = (Bait)item;

                    switch (tier)
                    {
                    case 1:
                        bait.Index = Utility.Random(15);
                        if (0.001 >= Utility.RandomDouble())
                        {
                            bait.Enhanced = true;
                        }
                        break;

                    case 2:
                        bait.Index = Utility.Random(34);
                        if (0.005 >= Utility.RandomDouble())
                        {
                            bait.Enhanced = true;
                        }
                        break;

                    case 3:
                        bait.Index = Utility.Random(34);
                        if (0.01 >= Utility.RandomDouble())
                        {
                            bait.Enhanced = true;
                        }
                        break;

                    case 4:
                        if (Utility.RandomBool())
                        {
                            bait.Index = 35;
                        }
                        else
                        {
                            bait.Index = Utility.RandomMinMax(16, 34);
                        }
                        if (0.05 >= Utility.RandomDouble())
                        {
                            bait.Enhanced = true;
                        }
                        break;
                    }

                    if (FishInfo.GetTypeFromIndex(bait.Index) == typeof(Charydbis))
                    {
                        bait.UsesRemaining = 5;
                        from.SendLocalizedMessage(1150871); //You receive charybdis bait

                        if (0.08 >= Utility.RandomDouble())
                        {
                            bait.Enhanced = true;
                        }
                    }
                    else
                    {
                        object label = FishInfo.GetFishLabel(bait.Index);

                        if (label is int)
                        {
                            from.SendLocalizedMessage(1149588, string.Format("#{0}\t", (int)label)); //You receive bait to catch ~1_val~
                        }
                        else
                        {
                            from.SendLocalizedMessage(1149588, (string)label);      //You receive bait to catch ~1_val~
                        }
                        bait.UsesRemaining = (int)Math.Min(200, points / 2);
                    }
                }
                else if (item is PermanentBoatPaint)
                {
                    from.SendMessage("You recieve permanent boat paint!");
                }
                else
                {
                    if (item is FishingPole)
                    {
                        BaseRunicTool.ApplyAttributesTo((FishingPole)item, false, 0, Utility.RandomMinMax(1, tier + 1), 25, 100);
                    }

                    from.SendLocalizedMessage(1149589); //You receive some rare fishing equipment.
                }

                pack.DropItem(item);

                if (entry != null)
                {
                    entry.OnAfterReward(points);
                }
            }
        }
Esempio n. 20
0
        public DragonSanctuarySamuraiMoonElf() : base(AIType.AI_Melee, FightMode.Closest, 15, 1, 0.1, 0.2)
        {
            SetStr(755, 788);
            SetDex(300, 500);
            SetInt(100, 200);

            SetHits(500, 600);

            SetDamage(12, 15);

            SetSkill(SkillName.Anatomy, 100.0);
            SetSkill(SkillName.MagicResist, 70.0);
            SetSkill(SkillName.Swords, 100.0);
            SetSkill(SkillName.Tactics, 100.0);

            Karma = 10000;

            m_Timer = new MoveTimer(this);
            ChangeLocation();

            PackItem(new Bandage(Utility.RandomMinMax(15, 20)));

            if (this.Female = Utility.RandomBool())
            {
                Name       = NameList.RandomName("elven female");
                Title      = "Svartalfar Samurai of Dragon Sanctuary";
                Body       = 606;
                Hue        = Utility.RandomList(897, 898, 899, 900, 901, 905, 990, 995, 996, 997, 998, 999, 2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411);
                HairHue    = 2405;
                HairItemID = Utility.RandomList(12224, 12225, 12236, 12237, 12238, 12239);

                EbonyMoonblade weapon = new EbonyMoonblade();
                BaseRunicTool.ApplyAttributesTo(weapon, 5, 25, 35);
                weapon.Slayer = SlayerName.ReptilianDeath;
                weapon.WeaponAttributes.HitLightning = 25;
                weapon.Hue     = 0x4D5;
                weapon.Movable = true;
                AddItem(weapon);

                AmazonianFighterHelmet helmet = new AmazonianFighterHelmet();
                helmet.Movable = true;
                AddItem(helmet);

                AmazonianFighterBustier chest = new AmazonianFighterBustier();
                chest.Movable = true;
                AddItem(chest);

                AmazonianFighterGloves gloves = new AmazonianFighterGloves();
                gloves.Movable = true;
                AddItem(gloves);

                AddItem(new AmazonianFighterBelt());
                AddItem(new AmazonianFighterBoots());

                new Ridgeback().Rider = this;
            }
            else
            {
                Name       = NameList.RandomName("elven male");
                Title      = "Svartalfar Samurai of Dragon Sanctuary";
                Body       = 605;
                Hue        = Utility.RandomList(897, 898, 899, 900, 901, 905, 990, 995, 996, 997, 998, 999, 2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411);
                HairHue    = 2405;
                HairItemID = Utility.RandomList(12224, 12225, 12236, 12237, 12238, 12239);

                EbonyGlassBardiche weapon = new EbonyGlassBardiche();
                BaseRunicTool.ApplyAttributesTo(weapon, 5, 25, 35);
                weapon.Slayer = SlayerName.ReptilianDeath;
                weapon.WeaponAttributes.HitLightning = 25;
                weapon.Hue     = 0x4D5;
                weapon.Movable = true;
                AddItem(weapon);

                DecorativePlateKabuto helm = new DecorativePlateKabuto();
                BaseRunicTool.ApplyAttributesTo(helm, 5, 25, 35);
                helm.Hue     = 0x4D5;
                helm.Movable = true;
                AddItem(helm);

                PlateMempo gorget = new PlateMempo();
                BaseRunicTool.ApplyAttributesTo(gorget, 5, 25, 35);
                gorget.Hue     = 0x4D5;
                gorget.Movable = true;
                AddItem(gorget);

                PlateHiroSode arms = new PlateHiroSode();
                BaseRunicTool.ApplyAttributesTo(arms, 5, 25, 35);
                arms.Hue     = 0x4D5;
                arms.Movable = true;
                AddItem(arms);

                PlateDo chest = new PlateDo();
                BaseRunicTool.ApplyAttributesTo(chest, 5, 25, 35);
                chest.Hue     = 0x4D5;
                chest.Movable = true;
                AddItem(chest);

                PlateHaidate legs = new PlateHaidate();
                BaseRunicTool.ApplyAttributesTo(legs, 5, 25, 35);
                legs.Hue     = 0x4D5;
                legs.Movable = true;
                AddItem(legs);

                FurBoots boots = new FurBoots();
                BaseRunicTool.ApplyAttributesTo(boots, 5, 25, 35);
                boots.Hue     = 0x4D5;
                boots.Movable = true;
                AddItem(boots);

                new SavageRidgeback().Rider = this;
            }
        }
Esempio n. 21
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            PlayerMobile player = from as PlayerMobile;

            if (player != null)
            {
                QuestSystem qs = player.Quest;

                if (qs is UzeraanTurmoilQuest)
                {
                    if (dropped is UzeraanTurmoilHorn)
                    {
                        if (player.Young)
                        {
                            UzeraanTurmoilHorn horn = (UzeraanTurmoilHorn)dropped;

                            if (horn.Charges < 10)
                            {
                                this.SayTo(from, 1049384); // I have recharged the item for you.
                                horn.Charges = 10;
                            }
                            else
                            {
                                this.SayTo(from, 1049385); // That doesn't need recharging yet.
                            }
                        }
                        else
                        {
                            player.SendLocalizedMessage(1114333); //You must be young to have this item recharged.
                        }

                        return(false);
                    }

                    if (dropped is SchmendrickScrollOfPower)
                    {
                        QuestObjective obj = qs.FindObjective(typeof(ReturnScrollOfPowerObjective));

                        if (obj != null && !obj.Completed)
                        {
                            Container cont = GetNewContainer();

                            cont.DropItem(new TreasureMap(player.Young ? 0 : 1, Map.Trammel));
                            cont.DropItem(new Shovel());
                            cont.DropItem(new UzeraanTurmoilHorn());

                            if (!player.PlaceInBackpack(cont))
                            {
                                cont.Delete();
                                player.SendLocalizedMessage(1046260); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                                return(false);
                            }
                            else
                            {
                                dropped.Delete();
                                obj.Complete();
                                return(true);
                            }
                        }
                    }
                    else if (dropped is QuestFertileDirt)
                    {
                        QuestObjective obj = qs.FindObjective(typeof(ReturnFertileDirtObjective));

                        if (obj != null && !obj.Completed)
                        {
                            Container cont = GetNewContainer();

                            if (player.Profession == 2) // magician
                            {
                                cont.DropItem(new BlackPearl(20));
                                cont.DropItem(new Bloodmoss(20));
                                cont.DropItem(new Garlic(20));
                                cont.DropItem(new Ginseng(20));
                                cont.DropItem(new MandrakeRoot(20));
                                cont.DropItem(new Nightshade(20));
                                cont.DropItem(new SulfurousAsh(20));
                                cont.DropItem(new SpidersSilk(20));

                                for (int i = 0; i < 3; i++)
                                {
                                    cont.DropItem(Loot.RandomScroll(0, 23, SpellbookType.Regular));
                                }
                            }
                            else
                            {
                                cont.DropItem(new Gold(300));
                                cont.DropItem(new Bandage(25));

                                for (int i = 0; i < 5; i++)
                                {
                                    cont.DropItem(new LesserHealPotion());
                                }
                            }

                            if (!player.PlaceInBackpack(cont))
                            {
                                cont.Delete();
                                player.SendLocalizedMessage(1046260); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                                return(false);
                            }
                            else
                            {
                                dropped.Delete();
                                obj.Complete();
                                return(true);
                            }
                        }
                    }
                    else if (dropped is QuestDaemonBlood)
                    {
                        QuestObjective obj = qs.FindObjective(typeof(ReturnDaemonBloodObjective));

                        if (obj != null && !obj.Completed)
                        {
                            Item reward;

                            if (player.Profession == 2) // magician
                            {
                                Container cont = GetNewContainer();

                                cont.DropItem(new ExplosionScroll(4));
                                cont.DropItem(new MagicWizardsHat());

                                reward = cont;
                            }
                            else
                            {
                                BaseWeapon weapon;
                                switch (Utility.Random(6))
                                {
                                case 0:
                                    weapon = new Broadsword();
                                    break;

                                case 1:
                                    weapon = new Cutlass();
                                    break;

                                case 2:
                                    weapon = new Katana();
                                    break;

                                case 3:
                                    weapon = new Longsword();
                                    break;

                                case 4:
                                    weapon = new Scimitar();
                                    break;

                                default:
                                    weapon = new VikingSword();
                                    break;
                                }

                                if (Core.AOS)
                                {
                                    BaseRunicTool.ApplyAttributesTo(weapon, 3, 20, 40);
                                }
                                else
                                {
                                    weapon.DamageLevel     = (WeaponDamageLevel)BaseCreature.RandomMinMaxScaled(2, 4);
                                    weapon.AccuracyLevel   = (WeaponAccuracyLevel)BaseCreature.RandomMinMaxScaled(2, 4);
                                    weapon.DurabilityLevel = (WeaponDurabilityLevel)BaseCreature.RandomMinMaxScaled(2, 4);
                                }

                                weapon.Slayer = SlayerName.Silver;

                                reward = weapon;
                            }

                            if (!player.PlaceInBackpack(reward))
                            {
                                reward.Delete();
                                player.SendLocalizedMessage(1046260); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                                return(false);
                            }
                            else
                            {
                                dropped.Delete();
                                obj.Complete();
                                return(true);
                            }
                        }
                    }
                    else if (dropped is QuestDaemonBone)
                    {
                        QuestObjective obj = qs.FindObjective(typeof(ReturnDaemonBoneObjective));

                        if (obj != null && !obj.Completed)
                        {
                            Container cont = GetNewContainer();
                            cont.DropItem(new BankCheck(2000));
                            cont.DropItem(new EnchantedSextant());

                            if (!player.PlaceInBackpack(cont))
                            {
                                cont.Delete();
                                player.SendLocalizedMessage(1046260); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                                return(false);
                            }
                            else
                            {
                                dropped.Delete();
                                obj.Complete();
                                return(true);
                            }
                        }
                    }
                }
            }

            return(base.OnDragDrop(from, dropped));
        }
Esempio n. 22
0
        public RangerGuardOfSkaddria2() : base(AIType.AI_Archer, FightMode.Closest, 15, 1, 0.1, 0.2)
        {
            Title = "Ranger Guard of Skaddria Naddheim";

            SetStr(850, 900);
            SetDex(500, 700);
            SetInt(100, 200);

            SetHits(1500, 2000);

            SetDamage(19, 35);

            SetSkill(SkillName.Anatomy, 100.0, 100.0);
            SetSkill(SkillName.Archery, 100.0, 100.0);
            SetSkill(SkillName.Tactics, 100.0, 100.0);
            SetSkill(SkillName.MagicResist, 100.0, 100.0);

            Karma = 10000;

            AddItem(new HighBoots(23));
            AddItem(new PlumeCloak(313));

            StuddedGorget gorget = new StuddedGorget();

            gorget.Hue     = 23;
            gorget.Movable = true;
            AddItem(gorget);

            StuddedArms arms = new StuddedArms();

            arms.Hue     = 23;
            arms.Movable = true;
            AddItem(arms);

            StuddedGloves gloves = new StuddedGloves();

            gloves.Hue     = 313;
            gloves.Movable = true;
            AddItem(gloves);

            if (Female = Utility.RandomBool())
            {
                Body = 401;
                Name = NameList.RandomName("female");

                FemaleStuddedChest chest = new FemaleStuddedChest();
                chest.Hue     = 313;
                chest.Movable = true;
                AddItem(chest);

                SteelJaw weapon = new SteelJaw();
                BaseRunicTool.ApplyAttributesTo(weapon, 5, 25, 35);
                weapon.WeaponAttributes.HitLightning = 25;
                weapon.Hue     = 23;
                weapon.Movable = true;
                weapon.Quality = WeaponQuality.Exceptional;
                AddItem(weapon);

                PackItem(new Bolt(Utility.RandomMinMax(50, 80)));
            }
            else
            {
                Body = 400;
                Name = NameList.RandomName("male");

                StuddedChest chest = new StuddedChest();
                chest.Hue     = 313;
                chest.Movable = true;
                AddItem(chest);

                StuddedLegs legs = new StuddedLegs();
                legs.Hue     = 313;
                legs.Movable = true;
                AddItem(legs);

                SteelJaw weapon = new SteelJaw();
                BaseRunicTool.ApplyAttributesTo(weapon, 5, 25, 35);
                weapon.WeaponAttributes.HitLightning = 25;
                weapon.Hue     = 23;
                weapon.Movable = true;
                weapon.Quality = WeaponQuality.Exceptional;
                AddItem(weapon);

                PackItem(new Bolt(Utility.RandomMinMax(50, 80)));
            }

            Utility.AssignRandomHair(this);
        }
Esempio n. 23
0
        public DragonianOverlord() : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
        {
            Name        = NameList.RandomName("dragon");
            Title       = "the dragonian overlord";
            Body        = 399;
            BaseSoundID = 362;

            SetStr(1103, 1131);
            SetDex(99, 120);
            SetInt(734, 752);

            SetHits(956, 990);
            SetMana(3670, 3760);

            SetDamage(15, 25);

            SetDamageType(ResistanceType.Physical, 75);
            SetDamageType(ResistanceType.Fire, 25);

            SetResistance(ResistanceType.Physical, 70);
            SetResistance(ResistanceType.Fire, 80);
            SetResistance(ResistanceType.Cold, 10);
            SetResistance(ResistanceType.Poison, 60);
            SetResistance(ResistanceType.Energy, 60);

            SetSkill(SkillName.EvalInt, 72.8, 78.2);
            SetSkill(SkillName.Magery, 85.8, 99.3);
            SetSkill(SkillName.Meditation, 61.7, 64.4);
            SetSkill(SkillName.MagicResist, 120.1, 133.0);
            SetSkill(SkillName.Tactics, 99.6, 100.0);
            SetSkill(SkillName.Wrestling, 98.6, 99.0);

            Fame  = 222500;
            Karma = -222500;

////////////////////////////////Main Pack////////////////////////////////

            PackGold(350, 500);
            PackReg(45, 55);
            PackItem(new MeteorSwarmScroll());

////////////////////////////////1st Backpack////////////////////////////////

            Container pack1 = new Backpack();

            pack1.DropItem(new Cloak(762));
            pack1.DropItem(new RoyalCirclet());

            if (Utility.RandomDouble() < 0.25)
            {
                BaseArmor armor1 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor1, 5, 15, 30);

                pack1.DropItem(armor1);
            }

            if (Utility.RandomDouble() < 0.25)
            {
                BaseArmor armor2 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor2, 5, 15, 30);

                pack1.DropItem(armor2);
            }

            if (Utility.RandomDouble() < 0.25)
            {
                BaseArmor armor3 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor3, 5, 15, 30);

                pack1.DropItem(armor3);
            }

            if (Utility.RandomDouble() < 0.25)
            {
                BaseArmor armor4 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor4, 5, 15, 30);

                pack1.DropItem(armor4);
            }

            if (Utility.RandomDouble() < 0.20)
            {
                BaseArmor armor5 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor5, 5, 15, 30);

                pack1.DropItem(armor5);
            }

            if (Utility.RandomDouble() < 0.50)
            {
                BaseWeapon weapon = Loot.RandomWeapon(true);
                BaseRunicTool.ApplyAttributesTo(weapon, 5, 25, 30);

                pack1.DropItem(weapon);
            }

            Container bag1 = new Bag();

            bag1.DropItem(new Gold(Utility.RandomMinMax(50, 100)));
            bag1.DropItem(new Bandage(Utility.RandomMinMax(9, 18)));
            bag1.DropItem(Loot.RandomGem());
            bag1.DropItem(Loot.RandomGem());
            pack1.DropItem(bag1);

            PackItem(pack1);

////////////////////////////////2nd Backpack////////////////////////////////

            Container pack2 = new Backpack();

            if (Utility.RandomDouble() < 0.25)
            {
                BaseWeapon weapon = Loot.RandomWeapon(true);
                BaseRunicTool.ApplyAttributesTo(weapon, 5, 15, 30);

                pack2.DropItem(weapon);
            }

            if (Utility.RandomDouble() < 0.25)
            {
                BaseArmor armor1 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor1, 5, 15, 30);

                pack2.DropItem(armor1);
            }

            if (Utility.RandomDouble() < 0.25)
            {
                BaseArmor armor2 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor2, 5, 15, 30);

                pack2.DropItem(armor2);
            }

            if (Utility.RandomDouble() < 0.15)
            {
                BaseJewel earrings = new GoldEarrings();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(earrings, 5, 15, 30);
                }

                pack2.DropItem(earrings);
            }

            Container bag2 = new Bag();

            bag2.DropItem(new Gold(Utility.RandomMinMax(250, 300)));
            bag2.DropItem(new DragonScale(Utility.RandomMinMax(25, 35)));
            bag2.DropItem(Loot.RandomPotion());
            bag2.DropItem(new GreaterCurePotion());
            bag2.DropItem(new GreaterStrengthPotion());
            bag2.DropItem(new GreaterHealPotion());
            bag2.DropItem(Loot.RandomGem());
            bag2.DropItem(Loot.RandomGem());
            bag2.DropItem(Loot.RandomGem());
            pack2.DropItem(bag2);

            PackItem(pack2);

////////////////////////////////3rd Backpack////////////////////////////////

            Container pack3 = new Backpack();

            pack3.DropItem(new Spellbook());
            pack3.DropItem(Loot.RandomWand());
            pack3.DropItem(Loot.RandomWand());
            pack3.DropItem(Loot.RandomClothing());
            pack3.DropItem(Loot.RandomClothing());

            if (Utility.RandomDouble() < 0.25)
            {
                BaseClothing clothing = Loot.RandomClothing(true);
                BaseRunicTool.ApplyAttributesTo(clothing, 3, 15, 30);

                pack3.DropItem(clothing);
            }

            if (Utility.RandomDouble() < 0.15)
            {
                BaseJewel necklace = new GoldNecklace();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(necklace, 3, 15, 30);
                }

                pack3.DropItem(necklace);
            }

            Container bag3 = new Bag();

            bag3.DropItem(new Gold(Utility.RandomMinMax(25, 50)));
            bag3.DropItem(new Bandage(Utility.RandomMinMax(9, 18)));
            bag3.DropItem(Loot.RandomGem());
            bag3.DropItem(Loot.RandomGem());

            Item ScrollLoot1 = Loot.RandomScroll(0, 50, SpellbookType.Regular);

            ScrollLoot1.Amount = Utility.Random(5, 10);
            bag3.DropItem(ScrollLoot1);

            Item ScrollLoot2 = Loot.RandomScroll(0, 50, SpellbookType.Regular);

            ScrollLoot2.Amount = Utility.Random(5, 10);
            bag3.DropItem(ScrollLoot2);

            Item ScrollLoot3 = Loot.RandomScroll(0, 50, SpellbookType.Regular);

            ScrollLoot3.Amount = Utility.Random(5, 10);
            bag3.DropItem(ScrollLoot3);

            pack3.DropItem(bag3);

            PackItem(pack3);
        }
Esempio n. 24
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);
        }
Esempio n. 25
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            QuestSystem qs = player.Quest;

            if (qs is HaochisTrialsQuest)
            {
                if (HaochisTrialsQuest.HasLostHaochisKatana(player))
                {
                    qs.AddConversation(new LostSwordConversation());
                    return;
                }

                QuestObjective obj = qs.FindObjective <FindHaochiObjective>();

                if (obj?.Completed == false)
                {
                    obj.Complete();
                    return;
                }

                obj = qs.FindObjective <FirstTrialReturnObjective>();

                if (obj?.Completed == false)
                {
                    player.AddToBackpack(new LeatherDo());
                    obj.Complete();
                    return;
                }

                obj = qs.FindObjective <SecondTrialReturnObjective>();

                if (obj?.Completed == false)
                {
                    if (((SecondTrialReturnObjective)obj).Dragon)
                    {
                        player.AddToBackpack(new LeatherSuneate());
                    }

                    obj.Complete();
                    return;
                }

                obj = qs.FindObjective <ThirdTrialReturnObjective>();

                if (obj?.Completed == false)
                {
                    player.AddToBackpack(new LeatherHiroSode());
                    obj.Complete();
                    return;
                }

                obj = qs.FindObjective <FourthTrialReturnObjective>();

                if (obj?.Completed == false)
                {
                    if (!((FourthTrialReturnObjective)obj).KilledCat)
                    {
                        Container cont = GetNewContainer();
                        cont.DropItem(new LeatherHiroSode());
                        cont.DropItem(new JinBaori());
                        player.AddToBackpack(cont);
                    }

                    obj.Complete();
                    return;
                }

                obj = qs.FindObjective <FifthTrialReturnObjective>();

                if (obj?.Completed == false)
                {
                    HaochisKatana katana = player.Backpack?.FindItemByType <HaochisKatana>();
                    if (katana == null)
                    {
                        return;
                    }

                    katana.Delete();
                    obj.Complete();

                    obj = qs.FindObjective <FifthTrialIntroObjective>();
                    if (((FifthTrialIntroObjective)obj)?.StolenTreasure == true)
                    {
                        qs.AddConversation(new SixthTrialIntroConversation(true));
                    }
                    else
                    {
                        qs.AddConversation(new SixthTrialIntroConversation(false));
                    }
                }

                obj = qs.FindObjective <SixthTrialReturnObjective>();

                if (obj?.Completed == false)
                {
                    obj.Complete();
                    return;
                }

                obj = qs.FindObjective <SeventhTrialReturnObjective>();

                if (obj?.Completed == false)
                {
                    BaseWeapon weapon = new Daisho();
                    BaseRunicTool.ApplyAttributesTo(weapon, Utility.Random(1, 3), 10, 30);
                    player.AddToBackpack(weapon);

                    BaseArmor armor = new LeatherDo();
                    BaseRunicTool.ApplyAttributesTo(armor, Utility.Random(1, 3), 10, 20);
                    player.AddToBackpack(armor);

                    obj.Complete();
                }
            }
        }
Esempio n. 26
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            this.Direction = this.GetDirectionTo(player);

            QuestSystem qs = player.Quest;

            if (qs is WitchApprenticeQuest)
            {
                if (qs.IsObjectiveInProgress(typeof(FindApprenticeObjective)))
                {
                    this.PlaySound(0x259);
                    this.PlaySound(0x206);
                    qs.AddConversation(new HagDuringCorpseSearchConversation());
                }
                else
                {
                    QuestObjective obj = qs.FindObjective(typeof(FindGrizeldaAboutMurderObjective));

                    if (obj != null && !obj.Completed)
                    {
                        this.PlaySound(0x420);
                        this.PlaySound(0x20);
                        obj.Complete();
                    }
                    else if (qs.IsObjectiveInProgress(typeof(KillImpsObjective)) ||
                             qs.IsObjectiveInProgress(typeof(FindZeefzorpulObjective)))
                    {
                        this.PlaySound(0x259);
                        this.PlaySound(0x206);
                        qs.AddConversation(new HagDuringImpSearchConversation());
                    }
                    else
                    {
                        obj = qs.FindObjective(typeof(ReturnRecipeObjective));

                        if (obj != null && !obj.Completed)
                        {
                            this.PlaySound(0x258);
                            this.PlaySound(0x41B);
                            obj.Complete();
                        }
                        else if (qs.IsObjectiveInProgress(typeof(FindIngredientObjective)))
                        {
                            this.PlaySound(0x259);
                            this.PlaySound(0x206);
                            qs.AddConversation(new HagDuringIngredientsConversation());
                        }
                        else
                        {
                            obj = qs.FindObjective(typeof(ReturnIngredientsObjective));

                            if (obj != null && !obj.Completed)
                            {
                                Container cont = GetNewContainer();

                                cont.DropItem(new BlackPearl(30));
                                cont.DropItem(new Bloodmoss(30));
                                cont.DropItem(new Garlic(30));
                                cont.DropItem(new Ginseng(30));
                                cont.DropItem(new MandrakeRoot(30));
                                cont.DropItem(new Nightshade(30));
                                cont.DropItem(new SulfurousAsh(30));
                                cont.DropItem(new SpidersSilk(30));

                                cont.DropItem(new Cauldron());
                                cont.DropItem(new MoonfireBrew());
                                cont.DropItem(new TreasureMap(Utility.RandomMinMax(1, 4), this.Map));
                                cont.DropItem(new Gold(2000, 2200));

                                if (Utility.RandomBool())
                                {
                                    BaseWeapon weapon = Loot.RandomWeapon();

                                    if (Core.AOS)
                                    {
                                        BaseRunicTool.ApplyAttributesTo(weapon, 2, 20, 30);
                                    }
                                    else
                                    {
                                        weapon.DamageLevel     = (WeaponDamageLevel)BaseCreature.RandomMinMaxScaled(2, 3);
                                        weapon.AccuracyLevel   = (WeaponAccuracyLevel)BaseCreature.RandomMinMaxScaled(2, 3);
                                        weapon.DurabilityLevel = (WeaponDurabilityLevel)BaseCreature.RandomMinMaxScaled(2, 3);
                                    }

                                    cont.DropItem(weapon);
                                }
                                else
                                {
                                    Item item;

                                    if (Core.AOS)
                                    {
                                        item = Loot.RandomArmorOrShieldOrJewelry();

                                        if (item is BaseArmor)
                                        {
                                            BaseRunicTool.ApplyAttributesTo((BaseArmor)item, 2, 20, 30);
                                        }
                                        else if (item is BaseJewel)
                                        {
                                            BaseRunicTool.ApplyAttributesTo((BaseJewel)item, 2, 20, 30);
                                        }
                                    }
                                    else
                                    {
                                        BaseArmor armor = Loot.RandomArmorOrShield();
                                        item = armor;

                                        armor.ProtectionLevel = (ArmorProtectionLevel)BaseCreature.RandomMinMaxScaled(2, 3);
                                        armor.Durability      = (ArmorDurabilityLevel)BaseCreature.RandomMinMaxScaled(2, 3);
                                    }

                                    cont.DropItem(item);
                                }

                                if (player.BAC > 0)
                                {
                                    cont.DropItem(new HangoverCure());
                                }

                                if (player.PlaceInBackpack(cont))
                                {
                                    bool gainedPath = false;

                                    if (VirtueHelper.Award(player, VirtueName.Sacrifice, 250, ref gainedPath)) // TODO: Check amount on OSI.
                                    {
                                        player.SendLocalizedMessage(1054160);                                  // You have gained in sacrifice.
                                    }
                                    this.PlaySound(0x253);
                                    this.PlaySound(0x20);
                                    obj.Complete();
                                }
                                else
                                {
                                    cont.Delete();
                                    player.SendLocalizedMessage(1046260); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                QuestSystem newQuest        = new WitchApprenticeQuest(player);
                bool        inRestartPeriod = false;

                if (qs != null)
                {
                    newQuest.AddConversation(new DontOfferConversation());
                }
                else if (QuestSystem.CanOfferQuest(player, typeof(WitchApprenticeQuest), out inRestartPeriod))
                {
                    this.PlaySound(0x20);
                    this.PlaySound(0x206);
                    newQuest.SendOffer();
                }
                else if (inRestartPeriod)
                {
                    this.PlaySound(0x259);
                    this.PlaySound(0x206);
                    newQuest.AddConversation(new RecentlyFinishedConversation());
                }
            }
        }
Esempio n. 27
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);
        }
Esempio n. 28
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            QuestSystem qs = player.Quest;

            if (qs is EminosUndertakingQuest)
            {
                if (EminosUndertakingQuest.HasLostNoteForZoel(player))
                {
                    Item note = new NoteForZoel();

                    if (player.PlaceInBackpack(note))
                    {
                        qs.AddConversation(new LostNoteConversation());
                    }
                    else
                    {
                        note.Delete();
                        player.SendLocalizedMessage(1046260);                           // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                    }
                }
                else if (EminosUndertakingQuest.HasLostEminosKatana(player))
                {
                    qs.AddConversation(new LostSwordConversation());
                }
                else
                {
                    QuestObjective obj = qs.FindObjective(typeof(FindEminoBeginObjective));

                    if (obj != null && !obj.Completed)
                    {
                        obj.Complete();
                    }
                    else
                    {
                        obj = qs.FindObjective(typeof(UseTeleporterObjective));

                        if (obj != null && !obj.Completed)
                        {
                            Item note = new NoteForZoel();

                            if (player.PlaceInBackpack(note))
                            {
                                obj.Complete();

                                player.AddToBackpack(new LeatherNinjaPants());
                                player.AddToBackpack(new LeatherNinjaMitts());
                            }
                            else
                            {
                                note.Delete();
                                player.SendLocalizedMessage(1046260);                                   // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                            }
                        }
                        else
                        {
                            obj = qs.FindObjective(typeof(ReturnFromInnObjective));

                            if (obj != null && !obj.Completed)
                            {
                                Container cont = GetNewContainer();

                                for (int i = 0; i < 10; i++)
                                {
                                    cont.DropItem(new LesserHealPotion());
                                }

                                cont.DropItem(new LeatherNinjaHood());
                                cont.DropItem(new LeatherNinjaJacket());

                                if (player.PlaceInBackpack(cont))
                                {
                                    obj.Complete();
                                }
                                else
                                {
                                    cont.Delete();
                                    player.SendLocalizedMessage(1046260);                                       // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                                }
                            }
                            else
                            {
                                if (qs.IsObjectiveInProgress(typeof(SlayHenchmenObjective)))
                                {
                                    qs.AddConversation(new ContinueSlayHenchmenConversation());
                                }
                                else
                                {
                                    obj = qs.FindObjective(typeof(GiveEminoSwordObjective));

                                    if (obj != null && !obj.Completed)
                                    {
                                        Item katana = null;

                                        if (player.Backpack != null)
                                        {
                                            katana = player.Backpack.FindItemByType(typeof(EminosKatana));
                                        }

                                        if (katana != null)
                                        {
                                            bool stolenTreasure = false;

                                            HallwayWalkObjective walk = qs.FindObjective(typeof(HallwayWalkObjective)) as HallwayWalkObjective;
                                            if (walk != null)
                                            {
                                                stolenTreasure = walk.StolenTreasure;
                                            }

                                            Kama kama = new Kama();

                                            if (stolenTreasure)
                                            {
                                                BaseRunicTool.ApplyAttributesTo(kama, 1, 10, 20);
                                            }
                                            else
                                            {
                                                BaseRunicTool.ApplyAttributesTo(kama, 1, 10, 30);
                                            }

                                            if (player.PlaceInBackpack(kama))
                                            {
                                                katana.Delete();
                                                obj.Complete();

                                                if (stolenTreasure)
                                                {
                                                    qs.AddConversation(new EarnLessGiftsConversation());
                                                }
                                                else
                                                {
                                                    qs.AddConversation(new EarnGiftsConversation());
                                                }
                                            }
                                            else
                                            {
                                                kama.Delete();
                                                player.SendLocalizedMessage(1046260);                                                   // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Esempio n. 29
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            QuestSystem qs = player.Quest;

            if (qs is TerribleHatchlingsQuest)
            {
                if (qs.IsObjectiveInProgress(typeof(FirstKillObjective)))
                {
                    qs.AddConversation(new DirectionConversation());
                }
                else if (qs.IsObjectiveInProgress(typeof(SecondKillObjective)) ||
                         qs.IsObjectiveInProgress(typeof(ThirdKillObjective)))
                {
                    qs.AddConversation(new TakeCareConversation());
                }
                else
                {
                    QuestObjective obj = qs.FindObjective(typeof(ReturnObjective));

                    if (obj != null && !obj.Completed)
                    {
                        Container cont = GetNewContainer();

                        cont.DropItem(new Gold(Utility.RandomMinMax(100, 200)));

                        if (Utility.RandomBool())
                        {
                            BaseWeapon weapon = Loot.Construct(Loot.SEWeaponTypes) as BaseWeapon;

                            if (weapon != null)
                            {
                                BaseRunicTool.ApplyAttributesTo(weapon, 3, 10, 30);
                                cont.DropItem(weapon);
                            }
                        }
                        else
                        {
                            BaseArmor armor = Loot.Construct(Loot.SEArmorTypes) as BaseArmor;

                            if (armor != null)
                            {
                                BaseRunicTool.ApplyAttributesTo(armor, 1, 10, 20);
                                cont.DropItem(armor);
                            }
                        }

                        if (player.PlaceInBackpack(cont))
                        {
                            obj.Complete();
                        }
                        else
                        {
                            cont.Delete();
                            player.SendLocalizedMessage(1046260);                               // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                        }
                    }
                }
            }
            else
            {
                TerribleHatchlingsQuest newQuest = new TerribleHatchlingsQuest(player);
                bool inRestartPeriod             = false;

                if (qs != null)
                {
                    if (contextMenu)
                    {
                        SayTo(player, 1063322);                           // Before you can help me with the Terrible Hatchlings, you'll need to finish the quest you've already taken!
                    }
                }
                else if (QuestSystem.CanOfferQuest(player, typeof(TerribleHatchlingsQuest), out inRestartPeriod))
                {
                    newQuest.SendOffer();
                }
                else if (inRestartPeriod && contextMenu)
                {
                    SayTo(player, 1049357);                       // I have nothing more for you at this time.
                }
            }
        }
Esempio n. 30
0
        public override void OnDeath(Container c)
        {
            base.OnDeath(c);

            Mobile killer = this.LastKiller;

            if (killer != null)
            {
                if (killer is BaseCreature)
                {
                    killer = ((BaseCreature)killer).GetMaster();
                }

                if (killer is PlayerMobile)
                {
                    if (GetPlayerInfo.LuckyKiller(killer.Luck) && Utility.RandomMinMax(1, 4) == 1)
                    {
                        BaseWeapon fork = new Pitchfork();
                        fork.AccuracyLevel          = WeaponAccuracyLevel.Supremely;
                        fork.MinDamage              = fork.MinDamage + 7;
                        fork.MaxDamage              = fork.MaxDamage + 12;
                        fork.Attributes.BonusHits   = 50;
                        fork.AosElementDamages.Fire = 50;
                        fork.Name   = "Satan's Pitchfork";
                        fork.Slayer = SlayerName.Repond;
                        if (Utility.RandomMinMax(0, 100) > 50)
                        {
                            fork.WeaponAttributes.HitFireball = 50;
                        }
                        fork.Hue = 0x489;
                        c.DropItem(fork);
                    }

                    ArrayList targets = new ArrayList();
                    foreach (Item item in World.Items.Values)
                    {
                        if (item is OrbOfTheAbyss)
                        {
                            targets.Add(item);
                        }
                    }
                    for (int i = 0; i < targets.Count; ++i)
                    {
                        OrbOfTheAbyss item = ( OrbOfTheAbyss )targets[i];
                        if (killer == item.owner)
                        {
                            item.Delete();
                        }                                                                     // PLAYERS ARE ONLY ALLOWED ONE ORB
                    }

                    OrbOfTheAbyss orb = new OrbOfTheAbyss();
                    orb.owner = killer;
                    int min   = 25;
                    int max   = 100;
                    int props = 2 + Utility.RandomMinMax(0, 10);
                    BaseRunicTool.ApplyAttributesTo((BaseJewel)orb, false, killer.Luck, props, min, max);
                    killer.AddToBackpack(orb);
                    killer.SendMessage("You have obtained Satan's Orb of the Abyss!");
                    LoggingFunctions.LogGenericQuest(killer, "has obtained Satan's orb of the abyss");
                }
            }
        }