• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] adding mulitple of same ability to a unit

Status
Not open for further replies.
i have an ability it has 8 lvls
lvl 1 is .01
lvl 2 is .05
lvl 3 is .10
lvl 4 is .15
lvl 5 is .25
lvl 6 is .50
lvl 7 is .75
lvl 8 is 1.00

now what im trying to achieve is im getting the intelligence of hero (u) then every 20 intel im adding .01 onto tht unit

ex
JASS:
    set T = GetHeroInt( u, true )
    if T < 20 then
    elseif T >= 20 then 
        call UnitAddAbility( u, 'ACev' )
        call SetUnitAbilityLevel(  u, 'ACev', 1 )
    endif

thx to anyone tht can help
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
i have an ability it has 8 lvls
lvl 1 is .01
lvl 2 is .05
lvl 3 is .10
lvl 4 is .15
lvl 5 is .25
lvl 6 is .50
lvl 7 is .75
lvl 8 is 1.00

now what im trying to achieve is im getting the intelligence of hero (u) then every 20 intel im adding .01 onto tht unit

ex
JASS:
    set T = GetHeroInt( u, true )
    if T < 20 then
    elseif T >= 20 then 
        call UnitAddAbility( u, 'ACev' )
        call SetUnitAbilityLevel(  u, 'ACev', 1 )
    endif

thx to anyone tht can help

Firstly, when you try to add an ability that the unit already has, then the game simply ignores it. What exactly does that ability do? What exactly are you asking? You explained what you want to do, but not where you get a problem.
 
heres a pic of his max life modifier
 

Attachments

  • max life modifier.PNG
    max life modifier.PNG
    91.2 KB · Views: 53
Level 21
Joined
Mar 27, 2012
Messages
3,232
no i want it to act like how he does his max life modifier he uses one lvl of ability then the other ex lvl 4 and lvl 3 will give him 9 mine is not for life or for mana

Well basically set up an ability with those levels then. Use something like what I showed for adding levels. If you want to combine different levels, then it's just better to make separate abilities.
lvl 1 is .01
lvl 2 is .05
lvl 3 is .10
lvl 4 is .15
lvl 5 is .25
lvl 6 is .50
lvl 7 is .75
lvl 8 is 1.00
 
Status
Not open for further replies.
Top