|
高人指点下,这个使用矩形制作的技能,该怎么完全排泄
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Bengquan_Con takes nothing returns boolean
return GetSpellAbilityId() == 'A090'
endfunction
function Bengquan_ActI takes nothing returns nothing
local string s=I2S(H2I(GetExpiredTimer()))
local unit u=I2U(GetStoredInteger(udg_GC,s,"u"))
local real a=GetStoredReal(udg_GC,s,"a")
local integer i=GetStoredInteger(udg_GC,s,"i")
local group g=RectAct(100,200,a,GetUnitX(u),GetUnitY(u),CreateGroup(),false,false,GetPlayerId(GetOwningPlayer(u)))
local unit ut=null
local real d=GetStoredReal(udg_GC,s,"d")
loop
set ut=FirstOfGroup(g)
call GroupRemoveUnit(g,ut)
call UnitDamageTarget(u,ut,d,true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_FORCE,WEAPON_TYPE_METAL_HEAVY_BASH)
call SetUnitX(ut,GetUnitX(ut)+15*Cos(a))
call SetUnitY(ut,GetUnitY(ut)+15*Sin(a))
exitwhen ut==null
endloop
call SetUnitX(u,GetUnitX(u)+15*Cos(a))
call SetUnitY(u,GetUnitY(u)+15*Sin(a))
if i>2 then
call DestroyTimer(GetExpiredTimer())
call DestroyEffect(I2E(GetStoredInteger(udg_GC,s,"eff1")))
call DestroyEffect(I2E(GetStoredInteger(udg_GC,s,"eff2")))
call DestroyEffect(I2E(GetStoredInteger(udg_GC,s,"eff3")))
call FlushStoredMission(udg_GC,s)
call PauseUnit(u,false)
call SetUnitTimeScale(u,1)
else
set i=i+1
call StoreInteger(udg_GC,s,"i",i)
endif
set u=null
call DestroyGroup(g)
set g=null
set ut=null
endfunction
function Bengquan_Act takes nothing returns nothing
local location l=GetSpellTargetLoc()
local unit u=GetTriggerUnit()
local timer t=CreateTimer()
local real a=Atan2(GetLocationY(l)-GetUnitY(u),GetLocationX(l)-GetUnitX(u))
call PauseUnit(u,true)
call StoreInteger(udg_GC,I2S(H2I(t)),"eff1",H2I(AddSpecialEffectTarget("Abilities \\Spells\\NightElf\\Blink\\BlinkCaster.mdl",u,"weapon")))
call StoreInteger(udg_GC,I2S(H2I(t)),"eff2",H2I(AddSpecialEffectTarget("Abilities \\Spells\\Orc\\Disenchant\\DisenchantSpecialArt.mdl",u,"weapon")))
call StoreInteger(udg_GC,I2S(H2I(t)),"eff3",H2I(AddSpecialEffectTarget("Abilities \\Spells\\Undead\\FreezingBreath\\FreezingBreathMissile.mdl",u,"weapon")))
call SetUnitTimeScale(u,5)
call SetUnitAnimation(u,"Attack Two")
call StoreInteger(udg_GC,I2S(H2I(t)),"u",H2I(u))
call StoreReal(udg_GC,I2S(H2I(t)),"a",a)
call StoreReal(udg_GC,I2S(H2I(t)),"d",GetHeroStr(u,true)*0.5+25*GetUnitAbilityLevel(u,'A090'))
call TimerStart(t,0.01,true,function Bengquan_ActI)
set l=null
set u=null
set t=null
endfunction
function InitTrig_Bengquan takes nothing returns nothing
set gg_trg_Bengquan = CreateTrigger()
call TriggerRegisterUnitEvent(gg_trg_Bengquan,gg_unit_N004_0233,EVENT_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Bengquan,Condition(function Bengquan_Con))
call TriggerAddAction(gg_trg_Bengquan,function Bengquan_Act)
endfunction |
|