• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Trigger] Chain lightning help

Status
Not open for further replies.
Level 2
Joined
Oct 17, 2008
Messages
11
i am trying to build a chain lightning ability that bounces and deals damage based on the attribute intellect. i am using the dummy ability channel as my cast, there is only 1 rank to my ability (which i plan to keep that way) and am using triggers for the rest. here is my trigger so far
NewBitmapImage-2-1.jpg
so far it double hits the initial target and randomly completes full target total (6) id also like to add sound but that wasn't working for me ether. Any suggestions appreciated, also the variables i use are all based off the player # so not to over lap if 2 players cast the same spell within triggering time (prob not completely necessary but id rather have it then not)
 
Level 6
Joined
Sep 13, 2008
Messages
261
What you need to do in this case is pick all units in an area and do actions.
If they meet your target requirements
Add them to a second group
then pick random unit of second group deal damage and move effect to it then remove the unit from the group.
until the number desired is reached like this
  • Chain Lightning
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chain Lightning
    • Actions
      • Unit Group - Pick every unit in (Units within 512.00 of (Center of (Playable map area))) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Targeted unit) is alive) Equal to True
            • Then - Actions
              • Unit Group - Add (Targeted unit) to PlayersGroup[1]
            • Else - Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Unit[1] = (Random unit from PlayersGroup[1])
          • Unit - Cause (Triggering unit) to damage (Triggering unit), dealing 500.00 damage of attack type Spells and damage type Normal
          • Lightning - Create a Chain Lightning - Primary lightning effect from source (Position of (Triggering unit)) to target (Position of Unit[1])
          • Wait 0.03 seconds
          • Lightning - Destroy (Last created lightning effect)
          • Unit Group - Remove Unit[1] from PlayersGroup[1]
Warning trigger leaks locations and unit groups and is not mui.
 
Level 2
Joined
Oct 17, 2008
Messages
11
ok ya the if then else one that is blank i had conditions which i was basing off another spell but i got rid of the conditions needed and never movied the else function else for some reson, Thanks howl for the tip, but also i want it to bounce off the the hit unit and go from 500 from there, also the damage would work but i dont think the lightning effect would work, im thinking of trying a dummy unit that will give a buff to units to make them availbe targets or make them the next target

Edit
i figgured it out
NewBitmapImage-3.jpg
 
Last edited:
Level 5
Joined
Jan 6, 2006
Messages
106
  • Chain Lightning
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chain Lightning
    • Actions
      • Unit Group - Pick every unit in (Units within 512.00 of (Center of (Playable map area))) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Targeted unit) is alive) Equal to True
            • Then - Actions
              • Unit Group - Add (Targeted unit) to PlayersGroup[1]
            • Else - Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Unit[1] = (Random unit from PlayersGroup[1])
          • Unit - Cause (Triggering unit) to damage (Triggering unit), dealing 500.00 damage of attack type Spells and damage type Normal
          • Lightning - Create a Chain Lightning - Primary lightning effect from source (Position of (Triggering unit)) to target (Position of Unit[1])
          • Wait 0.03 seconds
          • Lightning - Destroy (Last created lightning effect)
          • Unit Group - Remove Unit[1] from PlayersGroup[1]

(Position of (Triggering unit)) and (Position of Unit[1]) are GUI leaks. Please take note of that.

And to be on the safe side, assign a variable for the lightning effect. Using (Last created (unit, unit group, special effect.... whatever)) after a Wait function may cause it not to work.
 
Level 2
Joined
Oct 17, 2008
Messages
11
ya i relize to set to variables that was only the first section of the trigger and i get rid of leaks at the end, and sorry about the trigger as text im new to this site and didnt understand how to do it otherwise, this post can be deleted thanks for all the help guys
 
Status
Not open for further replies.
Top