Syntax Error
Hello guys! I'm trying to make a spell that teleports all allied heroes within 375 range of the caster to the targeted unit. I'm using Mass Teleport as the base skill. When I try to sabe the map, jasshelper returns an error with the function C1 saying "syntax error". Here is my trigger:
Hello guys! I'm trying to make a spell that teleports all allied heroes within 375 range of the caster to the targeted unit. I'm using Mass Teleport as the base skill. When I try to sabe the map, jasshelper returns an error with the function C1 saying "syntax error". Here is my trigger:
Code:
MassTeleport1
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Teleporte em Massa (Jaina Proudmoore)
Actions
Set TargetArray[(Player number of (Owner of (Triggering unit)))] = (Target unit of ability being cast)
JASS:
scope MassTeleport2 initializer Init
private function Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 039;A01U039; ) ) then
return false
endif
return true
endfunction
private function C1 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
private function C2 takes nothing returns boolean
return ( IsUnitAlly(GetFilterUnit(), GetOwningPlayer(Caster())) == true )
endfunction
private function C3 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
private function C12 takes nothing returns boolean
return GetBooleanAnd( C1(), C2() )
endfunction
private function C4 takes nothing returns boolean
return GetBooleanAnd( C12(), C3() )
endfunction
private function A1 takes nothing returns nothing
call AddSpecialEffectTargetUnitBJ( "origin", GetEnumUnit(), "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call SetUnitPositionLoc( GetEnumUnit(), TargetPos)
endfunction
function A2 takes nothing returns boolean
if ( not ( IsUnitAliveBJ(udg_TargetArray[GetConvertedPlayerId(GetOwningPlayer(Caster()))]) == true ) ) then
return false
endif
return true
endfunction
function Actions takes nothing returns nothing
local unit Caster = GetTriggerUnit()
local location TargetPos = GetUnitLoc(udg_TargetArray[GetConvertedPlayerId(GetOwningPlayer(Caster()))])
local location Loc = GetUnitLoc(Caster())
if ( A2() ) then
call ForGroupBJ( GetUnitsInRangeOfLocMatching(375.00, Loc, Condition(C4, A1)
call AddSpecialEffectTargetUnitBJ( "origin", Caster(), "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
else
call DisplayTimedTextToPlayer( GetOwningPlayer(Caster()), 0, 0, 10.00, "O alvo não está vivo." )
endif
set Caster = null
call RemoveLocation(TargetPos)
call RemoveLocation(Loc)
set Loc = null
set TargetPos = null
endfunction
//===========================================================================
private function Init takes nothing returns nothing
local trigger MassTeleport2 = CreateTrigger()
set MassTeleport2 = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(MassTeleport2, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(MassTeleport2, Condition(function Conditions))
call TriggerAddAction(MassTeleport2, function Actions)
endfunction
endscope