public override void OnDeath(Container c)
        {
            base.OnDeath(c);

            FishingPole pole = new FishingPole();

            BaseRunicTool.ApplyAttributesTo(pole, false, 0, Utility.RandomMinMax(2, 5), 50, 100);
            c.DropItem(pole);

            c.DropItem(new MessageInABottle(c.Map));
            c.DropItem(new SpecialFishingNet());
            c.DropItem(new SpecialFishingNet());

            SkillMasteryPrimer.CheckPrimerDrop(this);
        }
        public override void GenerateLoot()
        {
            AddLoot(LootPack.Rich, 2);
            AddLoot(LootPack.Gems);

            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel jewel1 = new GoldEarrings();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(jewel1, 3, 15, 20);
                }

                jewel1.Hue = 1152;
                jewel1.Attributes.WeaponDamage = 6;
                jewel1.Resistances.Cold        = 9;

                PackItem(jewel1);
            }

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

                jewel2.Hue = 1152;
                jewel2.Attributes.WeaponDamage = 9;
                jewel2.Resistances.Cold        = 8;

                PackItem(jewel2);
            }

            if (Utility.RandomDouble() < 0.04)               //4% chance to drop.
            {
                BaseWeapon weapon = new Lance();

                weapon.Hue = 1152;

                weapon.Attributes.WeaponDamage         = 15;
                weapon.WeaponAttributes.HitHarm        = 5;
                weapon.WeaponAttributes.HitLowerDefend = 10;

                PackItem(weapon);
            }
        }
Esempio n. 3
0
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            base.OnMovement(m, oldLocation);

            if (InRange(m.Location, 2) && !InRange(oldLocation, 2) && m is PlayerMobile)
            {
                PlayerMobile pm = (PlayerMobile)m;
                QuestSystem  qs = pm.Quest;

                if (qs is DarkTidesQuest)
                {
                    QuestObjective obj = qs.FindObjective(typeof(ReturnToCrystalCaveObjective));

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

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

                            cont.DropItem(new Gold(500));

                            BaseJewel jewel = new GoldBracelet();
                            if (Core.AOS)
                            {
                                BaseRunicTool.ApplyAttributesTo(jewel, 3, 20, 40);
                            }
                            cont.DropItem(jewel);

                            if (!pm.PlaceInBackpack(cont))
                            {
                                cont.Delete();
                                pm.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();
                            }
                        }
                    }
                }
            }
        }
Esempio n. 4
0
        public Type GetSpecialLavaItem(Mobile from, Item type, Map map, Point3D pnt, object toHarvest)
        {
            Type newType = null;

            double skillBase  = from.Skills[SkillName.Fishing].Base;
            double skillValue = Math.Min(120.0, from.Skills[SkillName.Fishing].Value);

            //Same method as mutate entries
            for (int i = 0; i < m_LavaMutateTable.Length; ++i)
            {
                MutateEntry entry = m_LavaMutateTable[i];

                if (skillBase >= entry.m_ReqSkill)
                {
                    double chance = (skillValue - entry.m_MinSkill) / (entry.m_MaxSkill - entry.m_MinSkill);

                    if (map != null && map.Rules == MapRules.FeluccaRules)
                    {
                        chance *= 1.5;
                    }

                    if (chance > Utility.RandomDouble())
                    {
                        newType = entry.m_Types[Utility.Random(entry.m_Types.Length)];

                        if (newType == typeof(BaseWeapon))
                        {
                            BaseWeapon wep = Loot.RandomWeapon();

                            if (wep != null)
                            {
                                wep.SearingWeapon      = true;
                                wep.Attributes.Brittle = 1;
                                wep.MaxHitPoints       = 200;
                                wep.HitPoints          = 200;

                                BaseRunicTool.ApplyAttributesTo(wep, Utility.Random(1, 4), 45, 100);
                                from.AddToBackpack(wep);
                                from.SendMessage("You have pulled out an item : a searing weapon!");
                                return(typeof(BaseWeapon));
                            }
                        }
                    }
                }
            }

            return(newType);
        }
Esempio n. 5
0
        public EcruCitrineRing()
            : base()
        {
            Weight = 1.0;

            BaseRunicTool.ApplyAttributesTo(this, true, 0, Utility.RandomMinMax(2, 3), 0, 100);

            if (Utility.RandomBool())
            {
                Attributes.EnhancePotions = 50;
            }
            else
            {
                Attributes.BonusStr += 5;
            }
        }
Esempio n. 6
0
        public TurquoiseRing() : base(0x1F09)
        {
            Weight = 0.1;
            Name   = "A Turquoise Ring";
            int maxProps = CraftUtil.GetBonusProps(3) + 2;

            if (Utility.RandomDouble() > .95)
            {
                Attributes.WeaponSpeed = 5;
            }
            else
            {
                Attributes.WeaponDamage = 15;
            }
            BaseRunicTool.ApplyAttributesTo(this, maxProps, 0, 90);
        }
Esempio n. 7
0
        public DarkSapphireBracelet()
            : base()
        {
            Weight = 1.0;

            BaseRunicTool.ApplyAttributesTo(this, true, 0, Utility.RandomMinMax(1, 4), 0, 100);

            if (Utility.Random(100) < 10)
            {
                Attributes.RegenMana += 2;
            }
            else
            {
                Resistances.Cold += 10;
            }
        }
Esempio n. 8
0
        public FireRubyBracelet()
            : base()
        {
            Weight = 1.0;

            BaseRunicTool.ApplyAttributesTo(this, true, 0, Utility.RandomMinMax(1, 4), 0, 100);

            if (Utility.Random(100) < 10)
            {
                Attributes.RegenHits += 2;
            }
            else
            {
                Resistances.Fire += 10;
            }
        }
Esempio n. 9
0
        public PerfectEmeraldRing()
            : base()
        {
            Weight = 1.0;

            BaseRunicTool.ApplyAttributesTo(this, true, 0, Utility.RandomMinMax(2, 4), 0, 100);

            if (Utility.RandomBool())
            {
                Resistances.Poison += 10;
            }
            else
            {
                Attributes.SpellDamage += 5;
            }
        }
Esempio n. 10
0
        public TurqouiseRing()
            : base()
        {
            Weight = 1.0;

            BaseRunicTool.ApplyAttributesTo(this, true, 0, Utility.RandomMinMax(1, 3), 0, 100);

            if (Utility.Random(100) < 10)
            {
                Attributes.WeaponSpeed += 5;
            }
            else
            {
                Attributes.WeaponDamage += 15;
            }
        }
Esempio n. 11
0
        public override void OnDeath(Container c)
        {
            base.OnDeath(c);

            int drop = Utility.RandomMinMax(2, 5);

            for (int i = 0; i < drop; i++)
            {
                Type pieType = m_Pies[Utility.Random(m_Pies.Length)];

                Item pie = Loot.Construct(pieType);

                if (pie != null)
                {
                    c.DropItem(pie);
                }
            }

            drop = Utility.RandomMinMax(2, 5);

            for (int i = 0; i < drop; i++)
            {
                Type steakType = m_Steaks[Utility.Random(m_Steaks.Length)];

                Item steak = Loot.Construct(steakType);

                if (steak != null)
                {
                    c.DropItem(steak);
                }
            }

            c.DropItem(new MessageInABottle(c.Map));
            c.DropItem(new SpecialFishingNet());
            c.DropItem(new SpecialFishingNet());
            c.DropItem(new SpecialFishingNet());
            c.DropItem(new SpecialFishingNet());

            FishingPole pole = new FishingPole();

            BaseRunicTool.ApplyAttributesTo(pole, false, 0, Utility.RandomMinMax(2, 5), 50, 100);
            c.DropItem(pole);

            #region TOL
            //SkillMasteryPrimer.CheckPrimerDrop(this);
            #endregion
        }
Esempio n. 12
0
        public DarkSapphireBracelet() : base(0x1086)
        {
            Weight = 0.1;
            Name   = "A Brilliant Amber Bracelet";
            int maxProps = CraftUtil.GetBonusProps(4) + 1;

            if (Utility.RandomDouble() > .5)
            {
                Resistances.Cold = 10;
            }
            else
            {
                Attributes.RegenMana = 2;
            }

            BaseRunicTool.ApplyAttributesTo(this, maxProps, 0, 100);
        }
Esempio n. 13
0
        public override void GiveRewards()
        {
            //Random gold amount to add
            BankCheck gold = new BankCheck(Utility.RandomMinMax(500, 800));

            if (!Owner.AddToBackpack(gold))
            {
                gold.MoveToWorld(Owner.Location, Owner.Map);
            }

            //Adding Quest Reward Token(s)
            for (int x = 0; x < 1; x++)
            {
                RandomTalisman talisman = new RandomTalisman();
                if (!Owner.AddToBackpack(talisman))
                {
                    talisman.MoveToWorld(Owner.Location, Owner.Map);
                }
            }
            Item item;

            //Add Reward Item #1
            item = new DreadPirateBoots();
            if (item is BaseWeapon)
            {
                BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, Utility.RandomMinMax(1, 4), 10, 50);
            }
            if (item is BaseArmor)
            {
                BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 10, 50);
            }
            if (item is BaseJewel)
            {
                BaseRunicTool.ApplyAttributesTo((BaseJewel)item, Utility.RandomMinMax(1, 4), 10, 50);
            }
            if (item is BaseHat)
            {
                BaseRunicTool.ApplyAttributesTo((BaseHat)item, Utility.RandomMinMax(1, 4), 10, 50);
            }
            if (!Owner.AddToBackpack(item))
            {
                item.MoveToWorld(Owner.Location, Owner.Map);
            }

            base.GiveRewards();
        }
Esempio n. 14
0
        public ChestOfHeirlooms()
            : base(0x2811)
        {
            Locked        = true;
            LockLevel     = 95;
            MaxLockLevel  = 140;
            RequiredSkill = 95;

            TrapType  = TrapType.ExplosionTrap;
            TrapLevel = 10;
            TrapPower = 100;

            GumpID = 0x10B;

            for (int i = 0; i < 10; ++i)
            {
                Item item = Loot.ChestOfHeirloomsContains();

                int attributeCount = Utility.RandomMinMax(1, 5);
                int min            = 20;
                int max            = 80;

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

                    BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);
                }
                else if (item is BaseArmor)
                {
                    BaseArmor armor = (BaseArmor)item;

                    BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);
                }
                else if (item is BaseHat)
                {
                    BaseRunicTool.ApplyAttributesTo((BaseHat)item, attributeCount, min, max);
                }
                else if (item is BaseJewel)
                {
                    BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max);
                }

                DropItem(item);
            }
        }
Esempio n. 15
0
        public static void Enhance(Item loot)
        {
            if (loot is BaseWeapon weapon)
            {
                BaseRunicTool.ApplyAttributesTo(weapon, Utility.RandomMinMax(1, 5), 10, 80);
                return;
            }

            if (loot is BaseArmor armor)
            {
                BaseRunicTool.ApplyAttributesTo(armor, Utility.RandomMinMax(1, 5), 10, 80);
            }

            if (loot is BaseJewel jewel)
            {
                BaseRunicTool.ApplyAttributesTo(jewel, Utility.RandomMinMax(1, 5), 10, 80);
            }
        }
Esempio n. 16
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();

                BaseRunicTool.ApplyAttributesTo(weapon, 2, 20, 30);

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

                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);
                }

                bag.DropItem(item);
            }

            bag.DropItem(new Obsidian());

            if (to.PlaceInBackpack(bag))
            {
                return(true);
            }
            else
            {
                bag.Delete();
                return(false);
            }
        }
        public override void OnRead()
        {
            PlayerMobile pm = System.From;

            Moongate gate = new Moongate(new Point3D(1629, 1880, 5), Map.Malas);                 // Skaddria Naddheim Bank

            gate.Name = "Skaddria Naddheim Bank";
            gate.MoveToWorld(pm.Location, pm.Map);
            Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerCallback(gate.Delete));

            // woohoo!
            pm.PlaySound(0x5B8);               // satyrpipe_use_well
            pm.PlaySound(pm.Female ? 783 : 1054);
            pm.Say("Yahoo!");

            pm.AddToBackpack(new Gold(3500));
            pm.AddToBackpack(new SkillSlotDeedQuestReward());
            pm.AddToBackpack(new WeightIncreaseDeed());

            pm.Exp     += 1000;
            pm.KillExp += 1000;
            pm.SendMessage("You've gained 1000 exp.");

            if (pm.Exp >= pm.LevelAt && pm.Level != pm.LevelCap)
            {
                Actions.DoLevel(pm, new Setup());
            }

            pm.TotalQuestsDone += 1;

            BaseJewel jewel = new RingOfMinorRevigoration();

            if (Core.AOS)
            {
                BaseRunicTool.ApplyAttributesTo(jewel, 2, 5, 10);
            }

            jewel.Attributes.Luck = 200;
            jewel.LootType        = LootType.Blessed;

            pm.AddToBackpack(jewel);

            System.Complete();
        }
Esempio n. 18
0
        public static Item RandomItem(int attributeCount, int min, int max)
        {
            Item item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(false, true);

            if (item is BaseWeapon)
            {
                BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, attributeCount, min, max);
            }
            else if (item is BaseArmor)
            {
                BaseRunicTool.ApplyAttributesTo((BaseArmor)item, attributeCount, min, max);
            }
            else if (item is BaseJewel)
            {
                BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max);
            }

            return(item);
        }
Esempio n. 19
0
 public static void Enhance(Item loot)
 {
     if (loot is BaseWeapon)
     {
         BaseRunicTool.ApplyAttributesTo((BaseWeapon)loot, Utility.RandomMinMax(1, 5), 10, 80);
     }
     else if (loot is BaseArmor)
     {
         BaseRunicTool.ApplyAttributesTo((BaseArmor)loot, Utility.RandomMinMax(1, 5), 10, 80);
     }
     else if (loot is BaseShield)
     {
         BaseRunicTool.ApplyAttributesTo((BaseShield)loot, Utility.RandomMinMax(1, 5), 10, 80);
     }
     else if (loot is BaseJewel)
     {
         BaseRunicTool.ApplyAttributesTo((BaseJewel)loot, Utility.RandomMinMax(1, 5), 10, 80);
     }
 }
Esempio n. 20
0
        public PerfectEmeraldRing()
        {
            Weight = 0.1;
            Name   = "A Perfect Emerald Ring";
            int maxProps = CraftUtil.GetBonusProps(3) + 2;

            switch (Utility.Random(2))
            {
            case 0:
                Resistances.Poison = 10;
                break;

            default:
                Attributes.LowerManaCost = 10;
                break;
            }

            BaseRunicTool.ApplyAttributesTo(this, maxProps, 0, 80);
        }
Esempio n. 21
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;
                        }
                    }
                }
            }
        }
        public override void GenerateLoot()
        {
            AddLoot(LootPack.Gems);

            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel jewel1 = new GoldEarrings();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(jewel1, 3, 15, 20);
                }

                jewel1.Resistances.Energy = 8;

                PackItem(jewel1);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel jewel2 = new GoldNecklace();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(jewel2, 3, 15, 20);
                }

                jewel2.Resistances.Energy = 12;

                PackItem(jewel2);
            }
            if (Utility.RandomDouble() < 0.04)               //4% chance to drop.
            {
                BaseWeapon weapon = new QuarterStaff();

                weapon.Hue = 2106;

                weapon.Attributes.SpellDamage        = 15;
                weapon.WeaponAttributes.HitLightning = 5;

                PackItem(weapon);
            }
        }
        public override void GenerateLoot()
        {
            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel jewel1 = new GoldEarrings();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(jewel1, 3, 15, 20);
                }

                jewel1.Resistances.Fire = 8;

                PackItem(jewel1);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel jewel2 = new GoldNecklace();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(jewel2, 3, 15, 20);
                }

                jewel2.Resistances.Fire = 12;

                PackItem(jewel2);
            }
            if (Utility.RandomDouble() < 0.05)               //5% chance to drop.
            {
                BaseWeapon weapon = new BlackStaff();

                weapon.Hue = 1908;

                weapon.Attributes.SpellDamage       = 15;
                weapon.WeaponAttributes.HitFireball = 5;

                PackItem(weapon);
            }
        }
Esempio n. 24
0
        public static void SpecialItem(Item item, Mobile m)
        {
            int min   = (int)(m.Fame / 200);
            int max   = (int)(m.Fame / 100);
            int props = (int)(m.Fame / 1500) + Utility.RandomMinMax(0, (int)(m.Fame / 2000));

            if (item is BaseHat)
            {
                BaseHat hat = (BaseHat)item; BaseRunicTool.ApplyAttributesTo(hat, false, 0, props, min, max);
            }
            else if (item is BaseClothing)
            {
                BaseClothing cloth = (BaseClothing)item; BaseRunicTool.ApplyAttributesTo(cloth, false, 0, props, min, max);
            }
            else if (item is BaseArmor)
            {
                BaseArmor armor = (BaseArmor)item; BaseRunicTool.ApplyAttributesTo(armor, false, 0, props, min, max);
            }
            else if (item is BaseWeapon)
            {
                BaseWeapon weapon = (BaseWeapon)item; BaseRunicTool.ApplyAttributesTo(weapon, false, 0, props, min, max);
            }
        }
Esempio n. 25
0
        public override void GenerateLoot()
        {
            AddLoot(LootPack.Rich);

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

                PackItem(clothing);
            }

            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel ring = new GoldRing();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(ring, 3, 15, 25);
                }

                PackItem(ring);
            }
        }
Esempio n. 26
0
        public override void GiveRewards()
        {
            //Give Gold to player in form of a bank check
            BankCheck gold = new BankCheck(Utility.RandomMinMax(2000, 5000));

            if (!Owner.AddToBackpack(gold))
            {
                gold.MoveToWorld(Owner.Location, Owner.Map);
            }

            Item item;

            //Random Magic Item #1
            item = Loot.RandomArmorOrShieldOrWeaponOrJewelry();
            if (item is BaseWeapon)
            {
                BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, 2, 5, 30);
            }
            if (item is BaseArmor)
            {
                BaseRunicTool.ApplyAttributesTo((BaseArmor)item, 2, 5, 30);
            }
            if (item is BaseJewel)
            {
                BaseRunicTool.ApplyAttributesTo((BaseJewel)item, 2, 5, 30);
            }
            if (item is BaseHat)
            {
                BaseRunicTool.ApplyAttributesTo((BaseHat)item, 2, 5, 30);
            }
            if (!Owner.AddToBackpack(item))
            {
                item.MoveToWorld(Owner.Location, Owner.Map);
            }

            base.GiveRewards();
        }
Esempio n. 27
0
        public override void GenerateLoot()
        {
            AddLoot(LootPack.Rich);

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

                PackItem(clothing);
            }

            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield = new GrassShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield, 5, 35, 50);
                }
                shield.Hue = 2536;

                PackItem(shield);
            }

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

                PackItem(ring);
            }
        }
        public override void GenerateLoot()
        {
            AddLoot(LootPack.Average);
            AddLoot(LootPack.Potions);

            if (Utility.RandomDouble() < 0.15)
            {
                BaseWeapon weapon = Loot.RandomWeapon(true);
                switch (Utility.Random(4))
                {
                case 0: weapon = new QuarterStaff(); break;

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

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

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

                BaseRunicTool.ApplyAttributesTo(weapon, 2, 10, 20);

                PackItem(weapon);
            }
        }
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 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);
        }