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

How to add mana/hitpoints to unit?

Status
Not open for further replies.
Level 37
Joined
Mar 6, 2006
Messages
9,243
The method that bonus systems use is to add item mana/health bonus ability. Give the abilities levels. Make level 0 give 0 bonus. Make the other levels give negative bonuses.

To enable negative values, got to file -preferences and tick the box there.

Then select a data field and press shift + enter to edit the value. Enter a negative value.

Add the ability to the unit, set it's level to something else than 0 and remove the ability right away. The unit will get bonus max hp/mana.

You could make lvl 1 give 1 bonus, lvl 2 2 bonus, lvl 3 4 bonus, lvl 4 8 bonus, lvl 5 16 bonus so the increase can be any value, and you can easily set it to the correct value by using a loop and adding the ability, setting it to the correct level and removing it.

For example +100 hp:

Add, set to level 7, remove (+64)
Add, set to level 6, remove (+32)
Add, set to level 3, remove (+4)

^You can use a loop with that.

And then the unit has +100 max life.
 
The method that bonus systems use is to add item mana/health bonus ability. Give the abilities levels. Make level 0 give 0 bonus. Make the other levels give negative bonuses.

To enable negative values, got to file -preferences and tick the box there.

Then select a data field and press shift + enter to edit the value. Enter a negative value.

Add the ability to the unit, set it's level to something else than 0 and remove the ability right away. The unit will get bonus max hp/mana.

You could make lvl 1 give 1 bonus, lvl 2 2 bonus, lvl 3 4 bonus, lvl 4 8 bonus, lvl 5 16 bonus so the increase can be any value, and you can easily set it to the correct value by using a loop and adding the ability, setting it to the correct level and removing it.

For example +100 hp:

Add, set to level 7, remove (+64)
Add, set to level 6, remove (+32)
Add, set to level 3, remove (+4)

^You can use a loop with that.

And then the unit has +100 max life.


I am not sure if i understood it...

I made it like this and it's didn't work:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Max mana of TempUnit) Less than TempReal
    • Then - Actions
      • Set TempReal = (TempReal - (Max mana of TempUnit))
      • For each (Integer B) from 1 to (Integer(TempReal)), do (Actions)
        • Loop - Actions
          • Unit - Add mana +1 to TempUnit
          • Unit - Set level of mana +1 for TempUnit to 1
          • Unit - Remove mana +1 from TempUnit
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Max mana of TempUnit) Greater than TempReal
        • Then - Actions
          • Set TempReal = ((Max mana of TempUnit) - TempReal)
          • For each (Integer B) from 1 to (Integer(TempReal)), do (Actions)
            • Loop - Actions
              • Unit - Add mana -1 to TempUnit
              • Unit - Set level of mana -1 for TempUnit to 1
              • Unit - Remove mana -1 from TempUnit
        • Else - Actions
Only one thing worked: The life +1 and -1
But mana just does't working.
Its because there is item with ability (book) that permanently increases hitpoints.
But mana has no book for permanent increase as i know right?
Or i just didn't find it?
What ability have i use for the function?
 
Status
Not open for further replies.
Top