• 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 force heroes to level up ability?

Level 8
Joined
Nov 24, 2016
Messages
218
Hi, im trying to make a trigger that would do something like this:
After training certain type of hero (like paladin), game would automaticly put his level 1 skill point into divine shield, and i want it to work for all players on the map, so if anyone at any point decides train paladin, first skill it will learn is divine shield.

Screen shoot is of my trigger that dont work.
 

Attachments

  • obraz_2025-01-12_195441657.png
    obraz_2025-01-12_195441657.png
    35.8 KB · Views: 5

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Edit: See my last post.

That Event has a special function specific to it:
1736708222213.png

I don't know why, it's pretty stupid.

So something like this works:
  • Events
    • Unit - A unit Finishes training a unit
  • Conditions
    • (Trained unit-type) Equal to Paladin
  • Actions
    • ... Do stuff
Alternatively, you can do this but it's less efficient:
  • Events
    • Unit - A unit enters (Playable map area)
  • Conditions
    • (Triggering unit) Equal to Paladin
  • Actions
    • ... Do stuff
This should* only run once per unit.
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
what do you mean about second trigger? it will only on 1 paladin?
A unit should only "Enter the playable map area" one time, assuming you don't move it out of bounds and back into the map.

But entering a normal Region can happen multiple times:
  • Events
    • Unit - A unit enters My Region <gen>
  • Conditions
    • (Triggering unit) Equal to Paladin
  • Actions
    • ... Do stuff
 
Level 8
Joined
Nov 24, 2016
Messages
218
also first trigger does not work, he doesn't learn any skill when trained
 

Attachments

  • obraz_2025-01-12_200757192.png
    obraz_2025-01-12_200757192.png
    29.3 KB · Views: 5

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
also first trigger does not work, he doesn't learn any skill when trained
I made a mistake, you just need to reference (Trained unit) instead of (Triggering unit).
(Triggering unit) refers to the Altar or whatever building made the Hero. (Trained unit) refers to the Hero.

This works:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Paladin
    • Actions
      • Hero - Learn skill for (Trained unit): Divine Shield
So use (Trained unit) for the Finishes training Event and (Triggering unit) for the Enters playable map area Event.

The (Trained unit-type) function I mentioned earlier is used with the the Begins/Cancels training Events.
 
Last edited:
Level 8
Joined
Nov 24, 2016
Messages
218
it works, thank you! also is there a way to make hero learn certain abilities past lvl 1? something like : paladin gets lvl 2 and learns holy light, level 3 aura etc.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
it works, thank you! also is there a way to make hero learn certain abilities past lvl 1? something like : paladin gets lvl 2 and learns holy light, level 3 aura etc.
You use the "Gains a level" Event:
  • Events
    • Unit - A unit Gains a level
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Paladin
  • Actions
    • Set Variable Lvl = (Hero level of (Triggering unit))
    • If Lvl Equal to 2 then do (Hero - Learn skill for (Triggering unit): Holy Light) else do (Do nothing)
    • If Lvl Equal to 3 then do (Hero - Learn skill for (Triggering unit): Divine Shield) else do (Do nothing)
    • If Lvl Equal to 4 then do (Hero - Learn skill for (Triggering unit): Devotion Aura) else do (Do nothing)
 
Level 8
Joined
Nov 24, 2016
Messages
218
Something like this without set variable is okay?
Edit: I mean it works as intended but is variable needed?
 

Attachments

  • 1736711462864.png
    1736711462864.png
    62.3 KB · Views: 3
Top