killbuzz
Member
- Reaction score
- 9
I'm currently working on a creep respawn system that will respawn the dead creep in its original location and only if there are no enemy players nearby. here is what I have so far:
I'm having problems with the local location 'tmpPoint' I would like to call it in the wait until function and I'm wondering if its possible/how to do it. I have tried converting to custom text and editing the variables from there but I always get an error.
Code:
Respawn Init
Events
Map initialization
Conditions
Actions
Set Respawn_Time = 25.00
Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
Loop - Actions
Set Temp_Integer = (Temp_Integer + 1)
Unit - Set the custom value of (Picked unit) to Temp_Integer
Set Creep_Point[Temp_Integer] = (Position of (Picked unit))
Set Creep_Angle[Temp_Integer] = (Facing of (Picked unit))
Code:
Respawn
Events
Unit - A unit owned by Neutral Hostile Dies
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Not equal to Sapphiron (undead)
(Unit-type of (Triggering unit)) Not equal to Lich King (Evil)
(Unit-type of (Triggering unit)) Not equal to Ghost
(Unit-type of (Triggering unit)) Not equal to Horn of Cenarius Pedestal
(Unit-type of (Triggering unit)) Not equal to Unique Artifact
((Triggering unit) is A Hero) Equal to False
((Triggering unit) is Summoned) Equal to False
(Custom value of (Triggering unit)) Greater than 0
((Triggering unit) is A flying unit) Equal to False
Actions
Custom script: local integer i = GetUnitTypeId(GetTriggerUnit())
Custom script: local integer ii = GetUnitUserData(GetTriggerUnit())
Custom script: local location tmpPoint = GetUnitLoc(GetTriggerUnit())
Wait until (((Units within 800.00 of tmpPoint matching (((Matching unit) belongs to an enemy of Neutral Hostile) Equal to True)) is empty) Equal to True), checking every Respawn_Time seconds
Custom script: call SetUnitUserData(CreateUnit(Player(12),i,GetLocationX(udg_Creep_Point[ii]),GetLocationY(udg_Creep_Point[ii]),udg_Creep_Angle[ii]),ii)
Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
Custom script: call RemoveLocation (udg_tmpPoint)