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

How to add skill in specific level

Status
Not open for further replies.
Level 13
Joined
Jun 3, 2011
Messages
1,058
HI i want to know how to make a trigger that for example when a hero is level 50 then a skill will be added? how can i make that? and if a hero is level not leveling to 50 a skill will be added
 
Level 13
Joined
Jun 3, 2011
Messages
1,058
Then with the condition, instead of 'equal to' use 'greater than' if you want that trigger to take action when the level of the hero is over level 50.
If you want to check for a lower level than 50 then use 'less than'.

My Level Cap is to 50
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
This handles units that level to 50 or are lvl 50 when the map starts.


  • Untitled Trigger 001
    • Events
      • Map initialization
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to No unit
        • Then - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Paladin
                  • (Level of (Picked unit)) Equal to 50
                • Then - Actions
                  • Unit - Add Acid Bomb to (Picked unit)
                • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to Paladin
              • (Level of (Triggering unit)) Greater than or equal to 50
            • Then - Actions
              • Unit - Add Acid Bomb to (Triggering unit)
            • Else - Actions
 
Level 17
Joined
Mar 21, 2011
Messages
1,597
or just add the ability to the unit and give it an upgrade. so it will be disabled until you get the upgrade.
then do a trigger.. blablabla unit reaches lvl 50 -> set level of upgrade to 1
so it will "unlock" the ability at lvl 50
 
Level 13
Joined
Jun 3, 2011
Messages
1,058
or just add the ability to the unit and give it an upgrade. so it will be disabled until you get the upgrade.
then do a trigger.. blablabla unit reaches lvl 50 -> set level of upgrade to 1
so it will "unlock" the ability at lvl 50

Naaa don't know how to make that thats too hard core i will do the Trigger mwahhahaha
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
why wont
  • add
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Hero level of (Triggering unit)) Equal to 50
    • Actions
      • Unit - Add Acid Bomb to (Triggering unit)
work? It will fire when your hero reaches level 50

You can do some ifs in the actions to see what unit type the unit is or just load the spell from hashtable which is saved in as a unittypeID for different units so something like this:

  • add
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Hero level of (Triggering unit)) Equal to 50
    • Actions
      • Custom script: call UnitAddAbility(GetTriggerUnit(), LoadInteger(somehashtable, 0, GetUnitTypeId(GetTriggerUnit())))
by the way GetUnitTypeId takes unit and returns its rawcode
which will load integer from somehashtable saved at 0, unit's raw code, so if you do like:

  • oninit
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set h = (Last created hashtable)
      • Custom script: call SaveInteger(udg_h, 0, 'Hmkg', 'A000')
So when mountain king gets to level 50, he will get ability with Id 'A000'
 
Level 13
Joined
Jun 3, 2011
Messages
1,058
why wont
  • add
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Hero level of (Triggering unit)) Equal to 50
    • Actions
      • Unit - Add Acid Bomb to (Triggering unit)
work? It will fire when your hero reaches level 50

You can do some ifs in the actions to see what unit type the unit is or just load the spell from hashtable which is saved in as a unittypeID for different units so something like this:

  • add
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Hero level of (Triggering unit)) Equal to 50
    • Actions
      • Custom script: call UnitAddAbility(GetTriggerUnit(), LoadInteger(somehashtable, 0, GetUnitTypeId(GetTriggerUnit())))
by the way GetUnitTypeId takes unit and returns its rawcode
which will load integer from somehashtable saved at 0, unit's raw code, so if you do like:

  • oninit
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set h = (Last created hashtable)
      • Custom script: call SaveInteger(udg_h, 0, 'Hmkg', 'A000')
So when mountain king gets to level 50, he will get ability with Id 'A000'

I don't really get it i don't use custom scripts that much don't have any clue what does that mean
 
Level 13
Joined
Jun 3, 2011
Messages
1,058
erm, I maybe misunderstood the question, so you mean you want to make lets say a shop which sells abilities but if I buy it and Im not level 50 I will get nothing or when I hit 50 level I will get ability automatically?

Not exactly... If your level is 50 you will get a Skill
 
Level 13
Joined
Jun 3, 2011
Messages
1,058
so you say not exactly than you say the very same thing I said, so when your hero hits level 50 he will get ability right?

Yes thats exactly what i meant but i have asked about when he is level to 50 and when he is level 50 he will get the skill. Because my save and load don't saves skills that's why i am asking
 
Status
Not open for further replies.
Top