I'm really not that great with jass but i'm trying to learn.
Anyway, I copied everything from the drag spell (Variables, etc everything.)
( http://www.wc3sear.ch/index.php?p=Spells&ID=575&sid=210fed1e34d49288b449008d5885f75b )
Everything was smooth until the 2 triggers...
Here's my errors:
Expected a name:
if ( not ( GetTriggerUnit() == gg_unit_Ofar_0001 ) ) then
Expected a code statement:
endif
Expected a name:
call AddLightningLoc( "LEAS", GetUnitLoc(gg_unit_Ofar_0001), GetUnitLoc(udg_SpellTarget[1]) )
Expected a variable name:
set udg_SpellSpecialFX[2] = GetLastCreatedEffectBJ()
Now, I do not know much about jass at the present but i'm guessing my problem lies within this:
gg_unit_Ofar_0001
Seeing as I don't have a farseer in my map like the drag map has might this be what causes the problem?
Anywhere heres the FULL triggers if anyone wants them.
Anyway, I copied everything from the drag spell (Variables, etc everything.)
( http://www.wc3sear.ch/index.php?p=Spells&ID=575&sid=210fed1e34d49288b449008d5885f75b )
Everything was smooth until the 2 triggers...
Here's my errors:
Expected a name:
if ( not ( GetTriggerUnit() == gg_unit_Ofar_0001 ) ) then
Expected a code statement:
endif
Expected a name:
call AddLightningLoc( "LEAS", GetUnitLoc(gg_unit_Ofar_0001), GetUnitLoc(udg_SpellTarget[1]) )
Expected a variable name:
set udg_SpellSpecialFX[2] = GetLastCreatedEffectBJ()
Now, I do not know much about jass at the present but i'm guessing my problem lies within this:
gg_unit_Ofar_0001
Seeing as I don't have a farseer in my map like the drag map has might this be what causes the problem?
Anywhere heres the FULL triggers if anyone wants them.
Code:
function Trig_Rope_Cast_Conditions takes nothing returns boolean
if ( not ( GetTriggerUnit() == gg_unit_Ofar_0001 ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A00P' ) ) then
return false
endif
return true
endfunction
function Trig_Rope_Cast_Actions takes nothing returns nothing
set udg_SpellTarget[1] = GetSpellTargetUnit()
call AddLightningLoc( "LEAS", GetUnitLoc(gg_unit_Ofar_0001), GetUnitLoc(udg_SpellTarget[1]) )
set udg_SpellsLightning[0] = GetLastCreatedLightningBJ()
call AddSpecialEffectTargetUnitBJ( "chest", udg_SpellTarget[1], "Abilities\\Spells\\Human\\AerialShackles\\AerialShacklesTarget.mdl" )
set udg_SpellSpecialFX[2] = GetLastCreatedEffectBJ()
call SetUnitPathing( udg_SpellsUnits[1], false )
call TriggerSleepAction( 0.05 )
call EnableTrigger( gg_trg_Rope_Recursive )
endfunction
//===========================================================================
function InitTrig_Rope_Cast takes nothing returns nothing
set gg_trg_Rope_Cast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Rope_Cast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Rope_Cast, Condition( function Trig_Rope_Cast_Conditions ) )
call TriggerAddAction( gg_trg_Rope_Cast, function Trig_Rope_Cast_Actions )
endfunction
Code:
function Trig_Rope_Recursive_Func002Func001001 takes nothing returns boolean
return ( IsUnitInRange(gg_unit_Ofar_0001, udg_SpellTarget[1], 150.00) == true )
endfunction
function Trig_Rope_Recursive_Func002Func009001 takes nothing returns boolean
return ( UnitHasBuffBJ(udg_SpellTarget[1], 'B001') == true )
endfunction
function Trig_Rope_Recursive_Func002Func009002 takes nothing returns boolean
return ( UnitHasBuffBJ(udg_SpellTarget[1], 'B002') == true )
endfunction
function Trig_Rope_Recursive_Func002C takes nothing returns boolean
if ( not GetBooleanOr( Trig_Rope_Recursive_Func002Func009001(), Trig_Rope_Recursive_Func002Func009002() ) ) then
return false
endif
if ( not ( IsUnitAliveBJ(gg_unit_Ofar_0001) == true ) ) then
return false
endif
return true
endfunction
function Trig_Rope_Recursive_Actions takes nothing returns nothing
if ( Trig_Rope_Recursive_Func002C() ) then
if ( Trig_Rope_Recursive_Func002Func001001() ) then
call DoNothing( )
else
set udg_SpellPoints[2] = PolarProjectionBJ(GetUnitLoc(udg_SpellTarget[1]), 30.00, AngleBetweenPoints(GetUnitLoc(udg_SpellTarget[1]), GetUnitLoc(gg_unit_Ofar_0001)))
endif
call SetUnitPositionLoc( udg_SpellTarget[1], udg_SpellPoints[2] )
call RemoveLocation( udg_SpellPoints[2] )
call MoveLightningLoc( udg_SpellsLightning[0], GetUnitLoc(gg_unit_Ofar_0001), GetUnitLoc(udg_SpellTarget[1]) )
else
call DestroyLightningBJ( udg_SpellsLightning[0] )
call DestroyEffect( udg_SpellSpecialFX[2] )
call SetUnitPathing( udg_SpellsUnits[1], true )
call DisableTrigger( GetTriggeringTrigger() )
endif
endfunction
//===========================================================================
function InitTrig_Rope_Recursive takes nothing returns nothing
set gg_trg_Rope_Recursive = CreateTrigger( )
call DisableTrigger( gg_trg_Rope_Recursive )
call TriggerRegisterTimerEventPeriodic( gg_trg_Rope_Recursive, 0.09 )
call TriggerAddAction( gg_trg_Rope_Recursive, function Trig_Rope_Recursive_Actions )
endfunction