• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

decrease unit mana by action?

Status
Not open for further replies.
Level 4
Joined
Nov 25, 2010
Messages
59
have anyone played raijin in dota? well if you dont, his skill is travelling to targeted area by lightning speed. It cost no mana, but after the unit reach the targeted area, his mana will be decreased as far as his distance. So the mana will be decrease bases on how far he travelled

can i decrease unit mana by action trigger? if can, tell me how to to that..
thanks b4 :grin::grin:
 
Level 13
Joined
Jun 1, 2008
Messages
360
Use the ability 'Item Mana Bonus'
Set 2 levels. Set mana bonus on level 1 to 1, on level 2 to 0.

Then via triggers:
Add the ability
Set level of ability to 2
Remove the ability

Then the unit has permanently +1 mana.

To make this more efficient create spells with +1, +2, +4 etc..
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
For clearer view, here is it:

  • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) - (Distance x ConstantValueForDecreasingMana))
Something like that, the formula is just CurrentMana - ManaUsed = SetCurrentManaOfUnit

You should see a function that "Reduce Mana of Unit" but instead, Blizzard provide "Set Mana of Unit" where you can set it by using your own formula, equal to "Reduce Mana of Unit" function :)

Just, math.
 
Status
Not open for further replies.
Top