• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

how can Add buff to units with triggers

Status
Not open for further replies.
Level 4
Joined
Aug 18, 2011
Messages
73
hello guys
how can i Add buff to units but with trigger instead of spell data
you know how it could be necessary in Gui spells because you set everything with triggers (dummy,damage,effects) but you have to add buffs with spells data?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
This won't work; UnitAddAbility(unit, 'buff')
But strange enough, this work; UnitRemoveAbility(unit, 'buff')

So you can't add buff via trigger, but you can remove buff via trigger (even when not using the RemoveBuff function, but by using RemoveAbility function because somehow, buff is considered as an ability when added to a unit)
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
You customize everything with triggers but do not use jass. Seems legit. Yes, you can insert single jass lines into GUI triggers with the Custom Script action but you should still know more of jass.

Instead of casting, you may also add an aura ability like the tornado slow aura that only works on oneself though that has some leveling up problems.

@defskull: Buffs are extends of abilities. So adding them has only a meaning via abilities to gain their behavior like being lost on death or dispel. Removal of buffs on the other hand is an interface, now it has an ability it belongs to and knows to dispose it.
 
Status
Not open for further replies.
Top