• 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.

Help me with Passive chain lightning

Status
Not open for further replies.
Level 4
Joined
Jul 25, 2007
Messages
66
I have been trying to make a passive chain lightning spell, like a 50% chance to cast when ever you attack someone. So far, this is what I have.
halpwp7.png


Sorry for the large picture, wanted to make sure you guys cold read it.

Edit: Never mind that isn't too big
 
Level 10
Joined
Jun 10, 2007
Messages
557
This may or may not be able to help you with the concept of dummy-units. Unfortunately, I have absolutely no clue how to make a 50% chance-on-hit type thing... I'm positive it's possible in JASS Script, but I dunno about GUI.

There is also an Edit-Post button near the bottom of your post. This is preferable to double-posting.
 
  • Passive CL
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Passive CL for (Attacking unit)) Greater than 0
      • (Random integer number between 1 and 2) Equal to 1
    • Actions
      • Custom script: local location udg_TempPoint
      • Set TempPoint = (Position of (Attacking unit))
      • Unit - Create 1 dummy for (Owner of (Attacking unit)) at TempPoint facing Default building facing degrees
      • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
      • Unit - Add Chain Lightning (dummy) to (Last created unit)
      • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning (Attacked unit)
      • Custom script: call RemoveLocation(udg_TempPoint)
Not tested but should work.
 
Last edited:
Level 12
Joined
Aug 18, 2006
Messages
1,193
  • Passive CL
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Passive CL for (Attacking unit)) Greater than 0
    • Actions
      • Custom script: local location udg_TempPoint
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 2) Equal to 1
        • Then - Actions
          • Set TempPoint = (Position of (Attacking unit))
          • Unit - Create 1 dummy for (Owner of (Attacking unit)) at TempPoint facing Default building facing degrees
          • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
          • Unit - Add Chain Lightning (dummy) to (Last created unit)
          • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning (Attacked unit)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_TempPoint)
Not tested but should work.
it should work, but the TempPoints local doesnt work, since its a If - All Conditions..... thing, but move the call RemoveLocation to under Order (Last created unit) and it should be flawless :p
 
Level 12
Joined
Aug 18, 2006
Messages
1,193
they go away from If/then/else is i remember correctly

and no, you dont need to move the Set TempPoint above the If/then/else, it should work perfectly anyway, which actually leads us that we dont even need the If/then/else, since we can just use the Random Number in the Conditions.....
 
Status
Not open for further replies.
Top