[JASS] Syntax Error

Status
Not open for further replies.
Level 4
Joined
Aug 1, 2007
Messages
66
I'm looking for the syntax error in the lines begining with "call GroupEnumUnitsInRangeOfLoc". All 4 lines are the same. I'm also wondering how to loop this and if there's a way to make the unit attack instead of just playing his animation and dealing damage.

JASS:
function Trig_Swift_Attack_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A00Y' ) ) then
        return false
    endif
    return true
endfunction

function SwiftAttackBoolean takes nothing returns boolean
    return IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) and  IsUnitAliveBJ(GetFilterUnit()) 
endfunction

function Trig_Swift_Attack_Actions takes nothing returns nothing
    local unit caster = GetSpellAbilityUnit()
    local unit target = GetSpellTargetUnit()
    local integer level = GetUnitAbilityLevel(caster,'A00Y')
    local real array damage
    local effect se1
    local effect se2
    local effect se3
    local effect se4
    local group targetgroup
    local sound array slice
    set slice[1] = gg_snd_MetalHeavySliceFlesh1
    set slice[2] = gg_snd_MetalHeavySliceFlesh2
    set slice[3] = gg_snd_MetalHeavySliceFlesh3    
    set damage[1] = 50
    set damage[2] = 62.5
    set damage[3] = 78.13
    set damage[4] = 97.66
    set damage[5] = 122.07
    set damage[6] = 152.59
    set damage[7] = 190.73
    set damage[8] = 238.42
    set damage[9] = 298.02
    set damage[10] = 372.53    
    call SetUnitTimeScalePercent( caster, 400.00 )
    call AddSpecialEffectTargetUnitBJ( "hand right", caster, "Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl" )
    set se1 = GetLastCreatedEffectBJ()
    call AddSpecialEffectTargetUnitBJ( "hand left", caster, "Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl" )
    set se2 = GetLastCreatedEffectBJ()
    call AddSpecialEffectTargetUnitBJ( "foot right", caster, "Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl" )
    set se3 = GetLastCreatedEffectBJ()
    call AddSpecialEffectTargetUnitBJ( "foot left", caster, "Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl" )
    set se4 = GetLastCreatedEffectBJ()
    call TriggerSleepAction( 0.01 )
    call SetUnitPositionLocFacingLocBJ( caster, GetUnitLoc(target), GetUnitLoc(target) )
    call SetUnitAnimation( caster, "attack" )
    call PlaySoundAtPointBJ( slice[GetRandomInt(1, 3)], 100, GetUnitLoc(caster), 0 )
    call UnitDamageTargetBJ( caster, target, damage[level], ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
    call TriggerSleepAction( 0.15 )
    
    call GroupEnumUnitsInRangeOfLoc( targetgroup, GetUnitLoc(target), 500, Condition(function SwiftAttackBoolean)) and ( GetFilterUnit() != target )
    
    set target = GroupPickRandomUnit(targetgroup)
    call SetUnitPositionLocFacingLocBJ( caster, GetUnitLoc(target), GetUnitLoc(target) )
    call SetUnitAnimation( caster, "attack" )
    call PlaySoundAtPointBJ( slice[GetRandomInt(1, 3)], 100, GetUnitLoc(caster), 0 )
    call UnitDamageTargetBJ( caster, target, damage[level], ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )    
    call TriggerSleepAction( 0.15 )
    
    call GroupEnumUnitsInRangeOfLoc( targetgroup, GetUnitLoc(target), 500, Condition(function SwiftAttackBoolean)) and ( GetFilterUnit() != target )
    
    set target = GroupPickRandomUnit(targetgroup)
    call SetUnitPositionLocFacingLocBJ( caster, GetUnitLoc(target), GetUnitLoc(target) )
    call SetUnitAnimation( caster, "attack" )
    call PlaySoundAtPointBJ( slice[GetRandomInt(1, 3)], 100, GetUnitLoc(caster), 0 )
    call UnitDamageTargetBJ( caster, target, damage[level], ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
    call TriggerSleepAction( 0.15 )
    
    call GroupEnumUnitsInRangeOfLoc( targetgroup, GetUnitLoc(target), 500, Condition(function SwiftAttackBoolean)) and ( GetFilterUnit() != target )
    
    set target = GroupPickRandomUnit(targetgroup)
    call SetUnitPositionLocFacingLocBJ( caster, GetUnitLoc(target), GetUnitLoc(target) )
    call SetUnitAnimation( caster, "attack" )
    call PlaySoundAtPointBJ( slice[GetRandomInt(1, 3)], 100, GetUnitLoc(caster), 0 )
    call UnitDamageTargetBJ( caster, target, damage[level], ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )    
    call TriggerSleepAction( 0.15 )
    
    call GroupEnumUnitsInRangeOfLoc( targetgroup, GetUnitLoc(target), 500, Condition(function SwiftAttackBoolean)) and ( GetFilterUnit() != target )
    
    set target = GroupPickRandomUnit(targetgroup)
    call SetUnitPositionLocFacingLocBJ( caster, GetUnitLoc(target), GetUnitLoc(target) )
    call SetUnitAnimation( caster, "attack" )
    call PlaySoundAtPointBJ( slice[GetRandomInt(1, 3)], 100, GetUnitLoc(caster), 0 )
    call UnitDamageTargetBJ( caster, target, damage[level], ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
    call SetUnitTimeScalePercent( GetSpellAbilityUnit(), 100.00 )
    call DestroyEffectBJ( se1 )
    call DestroyEffectBJ( se2 )
    call DestroyEffectBJ( se3 )
    call DestroyEffectBJ( se4 )
    set caster = null
    set target = null
    set se1 = null
    set se2 = null
    set se3 = null
    set se4 = null
    set targetgroup = null
    set slice[1] = null
    set slice[2] = null
    set slice[3] = null
endfunction
 
Level 5
Joined
Dec 18, 2007
Messages
205
" Condition(function SwiftAttackBoolean)) and ( GetFilterUnit() != target" does not work because filterunit does not exist.

you must loop through the group instead of making it like this.
maybe you should also create the group at the beginning using "local ....... = CreateGroup()"

greetz
 
Status
Not open for further replies.
Top