|
[codes=jass]
function act takes nothing returns boolean
local unit abc = GetTriggerUnit()
local integer i = ( GetUnitAbilityLevel(udg_Master1, 'A04H') * 9 )
local player pl = GetOwningPlayer(abc)
local location p
if not ( GetUnitAbilityLevel( abc , 'Bcsd') != 0 ) then
return false
else
if ( GetUnitState(abc, UNIT_STATE_LIFE) > I2R(i) ) then
call SetUnitLifeBJ( abc, ( GetUnitState(abc, UNIT_STATE_LIFE) - I2R(i) ) )
else
set p = GetUnitLoc(GetAttackedUnitBJ())
call KillUnit( abc )
call ReviveHeroLoc( abc, p , false )
call SetUnitOwner( abc, Player(11), false )
call UnitShareVision( abc, pl, true )
endif
endif
return false
endfunction
function check takes unit abc returns nothing
local trigger t
local triggercondition x
call TriggerRegisterUnitEvent(t, abc, EVENT_UNIT_DAMAGED)
set x = TriggerAddCondition( t, Condition( function act ) )
endfunction
function M1B_con takes nothing returns boolean
local unit x = GetAttackedUnitBJ()
if ( not ( GetUnitTypeId(GetAttacker()) == 'NC14' ) ) then
return false
endif
call check ( x )
set x = null
return false
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 M1B_con ) )
endfunction
[/codes]
还是一个触发,继续修改中,但目前没看出效果
上次修改还能看有效果呢 |
|