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

Yet again in need of Help: Spell

Status
Not open for further replies.
Level 6
Joined
Feb 21, 2008
Messages
205
Electric Discharge:
The Engineer puts on a battery which can store electricity, electricity has a chance to be produced when the engineer is hit, More electricity is produced the higher level this ability is. The Engineer can discharge this electricity to hurl a chain lightning at target enemies, this ability bounces more and damages more the more electricity it has charged up.

Triggers1:
  • Is attacked trigger
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Electric Discharge for (Attacked unit)) Greater than or equal to 1
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 5) Equal to 1
        • Then - Actions
          • Special Effect - Create a special effect at (Position of (Attacked unit)) using Abilities\Spells\Orc\Purge\PurgeBuffTarget.mdl
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Electric Discharge for (Attacked unit)) Equal to 1
            • Then - Actions
              • Set Some_number_variable = (Some_number_variable + 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Electric Discharge for (Attacked unit)) Equal to 2
                • Then - Actions
                  • Set Some_number_variable = (Some_number_variable + 2)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Electric Discharge for (Attacked unit)) Equal to 3
                    • Then - Actions
                      • Set Some_number_variable = (Some_number_variable + 3)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Level of Electric Discharge for (Attacked unit)) Equal to 4
                        • Then - Actions
                          • Set Some_number_variable = (Some_number_variable + 4)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Level of Electric Discharge for (Attacked unit)) Equal to 5
                            • Then - Actions
                              • Set Some_number_variable = (Some_number_variable + 5)
                            • Else - Actions
                              • Do nothing
        • Else - Actions
          • Do nothing
-------------------------------------------------
Trigger 2:
  • Cast spell trigger
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Electric Discharge
    • Actions
      • Set Electric_target = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Some_number_variable Equal to 1
        • Then - Actions
          • Unit - Create 1 Dummy Caster unit for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
          • Unit - Add Chain lightning (dummy) to (Last created unit)
          • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
          • Unit - Set level of Chain lightning (dummy) for (Last created unit) to 1
          • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning Electric_target
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Some_number_variable Equal to 2
            • Then - Actions
              • Unit - Create 1 Dummy Caster unit for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
              • Unit - Add Chain lightning (dummy) to (Last created unit)
              • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
              • Unit - Set level of Chain lightning (dummy) for (Last created unit) to 2
              • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning Electric_target
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Some_number_variable Equal to 4
                • Then - Actions
                  • Unit - Create 1 Dummy Caster unit for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
                  • Unit - Add Chain lightning (dummy) to (Last created unit)
                  • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
                  • Unit - Set level of Chain lightning (dummy) for (Last created unit) to 4
                  • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning Electric_target
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Some_number_variable Equal to 5
                    • Then - Actions
                      • Unit - Create 1 Dummy Caster unit for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
                      • Unit - Add Chain lightning (dummy) to (Last created unit)
                      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
                      • Unit - Set level of Chain lightning (dummy) for (Last created unit) to 5
                      • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning Electric_target
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Some_number_variable Equal to 6
                        • Then - Actions
                          • Unit - Create 1 Dummy Caster unit for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
                          • Unit - Add Chain lightning (dummy) to (Last created unit)
                          • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
                          • Unit - Set level of Chain lightning (dummy) for (Last created unit) to 6
                          • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning Electric_target
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Some_number_variable Equal to 7
                            • Then - Actions
                              • Unit - Create 1 Dummy Caster unit for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
                              • Unit - Add Chain lightning (dummy) to (Last created unit)
                              • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
                              • Unit - Set level of Chain lightning (dummy) for (Last created unit) to 7
                              • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning Electric_target
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • Some_number_variable Equal to 8
                                • Then - Actions
                                  • Unit - Create 1 Dummy Caster unit for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
                                  • Unit - Add Chain lightning (dummy) to (Last created unit)
                                  • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
                                  • Unit - Set level of Chain lightning (dummy) for (Last created unit) to 8
                                  • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning Electric_target
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • Some_number_variable Equal to 9
                                    • Then - Actions
                                      • Unit - Create 1 Dummy Caster unit for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
                                      • Unit - Add Chain lightning (dummy) to (Last created unit)
                                      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
                                      • Unit - Set level of Chain lightning (dummy) for (Last created unit) to 9
                                      • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning Electric_target
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • Some_number_variable Equal to 10
                                        • Then - Actions
                                          • Unit - Create 1 Dummy Caster unit for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
                                          • Unit - Add Chain lightning (dummy) to (Last created unit)
                                          • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
                                          • Unit - Set level of Chain lightning (dummy) for (Last created unit) to 10
                                          • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning Electric_target
                                        • Else - Actions
                                          • Do nothing
----------
And the third:
  • Reducing electric discharge
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Some_number_variable Greater than 10
        • Then - Actions
          • Set Some_number_variable = (Some_number_variable - 1)
        • Else - Actions
So, the dummy unit spawns, but he doesnt cast the spell for some reason, I've checked over my triggers, checked if the ability costs mana/CD/range, it all works as far as I have checked, but he still doesnt cast my spell >.<

Any clue what could be wrong here?
 
Level 6
Joined
Feb 21, 2008
Messages
205
Hmm.. try replacing "finishes casting.." with "starts the effect.."
And you could shorten this triggers in a few lines.

Your shitting me lol, that actually worked.

How on earth, my trigger did fire, since my dummy unit spawned, but how could it be fixed by just changing that?

A million thanks for the help though=)

(Yeah I know of the "Do nothings", but it helps tidy up my triggers, and its not for battle net, so am not afraid of the extra lag=)
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
  • actions
    • set Electric_Target = (Target Unit of Ability being Cast)
    • for each Integer A from 1 to 10
      • loop actions
        • if (Integer A equal to Some_Number)
        • then (Do your actions)
          • set level of Chain Lightning for (last created unit) to Integer A
That should be it,,
 
Status
Not open for further replies.
Top