//鬼龙之舞
//没有什么技术含量 ,只是没有使用到任何全局变量
function Trig_test_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction
function Trig_test_Func001002003 takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
endfunction
function Trig_test_Actions takes nothing returns nothing
local unit hero=GetTriggerUnit()
local unit u
local location loc= GetUnitLoc(hero)
local group g= GetUnitsInRangeOfLocMatching(512, loc, Condition(function Trig_test_Func001002003))
local integer n=0
local integer m
local unit array units
local player p=GetOwningPlayer(hero)
local real x=GetUnitX(hero)
local real y=GetUnitY(hero)
local integer a
local integer j
local real array angle
local integer t=0
if ( FirstOfGroup(g)!=null ) then
loop
set units[n]=FirstOfGroup(g)
exitwhen units[n]==null
set u= CreateUnit( p, 'hsor', x,y, bj_UNIT_FACING )
set angle[n]= bj_RADTODEG * Atan2(GetUnitY(units[n])-y , GetUnitX(units[n])-x)
//set angle[n]=AngleBetweenPoints(loc, GetUnitLoc(units[n]))
call UnitApplyTimedLifeBJ( 10.00, 'BTLF', u )
call ShowUnitHide(u )
call IssueTargetOrderBJ(u, "magicleash", units[n] )
//'Arav'是风暴乌鸦的技能代码
call UnitAddAbilityBJ( 'Arav', units[n] )
call SetUnitFlyHeightBJ(units[n], 250, 0.00 )
call GroupRemoveUnit(g,units[n])
set n=n+1
endloop
set m=n
call TriggerSleepAction( 0.5 )
loop
exitwhen m<=0
set a = 0
loop
exitwhen a > n
//'Bmlt' 是魔法效果代码
if ( units[a]!=null and UnitHasBuffBJ(units[a], 'Bmlt')==false ) then
call SetUnitFlyHeightBJ( units[a], GetUnitDefaultFlyHeight(units[a]), 0.00 )
call UnitRemoveAbilityBJ( 'Arav', units[a] )
set units[a]=null
set m=m-1
else
set angle[a]= angle[a]+2
//call SetUnitPositionLoc(loc,PolarProjectionBJ(loc,500,angle)
call SetUnitX(units[a],x+ 500 * Cos( angle[a] * bj_DEGTORAD))
call SetUnitY(units[a],y+ 500 * Sin( angle[a] * bj_DEGTORAD))
endif
set a = a + 1
endloop
call TriggerSleepAction( 0.00 )
endloop
call DisplayTextToPlayer(p,0,0,"DONE")
endif
call DestroyGroup(g)
call RemoveLocation(loc)
endfunction
//===========================================================================
function InitTrig_test takes nothing returns nothing
set gg_trg_test = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_test, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_test, Condition( function Trig_test_Conditions ) )
call TriggerAddAction( gg_trg_test, function Trig_test_Actions )
endfunction
[ 本帖最后由 鬼龙之舞 于 2006-5-2 20:39 编辑 ]
图片附件:
WC3ScrnShot_050206_143939_01.JPG (2006-5-2 15:25, 119.69 K)
附件:
test.w3x (2006-5-2 15:25, 24.02 K)该附件被下载次数 55
责任编辑:瞳瞳
进入论坛参与针对本文章的讨论
