• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

BlzGetAbilityRealLevelField bug

Status
Not open for further replies.
Level 21
Joined
May 16, 2012
Messages
644
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