|
其实是想做黑暗之箭的触发
[codes=jass]
function Trig_Master1B_Conditions takes nothing returns boolean
if ( GetUnitAbilityLevel(GetAttackedUnitBJ(), 'BNba') > 0 ) and ( GetUnitTypeId(GetAttacker()) == 'NC14' ) then
return true
endif
return false
endfunction
function Trig_Master1B_Actions takes nothing returns nothing
local integer i = ( GetUnitAbilityLevel(udg_Master1, 'A04H') * 21 )
local unit a = GetAttackedUnitBJ()
local player pl = GetOwningPlayer(a)
local location p
if ( GetUnitState(a, UNIT_STATE_LIFE) >= I2R(i) ) then
call SetUnitLifeBJ( a, ( GetUnitState(a, UNIT_STATE_LIFE) - I2R(i) ) )
else
set p = GetUnitLoc(GetAttackedUnitBJ())
call KillUnit( a )
call ReviveHeroLoc( a, p , false )
call SetUnitOwner( a, Player(11), false )
call UnitShareVision( a, pl, true )
endif
endfunction
//===========================================================================
function InitTrig_Master1B takes nothing returns nothing
set gg_trg_Master1B = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Master1B, Player(0), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Master1B, Player(1), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Master1B, Player(2), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Master1B, Player(3), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Master1B, Player(4), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Master1B, Player(5), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Master1B, Player(6), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Master1B, Player(7), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Master1B, Condition( function Trig_Master1B_Conditions ) )
call TriggerAddAction( gg_trg_Master1B, function Trig_Master1B_Actions )
endfunction
[/codes] |
|