• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[JASS] 2050 errors with this trigger

Status
Not open for further replies.
Level 28
Joined
Mar 25, 2008
Messages
2,955
Hi, i converted a gui-made spell from gui to jass and used the technique shown in various tutorials to declare local variables - but it seems i'm too dumb for that, however, my world editor gives about 2050 errors, mostly called 'Name expected' or else.

Well, here's my actual trigger
JASS:
function Trig_Ice_Age_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A02A' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Ice_Age_Func006002 takes nothing returns nothing
    call PauseUnitBJ( true, GetEnumUnit() )
endfunction

function Trig_Ice_Age_Func009Func008002 takes nothing returns nothing
    call UnitDamageTargetBJ( GetTriggerUnit(), GetEnumUnit(), ( 15000.00 / I2R(CountUnitsInGroup(eis_gruppe)) ), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL )
endfunction

function Trig_Ice_Age_Func011002 takes nothing returns nothing
    call PauseUnitBJ( false, GetEnumUnit() )
endfunction

function Trig_Ice_Age_Actions takes nothing returns nothing
    local location eis_caster_pkt
    local location array eis_rnd_pkt
    local location array eis_rnd_pkt
    local location array rnd_pkt
    local location array eis_rnd_pkt
    local effect eis_eff1
    local effect eis_eff2
    local effect eis_eff3
    local rect eis_region
    local group eis_gruppe
    local lightning array eis_blitz
    set eis_caster_pkt = GetUnitLoc(GetTriggerUnit())
    set eis_region = RectFromCenterSizeBJ(eis_caster_pkt, 1600.00, 1600.00)
    call TriggerSleepAction( 0.30 )
    set eis_gruppe = GetUnitsInRectOfPlayer(eis_region, Player(11))
    // enable freeze, add creeps
    call ForGroupBJ( eis_gruppe, function Trig_Ice_Age_Func006002 )
    // Energieblitze erzeugen
    set bj_forLoopBIndex = 1
    set bj_forLoopBIndexEnd = 15
    loop
        exitwhen bj_forLoopBIndex > bj_forLoopBIndexEnd
        set eis_rnd_pkt[0] = GetRandomLocInRect(eis_region)
        call AddLightningLoc( "DRAM", eis_caster_pkt, eis_rnd_pkt[0] )
        set eis_blitz[GetForLoopIndexB()] = GetLastCreatedLightningBJ()
        set bj_forLoopBIndex = bj_forLoopBIndex + 1
    endloop
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 10
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        // Effects
        set eis_rnd_pkt[1] = GetRandomLocInRect(eis_region)
        call AddSpecialEffectLocBJ( eis_rnd_pkt[1], "war3mapImported\\Shiva'sWrath.mdx" )
        set eis_eff1 = GetLastCreatedEffectBJ()
        set eis_rnd_pkt[2] = GetRandomLocInRect(eis_region)
        set eis_eff2 = GetLastCreatedEffectBJ()        
        call AddSpecialEffectLocBJ( eis_rnd_pkt[2], "Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl" )
        set eis_rnd_pkt[3] = GetRandomLocInRect(eis_region)
        call AddSpecialEffectLocBJ( udg_eis_rnd_pkt[3], "Abilities\\Spells\\Human\\Blizzard\\BlizzardTarget.mdl" )
        set eis_eff3 = GetLastCreatedEffectBJ()
        call ForGroupBJ( eis_gruppe, function Trig_Ice_Age_Func009Func008002 )
        call TriggerSleepAction( 0.50 )
        call RemoveLocation(eis_rnd_pkt[1])
        call RemoveLocation(eis_rnd_pkt[2])
        call RemoveLocation(eis_rnd_pkt[3])        
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    // Freeze off
    call ForGroupBJ( eis_gruppe, function Trig_Ice_Age_Func011002 )
    call TriggerSleepAction( 0.20 )
    // Clear effects
    call GroupClear( eis_gruppe )
    set bj_forLoopBIndex = 1
    set bj_forLoopBIndexEnd = 15
    loop
        exitwhen bj_forLoopBIndex > bj_forLoopBIndexEnd
        call DestroyLightningBJ( eis_blitz[GetForLoopIndexB()] )
        set bj_forLoopBIndex = bj_forLoopBIndex + 1
    endloop
    call RemoveLocation(eis_rnd_pkt[0])
    call RemoveLocation(eis_caster_pkt)
    call DestroyGroup(eis_gruppe)
    call RemoveRect(eis_region)
endfunction

//===========================================================================
function InitTrig_Ice_Age takes nothing returns nothing
    set gg_trg_Ice_Age = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Ice_Age, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_Ice_Age, Condition( function Trig_Ice_Age_Conditions ) )
    call TriggerAddAction( gg_trg_Ice_Age, function Trig_Ice_Age_Actions )
endfunction
i hope you don't get dizzy by my german names ^.^

Halp meeeh D:

But please be so kind and tell me as if i were a total noob (because i am) :>
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
ah right.. i didn't see that becuase lately i thought that one defines an array using just local unit blah[0] and so on ^^
Anyways, besides your awesomeness, there is one error left..
He sais:

Name expected: UnitDamageTargetBJ( GetTriggerUnit(), GetEnumUnit(), ( 15000.00 / I2R(CountUnitsInGroup(eis_gruppe)) ), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL )
 
Status
Not open for further replies.
Top