HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Detect if a unit has a skill ? (possible ?)

02-12-2007, 08:06 PM#1
RaptorTeak
Hi everybody.

I'm making lots of spells, but everytime I create a passiv skill for a unit only (I mean that only the unit who has the skill is affected by it), I have to make that this passiv skill is a self-only aura, and then in triggers I use a condition "UnitHasBuff blabla..".

But it's making lots of auras for nothing after all, but I was wondering if it was possible to detect if a unit has an ability ? I would really be cool, cuz all those self-only auras are getting me mad ^_^ .

Thanks in advance.
02-12-2007, 08:10 PM#2
CommanderZ
Collapse JASS:
        if GetUnitAbilityLevel(u,'A00V')==0 then
             (...)
        endif
I'm sure this can be done in Gui too
02-12-2007, 08:11 PM#3
RaptorTeak
Oh well, never thought to proceed this way, thanks a lot, it's working nice :) . + rep.
02-13-2007, 01:38 AM#4
Pyrogasm
Quote:
Originally Posted by CommanderZ
Collapse JASS:
        if GetUnitAbilityLevel(u,'A00V')==0 then
             (...)
        endif
I'm sure this can be done in Gui too
Once again, I think that's incorrect .

It should be this:
Collapse JASS:
if GetUnitAblityLevel(HoweverYouGetYourUnit(), 'RawcodeOfYourAbility') != 0 then //You could use > 0 also
//...
endif
02-13-2007, 01:53 PM#5
RaptorTeak
Yeah, I know that CommanderZ's script was to check if a unit hasn't an ability, but I just needed the idea to make it :) .
02-13-2007, 02:30 PM#6
CommanderZ
Sorry

I just copied two lines from script I was making at the moment