• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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,243
  • 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 13
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