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

[JASS] Can I register an ability gain event?

Status
Not open for further replies.
Level 17
Joined
Apr 13, 2008
Messages
1,597
Hi.
I want to register ability gain events. No, not hero skill gain events.
The main reason for this is that I want to do things with units when they come under the effects of certain auras.

I know I could pick units around the unit with aura and add them buffs/abilities but that sounds insane an ineffective.
Please help me out.
 
Level 17
Joined
Apr 13, 2008
Messages
1,597
No, not just heroes but regular units too.

PurplePoot, I don't know how do I use globals as the unit parameter in

JASS:
TriggerRegisterUnitInRange

Sorry for being stupid, I'm a novice JASSer.

Actually, I don't think it would fit my needs perfectly. I badly need something like TriggerRegisterAnyUnitEventAbilityGain, or something. Or a TriggerRegisterAnyUnitInRangeOfType.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
PurplePoot, I don't know how do I use globals as the unit parameter in
Dynamically create the event (and presumably the entire trigger with it). Then, attach it to the unit via some storage system, so that you can clean it up easily enough when the time comes.

TriggerRegisterAnyUnitEventAbilityGain
No can do, if you mean buffs. If you just mean abilities, you could just code your map that way (Replace UnitAddAbility).

TriggerRegisterAnyUnitInRangeOfType
Add a TriggerRegisterUnitInRange for every unit on the map (Or, if you just mean a single-subject event, TriggerRegisterUnitInRange with a boolexpr works).
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
I rather picking all units with buff
but... your choice

There is no trigger like that btw
 
Status
Not open for further replies.
Top