# [Trigger]Problem with making trigger MUI

Status
Not open for further replies.

#### Chuchulain

Level 1
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_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_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_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
• 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
• Unit - Move ConChains_Hit[ConChains_Loop] instantly to ConChains_Point[4]
• 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
• 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

#### mckill2009

Level 29
can you post a test map? coz seems like you are reducing the ConChains_Int twice...

#### Chuchulain

Level 1
I tried to remove the other ConChains_Int but it's still leaving the chains ... btw here's the test map ...

#### Attachments

• ConChains Test.w3x
44.3 KB · Views: 46

#### mckill2009

Level 29
sometimes, GUI cant do what JASS can, here's my version of it in JASS...

Last edited:

#### Chuchulain

Level 1
i tried your version but it seems not working on me ... it's still leaving some chains ...
we'll nevermind i decided to put expiration to the chains ...

Thanks for checking it ... )

Status
Not open for further replies.

Replies
2
Views
511
Replies
35
Views
1K
Replies
15
Views
1K
Replies
2
Views
549
Replies
3
Views
609