Warcraft III resources & community, 2003–2006 · archived

newbie need help...

5 posts
#1

newbie need help...

Can someone tell me what is wrong with this script??? WE got crashed... I'm a newbie in JASS (just starting ^^) :(

function Trig_Earthquake_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A08W' 
endfunction

function Trig_Earthquake_Actions takes nothing returns nothing
    local unit dummy
    set dummy = CreateNUnitsAtLoc( 1, 'h00A', GetOwningPlayer(GetTriggerUnit()), GetSpellTargetLoc(), bj_UNIT_FACING )
    call UnitAddAbilityBJ( 'A09J', dummy )
    call SetUnitAbilityLevelSwapped( 'A09J', dummy, GetUnitAbilityLevelSwapped('A08W', GetTriggerUnit()) )
    call UnitApplyTimedLifeBJ (10.00, ‘BTLF’, dummy)
    set dummy = null
endfunction

//===========================================================================
function InitTrig_Earthquake takes nothing returns nothing
    set gg_trg_Earthquake = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Earthquake, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Earthquake, Condition( function Trig_Earthquake_Conditions ) )
    call TriggerAddAction( gg_trg_Earthquake, function Trig_Earthquake_Actions )
endfunction


Btw, can you explain what to do with the takes and returns... I didnt quite get it...
#2
I don't know why it crashes but I see something you should change.

CreateNUnitsAtLoc into CreateUnit.
#3
I don't know why it crashes but I see something you should change.

CreateNUnitsAtLoc into CreateUnit.
#4
I don't know why it crashes but I see something you should change.

CreateNUnitsAtLoc into CreateUnit.

Sorry for the tripple post. Something wrong happened.
#5
Hmm, I dun think that's wrong. Anyway, that function is converted from GUI...