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

[JASS] What values go where??

Status
Not open for further replies.
Level 5
Joined
Aug 15, 2007
Messages
145
JASS:
native SetUnitAbilityLevel takes unit whichUnit, integer abilcode, integer level returns integer

This sets the level of an ability to the level of another units ability right? Only i dont know where each goes??
 
Level 8
Joined
Jun 18, 2007
Messages
214
It would be like this. SetUnitAbilityLevel(SomeUnit, 'A000', 3) . Some unit can be any unit, local of global (GetTriggerUnit(), GetSpellAbilityUnit(), etc) , 'A000' stands for the ability raw code (Ctrl + D to display raw codes in object editor), and 3 is the new level you want to set.
 
Level 8
Joined
Jun 18, 2007
Messages
214
I want to set the level of this ability to the level of another units ability....

1. Way

local integer i = GetUnitAbilityLevel(SomeUnit, 'A000') - SomeUnit is the unit that has the ability, 'A000' being the raw code of the ability.
Then:

call SetUnitAbilityLevell(TargetUnit, 'A000', i) - TargetUnit is the unit you want to change the ability level, 'A000' is the raw code, and i is the integer from the upper post, the level of the ability.

2. Way

call SetUnitAbilityLevel(TargetUnit, 'A000', GetUnitAbilityLevel(SomeUnit, 'A001')) - TargetUnit is the unit you want to change the level of the ability,
'A000' raw code of the first ability (the one that is being changed), SomeUnit the unit that has the ability which you want to use as level, and 'A001' being the rawcode of that ability.

Hope this helps.
 
Status
Not open for further replies.
Top