GetTriggerUnit-
DogEntrepreneur
- Reaction score
- 129
Okay, I get this Jasshelper error (yes I got it almost fully working).
Basicly, the only one that gives me this error is d.offsetWTH?
I'm new to vJass (btw)
_I want this spell MUI so I use struct data.
Basicly, the only one that gives me this error is d.offsetWTH?
I'm new to vJass (btw)
_I want this spell MUI so I use struct data.
JASS:
scope HookShot initializer Init
globals
private constant integer SPELL_ID = 039;H00K039;
private constant integer DUMMY_ID = 039;dumy039;
endglobals
private struct data
unit caster
real offset
real angle
real lenght
location cpoint
player p
endstruct
function Cond takes nothing returns boolean
return GetSpellAbilityId() == SPELL_ID
endfunction
function Callback takes nothing returns nothing
local location spawnpoint
local unit c
set d.offset = d.offset + 20.00
set d.lengh = d.lenght - 0.05
set spawnpoint = PolarProjectionBJ( d.cpoint, d.offset, d.angle )
set c = CreateUnitAtLoc( p, DUMMY_ID, spawnpoint, d.angle )
call UnitApplyTimedLife( c, 039;BTLF039;, d.lenght )
call RemoveLocation( spawnpoint)
set spawnpoint = null
endfunction
function Main takes nothing returns nothing
local unit u = GetTriggerUnit()
local timer t
local location tloc = GetSpellTargetLoc()
local location uloc = GetUnitLoc( u)
set d.cpoint = uloc
set d.offset = 0.00
set d.lengh = 2.00
set d.angle = AngleBetweenPoints( uloc, tloc)
set d.p = GetOwningPlayer( u)
call TimerStart( t, 0.05, true, function Callback)
call RemoveLocation( tloc)
call RemoveLocation( uloc)
call RemoveLocation( d.cpoint)
set u = null
set t = null
set tloc = null
set uloc = null
endfunction
//===========================================================================
function Init takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( t, Condition( function Cond))
call TriggerAddAction( t, function Main )
endfunction
endscope