Молния устанавливается в те же самые координаты, что и юнит. Если тебе кажется, что это криво, значит, камера плохо подвешена.
Это норм?
Через точки вот. Код кривой, но работает...
Code
function Trig_Orvan_Tenacious_grasp_Conditions takes nothing returns boolean if ( not ( GetSpellAbilityId() == 'A02O' ) ) then return false endif return true endfunction
function Orvan_LIGHTOFF takes nothing returns nothing local timer t=GetExpiredTimer() local integer ti=GetHandleId(t) local unit u=LoadUnitHandle(udg_Hash,ti,0) local unit target=LoadUnitHandle(udg_Hash,ti,1) local lightning lt=LoadLightningHandle(udg_Hash,ti,2) local real range=LoadReal(udg_Hash,ti,3) local real timeleft=LoadReal(udg_Hash,ti,4) local real r=GetUnitFacing(u) local location p=GetUnitLoc(u) local location p2=GetUnitLoc(target) local effect e=LoadEffectHandle(udg_Hash,ti,5)
if timeleft>0 and IsUnitType(target,UNIT_TYPE_DEAD)==false and IsUnitType(u,UNIT_TYPE_DEAD)==false then call SaveReal(udg_Hash,ti,4,timeleft-0.03) call SetUnitPositionLoc( target, PolarProjectionBJ(p, range, r) ) call MoveLightningLoc( lt, p, p2) else call DestroyEffect(e) call DestroyLightning(lt) call PauseTimer(t) call DestroyTimer(t) call FlushChildHashtable(udg_Hash,ti) call PauseUnit(target,false) endif call RemoveLocation (p) call RemoveLocation (p2) set p=null set p2=null set t=null set u=null set target=null set lt=null set e=null endfunction
function Trig_Orvan_Tenacious_grasp_Actions takes nothing returns nothing local unit u=GetTriggerUnit() local unit target=GetSpellTargetUnit() local real range=180 local timer t=CreateTimer() local integer ti=GetHandleId(t) local lightning lt=AddLightning("AFOD",false,0,0,0,0) local integer i=GetUnitAbilityLevel(u,GetSpellAbilityId()) local effect e=AddSpecialEffectTargetUnitBJ( "overhead", target, "Abilities\\Spells\\Human\\Thunderclap\\ThunderclapTarget.mdl" ) call PauseUnit(target,true) call SaveUnitHandle(udg_Hash,ti,0,u) call SaveUnitHandle(udg_Hash,ti,1,target) call SaveLightningHandle(udg_Hash,ti,2,lt) call SaveReal(udg_Hash,ti,3,range) call SaveReal(udg_Hash,ti,4,1.5+0.5*i) call SaveEffectHandle(udg_Hash,ti,5,e) call TimerStart(t,0.03,true,function Orvan_LIGHTOFF) set t=null set lt=null set u=null set target=null set e=null endfunction
//=========================================================================== function InitTrig_Orvan_Tenacious_grasp takes nothing returns nothing set gg_trg_Orvan_Tenacious_grasp = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Orvan_Tenacious_grasp, EVENT_PLAYER_UNIT_SPELL_CAST ) call TriggerAddCondition( gg_trg_Orvan_Tenacious_grasp, Condition( function Trig_Orvan_Tenacious_grasp_Conditions ) ) call TriggerAddAction( gg_trg_Orvan_Tenacious_grasp, function Trig_Orvan_Tenacious_grasp_Actions ) endfunction
Сообщение отредактировал Diabfall - Пятница, 03 Июня 2011, 19:52:19