Need help with Damaging Slide

KeresPup

Member
Reaction score
5
JASS:

function Trig_Seraphic_Charge_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A01A' ) ) then
        return false
    endif
    return true
endfunction

function Slide takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local spellData s = GetTimerData(t)
    local unit u = s.caster
    local real x
    local real y
    local real target_x = GetLocationX(s.targetpoint)
    local real target_y = GetLocationY(s.targetpoint)
    local real Temp_Angle = AngleBetweenPoints(s.startingpoint, s.targetpoint)
    local location Temp_Point = GetUnitLoc(s.caster)
    local effect SFX
    set x = GetUnitX(u) + 53 * Cos(Temp_Angle * bj_DEGTORAD)
    set y = GetUnitY(u) + 53 * Sin(Temp_Angle * bj_DEGTORAD)
    if(DistanceBetweenPoints(Temp_Point, s.startingpoint)<DistanceBetweenPoints(s.startingpoint, s.targetpoint)) then
        call SetUnitPosition(u, x, y)
        call SetUnitPathing( u, false )
        call SetUnitTimeScalePercent(u,300)
        call PauseUnit( u , true )
        set SFX = AddSpecialEffectLocBJ( GetUnitLoc(u), "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl" )
        call DestroyEffect(SFX)
        if((DistanceBetweenPoints(s.startingpoint, s.targetpoint)-(DistanceBetweenPoints(Temp_Point, s.startingpoint)))<100) then
            call SetUnitAnimation(u,"Attack Slam")
        endif
        call SetTimerData(t,s)
    else
        call SetUnitTimeScalePercent(u,100)
        call ReleaseTimer(t)
        call SetUnitPathing( u, true )
        call PauseUnit( u , false )
    endif
endfunction

function Trig_Seraphic_Charge_Actions takes nothing returns nothing
    local timer t
    local spellData s = spellData.create()
    set t = NewTimer()
    set s.caster = GetSpellAbilityUnit()
    set s.targetpoint = GetSpellTargetLoc()
    set s.startingpoint = GetUnitLoc(GetSpellAbilityUnit())
    set s.g1 = CreateGroup()
    call SetUnitAnimation(s.caster,"Stand Ready")
    call SetTimerData(t,s)
    call TimerStart(t, 0.027, true, function Slide)
endfunction

//===========================================================================
function InitTrig_Seraphic_Charge takes nothing returns nothing
    set gg_trg_Seraphic_Charge = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Seraphic_Charge, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Seraphic_Charge, Condition( function Trig_Seraphic_Charge_Conditions ) )
    call TriggerAddAction( gg_trg_Seraphic_Charge, function Trig_Seraphic_Charge_Actions )
endfunction


I already have the sliding part down, but I'm a bit clueless on how I should make it deal damage to the units that it passes by (without dealing damage to the units it already has dealt damage to).

Any Ideas?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top