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

Increase a hero's max health

Status
Not open for further replies.
You need to trigger it and using an editor's bug.

You'll have a dummy ability that will do nothing except being shown on the unit (so, the ability the player will see).

Then, when a player learns that ability, you should use a bug of the Mana/Life Bonus item abilities (you can either find how to use it by searching in the forums or finding a system that can do it)
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
if u need a light jass into header then:

(dont forget preload the hp/mp ability else will be a good lagg when u do 1st time)
  • Untitled Trigger 002
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Abilities2[1] = Add HP
      • Set Abilities2[2] = Add MP
copy this to header
JASS:
function AddHPMP takes boolean HP, integer v, unit u returns nothing
    local integer a
    local integer s
    local integer i
    local integer l
    local integer cv
    local integer mv

    if HP then
        set a = udg_Abilities2[1]
    else
        set a = udg_Abilities2[2]
    endif

    if ( v >= 0 ) then
        set s = 1
        set cv = v
    else
        set s = 5
        set cv = v * - 1
    endif
    set mv = cv - ( cv / 1000 ) * 1000
    set l = cv / 1000
    set i = 1
    loop
        exitwhen i > l
        call UnitAddAbility( u, a )
        call SetUnitAbilityLevel( u, a, ( 4 + s ) )
        call UnitRemoveAbility( u, a )
        set i = i + 1
    endloop
    set cv = mv
    set mv = cv - ( cv / 100 ) * 100
    set l = cv / 100
    set cv = mv
    set i = 1
    loop
        exitwhen i > l
        call UnitAddAbility( u, a )
        call SetUnitAbilityLevel( u, a, ( 3 + s ) )
        call UnitRemoveAbility( u, a )
        set i = i + 1
    endloop
    set mv = cv - ( cv / 10 ) * 10
    set l = cv / 10
    set cv = mv
    set i = 1
    loop
        exitwhen i > l
        call UnitAddAbility( u, a )
        call SetUnitAbilityLevel( u, a, ( 2 + s ) )
        call UnitRemoveAbility( u, a )
        set i = i + 1
    endloop
    set i = 1
    loop
        exitwhen i > cv
        call UnitAddAbility( u , a )
        call SetUnitAbilityLevel( u, a, ( 1 + s ) )
        call UnitRemoveAbility( u, a )
        set i = i + 1
    endloop
    set u = null
endfunction

then during game u can use easily like this

  • Untitled Trigger 002
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • Set unit = (Triggering unit)
      • -------- true = add hp/false = add mp, how much, what unit --------
      • -------- its mean i add 100 hp --------
      • Custom script: call AddHPMP (true, 100, udg_unit)
      • -------- i decrease with 150 hp --------
      • Custom script: call AddHPMP (true, -150, udg_unit)
      • -------- i add same mana than how much is A --------
      • Set A = 200
      • Custom script: call AddHPMP (false, udg_A, udg_unit)
screemshot show u how to set the hp ability (mp ability is same too), and u can base to Item Life Bonus (least)/Item Mana Bonus (least) item ability
 

Attachments

  • 1111.JPG
    1111.JPG
    137.3 KB · Views: 277
Status
Not open for further replies.
Top