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

Remove stun by triggers?

Status
Not open for further replies.
This is just a guess, since I don't have time right now to test. Stun buff says: Stun (Paused). But the Buff is only a visual effect, has no effect on the units function, the skill does though. You have to remove the Skill effect, no the buff.

Unit - Remove Buff must work: It will only remove the special effect and the buff, but the unit will remain Stunned.

To remove the real stun (and the buff at the same time) try using Unit - Pause/Unpause. (Off course: Unpause the unit)
 
Oh my gosh! The buff removing now works -.- ! Actually my true a new problem with my spell appears...

My spell, called 'Evil Kiss' needs to stun the target for 10 seconds, but there is 5% chance per second for the effect to break...

And when i cast it, every time the stun has been removed right when i cast the spell...

I will upload my map... can someone help me with that? (check my triggers! btw the Evil kiss spell owns the 'Spider Queen')
 
Last edited:
The game engine handles buffs by giving the unit an ability with the same ID as the buff set in the object editor. This dummy ability maintains the effect of the buff. By removing this ability (with the ID of the buff object) it will remove the buff and any effects the buff was giving.

As far as I know, this process is mono directional. You can not add a buff like you can normal abilities yet you can remove a buff like you do normal abilities.
 
Here's how I would do it:

  • EK Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Evil Kiss
    • Actions
      • Hashtable - Save "chance" as 0 of (Key (Target unit of ability being cast)) in EK_Hash
      • Set TempPoint = (Target point of ability being cast)
      • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees
      • Unit - Hide (Last created unit)
      • Unit - Add a 3.00 second Generic expiration timer to (Triggering unit)
      • Unit - Add EK_DummyAbility to (Last created unit)
      • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
      • Unit Group - Add (Triggering unit) to EK_Group
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Trigger - Turn on EK Remove Buff <gen>
  • EK Remove Buff
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in EK_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 100) Less than (Load 0 of (Key (Picked unit)) from EK_Hash)
              • ((Picked unit) has buff EK_Buff) Equal to False
            • Then - Actions
              • Unit - Remove EK_Buff buff from (Picked unit)
              • Unit Group - Remove (Picked unit) from EK_Group
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in EK_Hash
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in EK_Group) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
EK Remove Buff trigger is initially off, and "chance" means the chance to awaken per second. I hope I didn't forget anything, I wrote this in a little hurry.
 
Thanks! But i want to ask another thing - is it possible for the hashtables to bug my spell? Cuz i actually don't want it MUI :D all my other spells are not MUI because only one unit will use them... so i just want to ask if the hashtables can give such bugs?

Thanks for the support, Dr Super Good and Erkki2! :)
 
Now I had time to test it, and as I should have guessed, it was full of bugs :P
Here's the fixed version:
  • EK Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Evil Kiss
    • Actions
      • Hashtable - Save 30 as 0 of (Key (Target unit of ability being cast)) in EK_Hash
      • Set TempPoint = (Target point of ability being cast)
      • Unit - Create 1 DummyUnit for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees
      • Unit - Hide (Last created unit)
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Unit - Add EK_DummyAbility to (Last created unit)
      • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
      • Unit Group - Add (Target unit of ability being cast) to EK_Group
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Trigger - Turn on EK Remove Buff <gen>
  • EK Remove Buff
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in EK_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Random integer number between 1 and 100) Less than (Load 0 of (Key (Picked unit)) from EK_Hash)
                  • ((Picked unit) has buff EK_Buff (Pause)) Equal to False
            • Then - Actions
              • Unit - Remove EK_Buff (Pause) buff from (Picked unit)
              • Unit Group - Remove (Picked unit) from EK_Group
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in EK_Hash
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in EK_Group) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
Btw, why were you using hashtables in your version, if you don't want it to be MUI?
 
Status
Not open for further replies.
Back
Top