Carl-Fredrik
New Member
- Reaction score
- 51
Hello everyone.
So I've been trying to make one of those spells... I've failed so far though
So I started out with "let's start with making the unit move forward".
This is what I made...:
Thing is... it does nothing :/ Or well, I think it pauses the unit for a short while, I'm not sure though..
So how do I make it move forward?
Thanks in advance!
// Carl-Fredrik
So I've been trying to make one of those spells... I've failed so far though
So I started out with "let's start with making the unit move forward".
This is what I made...:
JASS:
scope KodoRun initializer KodoRushInit
globals
private timer TIMER = CreateTimer()
private real INTERVAL = 0.03
private integer FORLOOP = 1
private real DAMAGE = 30
private unit u = GetTriggerUnit()
private location triggerloc = GetUnitLoc(u)
endglobals
private function Conditions takes nothing returns boolean
if (GetSpellAbilityId() == 039;A05A039;) then
return true
endif
return false
endfunction
private function DoThisTimer takes nothing returns nothing
local location triggerloc = GetUnitLoc(u)
local location move = PolarProjectionBJ(triggerloc, 12.00, GetUnitFacing(u))
call SetUnitX(u, GetLocationX(move))
call SetUnitY(u, GetLocationY(move))
set FORLOOP = FORLOOP + 1
if FORLOOP == 100 then
call PauseUnit(u, false)
call PauseTimer(TIMER)
set FORLOOP = 1
endif
call RemoveLocation(move)
set move = null
endfunction
private function Actions takes nothing returns nothing
local location loc = GetSpellTargetLoc()
local location triggerloc = GetUnitLoc(u)
call SetUnitFacing(u, AngleBetweenPoints(triggerloc, loc))
call PauseUnit(u, true)
call TimerStart(TIMER, INTERVAL, true, (function DoThisTimer))
call RemoveLocation(loc)
set loc = null
endfunction
private function KodoRushInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition (function Conditions))
call TriggerAddAction( t, function Actions )
endfunction
endscope
Thing is... it does nothing :/ Or well, I think it pauses the unit for a short while, I'm not sure though..
So how do I make it move forward?
Thanks in advance!
// Carl-Fredrik