• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Spell] Chain Lightning - Do Not Destroy Trees

Status
Not open for further replies.
Level 11
Joined
Sep 11, 2013
Messages
327
Greetings!
I just wanted to make this spell Chain Lightning (level 4) to kill units, buildings and [Trees] when bounce.
Each level(1-4) has different number of bounces and different damage.

The problem is.. How can i made this spell to bounce even in Trees and kill Trees when bounce? "Target allowed" do not work..
I am still a begginer with triggers..
The help will be appreciated.
 
Level 17
Joined
Jun 2, 2009
Messages
1,183
If we talk about spell without bounce, it will be easy. But i don't know any way to detect next target for it's jump.
But maybe we can create new trigger that picks doodads and units within range and deals damage via trigger.
It is just a theory. I don't know how to make it.
 
Level 11
Joined
Sep 11, 2013
Messages
327
I'll see if I can throw together a working spell for you, I use the latest version as well so you'll be able to open my map.
Oh.:) Thank you so much!
I forgget to mention one more thing in that spell..
If is possible, when the chain hit the trees and found a unit/building in the next possible bounce even with many trees around, will be great if the spell will start prioritizing the unit/building for next bounce

I have Discord if needed.
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,694
I forgot how complicated this type of spell could be :xxd: Anyway, here it is.

I tried to put everything you would want to customize inside of the Chain Lightning Cast trigger, let me know what you think.

Some notes:
You cannot target trees with the initial cast but it will bounce to nearby trees if able.
It only targets a single type of tree but it can be changed to do multiples types of Destructibles. See the Chain Lightning Get Closest Tree trigger.
It's completely MUI, meaning you can cast this spell any number of times using any number of units and it will always work.
I carried over every single property from the original Chain Lightning such as Damage Reduction.
I gave you control over how long the delay is between lightning bounces. I recommend using a value that is a multiple of 2 like 0.10 or 0.20.
HD graphics are buggy so the Chain Lightning special effect creates an annoying looping sound. I don't know how to fix this besides using a different sfx or SD graphics.
There's room for efficiency improvements but I didn't want to create too many variables and it's really not that important.

Edit: Added new version which uses the Sentinel ability to target Trees with the initial cast. Also cleaned up some bugs/variables.
Edit 2: Fixed more bugs (see last posts).
 

Attachments

  • Custom Chain Lightning 3.w3m
    36.9 KB · Views: 9
Last edited:
Level 11
Joined
Sep 11, 2013
Messages
327
In my map, most of the time i need to use the spell first target on trees :(
Can you, please, come to Discord to talk a little bit more acurate about this spell:?
I feel a little overwhelmed by the size of the trigger o_O :)
A Future End#8167
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,694
I managed to make it target Trees by using the Sentinel ability and editing some of the triggers.

These are the main Actions you would edit in the Chain Lightning Cast trigger:
  • -------- [ CUSTOMIZE THESE: ] --------
  • Set VariableSet CL_TreeType = Summer Tree Wall
  • Set VariableSet CL_LightningArtTarget = Abilities\Weapons\Bolt\BoltImpact.mdl
  • Set VariableSet CL_AreaOfEffect[CL_Index] = 500.00
  • Set VariableSet CL_DelayBetweenBounces[CL_Index] = 0.20
  • Set VariableSet CL_DamageReduction[CL_Index] = 0.10
  • Set VariableSet CL_Damage[CL_Index] = (60.00 x (Real((Level of (Ability being cast) for CL_Caster[CL_Index]))))
  • Set VariableSet CL_NumberOfTargetsHit[CL_Index] = (2 + (2 x (Level of (Ability being cast) for CL_Caster[CL_Index])))
By default I have it setup to deal 60/120/180 damage and hit 4/6/8 targets with a 500 search radius for bounces. It also deals 10% less damage per bounce and has a 0.20 second delay between bounces.

If you want to target different Destructibles / multiple Tree-Types you can edit the Chain Lightning Get Closest Tree trigger:
  • If - Conditions
    • (Destructible-type of (Picked destructible)) Equal to CL_TreeType
    • ((Picked destructible) is alive) Equal to True
Simply add an OR to these Conditions and put all of your preferred Destructible-types.
  • 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 Barrel
        • (Destructible-type of (Picked destructible)) Equal to Cage
    • ((Picked destructible) is alive) Equal to True
See the previous post for an updated version. I'll update that with all new fixes!
 
Last edited:
Level 11
Joined
Sep 11, 2013
Messages
327
I managed to make it target Trees by using the Sentinel ability and editing some of the triggers.

These are the main Actions you would edit in the Chain Lightning Cast trigger:
  • -------- [ CUSTOMIZE THESE: ] --------
  • Set VariableSet CL_TreeType = Summer Tree Wall
  • Set VariableSet CL_LightningArtTarget = Abilities\Weapons\Bolt\BoltImpact.mdl
  • Set VariableSet CL_AreaOfEffect[CL_Index] = 500.00
  • Set VariableSet CL_DelayBetweenBounces[CL_Index] = 0.20
  • Set VariableSet CL_DamageReduction[CL_Index] = 0.10
  • Set VariableSet CL_Damage[CL_Index] = (60.00 x (Real((Level of (Ability being cast) for CL_Caster[CL_Index]))))
  • Set VariableSet CL_NumberOfTargetsHit[CL_Index] = (2 + (2 x (Level of (Ability being cast) for CL_Caster[CL_Index])))
By default I have it setup to deal 60/120/180 damage and hit 4/6/8 targets with a 500 search radius for bounces. It also deals 10% less damage per bounce and has a 0.20 second delay between bounces.

If you want to target different Destructibles / multiple Tree-Types you can edit the Chain Lightning Get Closest Tree trigger:
  • If - Conditions
    • (Destructible-type of (Picked destructible)) Equal to CL_TreeType
    • ((Picked destructible) is alive) Equal to True
Simply add an OR to these Conditions and put all of your preferred Destructible-types.
  • 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 Barrel
        • (Destructible-type of (Picked destructible)) Equal to Cage
    • ((Picked destructible) is alive) Equal to True
Hello again! I admire your work, it's very good.
I didn't know it would be such a long trigger.o_O
Thank you for all your work!

Now I know how to edit the basics of the spell, but i found a few problems because i didn't tell you what i accurately wanted for the spell. (sorry for that)

(Ideal spell)
Main Problems
1. I want to delete all lightning effects which appear between the targets, but i have no ideea how.
I want to put a special effect only on Origin(center) of targets(trees,units,buildings) when the spell hits them, without the lightning between them.
Special Effect: Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl

2. I found a little problem.. When the spell hits a moving target, the effect will remain attached to the ground and doesn't follow the target.
I wanted, if possible, the special effect to be attached to the Targets for its duration when the spell hits.

Optional problems
1. If possible, can you add a custom Aoe for each level (1-3)? I found you set bounce effect to be 500range, but 500 for all 3 levels

2. I found a weird bug, the last target hitted by the spell is NOT affected by special effect. Is it possible to make even the last unit to receive the special effect?

Thank you in advice!
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,694
So you don't want ANY Lightning and you want to attach the Special Effect to the Origin of the targets instead of creating it at their position. That's an easy change. Also, I'll look into the bug, I imagine it's something simple. I'll edit this comment in a few minutes with the map.

Edit: Here it is.

And you would define the Area of Effect using the same method I used for Number of Targets / Damage. It's just simple Arithmetic:
  • Set Variable CL_AreaOfEffect[CL_Index] = (500.00 + ((Real((Level of (Ability being cast) for CL_Caster[CL_Index]))) + 200.00))
This would be 700.00, 900.00, 1100.00, etc...

If your scaling doesn't follow a consistent pattern like this then you can use an Array that you define beforehand:
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set Variable CL_AoEPerLevel[1] = 500.00
    • Set Variable CL_AoEPerLevel[2] = 650.00
    • Set Variable CL_AoEPerLevel[3] = 1000.00
  • Set Variable CL_AreaOfEffect[CL_Index] = CL_AoEPerLevel[(Level of (Ability being cast) for CL_Caster[CL_Index])]
 

Attachments

  • Custom Chain Lightning abcdefg.w3m
    27.8 KB · Views: 7
Last edited:
Level 11
Joined
Sep 11, 2013
Messages
327
So you don't want ANY Lightning and you want to attach the Special Effect to the Origin of the targets instead of creating it at their position. That's an easy change. Also, I'll look into the bug, I imagine it's something simple. I'll edit this comment in a few minutes with the map.
Yes, if you can, i don't want ANY lightnings in the spell, just that special effect which will be attach to the origin of each target for its duration of the effect.
Sorry for bad english..:peasant-blushing:



EDit: It's perfect!
I just have to figure it out how to add this text (500.00 + ((Real((Level of (Ability being cast) for CL_Caster[CL_Index]))) + 200.00)) to the CL_AreaOfEffect[CL_Index] :))
it's just a matter of time until I figure it out
Thank you again!

EDIT2: I did it :) It's very very good
 
Last edited:
Level 11
Joined
Sep 11, 2013
Messages
327
So you don't want ANY Lightning and you want to attach the Special Effect to the Origin of the targets instead of creating it at their position. That's an easy change. Also, I'll look into the bug, I imagine it's something simple. I'll edit this comment in a few minutes with the map.

Edit: Here it is.

And you would define the Area of Effect using the same method I used for Number of Targets / Damage. It's just simple Arithmetic:
  • Set Variable CL_AreaOfEffect[CL_Index] = (500.00 + ((Real((Level of (Ability being cast) for CL_Caster[CL_Index]))) + 200.00))
This would be 700.00, 900.00, 1100.00, etc...

If your scaling doesn't follow a consistent pattern like this then you can use an Array that you define beforehand:
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set Variable CL_AoEPerLevel[1] = 500.00
    • Set Variable CL_AoEPerLevel[2] = 650.00
    • Set Variable CL_AoEPerLevel[3] = 1000.00
  • Set Variable CL_AreaOfEffect[CL_Index] = CL_AoEPerLevel[(Level of (Ability being cast) for CL_Caster[CL_Index])]
Sorry for bother you again, but i found a new (i think big) problem with the spell :(
Is complicated to explain in text so i've made a video on youtube to see better what is the problem..
I don't know if you have the energy and desire to fix it because you already did a lot of work to helping me

Here is the video:
Thank you very much anyway :)
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,694
Found the issue:
  • Set VariableSet CL_Point = (Position of (Picked destructible))
That was set to Position of (Picked unit) instead of (Picked destructible)

I updated my previous post with a new version of the map. Or you can just fix it yourself, it's very simple:
  • Chain Lightning Get Closest Tree
    • Events
    • Conditions
    • Actions
      • Set VariableSet CL_Tree = No destructible
      • Set VariableSet CL_AreaOfEffect[0] = 9999999.00
      • Destructible - Pick every destructible within CL_AreaOfEffect[CL_Loop] of CL_LightningSource[CL_Loop] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to CL_TreeType
              • ((Picked destructible) is alive) Equal to True
            • Then - Actions
              • Set VariableSet CL_Point = (Position of (Picked destructible)) <------------------------------------- FIX THIS ONE LINE
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between CL_LightningSource[CL_Loop] and CL_Point) Less than or equal to CL_AreaOfEffect[0]
                • Then - Actions
                  • Set VariableSet CL_Tree = (Picked destructible)
                  • Set VariableSet CL_AreaOfEffect[0] = (Distance between CL_LightningSource[CL_Loop] and CL_Point)
                • Else - Actions
              • Custom script: call RemoveLocation(udg_CL_Point)
            • Else - Actions
 
Last edited:
Level 11
Joined
Sep 11, 2013
Messages
327
Found the issue:
  • Set VariableSet CL_Point = (Position of (Picked destructible))
That was set to Position of (Picked unit) instead of (Picked destructible)

I updated my previous post with a new version of the map. Or you can just fix it yourself, it's very simple:
  • Chain Lightning Get Closest Tree
    • Events
    • Conditions
    • Actions
      • Set VariableSet CL_Tree = No destructible
      • Set VariableSet CL_AreaOfEffect[0] = 9999999.00
      • Destructible - Pick every destructible within CL_AreaOfEffect[CL_Loop] of CL_LightningSource[CL_Loop] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to CL_TreeType
              • ((Picked destructible) is alive) Equal to True
            • Then - Actions
              • Set VariableSet CL_Point = (Position of (Picked destructible)) <------------------------------------- FIX THIS ONE LINE
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between CL_LightningSource[CL_Loop] and CL_Point) Less than or equal to CL_AreaOfEffect[0]
                • Then - Actions
                  • Set VariableSet CL_Tree = (Picked destructible)
                  • Set VariableSet CL_AreaOfEffect[0] = (Distance between CL_LightningSource[CL_Loop] and CL_Point)
                • Else - Actions
              • Custom script: call RemoveLocation(udg_CL_Point)
            • Else - Actions
You did it again! Thank you so much! It work!:peasant-cheers:
"One more thing" :peasant-work-work:
I found with my friend a little problem with NumberOfTargetsHit
For example: If targets=15
If the first target is a Tree - it never count as a target, so the spell will hit this 1 tree + 15 targets =16
My friend tried to fix that and it work.
Here is how we fix that:
 

Attachments

  • HowWeDidIt.jpg
    HowWeDidIt.jpg
    177.4 KB · Views: 11

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,694
Edit: I literally forgot to subtract it in the Cast trigger. I was doing it in the UNIT section but not TREE:
  • Else - Actions
    • -------- TREE was found! --------
    • Set VariableSet CL_Tree = (Target destructible of ability being cast)
    • Set VariableSet CL_LightningSource[CL_Index] = (Position of CL_Tree)
    • -------- --------
    • -------- Customize the Special Effect: --------
    • Special Effect - Create a special effect at CL_LightningSource[CL_Index] using CL_LightningArtTarget
    • Special Effect - Destroy (Last created special effect)
    • -------- --------
    • -------- Kill tree: --------
    • Set VariableSet CL_NumberOfTargetsHit[CL_Index] = (CL_NumberOfTargetsHit[CL_Index] - 1)
    • Set VariableSet CL_Damage[CL_Index] = (CL_Damage[CL_Index] x (1.00 - CL_DamageReduction[CL_Index]))
    • Destructible - Kill CL_Tree
I updated all of the maps.
 
Last edited:
Level 11
Joined
Sep 11, 2013
Messages
327
Edit: I literally forgot to subtract it in the Cast trigger. I was doing it in the UNIT section but not TREE:
  • Else - Actions
    • -------- TREE was found! --------
    • Set VariableSet CL_Tree = (Target destructible of ability being cast)
    • Set VariableSet CL_LightningSource[CL_Index] = (Position of CL_Tree)
    • -------- --------
    • -------- Customize the Special Effect: --------
    • Special Effect - Create a special effect at CL_LightningSource[CL_Index] using CL_LightningArtTarget
    • Special Effect - Destroy (Last created special effect)
    • -------- --------
    • -------- Kill tree: --------
    • Set VariableSet CL_NumberOfTargetsHit[CL_Index] = (CL_NumberOfTargetsHit[CL_Index] - 1)
    • Set VariableSet CL_Damage[CL_Index] = (CL_Damage[CL_Index] x (1.00 - CL_DamageReduction[CL_Index]))
    • Destructible - Kill CL_Tree
I updated all of the maps.
Hello, again :peasant-waving:
I just imported the spell in the main map and after some tests, i found a new problem and i don't know how to fix it.. and is big:peasant-sad:
There i have this spell which regrow the dead trees
  • Regrow Trees STYK
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Regrow Trees - STYK
    • Actions
      • Special Effect - Create a special effect at ((Target point of ability being cast) offset by 0.00 towards 0.00 degrees.) using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at ((Target point of ability being cast) offset by 200.00 towards 0.00 degrees.) using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at ((Target point of ability being cast) offset by 200.00 towards 60.00 degrees.) using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at ((Target point of ability being cast) offset by 200.00 towards 120.00 degrees.) using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at ((Target point of ability being cast) offset by 200.00 towards 180.00 degrees.) using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at ((Target point of ability being cast) offset by 200.00 towards 240.00 degrees.) using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at ((Target point of ability being cast) offset by 200.00 towards 300.00 degrees.) using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Destructible - Pick every destructible within 375.00 of (Target point of ability being cast) and do (Destructible - Resurrect (Picked destructible) with (Max life of (Picked destructible)) life and Show birth animation)
      • Wait 0.15 seconds
      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
If i use Chain Lightning a second time on the same trees which was resurrected to life, I receive this message "That tree is occupied by an owl" which don't let me to use the spell again on this tree anymore..

The spell must hit: Air/Debris/Enemy/Neutral/Tree/Vulnerable/Structure (and maybe few more in future) (work good now with Sentinel)

I know that problem is because sentinel spell owl, but i don't know with what spell I should replace it..

Do you have any ideea?:peasant-confused:


Edit1: It is possible to make this spell Not to target/damage/jump the spell immunity units? (is not necessary, but maybe for the future:?)
 
Last edited:
Level 20
Joined
Feb 27, 2019
Messages
616
The tree dies before the owl spawns on the tree which creates some kind of bug.


You can add these to the trigger
  • Custom script: local destructable d
  • Custom script: set d = udg_CL_Tree
  • Wait 0.00 seconds
  • Custom script: call KillDestructable(d)
  • Custom script: set d = null
Change these ability values
Art - Missile speed = 0
Level Data - Hoovering Height = -3501

  • Chain Lightning Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chain Lightning (Demo)
    • Actions
      • Custom script: local destructable d
      • Set VariableSet CL_Index = (CL_Index + 1)
      • Set VariableSet CL_Caster[CL_Index] = (Triggering unit)
      • Set VariableSet CL_Player[CL_Index] = (Owner of CL_Caster[CL_Index])
      • Custom script: set udg_CL_CanBeTargeted[udg_CL_Index] = CreateGroup()
      • -------- --------
      • -------- [ CUSTOMIZE THESE: ] --------
      • Set VariableSet CL_TreeType = Summer Tree Wall
      • Set VariableSet CL_LightningArtTarget = Abilities\Weapons\Bolt\BoltImpact.mdl
      • Set VariableSet CL_AreaOfEffect[CL_Index] = 500.00
      • Set VariableSet CL_DelayBetweenBounces[CL_Index] = 0.20
      • Set VariableSet CL_DamageReduction[CL_Index] = 0.10
      • Set VariableSet CL_Damage[CL_Index] = (60.00 x (Real((Level of (Ability being cast) for CL_Caster[CL_Index]))))
      • Set VariableSet CL_NumberOfTargetsHit[CL_Index] = (2 + (2 x (Level of (Ability being cast) for CL_Caster[CL_Index])))
      • -------- --------
      • -------- [ STOP - TURN ON THE LOOP TRIGGER: ] --------
      • Set VariableSet CL_DelayBetweenBouncesReset[CL_Index] = CL_DelayBetweenBounces[CL_Index]
      • Trigger - Turn on Chain Lightning Loop <gen>
      • -------- --------
      • -------- [ DAMAGE TARGET / KILL TREE: ] --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target destructible of ability being cast) Equal to No destructible
        • Then - Actions
          • -------- UNIT was found! --------
          • Set VariableSet CL_Target = (Target unit of ability being cast)
          • Set VariableSet CL_LightningSource[CL_Index] = (Position of CL_Target)
          • -------- --------
          • -------- Create lightning: --------
          • Set VariableSet LH_DurationSet = 1.00
          • Set VariableSet LH_LightningNameSet = CLSB
          • Set VariableSet LH_PointSourceZSet = 60.00
          • Set VariableSet LH_PointTargetZSet = 60.00
          • Set VariableSet LH_PointSourceSet = (Position of CL_Caster[CL_Index])
          • Set VariableSet LH_PointTargetSet = (Position of CL_Target)
          • Trigger - Run LH Point2Point <gen> (ignoring conditions)
          • -------- --------
          • -------- Customize the Special Effect: --------
          • Special Effect - Create a special effect at CL_LightningSource[CL_Index] using CL_LightningArtTarget
          • Special Effect - Destroy (Last created special effect)
          • -------- --------
          • -------- Deal damage: --------
          • Set VariableSet CL_NumberOfTargetsHit[CL_Index] = (CL_NumberOfTargetsHit[CL_Index] - 1)
          • Unit Group - Add CL_Target to CL_CanBeTargeted[CL_Index]
          • Unit - Cause CL_Caster[CL_Index] to damage CL_Target, dealing CL_Damage[CL_Index] damage of attack type Spells and damage type Normal
          • Set VariableSet CL_Damage[CL_Index] = (CL_Damage[CL_Index] x (1.00 - CL_DamageReduction[CL_Index]))
        • Else - Actions
          • -------- TREE was found! --------
          • Set VariableSet CL_Tree = (Target destructible of ability being cast)
          • Custom script: set d = udg_CL_Tree
          • Set VariableSet CL_LightningSource[CL_Index] = (Position of CL_Tree)
          • -------- --------
          • -------- Create lightning: --------
          • Set VariableSet LH_DurationSet = 1.00
          • Set VariableSet LH_LightningNameSet = CLSB
          • Set VariableSet LH_PointSourceZSet = 60.00
          • Set VariableSet LH_PointTargetZSet = 60.00
          • Set VariableSet LH_PointSourceSet = (Position of CL_Caster[CL_Index])
          • Set VariableSet LH_PointTargetSet = (Position of CL_Tree)
          • Trigger - Run LH Point2Point <gen> (ignoring conditions)
          • -------- --------
          • -------- Customize the Special Effect: --------
          • Special Effect - Create a special effect at CL_LightningSource[CL_Index] using CL_LightningArtTarget
          • Special Effect - Destroy (Last created special effect)
          • -------- --------
          • -------- Kill tree: --------
          • Set VariableSet CL_NumberOfTargetsHit[CL_Index] = (CL_NumberOfTargetsHit[CL_Index] - 1)
          • Set VariableSet CL_Damage[CL_Index] = (CL_Damage[CL_Index] x (1.00 - CL_DamageReduction[CL_Index]))
          • Wait 0.00 seconds
          • Custom script: call KillDestructable(d)
      • Custom script: set d = null
Since Uncle has the best idea of the spell and trigger you may want to wait and let him update it for you though. I am not sure this solution is bug free because of the wait.
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,694
Tree Solutions:
  • Do what [db]east suggested, although it really needs to use a 0.00 second Timer since Waits aren't precise. The tree may get targeted by a bounce if it doesn't get destroyed early enough.
  • Find a different ability that can target trees.
  • Instead of resurrecting trees, simply recreate them.

You can ignore Magic Immune units by filtering them out in the Get Closest Unit trigger.
  • ((Matching unit) is Magic Immune) Equal to False
 
Level 11
Joined
Sep 11, 2013
Messages
327
Tree Solutions:
  • Do what [db]east suggested, although it really needs to use a 0.00 second Timer since Waits aren't precise. The tree may get targeted by a bounce if it doesn't get destroyed early enough.
  • Find a different ability that can target trees.
  • Instead of resurrecting trees, simply recreate them.

You can ignore Magic Immune units by filtering them out in the Get Closest Unit trigger.
  • ((Matching unit) is Magic Immune) Equal to False
1. I did what [db]east told me and now the spell work good even on the same tree :peasant-cheers:


2. I tried to put the condition, but the spell can still hit immune units. Is not a big problem tho.

Thanks for the help Again!

  • Chain Lightning Get Closest Unit
    • Events
    • Conditions
    • Actions
      • Set VariableSet CL_Target = No unit
      • Set VariableSet CL_AreaOfEffect[0] = 9999999.00
      • Set VariableSet CL_UnitGroup = (Units within CL_AreaOfEffect[CL_Loop] of CL_LightningSource[CL_Loop] matching ((((Matching unit) belongs to an enemy of CL_Player[CL_Loop].) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is in CL_CanBeTargeted[CL_Loop]
      • Unit Group - Pick every unit in CL_UnitGroup and do (Actions)
        • Loop - Actions
          • Set VariableSet CL_Point = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Matching unit) is Magic Immune) Equal to False <----------
              • (Distance between CL_LightningSource[CL_Loop] and CL_Point) Less than or equal to CL_AreaOfEffect[0]
            • Then - Actions
              • Set VariableSet CL_Target = (Picked unit)
              • Set VariableSet CL_AreaOfEffect[0] = (Distance between CL_LightningSource[CL_Loop] and CL_Point)
            • Else - Actions
          • Custom script: call RemoveLocation(udg_CL_Point)
      • Custom script: call DestroyGroup (udg_CL_UnitGroup)
 
Last edited:

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,694
(Matching unit) is used during the creation of the Unit Group to reference the units being added to it:
  • Set VariableSet CL_UnitGroup = (Units within CL_AreaOfEffect[CL_Loop] of CL_LightningSource[CL_Loop] matching ((((Matching unit) belongs to an enemy of CL_Player[CL_Loop].) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is in CL_CanBeTargeted[CL_Loop
So you use the (Matching unit) Event Response when you see the word "matching" -> Units in region matching... Units within range matching... etc.

What you did would work if you switched (Matching unit) to the correct Event Response for that situation -> (Picked unit). But I advise against this, it's better to add another Condition to CL_UnitGroup since that'll be more efficient.
 
Last edited:
Level 11
Joined
Sep 11, 2013
Messages
327
(Matching unit) is used during the creation of the Unit Group to reference the units being added to it:
  • Set VariableSet CL_UnitGroup = (Units within CL_AreaOfEffect[CL_Loop] of CL_LightningSource[CL_Loop] matching ((((Matching unit) belongs to an enemy of CL_Player[CL_Loop].) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is in CL_CanBeTargeted[CL_Loop
So you use the (Matching unit) Event Response when you see the word "matching" -> Units in region matching... Units within range matching... etc.

What you did would work if you switched (Matching unit) to the correct Event Response for that situation -> (Picked unit). But I advise against this, it's better to add another Condition to CL_UnitGroup since that'll be more efficient.
I've put at the end of CL_UnitGroup another "and" ((Matching unit) is Magic Immune) Equal to False (do not work | i can still target spell immunity units)
I deleted the first try then I put in the If condition
  • ((Picked unit) is Magic Immune) Equal to False
(same problem)

Is not a real problem right now:)) i can live with that.
I am glad the main spell work fine thanks to you!
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,694
Oh, you mean you can target them with the initial cast. It definitely won't bounce to Magic Immune units if you add that condition.

You would need to adjust the Targets Allowed on the ability itself to determine what you can initially target. But Sentinel is not intended to target Units in the first place so it probably always pierces Magic Immunity. You should mess around with it.

If that doesn't work you can add a new trigger that Orders the Hero to "Stop" if they begin casting the ability on a Magic Immune target.
 
Last edited:
Status
Not open for further replies.
Top