• 🏆 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] Indexing goes wrong

Status
Not open for further replies.

BUP

BUP

Level 9
Joined
Sep 9, 2012
Messages
172
These are the triggers from the spell Axe Spiral
I have troubles with my indexing.This spell didn't become MUI.


  • AS Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Axe Spiral
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AS_Index_Listener Equal to 0
        • Then - Actions
          • Trigger - Turn on AS Loop <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AS_Recycle_Size Greater than 0
        • Then - Actions
          • Set AS_Recycle_Size = (AS_Recycle_Size - 1)
          • Set AS_Current_Index = AS_Recycle_Container[AS_Recycle_Size]
        • Else - Actions
          • Set AS_Current_Index = AS_Index_Size
          • Set AS_Index_Size = (AS_Index_Size + 1)
      • Set AS_Caster[AS_Current_Index] = (Casting unit)
      • Set AS_Point = (Position of AS_Caster[AS_Current_Index])
      • Set AS_Height = 0.00
      • Set AS_Total_Axes[AS_Current_Index] = (8 + ((Level of Axe Spiral for AS_Caster[AS_Current_Index]) x 2))
      • Set AS_Damage = (3.00 x (Real((Level of Axe Spiral for AS_Caster[AS_Current_Index]))))
      • Set AS_Timer[AS_Current_Index] = AS_AbilityDuration
      • For each (Integer AS_Integer) from 1 to AS_Total_Axes[AS_Current_Index], do (Actions)
        • Loop - Actions
          • Unit - Create 1 Axe Spiral Unit for (Owner of AS_Caster[AS_Current_Index]) at (AS_Point offset by AS_AxeDistance towards ((360.00 / (Real(AS_Total_Axes[AS_Current_Index]))) x (Real(AS_Integer))) degrees) facing Default building facing degrees
          • Set AS_Dummy[AS_Integer] = (Last created unit)
          • Custom script: if UnitAddAbility(udg_AS_Dummy[udg_AS_Integer],'Amrf') then
          • Custom script: call UnitRemoveAbility(udg_AS_Dummy[udg_AS_Integer],'Amrf')
          • Custom script: endif
          • Animation - Change AS_Dummy[AS_Integer]'s size to (AS_Size%, 0.00%, 0.00%) of its original size
      • Custom script: call RemoveLocation(udg_AS_Point)
      • Set AS_Index_Container[AS_Index_Listener] = AS_Current_Index
      • Set AS_Index_Listener = (AS_Index_Listener + 1)


  • AS Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer AS_Loop) from 0 to (AS_Index_Listener - 1), do (Actions)
        • Loop - Actions
          • Set AS_Timer[AS_Current_Index] = (AS_Timer[AS_Current_Index] - 0.03)
          • Set AS_Current_Index = AS_Index_Container[AS_Loop]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • AS_Timer[AS_Current_Index] Greater than 0.00
            • Then - Actions
              • Set AS_Height = (AS_Height + AS_Height_Increase)
              • Set AS_Point = (Position of AS_Caster[AS_Current_Index])
              • For each (Integer AS_Integer) from 1 to AS_Total_Axes[AS_Current_Index], do (Actions)
                • Loop - Actions
                  • Animation - Change AS_Dummy[AS_Integer] flying height to AS_Height at 0.00
                  • Set AS_Dummy_Point[AS_Integer] = (Position of AS_Dummy[AS_Integer])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • AS_Angle[AS_Integer] Greater than or equal to 359.00
                    • Then - Actions
                      • Set AS_Angle[AS_Integer] = 0.00
                    • Else - Actions
                  • Set AS_Distance[AS_Integer] = (Distance between AS_Dummy_Point[AS_Integer] and AS_Point)
                  • Set AS_Angle[AS_Integer] = (Angle from AS_Point to AS_Dummy_Point[AS_Integer])
                  • Set AS_Move[AS_Integer] = (AS_Point offset by (AS_Distance[AS_Integer] + AS_GoingIn_Speed) towards (AS_Angle[AS_Integer] - AS_Spin_Speed) degrees)
                  • Unit - Move AS_Dummy[AS_Integer] instantly to AS_Move[AS_Integer], facing (AS_Angle[AS_Integer] - 90.00) degrees
                  • Custom script: call RemoveLocation(udg_AS_Move[udg_AS_Integer])
                  • Set AS_Hit_Group[AS_Integer] = (Units within 100.00 of AS_Dummy_Point[AS_Integer] matching (((((Matching unit) is A structure) Not equal to True) and (((Matching unit) is Magic Immune) Not equal to True)) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an e
                  • Unit Group - Pick every unit in AS_Hit_Group[AS_Integer] and do (Actions)
                    • Loop - Actions
                      • Set AS_Picked_Unit[AS_Integer] = (Picked unit)
                      • Set AS_PickedPoint[AS_Integer] = (Position of AS_Picked_Unit[AS_Integer])
                      • Set AS_Hit_Move[AS_Integer] = (AS_PickedPoint[AS_Integer] offset by AS_Hit_MoveSpeed towards (Angle from AS_Point to AS_PickedPoint[AS_Integer]) degrees)
                      • Unit - Cause AS_Caster[AS_Current_Index] to damage AS_Picked_Unit[AS_Integer], dealing AS_Damage damage of attack type Spells and damage type Normal
                      • Unit - Move AS_Picked_Unit[AS_Integer] instantly to AS_Hit_Move[AS_Integer]
                      • Custom script: call RemoveLocation(udg_AS_Hit_Move[udg_AS_Integer])
                      • Custom script: call RemoveLocation(udg_AS_PickedPoint[udg_AS_Integer])
                      • Special Effect - Create a special effect attached to the chest of AS_Picked_Unit[AS_Integer] using AS_Model_3
                      • Special Effect - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation(udg_AS_Dummy_Point[udg_AS_Integer])
                  • Custom script: call DestroyGroup(udg_AS_Hit_Group[udg_AS_Integer])
              • Custom script: call RemoveLocation(udg_AS_Point)
            • Else - Actions
              • Set AS_Point = (Position of AS_Caster[AS_Current_Index])
              • For each (Integer AS_Integer) from 1 to AS_Total_Axes[AS_Current_Index], do (Actions)
                • Loop - Actions
                  • Unit - Kill AS_Dummy[AS_Integer]
                  • Special Effect - Create a special effect at (AS_Point offset by AS_AxeDistance towards ((360.00 / (Real(AS_Total_Axes[AS_Current_Index]))) x (Real(AS_Integer))) degrees) using AS_Model_2
                  • Special Effect - Destroy (Last created special effect)
              • Custom script: call RemoveLocation(udg_AS_Point)
              • Set AS_Index_Listener = (AS_Index_Listener - 1)
              • Set AS_Index_Container[AS_Loop] = AS_Index_Container[AS_Index_Listener]
              • Set AS_Recycle_Container[AS_Recycle_Size] = AS_Current_Index
              • Set AS_Recycle_Size = (AS_Recycle_Size + 1)
              • Set AS_Loop = (AS_Loop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • AS_Index_Listener Equal to 0
                • Then - Actions
                  • Trigger - Turn off AS Loop <gen>
                  • Skip remaining actions
                • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top