- Joined
- Feb 22, 2006
- Messages
- 960
So I'm a newbie in jass and so i tried my best with this, and my question is, is there a better way to do it
i noticed it starts to lag when the spell is 5 times active
i noticed it starts to lag when the spell is 5 times active
JASS:
function dot_action takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local real damage = ( ( GetUnitAbilityLevelSwapped('A000', caster) * 10 ) + GetHeroInt(caster,true) )
local integer start = 0
local integer stop = 5
loop
exitwhen start > stop
call UnitDamageTarget(caster,target,damage,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call TriggerSleepAction(3.00)
set start = start + 1
endloop
set caster = null
set target = null
endfunction
function Condition_Function takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction
function InitTrig_dot takes nothing returns nothing
local trigger dot= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dot,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dot,Condition(function Condition_Function))
call TriggerAddAction(dot,function dot_action)
set dot = null
endfunction
Last edited: