• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] My spell is not working without Leaks.

Status
Not open for further replies.
Level 6
Joined
Jun 14, 2009
Messages
124
Well my prob is my spell won't work when I remove the leaks.

Try the spell with the leaks.

Then,

Try the spell without the leaks.

Concusion : The spell is not working...

So if you have any idea to fix the prob with no leaks, pm in this threat.

Post your new trigger in the threat, please.

Thanks !
 

Attachments

  • Lightning Destruction 1.0.0.a.w3x
    32.3 KB · Views: 49
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin o_O

Wait wait wait .... I remember the same spell for a couple of month ago, with the same trigger, with the same problem with the leak fixes and this was solved by me ...

So what's going on here?

  • Lightning Destruction Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set LD_Index[1] = 0
      • For each (Integer LD_Index[3]) from 1 to LD_Index[2], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LD_Bounce[LD_Index[3]] Greater than 0
            • Then - Actions
              • Set LD_Index[1] = (LD_Index[1] + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LD_Booleen[LD_Index[3]] Equal to False
                • Then - Actions
                  • Set LD_CasterLoc[LD_Index[3]] = (Position of LD_Caster[LD_Index[3]])
                  • Set LD_Distance[LD_Index[3]] = (Distance between LD_CasterLoc[LD_Index[3]] and LD_TargetLoc[LD_Index[3]])
                  • Set LD_Angle[LD_Index[3]] = (Angle from LD_CasterLoc[LD_Index[3]] to LD_TargetLoc[LD_Index[3]])
                  • Set LD_CurrentDistance[LD_Index[3]] = ((Distance between LD_CasterLoc[LD_Index[3]] and LD_LightningLoc[LD_Index[3]]) + LD_Speed[LD_Index[3]])
                  • Set LD_MoveLoc[LD_Index[3]] = (LD_CasterLoc[LD_Index[3]] offset by LD_CurrentDistance[LD_Index[3]] towards LD_Angle[LD_Index[3]] degrees)
                  • Custom script: call RemoveLocation( udg_LD_LightningLoc[ udg_LD_Index[ 3 ] ] )
                  • Set LD_LightningLoc[LD_Index[3]] = LD_MoveLoc[LD_Index[3]]
                  • Set Z[1] = 0.00
                  • Set Z[2] = (((LD_MaxHeight[LD_Index[3]] / LD_Distance[LD_Index[3]]) x (LD_Distance[LD_Index[3]] - LD_CurrentDistance[LD_Index[3]])) x (LD_CurrentDistance[LD_Index[3]] / LD_Distance[LD_Index[3]]))
                  • Set X[1] = (X of LD_CasterLoc[LD_Index[3]])
                  • Set X[2] = (X of LD_MoveLoc[LD_Index[3]])
                  • Set Y[1] = (Y of LD_CasterLoc[LD_Index[3]])
                  • Set Y[2] = (Y of LD_MoveLoc[LD_Index[3]])
                  • Custom script: call MoveLightningEx(udg_LD_Lightning[ udg_LD_Index[ 3 ] ], false, udg_X[1], udg_Y[1], udg_Z[1], udg_X[2], udg_Y[2], udg_Z[2])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • LD_CurrentDistance[LD_Index[3]] Greater than or equal to LD_Distance[LD_Index[3]]
                    • Then - Actions
                      • Special Effect - Create a special effect at LD_TargetLoc[LD_Index[3]] using LD_Effect[1]
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at LD_CasterLoc[LD_Index[3]] using LD_Effect[1]
                      • Special Effect - Destroy (Last created special effect)
                      • Set LD_Booleen[LD_Index[3]] = True
                      • Set LD_CurrentDistance[LD_Index[3]] = 0.00
                      • Set LD_Loc1[LD_Index[3]] = LD_CasterLoc[LD_Index[3]]
                      • Set LD_Loc2[LD_Index[3]] = (LD_TargetLoc[LD_Index[3]] offset by (Random real number between LD_MinAoE[LD_Index[3]] and LD_MaxAoE[LD_Index[3]]) towards (Random angle) degrees)
                      • Set LD_Distance[LD_Index[3]] = (Distance between LD_Loc1[LD_Index[3]] and LD_Loc2[LD_Index[3]])
                      • Set LD_Angle[LD_Index[3]] = (Angle from LD_Loc1[LD_Index[3]] to LD_Loc2[LD_Index[3]])
                      • Custom script: call RemoveLocation( udg_LD_LightningLoc[ udg_LD_Index[ 3 ] ] )
                      • Set LD_Group[LD_Index[3]] = (Units within LD_DamageZone[LD_Index[3]] of LD_Loc2[LD_Index[3]] matching (((Matching unit) belongs to an enemy of (Owner of LD_Caster[LD_Index[3]])) Equal to True))
                      • Custom script: call RemoveLocation( udg_LD_MoveLoc[ udg_LD_Index[ 3 ] ] )
                      • Custom script: call RemoveLocation( udg_LD_CasterLoc[ udg_LD_Index[ 3 ] ] )
                      • Unit Group - Pick every unit in LD_Group[LD_Index[3]] and do (Actions)
                        • Loop - Actions
                          • Unit - Cause LD_Caster[LD_Index[3]] to damage (Picked unit), dealing LD_Damage[LD_Index[3]] damage of attack type Spells and damage type Lightning
                    • Else - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • LD_CurrentDistance[LD_Index[3]] Less than LD_Distance[LD_Index[3]]
                    • Then - Actions
                      • Set LD_Speed[LD_Index[3]] = (LD_Distance[LD_Index[3]] / (50.00 / 3.00))
                      • Set LD_CurrentDistance[LD_Index[3]] = (LD_CurrentDistance[LD_Index[3]] + LD_Speed[LD_Index[3]])
                      • Set LD_MoveLoc[LD_Index[3]] = (LD_Loc1[LD_Index[3]] offset by LD_CurrentDistance[LD_Index[3]] towards LD_Angle[LD_Index[3]] degrees)
                      • Set Z[2] = 0.00
                      • Set Z[1] = (((LD_MaxHeight[LD_Index[3]] / LD_Distance[LD_Index[3]]) x (LD_Distance[LD_Index[3]] - LD_CurrentDistance[LD_Index[3]])) x (LD_CurrentDistance[LD_Index[3]] / LD_Distance[LD_Index[3]]))
                      • Set X[2] = (X of LD_TargetLoc[LD_Index[3]])
                      • Set X[1] = (X of LD_MoveLoc[LD_Index[3]])
                      • Set Y[2] = (Y of LD_TargetLoc[LD_Index[3]])
                      • Set Y[1] = (Y of LD_MoveLoc[LD_Index[3]])
                      • Custom script: call MoveLightningEx(udg_LD_Lightning[ udg_LD_Index[ 3 ] ], false, udg_X[1], udg_Y[1], udg_Z[1], udg_X[2], udg_Y[2], udg_Z[2])
                    • Else - Actions
                      • Special Effect - Create a special effect at LD_TargetLoc[LD_Index[3]] using LD_Effect[1]
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at LD_Loc2[LD_Index[3]] using LD_Effect[1]
                      • Special Effect - Destroy (Last created special effect)
                      • Set LD_Bounce[LD_Index[3]] = (LD_Bounce[LD_Index[3]] - 1)
                      • Set LD_CurrentDistance[LD_Index[3]] = 0.00
                      • Set LD_Loc1[LD_Index[3]] = LD_Loc2[LD_Index[3]]
                      • Set LD_Loc2[LD_Index[3]] = (LD_TargetLoc[LD_Index[3]] offset by (Random real number between LD_MinAoE[LD_Index[3]] and LD_MaxAoE[LD_Index[3]]) towards (Random angle) degrees)
                      • Set LD_Distance[LD_Index[3]] = (Distance between LD_Loc1[LD_Index[3]] and LD_Loc2[LD_Index[3]])
                      • Set LD_Angle[LD_Index[3]] = (Angle from LD_Loc1[LD_Index[3]] to LD_Loc2[LD_Index[3]])
                      • Set LD_Group[LD_Index[3]] = (Units within LD_DamageZone[LD_Index[3]] of LD_Loc2[LD_Index[3]] matching (((Matching unit) belongs to an enemy of (Owner of LD_Caster[LD_Index[3]])) Equal to True))
                      • Unit Group - Pick every unit in LD_Group[LD_Index[3]] and do (Actions)
                        • Loop - Actions
                          • Set Temp_Loc = (Position of (Picked unit))
                          • Unit - Cause LD_Caster[LD_Index[3]] to damage (Picked unit), dealing LD_Damage[LD_Index[3]] damage of attack type Spells and damage type Lightning
                          • Special Effect - Create a special effect at Temp_Loc using LD_Effect[2]
                          • Special Effect - Destroy (Last created special effect)
                          • Custom script: call RemoveLocation( udg_Temp_Loc )
                          • Custom script: call RemoveLocation( udg_LD_Loc2[ udg_LD_Index[ 3 ] ] )
                          • Custom script: call RemoveLocation( udg_LD_Loc1[ udg_LD_Index[ 3 ] ] )
                      • Custom script: call DestroyGroup( udg_LD_Group[ udg_LD_Index[ 3 ] ] )
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LD_Bounce[LD_Index[3]] Equal to 0
                • Then - Actions
                  • Set LD_Bounce[LD_Index[3]] = (LD_Bounce[LD_Index[3]] - 1)
                  • Lightning - Destroy LD_Lightning[LD_Index[3]]
                  • Custom script: call RemoveLocation( udg_LD_TargetLoc[ udg_LD_Index[ 3 ] ] )
                  • Custom script: call RemoveLocation( udg_LD_Loc1[ udg_LD_Index[ 3 ] ] )
                  • Custom script: call RemoveLocation( udg_LD_Loc2[ udg_LD_Index[ 3 ] ] )
                • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LD_Index[1] Equal to 0
        • Then - Actions
          • Set LD_Index[2] = 0
          • Trigger - Turn off (This trigger)
        • Else - Actions
Greetings and Peace
Dr. Boom
 
Status
Not open for further replies.
Top