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

Stable "give temporary ability" trigger?

Status
Not open for further replies.
Level 5
Joined
Apr 6, 2006
Messages
98
Well, the basic trigger i used to use was

Event
Unit begins channeling an ability

Conditions
Ability being cast equals bloodlust(example)[/u]

Actions
Add command aura(example) to 'Target Of Ability Being Cast'
Wait X seconds game time (X=duration of buff spell)
Remove command aura from 'Target Of Ability Being Cast'

-----

however sometimes, the ability is not removed should the unit spam spells during the process of the duration of the buff.

Seems that the problem is under the Actions field, but im unsure what, so what is a stable temporary buff trigger in this case?
 
Level 13
Joined
Feb 18, 2009
Messages
1,381
Create a variable, and set it as last created spell or what it's name is. Then say remove Variable
 
Level 13
Joined
Feb 18, 2009
Messages
1,381
I'll give it a try

EDIT : Seems as i overtook myself. I can't really figure it out.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Untitled Trigger 009
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to *your ability*
    • Actions
      • Custom script: local unit u = GetSpellTargetUnit()
      • Custom script: call UnitAddAbility(u,'AUau')
      • Wait 5.00 seconds
      • Custom script: call UnitRemoveAbility(u,'AUau')
Replace the AUau with the ability code of the ability you want to add. You can find them at object editor. Select View -> Display Values As Raw Data.
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
Well the correct solution would propably be creating a timer for each targeted unit and removing the buff as soon as the timer expires.
However since you don't use JASS, I suggest this: Create a unit group for units affected by this spell. When they receive the buff the , add them to group. Then create a 1-second trigger that checks all units in that group for the buff, and if they no longer have it they remove the ability and remove the unit from group.
Maker's solution is propably better.
 
Status
Not open for further replies.
Top