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

Reducing mana when unit attacks

Status
Not open for further replies.
Level 4
Joined
May 23, 2007
Messages
78
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.
 
Level 17
Joined
Apr 24, 2005
Messages
762
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?
 
Level 4
Joined
May 23, 2007
Messages
78
umm maybe have a trigger that says when a units mana=0 disable attack both attacks? i'd have to look into it. but something like that might work.
 
Status
Not open for further replies.
Top