Exemplo n.º 1
0
        public static void ResolveExperienceGainChargeLoss(PlayerMobile player, BaseCreature creature, Item item)
        {
            if (player == null || creature == null || item == null)
            {
                return;
            }
            if (item.Deleted)
            {
                return;
            }
            if (item.Aspect == AspectEnum.None)
            {
                return;
            }

            double experienceChance = creature.AspectGearExperienceChanceOnKill();
            int    experienceValue  = creature.AspectGearExperienceEarnedOnKill();

            if (Utility.RandomDouble() <= experienceChance)
            {
                int previousArcaneCharges = item.ArcaneCharges;

                ArcaneChargeLoss(item, experienceValue);

                if (item.TierLevel > 0 && item.TierLevel < MaxTierLevel)
                {
                    item.Experience += experienceValue;

                    if (item.Experience > ExperienceNeededToUpgrade)
                    {
                        item.Experience = ExperienceNeededToUpgrade;
                    }
                }
            }
        }