HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

UnitHasBuffsEx

07-12-2009, 07:42 AM#1
Deaod
Collapse JASS:
native UnitHasBuffsEx takes unit whichUnit, boolean removePositive, boolean removeNegative, boolean magic, boolean physical, boolean timedLife, boolean aura, boolean autoDispel returns boolean

Alright, does anyone know if this native does what i suppose it does (returning true if the specified unit has a buff matching certain criteria)?

My tests so far have shown nothing (it always returns false).
07-12-2009, 09:33 AM#2
DioD
this is gui function as i know, read comment...

and better tell us what you want to do, not how you want to do it.
07-12-2009, 10:09 AM#3
Deaod
UnitHasBuffsEx is not integrated into GUI as far as i can see.
However, UnitCountBuffsEx is. If theres any consistency in Blizzards natives, UnitHasBuffsEx doesnt work (using the same parameters on it as if i was counting buffs using UnitCountBuffsEx).

What i want to do:
Detect if a unit is under the effect of ANY debuff (excluding expiration timers).
07-12-2009, 11:09 AM#4
DioD
you can count debufs, play with UnitCountBuffsEx non zero return mean there is debuff (for units with summoned classification deduct 1 from result, there is only one exp timer per unit possible)
07-12-2009, 02:25 PM#5
Deaod
bad news, UnitCountBuffsEx doesnt work as well. Can anyone confirm this, or is it just me being dumb?
07-12-2009, 02:55 PM#6
DioD
there is advent of zenith map, it is not open source but, anyway check its code, since it contain some spells with damage per buff effects.
07-12-2009, 03:29 PM#7
Rising_Dusk
I manually control all buffs in the map, so I can detect if units suffer them at will through the system. I do not use any native or something special.
07-12-2009, 04:57 PM#8
DioD
UnitRemoveBuffsBJ

UnitCountBuffsExBJ

is bj functions with nice comment over params

tested - working

damn check gui first time is mana
Attached Images
File type: jpg123.JPG (23.4 KB)
07-12-2009, 06:09 PM#9
Deaod
DioD, im fully aware of that GUI function.

However, when i was testing the native with the debuff from 'Aslo' (Slow, human unit ability), it always returned "0", regardless of whether the buff was on the unit or not. I also set every boolean parameter of the function to true, but that didnt help as well. I concluded the native must be broken.

If you managed to get it working, please provide a test map, so i can figure out what im doing wrong.
07-13-2009, 10:40 AM#10
DioD
There is test&debug map

you are free to use any precious stuff from it.

ofc i can rip buff test, but have not time for this.

engine\trigger18 do its job
Attached Files
File type: w3x(12) Reaper's Way v0.011Beta2.w3x (153.6 KB)
07-14-2009, 06:15 AM#11
Deaod
alright, thanks for not giving up on me. I tracked the error down and eliminated it. You might want to remove the map.