Inheritance: IInitiableSkillHandler, ISkillHandler
Ejemplo n.º 1
0
        /// <summary>
        /// Returns chance for a successful gathering.
        /// </summary>
        /// <param name="creature"></param>
        /// <param name="collectData"></param>
        /// <returns></returns>
        private float GetSuccessChance(Creature creature, CollectingData collectData)
        {
            // Base
            var successChance = 0f;

            // Herbalism
            if (collectData.Target.Contains("/herb/"))
            {
                successChance = Herbalism.GetChance(creature, collectData);

                // If base chance is 0, gathering herbs fails. Adding the PM
                // bonus would make it possible to pick unpickable herbs
                // without Herbalism.
                if (successChance == 0)
                {
                    return(0);
                }
            }
            // Others
            else
            {
                successChance = collectData.SuccessRate;
            }

            // Add Production Mastery bonus
            successChance = ProductionMastery.IncreaseChance(creature, successChance);

            return(successChance);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns chance for a successful gathering.
        /// </summary>
        /// <param name="creature"></param>
        /// <param name="collectData"></param>
        /// <returns></returns>
        private float GetSuccessChance(Creature creature, CollectingData collectData)
        {
            // Base
            var successChance = collectData.SuccessRate;

            // Add chance for herbs based on Herbalism rank
            if (collectData.Target.Contains("/herb/"))
            {
                successChance += Herbalism.GetChance(creature, collectData);
            }

            // Add Production Mastery bonus
            successChance = ProductionMastery.IncreaseChance(creature, successChance);

            return(successChance);
        }