Server.Mobiles.Paragon.CheckArtifactChance C# (CSharp) Méthode

CheckArtifactChance() public static méthode

public static CheckArtifactChance ( Mobile m, BaseCreature bc ) : bool
m Mobile
bc BaseCreature
Résultat bool
        public static bool CheckArtifactChance(Mobile m, BaseCreature bc)
        {
            if (!Core.AOS) return false;

            double fame = (double)bc.Fame;

            if (fame > 32000) fame = 32000;

            double chance = 1 / (Math.Max(10, 100 * (0.83 - Math.Round(Math.Log(Math.Round(fame / 6000, 3) + 0.001, 10), 3))) * (100 - Math.Sqrt(m.Luck)) / 100.0);

            return chance > Utility.RandomDouble();
        }

Usage Example

Exemple #1
0
        public override void OnKilledBy(Mobile mob)
        {
            base.OnKilledBy(mob);

            if (!CheckFisherArtifactChance() && Paragon.CheckArtifactChance(mob, this))
            {
                GiveArtifactTo(mob);
            }

            m_Fisher = null;
        }
All Usage Examples Of Server.Mobiles.Paragon::CheckArtifactChance