• Adds the input value of experience to the hero unit specified.

    If the experience added exceeds the amount required for the hero to gain a level, then it will force the unit to gain a level and the remaining experience will spill over for the next level.

    Parameters

    • whichHero: Unit<UnitEventMap>

      The hero unit to add experience to.

    • xpToAdd: number

      The amount of experience to add to the hero unit.

    • showEyeCandy: boolean

      If the boolean input is true, then the hero-level-gain effect will be shown if the hero gains a level from the added experience.

    Returns void

    Bug

    Adding negative value to experience will decrease it by the stated value, but won't lower the level even if the experience value after deduction is lower than the lower bound of the experience required to get the stated level.

    Bug

    If the value will become lower than zero, the experience won't be negative, instead of it it'll be equal to 4294967296+(supposed_negative_experience_value) which actually proves that WarCraft III uses unsigned int type for storing experience points.

Generated using TypeDoc