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

Item exchanges mana for health ?

Level 20
Joined
Aug 29, 2012
Messages
838
This should do the trick:
  • Exchange
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to YourItemAbility
    • Actions
      • Set VariableSet HP = ((Percentage life of (Triggering unit)) x 1.50)
      • Set VariableSet MP = ((Percentage mana of (Triggering unit)) x 0.50)
      • Unit - Set life of (Triggering unit) to HP%
      • Unit - Set mana of (Triggering unit) to MP%
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,578
Your post is too vague to give you a proper solution. Chaosium's suggestion works but I'm certain it's not what you want (we can only guess).

What is 50% mana? Is that current mana or max mana? Do you need more than 50% current mana to use the item in the first place?

What does exchange mean? Is it a 1:1 ratio? If 50% of my current mana is equal to 200 mana, does that mean I gain 200 life?
 
Level 5
Joined
May 8, 2020
Messages
78
Your post is too vague to give you a proper solution. Chaosium's suggestion works but I'm certain it's not what you want (we can only guess).

What is 50% mana? Is that current mana or max mana? Do you need more than 50% current mana to use the item in the first place?

What does exchange mean? Is it a 1:1 ratio? If 50% of my current mana is equal to 200 mana, does that mean I gain 200 life?
it is suppose i have 1000 mana but i used up 500 i still have 500 mana left (so it can be called current mana)
I will trade for 500 mana and my mana will run out
The third one is correct in my opinion
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,578
it is suppose i have 1000 mana but i used up 500 i still have 500 mana left (so it can be called current mana)
I will trade for 500 mana and my mana will run out
The third one is correct in my opinion
Okay, so take Chaosium's trigger and adjust it to use flat values instead of percentages:
  • Exchange
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to YourItemAbility
    • Actions
      • Set VariableSet MP = ((Mana of (Triggering unit)) x 0.50)
      • Unit - Set life of (Triggering unit) to (Life of (Triggering unit) + MP)
      • Unit - Set mana of (Triggering unit) to (Mana of (Triggering unit) - MP)
 
Last edited:
Top