- Joined
- Jun 9, 2019
- Messages
- 15
So I am making an anime themed map and am looking to how to make an ability that activates only when heroes life is low and significantly raises their attributes makes them levitate slightly and changes his color...
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Events

Time - Every 0.50 seconds of game-time
Conditions
Actions

Unit Group - Pick every unit in GROUP_THAT_HAS_ALL_UNITS_WITH_THIS_ABILITY_IN_IT and do (Actions)


Loop - Actions



Set TempUnit = (Picked Unit)



Set LifePct = (Percentage life of TempUnit)



Set BonusActive = ((Level of THIS_ABILITY_GETS_ADDED_WHEN_THIS_IS_ACTIVE) for TempUnit) greater than 0) //BonusActive is a boolean variable



If (All conditions are true) then do (Then actions) else do (Else actions)




If - Conditions





LifePct less than or equal to THRESHOLD_VALUE





BonusActive equal to false




Then - Actions





Unit - Add THIS_ABILITY_GETS_ADDED_WHEN_THIS_IS_ACTIVE to TempUnit





-------- set bonuses here --------





-------- you may need to store the amount of added stats in a variable so you can properly remove them later --------




Else - Actions



If (All conditions are true) then do (Then actions) else do (Else actions)




If - Conditions





LifePct greater than or equal to THRESHOLD_VALUE





BonusActive equal to true




Then - Actions





Unit - Remove THIS_ABILITY_GETS_ADDED_WHEN_THIS_IS_ACTIVE from TempUnit





-------- remove bonuses here --------




Else - Actions
Events

Time - Every 0.50 seconds of game-time
Conditions
Actions

Unit Group - Pick every unit in GROUP_THAT_HAS_ALL_UNITS_WITH_THIS_ABILITY_IN_IT and do (Actions)


Loop - Actions



Set TempUnit = (Picked Unit)



Set LifePct = (Percentage life of TempUnit)



Set BonusLvl = ((Level of FLAG_ABILITY) for TempUnit)



If (All conditions are true) then do (Then actions) else do (Else actions)




If - Conditions





LifePct less than or equal to THRESHOLD_VALUE





BonusLvl equal to 0




Then - Actions





Unit - Add FLAG_ABILITY to TempUnit





-------- Change stats here if you are going to use a trigger, or instead of FLAG_ABILITY add the proper attribute bonus ability --------





-------- --------





-------- this is a trick to make it so you can set the fly height of ground units with a trigger --------





-------- it only has to be done once per unit and then you can set its height at will, which is why this part of the trigger ISN'T in the other if statement below this one --------





Unit - Add Crow Form (Medivh) to TempUnit





Unit - Remove Crow Form (Medivh) from TempUnit





Unit - Set TempUnit fly height to HEIGHT_YOU_WANT at RATE_YOU_WANT_IT_TO_CHANGE





-------- choose your new color here --------





Unit - Set TempUnit vertex color to RED %, GREEN %, BLUE % and 0% transparency




Else - Actions



If (All conditions are true) then do (Then actions) else do (Else actions)




If - Conditions





LifePct greater than or equal to THRESHOLD_VALUE





BonusLvl greater than 0




Then - Actions





Unit - Remove FLAG_ABILITY from TempUnit





-------- remove bonuses here if you used a trigger or instead of FLAG_ABILITY remove the proper attribute bonus ability --------





Unit - Set TempUnit fly height to ORIGNIAL_FLY_HEIGHT at RATE_YOU_WANT_IT_TO_CHANGE





Unit - Set TempUnit vertex color to 100%, 100%, 100% and 0% transparency




Else - Actions
