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

[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