|
[codes=jass]
function Heros_die2 takes nothing returns boolean
local integer lv = GetUnitLevel(udg_Player2)
if ( GetDyingUnit() == udg_Player2 ) and ( GetUnitAbilityLevel(GetDyingUnit(), 'A00H') == 0 ) and ( UnitHasItemOfTypeBJ(GetDyingUnit(), 'ankh') == false ) then
set udg_DeathPoint[2] = GetUnitLoc(udg_Player2)
set udg_Int_die[2]=udg_Int_die[2]+1
call SetPlayerStateBJ( Player(1), PLAYER_STATE_RESOURCE_FOOD_USED, udg_Int_die[2] )
call StartTimerBJ( udg_T_Reincarnation[2], false, udg_Int_die[2] * 3 +lv )
call BJDebugMsg("玩家2复活开启")
endif
return false
endfunction
//===========================================================================
function InitTrig_Heros_die2 takes nothing returns nothing
set gg_trg_Heros_die2 = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Heros_die2, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Heros_die2, Condition( function Heros_die2 ) )
endfunction
function Reincarnation2 takes nothing returns boolean
call ReviveHeroLoc( udg_Player2, udg_DeathPoint[2], true )
call SetUnitManaPercentBJ( udg_Player2, 70.00 )
call RemoveLocation( udg_DeathPoint[2] )
set udg_DeathPoint[2]=null
call SelectUnitForPlayerSingle( udg_Player2, Player(1) )
return false
endfunction
//===========================================================================
function InitTrig_Reincarnation2 takes nothing returns nothing
set gg_trg_Reincarnation2 = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Reincarnation2, udg_T_Reincarnation[2] )
call TriggerAddCondition( gg_trg_Reincarnation2, Condition( function Reincarnation2 ) )
endfunction
[/codes]
那条DEBUG显示了
玩家2是事先设置的Player2
但不知道为什么无法复活 |
|