Cokemonkey11
Spell Reviewer
- Joined
- May 9, 2006
- Messages
- 3,575
JASS:
scope tide
globals
private unit wave
private integer speed
private real direc
private location offset
private timer time
endglobals
private function tideTimeCall takes nothing returns nothing
local location current = GetUnitLoc(wave)
set offset = PolarProjectionBJ(GetUnitLoc(wave),speed,direc)
call SetUnitPositionLoc(wave,offset)
set speed = speed - 1
if speed < -30 then
call DestroyTimer(time)
endif
endfunction
private function sTide takes nothing returns nothing
set time = CreateTimer()
set direc = GetUnitFacing(GetSpellAbilityUnit())
set wave = CreateUnitAtLoc(GetOwningPlayer(GetSpellAbilityUnit()),'hfoo',GetUnitLoc(GetSpellAbilityUnit()),direc)
set speed = 25
call TimerStart(time,.03,true,function tideTimeCall)
endfunction
function callTide takes nothing returns nothing
call sTide()
endfunction
endscope
function tideActions takes nothing returns nothing
if GetSpellAbilityId()=='A001' then
call callTide()
endif
endfunction
function InitTrig_tide takes nothing returns nothing
set gg_trg_tide = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_tide,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction(gg_trg_tide,function tideActions)
endfunction
works but not MUI. if i have 2 units cast the ability at the same time the timer never ends (speed gets smaller and smaller (unit moves faster backwards))
any workaround?
Last edited: