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

[Spell] Certain conditions make a spell usable

Status
Not open for further replies.
Level 14
Joined
Nov 17, 2010
Messages
1,266
I searched for an answer to this but couldn't find one

Basically I am wondering if there is a way to make an ability that shows up as disabled until a units health gets below a certain point. The spell I want to make is one where it becomes active once the heroes health is below 25% and then deals damage to nearby units equal to the difference between the max life of the hero and the current life while increasing armor and healing over time.

The only problem is that I don't know how to prevent the ability from being used until the Heroes health is below 25%. Any thoughts?
 
Level 14
Joined
Nov 17, 2010
Messages
1,266
Its the actions that is the problem. I can make the ability do what I want with triggers I just want the ability to be inactive as if I didn't have enough mana except instead of checking the mana it would check to see if my health was low enough before becoming clickable.
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
Here is one that may help

  • Untitled Trigger 002
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to <Your ability>
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (% Life of (Triggering unit)) Greater than 25.00
        • Then - Actions
          • Unit - Pause (Triggering unit)
          • Unit - Order (Triggering unit) to Stop
          • Unit - Unpause (Triggering unit)
          • Game - Display Message "Cannot use ability until HP is lower than 25%"
        • Else - Actions
          • Your ability code
Afaik there is no way to disable an ability as if the unit has no mana or is silenced.

However you can utilize Engineering Upgrade to replace a dummy ability with the real one when the unit's HP becomes lower than 25%.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Try this.

I made it so that you can not level the ability when under 25% hp.


  • Untitled Trigger 004
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Level of Critical Strike Dummy for DamageEventTarget) Not equal to 0
      • (Percentage life of DamageEventTarget) Less than 25.00 // This should be (life of unit - damage taken) / max life < 0.25
    • Actions
      • Set u = DamageEventTarget
      • Set i = (Level of Critical Strike Dummy for u)
      • Unit - Remove Critical Strike Dummy from u
      • Unit - Add Shockwave to u
      • Unit - Set level of Shockwave for u to i
      • Unit Group - Add u to CRITGROUP
      • Trigger - Turn on Untitled Trigger 005 <gen>
  • Untitled Trigger 005
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in CRITGROUP and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of (Picked unit)) Greater than or equal to 25.00
            • Then - Actions
              • Set u = (Picked unit)
              • Set i = (Level of Shockwave for u)
              • Unit - Remove Shockwave from u
              • Unit - Add Critical Strike Dummy to u
              • Unit - Set level of Critical Strike Dummy for u to i
              • Unit Group - Remove (Picked unit) from CRITGROUP
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (CRITGROUP is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
  • Untitled Trigger 006
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Critical Strike Dummy
      • (Level of Shockwave for (Triggering unit)) Greater than 0
    • Actions
      • Set u = (Triggering unit)
      • Unit - Remove Critical Strike Dummy from u
      • Hero - Modify unspent skill points of u: Add 1 points
 

Attachments

  • Damage Engine v2.2.1.0.w3x
    33.3 KB · Views: 33
Level 17
Joined
Nov 13, 2006
Messages
1,814
I searched for an answer to this but couldn't find one

Basically I am wondering if there is a way to make an ability that shows up as disabled until a units health gets below a certain point. The spell I want to make is one where it becomes active once the heroes health is below 25% and then deals damage to nearby units equal to the difference between the max life of the hero and the current life while increasing armor and healing over time.

The only problem is that I don't know how to prevent the ability from being used until the Heroes health is below 25%. Any thoughts?

only 1 trick exist for this what look cool and dont need dummy ability add/remove what screw up the spellbook opening, just a dummy unit....

make ability unit depend (techtree requiment a dummy unit with "25% hp" name)
check ur unit hp when going lower than 25% and create a dummy unit for player if dont exist already one, when ur hp going higher then remove the unit and null the variable

dummy unit must be with: no attack, no model file, non visiable in minimap, non movespeed, with locust ability, flying movement, 0 food cost. - this need onyl for make unable too cast the ability and if u check the ability then u can see with yellow letters the unit name (what could be anything like "low hp requiment" or what u want)
 
Status
Not open for further replies.
Top