- Joined
- Oct 4, 2006
- Messages
- 7
This is my first atempt to a JASS spell. But the problem is that it doesnt do any damage, why?
JASS:
function GlavieTossCond takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01M' ) ) then
return false
endif
return true
endfunction
function GlavieToss takes nothing returns nothing
local unit glavietoss_targ = GetSpellTargetUnit ()
local unit glavietoss_cast = GetTriggerUnit ()
local integer glavietoss_dmg = GetHeroAgi(glavietoss_cast,true)* (1 + (0.4 * GetUnitAbilityLevel (glavietoss_cast,'A01M')))
UnitDamageTarget( glavietoss_cast,glavietoss_targ,glavietoss_dmg,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_ENHANCED,null)
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