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

Detecting when Bladestorm ends?

Status
Not open for further replies.
Level 11
Joined
Feb 11, 2010
Messages
199
Sorry if this is a newbie question, but how would I detect when the effect of the spell Bladestorm ends in GUI triggers? I've tried detecting when a unit no longer has the buff "Bladestorm (Caster)" but, after finding that this didn't work and doing some further testing, it seems that the unit doesn't actually *get* the Bladestorm (Caster) buff during the effect of Bladestorm. :confused:

As is I'm reduced to just guessing when it ends using a timer...
 
Level 12
Joined
May 21, 2009
Messages
994
Okay, first you maybe say "Bladestorm duration = 10 seconds" in the object editor. Then you detect when the spell is cast like this:
  • Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bladestorm
    • Actions
      • Countdown Timer - Start YOUR_TIMER as a One-shot timer that will expire in 10.00 seconds
  • End
    • Events
      • Time - YOUR_TIMER expires
    • Conditions
    • Actions
      • -------- Do your actions here: --------
I'm not sure if this is MUI though. But It should work.
Have fun.
 
Level 11
Joined
Feb 11, 2010
Messages
199
Okay, first you maybe say "Bladestorm duration = 10 seconds" in the object editor. Then you detect when the spell is cast like this:
  • Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bladestorm
    • Actions
      • Countdown Timer - Start YOUR_TIMER as a One-shot timer that will expire in 10.00 seconds
  • End
    • Events
      • Time - YOUR_TIMER expires
    • Conditions
    • Actions
      • -------- Do your actions here: --------
I'm not sure if this is MUI though. But It should work.
Have fun.

Yeah... that's what I'm already doing, as mentioned in the first post. Thanks for the reply though :)
 
A timer will not be MUI enhanced. Try this:
  • Trigger1
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a hashtable
    • Set Hashtable = (Last created hashtable)
  • Trigger2
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Bladestorm
  • Actions
    • Hashtable - Save 60.00 as (Key(timer)) of (Key(Triggering unit)) in Hashtable
    • Unit Group - Add (Triggering unit) to Temp_Group
    • Trigger - Turn on Trigger 3 <gen>
  • Trigger3
  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • ((Temp_Group) is empty) Equal to True
      • Then - Actions
        • Trigger - Turn off (This trigger)
      • Else - Actions
        • Unit Group - Pick every unit in (Temp_Group) and do (Actions)
          • Loop - Actions
            • Set Timer1 = (Load (Key(timer)) of (Key(Picked unit)) from Hashtable
            • Hashtable - Save (Timer1 - 1.00) as (Key(timer)) of (Key(Picked unit)) in Hashtable
            • If (All conditions) are true then do (Actions) else do (Actions)
              • If - Conditions
                • (Timer1) Equal to 0
              • Then - Actions
                • Unit Group - Remove (Picked unit) from Temp_Group
                • Hashtable - Clear all child hashtables of (Key(Picked unit)) from Hashtable
              • Else - Actions
The "60.00" value you save is your spell's duration. Save a formula based number to be exact. If, for example, Level 1 lasts for 30 seconds, level 2 for 45 seconds and level 3 for 60 seconds, then save "(15*(Real(Level of (Ability being cast) for (Triggering unit)))+15)"

For more info,
[•] http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hashtables-mui-133407/
 
Status
Not open for further replies.
Top