• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Spell book (hidden passive abilities)

Status
Not open for further replies.
Level 6
Joined
May 31, 2008
Messages
218
So, i want to make a spell that gives a unit increased attack speed and dodge chance, but since there is no such spell i believe i tried to make it with a spell book. Right now i have a dummy spell, that when you level gives the unit the spell book and sets those spells inside the spell book to a certain level.

But it wont work, and after reading a few threads i still haven't understood how to make it work.

  • Skills of a Drunkard
    • Events
      • Unit - A unit Learns a skill
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned Hero Skill) Equal to (==) Skills of a Drunkard (DWARVES)
          • (Level of Skills of a Drunkard (DWARVES) for (Triggering unit)) Equal to (==) 1
        • Then - Actions
          • Hero - Learn skill for (Triggering unit): Spell Book (DWARVES)
          • Unit - Set level of Attack Speed (DWARVES) for (Triggering unit) to 1
          • Unit - Set level of Dodge (DWARVES) for (Triggering unit) to 1
          • Player - Disable Spell Book (DWARVES) for Player 10 (Light Blue)
        • Else - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Learned Hero Skill) Equal to (==) Skills of a Drunkard (DWARVES)
              • (Level of Skills of a Drunkard (DWARVES) for (Triggering unit)) Equal to (==) 2
            • Then - Actions
              • Player - Enable Spell Book (DWARVES) for Player 10 (Light Blue)
              • Unit - Set level of Attack Speed (DWARVES) for (Triggering unit) to 2
              • Unit - Set level of Dodge (DWARVES) for (Triggering unit) to 2
              • Player - Disable Spell Book (DWARVES) for Player 10 (Light Blue)
            • Else - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Learned Hero Skill) Equal to (==) Skills of a Drunkard (DWARVES)
                  • (Level of Skills of a Drunkard (DWARVES) for (Triggering unit)) Equal to (==) 3
                • Then - Actions
                  • Player - Enable Spell Book (DWARVES) for Player 10 (Light Blue)
                  • Unit - Set level of Attack Speed (DWARVES) for (Triggering unit) to 3
                  • Unit - Set level of Dodge (DWARVES) for (Triggering unit) to 3
                  • Player - Disable Spell Book (DWARVES) for Player 10 (Light Blue)
                • Else - Actions
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Learned Hero Skill) Equal to (==) Skills of a Drunkard (DWARVES)
                      • (Level of Skills of a Drunkard (DWARVES) for (Triggering unit)) Equal to (==) 4
                    • Then - Actions
                      • Player - Enable Spell Book (DWARVES) for Player 10 (Light Blue)
                      • Unit - Set level of Attack Speed (DWARVES) for (Triggering unit) to 4
                      • Unit - Set level of Dodge (DWARVES) for (Triggering unit) to 4
                      • Player - Disable Spell Book (DWARVES) for Player 10 (Light Blue)
                    • Else - Actions
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
You should initially disable the spell book and then not enable it.

You can run this at map initialization. The spell book will be hidden for P1-P12.
  • For each (Integer loopA) from 1 to 12, do (Actions)
    • Loop - Actions
      • Player - Disable some spell book for (Player(loopA))
When the unuit learns ability level 1, you can give it the spell book. The spells inside the spell book will be at level 1.

In your trigger you should set the level of the abilities inside the spell book to the level of learned ability:

  • Unit - Set level of *ability in spell book* for (Triggering unit) to (Learned skill level)
 
Level 5
Joined
Nov 30, 2010
Messages
184
The common era brings about common mistakes...

You can't use learn skill for hero action on a skill that the hero does not originally have (cannot be learned manually). This also applies to the action set level of ability.

Give the hero the ability first and then use the learn action.

This should solve your problem =)
 
Level 6
Joined
May 31, 2008
Messages
218
I will post the map today or tomorrow, been a little busy. Also, if any of you are good at triggers overall, i would be glad if you looked at all my triggers in the map, since i dunno what leaks or if they can be improved.
 
Status
Not open for further replies.
Top