- Joined
- Jun 26, 2006
- Messages
- 177
JASS:
function Trig_snapdragonpoison_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
globals
unit sdpTarget
real sdpDamage
endglobals
function Trig_snapdragonpoison_Actions takes nothing returns nothing
local integer i = 7
set sdpTarget = GetSpellTargetUnit()
set sdpDamage = 0.01 * GetUnitAbilityLevelSwapped('A000',GetSpellAbilityUnit())
loop
exitwhen i == 0
call UnitDamageTargetBJ(GetSpellAbilityUnit(),sdpTarget,(GetUnitState(GetSpellTargetUnit(),UNIT_STATE_LIFE) * sdpDamage),ATTACK_TYPE_MAGIC,DAMAGE_TYPE_MAGIC)
call TriggerSleepAction(1.00)
set i = i - 1
endloop
endfunction
//===========================================================================
function InitTrig_snapdragonpoison takes nothing returns nothing
set gg_trg_snapdragonpoison = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_snapdragonpoison, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_snapdragonpoison, Condition( function Trig_snapdragonpoison_Conditions ) )
call TriggerAddAction( gg_trg_snapdragonpoison, function Trig_snapdragonpoison_Actions )
endfunction