• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Cloaking /w Speed

Status
Not open for further replies.
Level 12
Joined
May 20, 2009
Messages
822
I need some help getting this trigger to function properly.

  • Turn On
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Ranger
          • (Owner of (Triggering unit)) Equal to Player 1 (Red)
          • (Issued order) Equal to (Order(immolation))
    • Actions
      • Unit - Add Permanent Invisibility to (Triggering unit)
      • Set Cloaking = (Units of type (Unit-type of (Triggering unit)))
      • Set CloakingP1 = (Triggering unit)
      • Set ManaOfRangerP1 = (Mana of (Triggering unit))
  • Cloaking Level 1
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Level of Cloak for CloakingP1) Equal to 1
              • (CloakingP1 has buff Cloaking ) Equal to True <------ This fixed it.
        • Then - Actions
          • Unit - Set CloakingP1 movement speed to ((Default movement speed of CloakingP1) + 100.00)
        • Else - Actions
  • Turn Off
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(unimmolation))
          • (Owner of (Triggering unit)) Equal to Player 1 (Red)
          • (Unit-type of (Triggering unit)) Equal to Ranger
    • Actions
      • Unit - Remove Permanent Invisibility from (Triggering unit)
      • Unit - Set CloakingP1 movement speed to (Default movement speed of CloakingP1)
The problem I'm having is that the Speed Increase doesn't go away when it's turned off/The buff is removed.

EDIT: Actually, just as I post this I think I saw the issue...Hold on.

EDIT2: Sorry. xD Will edit original triggers to show what the problem is, for future references.
 
Level 6
Joined
Feb 5, 2012
Messages
1,685
In the first trigger

Create a variable

Set Movespeed = current movementspeed of CloakingP1

In the second trigger

Unit - Set CloakingP1 movement speed to ((Current movement speed of CloakingP1) + 100.00)

In the third trigger

Unit - Set CloakingP1 movement speed to Movespeed


Your problem is that you increases the default movementspeed of the unit in the second trigger so when you set back the movementspeed of CloakingP1 to default since you already increased the ms on the second trigger the bonus ms will not be removed..

Solution : Store first the movespeed in a variable.. before you add bonus ms.. so you can revert back..
 
Status
Not open for further replies.
Top