feistaghelm
New Member
- Reaction score
- 2
I have a JASS code that I got from one of these posts that make creeps respawn as random creeps of the same level. Here tis...
function Trig_RespawnCreeps_Test takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), Player(PLAYER_NEUTRAL_AGGRESSIVE)) )
endfunction
function Trig_RespawnCreeps_Actions takes nothing returns nothing
local location Position = GetUnitLoc(GetDyingUnit())
local integer Level = GetUnitLevel(GetDyingUnit())
loop
call PolledWait( GetRandomReal(25.00, 55.00) )
exitwhen ( IsUnitGroupEmptyBJ(GetUnitsInRangeOfLocMatching(1536.00, Position, Condition(function Trig_RespawnCreeps_Test))) == true )
endloop
call CreateNUnitsAtLoc( 1, ChooseRandomCreepBJ(Level), Player(PLAYER_NEUTRAL_AGGRESSIVE), Position, bj_UNIT_FACING )
endfunction
function InitTrig_RespawnCreeps takes nothing returns nothing
set gg_trg_RespawnCreeps = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_RespawnCreeps, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_RespawnCreeps, function Trig_RespawnCreeps_Actions )
endfunction
Now my question is, how do I make the dead creep respawn as the same creep? I need it for quests mobs.
Thanks Tamisrah but I have no idea how to make your code work. I am horrible with JASS. Does anyone have a GUI code for respawning the same creep that died?
I got a great code for respawning the same creep that died. Took a little searching, which I am horrible at, but found it. here tis for anyone that needs it.
function Trig_Respawn5_Func_Test takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), Player(PLAYER_NEUTRAL_AGGRESSIVE)) )
endfunction
function Trig_Respawn5_Actions takes nothing returns nothing
local location tmpPoint = GetUnitLoc(GetDyingUnit())
local integer tmpUnit = GetUnitTypeId(GetDyingUnit())
loop
call PolledWait( GetRandomReal(240.00, 300.00) )
exitwhen ( IsUnitGroupEmptyBJ(GetUnitsInRangeOfLocMatching(1536.00, tmpPoint, Condition(function Trig_Respawn5_Func_Test))) )
endloop
call CreateNUnitsAtLoc( 1, tmpUnit, Player(PLAYER_NEUTRAL_AGGRESSIVE), tmpPoint, bj_UNIT_FACING )
endfunction
//===========================================================================
function InitTrig_Respawn5 takes nothing returns nothing
set gg_trg_Respawn5 = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Respawn5, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Respawn5, function Trig_Respawn5_Actions )
endfunction
Enjoy and thanks to AceHeart for both random and specific respawn codes.
function Trig_RespawnCreeps_Test takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), Player(PLAYER_NEUTRAL_AGGRESSIVE)) )
endfunction
function Trig_RespawnCreeps_Actions takes nothing returns nothing
local location Position = GetUnitLoc(GetDyingUnit())
local integer Level = GetUnitLevel(GetDyingUnit())
loop
call PolledWait( GetRandomReal(25.00, 55.00) )
exitwhen ( IsUnitGroupEmptyBJ(GetUnitsInRangeOfLocMatching(1536.00, Position, Condition(function Trig_RespawnCreeps_Test))) == true )
endloop
call CreateNUnitsAtLoc( 1, ChooseRandomCreepBJ(Level), Player(PLAYER_NEUTRAL_AGGRESSIVE), Position, bj_UNIT_FACING )
endfunction
function InitTrig_RespawnCreeps takes nothing returns nothing
set gg_trg_RespawnCreeps = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_RespawnCreeps, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_RespawnCreeps, function Trig_RespawnCreeps_Actions )
endfunction
Now my question is, how do I make the dead creep respawn as the same creep? I need it for quests mobs.
Thanks Tamisrah but I have no idea how to make your code work. I am horrible with JASS. Does anyone have a GUI code for respawning the same creep that died?
I got a great code for respawning the same creep that died. Took a little searching, which I am horrible at, but found it. here tis for anyone that needs it.
function Trig_Respawn5_Func_Test takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), Player(PLAYER_NEUTRAL_AGGRESSIVE)) )
endfunction
function Trig_Respawn5_Actions takes nothing returns nothing
local location tmpPoint = GetUnitLoc(GetDyingUnit())
local integer tmpUnit = GetUnitTypeId(GetDyingUnit())
loop
call PolledWait( GetRandomReal(240.00, 300.00) )
exitwhen ( IsUnitGroupEmptyBJ(GetUnitsInRangeOfLocMatching(1536.00, tmpPoint, Condition(function Trig_Respawn5_Func_Test))) )
endloop
call CreateNUnitsAtLoc( 1, tmpUnit, Player(PLAYER_NEUTRAL_AGGRESSIVE), tmpPoint, bj_UNIT_FACING )
endfunction
//===========================================================================
function InitTrig_Respawn5 takes nothing returns nothing
set gg_trg_Respawn5 = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Respawn5, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Respawn5, function Trig_Respawn5_Actions )
endfunction
Enjoy and thanks to AceHeart for both random and specific respawn codes.