• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Need help !!!

Status
Not open for further replies.
Level 10
Joined
Sep 6, 2007
Messages
440
I'm working on a spell which is an aura of slow based on endurance aura, but I want it to trigger when the heros hp is below %50. I got 2 skills while the one is a dummy that needs a unit named At most %50 hp. But I don't know how can I make it work in triggers.
Basically all I want to do is make an aura that activates when heros hp is below %50.:hohum: In GUI please :D Will someone help me!!?!?!? XD
 
Last edited:
Level 21
Joined
Aug 21, 2005
Messages
3,699
Basically, you can use a spellbook ability with 2 levels. In level 1 you put no spell, in level 2 you put the modified Endurance aura.
Add "MyspellBookAbility" to your hero in the object editor.

Then, you disable the spellbook at Map Initialization.
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • Player - Disable MySpellbookAbility for (Picked player)
Then you create a trigger that increases the level of the spellbook when your unit's HP is under 50%; and decreases the level when your unit's HP is over 50%.

e.g.
(warning: leaks unit group)
  • Events
    • Time - Every 0,1 seconds of game time
  • Conditions
  • Actions
    • Unit - pick every unit of unit type YourHero and do actions
      • Loop - Actions
        • If (all conditions are true) then do (then actions) else do (else actions)
          • If - Conditions
            • Picked unit's HP <50%
          • Then - Actions
            • Unit - Ability - Set level of MySpellBookAbility to 2 for picked unit
          • Else - Actions
            • Unit - Ability - Set level of MySpellbookAbility to 1 for picked unit
For *eye candy* you can create a dummy ability based off e.g. Critical Strike for the hero.
 
Level 10
Joined
Sep 6, 2007
Messages
440
Ah, the unit picks... Thank you so much I didn't even think about them. Great ideas! I was thinking for that for 2 days O_O. + rep ! Oh what will happen if my aura has more than 1 level? :p? It doesn't accept hero skills. I'm trying to make it for a hero :p. Sorry I missed that little detail.
 
Last edited:
Level 21
Joined
Aug 21, 2005
Messages
3,699
In that case, you make the dummy critical strike ability to have n (e.g. 3) levels, and the endurance aura inside the spellbook have 3 levels too.

  • Events
    • Time - Every 0,1 seconds of game time
  • Conditions
  • Actions
    • Unit - pick every unit of unit type YourHero and do actions
      • Loop - Actions
        • If (all conditions are true) then do (then actions) else do (else actions)
          • If - Conditions
            • Picked unit's HP <50%
          • Then - Actions
            • Unit - Ability - Set level of MySpellBookAbility to 2 for picked unit
          • Else - Actions
            • Unit - Ability - Set level of MySpellbookAbility to 1 for picked unit
This trigger is still the same (and the Map Initialization trigger is still required too)

  • Events
    • Unit - a unit learns a skill
  • Conditions
    • Learned skill is equal to "TheDummyAbility"
  • Actions
    • Unit - Ability - set level of (ModifiedEnduranceAura) to level of "TheDummyAbility"
ModifiedEnduranceAura being the endurance aura inside the spellbook and "TheDummyAbility" the passive ability based on e.g. Critical Strike.

I'm not entirely sure if that works, but you could test it by not disabling the spellbook ability yet and simply opening the book to see the level of endurance aura.

Razorbrain if you can think of a better solution (I wouldn't be surprised if you could ;)), feel free to post it anyway
 
Level 10
Joined
Sep 6, 2007
Messages
440
Is that make a difference if abilitys class is changed? Like that was supposed to be a hero ability but I change it to an unit ability.
[EDIT] Trigger won't work due to the spellbook itself. Also tooltips won't show and also trigger itself didn't even work!!! :O Razorbrain, what was your idea? :D Perhaps it can have some use to me.
 
Last edited:
Level 21
Joined
Aug 21, 2005
Messages
3,699
I changed the critical strike dummy into devotion aura dummy for technical reasons and solved a small bug in the trigger. However, even with the bug everything worked fine here...

The triggers are nothing too fancy and probably can be done better, but that's not my job.
 

Attachments

  • slowaura.w3x
    18.4 KB · Views: 33
Status
Not open for further replies.
Top