ok i cant seem to get this trigger to work
basically, on every tenth attack the hero makes, he would deal bonus damage. but i cant seem to get it to work!
Code:
function HSC takes nothing returns boolean
return GetAttacker() == 'Huth'
endfunction
function HSA takes nothing returns nothing
if ( udg_I < 10 ) then
set udg_I = (udg_I + 1)
else
call AddSpecialEffectLocBJ( GetUnitLoc(GetAttackedUnitBJ()), "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" )
call AddSpecialEffectLocBJ( GetUnitLoc(GetAttackedUnitBJ()), "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl" )
call UnitDamageTargetBJ( GetAttacker(), GetAttackedUnitBJ(), ( I2R(GetHeroStatBJ(bj_HEROSTAT_INT, GetAttacker(), true)) * 0.08 ), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
set udg_I = 0
endif
endfunction
function HSE takes nothing returns nothing
local trigger t
set udg_I = 0
set t= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ (t, EVENT_UNIT_DAMAGED)
call TriggerAddCondition(t, Condition(function HSC))
call TriggerAddAction(t, function HSA)
endfunction
basically, on every tenth attack the hero makes, he would deal bonus damage. but i cant seem to get it to work!