|
问题?
function WrathB takes nothing returns boolean
    return GetSpellAbilityId() == 'A01C'
endfunction
 
function Wrath2 takes nothing returns nothing
    local timer t=GetExpiredTimer()
    local integer ss=GetHandleId(t)
    local unit tru=LoadUnitHandle(udg_GC,ss,1)
    local unit u
    local real x1=LoadReal(udg_GC,ss,1)
    local real y1=LoadReal(udg_GC,ss,2)
    local location l=Location(x1,y1)
    local integer i=LoadInteger(udg_GC,ss,1)
    if i < 11 then
        set i = ( i + 1 )
        call DestroyEffect( AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\Taunt\\TauntCaster.mdl", tru, "chest") )
        call SetUnitFlyHeight( tru, ( GetUnitFlyHeight(tru) + 200.00 ), 0.00 )
    else
        if i == 11 then
            set i = ( i + 1 )
            call SetUnitPositionLoc( tru, l )
            call DestroyEffect( AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\Taunt\\TauntCaster.mdl", tru, "chest") )
            call SetUnitFlyHeight( tru, ( GetUnitFlyHeight(tru) - 200.00 ), 0.00 )
        else
            if i == 22 then
                set i = 0
                call PauseUnit( tru, false )
                call SetUnitInvulnerable( tru, false )
                call UnitRemoveAbility( tru, 'A002' )
                call CreateNUnitsAtLoc( 1, 'h00F', GetOwningPlayer(tru), l, bj_UNIT_FACING )
                set bj_forLoopAIndex = 1
                set bj_forLoopAIndexEnd = 10
                loop
                    exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
                    set u = CreateUnitAtLoc(GetOwningPlayer(tru), 'h00E', l, GetRandomReal(1.00, 360.00))
                    call SetUnitFlyHeight( u, ( 100.00 * I2R(bj_forLoopAIndex) ), 0.00 )
                    set u = CreateUnitAtLoc(GetOwningPlayer(tru), 'h009', l, GetRandomReal(1.00, 360.00))
                    call SetUnitFlyHeight( u, ( 100.00 * I2R(bj_forLoopAIndex) ), 0.00 )
                    set bj_forLoopAIndex = bj_forLoopAIndex + 1
                endloop
                call UnitRemoveAbility( tru, 'A00O' )
                call RemoveLocation( l )
                call PauseTimer(t)
                call FlushChildHashtable(udg_GC,ss)
                call DestroyTimer(t)
            else
                set i = ( i + 1 )
                call DestroyEffect( AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\Taunt\\TauntCaster.mdl", tru, "chest") )
                call SetUnitFlyHeight( tru, ( GetUnitFlyHeight(tru) - 200.00 ), 0.00 )
            endif
        endif
    endif
    call SaveInteger(udg_GC,ss,1,i)
    set t=null
    set l=null
    set tru=null
    set u=null
endfunction
function WrathA takes nothing returns nothing
    local integer flynum=1
    local real x=GetLocationX(GetSpellTargetLoc())
    local real y=GetLocationY(GetSpellTargetLoc())
    local timer t=GetExpiredTimer()
    local integer ss=GetHandleId(t)
    call PauseUnit( GetTriggerUnit(), true )
    call UnitAddAbility( GetTriggerUnit(), 'A002' )
    call SetUnitInvulnerable( GetTriggerUnit(), true )
    call UnitAddAbility( GetTriggerUnit(), 'A00O' )
    call SaveUnitHandle(udg_GC,ss,1,GetTriggerUnit())
    call SaveReal(udg_GC,ss,1,x)
    call SaveReal(udg_GC,ss,1,y)
    call SaveInteger(udg_GC,ss,1,flynum)
    call TimerStart(t,0.10,true,function Wrath2)
    set t=null
endfunction
//===========================================================================
function InitTrig_Wrath takes nothing returns nothing
    set gg_trg_Wrath = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Wrath, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Wrath, Condition( function WrathB ) )
    call TriggerAddAction( gg_trg_Wrath, function WrathA )
endfunction |
|