• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] help!

Level 25
Joined
Sep 7, 2018
Messages
540
hi friends actually i made a spell that i can't add a special effect like flame strike on ability point.
  • Fel Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fel Strike
    • Actions
      • -------- Config --------
      • Set Fel_Strike_Point = (Target point of ability being cast)
      • Wait 0.50 seconds
      • Special Effect - Create a special effect at Fel_Strike_Point using LightStrikeArray.mdx
      • Special Effect - Destroy (Last created special effect)
      • Unit Group - Pick every unit in (Units within 150.00 of Fel_Strike_Point) and do (Actions)
        • Loop - Actions
          • Set Fel_Strike_Target = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Fel_Strike_Target is Magic Immune) Equal to False
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage Fel_Strike_Target, dealing 100.00 damage of attack type Spells and damage type Magic
              • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Fel_Strike_Point facing Default building facing degrees
              • Set Dummy = (Last created unit)
              • Unit - Add Fel Strike Stun to Dummy
              • Unit - Order Dummy to Human Mountain King - Storm Bolt Fel_Strike_Target
              • Unit - Add a 0.20 second Generic expiration timer to Dummy
            • Else - Actions
              • Do nothing
      • Destructible - Pick every destructible within 150.00 of Fel_Strike_Point and do (Destructible - Kill (Picked destructible))
      • Custom script: call RemoveLocation(udg_Fel_Strike_Point)
also can you guys add two number of charges for this ability.
 

Attachments

  • (12)Blackrock.w3x
    685.1 KB · Views: 8
Last edited:
Level 45
Joined
Feb 27, 2007
Messages
5,578
You typed the imported file path wrong. It's LightStrikeArrayTarget.mdx, and you forgot the Target part.
also can you guys add two number of charges for this ability.
That's actually way more complicated than it sounds. I think Flare can have charges but beyond that probably nothing else can? I've never seen a multi-charge ability on a unit in wc3 (only on items).

Do Nothing is pointless and should never be used. It does nothing at all and doesn't benefit you in any way.
 
Level 30
Joined
Aug 29, 2012
Messages
1,382
To make something close to charges you could have an integer, increase it by one any time the spell is cast and when it has reached XYZ number then you remove the spell from the unit, but if you want a number on the spell like the huntress Sentry I think you can forget about it :p
 
Level 25
Joined
Sep 7, 2018
Messages
540
You typed the imported file path wrong. It's LightStrikeArrayTarget.mdx, and you forgot the Target part.

That's actually way more complicated than it sounds. I think Flare can have charges but beyond that probably nothing else can? I've never seen a multi-charge ability on a unit in wc3 (only on items).

Do Nothing is pointless and should never be used. It does nothing at all and doesn't benefit you in any way.
I added target but still nothing happens.
Even I can't add original flame strike target on the point.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
The actual problem is something I typed here first and then deleted because your post says Flame Strike but the effect being used was that imported model. Now you've shown that you are actually trying to use Flame Strike.
  1. You're immediately destroying the effect after creating it. You're doing this to prevent the effect becoming a memory leak, which is good.
  2. Destroying an effect causes the effect to play its full death animation if it has one, and the effect will not be removed until the death animation has played.
  3. Many effects in the game do not have named animations (or don't have one named death) and you are likely familiar with destroying those. (There are other issues about such effects persisting after being destroyed that I'm not addressing here.)
  4. Flamestrike has named Birth, Stand, and Death animations so because you're doing 1 it causes 2 to happen, and the Flame Strike has a death animation which is getting played instead of the birth animation you want to see.
This is actually surprisingly easy to resolve. You just need to tell the effect to play its birth animation immediately after being destroyed. That sounds like it shouldn't work because the effect is destroyed, right?! Well I guess the effect persists in memory until the animation plays so any variables that pointed to it are not yet null after the Destroy line. A little weird, but makes sense too. Something like this:
  • Actions
    • Special Effect - Create a special effect at (Center of Region 000 <gen>) using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
    • Special Effect - Destroy (Last created special effect)
    • Special Effect - Play Special Effect: (Last created special effect), Animation: Birth
This has one downside: The effect will freeze on the last frame of the animation you ordered it to play for some time until the game decides to remove it. I presume it doesn't become a permanent memory leak this way but I did not test. If you don't want to use a method like this there are other ways to remove the effect after a time delay or displaying the effect with a locusted unit with a timed life. Up to you.
 
Level 25
Joined
Sep 7, 2018
Messages
540
The actual problem is something I typed here first and then deleted because your post says Flame Strike but the effect being used was that imported model. Now you've shown that you are actually trying to use Flame Strike.
  1. You're immediately destroying the effect after creating it. You're doing this to prevent the effect becoming a memory leak, which is good.
  2. Destroying an effect causes the effect to play its full death animation if it has one, and the effect will not be removed until the death animation has played.
  3. Many effects in the game do not have named animations (or don't have one named death) and you are likely familiar with destroying those. (There are other issues about such effects persisting after being destroyed that I'm not addressing here.)
  4. Flamestrike has named Birth, Stand, and Death animations so because you're doing 1 it causes 2 to happen, and the Flame Strike has a death animation which is getting played instead of the birth animation you want to see.
This is actually surprisingly easy to resolve. You just need to tell the effect to play its birth animation immediately after being destroyed. That sounds like it shouldn't work because the effect is destroyed, right?! Well I guess the effect persists in memory until the animation plays so any variables that pointed to it are not yet null after the Destroy line. A little weird, but makes sense too. Something like this:
  • Actions
    • Special Effect - Create a special effect at (Center of Region 000 <gen>) using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
    • Special Effect - Destroy (Last created special effect)
    • Special Effect - Play Special Effect: (Last created special effect), Animation: Birth
This has one downside: The effect will freeze on the last frame of the animation you ordered it to play for some time until the game decides to remove it. I presume it doesn't become a permanent memory leak this way but I did not test. If you don't want to use a method like this there are other ways to remove the effect after a time delay or displaying the effect with a locusted unit with a timed life. Up to you.
i can't find Special Effect - Play Special Effect: (Last created special effect), Animation: Birth on world editor can you send a custom script in order to do this.
i use 1.29.2
 
Level 25
Joined
Sep 7, 2018
Messages
540
Now it works perfectly.
  • Fel Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fel Strike
    • Actions
      • -------- Config --------
      • Custom script: local real udg_Fel_Strike_Area
      • Set Fel_Strike_Area = 165.00
      • Set Fel_Strike_Point = (Target point of ability being cast)
      • -------- Cast --------
      • Wait 0.50 seconds
      • Special Effect - Create a special effect at Fel_Strike_Point using FelStrikeTarget.mdx
      • Set Fel_Strike_Effect = (Last created special effect)
      • Special Effect - Set Scale of Fel_Strike_Effect to 0.70
      • Special Effect - Destroy Fel_Strike_Effect
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within Fel_Strike_Area of Fel_Strike_Point) and do (Actions)
        • Loop - Actions
          • Set Fel_Strike_Target = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Fel_Strike_Target is Magic Immune) Equal to False
              • (Fel_Strike_Target is A flying unit) Equal to False
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage Fel_Strike_Target, dealing 400.00 damage of attack type Spells and damage type Magic
              • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Fel_Strike_Point facing Default building facing degrees
              • Set Dummy = (Last created unit)
              • Unit - Add Fel Strike Stun to Dummy
              • Unit - Order Dummy to Human Mountain King - Storm Bolt Fel_Strike_Target
              • Unit - Add a 0.20 second Generic expiration timer to Dummy
            • Else - Actions
              • Do nothing
      • -------- Kill trees --------
      • Destructible - Pick every destructible within Fel_Strike_Area of Fel_Strike_Point and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Destructible-type of (Picked destructible)) Equal to Ashenvale Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Ashenvale Canopy Tree
                  • (Destructible-type of (Picked destructible)) Equal to Barrens Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Barrens Canopy Tree
                  • (Destructible-type of (Picked destructible)) Equal to Black Citadel Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Cityscape Fall Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Cityscape Snowy Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Cityscape Summer Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Cityscape Winter Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Cityscape Ruined Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Dalaran Ruins Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Dungeon Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Felwood Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Felwood Canopy Tree
                  • (Destructible-type of (Picked destructible)) Equal to Icecrown Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Icecrown Canopy Tree
                  • (Destructible-type of (Picked destructible)) Equal to Northrend Canopy Tree
                  • (Destructible-type of (Picked destructible)) Equal to Fall Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Summer Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Northrend Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Snowy Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Outland Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Ruins Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Ruins Canopy Tree
                  • (Destructible-type of (Picked destructible)) Equal to Underground Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Village Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Fall Tree Wall
            • Then - Actions
              • Set Trees = (Picked destructible)
              • Destructible - Kill Trees
            • Else - Actions
              • Do nothing
      • -------- Remove leak --------
      • Custom script: call RemoveLocation(udg_Fel_Strike_Point)
      • Custom script: set udg_Fel_Strike_Point = null
      • Custom script: set udg_Fel_Strike_Target = null
      • Custom script: set udg_Dummy = null
      • Custom script: set udg_Trees = null
 
Last edited:
Level 25
Joined
Sep 7, 2018
Messages
540
I just want to be clear: that doesn’t fix the problem, it just avoids the problem. The effect you chose (FelStrikeTarget) probably doesn’t have any named animations. If you ever change it to a different model that does have named animations this issue will reappear.
But it works perfectly, actually the model that I used just has birth animation.
Here check the full map. Pick warlock hero from orc clan it's ultimate spell for this hero.
 

Attachments

  • (12)Blackrock.w3x
    712.7 KB · Views: 6
Last edited:
Level 45
Joined
Feb 27, 2007
Messages
5,578
actually the model that I used just have birth animation
No... it has no named animations. Look at the model in the editor preview menu and you'll see that it doesn't have the buttons to change animations and it also doesn't have a name given to the one animation it has. This effect will always play this animation when created and it won't be overwritten by trying to play a death animation.

Animations.png
 
Level 25
Joined
Sep 7, 2018
Messages
540
No... it has no named animations. Look at the model in the editor preview menu and you'll see that it doesn't have the buttons to change animations and it also doesn't have a name given to the one animation it has. This effect will always play this animation when created and it won't be overwritten by trying to play a death animation.

View attachment 476663
Oh, you mean this I think it doesn't have animations because I didn't add stand and death animation, am I right? And also I can't change effect animation because I use old version.
However special effect always does birth I think.
 
Level 25
Joined
Sep 7, 2018
Messages
540
No... it has no named animations. Look at the model in the editor preview menu and you'll see that it doesn't have the buttons to change animations and it also doesn't have a name given to the one animation it has. This effect will always play this animation when created and it won't be overwritten by trying to play a death animation.

View attachment 476663
Oh, you mean this I think it doesn't have animations because I didn't add stand and death animation, am I right?
 
Last edited:
Level 45
Joined
Feb 27, 2007
Messages
5,578
However special effect always does birth I think.
They automatically play a birth animation when spawned if the model has an animation called "birth". They automatically play a death animation when destroyed if the model has an animation called "death". You cannot prevent this except but ordering it to play another animation after being destroyed, as I showed above (which you can't do because your game version is too old).

The solution you have chosen is just to use an effect that doesn't have any names for its animations at all, since that means it won't be forced to show death when you immediately destroy it. That works fine here, but in the future when you encounter this issue again (because you destroy an effect immediately after creating it and use a model with a death animation) I want you to know why it is happening and what you can do about it. That is all I'm trying to explain.
 
Level 25
Joined
Sep 7, 2018
Messages
540
They automatically play a birth animation when spawned if the model has an animation called "birth". They automatically play a death animation when destroyed if the model has an animation called "death". You cannot prevent this except but ordering it to play another animation after being destroyed, as I showed above (which you can't do because your game version is too old).

The solution you have chosen is just to use an effect that doesn't have any names for its animations at all, since that means it won't be forced to show death when you immediately destroy it. That works fine here, but in the future when you encounter this issue again (because you destroy an effect immediately after creating it and use a model with a death animation) I want you to know why it is happening and what you can do about it. That is all I'm trying to explain.
Thank you, I got it. I'll add death animation to models next time.
 
Level 25
Joined
Sep 7, 2018
Messages
540
Now it works perfectly.
  • Fel Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fel Strike
    • Actions
      • -------- Config --------
      • Custom script: local real udg_Fel_Strike_Area
      • Set Fel_Strike_Area = 165.00
      • Set Fel_Strike_Point = (Target point of ability being cast)
      • -------- Cast --------
      • Wait 0.50 seconds
      • Special Effect - Create a special effect at Fel_Strike_Point using FelStrikeTarget.mdx
      • Set Fel_Strike_Effect = (Last created special effect)
      • Special Effect - Set Scale of Fel_Strike_Effect to 0.70
      • Special Effect - Destroy Fel_Strike_Effect
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within Fel_Strike_Area of Fel_Strike_Point) and do (Actions)
        • Loop - Actions
          • Set Fel_Strike_Target = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Fel_Strike_Target is Magic Immune) Equal to False
              • (Fel_Strike_Target is A flying unit) Equal to False
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage Fel_Strike_Target, dealing 400.00 damage of attack type Spells and damage type Magic
              • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Fel_Strike_Point facing Default building facing degrees
              • Set Dummy = (Last created unit)
              • Unit - Add Fel Strike Stun to Dummy
              • Unit - Order Dummy to Human Mountain King - Storm Bolt Fel_Strike_Target
              • Unit - Add a 0.20 second Generic expiration timer to Dummy
            • Else - Actions
              • Do nothing
      • -------- Kill trees --------
      • Destructible - Pick every destructible within Fel_Strike_Area of Fel_Strike_Point and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Destructible-type of (Picked destructible)) Equal to Ashenvale Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Ashenvale Canopy Tree
                  • (Destructible-type of (Picked destructible)) Equal to Barrens Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Barrens Canopy Tree
                  • (Destructible-type of (Picked destructible)) Equal to Black Citadel Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Cityscape Fall Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Cityscape Snowy Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Cityscape Summer Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Cityscape Winter Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Cityscape Ruined Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Dalaran Ruins Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Dungeon Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Felwood Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Felwood Canopy Tree
                  • (Destructible-type of (Picked destructible)) Equal to Icecrown Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Icecrown Canopy Tree
                  • (Destructible-type of (Picked destructible)) Equal to Northrend Canopy Tree
                  • (Destructible-type of (Picked destructible)) Equal to Fall Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Summer Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Northrend Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Snowy Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Outland Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Ruins Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Ruins Canopy Tree
                  • (Destructible-type of (Picked destructible)) Equal to Underground Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Village Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Fall Tree Wall
            • Then - Actions
              • Set Trees = (Picked destructible)
              • Destructible - Kill Trees
            • Else - Actions
              • Do nothing
      • -------- Remove leak --------
      • Custom script: call RemoveLocation(udg_Fel_Strike_Point)
      • Custom script: set udg_Fel_Strike_Point = null
      • Custom script: set udg_Fel_Strike_Target = null
      • Custom script: set udg_Dummy = null
      • Custom script: set udg_Trees = null
@Uncle if you have time can you tell me that is it mui? thanks.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
It's not MUI.

Fel_Strike_Point gets Set BEFORE the Wait and is referenced AFTER the Wait. If a unit were to cast the ability again during the 0.50 second delay, the Point variable would get overwritten with a new Point and cause the previous cast to have unexpected results. You had the right idea with your "shadowing" of the Fel_Strike_Area variable, though. Also, you don't need to null any of those variables at the end.

Here's an updated version with a bunch of optimizations:
  • Fel Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fel Strike
    • Actions
      • -------- Config --------
      • Custom script: local location point = GetSpellTargetLoc()
      • -------- Cast --------
      • Wait 0.50 game-time seconds
      • Set Fel_Strike_Caster = (Triggering unit)
      • Custom script: set udg_Fel_Strike_Point = point
      • -------- Optional special effect --------
      • Special Effect - Create a special effect at Fel_Strike_Point using FelStrikeTarget.mdx
      • Set Fel_Strike_Effect = (Last created special effect)
      • Special Effect - Set Scale of Fel_Strike_Effect to 0.70
      • Special Effect - Destroy Fel_Strike_Effect
      • -------- Dummy unit that stuns (only one is needed if it's setup correctly) --------
      • Unit - Create 1 Dummy for (Owner of Fel_Strike_Caster) at Fel_Strike_Point facing Default building facing degrees
      • Set Dummy = (Last created unit)
      • Unit - Add Fel Strike Stun to Dummy
      • Unit - Add a 5.00 second Generic expiration timer to Dummy
      • -------- Damage and stun enemies --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 165.00 of Fel_Strike_Point) and do (Actions)
        • Loop - Actions
          • Set Fel_Strike_Target = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Fel_Strike_Target is Alive) Equal to True
              • (Fel_Strike_Target belongs to an enemy of (Owner of Fel_Strike_Caster)) Equal to True
              • (Fel_Strike_Target is Magic Immune) Equal to False
              • (Fel_Strike_Target is A flying unit) Equal to False
            • Then - Actions
              • Unit - Order Dummy to Human Mountain King - Storm Bolt Fel_Strike_Target
              • Unit - Cause Fel_Strike_Caster to damage Fel_Strike_Target, dealing 400.00 damage of attack type Spells and damage type Magic
            • Else - Actions
      • -------- Kill trees --------
      • Destructible - Pick every destructible within 165.00 of Fel_Strike_Point and do (Actions)
        • Loop - Actions
          • Set Trees = (Picked destructible)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Destructible-type of Trees) Equal to Ashenvale Tree Wall
                  • (Destructible-type of Trees) Equal to Ashenvale Canopy Tree
                  • (Destructible-type of Trees) Equal to Barrens Tree Wall
                  • (Destructible-type of Trees) Equal to Barrens Canopy Tree
                  • (Destructible-type of Trees) Equal to Black Citadel Tree Wall
                  • (Destructible-type of Trees) Equal to Cityscape Fall Tree Wall
                  • (Destructible-type of Trees) Equal to Cityscape Snowy Tree Wall
                  • (Destructible-type of Trees) Equal to Cityscape Summer Tree Wall
                  • (Destructible-type of Trees) Equal to Cityscape Winter Tree Wall
                  • (Destructible-type of Trees) Equal to Cityscape Ruined Tree Wall
                  • (Destructible-type of Trees) Equal to Dalaran Ruins Tree Wall
                  • (Destructible-type of Trees) Equal to Dungeon Tree Wall
                  • (Destructible-type of Trees) Equal to Felwood Tree Wall
                  • (Destructible-type of Trees) Equal to Felwood Canopy Tree
                  • (Destructible-type of Trees) Equal to Icecrown Tree Wall
                  • (Destructible-type of Trees) Equal to Icecrown Canopy Tree
                  • (Destructible-type of Trees) Equal to Northrend Canopy Tree
                  • (Destructible-type of Trees) Equal to Fall Tree Wall
                  • (Destructible-type of Trees) Equal to Summer Tree Wall
                  • (Destructible-type of Trees) Equal to Northrend Tree Wall
                  • (Destructible-type of Trees) Equal to Snowy Tree Wall
                  • (Destructible-type of Trees) Equal to Outland Tree Wall
                  • (Destructible-type of Trees) Equal to Ruins Tree Wall
                  • (Destructible-type of Trees) Equal to Ruins Canopy Tree
                  • (Destructible-type of Trees) Equal to Underground Tree Wall
                  • (Destructible-type of Trees) Equal to Village Tree Wall
                  • (Destructible-type of Trees) Equal to Fall Tree Wall
            • Then - Actions
              • Destructible - Kill Trees
            • Else - Actions
      • -------- Remove memory leaks --------
      • Custom script: call RemoveLocation(udg_Fel_Strike_Point)
      • Custom script: set point = null
(Target point of ability being cast) is not usable after a Wait and I wasn't sure about shadowing it. So instead I went with something I knew would work, a local location variable (location means Point). GetSpellTargetLoc() is the code version of (Target point of ability being cast), understand that they're the same thing. Since local variables are safe to use after Waits, I simply set Fel_Strike_Point to be equal to my local variable AFTER the Wait. So we avoid the issue by relying on a local variable for a short moment and can still use Fel_Strike_Point without needing to use code everywhere.

Also, if the Dummy doesn't work, make sure that:
1) Dummy is based on the Locust with Movement Type = None, Speed Base = 0, etc.
2) Dummy Ability has 99999 cast range, 0 cooldown, 0 mana cost, etc.

Edit: Removed Fel_Strike_Area variables. I don't think that will work since "shadowing" can't be used in separate functions (scope issue). It wasn't necessary anyway, you can just reference 165.00 directly.
 
Last edited:
Level 25
Joined
Sep 7, 2018
Messages
540
It's not MUI.

Fel_Strike_Point gets Set BEFORE the Wait and is referenced AFTER the Wait. If a unit were to cast the ability again during the 0.50 second delay, the Point variable would get overwritten with a new Point and cause the previous cast to have unexpected results. You had the right idea with your "shadowing" of the Fel_Strike_Area variable, though. Also, you don't need to null any of those variables at the end.

Here's an updated version with a bunch of optimizations:
  • Fel Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fel Strike
    • Actions
      • -------- Config --------
      • Custom script: local real udg_Fel_Strike_Area
      • Custom script: local location point = GetSpellTargetLoc()
      • Set Fel_Strike_Area = 165.00
      • -------- Cast --------
      • Wait 0.50 game-time seconds
      • Set Fel_Strike_Caster = (Triggering unit)
      • Custom script: set udg_Fel_Strike_Point = point
      • -------- Optional special effect --------
      • Special Effect - Create a special effect at Fel_Strike_Point using FelStrikeTarget.mdx
      • Set Fel_Strike_Effect = (Last created special effect)
      • Special Effect - Set Scale of Fel_Strike_Effect to 0.70
      • Special Effect - Destroy Fel_Strike_Effect
      • -------- Dummy unit that stuns (only one is needed if it's setup correctly) --------
      • Unit - Create 1 Dummy for (Owner of Fel_Strike_Caster) at Fel_Strike_Point facing Default building facing degrees
      • Set Dummy = (Last created unit)
      • Unit - Add Fel Strike Stun to Dummy
      • Unit - Add a 5.00 second Generic expiration timer to Dummy
      • -------- Damage and stun enemies --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within Fel_Strike_Area of Fel_Strike_Point) and do (Actions)
        • Loop - Actions
          • Set Fel_Strike_Target = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Fel_Strike_Target is Alive) Equal to True
              • (Fel_Strike_Target belongs to an enemy of (Owner of Fel_Strike_Caster)) Equal to True
              • (Fel_Strike_Target is Magic Immune) Equal to False
              • (Fel_Strike_Target is A flying unit) Equal to False
            • Then - Actions
              • Unit - Order Dummy to Human Mountain King - Storm Bolt Fel_Strike_Target
              • Unit - Cause Fel_Strike_Caster to damage Fel_Strike_Target, dealing 400.00 damage of attack type Spells and damage type Magic
            • Else - Actions
      • -------- Kill trees --------
      • Destructible - Pick every destructible within Fel_Strike_Area of Fel_Strike_Point and do (Actions)
        • Loop - Actions
          • Set Trees = (Picked destructible)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Destructible-type of Trees) Equal to Ashenvale Tree Wall
                  • (Destructible-type of Trees) Equal to Ashenvale Canopy Tree
                  • (Destructible-type of Trees) Equal to Barrens Tree Wall
                  • (Destructible-type of Trees) Equal to Barrens Canopy Tree
                  • (Destructible-type of Trees) Equal to Black Citadel Tree Wall
                  • (Destructible-type of Trees) Equal to Cityscape Fall Tree Wall
                  • (Destructible-type of Trees) Equal to Cityscape Snowy Tree Wall
                  • (Destructible-type of Trees) Equal to Cityscape Summer Tree Wall
                  • (Destructible-type of Trees) Equal to Cityscape Winter Tree Wall
                  • (Destructible-type of Trees) Equal to Cityscape Ruined Tree Wall
                  • (Destructible-type of Trees) Equal to Dalaran Ruins Tree Wall
                  • (Destructible-type of Trees) Equal to Dungeon Tree Wall
                  • (Destructible-type of Trees) Equal to Felwood Tree Wall
                  • (Destructible-type of Trees) Equal to Felwood Canopy Tree
                  • (Destructible-type of Trees) Equal to Icecrown Tree Wall
                  • (Destructible-type of Trees) Equal to Icecrown Canopy Tree
                  • (Destructible-type of Trees) Equal to Northrend Canopy Tree
                  • (Destructible-type of Trees) Equal to Fall Tree Wall
                  • (Destructible-type of Trees) Equal to Summer Tree Wall
                  • (Destructible-type of Trees) Equal to Northrend Tree Wall
                  • (Destructible-type of Trees) Equal to Snowy Tree Wall
                  • (Destructible-type of Trees) Equal to Outland Tree Wall
                  • (Destructible-type of Trees) Equal to Ruins Tree Wall
                  • (Destructible-type of Trees) Equal to Ruins Canopy Tree
                  • (Destructible-type of Trees) Equal to Underground Tree Wall
                  • (Destructible-type of Trees) Equal to Village Tree Wall
                  • (Destructible-type of Trees) Equal to Fall Tree Wall
            • Then - Actions
              • Destructible - Kill Trees
            • Else - Actions
      • -------- Remove memory leaks --------
      • Custom script: call RemoveLocation(udg_Fel_Strike_Point)
      • Custom script: set point = null
(Target point of ability being cast) is not usable after a Wait and I wasn't sure about shadowing it. So instead I went with something I knew would work, a local location variable (location means Point). GetSpellTargetLoc() is the code version of (Target point of ability being cast), understand that they're the same thing. Since local variables are safe to use after Waits, I simply set Fel_Strike_Point to be equal to my local variable AFTER the Wait. So we avoid the issue by relying on a local variable for a short moment and can also still use Fel_Strike_Point without needing to use code everywhere.

Also, if the Dummy doesn't work, make sure that:
1) Dummy is based on the Locust with most importantly Movement Type = None, Speed Base = 0, etc.
2) Dummy Ability has 99999 cast range, 0 cooldown, 0 mana cost, etc.
Thanks alot, for help.
 
Top