• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your 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:
Level 6
Joined
Jul 26, 2004
Messages
210
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.
 
Level 6
Joined
Jul 26, 2004
Messages
210
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)
 
Level 4
Joined
Jun 30, 2008
Messages
92
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.
Top