• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

skill wont cast. JASS help

Status
Not open for further replies.
Level 4
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.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Check these things:

1) The dummy has enough mana
2) Some spells can't be cast on units that do not meet certain criteria, like they are not enemies/allies. Makse sure the target is valid.
3) 1 second is enough time for the dummy to cast the spell.
4) Make sure "track" is the correct order string. Create a trigger that displays the order string above your unit when you manually cast the spell.
 
Status
Not open for further replies.
Top