|
''如果我在施放技能时暂停英雄会出现不断重复施放技能问题''
'请帮忙找多问题'
[jass]function ZhengdiC takes nothing returns boolean
return GetSpellAbilityId() == 'A008'
endfunction
function ZhengdiD takes nothing returns nothing
call UnitDamageTarget(udg_u,GetEnumUnit(),2500,true,false,null,null,null)
call GroupAddUnit(udg_g,GetEnumUnit())
endfunction
function Zhengdiloop takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer a4=GetHandleId(t)
local real angle=0
local real radius=0
local real x1=LoadReal(udg_GC,a4,1)
local real y1=LoadReal(udg_GC,a4,2)
local real x2
local real y2
local integer i=LoadInteger(udg_GC,a4,1)
local integer n=0
local unit tru=LoadUnitHandle(udg_GC,a4,1)
local real x
local real y
local unit u
local group g=CreateGroup()
set i=i+1
call SaveInteger(udg_GC,a4,1,i)
if i<=30 then
if i==1 then
call TimerStart(t,0.1,true,function Zhengdiloop)
endif
set angle=GetRandomReal(0,6.28)
set radius=GetRandomReal(1100,1900)
set x=x1+radius*Cos(angle)
set y=y1+radius*Sin(angle)
set u=CreateUnit(GetOwningPlayer(tru),'e002',x,y,0)
call SetUnitFlyHeight(u,1500,0)
call SetUnitFlyHeight(u,0,750)
elseif i>=93 then
call CreateUnit(GetOwningPlayer(tru),'u006',x1,y1,0)
if i!=100 then
loop
exitwhen n>=72
set x2=x1+1100*Cos(n*5)
set y2=y1+1100*Sin(n*5)
call DestroyEffect(AddSpecialEffect("war3mapImported\\holystrike.mdx",x2,y2))
set n=n+1
endloop
endif
if i==100 then
loop
exitwhen n>=20
set x2=x1+1500*Cos(n*18)
set y2=y1+1500*Sin(n*18)
call CreateUnit(GetOwningPlayer(tru),'u005',x2,y2,GetRandomInt(0,360))
set udg_u=tru
call GroupEnumUnitsInRange(g,x2,y2,800.00,Condition(function GetUnitC1))
call ForGroup(g,function ZhengdiD)
set n=n+1
endloop
call PauseUnit(tru,false) |
call PauseTimer(t)
call FlushChildHashtable(udg_GC,a4)
call DestroyTimer(t)
endif
endif
//call SaveInteger(udg_GC,a4,1,i)
set tru=null
set u=null
set t=null
set g=null
endfunction
function Zhengdi takes nothing returns nothing
local timer t=CreateTimer()
local integer a4=GetHandleId(t)
local real x=GetUnitX(GetTriggerUnit())
local real y=GetUnitY(GetTriggerUnit())
local integer i=0
call PauseUnit(GetTriggerUnit(),true) |
call CreateUnit(GetOwningPlayer(GetTriggerUnit()),'u004',x,y,0.0)
call SaveUnitHandle(udg_GC,a4,1,GetTriggerUnit())
call SaveInteger(udg_GC,a4,1,0)
call SaveReal(udg_GC,a4,1,x)
call SaveReal(udg_GC,a4,2,y)
call TimerStart(t,1.0,false,function Zhengdiloop)
set t=null
endfunction
//===========================================================================
function InitTrig_a4 takes nothing returns nothing
set gg_trg_a4 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_a4, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_a4, Condition( function ZhengdiC ) )
call TriggerAddAction( gg_trg_a4, function Zhengdi )
endfunction[/jass] |
|