HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

ack hair pulling time

03-14-2004, 12:15 PM#1
jardragon901
this is a type of teleport attack trigger I'm trying to make but it always gives me compile errors and I'm not sure what is exactly wrong. Most of the compile errors are "Expected a name" :\ .

Code:
function Trig_Silent_Death_1_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A000' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Silent_Death_1_Func012Func002Func004001001003 takes nothing returns boolean
    return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(hero)) == true )
endfunction

function Trig_Silent_Death_1_Func012Func002Func005002001001003001 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_DEAD) == false )
endfunction

function Trig_Silent_Death_1_Func012Func002Func005002001001003002 takes nothing returns boolean
    return ( IsUnitEnemy(GetFilterUnit(), returnplayer(hero)) == true )
endfunction

function Trig_Silent_Death_1_Func012Func002Func005002001001003 takes nothing returns boolean
    return GetBooleanAnd( Trig_Silent_Death_1_Func012Func002Func005002001001003001(), Trig_Silent_Death_1_Func012Func002Func005002001001003002() )
endfunction

function Trig_Silent_Death_1_Func012Func002C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(GetUnitsInRangeOfLocMatching(400.00, GetUnitLoc(summon), Condition(function Trig_Silent_Death_1_Func012Func002Func004001001003))) > 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Silent_Death_1_Actions takes nothing returns nothing
    local unit hero
    local unit summon
    set hero = GetSpellAbilityUnit()
    set summon = gg_unit_o000_0055
    call PauseUnitBJ( true, hero )
    call SetUnitInvulnerable( hero, true )
    call ShowUnitHide( hero )
    call SetUnitPositionLocFacingBJ( summon, hero, GetUnitFacing(hero) )
    call SetUnitOwner( summon, GetOwningPlayer(hero), true )
    call SetUnitVertexColorBJ( summon, 100, 100, 100, 50.00 )
    call UnitAddAbilityBJ( udg_spelldamage[0], summon )
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 10
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        call PolledWait( 0.60 )
        if ( Trig_Silent_Death_1_Func012Func002C() ) then
            call SetUnitPositionLoc( summon, GetUnitLoc(GroupPickRandomUnit(GetUnitsInRangeOfLocMatching(400.00, GetUnitLoc(hero), Condition(function Trig_Silent_Death_1_Func012Func002Func005002001001003)))) )
            call AddSpecialEffectLocBJ( GetUnitLoc(summon), "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl" )
            call DestroyEffectBJ( GetLastCreatedEffectBJ() )
        else
            call SetUnitPositionLocFacingBJ( summon, GetRandomLocInRect(RectFromCenterSizeBJ(GetUnitLoc(hero), 400.00, 400.00)), GetRandomDirectionDeg() )
            call AddSpecialEffectLocBJ( GetUnitLoc(summon), "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl" )
            call DestroyEffectBJ( GetLastCreatedEffectBJ() )
        endif
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    call SetUnitPositionLocFacingBJ( hero, GetUnitLoc(summon), GetUnitFacing(summon) )
    call ShowUnitHide( summon )
    call ShowUnitShow( hero )
    call SelectUnitSingle( hero )
    call SetUnitInvulnerable( hero, false )
    call PauseUnitBJ( false, hero )
    call TriggerSleepAction( 0.50 )
    call TriggerExecute( gg_trg_Silent_Death_2 )
endfunction

//===========================================================================
function InitTrig_Silent_Death_1 takes nothing returns nothing
    set gg_trg_Silent_Death_1 = CreateTrigger(  )
    call TriggerRegisterUnitEvent( gg_trg_Silent_Death_1, gg_unit_N001_0001, EVENT_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_Silent_Death_1, Condition( function Trig_Silent_Death_1_Conditions ) )
    call TriggerAddAction( gg_trg_Silent_Death_1, function Trig_Silent_Death_1_Actions )
endfunction

03-14-2004, 12:33 PM#2
jardragon901
Err nvm I figured out what was wrong, sigh thats what I get for coding at 5 am.