Event - hero gains a level
Condition - integer - level of hero equal to 50
Action - unit - add ability to unit
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'.
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
why wont
work? It will fire when your hero reaches level 50
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)
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:
by the way GetUnitTypeId takes unit and returns its rawcode
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())))
which will load integer from somehashtable saved at 0, unit's raw code, so if you do like:
So when mountain king gets to level 50, he will get ability with Id 'A000'
oninit
Events
Map initialization
Conditions
Actions
Hashtable - Create a hashtable
Set h = (Last created hashtable)
Custom script: call SaveInteger(udg_h, 0, 'Hmkg', 'A000')
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?
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?