• 🏆 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!

hero learns skill on level-up

Status
Not open for further replies.
Level 4
Joined
Jul 18, 2008
Messages
76
How can i make this trigger?
i tried it myself but didnt get it to work.

Ive got a Hero named "Warrior" and a skill named "Shield Reflection".

No hero in this map will have spells to learn, but i want to make triggers that gives skills to heroes on level-up.

So, when this Warrior reaches level 2 i want him to recieve the spell Shield Reflection.

+rep for helpers :)
 
Level 10
Joined
Nov 3, 2009
Messages
686
Learn

  • Unit
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Warrior
      • (Level of (Triggering unit)) Equal to 2
    • Actions
      • Unit - Add Shield Reflection to (Triggering unit)
Increase Level

  • Unit
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Warrior
      • (Level of (Triggering unit)) Equal to 3
    • Actions
      • Unit - Set level of Shield Reflection of (triggering unit) to 2
With Increase level i think i made mistake but its should be Set Level.. :)

+REP if helped
 
Level 22
Joined
Feb 3, 2009
Messages
3,292
Learn

  • Unit
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Warrior
      • (Level of (Triggering unit)) Equal to 2
    • Actions
      • Unit - Add Shield Reflection to (Triggering unit)
Increase Level

  • Unit
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Warrior
      • (Level of (Triggering unit)) Equal to 3
    • Actions
      • Unit - Set level of Shield Reflection of (triggering unit) to 2
With Increase level i think i made mistake but its should be Set Level.. :)

+REP if helped

Don't ask for +rep, and anyway he already said in the first post that he will rep for help...
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Omg noobs did I ask for rep ? Just said +REP if helped!

To me that sounds like asking for rep.

And to actually add something to this thread, I'd squeeze things into one trigger.

  • Untitled Trigger 053
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Blood Mage
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of (Triggering unit)) Equal to 2
        • Then - Actions
          • Unit - Add Acid Bomb to (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Level of (Triggering unit)) mod 2) Equal to 0
              • (Level of Acid Bomb for (Triggering unit)) Less than 3
            • Then - Actions
              • Unit - Increase level of Acid Bomb for (Triggering unit)
            • Else - Actions
When you level to level 2, you get Acid bomb. After that, when you level to level 4 and 6, you increase the level of the ability. This is done by utilizing modulo function.

If the (level of unit / 2) produces an integer, then the unit gains a level for that ability. For example

3/2 = 1,5 -> does not gain a level
4/2 = 2 -> gains a level
5/2 = 2,5 -> does not gain a level
6/2 = 3 -> gains a level

The same way (x mod 3) would make you gain a new level at hero level 3, 6 and 9.

So with modulo, you can easily make the unit gain a level for the ability only after x amount of level gains.

You should also make sure that you don't increase the level of the ability higher than what the max level for the ability is, since you seem to loose the mana cost from the tooltip in that case.
 
Status
Not open for further replies.
Top