• 🏆 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] Problem with making trigger MUI

Status
Not open for further replies.
Level 1
Joined
Apr 11, 2011
Messages
63
i'm making an spell like Meat-Hook in DotA ... i having this problem .. when it cast multiple times it leaves a chain dummy ... i hope you help me with this
here's the trigger ...

  • Constricting Chains
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Constricting Chains
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ConChains_Int Equal to 0
        • Then - Actions
          • Trigger - Turn on Constricting Chains Extend <gen>
        • Else - Actions
      • Set ConChains_Int = (ConChains_Int + 1)
      • Set ConChains_Counts = (ConChains_Counts + 1)
      • Set ConChains_Caster[ConChains_Counts] = (Triggering unit)
      • Set ConChains_Level[ConChains_Counts] = (Real((Level of Constricting Chains for ConChains_Caster[ConChains_Counts])))
      • Set ConChains_Point[1] = (Position of ConChains_Caster[ConChains_Counts])
      • Set ConChains_Point[2] = (Target point of ability being cast)
      • Set ConChains_Angle[ConChains_Counts] = (Angle from ConChains_Point[1] to ConChains_Point[2])
      • Unit - Create 1 Dummy (Global) for (Owner of ConChains_Caster[ConChains_Counts]) at ConChains_Point[1] facing Default building facing degrees
      • Set ConChains_Dummy[ConChains_Counts] = (Last created unit)
      • Set ConChains_Link[ConChains_Counts] = 0
      • Set ConChains_LinkMax[ConChains_Counts] = (5 + (6 x (Integer(ConChains_Level[ConChains_Counts]))))
      • Set ConChains_On[ConChains_Counts] = True
      • Custom script: call RemoveLocation(udg_ConChains_Point[1])
      • Custom script: call RemoveLocation(udg_ConChains_Point[2])



  • Constricting Chains Extend
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ConChains_Loop) from 1 to ConChains_Counts, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ConChains_On[ConChains_Loop] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (ConChains_Dummy[ConChains_Loop] is alive) Equal to True
                • Then - Actions
                  • Set ConChains_Link[ConChains_Loop] = (ConChains_Link[ConChains_Loop] + 1)
                  • Set ConChains_Point[1] = (Position of ConChains_Dummy[ConChains_Loop])
                  • Set ConChains_Point[2] = (ConChains_Point[1] offset by (40.00 x (Real(ConChains_Link[ConChains_Loop]))) towards ConChains_Angle[ConChains_Loop] degrees)
                  • Unit - Create 1 Chilling Touch for (Owner of ConChains_Caster[ConChains_Loop]) at ConChains_Point[2] facing ConChains_Angle[ConChains_Loop] degrees
                  • Set ConChains_DummyLink[ConChains_Link[ConChains_Loop]] = (Last created unit)
                  • Set ConChains_Point[3] = (Position of ConChains_DummyLink[ConChains_Link[ConChains_Loop]])
                  • Set ConChains_HitGroup[ConChains_Loop] = (Random 1 units from (Units within 125.00 of ConChains_Point[3] matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is Mechanical) Not equal to True) and ((((Matching unit) is An Ancient) Not equal to True) and ((((Matching u
                  • Unit Group - Pick every unit in ConChains_HitGroup[ConChains_Loop] and do (Actions)
                    • Loop - Actions
                      • Set ConChains_Hit[ConChains_Loop] = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • ConChains_Hit[ConChains_Loop] Not equal to No unit
                          • ConChains_Link[ConChains_Loop] Greater than or equal to ConChains_LinkMax[ConChains_Loop]
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (ConChains_Hit[ConChains_Loop] belongs to an ally of (Owner of ConChains_Caster[ConChains_Loop])) Not equal to True
                        • Then - Actions
                          • Unit - Cause ConChains_Caster[ConChains_Loop] to damage ConChains_Hit[ConChains_Loop], dealing (90.00 x ConChains_Level[ConChains_Loop]) damage of attack type Chaos and damage type Universal
                          • Special Effect - Create a special effect attached to the chest of ConChains_Hit[ConChains_Loop] using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
                          • Special Effect - Destroy (Last created special effect)
                        • Else - Actions
                      • Unit - Kill ConChains_Dummy[ConChains_Loop]
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_ConChains_Point[1])
                  • Custom script: call RemoveLocation(udg_ConChains_Point[2])
                  • Custom script: call RemoveLocation(udg_ConChains_Point[3])
                  • Custom script: call DestroyGroup (udg_ConChains_HitGroup[udg_ConChains_Loop])
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ConChains_Hit[ConChains_Loop] Not equal to No unit
                    • Then - Actions
                      • Set ConChains_Point[4] = (Position of ConChains_DummyLink[ConChains_Link[ConChains_Loop]])
                      • Unit - Move ConChains_Hit[ConChains_Loop] instantly to ConChains_Point[4]
                      • Unit - Remove ConChains_DummyLink[ConChains_Link[ConChains_Loop]] from the game
                      • Set ConChains_Link[ConChains_Loop] = (ConChains_Link[ConChains_Loop] - 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ConChains_Link[ConChains_Loop] Less than or equal to 0
                        • Then - Actions
                          • Set ConChains_Int = (ConChains_Int - 1)
                          • Set ConChains_On[ConChains_Loop] = False
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ConChains_Int Equal to 0
                            • Then - Actions
                              • Set ConChains_Counts = 0
                              • Trigger - Turn off (This trigger)
                            • Else - Actions
                          • Set ConChains_Hit[ConChains_Loop] = No unit
                        • Else - Actions
                      • Custom script: call RemoveLocation(udg_ConChains_Point[4])
                    • Else - Actions
                      • Unit - Remove ConChains_DummyLink[ConChains_Link[ConChains_Loop]] from the game
                      • Set ConChains_Link[ConChains_Loop] = (ConChains_Link[ConChains_Loop] - 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ConChains_Link[ConChains_Loop] Less than or equal to 0
                        • Then - Actions
                          • Set ConChains_Int = (ConChains_Int - 1)
                          • Set ConChains_On[ConChains_Loop] = False
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ConChains_Int Equal to 0
                            • Then - Actions
                              • Set ConChains_Counts = 0
                              • Trigger - Turn off (This trigger)
                            • Else - Actions
                        • Else - Actions
            • Else - Actions


Thanks in advance :))
 
Status
Not open for further replies.
Top