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

Footman question

Status
Not open for further replies.
Level 4
Joined
Apr 17, 2008
Messages
84
I want to attach mana to the footman that runs out over time. Once the mana is depleted the footman starts to take damage until death. To replenish mana he must stand by a fountain etc...

Is this possible?
 
Very Possible and very easy.
First, edit the Footmans Mana Initial Amount and Maximum: A7.jpg

Next, the trigger:
  • Footman Mana Depletion
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to Footman))) and do (Actions)
        • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Mana of (Picked unit)) Greater than 1.00
        • Then - Actions
          • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - 0.50)
        • Else - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 0.50)
:grin::grin::grin:
 
Level 17
Joined
Apr 13, 2008
Messages
1,608
Sorry, graystuff111, but there is a much easier solution:

Give the footman a negative mana regeneration value in the object editor. Simply hold shift while clicking on the field and you'll be able to enter negative values.

Trigger1:
E: Unit's mana becomes 0.
C: Unit is a footman type unit.
A: Give the unit an ability based on a hp regeneration ability that has negative hp regen.

Trigger2:
You'll have to remove the negative life regen here.
How? It depends on your map. Is your fountain a constructable unit or did you place it in the world editor?
 
Level 17
Joined
Apr 13, 2008
Messages
1,608
Hmm, my bad, I thought you can generalize the Unit's life becomes = x event in GUI but it looks like it's a specific unit event.

Well, you should stick with the negative mana regeneration at all costs, that makes setting the unit's mana in the trigger unnecessary. So you should only use that trigger to check if the mana of a footman is 0 and if it is give it a negative hp regen ability. Oh, and I wouldn't check it every 0.25 sec. every 1 or 2 or 3 sec would be perfect and it would be less strain on the computer's resources.
 
Status
Not open for further replies.
Top