just a hint: you don't need those long variable names, you can use the same variable names in different functions. so you can use a simple 'trg' instead of 'glavietoss_targ'. you know what i mean...
ah and also, these are the same, but the second is much simpler:
function GlavieTossCond takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01M' ) ) then
return false
endif
return true
endfunction
function GlavieTossCond takes nothing returns boolean
return GetSpellAbilityId() == 'A01M'
endfunction
If you have more conditions, use an 'and' between them. F. ex:
function GlavieTossCond takes nothing returns boolean
return GetSpellAbilityId() == 'A01M' and GetSpellAbilityLevel() == 1
endfunction
1. you wrote "WEAPON_TYPE_WHONKOWS" instead of "WEAPON_TYPE_WHOKNOWS" 2. you mistyped the triggername at least once - you wrote "GlavieToss" as well as "glavietoss" - warcraft III-Jass is casesensitiv 3. you used an integer for the damage. damage is a real.
here the corrected code (it compiles - haven't checked, wether it works)
function GlavieTossCond takes nothing returns boolean
return ( GetSpellAbilityId() == 'A01M' )
endfunction
function GlavieToss takes nothing returns nothing
local unit glavietoss_targ = GetSpellTargetUnit()
local unit glavietoss_cast = GetTriggerUnit()
local real glavietoss_dmg = GetHeroAgi(glavietoss_cast,true) * (1 + (0.4 * GetUnitAbilityLevel(glavietoss_cast,'A01M')))
call UnitDamageTarget( glavietoss_cast, glavietoss_targ, glavietoss_dmg, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_ENHANCED, WEAPON_TYPE_WHOKNOWS)
set glavietoss_targ = null
set glavietoss_cast = null
endfunction
//===========================================================================
function InitTrig_glavietoss takes nothing returns nothing
set gg_trg_glavietoss = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_glavietoss, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_glavietoss, Condition(function GlavieTossCond))
call TriggerAddAction(gg_trg_glavietoss, function GlavieToss)
endfunction
so you can do decimal numbers, for example if you want to do .1 damage every 0.01 seconds, thus doing 10 damage a second, though doing it smoothly instead of choppily.