This should be pretty easy to do via triggers. (GUI)
Note that the following triggers are freehand, so the text might not be exactly correct:
Trigger:
- Enter Region
- Events
- Unit - A unit enters <Region>
- Condition
- Actions
- Countdown timer - Start Timer as a One-Shot countdown timer that expires in 10 seconds
- Trigger - Switch on Give Ability
- Trigger - Switch on Exit Region
Trigger:
- Exit Region
- Events
- Unit - A unit exits <Region>
- Conditions
- Actions
- Trigger - Switch off Give Ability
- Trigger - Switch off this trigger
Trigger:
- Give Ability
- Events
- Timer - Timer expires
- Conditions
- Actions
- Unit - Add <Ability> To Unit_Variable
a unit enters regionX
-put your conditions here-
set x = position of triggering unit.
create 1 dummy timer for owner of triggering unit at X
add 4 seconds generic expiration timer to last created unit.
set real = real + 1
set unit[real] = triggering unit
set dummy[real] = last created unit
add custom value for last created unit = real.
add triggering unit to gain_ab_group
A unit dies
unit type = dummy timer
add ability to unit[custom value of triggering unit].
remove unit from gain_ab_group
A unit leaves region.
unit is in gain_ab_group
remove dummy[index value of unit[]] from the game
remove triggering unit from gain_ab_group
A unit leaves region.
unit is in gain_ab_group equal to false
remove your ability from triggering unit
Maybe this may cause bugs?
maybe the guy wants it to be MUI...