Dirac
22710180
- Reaction score
- 147
Chain Hook
Made by Dirac
Made by Dirac
What? another hook type ability? Yes! but this one is somehow different.
Description:Shots a hook to a target location hooks the first unit on the way. Hooked unit cant move and the caster can drag it by moving, damage dealt is based on distance. Time hooked is increased by level.
Pros:
Leakless (i think)
Nice animation
MUI
Cons:
Not very customizable
UPDATE:
1.1
Removed HUGE leak, new testing map
1.2
MUI is now increased to 50
Hooked units are not possible targets while remain hooked
1.3
Units that are near the caster are not suitable targets
Removed Minor Leak (Thanks to BlackRose)
Fixed Tooltip
Hooked units now are dragged "smoothly"
1.3.1
Removed Minor Leak
1.3.2
Removed Leaks
1.3.3
Reduced Lag
Added some customization functions
Minor bug fix
1.3.4
Added more customization functions, now this spell can be used as a traditional meat hook
Minor bug fixes
Screenshots
CODE:
Trigger:
- ChainHook
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Chain Hook
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- MUI Less than or equal to 50
- Then - Actions
- Set MUI = (MUI + 1)
- Else - Actions
- Set MUI = 1
- If - Conditions
- Set MUICaster[MUI] = (Casting unit)
- Set MUIPoint[MUI] = (Target point of ability being cast)
- Set TempPoint = (Position of MUICaster[MUI])
- Unit - Create 1 ChainHook for (Owner of MUICaster[MUI]) at TempPoint facing (Angle from TempPoint to MUIPoint[MUI]) degrees
- Unit Group - Add (Last created unit) to ChainHookDummyGroup
- Set ChainHookDummys[((MUI x 100) - 99)] = (Last created unit)
- Set ChainHookDummyCount[MUI] = 1
- Unit - Set the custom value of (Last created unit) to MUI
- Custom script: call RemoveLocation (udg_TempPoint)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
Trigger:
- ChainHookSlide
- Events
- Time - Every 0.03 seconds of game time
- Conditions
- (ChainHookDummyGroup is empty) Equal to False
- Actions
- Unit Group - Pick every unit in ChainHookDummyGroup and do (Actions)
- Loop - Actions
- Set TempInteger = (Custom value of (Picked unit))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- MUITarget[TempInteger] Equal to No unit
- Then - Actions
- Set TempInteger2 = (((TempInteger x 100) - 100) + ChainHookDummyCount[TempInteger])
- Set MUISlide[(Custom value of (Picked unit))] = (MUISlide[(Custom value of (Picked unit))] + 20.00)
- Set TempPointArray[1] = (Position of MUICaster[TempInteger])
- Set TempPoint = (TempPointArray[1] offset by MUISlide[TempInteger] towards (Angle from TempPointArray[1] to MUIPoint[(Custom value of (Picked unit))]) degrees)
- Unit - Move (Picked unit) instantly to TempPoint, facing (Angle from TempPointArray[1] to MUIPoint[TempInteger]) degrees
- Custom script: call RemoveLocation (udg_TempPoint)
- Set TempPoint = (Position of MUICaster[TempInteger])
- Custom script: call RemoveLocation (udg_TempPointArray[1])
- Set TempPointArray[1] = (Position of ChainHookDummys[TempInteger2])
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Distance between TempPoint and TempPointArray[1]) Greater than or equal to 45.00
- Then - Actions
- Custom script: call RemoveLocation (udg_TempPoint)
- Set TempPoint = (Position of MUICaster[TempInteger])
- Set ChainHookDummyCount[TempInteger] = (ChainHookDummyCount[TempInteger] + 1)
- Set TempInteger2 = (((TempInteger x 100) - 100) + ChainHookDummyCount[TempInteger])
- Unit - Create 1 ChainHook for (Owner of MUICaster[TempInteger]) at TempPoint facing (Facing of ChainHookDummys[(TempInteger2 - 1)]) degrees
- Set ChainHookDummys[TempInteger2] = (Last created unit)
- Custom script: call RemoveLocation (udg_TempPoint)
- Else - Actions
- Custom script: call RemoveLocation (udg_TempPoint)
- If - Conditions
- Custom script: call RemoveLocation (udg_TempPointArray[1])
- For each (Integer A) from 2 to ChainHookDummyCount[TempInteger], do (Actions)
- Loop - Actions
- Set TempInteger2 = (((TempInteger x 100) - 100) + (Integer A))
- Set TempPointArray[1] = (Position of ChainHookDummys[TempInteger2])
- Set TempPointArray[2] = (Position of ChainHookDummys[(TempInteger2 - 1)])
- Set TempPoint = (TempPointArray[2] offset by 40.00 towards (Angle from TempPointArray[2] to TempPointArray[1]) degrees)
- Unit - Move ChainHookDummys[TempInteger2] instantly to TempPoint, facing (Angle from TempPointArray[1] to TempPointArray[2]) degrees
- Custom script: call RemoveLocation (udg_TempPoint)
- Custom script: call RemoveLocation (udg_TempPointArray[1])
- Custom script: call RemoveLocation (udg_TempPointArray[2])
- Loop - Actions
- Set TempGroup = (Units within 90.00 of (Position of (Picked unit)))
- Unit Group - Pick every unit in TempGroup and do (Actions)
- Loop - Actions
- Set TempPointArray[1] = (Position of MUICaster[TempInteger])
- Set TempPointArray[2] = (Position of (Picked unit))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Picked unit) is A structure) Equal to False
- ((Picked unit) is alive) Equal to True
- (Picked unit) Not equal to MUICaster[TempInteger]
- ((Picked unit) is in ChainHookTargetGroup) Equal to False
- (Distance between TempPointArray[1] and TempPointArray[2]) Greater than or equal to 150.00
- Then - Actions
- Set MUITarget[TempInteger] = (Picked unit)
- Unit Group - Add (Picked unit) to ChainHookTargetGroup
- Unit - Turn collision for MUITarget[TempInteger] Off
- Else - Actions
- If - Conditions
- Custom script: call RemoveLocation (udg_TempPointArray[1])
- Custom script: call RemoveLocation (udg_TempPointArray[2])
- Loop - Actions
- Custom script: call DestroyGroup (udg_TempGroup)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- MUISlide[(Custom value of (Picked unit))] Greater than or equal to 3000.00
- Then - Actions
- Set MUITarget[TempInteger] = MUICaster[TempInteger]
- Else - Actions
- If - Conditions
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- MUITarget[TempInteger] Equal to MUICaster[TempInteger]
- Then - Actions
- Set TempInteger2 = (((TempInteger x 100) - 100) + ChainHookDummyCount[TempInteger])
- Set TempPointArray[1] = (Position of MUICaster[TempInteger])
- Set TempPointArray[2] = (Position of ChainHookDummys[TempInteger2])
- Set TempPointArray[3] = (Position of ChainHookDummys[(TempInteger2 + 1)])
- Set TempPoint = (TempPointArray[2] offset by 20.00 towards (Angle from TempPointArray[2] to TempPointArray[1]) degrees)
- Unit - Move ChainHookDummys[TempInteger2] instantly to TempPoint, facing (Angle from TempPointArray[3] to TempPointArray[2]) degrees
- Custom script: call RemoveLocation (udg_TempPoint)
- Custom script: call RemoveLocation (udg_TempPointArray[1])
- Custom script: call RemoveLocation (udg_TempPointArray[2])
- For each (Integer A) from 1 to (ChainHookDummyCount[TempInteger] - 1), do (Actions)
- Loop - Actions
- Set TempInteger2 = (((TempInteger x 100) - 100) + (Integer A))
- Set TempPointArray[1] = (Position of ChainHookDummys[(TempInteger2 + 1)])
- Set TempPointArray[2] = (Position of ChainHookDummys[TempInteger2])
- Set TempPoint = (TempPointArray[2] offset by 20.00 towards (Angle from TempPointArray[2] to TempPointArray[1]) degrees)
- Unit - Move ChainHookDummys[TempInteger2] instantly to TempPoint, facing (Angle from TempPointArray[1] to TempPointArray[2]) degrees
- Custom script: call RemoveLocation (udg_TempPointArray[1])
- Custom script: call RemoveLocation (udg_TempPointArray[2])
- Custom script: call RemoveLocation (udg_TempPoint)
- Loop - Actions
- Set TempInteger2 = (((TempInteger x 100) - 100) + ChainHookDummyCount[TempInteger])
- Set TempPoint = (Position of ChainHookDummys[TempInteger2])
- Set TempPointArray[1] = (Position of MUICaster[TempInteger])
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Distance between TempPoint and TempPointArray[1]) Less than or equal to 10.00
- Then - Actions
- Set ChainHookDummyCount[TempInteger] = (ChainHookDummyCount[TempInteger] - 1)
- Unit - Remove ChainHookDummys[TempInteger2] from the game
- Else - Actions
- If - Conditions
- Custom script: call RemoveLocation (udg_TempPoint)
- Custom script: call RemoveLocation (udg_TempPointArray[1])
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ChainHookDummyCount[TempInteger] Equal to 0
- Then - Actions
- Set MUISlide[TempInteger] = 0.00
- Unit - Turn collision for MUITarget[TempInteger] On
- Unit Group - Remove MUITarget[TempInteger] from ChainHookTargetGroup
- Set MUITarget[TempInteger] = No unit
- Set ChainHookDistance[TempInteger] = 0.00
- Custom script: call RemoveLocation (udg_MUIPoint[udg_TempInteger])
- Else - Actions
- If - Conditions
- Else - Actions
- Set TempInteger2 = (((TempInteger x 100) - 100) + ChainHookDummyCount[TempInteger])
- Set TempPointArray[1] = (Position of MUICaster[TempInteger])
- Set TempPointArray[2] = (Position of ChainHookDummys[TempInteger2])
- Set TempPoint = (TempPointArray[1] offset by 40.00 towards (Angle from TempPointArray[1] to TempPointArray[2]) degrees)
- Unit - Move ChainHookDummys[TempInteger2] instantly to TempPoint, facing (Angle from TempPointArray[1] to TempPointArray[2]) degrees
- Custom script: call RemoveLocation (udg_TempPointArray[1])
- Custom script: call RemoveLocation (udg_TempPointArray[2])
- Custom script: call RemoveLocation (udg_TempPoint)
- Set ChainHookDistance[TempInteger] = (ChainHookDistance[TempInteger] + 1.00)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (MUICaster[TempInteger] belongs to an enemy of (Owner of MUITarget[TempInteger])) Equal to True
- Then - Actions
- Set TempPoint = (Position of ChainHookDummys[((TempInteger x 100) - 99)])
- Set TempPointArray[1] = (Position of MUITarget[TempInteger])
- Unit - Cause MUICaster[TempInteger] to damage MUITarget[TempInteger], dealing ((Distance between TempPoint and TempPointArray[1]) / 2.00) damage of attack type Spells and damage type Normal
- Custom script: call RemoveLocation (udg_TempPoint)
- Custom script: call RemoveLocation (udg_TempPointArray[1])
- Else - Actions
- If - Conditions
- Set TempPoint = (Position of ChainHookDummys[((TempInteger x 100) - 99)])
- Set TempPointArray[1] = (Position of MUITarget[TempInteger])
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Distance between TempPoint and TempPointArray[1]) Greater than or equal to 1.00
- Then - Actions
- Custom script: call RemoveLocation (udg_TempPoint)
- Set TempInteger2 = ((TempInteger x 100) - 99)
- Set TempPoint = (Position of ChainHookDummys[TempInteger2])
- Unit - Move MUITarget[TempInteger] instantly to TempPoint
- Custom script: call RemoveLocation (udg_TempPoint)
- Set TempPoint = (Position of ChainHookDummys[TempInteger2])
- Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
- Custom script: call RemoveLocation (udg_TempPoint)
- Special Effect - Destroy (Last created special effect)
- Else - Actions
- Custom script: call RemoveLocation (udg_TempPoint)
- If - Conditions
- Custom script: call RemoveLocation (udg_TempPointArray[1])
- For each (Integer A) from 1 to (ChainHookDummyCount[TempInteger] - 1), do (Actions)
- Loop - Actions
- Set TempInteger2 = (((TempInteger x 100) - 100) + (Integer A))
- Set TempPointArray[1] = (Position of ChainHookDummys[(TempInteger2 + 1)])
- Set TempPointArray[2] = (Position of ChainHookDummys[TempInteger2])
- Set TempPoint = (TempPointArray[1] offset by 40.00 towards (Angle from TempPointArray[1] to TempPointArray[2]) degrees)
- Unit - Move ChainHookDummys[TempInteger2] instantly to TempPoint, facing (Angle from TempPointArray[1] to TempPointArray[2]) degrees
- Custom script: call RemoveLocation (udg_TempPointArray[1])
- Custom script: call RemoveLocation (udg_TempPointArray[2])
- Custom script: call RemoveLocation (udg_TempPoint)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Or - Any (Conditions) are true
- Conditions
- (MUICaster[TempInteger] is dead) Equal to True
- (MUITarget[TempInteger] is dead) Equal to True
- ChainHookDistance[TempInteger] Greater than or equal to (500.00 + (15.00 x (Real((Level of Chain Hook for MUICaster[TempInteger])))))
- Conditions
- Or - Any (Conditions) are true
- Then - Actions
- Unit Group - Remove MUITarget[TempInteger] from ChainHookTargetGroup
- Set MUITarget[TempInteger] = MUICaster[TempInteger]
- Else - Actions
- If - Conditions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Loop - Actions
- Unit Group - Pick every unit in ChainHookDummyGroup and do (Actions)
- Events