|
楼主 |
发表于 2008-1-27 20:24:40
|
显示全部楼层
[codes=jass]
function Trig_tztj_1_______u_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A012' ) then
return true
endif
return false
endfunction
function Trig_tztj_1_______u_Actions takes nothing returns nothing
local unit SpellUnit=GetTriggerUnit()
local location SUnitPoint = GetUnitLoc(SpellUnit)
local location SpellPoint= GetSpellTargetLoc()
local unit array LastUnit
local integer i=0
local integer j=0
local location array obturate
local real angle=AngleBetweenPoints(SUnitPoint,SpellPoint)
local player SpellPlayer=GetOwningPlayer(SpellUnit)
loop
set i=i+1
exitwhen i>32
set obturate = PolarProjectionBJ(SUnitPoint, ( 32.00 * I2R(i) ),angle)
call CreateUnitAtLoc( SpellPlayer, 'e00B',obturate,0 )
set LastUnit = GetLastCreatedUnit()
call AddSpecialEffectLoc( "Objects\\\\Spawnmodels\\\\Undead\\\\ImpaleTargetDust\\\\ImpaleTargetDust.mdl" ,obturate)
call DestroyEffect( GetLastCreatedEffectBJ() )
call SetTerrainPathableBJ(obturate, PATHING_TYPE_ANY, false )
endloop
call RemoveLocation( SUnitPoint )
call RemoveLocation( SpellPoint )
call TriggerSleepAction( 8.00 )
loop
set j=j+1
exitwhen j > 33
call RemoveUnit( LastUnit[j] )
call SetTerrainPathableBJ( obturate[j], PATHING_TYPE_ANY, true )
call RemoveLocation( obturate[j] )
set LastUnit[j]=null
endloop
set SpellUnit=null
set angle=0
set SpellPlayer=null
endfunction
//===========================================================================
function InitTrig_tztj_1_______u takes nothing returns nothing
set gg_trg_tztj_1_______u=CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_tztj_1_______u, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_tztj_1_______u, Condition( function Trig_tztj_1_______u_Conditions ) )
call TriggerAddAction( gg_trg_tztj_1_______u, function Trig_tztj_1_______u_Actions )
endfunction[/codes]
这个是模仿DOTA神牛的拦路 但是 8秒过后路是可以走了 为什么创建的单位没有删除掉呢?删除和清空是
[codes=jass]
call RemoveUnit( LastUnit[j] )
set LastUnit[j]=null
[/codes]
这两段 我语法检查了 没错啊 但是创建出来的单位就是不删除 |
|