Hi there.. i made a new spell for one of my heroes. Basicly its pretty much like a Summon Serpent Wards Skill but i wanted to let the "Serpent Wards" be summoned in a small random Area around the target Point. I made this because i use a Doodad-Model in exchange of the Serpent Ward Model and it looks way better when all the Wards aren't crowded at one single point.
The Spell is working, but there are some bugs and it seems to me that the Code is way more complicated than it should be. My first Trigger spell though.
Here's the Code
The Problem is that i can't make the Units unsummon themselfs like a normal Summon Skill (Or can i?), so i have to kill the Units after some time by a Trigger, but the way i do it (Save the Units in a Variable and kill them by Random) doesn't work correct. Sometimes it works, but sometimes only a few of the summoned Units get killed or even none of them. And the Code seems very unclean to me, but i dont know any better way.
I have second Problem with another summon Skill. This one is a normal summon Skill, based on Summon Spirit Wolfs just with exchanged Data, but i want the summoned Units to leave Corpses. I tried to kill/leave them Corpses by Trigger but it won't work correct, any ideas?
The Spell is working, but there are some bugs and it seems to me that the Code is way more complicated than it should be. My first Trigger spell though.
Here's the Code
-
Tormented Souls
-
Ereignisse
- Einheit - A unit starts to cast a Ability
-
Bedingungen
- (Ability being cast) Gleich Tormented Souls
-
Aktionen
- Set TargetPoint = (Region centered at (Target point of ability being cast) with size (200.00, 200.00))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Bedingungen
- (Real((Level of Tormented Souls for (Triggering unit)))) Gleich 1.00
-
'THEN'-Aktionen
- Sound - Play UndeadDissipate2 <gen>
- Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
- Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
- Einheitengruppe - Add (Last created unit) to Grave
- Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
- Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
- Einheitengruppe - Add (Last created unit) to Grave
- Wait 7.00 seconds
- Einheit - Kill (Random unit from Grave)
- Einheit - Kill (Random unit from Grave)
-
'ELSE'-Aktionen
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Bedingungen
- (Real((Level of Tormented Souls for (Triggering unit)))) Gleich 2.00
-
'THEN'-Aktionen
- Sound - Play UndeadDissipate2 <gen>
- Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
- Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
- Einheitengruppe - Add (Last created unit) to Grave
- Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
- Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
- Einheitengruppe - Add (Last created unit) to Grave
- Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
- Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
- Einheitengruppe - Add (Last created unit) to Grave
- Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
- Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
- Einheitengruppe - Add (Last created unit) to Grave
- Wait 7.00 seconds
- Einheit - Kill (Random unit from Grave)
- Einheit - Kill (Random unit from Grave)
- Einheit - Kill (Random unit from Grave)
- Einheit - Kill (Random unit from Grave)
-
'ELSE'-Aktionen
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Bedingungen
- (Real((Level of Tormented Souls for (Triggering unit)))) Gleich 3.00
-
'THEN'-Aktionen
- Sound - Play UndeadDissipate2 <gen>
- Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
- Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
- Einheitengruppe - Add (Last created unit) to Grave
- Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
- Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
- Einheitengruppe - Add (Last created unit) to Grave
- Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
- Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
- Einheitengruppe - Add (Last created unit) to Grave
- Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
- Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
- Einheitengruppe - Add (Last created unit) to Grave
- Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
- Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
- Einheitengruppe - Add (Last created unit) to Grave
- Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
- Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
- Einheitengruppe - Add (Last created unit) to Grave
- Wait 7.00 seconds
- Einheit - Kill (Random unit from Grave)
- Einheit - Kill (Random unit from Grave)
- Einheit - Kill (Random unit from Grave)
- Einheit - Kill (Random unit from Grave)
- Einheit - Kill (Random unit from Grave)
- Einheit - Kill (Random unit from Grave)
-
'ELSE'-Aktionen
- Do nothing
-
'IF'-Bedingungen
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Bedingungen
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Bedingungen
-
Ereignisse
The Problem is that i can't make the Units unsummon themselfs like a normal Summon Skill (Or can i?), so i have to kill the Units after some time by a Trigger, but the way i do it (Save the Units in a Variable and kill them by Random) doesn't work correct. Sometimes it works, but sometimes only a few of the summoned Units get killed or even none of them. And the Code seems very unclean to me, but i dont know any better way.
I have second Problem with another summon Skill. This one is a normal summon Skill, based on Summon Spirit Wolfs just with exchanged Data, but i want the summoned Units to leave Corpses. I tried to kill/leave them Corpses by Trigger but it won't work correct, any ideas?
Last edited: