HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help please, why doesn't my code work?

02-10-2005, 05:43 PM#1
13l4d3-M4st3r
Hi, I'm new to JASS and I've been trying to create an ability that damages the target according to the hero's intelligence
Code:
function Trig_FEB_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'AHtb' ) ) then
        return false
    endif
    return true
endfunction

function Trig_FEB_Actions takes nothing returns nothing
endfunction

//===========================================================================
function InitTrig_FEB takes nothing returns nothing
    set gg_trg_FEB = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_FEB, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_FEB, Condition( function Trig_FEB_Conditions ) )
    call TriggerAddAction( gg_trg_FEB, function Trig_FEB_Actions )
endfunction
//===========================================================================
function Trig_FEB_actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local unit target = GetSpellTargetUnit()
    local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, caster, true)
    call UnitDamageTargetBJ( caster, target, ((10 * int) + 100), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endfunction

Why doesn't it work???
I've tried everything.
Please help
02-10-2005, 06:34 PM#2
SentryIII
You're adding the actions in the "Trig_FEB_Actions" function (which is blank) instead of the "Trig_FEB_actions" function. On top of that, the "Trig_FEB_actions" function is below the function that adds it to the trigger, so even if you change it to call that function, you'll get errors.

Move your actions into the "Trig_FEB_Actions" function and get rid of the other one. I don't see why you even did that in the first place... o_O
02-10-2005, 06:45 PM#3
13l4d3-M4st3r
Oh never mind I managed to solve it...