Добавлено (18-01-2011, 23:09) --------------------------------------------- BUUNI, нужно добавить другим триггером в этот триггер событие,получает повреждения
Добавлено (18-01-2011, 23:09) --------------------------------------------- преведи к читабельному виду код плиз
loop exitwhen i>7 if udg_Damage<=0. then set txt=CreateTextTag() call SetTextTagText(txt,"|c00C80000" +"Miss",.023) call SetTextTagPosUnit(txt,y,0.) call SetTextTagColor(txt,255,0,0,255) call SetTextTagVelocity(txt,.001,.03) call SetTextTagFadepoint(txt,.75) call SetTextTagLifespan(txt,1.5) call SetTextTagPermanent(txt,false) set txt=null else set txt=CreateTextTag() call SetTextTagText(txt,"|c00C80000"+I2S(R2I(d))+" hp",.023) call SetTextTagPosUnit(txt,y,0.) call SetTextTagColor(txt,255,0,0,255) call SetTextTagVelocity(txt,.001,.03) call SetTextTagFadepoint(txt,.75) call SetTextTagLifespan(txt,1.5) call SetTextTagPermanent(txt,false) set txt=null endif set i=i+1 endloop
и используй такой цикл,и текстаг офк переменные поставь
Добавлено (19-01-2011, 12:25) --------------------------------------------- А еще лучше на хеше сделай))Я сделал но т.к ниразу не работал с этими повреждениями то хз))
Добавлено (19-01-2011, 12:39) --------------------------------------------- Выложи более хороший код)Если узнаешь как занестив d дмг то спелл будет супер^^
Code
function Trig_cast_Timer takes nothing returns nothing local timer ta=GetExpiredTimer() local integer i=GetHandleId(ta) local integer in=0 local texttag txt local unit t=LoadUnitHandle(udg_Hash,i,1) local unit u=LoadUnitHandle(udg_Hash,i,0) local real d=GetEventDamage() loop exitwhen in>7 if d<=0. then set txt=CreateTextTag() call SetTextTagText(txt,"|c00C80000" +"Miss",.023) call SetTextTagPosUnit(txt,t,0.) call SetTextTagColor(txt,255,0,0,255) call SetTextTagVelocity(txt,.001,.03) call SetTextTagFadepoint(txt,.75) call SetTextTagLifespan(txt,1.5) call SetTextTagPermanent(txt,false) set txt=null else set txt=CreateTextTag() call SetTextTagText(txt,"|c00C80000"+I2S(R2I(d))+" hp",.023) call SetTextTagPosUnit(txt,t,0.) call SetTextTagColor(txt,255,0,0,255) call SetTextTagVelocity(txt,.001,.03) call SetTextTagFadepoint(txt,.75) call SetTextTagLifespan(txt,1.5) call SetTextTagPermanent(txt,false) set txt=null endif set in=in+1 endloop call PauseTimer(ta) call DestroyTimer(ta) call FlushChildHashtable(udg_Hash,i) set t=null set u=null set ta=null endfunction function Trig_cast_Actions takes nothing returns nothing local timer ta local integer i local real dx local real dy local unit u local unit t if GetSpellAbilityId()=='A000' then set ta=CreateTimer() set i=GetHandleId(ta) set u=GetTriggerUnit() set t=GetSpellTargetUnit() set dx=GetWidgetX(u)-GetWidgetX(t) set dy=GetWidgetY(u)-GetWidgetY(t) call SaveUnitHandle(udg_Hash,i,0,u) call SaveUnitHandle(udg_Hash,i,1,t) call TimerStart(ta,SquareRoot(dx * dx + dy * dy)/1000.,false,function Trig_cast_Timer) set ta = null endif set t=null set u=null endfunction
//=========================================================================== function InitTrig_cast takes nothing returns nothing local trigger trig=CreateTrigger() local integer index=0 loop call TriggerRegisterPlayerUnitEvent(trig, Player(index),EVENT_PLAYER_UNIT_SPELL_EFFECT,null) exitwhen index==11 set index=index + 1 endloop call TriggerAddAction(trig,function Trig_cast_Actions) set trig=null endfunction