Code
globals
hashtable hash=InitHashtable()
endglobals
function Timer takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer id=GetHandleId(t)
local unit caster=LoadUnitHandle(hash,id,1)
local unit target=LoadUnitHandle(hash,id,2)
local integer count=LoadInteger(hash,id,3)-1
call SetUnitFlyHeight(target,GetUnitDefaultFlyHeight(target),2.)
call UnitDamageTarget(caster,target,GetHeroStr(target,false)*.5,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
if count <=0 or GetWidgetLife(target)<=0 then
call PauseTimer(t)
call DestroyTimer(t)
endif
endfunction
function spell takes nothing returns nothing
local timer t
local integer id
if GetSpellAbilityId()=='A000' then
set t=CreateTimer()
set id=GetHandleId(t)
call SetUnitFlyHeight(GetTriggerUnit(),300,3.)
call SaveUnitHandle(hash,id,1,GetTriggerUnit())
call SaveUnitHandle(hash,id,2,GetSpellTargetUnit())
call SaveInteger(hash,id,3,10)
call TimerStart(t,1.00,true,function Timer)
set t=null
endif
endfunction
function InitTrig_new takes nothing returns nothing
local trigger trig=CreateTrigger()
local integer i=0
loop
call TriggerRegisterPlayerUnitEvent(trig,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,null)
set i=i+1
exitwhen i==15
endloop
call TriggerAddAction( trig, function spell )
endfunction
Оцените код и скилл..И скажите мне, почему невидно слотов игроков, когда я запускаю эту карту ?