HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Detecting item passive abilities?

01-16-2006, 08:34 AM#1
Ignitedstar
I have an item with a custom passive ability. I know to do it's effect, however, I don't understand how to make a trigger to detect if the hero has it.

In general, how do you detect item passive abilities? I have absolutely no idea how.
01-16-2006, 10:43 AM#2
qwertyui
AFAIK there is no way to detect if a specific item has a specific ability.
Why can't you just detect whether the item in question is in hero's inventory?
01-16-2006, 11:03 AM#3
Ant
I think you can give the item a buff giving passive, and check for the buff. Technically should work, but I haven't tried it.
01-16-2006, 11:57 AM#4
qwertyui
Another way to go about it, if you don't want to have unneeded buffs on your hero interface, would be setting hero's custom value to indicate that he has a passive ability.
01-16-2006, 04:03 PM#5
PitzerMike
Items work like that: When a hero picks up an item all the abilities of the item are added to the hero. When the item is dropped, the ability is removed again -> UnitHasAbility will return true when a hero has an item with that passive ability.

So it's really incredibly easy to do a check with triggers.
01-16-2006, 04:48 PM#6
qwertyui
...and that's why you can always disable an item ability through unit-remove abilit, right?
01-16-2006, 05:53 PM#7
iNfraNe
correct.
01-17-2006, 05:00 AM#8
Ignitedstar
Oh, I see. So even if I used a "Unit has ability equal to (Item Passive)", it will still count as the item's passive ability? (Restating your answer so I understand what your talking about.)
01-17-2006, 10:44 AM#9
PitzerMike
Yes. And as soon as the item is dropped you'll get false again.