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

[Trigger] Unit Loses mana while Repairing.

Status
Not open for further replies.
Level 6
Joined
Jul 26, 2004
Messages
210
Alright, I have a trigger setup that causes a unit to lose 1 mana every 2 seconds when/if the unit casts the ability repair(human). Now for the issue... The trigger works fine if the unit has to MOVE from location to location to repair/build structures, but if the unit does not have to MOVE in order to repair/build a structure the mana lost every 2 seconds is increased. An example of when a unit does not have to move in order to repair/build something is if the unit is ordered to build two structures right next to each other using shift + order.

Here is the trigger I currently have setup.
  • Building
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Repair (Human)
          • (Current order of (Triggering unit)) Equal to (Order(repair))
    • Actions
      • Trigger - Add to (This trigger) the event (Time - Every 2.00 seconds of game time)
      • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) - 1.00)
      • Wait 1.00 game-time seconds
      • Trigger - Run (This trigger) (checking conditions)


So basically what im asking for is maybe an alternate trigger or something i need to add, another trigger perhaps. Something to fix this so that it works the way i would like it to, as long as a unit is building it will lose 1 mana ever 2 seconds.
 
Last edited:
no, gold and lumber do not need to be spent to repair, only for the initial build. Would you mind explaining this modified drain heal briefly? I might add that i am wanting the peasant's mana to be drained while he is repairing/constructing a structure, not the structures, just to clear things up a bit.
 
Once again I solved my own problem -.- heh. Heres the new trigger.

  • Building
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Repair (Human)
          • (Current order of (Triggering unit)) Equal to (Order(repair))
    • Actions
      • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) - 1.00)
      • Wait 2.00 game-time seconds
      • Trigger - Run (This trigger) (checking conditions)
 
I have to say, thank you for this trigger, it works well and it fits perfectly into my game (I hadn't even thought of it).

I have found one problem with it, and I wanted to ask if you had figured this problem out, and if you had figured out a solution.

If you instead just right click on a damaged building your unit will repair it but it won't drain mana.

I think this might be because the unit is power building instead of repairing, but I don't know how to solve that. Any ideas (sorry for jacking the thread, but I thought you might be interested in this problem).
 
Status
Not open for further replies.
Back
Top