• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

BlzGetAbilityRealLevelField bug

Status
Not open for further replies.
Level 20
Joined
May 16, 2012
Messages
635
I think i found a possible bug. I was trying to modify the ToolTip - Learn - Extended field of an ability using the new function BlzSetAbilityResearchExtendedTooltip()

JASS:
if GetUnitAbilityLevel(u, 'AHtb') < 4 then
        set s = ("A magical hammer that is thrown at an enemy unit, causing damage and stunning the target.

Level 1 - |cff0080ff" + I2S(R2I((1000 + udg_SpellPowerFlat[GetUnitUserData(u)]) * udg_SpellPowerPercent[GetUnitUserData(u)])) + " Magical|r damage, |cffffcc00" + R2SW(BlzGetAbilityRealLevelField(BlzGetUnitAbility(u, 'AHtb'), ABILITY_RLF_DURATION_NORMAL, 0),1,1) + "|r second stun.
Level 2 - |cff0080ff" + I2S(R2I((2500 + udg_SpellPowerFlat[GetUnitUserData(u)]) * udg_SpellPowerPercent[GetUnitUserData(u)])) + " Magical|r damage, |cffffcc00" + R2SW(BlzGetAbilityRealLevelField(BlzGetUnitAbility(u, 'AHtb'), ABILITY_RLF_DURATION_NORMAL, 1),1,1) + "|r second stun.
Level 3 - |cff0080ff" + I2S(R2I((5000 + udg_SpellPowerFlat[GetUnitUserData(u)]) * udg_SpellPowerPercent[GetUnitUserData(u)])) + " Magical|r damage, |cffffcc00" + R2SW(BlzGetAbilityRealLevelField(BlzGetUnitAbility(u, 'AHtb'), ABILITY_RLF_DURATION_NORMAL, 2),1,1) + "|r second stun.                       
Level 4 - |cff0080ff" + I2S(R2I((10000 + udg_SpellPowerFlat[GetUnitUserData(u)]) * udg_SpellPowerPercent[GetUnitUserData(u)])) + " Magical|r damage, |cffffcc00" + R2SW(BlzGetAbilityRealLevelField(BlzGetUnitAbility(u, 'AHtb'), ABILITY_RLF_DURATION_NORMAL, 3),1,1) + "|r second stun.")
        call BlzSetAbilityResearchExtendedTooltip('AHtb', s, 0)
    endif

This piece of code runs every 0.5 seconds but i noticed that if the ability, in this case storm bolt, is not leveled up the value returned by the function BlzGetAbilityRealLevelField is always 0, no matter what parameters i use. Once i level up the ability, the values returned works as intended, Also, it's a bit weird that these functions are 0 based, because the fields in the object editor are 1 based, so its pretty easy to get confused.
 
Status
Not open for further replies.
Top