I made a boss hero with a single level unit ability based on 'Holy Light' and the purpose is to be a self heal for the boss. I made it so that it cant target self (and it works properly) and changed the OrderId string to 'farsight'
Then I made the following trigger in gui, changed it to custom text and filled in the order with the 'farsight' string. Now the trigger is functioning and the boss uses it on himself basically everytime the cooldown is up, however the problem is the FIRST time he uses the ability is life is not yet under the value on the trigger condition "22000.00." The boss units hp is 35500 and he uses the heal the first time when his hp is around 30000.
now that this trigger is not in gui i no longer understand it, so like what would I have to do to make it so that the first heal doesnt happen until his life is less than 22000?
Then I made the following trigger in gui, changed it to custom text and filled in the order with the 'farsight' string. Now the trigger is functioning and the boss uses it on himself basically everytime the cooldown is up, however the problem is the FIRST time he uses the ability is life is not yet under the value on the trigger condition "22000.00." The boss units hp is 35500 and he uses the heal the first time when his hp is around 30000.
now that this trigger is not in gui i no longer understand it, so like what would I have to do to make it so that the first heal doesnt happen until his life is less than 22000?
JASS:
function Trig_boss_protect_2_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 039;Hart039; ) ) then
return false
endif
return true
endfunction
function Trig_boss_protect_2_Func001001 takes nothing returns boolean
return ( GetUnitStateSwap(UNIT_STATE_LIFE, GetTriggerUnit()) < 22000.00 )
endfunction
function Trig_boss_protect_2_Actions takes nothing returns nothing
if ( Trig_boss_protect_2_Func001001() ) then
call IssueTargetOrderBJ( GetTriggerUnit(), "farsight", GetTriggerUnit() )
else
call DoNothing( )
endif
endfunction
//===========================================================================
function InitTrig_boss_protect_2 takes nothing returns nothing
set gg_trg_boss_protect_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_boss_protect_2, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_boss_protect_2, Condition( function Trig_boss_protect_2_Conditions ) )
call TriggerAddAction( gg_trg_boss_protect_2, function Trig_boss_protect_2_Actions )
endfunction