|
本帖最后由 Simonade 于 2013-7-20 11:31 编辑
globals
hashtable h=InitHashtable()
endglobals
//========================================================================
function Scale takes integer T returns nothing
local unit dummy=LoadUnitHandle(h,0,0)
call SetUnitScale(dummy,3.0+T*0.0125,3.0+T*0.0125,3.0+T*0.0125)
set dummy=null
endfunction
//=========================================================================
function IsDrop takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(LoadUnitHandle(h,0,0)))==true
endfunction
//=========================================================================
function Grow takes nothing returns nothing
local timer t=GetExpiredTimer()
local location point=LoadLocationHandle(h,GetHandleId(t),0)
local unit dummy=LoadUnitHandle(h,0,0)
local integer T=LoadInteger(h,GetHandleId(t),10)
local integer n=LoadInteger(h,GetHandleId(t),11) //
local group g=CreateGroup()
local unit u
local location loc
local real ang
set T=T+1
call SaveInteger(h,GetHandleId(t),10,T)
call BJDebugMsg("位置11111111111111"+I2S(T))
call Scale(T)
call BJDebugMsg("位置222222222222222222222222222222"+I2S(T))
call GroupEnumUnitsInRange(g,GetLocationX(point),GetLocationY(point),500.0+(n/200.0)*100.0,Condition(function IsDrop))//Condition(function IsDrop)
call BJDebugMsg("位置33333333333333333333333333333333333333333333333333333333"+I2S(T))
loop
set u=FirstOfGroup(g)
exitwhen u==null
set loc=GetUnitLoc(u)
set ang=Atan2(GetLocationY(point)-GetLocationY(loc),GetLocationX(point)-GetLocationX(loc))
call SetUnitX(u,GetLocationX(loc)+(5.0+n/25.0)*Cos(ang+1.0833-T*0.0025))
call SetUnitY(u,GetLocationY(loc)+(5.0+n/25.0)*Sin(ang+1.0833-T*0.0025))
call RemoveLocation(loc)
call GroupRemoveUnit(g,u)
call UnitDamageTarget(dummy,u,0.5+n/5000.0,false,false,ATTACK_TYPE_MELEE,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)//就是这里了单位数量n还不到100啊
set u=null set loc=null
set n=n+1
endloop
call SaveInteger(h,GetHandleId(t),11,n)
if T==420 then
call PauseTimer(t)
call DestroyTimer(t)
call RemoveLocation(point)
call DestroyEffect(LoadEffectHandle(h,GetHandleId(point),0))//call DestroyEffect(LoadEffectHandle(h,GetHandleId(point),1))
call FlushChildHashtable(h,GetHandleId(point))
call FlushChildHashtable(h,GetHandleId(t))
call RemoveUnit(dummy) //LoadUnitHandle(h,0,0)
endif
call BJDebugMsg(I2S(n))
set t=null
set point=null
set dummy=null
set g=null
endfunction
//=======================================================
function Start takes nothing returns nothing
local timer t
local location point
local unit dummy
local effect eff1 //local effect eff2
if GetSpellAbilityId()!='AUdd' then
return
endif
set point=GetSpellTargetLoc()
set eff1=AddSpecialEffect("war3mapImported\\Black.mdl",GetLocationX(point),GetLocationY(point))
//set eff2=AddSpecialEffect("war3mapImported\\GrudgeAura.mdl",GetLocationX(point),GetLocationY(point))
set dummy=CreateUnit(GetOwningPlayer(GetTriggerUnit()),'e001',GetLocationX(point),GetLocationY(point),0.0)
call SaveEffectHandle(h,GetHandleId(point),0,eff1) //call SaveEffectHandle(h,GetHandleId(point),1,eff2)
call SaveUnitHandle(h,0,0,dummy)
set t=CreateTimer()
call SaveLocationHandle(h,GetHandleId(t),0,point)
call TimerStart(t,0.05,true,function Grow)
set t=null
set point=null
set dummy=null
set eff1=null //set eff2=null
endfunction
//===========================================================================
function InitTrig_blackhole takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction(t,function Start)
set t=null
endfunction
//
//call Scale(T,point)
//loop
//exitwhen i==2
//call SetFogStateRadius(Player(i),FOG_OF_WAR_FOGGED,GetLocationX(point),GetLocationY(point),30.0+T*0.75,false)
//set i=i+1
//endloop
|
-
黑洞吸的单位越多就吸引力越强,范围越大,结果把全图的单位都吸过来了。。。
-
-
太初黑洞测试版.w3x
50.75 KB, 下载次数: 0
|