Beispiel #1
0
 public MagicQuiver()
 {
     Name   = "quiver";
     Name   = LootPackEntry.MagicItemAdj("start", false, false, ItemID) + " " + Name;
     Hue    = RandomThings.GetRandomColor(0);
     ItemID = Utility.RandomList(0x2B02, 0x2B03);
 }
        public static string SwordName(string item, Mobile from)
        {
            string OwnerName  = from.Name;
            string sAdjective = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(LootPackEntry.MagicItemAdj("start", false, false, 0));
            string name       = item;

            if (OwnerName.EndsWith("s"))
            {
                OwnerName = OwnerName + "'";
            }
            else
            {
                OwnerName = OwnerName + "'s";
            }

            int FirstLast = 0;

            if (Utility.RandomBool())
            {
                FirstLast = 1;
            }

            if (FirstLast == 0)               // FIRST COMES ADJECTIVE
            {
                name = "the " + sAdjective + " " + item + " of " + from.Name;
            }
            else             // FIRST COMES OWNER
            {
                name = OwnerName + " " + sAdjective + " " + item;
            }

            return(name);
        }
Beispiel #3
0
        public override void ProcessKill(Mobile victim, Mobile damager)
        {
            var bc = victim as BaseCreature;

            if (!InSeason || bc == null || bc.Controlled || bc.Summoned || !damager.Alive || damager.Deleted || !bc.IsChampionSpawn)
            {
                return;
            }

            Region r = bc.Region;

            if (damager is PlayerMobile && r.IsPartOf("Khaldun"))
            {
                if (!DungeonPoints.ContainsKey(damager))
                {
                    DungeonPoints[damager] = 0;
                }

                int fame = bc.Fame / 4;
                int luck = Math.Max(0, ((PlayerMobile)damager).RealLuck);

                DungeonPoints[damager] += (int)(fame * (1 + Math.Sqrt(luck) / 100)) * PotionOfGloriousFortune.GetBonus(damager);

                int          x = DungeonPoints[damager];
                const double A = 0.000863316841;
                const double B = 0.00000425531915;

                double chance = A * Math.Pow(10, B * x);

                if (chance > Utility.RandomDouble())
                {
                    Item i = Loot.RandomArmorOrShieldOrWeaponOrJewelry(LootPackEntry.IsInTokuno(bc), LootPackEntry.IsMondain(bc), LootPackEntry.IsStygian(bc));

                    if (i != null)
                    {
                        RunicReforging.GenerateRandomItem(i, damager, Math.Max(100, RunicReforging.GetDifficultyFor(bc)), RunicReforging.GetLuckForKiller(bc), ReforgedPrefix.None, ReforgedSuffix.Khaldun);

                        damager.PlaySound(0x5B4);
                        damager.SendLocalizedMessage(1062317); // For your valor in combating the fallen beast, a special artifact has been bestowed on you.

                        if (!damager.PlaceInBackpack(i))
                        {
                            if (damager.BankBox != null && damager.BankBox.TryDropItem(damager, i, false))
                            {
                                damager.SendLocalizedMessage(1079730); // The item has been placed into your bank box.
                            }
                            else
                            {
                                damager.SendLocalizedMessage(1072523); // You find an artifact, but your backpack and bank are too full to hold it.
                                i.MoveToWorld(damager.Location, damager.Map);
                            }
                        }

                        DungeonPoints.Remove(damager);
                    }
                }
            }
        }
Beispiel #4
0
        public override void ProcessKill(Mobile victim, Mobile damager)
        {
            BaseCreature bc = victim as BaseCreature;

            if (!TreasuresOfDoomEvent.Instance.Running || bc == null || bc.Controlled || bc.Summoned || !damager.Alive || damager.Deleted || bc.IsChampionSpawn)
            {
                return;
            }

            Region r = bc.Region;

            if (damager is PlayerMobile mobile && r.IsPartOf("Doom"))
            {
                if (!DungeonPoints.ContainsKey(mobile))
                {
                    DungeonPoints[mobile] = 0;
                }

                int luck = Math.Max(0, mobile.RealLuck);

                DungeonPoints[mobile] += (int)Math.Max(0, (bc.Fame * (1 + Math.Sqrt(luck) / 100)));

                int          x = DungeonPoints[mobile];
                const double A = 0.000863316841;
                const double B = 0.00000425531915;

                double chance = A * Math.Pow(10, B * x);

                if (chance > Utility.RandomDouble())
                {
                    Item i = Loot.RandomArmorOrShieldOrWeaponOrJewelry(LootPackEntry.IsInTokuno(bc), LootPackEntry.IsMondain(bc), LootPackEntry.IsStygian(bc));

                    if (i != null)
                    {
                        RunicReforging.GenerateRandomItem(i, mobile, Math.Max(100, RunicReforging.GetDifficultyFor(bc)), RunicReforging.GetLuckForKiller(bc), ReforgedPrefix.None, ReforgedSuffix.Doom);

                        mobile.PlaySound(0x5B4);
                        mobile.SendLocalizedMessage(1155588); // You notice the crest of Doom on your fallen foe's equipment and decide it may be of some value...

                        if (!mobile.PlaceInBackpack(i))
                        {
                            if (mobile.BankBox != null && mobile.BankBox.TryDropItem(mobile, i, false))
                            {
                                mobile.SendLocalizedMessage(1079730); // The item has been placed into your bank box.
                            }
                            else
                            {
                                mobile.SendLocalizedMessage(1072523); // You find an artifact, but your backpack and bank are too full to hold it.
                                i.MoveToWorld(mobile.Location, mobile.Map);
                            }
                        }

                        DungeonPoints.Remove(mobile);
                    }
                }
            }
        }
Beispiel #5
0
        public static Item CreateItem(Mobile damager)
        {
            Item i = Loot.RandomArmorOrShieldOrWeaponOrJewelry(LootPackEntry.IsInTokuno(damager), LootPackEntry.IsMondain(damager), LootPackEntry.IsStygian(damager));

            if (i != null)
            {
                RunicReforging.GenerateRandomItem(i, damager, Utility.RandomMinMax(700, 800), damager is PlayerMobile ? ((PlayerMobile)damager).RealLuck : 0, ReforgedPrefix.None, ReforgedSuffix.Minax);
            }

            return(i);
        }
Beispiel #6
0
        public override void ProcessKill(BaseCreature victim, Mobile damager, int index)
        {
            if (!Enabled)
            {
                return;
            }

            Region r = victim.Region;

            if (damager is PlayerMobile && r.IsPartOf("KotlCity"))
            {
                if (!DungeonPoints.ContainsKey(damager))
                {
                    DungeonPoints[damager] = 0;
                }

                int fame = victim.Fame / 2;
                DungeonPoints[damager] += (int)(fame * (1 + Math.Sqrt(((PlayerMobile)damager).RealLuck) / 100));

                int          x = DungeonPoints[damager];
                const double A = 0.000863316841;
                const double B = 0.00000425531915;

                double chance = A * Math.Pow(10, B * x);

                if (chance > Utility.RandomDouble())
                {
                    Item i = Loot.RandomArmorOrShieldOrWeaponOrJewelry(LootPackEntry.IsInTokuno(victim), LootPackEntry.IsMondain(victim), LootPackEntry.IsStygian(victim));

                    if (i != null)
                    {
                        RunicReforging.GenerateRandomItem(i, damager, Math.Max(100, RunicReforging.GetDifficultyFor(victim)), RunicReforging.GetLuckForKiller(victim), ReforgedPrefix.None, ReforgedSuffix.Kotl);

                        damager.PlaySound(0x5B4);
                        damager.SendLocalizedMessage(1062317); // For your valor in combating the fallen beast, a special artifact has been bestowed on you.

                        if (!damager.PlaceInBackpack(i))
                        {
                            if (damager.BankBox != null && damager.BankBox.TryDropItem(damager, i, false))
                            {
                                damager.SendLocalizedMessage(1079730); // The item has been placed into your bank box.
                            }
                            else
                            {
                                damager.SendLocalizedMessage(1072523); // You find an artifact, but your backpack and bank are too full to hold it.
                                i.MoveToWorld(damager.Location, damager.Map);
                            }
                        }

                        DungeonPoints.Remove(damager);
                    }
                }
            }
        }
Beispiel #7
0
        public MagicPigment() : base(0x4C5A)
        {
            string OwnerName = RandomThings.GetRandomName();

            if (OwnerName.EndsWith("s"))
            {
                OwnerName = OwnerName + "'";
            }
            else
            {
                OwnerName = OwnerName + "'s";
            }

            string ItemName = LootPackEntry.MagicItemAdj("start", false, false, ItemID);

            Weight = 2.0;
            Name   = OwnerName + " " + ItemName + " paints";
        }
Beispiel #8
0
        public void OnEndInvasion()
        {
            if (Beacon != null)
            {
                List <Mobile> rights = Beacon.GetLootingRights();

                if (rights != null)
                {
                    foreach (Mobile damager in rights.Where(mob => mob.InRange(Beacon.Location, 12)))
                    {
                        Item i = Loot.RandomArmorOrShieldOrWeaponOrJewelry(LootPackEntry.IsInTokuno(damager), LootPackEntry.IsMondain(damager), LootPackEntry.IsStygian(damager));

                        if (i != null)
                        {
                            RunicReforging.GenerateRandomItem(i, damager, Utility.RandomMinMax(700, 800), damager is PlayerMobile ? ((PlayerMobile)damager).RealLuck : damager.Luck, ReforgedPrefix.None, ReforgedSuffix.Minax);

                            damager.PlaySound(0x5B4);
                            damager.SendLocalizedMessage(1154554); // You recover an artifact bearing the crest of Minax from the rubble.

                            if (!damager.PlaceInBackpack(i))
                            {
                                if (damager.BankBox != null && damager.BankBox.TryDropItem(damager, i, false))
                                {
                                    damager.SendLocalizedMessage(1079730); // The item has been placed into your bank box.
                                }
                                else
                                {
                                    damager.SendLocalizedMessage(1072523); // You find an artifact, but your backpack and bank are too full to hold it.
                                    i.MoveToWorld(damager.Location, damager.Map);
                                }
                            }
                        }
                    }
                }
            }
        }
        public override void ProcessKill(Mobile victim, Mobile damager)
        {
            var bc = victim as BaseCreature;

            if (bc == null)
            {
                return;
            }

            if (TOSDSpawner.Instance != null)
            {
                TOSDSpawner.Instance.OnCreatureDeath(bc);
            }

            if (!Enabled || bc.Controlled || bc.Summoned || !damager.Alive)
            {
                return;
            }

            Region r = bc.Region;

            if (damager is PlayerMobile && r.IsPartOf("Sorcerer's Dungeon"))
            {
                if (!DungeonPoints.ContainsKey(damager))
                {
                    DungeonPoints[damager] = 0;
                }

                int fame = bc.Fame / 4;
                int luck = Math.Max(0, ((PlayerMobile)damager).RealLuck);

                DungeonPoints[damager] += (int)(fame * (1 + Math.Sqrt(luck) / 100));

                int          x = DungeonPoints[damager];
                const double A = 0.000863316841;
                const double B = 0.00000425531915;

                double chance = A * Math.Pow(10, B * x);

                if (chance > Utility.RandomDouble())
                {
                    Item i = Loot.RandomArmorOrShieldOrWeaponOrJewelry(LootPackEntry.IsInTokuno(bc), LootPackEntry.IsMondain(bc), LootPackEntry.IsStygian(bc));

                    if (i != null)
                    {
                        RunicReforging.GenerateRandomItem(i, damager, Math.Max(100, RunicReforging.GetDifficultyFor(bc)), RunicReforging.GetLuckForKiller(bc), ReforgedPrefix.None, ReforgedSuffix.EnchantedOrigin);

                        damager.PlaySound(0x5B4);
                        damager.SendLocalizedMessage(1157613); // You notice some of your fallen foes' equipment to be of enchanted origin and decide it may be of some value...

                        if (!damager.PlaceInBackpack(i))
                        {
                            if (damager.BankBox != null && damager.BankBox.TryDropItem(damager, i, false))
                            {
                                damager.SendLocalizedMessage(1079730); // The item has been placed into your bank box.
                            }
                            else
                            {
                                damager.SendLocalizedMessage(1072523); // You find an artifact, but your backpack and bank are too full to hold it.
                                i.MoveToWorld(damager.Location, damager.Map);
                            }
                        }

                        DungeonPoints.Remove(damager);
                    }
                }
            }
        }
Beispiel #10
0
        public override void ProcessKill(Mobile victim, Mobile killer)
        {
            PlayerMobile pm = killer as PlayerMobile;
            BaseCreature bc = victim as BaseCreature;

            if (pm == null || bc == null || bc.NoKillAwards || !pm.Alive)
            {
                return;
            }

            //Make sure its a boss we killed!!
            bool boss = bc is Impaler || bc is DemonKnight || bc is DarknightCreeper || bc is FleshRenderer || bc is ShadowKnight || bc is AbysmalHorror;

            if (!boss)
            {
                return;
            }

            int luck = Math.Max(0, pm.RealLuck);

            AwardPoints(pm, (int)Math.Max(0, (bc.Fame * (1 + Math.Sqrt(luck) / 100)) / 2));

            double       gpoints = GetPoints(pm);
            const double A       = 0.000863316841;
            const double B       = 0.00000425531915;

            double chance = A * Math.Pow(10, B * gpoints);
            double roll   = Utility.RandomDouble();

            if (chance > roll)
            {
                Item i = null;

                int ran = Utility.Random(m_RewardTable.Length + 1);

                if (ran >= m_RewardTable.Length)
                {
                    i = Loot.RandomArmorOrShieldOrWeaponOrJewelry(LootPackEntry.IsInTokuno(killer), LootPackEntry.IsMondain(killer), LootPackEntry.IsStygian(killer));
                    RunicReforging.GenerateRandomArtifactItem(i, luck, Utility.RandomMinMax(800, 1200));
                    NegativeAttributes attrs = RunicReforging.GetNegativeAttributes(i);

                    if (attrs != null)
                    {
                        attrs.Prized = 1;
                    }
                }
                else
                {
                    Type[] list = m_RewardTable[ran];
                    Type   t    = list.Length == 1 ? list[0] : list[Utility.Random(list.Length)];

                    i = Activator.CreateInstance(t) as Item;
                }

                if (i != null)
                {
                    pm.SendLocalizedMessage(1062317); // For your valor in combating the fallen beast, a special artifact has been bestowed on you.

                    pm.PlaySound(0x5B4);

                    if (!pm.PlaceInBackpack(i))
                    {
                        if (pm.BankBox != null && pm.BankBox.TryDropItem(killer, i, false))
                        {
                            pm.SendLocalizedMessage(1079730); // The item has been placed into your bank box.
                        }
                        else
                        {
                            pm.SendLocalizedMessage(1072523); // You find an artifact, but your backpack and bank are too full to hold it.
                            i.MoveToWorld(pm.Location, pm.Map);
                        }
                    }

                    SetPoints(pm, 0);
                }
            }
        }
Beispiel #11
0
        public virtual void Fill()
        {
            Reset();

            List <Item> contains = new List <Item>(Items);

            foreach (var i in contains)
            {
                i.Delete();
            }

            ColUtility.Free(contains);

            for (int i = 0; i < Utility.RandomMinMax(6, 12); i++)
            {
                DropItem(Loot.RandomGem());
            }

            DropItem(new Gold(Utility.RandomMinMax(800, 1100)));

            Item item = null;

            if (0.30 > Utility.RandomDouble())
            {
                switch (Utility.Random(7))
                {
                case 0:
                    item = new Bandage(Utility.Random(10, 30)); break;

                case 1:
                    item        = new SmokeBomb();
                    item.Amount = Utility.Random(3, 6);
                    break;

                case 2:
                    item        = new InvisibilityPotion();
                    item.Amount = Utility.Random(1, 3);
                    break;

                case 3:
                    item = new Lockpick(Utility.Random(1, 10)); break;

                case 4:
                    item = new DreadHornMane(Utility.Random(1, 2)); break;

                case 5:
                    item = new Corruption(Utility.Random(1, 2)); break;

                case 6:
                    item = new Taint(Utility.Random(1, 2)); break;
                }

                DropItem(item);
            }

            if (0.25 > Utility.RandomDouble())
            {
                DropItem(new CounterfeitPlatinum());
            }

            if (0.2 > Utility.RandomDouble())
            {
                switch (Utility.Random(3))
                {
                case 0:
                    item = new ZombiePainting(); break;

                case 1:
                    item = new SkeletonPortrait(); break;

                case 2:
                    item = new LichPainting(); break;

                case 3:
                    item = new RelicOfHydros(); break;

                case 4:
                    item = new RelicOfLithos(); break;

                case 5:
                    item = new RelicOfPyros(); break;

                case 6:
                    item = new RelicOfStratos(); break;
                }

                DropItem(item);
            }

            if (0.1 > Utility.RandomDouble())
            {
                item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(LootPackEntry.IsInTokuno(this), LootPackEntry.IsMondain(this), LootPackEntry.IsStygian(this));

                if (item != null)
                {
                    TreasureMapChest.GetRandomItemStat(out int min, out int max, 1.0);

                    RunicReforging.GenerateRandomItem(item, null, Utility.RandomMinMax(min, max), 0, ReforgedPrefix.None, ReforgedSuffix.Khaldun, Map);

                    DropItem(item);
                }
            }
        }
Beispiel #12
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.Blessed)
            {
                from.SendMessage("You cannot look through that while in this state.");
            }
            else if (!from.InRange(GetWorldLocation(), 3))
            {
                from.SendMessage("You will have to get closer to it!");
            }
            else if (m_Uses < 5)
            {
                m_Uses++;
                if (Server.Misc.GetPlayerInfo.LuckyPlayer(from.Luck) && Utility.RandomBool())
                {
                    m_Uses--;
                }

                from.PlaySound(0x2E5);
                from.SendMessage("You pull something from the treasure hoard!");

                Item item = null;

                switch (Utility.Random(17))
                {
                case 0:
                    item = Loot.RandomArty();
                    break;

                case 1:
                    item = DungeonLoot.RandomSlayer();
                    break;

                case 2:
                    item = Loot.RandomSArty();
                    break;

                case 3:
                    if (Server.Misc.GetPlayerInfo.EvilPlay(from) == true && Utility.RandomMinMax(0, 10) == 10)
                    {
                        item = DungeonLoot.RandomEvil();
                    }
                    else
                    {
                        item = Loot.RandomRelic();
                        if (item is DDRelicWeapon && Server.Misc.GetPlayerInfo.OrientalPlay(from) == true)
                        {
                            Server.Items.DDRelicWeapon.MakeOriental(item);
                        }
                        else if (item is DDRelicStatue && Server.Misc.GetPlayerInfo.OrientalPlay(from) == true)
                        {
                            Server.Items.DDRelicStatue.MakeOriental(item);
                        }
                        else if (item is DDRelicBanner && item.ItemID != 0x2886 && item.ItemID != 0x2887 && Server.Misc.GetPlayerInfo.OrientalPlay(from) == true)
                        {
                            Server.Items.DDRelicBanner.MakeOriental(item);
                        }
                    }
                    break;

                case 4:
                    item = DungeonLoot.RandomRare();
                    if (item.Stackable == true)
                    {
                        item.Amount = Utility.RandomMinMax(5, 20);
                    }
                    break;

                case 5:
                    item = DungeonLoot.RandomLoreBooks();
                    break;

                case 6:
                    if (Utility.Random(4) != 1)
                    {
                        item = Loot.RandomScroll(0, 7, SpellbookType.Regular);
                    }
                    else
                    {
                        item = Loot.RandomScroll(0, 17, SpellbookType.Necromancer);
                    }
                    break;

                case 7:
                    int luckMod = from.Luck; if (luckMod > 2000)
                    {
                        luckMod = 2000;
                    }

                    if ((Region.Find(from.Location, from.Map)).IsPartOf("the Ancient Crash Site") ||
                        (Region.Find(from.Location, from.Map)).IsPartOf("the Ancient Sky Ship"))
                    {
                        item = new DDXormite((luckMod + Utility.RandomMinMax(333, 666)));
                    }
                    else if (Worlds.GetMyWorld(from.Map, from.Location, from.X, from.Y) == "the Mines of Morinia")
                    {
                        item = new Crystals((luckMod + Utility.RandomMinMax(200, 400)));
                    }
                    else if (Worlds.GetMyWorld(from.Map, from.Location, from.X, from.Y) == "the Underworld")
                    {
                        item = new DDJewels((luckMod + Utility.RandomMinMax(500, 1000)));
                    }
                    else
                    {
                        item = new Gold((luckMod + Utility.RandomMinMax(1000, 2000)));
                    }
                    break;

                case 8:
                case 9:
                case 10:
                case 11:
                    item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(Server.LootPackEntry.IsInIslesDread(from));
                    ContainerFunctions.LootMutate(from, Server.LootPack.GetRegularLuckChance(from), item, from.Backpack, Utility.RandomMinMax(5, 10));
                    break;

                case 12:
                    item = Loot.RandomInstrument();

                    int attributeCount;
                    int min, max;
                    Server.Misc.ContainerFunctions.GetRandomAOSStats(out attributeCount, out min, out max, 6);

                    BaseInstrument instr = (BaseInstrument)item;

                    int cHue = 0;
                    int cUse = 0;

                    switch (instr.Resource)
                    {
                    case CraftResource.AshTree: cHue = MaterialInfo.GetMaterialColor("ash", "", 0); cUse = 20; break;

                    case CraftResource.CherryTree: cHue = MaterialInfo.GetMaterialColor("cherry", "", 0); cUse = 40; break;

                    case CraftResource.EbonyTree: cHue = MaterialInfo.GetMaterialColor("ebony", "", 0); cUse = 60; break;

                    case CraftResource.GoldenOakTree: cHue = MaterialInfo.GetMaterialColor("gold", "", 0); cUse = 80; break;

                    case CraftResource.HickoryTree: cHue = MaterialInfo.GetMaterialColor("hickory", "", 0); cUse = 100; break;

                    case CraftResource.MahoganyTree: cHue = MaterialInfo.GetMaterialColor("mahogany", "", 0); cUse = 120; break;

                    case CraftResource.DriftwoodTree: cHue = MaterialInfo.GetMaterialColor("driftwood", "", 0); cUse = 120; break;

                    case CraftResource.OakTree: cHue = MaterialInfo.GetMaterialColor("oak", "", 0); cUse = 140; break;

                    case CraftResource.PineTree: cHue = MaterialInfo.GetMaterialColor("pine", "", 0); cUse = 160; break;

                    case CraftResource.RosewoodTree: cHue = MaterialInfo.GetMaterialColor("rosewood", "", 0); cUse = 180; break;

                    case CraftResource.WalnutTree: cHue = MaterialInfo.GetMaterialColor("walnute", "", 0); cUse = 200; break;
                    }

                    if (!(Server.Misc.Worlds.IsOnSpaceship(from.Location, from.Map)))
                    {
                        if (cHue > 0)
                        {
                            item.Hue = cHue;
                        }
                        else if (Utility.RandomMinMax(1, 4) == 1)
                        {
                            item.Hue = Utility.RandomColor(0);
                        }
                        Server.Misc.MorphingTime.MakeOrientalItem(item, from);
                        item.Name = LootPackEntry.MagicItemName(item, from, Region.Find(from.Location, from.Map));
                    }
                    else
                    {
                        string newName = "odd alien";
                        switch (Utility.RandomMinMax(0, 6))
                        {
                        case 0: newName = "odd"; break;

                        case 1: newName = "unusual"; break;

                        case 2: newName = "bizarre"; break;

                        case 3: newName = "curious"; break;

                        case 4: newName = "peculiar"; break;

                        case 5: newName = "strange"; break;

                        case 6: newName = "weird"; break;
                        }

                        switch (Utility.RandomMinMax(1, 4))
                        {
                        case 1: item = new Pipes();             item.Name = newName + " " + Server.Misc.RandomThings.GetRandomAlienRace() + " pipes";           break;

                        case 2: item = new Pipes();             item.Name = newName + " " + Server.Misc.RandomThings.GetRandomAlienRace() + " pan flute";       break;

                        case 3: item = new Fiddle();    item.Name = newName + " " + Server.Misc.RandomThings.GetRandomAlienRace() + " violin";          break;

                        case 4: item = new Fiddle();    item.Name = newName + " " + Server.Misc.RandomThings.GetRandomAlienRace() + " fiddle";          break;
                        }

                        BaseInstrument lute = (BaseInstrument)item;
                        lute.Resource = CraftResource.None;

                        item.Hue = Utility.RandomColor(0);
                    }

                    instr.UsesRemaining = instr.UsesRemaining + cUse;

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

                    SlayerName slayer = BaseRunicTool.GetRandomSlayer();

                    instr.Quality = InstrumentQuality.Regular;
                    if (Utility.RandomMinMax(1, 4) == 1)
                    {
                        instr.Quality = InstrumentQuality.Exceptional;
                    }

                    if (Utility.RandomMinMax(1, 4) == 1)
                    {
                        instr.Slayer = slayer;
                    }

                    break;

                case 13:
                    item = Loot.RandomGem();
                    break;

                case 14:
                    item = Loot.RandomPotion();
                    break;

                case 15:
                    item = Loot.RandomWand(); Server.Misc.MaterialInfo.ColorMetal(item, 0); string wandOwner = ""; if (Utility.RandomMinMax(1, 3) == 1)
                    {
                        wandOwner = Server.LootPackEntry.MagicWandOwner() + " ";
                    }
                    item.Name = wandOwner + item.Name;
                    break;

                case 16:
                    m_Uses = 6;                             // STOP GIVING LOOT WHEN THEY GET A CONTAINER
                    int chestLuck = Server.Misc.GetPlayerInfo.LuckyPlayerArtifacts(from.Luck);
                    if (chestLuck < 3)
                    {
                        chestLuck = 3;
                    }
                    if (chestLuck > 8)
                    {
                        chestLuck = 8;
                    }
                    item        = new LootChest(Utility.RandomMinMax(3, chestLuck));
                    item.ItemID = Utility.RandomList(0x9AB, 0xE40, 0xE41, 0xE7C);
                    item.Hue    = Utility.RandomList(0x961, 0x962, 0x963, 0x964, 0x965, 0x966, 0x967, 0x968, 0x969, 0x96A, 0x96B, 0x96C, 0x96D, 0x96E, 0x96F, 0x970, 0x971, 0x972, 0x973, 0x974, 0x975, 0x976, 0x977, 0x978, 0x979, 0x97A, 0x97B, 0x97C, 0x97D, 0x97E, 0x4AA);

                    Region reg = Region.Find(from.Location, from.Map);

                    string box = "hoard chest";
                    switch (Utility.RandomMinMax(0, 7))
                    {
                    case 0: box = "hoard chest";            break;

                    case 1: box = "treasure chest";         break;

                    case 2: box = "secret chest";           break;

                    case 3: box = "fabled chest";           break;

                    case 4: box = "legendary chest";        break;

                    case 5: box = "mythical chest";         break;

                    case 6: box = "lost chest";                     break;

                    case 7: box = "stolen chest";           break;
                    }

                    if (Server.Misc.Worlds.IsOnSpaceship(from.Location, from.Map))
                    {
                        Server.Misc.ContainerFunctions.MakeSpaceCrate(((LockableContainer)item));
                        box = item.Name;
                    }

                    switch (Utility.RandomMinMax(0, 1))
                    {
                    case 0: item.Name = box + " from " + Server.Misc.Worlds.GetRegionName(from.Map, from.Location);       break;

                    case 1: item.Name = box + " of " + HoardName;   break;
                    }
                    int xTraCash = Utility.RandomMinMax(5000, 8000);

                    int zone = 0;
                    if (Worlds.IsOnSpaceship(from.Location, from.Map))
                    {
                        zone = 1;
                    }
                    else if (Worlds.GetMyWorld(from.Map, from.Location, from.X, from.Y) == "the Underworld")
                    {
                        zone = 2;
                    }

                    ContainerFunctions.AddGoldToContainer(xTraCash, (LootChest)item, zone, from);
                    int artychance = GetPlayerInfo.LuckyPlayerArtifacts(from.Luck) + 10;
                    if (Utility.RandomMinMax(0, 100) < artychance)
                    {
                        Item artys = Loot.RandomArty(); ((LootChest)item).DropItem(artys); BaseContainer.DropItemFix(artys, from, ((LootChest)item).ItemID, ((LootChest)item).GumpID);
                    }
                    break;
                }

                if (item != null)
                {
                    if (Worlds.IsOnSpaceship(from.Location, from.Map))
                    {
                        Server.Misc.MorphingTime.MakeSpaceAceItem(item, from);
                    }

                    if (item is Container)
                    {
                        item.MoveToWorld(from.Location, from.Map);
                    }
                    else
                    {
                        from.AddToBackpack(item);
                    }
                }
                else
                {
                    if (Worlds.IsOnSpaceship(from.Location, from.Map))
                    {
                        item = new DDXormite((from.Luck + Utility.RandomMinMax(333, 666)));
                    }
                    else if (Worlds.GetMyWorld(from.Map, from.Location, from.X, from.Y) == "the Underworld")
                    {
                        item = new DDJewels((from.Luck + Utility.RandomMinMax(500, 1000)));
                    }
                    else
                    {
                        item = new Gold((from.Luck + Utility.RandomMinMax(1000, 2000)));
                    }
                    if (item != null)
                    {
                        from.AddToBackpack(item);
                    }
                }
            }
            else
            {
                from.SendMessage("There is nothing else worth taking from this pile!");
                this.Delete();
            }
        }
Beispiel #13
0
        public virtual void Fill()
        {
            Reset();

            List <Item> contains = new List <Item>(Items);

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

            ColUtility.Free(contains);

            for (int i = 0; i < Utility.RandomMinMax(6, 12); i++)
            {
                DropItem(Loot.RandomGem());
            }

            DropItem(new Gold(Utility.RandomMinMax(800, 1100)));

            if (0.1 > Utility.RandomDouble())
            {
                DropItem(new StasisChamberPowerCore());
            }

            if (0.1 > Utility.RandomDouble())
            {
                DropItem(new CardOfSemidar((CardOfSemidar.CardType)Utility.RandomMinMax(0, 5)));
            }

            if (0.25 > Utility.RandomDouble())
            {
                DropItem(new InoperativeAutomatonHead());
            }

            if (0.1 > Utility.RandomDouble() && Server.Engines.Points.PointsSystem.TreasuresOfKotlCity.Enabled)
            {
                Item item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(LootPackEntry.IsInTokuno(this), LootPackEntry.IsMondain(this), LootPackEntry.IsStygian(this));

                if (item != null)
                {
                    int min, max;

                    TreasureMapChest.GetRandomItemStat(out min, out max, 1.0);

                    RunicReforging.GenerateRandomItem(item, null, Utility.RandomMinMax(min, max), 0, ReforgedPrefix.None, ReforgedSuffix.Kotl, Map);

                    DropItem(item);
                }
            }

            if (0.25 > Utility.RandomDouble())
            {
                Item item;

                switch (Utility.Random(8))
                {
                default:
                case 0: item = new JournalDrSpector1(); break;

                case 1: item = new JournalDrSpector2(); break;

                case 2: item = new JournalDrSpector3(); break;

                case 3: item = new JournalDrSpector4(); break;

                case 4: item = new HistoryOfTheGreatWok1(); break;

                case 5: item = new HistoryOfTheGreatWok2(); break;

                case 6: item = new HistoryOfTheGreatWok3(); break;

                case 7: item = new HistoryOfTheGreatWok4(); break;
                }

                DropItem(item);
            }
        }
Beispiel #14
0
        public override void ProcessKill(Mobile victim, Mobile damager)
        {
            BaseCreature bc = victim as BaseCreature;

            if (!Enabled || bc == null || bc.Controlled || bc.Summoned || !damager.Alive)
            {
                return;
            }

            Region r = bc.Region;

            if (damager is PlayerMobile mobile && r.IsPartOf("KotlCity"))
            {
                if (!DungeonPoints.ContainsKey(mobile))
                {
                    DungeonPoints[mobile] = 0;
                }

                int fame = bc.Fame / 2;
                int luck = Math.Max(0, mobile.RealLuck);

                if (bc.Spawner is KotlBattleSimulator)
                {
                    fame *= 4;
                }

                DungeonPoints[mobile] += (int)(fame * (1 + Math.Sqrt(luck) / 100));

                int          x = DungeonPoints[mobile];
                const double A = 0.000863316841;
                const double B = 0.00000425531915;

                double chance = A * Math.Pow(10, B * x);

                if (chance > Utility.RandomDouble())
                {
                    Item i = Loot.RandomArmorOrShieldOrWeaponOrJewelry(LootPackEntry.IsInTokuno(bc), LootPackEntry.IsMondain(bc), LootPackEntry.IsStygian(bc));

                    if (i != null)
                    {
                        RunicReforging.GenerateRandomItem(i, mobile, Math.Max(100, RunicReforging.GetDifficultyFor(bc)), RunicReforging.GetLuckForKiller(bc), ReforgedPrefix.None, ReforgedSuffix.Kotl);

                        mobile.PlaySound(0x5B4);
                        mobile.SendLocalizedMessage(1062317); // For your valor in combating the fallen beast, a special artifact has been bestowed on you.

                        if (!mobile.PlaceInBackpack(i))
                        {
                            if (mobile.BankBox != null && mobile.BankBox.TryDropItem(mobile, i, false))
                            {
                                mobile.SendLocalizedMessage(1079730); // The item has been placed into your bank box.
                            }
                            else
                            {
                                mobile.SendLocalizedMessage(1072523); // You find an artifact, but your backpack and bank are too full to hold it.
                                i.MoveToWorld(mobile.Location, mobile.Map);
                            }
                        }

                        DungeonPoints.Remove(mobile);
                    }
                }
            }
        }
Beispiel #15
0
 public MagicQuiver()
 {
     Name = "quiver";
     Name = LootPackEntry.MagicItemAdj("start", false, false, ItemID) + " " + Name;
     Hue  = Utility.RandomColor(0);
 }