worldeditors
Cool Member
- Reaction score
- 1
Hello, I'm doing a creep revival system, whereby when a creep dies, it revives after the hero leaves the region, but apparently some creeps DON'T revive. I cant find the problem. please help!
Code:
Creep revive initialization
Events
Map initialization
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
Loop - Actions
Set Integer = (Integer + 1)
Unit - Set the custom value of (Picked unit) to Integer
Custom script: set udg_Creep_X[udg_Integer] = GetUnitX(GetEnumUnit())
Custom script: set udg_Creep_Y[udg_Integer] = GetUnitY(GetEnumUnit())
Code:
Revive creep
Events
Unit - A unit Dies
Conditions
(((Dying unit) is Summoned) Equal to False) and ((Owner of (Dying unit)) Equal to Neutral Hostile)
Actions
Wait until ((Number of units in (Units within 400.00 of (Position of (Dying unit)) matching (((Triggering unit) is A Hero) Equal to True))) Equal to 0), checking every 1.00 seconds
Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Hostile at ((Center of (Entire map)) offset by (Creep_X[(Custom value of (Dying unit))], Creep_Y[(Custom value of (Dying unit))])) facing Default building facing degrees