Name | Type | is_array | initial_value |
HR_BOOLEAN | boolean | Yes | |
HR_CAMERA | boolean | No | |
HR_DUMMY | unitcode | No | |
HR_DUMMY_LIFE_INCREASE | real | Yes | |
HR_EFFECT | boolean | No | |
HR_HERO_DIE_LOC | location | Yes | |
HR_HERO_PLAYER | unit | Yes | |
HR_MANA | boolean | No | |
HR_MANA_RESTORE | real | No | |
HR_REVIVE_POINT | location | Yes | |
HR_SELECT | boolean | No | |
HR_UNITG | group | No |
//TESH.scrollpos=0
//TESH.alwaysfold=0
//
//________________________________________________________________________________________________
//
// |-----\ |------| \ / |---------| \ / |-----|
// | | | \ / | \ / |
// |-----/ |---| \ / | \ / |---|
// | \ | \ / | \ / |
// | \ |------| \/ |---------| \/ |-----|
//
// by Silver Dust
//
// Version 1.00
//
// -----------------------------------------------------------------------------------------------
// What is Revive?
// Revive is event that makes your hero life back.
// -----------------------------------------------------------------------------------------------
//
//________________________________________________________________________________________________
// How to Import?
// -----------------------------------------------------------------------------------------------
//
// 1. Go to trigger editor, create a new trigger and go to Edit > Convert to Custom Text
// 2. Copy (Ctrl + C) and Paste (Ctrl + V) all the data here into that trigger
// 3. Go to Variables (Ctrl + B) and create a new variables,
// 4. Create a Unit make sure the object Id is this " 'h00C' " and then You're done!
// -----------------------------------------------------------------------------------------------
//
function Trig_Hero_Die_JASS_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetDyingUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function Trig_Hero_Die_JASS_Actions takes nothing returns nothing
// // //// // //// // //// // //// // //// // //// // //// // ////
// // SPAWNING DUMMY
// // //// // //// // //// // //// // //// // //// // //// // ////
set udg_HR_HERO_DIE_LOC[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = GetUnitLoc(GetDyingUnit())
set udg_HR_HERO_PLAYER[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = GetDyingUnit()
set udg_HR_DUMMY_LIFE_INCREASE[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = ( 0.40 - ( 0.01 * I2R(GetHeroLevel(udg_HR_HERO_PLAYER[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))])) ) )
call CreateNUnitsAtLoc( 1, udg_HR_DUMMY, GetOwningPlayer(udg_HR_HERO_PLAYER[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))]), udg_HR_HERO_DIE_LOC[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))], GetUnitFacing(udg_HR_HERO_PLAYER[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))]) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_HR_UNITG )
call SetUnitAnimation( GetLastCreatedUnit(), "birth" )
call AddSpecialEffectLocBJ( GetUnitLoc(GetLastCreatedUnit()), "Abilities\\Spells\\Human\\Resurrect\\ResurrectCaster.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call SetUnitLifeBJ( GetLastCreatedUnit(), 1.00 )
// // //// // //// // //// // //// // //// // //// // //// // ////
// // //// // //// // //// // //// // //// // //// // //// // ////
endfunction
//===========================================================================
function InitTrig_Hero_Die_JASS takes nothing returns nothing
set gg_trg_Hero_Die_JASS = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hero_Die_JASS, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Hero_Die_JASS, Condition( function Trig_Hero_Die_JASS_Conditions ) )
call TriggerAddAction( gg_trg_Hero_Die_JASS, function Trig_Hero_Die_JASS_Actions )
endfunction
//TESH.scrollpos=64
//TESH.alwaysfold=0
function Trig_Hero_Die_Loop_JASS_Func002Func001Func001Func001001001002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
function Trig_Hero_Die_Loop_JASS_Func002Func001Func001Func003001001002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
function Trig_Hero_Die_Loop_JASS_Func002Func001Func001C takes nothing returns boolean
if ( not ( udg_HR_EFFECT == true ) ) then
return false
endif
return true
endfunction
function Trig_Hero_Die_Loop_JASS_Func002Func001Func002Func002001001002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
function Trig_Hero_Die_Loop_JASS_Func002Func001Func002C takes nothing returns boolean
if ( not ( udg_HR_MANA == true ) ) then
return false
endif
return true
endfunction
function Trig_Hero_Die_Loop_JASS_Func002Func001Func003C takes nothing returns boolean
if ( not ( udg_HR_SELECT == true ) ) then
return false
endif
return true
endfunction
function Trig_Hero_Die_Loop_JASS_Func002Func001Func004C takes nothing returns boolean
if ( not ( udg_HR_CAMERA == true ) ) then
return false
endif
return true
endfunction
function Trig_Hero_Die_Loop_JASS_Func002Func001C takes nothing returns boolean
if ( not ( GetUnitLifePercent(GetEnumUnit()) == 100.00 ) ) then
return false
endif
return true
endfunction
function Trig_Hero_Die_Loop_JASS_Func002A takes nothing returns nothing
if ( Trig_Hero_Die_Loop_JASS_Func002Func001C() ) then
if ( Trig_Hero_Die_Loop_JASS_Func002Func001Func001C() ) then
call ReviveHeroLoc( GroupPickRandomUnit(GetUnitsOfPlayerMatching(GetOwningPlayer(GetEnumUnit()), Condition(function Trig_Hero_Die_Loop_JASS_Func002Func001Func001Func003001001002))), udg_HR_REVIVE_POINT[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))], true )
else
call ReviveHeroLoc( GroupPickRandomUnit(GetUnitsOfPlayerMatching(GetOwningPlayer(GetEnumUnit()), Condition(function Trig_Hero_Die_Loop_JASS_Func002Func001Func001Func001001001002))), udg_HR_REVIVE_POINT[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))], false )
endif
if ( Trig_Hero_Die_Loop_JASS_Func002Func001Func002C() ) then
call SetUnitManaPercentBJ( GroupPickRandomUnit(GetUnitsOfPlayerMatching(GetOwningPlayer(GetEnumUnit()), Condition(function Trig_Hero_Die_Loop_JASS_Func002Func001Func002Func002001001002))), 100 )
else
endif
if ( Trig_Hero_Die_Loop_JASS_Func002Func001Func003C() ) then
call SelectUnitForPlayerSingle( udg_HR_HERO_PLAYER[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))], GetOwningPlayer(GetEnumUnit()) )
else
endif
if ( Trig_Hero_Die_Loop_JASS_Func002Func001Func004C() ) then
call SmartCameraPanBJ( GetOwningPlayer(GetEnumUnit()), udg_HR_REVIVE_POINT[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))], 0.5 )
else
endif
call SetUnitAnimation( GetEnumUnit(), "death" )
call UnitApplyTimedLifeBJ( 0.75, 'BTLF', GetEnumUnit() )
else
call SetUnitLifePercentBJ( GetEnumUnit(), ( GetUnitLifePercent(GetEnumUnit()) + udg_HR_DUMMY_LIFE_INCREASE[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))] ) )
endif
endfunction
function Trig_Hero_Die_Loop_JASS_Actions takes nothing returns nothing
set udg_HR_UNITG = GetUnitsOfTypeIdAll(udg_HR_DUMMY)
call ForGroupBJ( udg_HR_UNITG, function Trig_Hero_Die_Loop_JASS_Func002A )
call DestroyGroup(udg_HR_UNITG)
endfunction
//===========================================================================
function InitTrig_Hero_Die_Loop_JASS takes nothing returns nothing
set gg_trg_Hero_Die_Loop_JASS = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Hero_Die_Loop_JASS, 0.10 )
call TriggerAddAction( gg_trg_Hero_Die_Loop_JASS, function Trig_Hero_Die_Loop_JASS_Actions )
endfunction