Example #1
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);
                    }
                }
            }
        }
Example #2
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);
                    }
                }
            }
        }
Example #3
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);
                    }
                }
            }
        }
        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);
                    }
                }
            }
        }
Example #5
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);
                    }
                }
            }
        }