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

Reducing mana when unit attacks

Status
Not open for further replies.
thats easy. lemme see if i can do all the WE lingo here
Event) a unit is attacked
Condition) (you may need a condition if the mana reduction is a specific type of unit)
Action) Set Mana of attacking units Mana to Current Mana-1

This last part is somewhat tricky but heres how you do it, you need to start off with Unit-Set Mana (to Value)

Now change the triggering unit value to attacking unit.

Next click on the 0 value and instead of inserting a number click on the function button that has arithmetic labeled to it

Now you should have 0 + 0 as editable values you want to change the first part to Unit-property. That should show up as Current Life of Triggering unit. Change Life function to mana and triggering to attacking.

Click ok for that portion only. It'll read Mana of Attacking unit + 1.00 change the + to a minus. and now you're ready to click ok.

Finally if you look at your actions trigger it should read Unit - Set mana of (Attacking unit) to ((Mana of (Attacking unit)) - 1.00)
That should get you what you need.
 
Before i asked the question i did something like that, but all it did was drain all of the attacking units mana not -1, but ill try urs maybe its different

EDIT: i figured out my problem... I accidentaly put the set mana of attacking unit to mana of triggering unit - 1. So everything is ok now

EDIT again: Is it possible to make that if the unit is out of mana it cannot attack anymore? and when he restores mana h can attack?
 
Status
Not open for further replies.
Back
Top