• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

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?
 
I'll give it a try

EDIT : Seems as i overtook myself. I can't really figure it out.
 
  • 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.
 
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.
Back
Top