HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger Help.

04-17-2004, 02:28 AM#1
DoCa-Cola
I made this trigger for a map I am making, But for some reason, when the unit attacks the spell doesn't cast. It's really confusing because it should (I think...) If any of you can tell me what I'm doing wrong I would greatly appreciate it.

-DoCa

Code:
function Trig_Untitled_Trigger_001_Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetAttacker()) == 'hgtw' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    call IssueImmediateOrderById( GetAttacker(), 'A000' )
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Untitled_Trigger_001, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddCondition( gg_trg_Untitled_Trigger_001, Condition( function Trig_Untitled_Trigger_001_Conditions ) )
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction
04-17-2004, 12:44 PM#2
AIAndy
The order id is unfortunately not equal to the ability id. You can find out that id either by using that order yourself, catching that order with a trigger and then displaying the id or if the base ability has an order string you can use OrderId("whatever the order string is") or just use the order native for strings.