|
[codes=jass]
function PauseUnit_Condition takes nothing returns boolean
if ( ( GetIssuedOrderId() == String2OrderIdBJ( smart ) ) ) then
return true
endif
if ( ( GetIssuedOrderId() == String2OrderIdBJ( attack ) ) ) then
return true
endif
if ( ( GetIssuedOrderId() == String2OrderIdBJ( attackground ) ) ) then
return true
endif
if ( ( GetIssuedOrderId() == String2OrderIdBJ( move ) ) ) then
return true
endif
if (GetSpellAbilityId()!= 0 and GetSpellAbilityId()!= A00E ) then //这就是单位唯一能释放的技能Id。
return true
endif
return false
endfunction
function StopUnitXL takes nothing returns nothing
call IssueImmediateOrderById(I2U(GetStoredInteger(udg_Data,I2S(H2I(GetExpiredTimer())), TheHero )), 851972 )
call FlushStoredMission(udg_Data,I2S(H2I(GetExpiredTimer())))
call DestroyTimer(GetExpiredTimer())
endfunction
function PauseUnitXL takes nothing returns nothing
local timer ti=null
set ti=CreateTimer()
call StoreInteger(udg_Data,I2S(H2I(ti)), TheHero ,H2I(GetTriggerUnit()))
call TimerStart(ti,0.00001,false,function StopUnitXL)
set ti=null
endfunction
function PauseUnit_a takes unit u returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterUnitEvent(t,u,EVENT_UNIT_ISSUED_POINT_ORDER)
call TriggerRegisterUnitEvent(t,u,EVENT_UNIT_ISSUED_TARGET_ORDER)
call TriggerRegisterUnitEvent(t,u,EVENT_UNIT_SPELL_CHANNEL)
call TriggerAddCondition(t,Condition(function PauseUnit_Condition))
call TriggerAddAction(t,function PauseUnitXL)
set t=null
endfunction[/codes]
附:测试地图
作用:看得见别的技能的图标,就是不能使。
BUG:单位能在攻击范围内自动攻击。
PS:改了一下。 |
评分
-
查看全部评分
|