HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Adding buffs

11-28-2007, 07:07 AM#1
chobibo
Just simple question guys, can I add a buff via trigger? One more , can I use a timer for spell cooldowns, that's all thanks guys!
11-28-2007, 10:33 AM#2
XieLong
To add an buff, just add a modified Tornado Slow Aura
Quote:
PitzerMike's Ability Guide:
Aasl (Tornado Slow Aura): This aura is perfect to add buffs to units that have no effects at all. Just set the targets allowed to self and the effect of the aura to zero. The ability doesn't have an icon. The best thing is that you can have more than one on a unit and the different buff icons will stack. Because 'Aasl' is normally a harming aura the buff tooltip will always be red, but you can change that by using color codes in the buff's name. For example |cffff0000Badass Red Buff|r and |cff00ff00Beneficial Green Buff|r. If you ever find a limit for 'Aasl' you can also use other auras and hide them in a disabled spellbook.

You can't influence the cooldown of abilities with triggers, there's only one exeption: Reset all cooldowns.
But what do you want to do with such timers? Maybee there's a workaround...
12-02-2007, 02:44 PM#3
chobibo
Hey XieLon thanks! about the cooldowns, I had a problem with it using ForGroup with TriggerSleepAction because it halts the operation of the callback function. I searched the forums for answers and I learned about executefunc which could enable me to put waits on callback functions. About the timers, I just didn't know how to use it on the time I posted this lol, I thought I could use them for cooldowns. Thanks Again + REP
12-02-2007, 10:25 PM#4
XieLong
Hm, sry, i dont really get now the connection between your ForGroup issue and the Spell Cooldown... but: I have a solution for the impossible wait within ForGroup-Loops:
Put your actions in 2 ForGroup loops and put the wait between them.
Or, and that's the better, cause leakfreem, variant, replace your ForGroup with this kind of loop:
Collapse JASS:
 local group g = <Your Group>
 local unit u
 loop
   set u = FirstOfGroup(g)
   exitwhen u == null
   call GroupRemoveUnit(g,u)
 //<your ForGroupActions>
 endloop
 call DestroyGroup(g)
 set g=null
 set u=null

But make sure that the group g is no reference on a group which you want to use afterwards, cause it will be empty. To avoid this little issue, you could flag the units (with custom value or attached boolean) instead of removing them from the group. And also you would have to change loop a little (add a controlling loop to the FirstOfgroup where you check the flag)

thx for +rep