Enable/Disable

Status
Not open for further replies.
Level 11
Joined
Dec 5, 2009
Messages
846
You know like mana shield or immolation they have enable disable. and i have a trigger if i enable mana shield then one trigger runs every 1 second. And then when the hero disables that spell or ability this trigger will turn off but how to do that? If you want me to post the trigger please tell me.
 
  • Trigger1
  • Events
    • Unit - A unit is issued an order with no target
  • Conditions
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Issued order) Equal to (order(immolation))
      • Then - Actions
        • Trigger - Turn on (Trigger2 <gen>)
      • Else - Actions
        • If (All conditions are true) then do (Actions) else do (Actions)
          • If - Conditions
            • (Issued order) Equal to (order(unimmolation))
          • Then - Actions
            • Trigger - Turn off (Trigger2 <gen>)
          • Else - Actions
      • Else - Actions
 
Level 11
Joined
Dec 5, 2009
Messages
846
It doesn't work i did like this


  • Events
    • Unit - A unit Is issued an order with no target
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Issued order) Equal to (Order(Mana Barrier))
      • Then - Actions
        • Set Unit[1] = (Casting unit)
        • Trigger - Turn on Mana barrier loop <gen>
      • Else - Actions
I tested with Mana Shield too istead of Mana Barrier doesnt work :(

Mana barrier loop doesnt run
 
Casting unit responds to "A unit starts the effect of an ability/begins channeling an ability/finishes casting an ability/stops casting an ability/begins casting an ability" event.
A unit is issued an order event refers to "Ordered unit" event. If you'are unsure what type of unit to generally place, use "Triggering unit". So now, replace Casting unit with Triggering unit or Ordered unit (I suggest the first, it's faster).
 
Level 11
Joined
Dec 5, 2009
Messages
846
Still doesnt work.. I tested with immolation and mana shield and |cffd1cd2eT|resla Barrier. And i tested both triggering unit and ordered unit still the same the loop doesn't run. I send the whole thing.

  • Events
    • Unit - A unit Is issued an order with no target
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Issued order) Equal to (Order(Mana Shield))
      • Then - Actions
        • Set Unit[1] = (Triggering Unit)/(Ordered unit)
        • Trigger - Turn on Telsa barrier loop <gen>
      • Else - Actions
  • Events
    • Time - Every 1.00 seconds of game time
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of |cffd1cd2eT|resla Barrier for Unit[1]) Equal to 1
      • Then - Actions
        • Set Tesla_UnitGroup[1] = (Units within 192.00 of (Position of Unit[1]) matching ((((Matching unit) belongs to an enemy of (Owner of Unit[1])) Equal to True) and (((Matching unit) is alive) Equal to True)))
        • Unit Group - Pick every unit in Tesla_UnitGroup[1] and do (Actions)
          • Loop - Actions
            • Unit - Set mana of Unit[1] to ((Mana of Unit[1]) - 1.00)
            • Unit - Cause Unit[1] to damage (Picked unit), dealing (4.00 x (Mana of Unit[1])) damage of attack type Spells and damage type Lightning
            • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Weapons\Bolt\BoltImpact.mdl
            • Unit - Set mana of Unit[1] to ((Mana of Unit[1]) - (Random real number between 1.00 and 15.00))
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of |cffd1cd2eT|resla Barrier for Unit[1]) Equal to 2
      • Then - Actions
        • Set Tesla_UnitGroup[1] = (Units within 192.00 of (Position of Unit[1]) matching ((((Matching unit) belongs to an enemy of (Owner of Unit[1])) Equal to True) and (((Matching unit) is alive) Equal to True)))
        • Unit Group - Pick every unit in Tesla_UnitGroup[1] and do (Actions)
          • Loop - Actions
            • Unit - Set mana of Unit[1] to ((Mana of Unit[1]) - 1.00)
            • Unit - Cause Unit[1] to damage (Picked unit), dealing (5.00 x (Mana of Unit[1])) damage of attack type Spells and damage type Lightning
            • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Weapons\Bolt\BoltImpact.mdl
            • Unit - Set mana of Unit[1] to ((Mana of Unit[1]) - (Random real number between 1.00 and 15.00))
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of |cffd1cd2eT|resla Barrier for Unit[1]) Equal to 3
      • Then - Actions
        • Set Tesla_UnitGroup[1] = (Units within 192.00 of (Position of Unit[1]) matching ((((Matching unit) belongs to an enemy of (Owner of Unit[1])) Equal to True) and (((Matching unit) is alive) Equal to True)))
        • Unit Group - Pick every unit in Tesla_UnitGroup[1] and do (Actions)
          • Loop - Actions
            • Unit - Set mana of Unit[1] to ((Mana of Unit[1]) - 1.00)
            • Unit - Cause Unit[1] to damage (Picked unit), dealing (7.00 x (Mana of Unit[1])) damage of attack type Spells and damage type Lightning
            • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Weapons\Bolt\BoltImpact.mdl
            • Unit - Set mana of Unit[1] to ((Mana of Unit[1]) - (Random real number between 1.00 and 15.00))
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of |cffd1cd2eT|resla Barrier for Unit[1]) Equal to 4
      • Then - Actions
        • Set Tesla_UnitGroup[1] = (Units within 192.00 of (Position of Unit[1]) matching ((((Matching unit) belongs to an enemy of (Owner of Unit[1])) Equal to True) and (((Matching unit) is alive) Equal to True)))
        • Unit Group - Pick every unit in Tesla_UnitGroup[1] and do (Actions)
          • Loop - Actions
            • Unit - Set mana of Unit[1] to ((Mana of Unit[1]) - 1.00)
            • Unit - Cause Unit[1] to damage (Picked unit), dealing (10.00 x (Mana of Unit[1])) damage of attack type Spells and damage type Lightning
            • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Weapons\Bolt\BoltImpact.mdl
            • Unit - Set mana of Unit[1] to ((Mana of Unit[1]) - (Random real number between 1.00 and 15.00))
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Or - Any (Conditions) are true
          • Conditions
            • (Mana of Unit[1]) Less than or equal to 1.00
            • (Ability being cast) Equal to |cffd1cd2eT|resla Barrier
      • Then - Actions
        • Trigger - Turn off (This trigger)
      • Else - Actions
Well this is the trigger. Thanks for the help!
 
Level 9
Joined
May 22, 2009
Messages
276
Another solution would be making 2 abilities(1 called 'Turn on', 1 called 'Turn off'), when u use one, it dissapears and the other appears, if you use the Turn on one just turn on the trigger, and turn it off when u use the Turn off ability
 
Ok, if you use "Immolation" as the ability, the turn on/off would be "immolation"/"unimmolation" respectively.
If you use "Mana Shield" as the ability, the turn on/off would be "manashieldon"/"manashieldoff" respectively. Exactly the way I write them, without the """.
Now, if you need to know what the order of a unit is, when it casts a certain ability, go to the ability, scroll to Text - Order string and check it.
 
Status
Not open for further replies.
Top