DeadZone Community Packages
    Preparing search index...

    Function calculateSkillingBreak

    • To trigger a skilling break, we generate a number between 1 and the maxRange. If the number generated is less than or equal to the chance, we trigger a skilling break. For example, if you were to set the chance to 5 and the max range to 100, there is a 5% chance of triggering a skilling break each time it's called. Furthermore, if the user has DZ API -> Custom Skilling Breaks enabled, it will use those frequency values rather than your ones.

      We recommend calling this method every so often with a reasonable chance to trigger a break, typically at the start of a cycle or at points where it seems reasonable to stop. Once a skilling break has been triggered, you should stop execution until Utility.isSkillingBreakActive returns false

      Parameters

      • chance: number

        The generated value is must be less than or equal to the chance to trigger a skilling break

      • maxRange: number

        The maximum range of the generated value

      Returns boolean

      true if a skilling break was triggered, false otherwise