JASS:
function Trig_WolfGirlDash_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A005' ) ) then
return false
endif
return true
endfunction
function Trig_WolfGirlDashes takes nothing returns nothing
local timer timerOne = GetExpiredTimer()
local unit caster = LoadUnitHandleBJ(1, GetHandleIdBJ(timerOne), udg_HeroesHashTable)
local real range = 20
local real angle = LoadRealBJ(2, GetHandleIdBJ(timerOne), udg_HeroesHashTable)
local real distance = LoadRealBJ(3, GetHandleIdBJ(timerOne), udg_HeroesHashTable)
local location movePointSecond
local location movePoint
if (distance > 0.00 == true and IsUnitAliveBJ(caster) == true) then
set movePointSecond = GetUnitLoc(caster)
set movePoint = PolarProjectionBJ(movePointSecond, range, angle)
call CreateNUnitsAtLoc( 1, 'h007', GetOwningPlayer(caster), movePoint, angle )
call SetUnitPositionLoc( caster, movePoint )
call RemoveLocation(movePointSecond)
call RemoveLocation(movePoint)
set distance = distance - range
call SaveRealBJ(distance, 3, GetHandleIdBJ(timerOne), udg_HeroesHashTable )
else
set movePointSecond = GetUnitLoc(caster)
call CreateNUnitsAtLoc( 1, 'h008', GetOwningPlayer(caster), movePointSecond, angle )
call PauseTimer(timerOne)
call DestroyTimer(timerOne)
set timerOne = null
endif
endfunction
function Trig_WolfGirlDash_Actions takes nothing returns nothing
local unit caster
local location casterPoint
local location targetPoint
local real angle
local real range
local timer timerOne
local real distance
set caster = GetSpellAbilityUnit()
set udg_WolfGirlCaster = GetSpellAbilityUnit()
set targetPoint = GetSpellTargetLoc()
set casterPoint = GetUnitLoc(caster)
set range = 50
set angle = AngleBetweenPoints(casterPoint, targetPoint)
set distance = DistanceBetweenPoints(casterPoint, targetPoint)
set timerOne = CreateTimer()
call SaveUnitHandleBJ( caster, 1, GetHandleIdBJ(timerOne), udg_HeroesHashTable )
call SaveRealBJ( angle, 2, GetHandleIdBJ(timerOne), udg_HeroesHashTable )
call SaveRealBJ( distance, 3, GetHandleIdBJ(timerOne), udg_HeroesHashTable )
call TimerStart(timerOne, 0.003, true, function Trig_WolfDashes)
call RemoveLocation(casterPoint)
call RemoveLocation(targetPoint)
set caster = null
endfunction
//===========================================================================
function InitTrig_WolfGirlDash takes nothing returns nothing
set gg_trg_WolfGirlDash = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_WolfGirlDash, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_WolfGirlDash, Condition( function Trig_WolfGirlDash_Conditions ) )
call TriggerAddAction( gg_trg_WolfGirlDash, function Trig_WolfGirlDash_Actions )
endfunction
I know about leaks and i will clear them later.
What i want is:
Pick every unit matching condition(enemy, is a live, not in a group damagedGroup) around a caster and do damage
But groups in jass is...pain, for me.