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

add specific buff

Status
Not open for further replies.
Level 2
Joined
Dec 18, 2005
Messages
28
Since I found no native in JASS to add a specific buff to a unit, I was wondering if some1 can script a function that adds one. The thing is dummys wont help, also spells like feerie fire or slow or something with modified values so it doesnt do anything just adding a buff wont help me, since I also use those as normal spells and in case a unit is the target of another spell based on the same (like ff or slow mentioned before), those buffs should stack.
Hope you get what I mean ^^
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
sry, i dont have time to test this theory right now, but try

JASS:
UnitAddAbility( yourunit, 'yourbuff' )

---damn sucky JASS tags---

buffs are considered abilities.

For example, UnitRemoveBuffSpecificBJ or whatever its called is really
JASS:
UnitRemoveAbility( whichUnit, whichBuff )
to check if a unit has a buff, you use

JASS:
if GetUnitAbilitLevel( yourunit, 'yourbuffcode' ) > 0

get the point? lol
 
Status
Not open for further replies.
Top