Hello, in my spell I pick units around a point and then damage them and then adding them to another unit group to prevent that they would be damaged again. But it works only for the first time...it damages all units just once....second time it damages units multiple times... I can't solve this problem by myslef, because i really don't know why this happens. Perhaps, there are things that are not professional.. this is my first larger spell. Please help me to figure it out. Thanks.
-
Nature Spirits
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Nature Spirits (Dummy Spell)
-
Actions
- If (NSTimes Equal to 5000) then do (Set NSTimes = 1) else do (Set NSTimes = (NSTimes + 1))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in NSGroup[0]) Equal to 0
-
Then - Actions
- Trigger - Turn on Nature Spirits Loop <gen>
-
Else - Actions
- Do nothing
-
If - Conditions
- Set NSCaster[NSTimes] = (Casting unit)
- Set NSPoint[0] = (Position of NSCaster[NSTimes])
- Set NSPoint[1] = (Target point of ability being cast)
- Set NSAngle[0] = (Angle from NSPoint[0] to NSPoint[1])
- Set NSPoint[11] = (NSPoint[0] offset by 40.00 towards NSAngle[0] degrees)
- Unit - Create 1 NSDummy for (Owner of NSCaster[NSTimes]) at NSPoint[11] facing NSAngle[0] degrees
- Hashtable - Save Handle Of(Last created unit) as 0 of (Key (Last created unit)) in NSHash
- Hashtable - Save 25.00 as 1 of (Key (Last created unit)) in NSHash
- Hashtable - Save False as 2 of (Key (Last created unit)) in NSHash
- Hashtable - Save 40 as 3 of (Key (Last created unit)) in NSHash
- Hashtable - Save False as 4 of (Key (Last created unit)) in NSHash
- Hashtable - Save NSAngle[0] as 5 of (Key (Last created unit)) in NSHash
- Hashtable - Save Handle OfNSPoint[0] as 6 of (Key (Last created unit)) in NSHash
- Unit Group - Add (Last created unit) to NSGroup[0]
- Set NSPoint[12] = (NSPoint[0] offset by 43.29 towards (NSAngle[0] + 22.50) degrees)
- Unit - Create 1 NSDummy 2 for (Owner of NSCaster[NSTimes]) at NSPoint[12] facing NSAngle[0] degrees
- Hashtable - Save Handle Of(Last created unit) as 0 of (Key (Last created unit)) in NSHash
- Hashtable - Save 95.00 as 1 of (Key (Last created unit)) in NSHash
- Hashtable - Save True as 2 of (Key (Last created unit)) in NSHash
- Hashtable - Save 16 as 3 of (Key (Last created unit)) in NSHash
- Hashtable - Save True as 4 of (Key (Last created unit)) in NSHash
- Hashtable - Save NSAngle[0] as 5 of (Key (Last created unit)) in NSHash
- Hashtable - Save Handle OfNSPoint[0] as 6 of (Key (Last created unit)) in NSHash
- Unit Group - Add (Last created unit) to NSGroup[0]
- Set NSPoint[13] = (NSPoint[0] offset by 43.29 towards (NSAngle[0] - 22.50) degrees)
- Unit - Create 1 NSDummy 3 for (Owner of NSCaster[NSTimes]) at NSPoint[13] facing NSAngle[0] degrees
- Hashtable - Save Handle Of(Last created unit) as 0 of (Key (Last created unit)) in NSHash
- Hashtable - Save 95.00 as 1 of (Key (Last created unit)) in NSHash
- Hashtable - Save False as 2 of (Key (Last created unit)) in NSHash
- Hashtable - Save 64 as 3 of (Key (Last created unit)) in NSHash
- Hashtable - Save True as 4 of (Key (Last created unit)) in NSHash
- Hashtable - Save NSAngle[0] as 5 of (Key (Last created unit)) in NSHash
- Hashtable - Save Handle OfNSPoint[0] as 6 of (Key (Last created unit)) in NSHash
- Unit Group - Add (Last created unit) to NSGroup[0]
- Set NSPoint[14] = (NSPoint[0] offset by 40.00 towards NSAngle[0] degrees)
- Unit - Create 1 Dummy 1 for (Owner of NSCaster[NSTimes]) at NSPoint[14] facing NSAngle[0] degrees
- Set NSDistance[NSTimes] = 40.00
- Hashtable - Save Handle Of(Last created unit) as 0 of (Key (Last created unit)) in NSHash
- Hashtable - Save NSAngle[0] as 1 of (Key (Last created unit)) in NSHash
- Hashtable - Save NSTimes as 2 of (Key (Last created unit)) in NSHash
- Hashtable - Save NSDistance[NSTimes] as 3 of (Key (Last created unit)) in NSHash
- Hashtable - Save Handle OfNSPoint[0] as 4 of (Key (Last created unit)) in NSHash
- Unit Group - Add (Last created unit) to NSGroup[1]
- Custom script: call RemoveLocation(udg_NSPoint[1])
- Custom script: call RemoveLocation(udg_NSPoint[11])
- Custom script: call RemoveLocation(udg_NSPoint[12])
- Custom script: call RemoveLocation(udg_NSPoint[13])
- Custom script: call RemoveLocation(udg_NSPoint[14])
-
Events
-
Nature Spirits Loop
-
Events
- Time - Every 0.05 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in NSGroup[0] and do (Actions)
-
Loop - Actions
- Set NSUnit[0] = (Load 0 of (Key (Picked unit)) in NSHash)
- Set NSHeight = (Load 1 of (Key (Picked unit)) from NSHash)
- Set NSHeightCheck = (Load 2 of (Key (Picked unit)) from NSHash)
- Set NSRange = (Load 3 of (Key (Picked unit)) from NSHash)
- Set NSRangeCheck = (Load 4 of (Key (Picked unit)) from NSHash)
- Set NSAngle[1] = (Load 5 of (Key (Picked unit)) from NSHash)
- Set NSPoint[3] = (Load 6 of (Key (Picked unit)) in NSHash)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- NSHeightCheck Equal to True
- NSHeight Equal to 25.00
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
- Set NSHeightCheck = True
- Set NSHeight = (NSHeight + 10.00)
- Hashtable - Save NSHeight as 1 of (Key (Picked unit)) in NSHash
- Animation - Change NSUnit[0] flying height to NSHeight at 0.00
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- NSHeight Equal to 125.00
-
Then - Actions
- Set NSHeightCheck = False
-
Else - Actions
- Do nothing
-
If - Conditions
- Hashtable - Save NSHeightCheck as 2 of (Key (Picked unit)) in NSHash
-
Else - Actions
- Set NSHeight = (NSHeight - 10.00)
- Hashtable - Save NSHeight as 1 of (Key (Picked unit)) in NSHash
- Animation - Change NSUnit[0] flying height to NSHeight at 300.00
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- NSRange Equal to 0
- NSRangeCheck Equal to True
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
- Set NSRangeCheck = True
- Set NSRange = (NSRange + 8)
- Hashtable - Save NSRange as 3 of (Key (Picked unit)) in NSHash
- Set NSPoint[4] = (Position of NSUnit[0])
- Set NSPoint[5] = (NSPoint[4] offset by 35.90 towards (NSAngle[1] - 12.87) degrees)
- Unit - Move NSUnit[0] instantly to NSPoint[5]
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- NSRange Equal to 80
-
Then - Actions
- Set NSRangeCheck = False
-
Else - Actions
- Do nothing
-
If - Conditions
- Hashtable - Save NSRangeCheck as 4 of (Key (Picked unit)) in NSHash
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Distance between NSPoint[3] and NSPoint[5]) Greater than or equal to 1480.00
-
Then - Actions
- Special Effect - Create a special effect at NSPoint[5] using Abilities\Spells\NightElf\FaerieDragonInvis\FaerieDragon_Invis.mdl
- Special Effect - Destroy (Last created special effect)
- Unit - Add a 0.10 second Generic expiration timer to NSUnit[0]
- Unit Group - Remove NSUnit[0] from NSGroup[0]
- Hashtable - Clear all child hashtables of child (Key (Picked unit)) in NSHash
-
Else - Actions
- Do nothing
-
If - Conditions
- Custom script: call RemoveLocation(udg_NSPoint[4])
- Custom script: call RemoveLocation(udg_NSPoint[5])
-
Else - Actions
- Set NSRange = (NSRange - 8)
- Hashtable - Save NSRange as 3 of (Key (Picked unit)) in NSHash
- Set NSPoint[4] = (Position of NSUnit[0])
- Set NSPoint[5] = (NSPoint[4] offset by 35.90 towards (NSAngle[1] + 12.87) degrees)
- Unit - Move NSUnit[0] instantly to NSPoint[5]
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Distance between NSPoint[3] and NSPoint[5]) Greater than or equal to 1480.00
-
Then - Actions
- Special Effect - Create a special effect at NSPoint[5] using Abilities\Spells\NightElf\FaerieDragonInvis\FaerieDragon_Invis.mdl
- Special Effect - Destroy (Last created special effect)
- Unit - Add a 0.10 second Generic expiration timer to NSUnit[0]
- Unit Group - Remove NSUnit[0] from NSGroup[0]
- Hashtable - Clear all child hashtables of child (Key (Picked unit)) in NSHash
-
Else - Actions
- Do nothing
-
If - Conditions
- Custom script: call RemoveLocation(udg_NSPoint[4])
- Custom script: call RemoveLocation(udg_NSPoint[5])
-
If - Conditions
-
Loop - Actions
-
Unit Group - Pick every unit in NSGroup[1] and do (Actions)
-
Loop - Actions
- Set NSUnit[0] = (Load 0 of (Key (Picked unit)) in NSHash)
- Set NSAngle[1] = (Load 1 of (Key (Picked unit)) from NSHash)
- Set NS = (Load 2 of (Key (Picked unit)) from NSHash)
- Set NSDistance[NS] = (Load 3 of (Key (Picked unit)) from NSHash)
- Set NSPoint[3] = (Load 4 of (Key (Picked unit)) in NSHash)
- Set NSPoint[4] = (NSPoint[3] offset by NSDistance[NS] towards NSAngle[1] degrees)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- NSDistance[NS] Equal to 40.00
- NSDistance[NS] Equal to 180.00
- NSDistance[NS] Equal to 320.00
- NSDistance[NS] Equal to 460.00
- NSDistance[NS] Equal to 600.00
- NSDistance[NS] Equal to 740.00
- NSDistance[NS] Equal to 880.00
- NSDistance[NS] Equal to 1020.00
- NSDistance[NS] Equal to 1160.00
- NSDistance[NS] Equal to 1300.00
- NSDistance[NS] Equal to 1440.00
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
- Set NSGroup[2] = (Units within 140.00 of NSPoint[4] matching ((((Matching unit) belongs to an ally of (Owner of NSCaster[NS])) Equal to False) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit) i
-
Unit Group - Pick every unit in NSGroup[2] and do (Actions)
-
Loop - Actions
- Set NSPoint[5] = (Position of (Picked unit))
- Unit - Create 1 Dummy 1 for (Owner of NSCaster[NS]) at NSPoint[5] facing Default building facing degrees
- Set NSUnit[1] = (Last created unit)
- Unit - Cause NSUnit[1] to damage (Picked unit), dealing ((Real((Level of Nature Spirits (Dummy Spell) for NSCaster[NS]))) x 100.00) damage of attack type Spells and damage type Enhanced
- Unit - Add Slow (Nature Spirits) to NSUnit[1]
- Unit - Set level of Slow (Nature Spirits) for NSUnit[1] to (Level of Nature Spirits (Dummy Spell) for NSCaster[NS])
- Special Effect - Create a special effect at NSPoint[5] using Abilities\Spells\NightElf\ManaBurn\ManaBurnTarget.mdl
- Special Effect - Destroy (Last created special effect)
- Unit - Order NSUnit[1] to Human Sorceress - Slow (Picked unit)
- Unit - Add a 2.00 second Generic expiration timer to NSUnit[1]
- Unit Group - Add (Picked unit) to NSCheckGroup[NS]
- Custom script: call RemoveLocation(udg_NSPoint[5])
-
Loop - Actions
- Custom script: call DestroyGroup(udg_NSGroup[2])
- Set NSGroup[2] = (Units within 145.00 of NSPoint[4] matching ((((Matching unit) belongs to an ally of (Owner of NSCaster[NS])) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mecha
-
Unit Group - Pick every unit in NSGroup[2] and do (Actions)
-
Loop - Actions
- Set NSPoint[5] = (Position of (Picked unit))
- Unit - Create 1 Dummy 1 for (Owner of NSCaster[NS]) at NSPoint[5] facing Default building facing degrees
- Set NSUnit[1] = (Last created unit)
- Unit - Add Heal (Nature Spirits) to NSUnit[1]
- Unit - Set level of Heal (Nature Spirits) for NSUnit[1] to (Level of Nature Spirits (Dummy Spell) for NSCaster[NS])
- Unit - Order NSUnit[1] to Human Paladin - Holy Light (Picked unit)
- Special Effect - Create a special effect at NSPoint[5] using Abilities\Spells\Items\ResourceItems\ResourceEffectTarget.mdl
- Special Effect - Destroy (Last created special effect)
- Unit - Add a 2.00 second Generic expiration timer to NSUnit[1]
- Unit Group - Add (Picked unit) to NSCheckGroup[NS]
- Custom script: call RemoveLocation(udg_NSPoint[5])
-
Loop - Actions
- Custom script: call DestroyGroup(udg_NSGroup[2])
- Custom script: call RemoveLocation(udg_NSPoint[4])
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- NSDistance[NS] Equal to 1510.00
-
Then - Actions
- Unit - Add a 0.10 second Generic expiration timer to NSUnit[0]
- Unit Group - Remove all units from NSCheckGroup[NS]
- Unit Group - Remove NSUnit[0] from NSGroup[1]
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in NSGroup[1]) Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
-
Else - Actions
- Do nothing
-
If - Conditions
- Hashtable - Clear all child hashtables of child (Key (Picked unit)) in NSHash
- Custom script: call RemoveLocation(udg_NSPoint[3])
-
Else - Actions
- Do nothing
-
If - Conditions
- Custom script: call RemoveLocation(udg_NSPoint[4])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Set NSDistance[NS] = (NSDistance[NS] + 35.00)
- Hashtable - Save NSDistance[NS] as 3 of (Key (Picked unit)) in NSHash
-
Loop - Actions
-
Unit Group - Pick every unit in NSGroup[0] and do (Actions)
-
Events
Last edited: