|
[jass]
function Master1B_Conditions takes nothing returns boolean
if ( GetUnitAbilityLevel(GetTriggerUnit(), 'BNba') > 0 ) then
return true
endif
return false
endfunction
function Master1B_Actions takes nothing returns nothing
local integer i = ( GetUnitAbilityLevel(udg_Master1, 'A04H') * 21 )
local unit a3 = GetTriggerUnit()
local player pl = GetOwningPlayer(a3)
local location p
if ( GetUnitState(a3, UNIT_STATE_LIFE) > I2R(i) ) then
call SetUnitLifeBJ( a3, ( GetUnitState(a3, UNIT_STATE_LIFE) - I2R(i) ) )
else
set p = GetUnitLoc(GetAttackedUnitBJ())
call KillUnit( a3 )
call ReviveHeroLoc( a3, p , false )
call SetUnitOwner( a3, Player(11), false )
call UnitShareVision( a3, pl, true )
endif
endfunction
function M1B_con takes nothing returns boolean
local trigger t
local unit x = GetAttackedUnitBJ()
if ( not ( GetUnitTypeId(GetAttacker()) == 'NC14' ) ) then
return false
endif
set t = CreateTrigger()
call TriggerRegisterUnitEvent(t, x, EVENT_UNIT_DAMAGED)
call TriggerAddCondition( t, Condition( function Master1B_Conditions ) )
call TriggerAddAction( t, function Master1B_Actions )
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
[/jass]
我给所有英雄设置了变量
在英雄复活的最后加上 改变XX所有者为XX
可惜在几次之后
就变不回来了
不知道为什么 |
|