• Check out the results of the Techtree Contest #19!
  • 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 void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Get Buff Level?

Status
Not open for further replies.
I don't think so.
But you can make X times the same buff with name : level 1, level 2 ... and add them to the spells you want or use triggers (don't know what do you want to make with these buffs).
 
JASS:
GetUnitAbilityLevel()
Use the buff's id.
That doesn't actually work even though it seem like it should.

There are no natives for checking the level of a buff. The only way you can accomplish this is to either use a custom buff system or keep track of the level yourself with something like a hashtable.
 
You can however, detect level of buff depending the ability itself
I'm pretty sure it is stated in Tooltips of the buff at unit's Status:
Level 1 XXX
This unit has XXX; its attack speed will increase bla bla bla
Check the level buff, it says from Level: 1, to Level: 4, so, it can differs
Learn the Ability, and type -test
And see the Buff Level
Type -reset
and learn the spell to next level
Type -test
And see current buff, level 4
 

Attachments

^We're talking about detecting a buff of an ability that the unit does not have. For example a palading has Devotion aura and a footman is near the palading. How to get the buff level on the footman?

One could pick all friendly paladins in range and get the max Devotion level. One would have to remeber that Devotion aura buff lasts a few seconds after exiting the range.

But that's not a good way and would require lots of triggering to include all abilities.

There is no way to get the buff level.
 
Moin moin =)

So the way to do this will be create a buff for every level of the ability and detect if the unit has one of these buff then.
Also f**k to blizzard, why they made "GetUnitAbilityLevel(unit,code) = 1/2/3" if this doesn't work anyway -_-
So this part after GetUnitAbilityLevel() is same useless like "Do nothing()" ...

Greetings and Peace
Dr. Boom
 
^That could be a good way to get the buff level.

GetUnitAbilityLevel() still works for ability levels, for buffs it returns 1 if the level is > 0, otherwise it returns 0.

Which brought me to check UnitHasBuff GUI function:

JASS:
function UnitHasBuffBJ takes unit whichUnit, integer buffcode returns boolean
    return (GetUnitAbilityLevel(whichUnit, buffcode) > 0)
endfunction
 
Status
Not open for further replies.
Back
Top