• 🏆 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!

[Crash] TOTAL ERROR when casting a spell

Status
Not open for further replies.
Level 11
Joined
Jun 26, 2014
Messages
504
Spell desc.: Links the caster and the target, healing the target per second and draining the mana of the caster. Caster can link himself with multiple units.

  • Cell Link
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Cell Link
    • Actions
      • For each (Integer A) from 1 to SP_CL_mui, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Target unit of ability being cast) Equal to SP_CL_unit[(Integer A)]
            • Then - Actions
              • Player Group - Add (Owner of (Triggering unit)) to Player_Messages
              • Game - Display to Player_Messages for 5.00 seconds the text: |cffffcc00Unit is a...
              • Player Group - Remove (Owner of (Triggering unit)) from Player_Messages
              • Skip remaining actions
            • Else - Actions
      • Set SP_CL_index = (SP_CL_index + 1)
      • Set SP_CL_mui = (SP_CL_mui + 1)
      • Set SP_CL_caster[SP_CL_mui] = (Triggering unit)
      • Set SP_CL_unit[SP_CL_mui] = (Target unit of ability being cast)
      • Set SP_CL_data[SP_CL_mui] = ((Real((Level of Cell Link for (Triggering unit)))) x 1.00)
      • Set SP_CL_mana[SP_CL_mui] = ((Real((Level of Cell Link for (Triggering unit)))) x 0.10)
      • Set SP_CL_distance[SP_CL_mui] = (((Level of Cell Link for (Triggering unit)) x 75) + 675)
      • Set SP_CL_point1[SP_CL_mui] = (Position of (Triggering unit))
      • Set SP_CL_point2[SP_CL_mui] = (Position of (Target unit of ability being cast))
      • Lightning - Create a Healing Wave - Secondary lightning effect from source SP_CL_point1[SP_CL_mui] to target SP_CL_point2[SP_CL_mui]
      • Set SP_CL_link[SP_CL_mui] = (Last created lightning effect)
      • Trigger - Turn on Cell Link Loop <gen>
  • Cell Link Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to SP_CL_mui, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((SP_CL_caster[(Integer A)] is alive) Equal to True) and ((SP_CL_unit[(Integer A)] is alive) Equal to True)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between SP_CL_point1[(Integer A)] and SP_CL_point2[(Integer A)]) Less than or equal to (Real(SP_CL_distance[(Integer A)]))
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Percentage mana of SP_CL_caster[(Integer A)]) Greater than 5.00
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Percentage life of SP_CL_unit[(Integer A)]) Less than 100.00
                        • Then - Actions
                          • Set SP_CL_point1[(Integer A)] = (Position of SP_CL_caster[(Integer A)])
                          • Set SP_CL_point2[(Integer A)] = (Position of SP_CL_unit[(Integer A)])
                          • Lightning - Move SP_CL_link[(Integer A)] to source SP_CL_point1[(Integer A)] and target SP_CL_point2[(Integer A)]
                          • Unit - Set mana of SP_CL_caster[(Integer A)] to ((Mana of SP_CL_caster[(Integer A)]) - SP_CL_mana[(Integer A)])
                          • Unit - Set life of SP_CL_unit[(Integer A)] to ((Life of SP_CL_unit[(Integer A)]) + SP_CL_data[(Integer A)])
                          • Custom script: call RemoveLocation(udg_SP_CL_point1[bj_forLoopAIndex])
                          • Custom script: call RemoveLocation(udg_SP_CL_point2[bj_forLoopAIndex])
                        • Else - Actions
                          • Lightning - Destroy SP_CL_link[(Integer A)]
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • SP_CL_unit[(Integer A)] Not equal to No unit
                            • Then - Actions
                              • Set SP_CL_caster[(Integer A)] = No unit
                              • Set SP_CL_unit[(Integer A)] = No unit
                              • Set SP_CL_index = (SP_CL_index - 1)
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • SP_CL_index Less than or equal to 0
                                • Then - Actions
                                  • Set SP_CL_index = 0
                                  • Set SP_CL_mui = 0
                                  • Trigger - Turn off (This trigger)
                                • Else - Actions
                            • Else - Actions
                    • Else - Actions
                      • Lightning - Destroy SP_CL_link[(Integer A)]
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • SP_CL_unit[(Integer A)] Not equal to No unit
                        • Then - Actions
                          • Set SP_CL_caster[(Integer A)] = No unit
                          • Set SP_CL_unit[(Integer A)] = No unit
                          • Set SP_CL_index = (SP_CL_index - 1)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • SP_CL_index Less than or equal to 0
                            • Then - Actions
                              • Set SP_CL_index = 0
                              • Set SP_CL_mui = 0
                              • Trigger - Turn off (This trigger)
                            • Else - Actions
                        • Else - Actions
                • Else - Actions
                  • Lightning - Destroy SP_CL_link[(Integer A)]
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SP_CL_unit[(Integer A)] Not equal to No unit
                    • Then - Actions
                      • Set SP_CL_caster[(Integer A)] = No unit
                      • Set SP_CL_unit[(Integer A)] = No unit
                      • Set SP_CL_index = (SP_CL_index - 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • SP_CL_index Less than or equal to 0
                        • Then - Actions
                          • Set SP_CL_index = 0
                          • Set SP_CL_mui = 0
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
            • Else - Actions
              • Lightning - Destroy SP_CL_link[(Integer A)]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SP_CL_unit[(Integer A)] Not equal to No unit
                • Then - Actions
                  • Set SP_CL_caster[(Integer A)] = No unit
                  • Set SP_CL_unit[(Integer A)] = No unit
                  • Set SP_CL_index = (SP_CL_index - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SP_CL_index Less than or equal to 0
                    • Then - Actions
                      • Set SP_CL_index = 0
                      • Set SP_CL_mui = 0
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
 
Status
Not open for further replies.
Top