jackall
You can change this now in User CP.
- Reaction score
- 37
I have no idea why but it only damages the target once for 5% of their HP.
This is the function that does the damage.
This is where I'm using it.
This is the function that does the damage.
JASS:
function HPPercentDamage takes unit source, unit target, real percent, boolean currHP, attacktype at, damagetype dt returns nothing
local real dmg
if currHP then
set dmg = GetUnitState(target,UNIT_STATE_LIFE)*percent
else
set dmg = GetUnitState(target,UNIT_STATE_MAX_LIFE)*percent
endif
call BJDebugMsg(R2S(dmg))
call UnitDamageTarget(source,target,dmg,true,false,at,dt,WEAPON_TYPE_WHOKNOWS)
endfunction
This is where I'm using it.
Trigger:
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- tmpReal Less than or equal to 0.20
- (Unit-type of tmpUnit) Equal to Spell Tower
- Then - Actions
- Custom script: call CreateDummy(udg_tmpUnit,udg_tmpUnit2,'h003',udg_tmpInt,'A00A',"entanglingroots")
- For each (Integer A) from 1 to 5, do (Actions)
- Loop - Actions
- Custom script: call HPPercentDamage(udg_Dummy[udg_tmpInt-1],udg_tmpUnit2,.05,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL)
- Wait 1.00 game-time seconds
- Loop - Actions
- Custom script: set noRoots=false
- Else - Actions
- Custom script: set noRoots=true
- If - Conditions