|
constant function AttackGround_SpellId takes nothing returns integer
return 'A04L' // The dummy spell ability... based off Channel
endfunction
constant function AttackGround_OrderId takes nothing returns integer
return OrderId("channel") // The dummy spell ability order id
endfunction
constant function AttackGround_DummyUnitId takes nothing returns integer
return 'h00A' // Dummy target unit (semi-locust no model, godlike stats (99999 hp... 1000 divine armor)
endfunction
//===========================================================================
function Trig_AttackGround_Conditions takes nothing returns boolean
return (GetIssuedOrderId() == AttackGround_OrderId()) and GetUnitAbilityLevel(GetTriggerUnit(),AttackGround_SpellId())>0
endfunction
function BlockDamage takes nothing returns boolean
if GetTriggerEventId()==EVENT_UNIT_DAMAGED then
call SetUnitState(GetTriggerUnit() ,UNIT_STATE_LIFE, GetUnitState(GetTriggerUnit() , UNIT_STATE_MAX_LIFE))
return false
else
return true
endif
endfunction
function Trig_AttackGround_Actions takes nothing returns nothing
local trigger t=CreateTrigger()
local triggercondition tc
local unit u=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),AttackGround_DummyUnitId(),GetOrderPointX(),GetOrderPointY(),0.)
call ShowUnit(u,false)
call UnitRemoveAbility(u,'Aloc')
call ShowUnit(u,true)
call SetUnitX(u,GetOrderPointX())
call SetUnitY(u,GetOrderPointY())
call UnitAddAbility(GetOrderedUnit(),'A04J')
call IssueTargetOrder(GetOrderedUnit(),"attack",u)
call TriggerRegisterUnitEvent( t ,u, EVENT_UNIT_DAMAGED )
set tc= TriggerAddCondition(t,Condition(function BlockDamage))
call TriggerSleepAction(0.00)
call TriggerRegisterUnitEvent( t ,GetOrderedUnit(), EVENT_UNIT_ISSUED_TARGET_ORDER )
call TriggerRegisterUnitEvent( t ,GetOrderedUnit(), EVENT_UNIT_ISSUED_POINT_ORDER )
call TriggerRegisterUnitEvent( t ,GetOrderedUnit(), EVENT_UNIT_ISSUED_ORDER )
call TriggerRegisterUnitEvent( t ,GetOrderedUnit(), EVENT_UNIT_DEATH)
loop
exitwhen GetTriggerExecCount(t)>0
call TriggerSleepAction(0.00)
endloop
call TriggerRemoveCondition(t,tc)
call UnitRemoveAbility(GetOrderedUnit(),'A04J')
call DestroyTrigger(t)
call RemoveUnit(u)
set u=null
set tc=null
set t=null
endfunction
//===========================================================================
function InitTrig_AttackGround takes nothing returns nothing
set gg_trg_AttackGround = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_AttackGround, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerAddCondition( gg_trg_AttackGround, Condition( function Trig_AttackGround_Conditions ) )
call TriggerAddAction( gg_trg_AttackGround, function Trig_AttackGround_Actions )
endfunction
这个技能如何把开始施放技能改为发动技能效果 |
|