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

[Trigger] Make AI Heroes select additional skill levels

Status
Not open for further replies.
Level 4
Joined
Dec 12, 2012
Messages
96
Okay, so I made a search on how to create a trigger making AI heroes select additional skills with their unused skill points and the trigger I applied on it doesn't really work and I can barely analyze how this trigger would work.

So here's the thing, a hero in W3 has a max level of 10 normally with 4 Hero Abilities. Three of which can be learned up to level 3 and one ability can only be learned once, which is its ultimate. So I upgraded all these Hero Abilities up to level 5 while the ultimate up to level 3. In addition, I added an attribute bonuses (like in Dota) that can be learned up to level 31. Level of all Heroes are up to 500 (Edited Game Constants).

The problem is, I can't get these AI Heroes learn the added skills, once they reach level 10, they'll stop learning skills.

So here's the trigger I made for AI Heroes selecting attribute bonuses.
  • Ai Heroes Custom skill
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
          • (Owner of (Triggering unit)) Equal to Player 6 (Orange)
          • (Owner of (Triggering unit)) Equal to Player 7 (Green)
          • (Owner of (Triggering unit)) Equal to Player 8 (Pink)
      • (Triggering unit) Equal to (Leveling Hero)
      • (Hero level of (Triggering unit)) Greater than 3
    • Actions
      • For each (Integer A) from 1 to (Unspent skill points of (Triggering unit)), do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to Death Knight
            • Then - Actions
              • Hero - Learn skill for (Triggering unit): Attribute Bonus (Upto 50)
            • Else - Actions
              • Do nothing
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Unit-type of (Triggering unit)) Equal to Paladin
                  • (Unit-type of (Triggering unit)) Equal to Archmage
                  • (Unit-type of (Triggering unit)) Equal to Mountain King
                  • (Unit-type of (Triggering unit)) Equal to Blood Mage
                  • (Unit-type of (Triggering unit)) Equal to Blademaster
                  • (Unit-type of (Triggering unit)) Equal to Far Seer
                  • (Unit-type of (Triggering unit)) Equal to Tauren Chieftain
                  • (Unit-type of (Triggering unit)) Equal to Shadow Hunter
                  • (Unit-type of (Triggering unit)) Equal to Death Knight
                  • (Unit-type of (Triggering unit)) Equal to Lich
                  • (Unit-type of (Triggering unit)) Equal to Dreadlord
                  • (Unit-type of (Triggering unit)) Equal to Crypt Lord
            • Then - Actions
              • Unit - Set level of Attribute Bonus (Upto 50) for (Triggering unit) to 31
            • Else - Actions
              • Do nothing
This is kinda hard for me and hoping to see some assistance with this trigger. Thanks.
 
Level 7
Joined
Nov 15, 2009
Messages
225
Code:
Events: A unit gains a level

Conditions: AND
                   level of triggering unit > 10
                   OR
                      (Owner of triggering unit) = Player (2,6,7,8)
                

Actions: if level of triggering unit = 11
               then Unit - Add ability (Attribute Bonus)
         else
               set level of Attribute Bonus = level of Attribute Bonus + 1


This should fix your problems on a very easy way
If you need a better code, just write again (got the wrong editor language right now^^)
 
Level 4
Joined
Dec 12, 2012
Messages
96
Code:
Events: A unit gains a level

Conditions: AND
                   level of triggering unit > 10
                   OR
                      (Owner of triggering unit) = Player (2,6,7,8)
                

Actions: if level of triggering unit = 11
               then Unit - Add ability (Attribute Bonus)
         else
               set level of Attribute Bonus = level of Attribute Bonus + 1


This should fix your problems on a very easy way
If you need a better code, just write again (got the wrong editor language right now^^)

Actually, i just solved it. Didn't expect I could. Thanks anyway! ;)

  • Mountain King
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Hero level of (Triggering unit)) Greater than or equal to 11
    • Actions
      • For each (Integer A) from 1 to (Unspent skill points of (Triggering unit)), do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to Mountain King
            • Then - Actions
              • Hero - Learn skill for (Triggering unit): Human Mountain King - Storm Bolt
              • Hero - Learn skill for (Triggering unit): Human Mountain King - Thunder Clap
              • Hero - Learn skill for (Triggering unit): Human Mountain King - Bash
              • Hero - Learn skill for (Triggering unit): Human Mountain King - Avatar
              • Hero - Learn skill for (Triggering unit): Attribute Bonus (Upto 50)
            • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top