Understood, I'm glad you got it working. But in the future please let people know your version/limitations beforehand. I usually ask but I assumed since you were a new user you would be on the latest patch (that seems to be the case most of the time).
Anyway, I see three issues with your trigger.
The first issue is the use of the Wait action along with a global variable:
-
Wait 1.00 seconds
-
Einheit - Set life of CorpseHeapClosestCorpseTower to ((Leben of CorpseHeapClosestCorpseTower) + 1.00)
You should never reference a global variable after a Wait unless you know for a fact that the variable's value can't change. In this case, if another unit were to Decay within that 1.00 second period, it COULD change the CorpseHeapClosestCorpseTower to a different tower. If that happens, the different tower will get healed twice and the original tower won't get healed at all. Remember, a global variable can only have
ONE value at a time.
The easy solution is to use a local variable since those are local to the trigger instance that created them. Alternatively, you could use some kind of indexing method with Array variables.
The second issue is that you're ALWAYS Waiting 1.00 second and trying to Heal to CorpseHeapClosestCorpseTower. That doesn't make sense, you should only Wait and Heal if you actually found a nearby corpse tower. The solution is simple, move those Actions into the THEN part of the trigger where it runs the Actions IF a tower is found:
Here's how you can fix both of these issues:
-
CorpseHeapGetEnemyCorpse
-

Ereignisse
-


Einheit - A unit Verfällt
-

Bedingungen
-


((Owner of (Triggering unit)) Gleich Spieler 11 (Dunkelgrün)) or ((Owner of (Triggering unit)) Gleich Spieler 12 (Braun))
-

Aktionen
-


Custom script: local unit u = null
-


Set CorpseHeapPoint[0] = (Position of (Triggering unit))
-


Set CorpseHeapClosestCorpseTower = Keine Einheit
-


Set CorpseHeapClosestDistance = 900.01
-


Einheitengruppe - Pick every unit in CorpseHeapTowerGroup and do (Actions)
-



Schleifen - Aktionen
-




Set CorpseHeapCorpseTower = (Picked unit)
-




Set CorpseHeapPoint[1] = (Position of CorpseHeapCorpseTower)
-




Set CorpseHeapDistance = (Distance between CorpseHeapPoint[0] and CorpseHeapPoint[1])
-




Custom script: call RemoveLocation(udg_CorpseHeapPoint[1])
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





'IF'-Bedingungen
-






CorpseHeapDistance Kleiner als CorpseHeapClosestDistance
-





'THEN'-Aktionen
-






Set CorpseHeapClosestCorpseTower = CorpseHeapCorpseTower
-






Set CorpseHeapClosestDistance = CorpseHeapDistance
-





'ELSE'-Aktionen
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



'IF'-Bedingungen
-




CorpseHeapClosestCorpseTower Ungleich Keine Einheit
-



'THEN'-Aktionen
-




Spiel - Display to (All players) the text: CreateMissile
-




Set TempInteger = (CMS_Amount + 1)
-




-------- Hier würden die daten für das Projectil rein --------
-




Set CMS_StartingLocation = (Position of (Triggering unit))
-




Set CMS_StartingHeight = 0.00
-




Set CMS_StartingSpeed = 300.00
-




Set CMS_StartingAcceleration = 200.00
-




Set CMS_StartingSource = (Triggering unit)
-




Set CMS_StartingType = 1
-




Set CMS_StartingMissile = (Triggering unit)
-




Custom script: set udg_TempInteger = CMS_CreateMissileEx()
-




-------- - --------
-




Set CMS_Param_MaxDistance[TempInteger] = ((Distance between (Position of (Triggering unit)) and (Position of CorpseHeapClosestCorpseTower)) - 30.00)
-




Set CMS_Param_TurnRate[TempInteger] = 55.00
-




Set CMS_StartingAngle = (Angle from CMS_StartingLocation to (Position of CorpseHeapClosestCorpseTower))
-




Set CMS_Param_IsHoming[TempInteger] = True
-




Set CMS_Param_Target_Type[TempInteger] = CMS_TARGETTYPE_UNIT
-




Set CMS_Param_Target_Location[TempInteger] = (Position of CorpseHeapClosestCorpseTower)
-




Set CMS_Param_Target_Unit[TempInteger] = CorpseHeapClosestCorpseTower
-




-------- - --------
-




Set CMS_Param_Target_Unit[0] = CorpseHeapClosestCorpseTower
-




Set CMS_Param_WalkingHeight[TempInteger] = 0.00
-




Set CMS_Param_Gravity[TempInteger] = (-45.00 x 0.03)
-




-------- - --------
-




Custom script: call RemoveLocation(udg_TempLocation)
-




-------- - --------
-




Spezialeffekt - Create a special effect attached to the overhead of CorpseHeapClosestCorpseTower using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdl
-




Special Effect - Destroy (Last created special effect)
-




-------- - --------
-




Custom script: set u = udg_CorpseHeapClosestCorpseTower
-




Wait 1.00 seconds
-




Custom script: set udg_CorpseHeapClosestCorpseTower = u
-




Einheit - Set life of CorpseHeapClosestCorpseTower to ((Leben of CorpseHeapClosestCorpseTower) + 1.00)
-



'ELSE'-Aktionen
-




Custom script: call RemoveLocation(udg_CorpseHeapPoint[0])
-


Custom script: set u = null
Note how I've structured everything. The Actions need to be in those exact positions!
The third issue is a minor one. You're creating a memory leak whenever you do this:
-
Spezialeffekt - Create a special effect attached to the overhead of CorpseHeapClosestCorpseTower using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdl
You need to Destroy the Special Effect or else it will exist forever:
-
Spezialeffekt - Create a special effect attached to the overhead of CorpseHeapClosestCorpseTower using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdl
-
Special Effect - Destroy (Last created special effect)
The game assumes that you may want to reuse this Special Effect so it won't destroy it automatically. It also doesn't know when you'd want to destroy it anyway, so it makes sense that the user is in charge of doing this. Memory leaks can create performance issues if too many of them pile up.