TheDeadFight
New Member
- Reaction score
- 1
I hope useful
in GUI :
in JASS :
create both of this variable :
in GUI :
Trigger:
- Revive
- Events
- Unit - A unit Dies
- Conditions
- ((Owner of (Triggering unit)) Equal to Neutral Hostile) and (((Triggering unit) is Summoned) Not equal to True)
- Actions
- Custom script: local string udg_CreepType
- Custom script: local location udg_CreepPoss
- Custom script: set udg_CreepType = UnitId2StringBJ(GetUnitTypeId(GetDyingUnit()))
- Custom script: set udg_CreepPoss = GetUnitLoc(GetDyingUnit())
- Set CreepPoss = (Position of (Dying unit))
- Wait 10.00 game-time seconds
- Unit - Create 1 (Unit-type(CreepType)) for Neutral Hostile at CreepPoss facing (Random angle) degrees
- Set CreepType = <Empty String>
- Custom script: call RemoveLocation(udg_CreepPoss)
- Events
in JASS :
create both of this variable :
Code:
Variable Name Variable Type
CreepPoss Point
CreepType String
JASS:
function Trig_Revive_Func006001 takes nothing returns boolean
return ( GetOwningPlayer(GetTriggerUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) )
endfunction
function Trig_Revive_Func006002 takes nothing returns boolean
return ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_SUMMONED) != true )
endfunction
function Trig_Revive_Conditions takes nothing returns boolean
if ( not GetBooleanAnd( Trig_Revive_Func006001(), Trig_Revive_Func006002() ) ) then
return false
endif
return true
endfunction
function Trig_Revive_Actions takes nothing returns nothing
local string udg_CreepType
local location udg_CreepPoss
set udg_CreepType = UnitId2StringBJ(GetUnitTypeId(GetDyingUnit()))
set udg_CreepPoss = GetUnitLoc(GetDyingUnit())
set udg_CreepPoss = GetUnitLoc(GetDyingUnit())
call PolledWait( 10.00 )
call CreateNUnitsAtLoc( 1, String2UnitIdBJ(udg_CreepType), Player(PLAYER_NEUTRAL_AGGRESSIVE), udg_CreepPoss, GetRandomDirectionDeg() )
set udg_CreepType = ""
call RemoveLocation(udg_CreepPoss)
endfunction
//===========================================================================
function InitTrig_Revive takes nothing returns nothing
set gg_trg_Revive = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Revive, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Revive, Condition( function Trig_Revive_Conditions ) )
call TriggerAddAction( gg_trg_Revive, function Trig_Revive_Actions )
endfunction