First question answered, but I have another. Rather than creating an additonal topic, I figured I'd ask it here first, in hopes of obtaining an answer.
This spell is based off Blink. I know some of you may cry at how awful this is coded, but it was my first attempt at a custom spell. Please ignore the leaks, I'm fairly sure I can fix them, it's a problem with the actual spell that I need help with. Oddly enough, it used to work on the map I first created it in, however when I imported it to a new map I ran into a problem. For some reason, when the spell is activated, the unit will Blink to the targetted point, but all of the effects that are meant to happen at CustomBlinkPoint (which should be where I target the blink spell) instead happen at a static point on my map. As such, the pause, damage, and terrain defamation occur at the same point every time I cast the spell. I did remember to create the variable, so it's not that. Any suggestions? Also, any optimization of the code, to be more efficient/MUI would be great.
Spell
So I'm pretty new to removing leaks, and I was wondering if this is the fastest and most efficient way of doing it? If it is, a simple yes is enough, if not, I would be grateful for any assistance.
Old Code:
Changed to
New Code:
This spell is based off Blink. I know some of you may cry at how awful this is coded, but it was my first attempt at a custom spell. Please ignore the leaks, I'm fairly sure I can fix them, it's a problem with the actual spell that I need help with. Oddly enough, it used to work on the map I first created it in, however when I imported it to a new map I ran into a problem. For some reason, when the spell is activated, the unit will Blink to the targetted point, but all of the effects that are meant to happen at CustomBlinkPoint (which should be where I target the blink spell) instead happen at a static point on my map. As such, the pause, damage, and terrain defamation occur at the same point every time I cast the spell. I did remember to create the variable, so it's not that. Any suggestions? Also, any optimization of the code, to be more efficient/MUI would be great.
Spell
Code:
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Custom Blink
Actions
Wait 1.00 seconds
Unit - Make (Triggering unit) Invulnerable
Set CustomBlinkPoint = ((Target point of ability being cast) offset by (0.00, 0.00))
Unit Group - Pick every unit in (Units within 700.00 of CustomBlinkPoint) and do (Actions)
Loop - Actions
Unit - Pause (Picked unit)
Animation - Play (Last created unit)'s birth animation
Special Effect - Create a special effect at CustomBlinkPoint using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
Special Effect - Create a special effect at CustomBlinkPoint using Abilities\Spells\Human\FlameStrike\FlameStrikeTarget.mdl
Unit - Create 1 Charge up spell for Neutral Passive at CustomBlinkPoint facing (Position of (Triggering unit))
Sound - Play ManaFlareLoop <gen> at 100.00% volume, located at CustomBlinkPoint with Z offset 0.00
Animation - Change (Last created unit)'s animation speed to 6.00% of its original speed
Wait 1.00 seconds
Wait 1.75 seconds
Sound - Play ManaFlareLoop <gen> at 100.00% volume, located at CustomBlinkPoint with Z offset 0.00
Wait 2.25 seconds
Unit - Cause (Triggering unit) to damage circular area after 0.50 seconds of radius 700.00 at CustomBlinkPoint, dealing 200.00 damage of attack type Spells and damage type Lightning
Unit - Create 1 Middle of spell for Neutral Passive at CustomBlinkPoint facing (Position of (Triggering unit))
Sound - Play Shockwave <gen> at 100.00% volume, located at CustomBlinkPoint with Z offset 0.00
Environment - Create a 2.00 second Normal ripple deformation at CustomBlinkPoint with starting radius 200.00, ending radius 800.00, and depth 20.00, using 0.50 second ripples spaced 150.00 apart
Wait 2.00 seconds
Sound - Stop (Last played sound) Immediately
Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 500.00 at (Center of (Playable map area)), dealing 100.00 damage of attack type Spells and damage type Normal
Unit - Create 1 Middle of spell for Neutral Passive at CustomBlinkPoint facing (Position of (Triggering unit))
Sound - Play Shockwave <gen> at 100.00% volume, located at CustomBlinkPoint with Z offset 0.00
Environment - Create a 2.00 second Normal ripple deformation at CustomBlinkPoint with starting radius 200.00, ending radius 800.00, and depth 20.00, using 0.50 second ripples spaced 150.00 apart
Wait 2.00 seconds
Sound - Stop (Last played sound) Immediately
Unit - Cause (Triggering unit) to damage circular area after 0.50 seconds of radius 700.00 at CustomBlinkPoint, dealing 200.00 damage of attack type Spells and damage type Lightning
Unit - Create 1 Middle of spell for Neutral Passive at CustomBlinkPoint facing (Position of (Triggering unit))
Sound - Play Shockwave <gen> at 100.00% volume, located at CustomBlinkPoint with Z offset 0.00
Environment - Create a 2.00 second Normal ripple deformation at CustomBlinkPoint with starting radius 200.00, ending radius 800.00, and depth 20.00, using 0.50 second ripples spaced 150.00 apart
Wait 2.00 seconds
Sound - Stop (Last played sound) Immediately
Unit - Cause (Triggering unit) to damage circular area after 0.50 seconds of radius 700.00 at CustomBlinkPoint, dealing 2000.00 damage of attack type Spells and damage type Divine
Unit - Create 1 Stomp Effect for Neutral Passive at CustomBlinkPoint facing (Position of (Triggering unit))
Animation - Change (Last created unit)'s animation speed to 20.00% of its original speed
Environment - Create a 4.00 second Normal ripple deformation at CustomBlinkPoint with starting radius 200.00, ending radius 1000.00, and depth 120.00, using 0.50 second ripples spaced 150.00 apart
Environment - Create a 1.00 second Permanent crater deformation at CustomBlinkPoint with radius 400.00 and depth 150.00
Special Effect - Destroy (Last created special effect)
Sound - Play ImplosionDie2 <gen> at 100.00% volume, located at CustomBlinkPoint with Z offset 0.00
Wait 2.00 seconds
Unit - Make (Triggering unit) Vulnerable
Unit - Unpause (Triggering unit)
Unit Group - Pick every unit in (Last created unit group) and do (Actions)
Loop - Actions
Unit - Unpause (Picked unit)
So I'm pretty new to removing leaks, and I was wondering if this is the fastest and most efficient way of doing it? If it is, a simple yes is enough, if not, I would be grateful for any assistance.
Old Code:
SPWN 1 AI movement 1
Events
Unit - A unit enters Spawn 1 <gen>
Conditions
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
Actions
Unit Group - Order (Units in Spawn 1 <gen>) to Attack-Move To (Center of Attackers attack point <gen>)
Events
Unit - A unit enters Spawn 1 <gen>
Conditions
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
Actions
Unit Group - Order (Units in Spawn 1 <gen>) to Attack-Move To (Center of Attackers attack point <gen>)
Changed to
New Code:
SPWN 1 AI movement 1
Events
Unit - A unit enters Spawn 1 <gen>
Conditions
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
Actions
Set Temp_point = (Center of Attackers attack point <gen>)
Set Temp_group = (Units in Spawn 1 <gen>)
Unit Group - Order Temp_group to Attack-Move To Temp_point
Custom script: call RemoveLocation (udg_Temp_point)
Custom script: call DestroyGroup (udg_Temp_group)
Events
Unit - A unit enters Spawn 1 <gen>
Conditions
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
Actions
Set Temp_point = (Center of Attackers attack point <gen>)
Set Temp_group = (Units in Spawn 1 <gen>)
Unit Group - Order Temp_group to Attack-Move To Temp_point
Custom script: call RemoveLocation (udg_Temp_point)
Custom script: call DestroyGroup (udg_Temp_group)