• 🏆 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!

Get Buff Level?

Status
Not open for further replies.
Level 4
Joined
Mar 24, 2008
Messages
87
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).
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
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

  • Strygwyr's Thirst (1).w3x
    21.1 KB · Views: 188
Level 37
Joined
Mar 6, 2006
Messages
9,240
^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.
 
Level 16
Joined
May 1, 2008
Messages
1,605
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
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
^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.
Top