In the trigger editor there is an action which allows me to make a unit unturnable (Unit - Turn Unit Turnable state Off).
I have an ability which applies a buff to the caster. I would like for the caster to be unturnable for the duration of the buff, the buff might be refreshed though, so it is not a set duration. Also, I would like it to work regardless of how many casters I have in my map.
So either I need some way to make a unit unturnable through effects/behaviors in the data editor, or a collection of events for triggers that fire when the buff is applied/runs out. Anyone got any bright ideas?
In case someone has similar problems, I solved it by using the Data Table as a dynamic array - when the unit casts the ability, I start a timer, and add an event to another function for when the timer expired. I then save the caster and the timer in the data editor. If the ability is cast again before the timer runs out, I can check the data table for the event unit, and restart the corresponding timer.
When the timer expires, I remove it and the corresponding unit from data table.
This way I got two triggers that fire when the buff is applied/runs out.