• 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 faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

If unit loses buff?

Status
Not open for further replies.
Level 4
Joined
Jan 9, 2010
Messages
89
There is no event detecting this.

The closest you could come would be checking for the buff every (something) seconds. Kinda inefficient but I think it would be the only way.

As for the stun you would have to make a dummy caster cast a custom spell with a stun in it.
 
Last edited:
Well, the specific buff is of an ability, right? What's its duration? Get it, and do this:
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a Hashtable
    • Set Hashtable = Last created Hashtable
  • Trigger1
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to X
  • Actions
    • Hashtable - Save Timer1 as (Key(duration)) of (Key(Target unit of ability being cast)) in Hashtable
    • Countdown Timer - Start (Load (Key(duration) of (Key(Target unit of ability being cast)) in Hashtable) as a one-shot timer that will expire in 5.00 seconds [Change 5.00 to the duration of the spell]
    • Hashtable - Save (Target unit of ability being cast) as (Key(unit)) of (Key(Last started timer) in Hashtable
    • Hashtable - Save (Triggering unit) as (Key(unit1)) of (Key(Last started timer) in Hashtable
  • Trigger2
  • Events
    • Time - Timer1 expires
  • Conditions
    • ((Load (Key(unit)) of (Key(Expiring timer)) from Hashtable) has (your buff)) Equal to False
  • Actions
    • Set Point1 = (Position of (Load (Key(unit)) of (Key(Expiring Timer)) from Hashtable)
    • Unit - Create 1 dummy for (Owner of (Load (Key(unit1)) of (Key(Expiring Timer)) from Hashtable) at Point1 facing default building degrees
    • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Load (Key(unit)) of (Key(Expiring Timer)) from Hashtable)
    • Unit - Add a 1.00 seconds Generic expiration timer to (Last created unit)
    • Custom script: call RemoveLocation (udg_Point1)
    • Hashtable - Clear all child hashtables of child (Key(Load (Key(unit)) of (Key(Expiring Timer)))) in Hashtable
    • Hashtable - Clear all child hashtables of child (Key(Expiring Timer)) in Hashtable
 
Level 7
Joined
Oct 14, 2008
Messages
340
And if that unit gets purged? It will lose it's buff but not be stunned for a few more seconds, a much faster periodic timer detecting whether the unit still has the buff is the most efficient way to do it. Creating a dummy to cast a stun on the target and destroying the timer when the buff is lost.
 
Level 11
Joined
Jan 25, 2009
Messages
572
And if that unit gets purged? It will lose it's buff but not be stunned for a few more seconds, a much faster periodic timer detecting whether the unit still has the buff is the most efficient way to do it. Creating a dummy to cast a stun on the target and destroying the timer when the buff is lost.

Well do this then

  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a Hashtable
    • Set Hashtable = Last created Hashtable
  • Trigger1
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to X
  • Actions
    • Hashtable - Save Timer1 as (Key(duration)) of (Key(Target unit of ability being cast)) in Hashtable
    • Countdown Timer - Start (Load (Key(duration) of (Key(Target unit of ability being cast)) in Hashtable) as a one-shot timer that will expire in 5.00 seconds [Change 5.00 to the duration of the spell]
    • Hashtable - Save (Target unit of ability being cast) as (Key(unit)) of (Key(Last started timer) in Hashtable
    • Hashtable - Save (Triggering unit) as (Key(unit1)) of (Key(Last started timer) in Hashtable
  • Trigger2
  • Events
    • Time - Timer1 expires
    • Unit - A unit Starts the effect of an ability
  • Conditions
  • Or - Any (Conditions) are true
    • Conditions
      • (Ability being cast) Equal to Purge
      • ((Load (Key(unit)) of (Key(Expiring timer)) from Hashtable) has (your buff)) Equal to True
  • Actions
    • Set Point1 = (Position of (Load (Key(unit)) of (Key(Expiring Timer)) from Hashtable)
    • Unit - Create 1 dummy for (Owner of (Load (Key(unit1)) of (Key(Expiring Timer)) from Hashtable) at Point1 facing default building degrees
    • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Load (Key(unit)) of (Key(Expiring Timer)) from Hashtable)
    • Unit - Add a 1.00 seconds Generic expiration timer to (Last created unit)
    • Custom script: call RemoveLocation (udg_Point1)
    • Hashtable - Clear all child hashtables of child (Key(Load (Key(unit)) of (Key(Expiring Timer)))) in Hashtable
    • Hashtable - Clear all child hashtables of child (Key(Expiring Timer)) in Hashtable
 
Status
Not open for further replies.
Top