Naga'sShadow
Ultra Cool Member
- Reaction score
- 49
I've got a trigger that wants to cast a spell on all nearby units. I've set the caster function up but the syntax checker says the actions function is expecting a return, except I don't see any actions that give a return.
This is the line that calls this function.
On a slightly related note "Caster" is a local variable declared earilier in the trigger. I'm using handle variables to move it around. Do I need to refer to it with handles in this part as well?
JASS:
function Ghostwalk_Slam_Conditions takes nothing returns boolean
local unit Caster = H2U(GetHandleHandle(Caster, "Caster"))// I added this line and it clears up that error but I'm not sure if its done right
return ( IsUnitEnemy(GetEnumUnit(), GetOwningPlayer(Caster)) == true )
endfunction
function Ghostwalk_Slam_Actions takes nothing retruns nothing
call CreateNUnitsAtLoc( 1, 039;h001039;, GetOwningPlayer(Caster), GetUnitLoc(GetEnumUnit()), bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 2.00, 039;BTLF039;, GetLastCreatedUnit() )
call UnitAddAbilityBJ( 039;A00O039;, GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "banish", GetEnumUnit() )
endfunction
This is the line that calls this function.
JASS:
call ForGroupBJ( GetUnitsInRangeOfLocMatching(500.00, GetUnitLoc(Caster), Condition(function Ghostwalk_Slam_Conditions)), function Ghostwalk_Slam_Actions )
On a slightly related note "Caster" is a local variable declared earilier in the trigger. I'm using handle variables to move it around. Do I need to refer to it with handles in this part as well?