• 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.

[Solved] Check if "Ability Being Cast" is Hero/Unit/Item Abilty?

Status
Not open for further replies.
Level 4
Joined
Oct 11, 2017
Messages
37
Greetings, everyone!

I'm currently working in a "Arcane Sense" aura that notifies it's owner when a Hero unit is using one of it's abilities, however, the aura is activating even when a enemy hero uses an active item (mostly because, after all, the item IS a ability).

Is it possible through non-indexing methods to check if an ability being cast is a item ability?
 
Level 14
Joined
Jan 10, 2023
Messages
247
I think that does work, but if it doesn't, would it be possible to use the FourCC's first digit?

A capital first digit ('X000') marks a hero ability, a lower ('x000') marks a non-hero ability.
Same with Units.
With abilities, it may be possible to force a Hero ability to have a lowercase 1st digit, if you choose a specific FourCC value when making the ability, but I haven't tried. With units, if you copy a peasant ('hpea') but change the new peasant's FourCC to 'Hpea' it will make a copy but as a hero.
Abilities may force the change to Hero-type as well, but they do have a boolean for this so it may be simply a convention and not something that actually changes anything.

Anyway, if that is true that they are designated by the first digit, you could detect Hero/non-Hero by the FourCC abilcode value.
 
Level 4
Joined
Oct 11, 2017
Messages
37
On 1.31+ you can check if it's an Item Ability using a Boolean comparison:
  • (Ability: (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast))'s Boolean Field: Item Ability ('aite')) Equal to True
Not sure if it works though.
This one worked perfectly, and is by far the simplest method that fit my purposes.

Thanks everyone for your suggestions!
 
Status
Not open for further replies.
Top