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

Default spell leveled up

Status
Not open for further replies.
Level 9
Joined
Dec 16, 2017
Messages
343
Hi guys, i am new in WE, i want to make a trigger that level's up default skill of all heroes that are used in the map

for example:

Default upg
Events
Unit - A unit Gains a level
Conditions
Actions
Unit - Set level of Warglaive of Azzinoth[Default] for (Leveling Hero) to 2
Unit - Set level of Blade Strike [Default] for (Leveling Hero) to 2
Unit - Set level of Cleaving Attack [Default] for (Leveling Hero) to 2
Unit - Set level of Illusion Split [Default] for (Leveling Hero) to 2
Unit - Set level of Mangekyo Sharingan[Default] for (Leveling Hero) to 2
Unit - Set level of Katon : Gokakyu no Jutsu[Default] for (Leveling Hero) to 2
Unit - Set level of Molten Armor[Default] for (Leveling Hero) to 2
Unit - Set level of Rinnegan[Default] for (Leveling Hero) to 2
Unit - Set level of Orb of Frost [Default] for (Leveling Hero) to 2
Unit - Set level of Mangekyo Sharingan[Default] for (Leveling Hero) to 2
Unit - Set level of Weights Training[Default] for (Leveling Hero) to 2
Unit - Set level of Fel Energy[Default] for (Leveling Hero) to 2


I mention that default skills are labelled as unit spell and they have more then one level, i want them to upgrade when hero gains a certain amount of lvl for example, if hero is lvl 10, upgrade the spell to level 2,if hero is lvl 20, upgrade the spell to level 3, and so on.
I can't find a condition that is something like [level gained equals to 10],is there any alternate way i can do that?
Will it crash because i set all defaults to upgrade at a certain level and even if for example someone doesn't play that hero and is unused?
Thanks !
 
Last edited:
Level 17
Joined
Apr 27, 2008
Messages
2,455
There are several ways to do it, if then elseif where you have all the levels you want to check.
Using an array where the index is the level you want to check.
You can also use the modulo function and the integer result of hero level/level you want to check.
And so one.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,539
Here's a more generic trigger that levels up the Paladin's skills by 1 point whenever he gains a level. Note that doing it like this doesn't spend Skill Points, but you're using Unit abilities anyway, additionally, this won't increase the level of a non-learned Hero skill.
  • Level Up
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Paladin
    • Actions
      • Set Variable TempAbility = Holy Light
      • Unit - Set level of TempAbility for (Triggering unit) to ((Level of TempAbility for (Triggering unit)) + 1)
      • Set Variable TempAbility = Divine Shield
      • Unit - Set level of TempAbility for (Triggering unit) to ((Level of TempAbility for (Triggering unit)) + 1)
      • Set Variable TempAbility = Devotion Aura
      • Unit - Set level of TempAbility for (Triggering unit) to ((Level of TempAbility for (Triggering unit)) + 1)
You can add a Level condition as well (Integer Comparison):
  • (Hero level of (Triggering unit)) Equal to 5
Note that you don't need the TempAbility variable, it just makes things easier:
  • Level Up 2
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Paladin
    • Actions
      • Unit - Set level of Holy Light for (Triggering unit) to ((Level of Holy Light for (Triggering unit)) + 1)
You can also set the level to exactly what you want:
  • Unit - Set level of Holy Light for (Triggering unit) to 3
 
Last edited:
Level 9
Joined
Dec 16, 2017
Messages
343
Thank you all for help !
And if i want to keep it to 1 trigger per hero i tried something like this, it should be ok,no? so i make 1 trigger/per hero

  • Default upg
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to |c00FF7F00Illidan Stormrage|r
          • (Hero level of (Triggering unit)) Greater than or equal to 10
        • Then - Actions
          • Unit - Set level of Illidan-Warglaive of Azzinoth[Default] for (Triggering unit) to 2
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to |c00FF7F00Illidan Stormrage|r
          • (Hero level of (Triggering unit)) Greater than or equal to 20
        • Then - Actions
          • Unit - Set level of Illidan-Warglaive of Azzinoth[Default] for (Triggering unit) to 3
        • Else - Actions
 
Last edited:
Thank you all for help !
And if i want to keep it to 1 trigger per hero i tried something like this, it should be ok,no? so i make 1 trigger/per hero
  • Default upg
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to |c00FF7F00Illidan Stormrage|r
          • (Hero level of (Triggering unit)) Greater than or equal to 10
        • Then - Actions
          • Unit - Set level of Illidan-Warglaive of Azzinoth[Default] for (Triggering unit) to 2
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to |c00FF7F00Illidan Stormrage|r
          • (Hero level of (Triggering unit)) Greater than or equal to 20
        • Then - Actions
          • Unit - Set level of Illidan-Warglaive of Azzinoth[Default] for (Triggering unit) to 3
        • Else - Actions

Yes this is ok, but I'd suggest moving the "unit-type comparison" up to the trigger "conditions" so you only have to check for levels in the "if:s" in the Actions-part.

And yes, one trigger per hero is good to keep the triggers short and clean (easier to overview and modify later if needed).

If you surround your trigger in "[_TRIGGER]<pasted-trigger-here>[_/TRIGGER]" (without the _), it'll show up as in my quoted text of your trigger.
 
Status
Not open for further replies.
Top