Warcraft III resources & community, 2003–2006 · archived

How Do i Make Knock Back Spells

4 posts
#2
Thats a example from my Stygian Lord for a push back function, u need to start a timer for 0,01 seconds repeatedly and call to move unit instantly to a point behind himself (polar projection function used) I hope i could help u. (sorry its a few german in this script.
function Trig_Smash_Push_Back_Kopieren_Func001C takes nothing returns boolean
    if ( not ( udg_SmashedPBCap >= 50 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Smash_Push_Back_Kopieren_Func003A takes nothing returns nothing
    call RemoveLocation(udg_SmashedCurrentPoint)
    call RemoveLocation(udg_SmashedPBBackPoint)
    call DestroyEffectBJ( udg_SmashedPBEffect )
    set udg_SmashedCurrentPoint = GetUnitLoc(GetEnumUnit())
    set udg_SmashedPBBackPoint = PolarProjectionBJ(udg_SmashedCurrentPoint, 4.00, AngleBetweenPoints(udg_SmashedArea, udg_SmashedCurrentPoint))
    call SetUnitPositionLoc( GetEnumUnit(), udg_SmashedPBBackPoint )
    call AddSpecialEffectLocBJ( udg_SmashedCurrentPoint, "Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl" )
    set udg_SmashedPBEffect = GetLastCreatedEffectBJ()
endfunction

function Trig_Smash_Push_Back_Kopieren_Actions takes nothing returns nothing
    if ( Trig_Smash_Push_Back_Kopieren_Func001C() ) then
        call GroupClear( udg_SmashedPBGroup )
        set udg_SmashedPBCap = 0
        set udg_SmashUnit = null
        set udg_SmashedUnit = null
        call PauseTimerBJ( true, udg_SmashedPBTimer )
        call RemoveLocation(udg_SmashedArea)
        call RemoveLocation(udg_SmashedCurrentPoint)
        call RemoveLocation(udg_SmashedPBBackPoint)
        return
    else
    endif
    set udg_SmashedPBCap = ( udg_SmashedPBCap + 1 )
    call ForGroupBJ( udg_SmashedPBGroup, function Trig_Smash_Push_Back_Kopieren_Func003A )
endfunction

//===========================================================================
function InitTrig_Smash_Push_Back_Kopieren takes nothing returns nothing
    set gg_trg_Smash_Push_Back_Kopieren = CreateTrigger(  )
    call TriggerRegisterTimerExpireEventBJ( gg_trg_Smash_Push_Back_Kopieren, udg_SmashedPBTimer )
    call TriggerAddAction( gg_trg_Smash_Push_Back_Kopieren, function Trig_Smash_Push_Back_Kopieren_Actions )
endfunction

#3
No Clue Wat U said and i can barley read it.......:- :( :(
#4
use the actions 'unit - move unit instantly to 'position' then use point with polar offset and move it to position of the unit u want to slide offset by 30 (depends on how fast u want it to slide) facing the unit facing, or the facing of the unit that attacks him or anything

use that function in a trigger with the event: every XXX seconds of the game (0.03)