- Joined
- Mar 5, 2009
- Messages
- 254
Hello,im currently working on an map and when i tested it i found a bug,when i kill a unit type Murloc Plaguebearer,then the map after like 60 seconds create an type of unit of Elder sasquatch at a point close to center of playable map area.And when i kill more murlocs,(i have respawn system) they do respawn but also the map creates that sasquatchs for every murlocplaguebearer that i kill.When i kill any other type of units this bug doesn't happen.I don't know what is wrong.Here is the respawn system that i use :
-
INIT Store Creeps
-
Events
- Map initialization
- Time - Elapsed game time is 2.00 seconds
- Conditions
-
Actions
- Set Loop = 0
-
Unit Group - Pick every unit in (Units owned by Neutral Hostile) and do (Actions)
-
Loop - Actions
- Set Creep_Type[Loop] = (Unit-type of (Picked unit))
- Set Creep_Position[Loop] = (Position of (Picked unit))
- Unit - Set the custom value of (Picked unit) to Loop
- Set Loop = (Loop + 1)
-
Loop - Actions
-
Events
JASS:
function Trig_Revive_Creeps_Actions takes nothing returns nothing
local integer CUSTOM
set CUSTOM = GetUnitUserData(GetDyingUnit())
call TriggerSleepAction( 60.00 )
call CreateNUnitsAtLoc( 1, udg_Creep_Type[CUSTOM], Player(PLAYER_NEUTRAL_AGGRESSIVE), udg_Creep_Position[CUSTOM], bj_UNIT_FACING )
call SetUnitUserData( GetLastCreatedUnit(), CUSTOM )
endfunction
//===========================================================================
function InitTrig_Revive_Creeps takes nothing returns nothing
set gg_trg_Revive_Creeps = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Revive_Creeps, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Revive_Creeps, function Trig_Revive_Creeps_Actions )
endfunction