- Joined
- Oct 18, 2007
- Messages
- 929
Ok im fixing a spell for someone and it starts to loop at the end, but i dont know why... I get so frustrated when something like this happens
plz check it out

-
Setup
-

Events
-


Map initialization
-
-

Conditions
-

Actions
-


-------- I added this Real Variable so that you can controll the speed the target is pulled. --------
-


Set Speed = 5.00
-


-------- With this variable you can change the lightning type --------
-


Set LightningType = Chain Lightning - Primary
-
-
-
Physics Pull MUI
-

Events
-


Unit - A unit Begins casting an ability
-
-

Conditions
-


(Ability being cast) Equal to Psychic Pull
-


((Triggering unit) is in DraggingGroup) Not equal to True
-
-

Actions
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




Count Less than 8000
-
-



Then - Actions
-




Set Count = (Count + 1)
-
-



Else - Actions
-




Set Count = 0
-
-
-


Set Caster[Count] = (Casting unit)
-


Set Target[Count] = (Target unit of ability being cast)
-


Set CasterLocation[Count] = (Position of Caster[Count])
-


Set TargetLocation[Count] = (Position of Target[Count])
-


Wait 0.01 seconds
-


Unit - Pause Caster[Count]
-


Animation - Play Caster[Count]'s spell channel animation
-


Unit - Set the custom value of Target[Count] to Count
-


Unit - Set the custom value of Caster[Count] to Count
-


Unit Group - Add Caster[Count] to DraggingGroup
-


Unit Group - Add Target[Count] to MoovingUnits
-


Special Effect - Create a special effect at TargetLocation[Count] using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
-


Special Effect - Destroy (Last created special effect)
-


Lightning - Create a LightningType lightning effect from source CasterLocation[Count] to target TargetLocation[Count]
-


Set LightningEffect[Count] = (Last created lightning effect)
-


Unit - Turn collision for Target[Count] Off
-
-
-
The Pull
-

Events
-


Time - Every 0.01 seconds of game time
-
-

Conditions
-

Actions
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




(Number of units in MoovingUnits) Greater than 0
-
-



Then - Actions
-




Unit Group - Pick every unit in MoovingUnits and do (Actions)
-





Loop - Actions
-






Set Counting = (Custom value of (Picked unit))
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(Distance between CasterLocation[Counting] and TargetLocation[Counting]) Less than or equal to 100.00
-
-







Then - Actions
-








Unit Group - Remove Caster[Counting] from DraggingGroup
-








Unit Group - Remove Target[Counting] from MoovingUnits
-








-------- You dont need this effect --------
-








Special Effect - Create a special effect at TargetLocation[Counting] using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
-








Special Effect - Destroy (Last created special effect)
-








-------- You dont need this effect --------
-








Custom script: call RemoveLocation ( udg_CasterLocation[udg_Counting] )
-








Custom script: call RemoveLocation ( udg_TargetLocation[udg_Counting] )
-








Custom script: call RemoveLocation ( udg_TargetMoveLoaction[udg_Counting] )
-








Unit - Turn collision for Target[Counting] Off
-








Animation - Reset Caster[Counting]'s animation
-








Lightning - Destroy LightningEffect[Counting]
-








Unit - Unpause Caster[Counting]
-








Unit - Set the custom value of Target[Counting] to 0
-








Unit - Set the custom value of Caster[Counting] to 0
-








Set Caster[Counting] = No unit
-








Set Target[Counting] = No unit
-
-







Else - Actions
-








Custom script: call RemoveLocation ( udg_TargetLocation[udg_Counting] )
-








Set TargetLocation[Counting] = (Position of Target[Counting])
-








Set TargetMoveLoaction[Counting] = (TargetLocation[Counting] offset by Speed towards (Angle from TargetLocation[Counting] to CasterLocation[Counting]) degrees)
-








Unit - Move Target[Counting] instantly to TargetMoveLoaction[Counting]
-








Lightning - Move LightningEffect[Counting] to source TargetMoveLoaction[Counting] and target CasterLocation[Counting]
-








-------- You dont need this effect --------
-








Special Effect - Create a special effect at TargetLocation[Counting] using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
-








Special Effect - Destroy (Last created special effect)
-








-------- You dont need this effect --------
-








Custom script: call RemoveLocation ( udg_TargetMoveLoaction[udg_Counting] )
-
-
-
-
-
-



Else - Actions
-
-
-
-
Canceled Pull
-

Events
-


Unit - A unit Is attacked
-
-

Conditions
-


((Triggering unit) is in DraggingGroup) Equal to True
-
-

Actions
-


Set Counts = (Custom value of (Attacked unit))
-


Unit Group - Remove Caster[Counts] from DraggingGroup
-


Unit Group - Remove Target[Counts] from DraggingGroup
-


-------- You dont need this effect --------
-


Special Effect - Create a special effect at TargetLocation[Counts] using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
-


Special Effect - Destroy (Last created special effect)
-


-------- You dont need this effect --------
-


Custom script: call RemoveLocation ( udg_CasterLocation[udg_Counts] )
-


Custom script: call RemoveLocation ( udg_TargetLocation[udg_Counts] )
-


Custom script: call RemoveLocation ( udg_TargetMoveLoaction[udg_Counts] )
-


Unit - Turn collision for Target[Counts] Off
-


Animation - Reset Caster[Counts]'s animation
-


Lightning - Destroy LightningEffect[Counts]
-


Set Caster[Counts] = No unit
-


Set Target[Counts] = No unit
-


Unit - Set the custom value of Target[Counts] to 0
-


Unit - Set the custom value of Caster[Counts] to 0
-


Unit - Unpause Caster[Counts]
-
-
