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!
Do you want it to be % or flat, can the Hero die from sacrifing life for mana? Level scaling? LUA, JASScode, GUI?
Some extra details would be for sure helpful the good news is this should be fairly easy to make.
EDIT:
Here is a simple spell using flat values, since it runs instantly there is no need for any fancier things.
Spell Setup
Events
Map initialization
Conditions
Actions
-------- Set up values in map ini or any of your "Start" triggers --------
-------- Should do this for all spells which uses a constant value --------
Set VariableSet ManaGain[1] = 75.00
Set VariableSet ManaGain[2] = 100.00
Set VariableSet ManaGain[3] = 125.00
Mana for Life
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Mana Gain
Actions
-------- Get the level --------
Set VariableSet Level = (Level of Mana Gain for (Triggering unit))
-------- Prevent unit from dying from cast --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Life of (Triggering unit)) Less than ManaGain[Level]
Then - Actions
Unit - Order (Triggering unit) to Stop.
Game - Display to (All players) the text: Not enough life to ...
Else - Actions
Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - ManaGain[Level])
Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + ManaGain[Level])
DoomBlade's way will work but here's how I implemented it in one of my maps. I based it off the Channel ability and I called it Life Burn. Burns 10% health to generate equal points in mana. Casting below 10% health can kill the hero. Higher ranks decrease cooldown and mana cost. I used this icon and added this sfx as Art - Caster in Object Editor. Currently the only benefit of going up in rank is a slower cooldown. Not sure this is the most fun way of doing it for players.
Life Burn Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Life Burn (E)
Actions
Set VariableSet pyro_burnt_PN = (Player number of (Owner of (Casting unit)))
Set VariableSet pyro_burnt_hp[pyro_burnt_PN] = ((Max life of Knight_Hero_Var[pyro_burnt_PN]) x 0.10)
Unit - Set life of Knight_Hero_Var[pyro_burnt_PN] to ((Life of Knight_Hero_Var[pyro_burnt_PN]) - pyro_burnt_hp[pyro_burnt_PN])
Unit - Set mana of Knight_Hero_Var[pyro_burnt_PN] to ((Mana of Knight_Hero_Var[pyro_burnt_PN]) + pyro_burnt_hp[pyro_burnt_PN])
I basically do the same thing for my "Cup of Blood" item in my map (but I have jass functions to show mana-text (my heal-text function does not work with negative values when I did this, so need to do it manually)).
AND I allow the hero to die and spawn a demon if that happens...
CupOfBloodOnUse
Events
Unit - A unit Uses an item
Conditions
(Item-type of (Item being manipulated)) Equal to Cup of Blood
Actions
Set temp_unit = (Hero manipulating item)
Set temp_point = (Position of temp_unit)
-------- +hp --------
Unit - Set life of temp_unit to ((Life of temp_unit) - 125.00)
Floating Text - Create floating text that reads -125 at temp_point with Z offset 80.00, using font size 8.00, color (50.00%, 75.00%, 25.00%), and 25.00% transparency
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 0.65 seconds
Floating Text - Change the fading age of (Last created floating text) to 0.50 seconds
Floating Text - Set the velocity of (Last created floating text) to (128.00 + (Random real number between 0.00 and 32.00)) towards (75.00 + (Random real number between 0.00 and 30.00)) degrees
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Life of temp_unit) Less than or equal to 0.00
Then - Actions
Unit - Create 1 Clicky Daemon [Boss 4 Summoned] for Player 9 (Gray) at temp_point facing Default building facing degrees
Do you want it to be % or flat, can the Hero die from sacrifing life for mana? Level scaling? LUA, JASScode, GUI?
Some extra details would be for sure helpful the good news is this should be fairly easy to make.
EDIT:
Here is a simple spell using flat values, since it runs instantly there is no need for any fancier things.
Spell Setup
Events
Map initialization
Conditions
Actions
-------- Set up values in map ini or any of your "Start" triggers --------
-------- Should do this for all spells which uses a constant value --------
Set VariableSet ManaGain[1] = 75.00
Set VariableSet ManaGain[2] = 100.00
Set VariableSet ManaGain[3] = 125.00
Mana for Life
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Mana Gain
Actions
-------- Get the level --------
Set VariableSet Level = (Level of Mana Gain for (Triggering unit))
-------- Prevent unit from dying from cast --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Life of (Triggering unit)) Less than ManaGain[Level]
Then - Actions
Unit - Order (Triggering unit) to Stop.
Game - Display to (All players) the text: Not enough life to ...
Else - Actions
Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - ManaGain[Level])
Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + ManaGain[Level])
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.