- Joined
- Jul 24, 2007
- Messages
- 40
Can someone explain to me how to create a MUI damage over time spell? This is what i have...i think it doesn't work becuase
doesnt work after
.
any help would be appreciated.
JASS:
GetSpellTargetUnit()
JASS:
call TriggerSleepAction
any help would be appreciated.
JASS:
function Trig_Crucify_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A003'
endfunction
function dot takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit target = GetSpellTargetUnit()
call UnitDamageTarget(caster, target, 6 * GetUnitAbilityLevel(caster, 'A003'), true, true, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, null)
endfunction
function Trig_Crucify_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit target = GetSpellTargetUnit()
local real mana = GetUnitState(target,UNIT_STATE_MANA)
local real manadeduced = 1 - (.1 * GetUnitAbilityLevel(caster, 'A003'))
local real x = GetUnitX(target)
local real y = GetUnitY(target)
local effect e1
local timer t = CreateTimer()
set e1 = AddSpecialEffect("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl",x,y)
call UnitDamageTarget(caster, target, 30 * GetUnitAbilityLevel(caster, 'A003'), true, true, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, null)
call SetUnitManaBJ( target, (mana * manadeduced))
call DestroyEffect(e1)
call TimerStart(t,1,true,function dot)
call TriggerSleepAction(15)
call DestroyTimer(t)
//Clean
set caster = null
set target = null
set e1 = null
set t = null
endfunction
//===========================================================================
function InitTrig_Crucify takes nothing returns nothing
set gg_trg_Crucify = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(gg_trg_Crucify, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Crucify, Condition(function Trig_Crucify_Conditions))
call TriggerAddAction( gg_trg_Crucify, function Trig_Crucify_Actions )
endfunction