- Joined
- Jul 16, 2009
- Messages
- 42
JASS:
function Trig_abilityTrack_Conds takes nothing returns boolean
return GetUnitAbilityLevel(GetAttacker(), 'A002') >=1 and GetRandomInt(1, 100) <= 100
endfunction
function Trig_abilityTrack takes nothing returns nothing
local unit e
local unit d = GetAttacker()
local unit t = GetAttackedUnitBJ()
local integer i = GetUnitAbilityLevelSwapped('A002', d)
if GetWidgetLife(t) > 0 then
set e = CreateUnit(GetOwningPlayer(d), 'h001', GetUnitX(t), GetUnitY(t), 0)
call UnitApplyTimedLife(e, 'BTLF', 1.00)
call UnitAddAbility(e,'A005')
call SetUnitAbilityLevelSwapped( 'A005', e, i )
call IssueTargetOrder( e, "track", t )
else
endif
set e = null
set d = null
set t = null
endfunction
//===========================================================================
function InitTrig_abilityTrack takes nothing returns nothing
set gg_trg_abilityTrack = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_abilityTrack, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_abilityTrack, Condition( function Trig_abilityTrack_Conds ) )
call TriggerAddAction( gg_trg_abilityTrack, function Trig_abilityTrack )
endfunction
so i have the above script and everything seems to work great. it will create the dummy unit at the right place with the right skill at the right lvl. but for some reason it wont cast it. This is a passive version of the track in dota made using fairie fire. i changed the use/turnon to 'track' and activate to 'trackon' ive even tried manually casting and it works. but the line
call IssueTargetOrder( e, "track", t )
doesn't seem to work. any help will be much appreciated. if you need any more info on the situation please ask an di will provide it.