|
先上代码。
[jass]
library JSWLIB
//条件
function Trig_Js_W_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00H' ) ) then
return false
endif
return true
endfunction
//计时器动作
function Js_Wzhouqi takes nothing returns nothing
local integer i = GetHandleId(GetExpiredTimer())
local unit u = LoadUnitHandle(hx,i,1)
local unit u2 = LoadUnitHandle(hx,i,2)
local real x = LoadReal(hx,i,3)
local location d1 = GetUnitLoc(u2)
local location d3 = GetUnitLoc(u)
local unit u3
local location d2 = PolarProjectionBJ((d1), GetRandomReal(20.00, 250.00), AngleBetweenPoints(d3,d1))
local integer i2 = GetUnitAbilityLevelSwapped('A00H', u)+1
if(x<=I2R(i2)) then
call SetUnitPositionLoc(u,d2)
set u3 = CreateUnitAtLoc(GetOwningPlayer(u),'ewsp',d3, AngleBetweenPoints(d3,d1))
call UnitApplyTimedLifeBJ( 1.00, 'BHwe', u3 )
call SetUnitVertexColor( u3, 255, 255, 255, 70 )
call SetUnitAnimation(u3,"attack ")
call UnitDamageTargetBJ( u, u2, I2R(GetHeroAgi(u, true)), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
call SetUnitFacingToFaceLocTimed(u,d1,0)
call SetUnitAnimation(u,"attack slam")
set x = x+1.00
call SaveReal(hx,i,3,x)
set u3 =null
set u =null
set u2=null
call RemoveLocation(d1)
call RemoveLocation(d2)
call RemoveLocation(d3)
else
call DestroyTimer(GetExpiredTimer())
call FlushChildHashtable(hx,i)
call UnitRemoveAbilityBJ('A00E',u)
call SetUnitTimeScale( u, 1.00 )
call SetUnitInvulnerable(u,false)
call PauseUnit(u,false)
set u =null
set u2= null
call RemoveLocation(d1)
call RemoveLocation(d2)
call RemoveLocation(d3)
endif
endfunction
//主函数
function Trig_Js_W_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit u2=GetSpellTargetUnit()
local timer t = CreateTimer()
local integer i = GetHandleId(t)
call SetUnitTimeScale( u, 10.00 )
call PauseUnit( u,true )
call SetUnitInvulnerable( u, true )
call UnitAddAbilityBJ('A00E',u)
call SaveUnitHandle(hx,i,1,u)
call SaveUnitHandle(hx,i,2,u2)
call TimerStart(t,0.1,true,function Js_Wzhouqi)
set u = null
set u2= null
set t = null
endfunction
//注册
function Js_W takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition(t, Condition( function Trig_Js_W_Conditions ) )
call TriggerAddAction( t, function Trig_Js_W_Actions )
set t = null
endfunction
endlibrary[/jass]
-
- //调用函数
- 事件游戏逝去0秒
- 动作-call Js_W
复制代码
这个原技能是风暴之锤。 没有call Js_W 就有眩晕效果 call了Js_W就无效果。问题很纠结 |
|