コード例 #1
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(damager.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(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);
                    }
                }
            }
        }
コード例 #2
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);
        }
コード例 #3
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);
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #4
0
        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);
                    }
                }
            }
        }
コード例 #5
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);
                }
            }
        }
コード例 #6
0
ファイル: KhaldunChest.cs プロジェクト: Evad-lab/ServUOX
        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);
                }
            }
        }
コード例 #7
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);
            }
        }
コード例 #8
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);
                    }
                }
            }
        }