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

[Trigger] help with ability

Status
Not open for further replies.
Level 3
Joined
Aug 20, 2008
Messages
40
i want to replace some hero ability when he has hp below 45/55/65%
can anybody advise how is it better to do similar?
does nobody know how help me?!
 
Last edited:
Level 25
Joined
Jun 5, 2008
Messages
2,573
You should make it as this:

  • Unit is attacked
  • Conditions Attacked unit has an buff/Attacked unit type equals *your_unit*
  • Action
    • set *ability_unit* = attacked unit
    • If/then/else
    • If life of attacked unit equal or lower than attacked units life x 0.65
    • Then Ability Remove *ability1* from attacked unit
      • Ability add *ability2* to attacked unit
    • Else do nothing
    • If life of attacked unit equal or lower than attacked units life x 0.55
    • Then Ability Remove *ability2* from attacked unit
      • Ability Remove *ability1*(if it has it somehow) from attacked unit
      • Ability add *ability3* to attacked unit
    • Else do nothing
    • If life of attacked unit equal or lower than attacked units life x 0.45
    • Then Ability Remove *ability3* from attacked unit
      • Ability Remove *ability1*(if it has it somehow) from attacked unit
      • Ability Remove *ability2*(if it has it somehow) from attacked unit
      • Ability add *ability4* to attacked unit
    • Else do nothing
Reversal:

  • Every 1 second of game
  • Conditions
  • Actions
    • If life of *ability_unit* equal or greater than *ability_unit* units life x 0.45
    • Then Ability Remove *ability4* from attacked unit
      • Ability Remove *ability1*(if it has it somehow) from *ability_unit*
      • Ability Remove *ability2*(if it has it somehow) from *ability_unit*
      • Ability add *ability3* to *ability_unit*
    • Else do nothing
    • If life of *ability_unit* equal or greater than *ability_unit* units life x 0.55
      • Then Ability Remove *ability3* from attacked unit
        • Ability Remove *ability4*(if it has it somehow) from *ability_unit*
        • Ability Remove *ability1*(if it has it somehow) from *ability_unit*
        • Ability add *ability2* to *ability_unit*
  • Else do nothing
    • If life of *ability_unit* equal or greater than *ability_unit* units life x 0.65
      • Then Ability Remove *ability2* from attacked unit
        • Ability Remove *ability4*(if it has it somehow) from *ability_unit*
        • Ability Remove *ability3*(if it has it somehow) from *ability_unit*
        • Ability add *ability1* to *ability_unit*
  • Else do nothing
Should work.
 
Level 3
Joined
Aug 20, 2008
Messages
40
i make as you said but nothing happened or later replacement ability...
approximately on 30% and below =(
 
Level 3
Joined
Aug 20, 2008
Messages
40
Blood Hunger - ability learned name (has 3 lvl)
Berserker - unit that learned
Novice Skills - changed when hp below 45/55/65% (has 4 lvl)

  • Events
    • Unit - A unit Is attacked
  • Conditions
    • Unit-type of (Attacked unit) Equal to Berserker
  • Actions
    • Set bloodhero=(Attacked unit)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Life of bloodhero) Less than or equal to ((Life of bloodhero)x(0.35+(0.10x(Real((Level of Blood Hunger for bloodhero))))))
      • Then - Actions
        • Unit - Set level of Novice Skills berserker forbloodhero to (1+(Level of Blood Hunger for bloodhero))
      • Else - Actions
        • Do nothing
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
You can Make a custom engineering update (lets call it E ability)
put it in a disabled spell book and give that spell book to your hero
in Level 1 it turns B to A (B is the one at lower than % or whatever its)
in Level 2 it turns A to B

When Unit Learns Ability
If its C ability(the one allows you to change abilities)
Add it to YHTA group

Every Second
Pick Every Units in YHTA group
if Picked Units Health is Bellow %(35+(Level of C for Picked Unit)*10)
then
Set Level of E for Picked Unit to 2
else
Set Level of E for Picked Unit to 1

simple no jass no leaks
 
Level 3
Joined
Aug 20, 2008
Messages
40
You can Make a custom engineering update (lets call it E ability)
put it in a disabled spell book and give that spell book to your hero
in Level 1 it turns B to A (B is the one at lower than % or whatever its)
in Level 2 it turns A to B

When Unit Learns Ability
If its C ability(the one allows you to change abilities)
Add it to YHTA group

Every Second
Pick Every Units in YHTA group
if Picked Units Health is Bellow %(35+(Level of C for Picked Unit)*10)
then
Set Level of E for Picked Unit to 2
else
Set Level of E for Picked Unit to 1

simple no jass no leaks


I already tried similar... at different variants identically...
ability does not always change or changes very lately
 
Level 25
Joined
Jun 5, 2008
Messages
2,573
I was trying to make it but it doesn't work, i am going to try a difrent aproach and see if it works, sorry to keep you waiting, difrent time zone + school = busy.

Nevermind here it is:

View attachment 38219

Funny thing, when i first tried to make the same spell for my map, i couldn't figure how, now i guess my skills have improved.
Just instead of setting the level of ability for the dummy unit remove and add ability to your unit, hope this helped you.
 
Last edited:
Level 3
Joined
Aug 20, 2008
Messages
40
I was trying to make it but it doesn't work, i am going to try a difrent aproach and see if it works, sorry to keep you waiting, difrent time zone + school = busy.

I am also busy in an university ^_^
thanks for help me
 
Status
Not open for further replies.
Top