Spell ChainHook

Dirac

22710180
Reaction score
147
Chain Hook
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:rolleyes:)
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
wc3scrnshot021309083549gc3.jpg
wc3scrnshot021309083602yn2.jpg
wc3scrnshot021309083611gc8.jpg

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
      • 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)
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)
              • 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])
              • 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
                  • Custom script: call RemoveLocation (udg_TempPointArray[1])
                  • Custom script: call RemoveLocation (udg_TempPointArray[2])
              • 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
            • 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)
                  • 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
                  • 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
                • 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
                  • 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)
                  • 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)
                  • 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])))))
                    • Then - Actions
                      • Unit Group - Remove MUITarget[TempInteger] from ChainHookTargetGroup
                      • Set MUITarget[TempInteger] = MUICaster[TempInteger]
                    • Else - Actions
 

Attachments

  • ChainHook v1.3.2.w3x
    31.9 KB · Views: 466
  • ChainHook v1.3.3.w3x
    33 KB · Views: 481
  • ChainHook v1.3.4.w3x
    34.5 KB · Views: 723

Nerfpl

New Member
Reaction score
53
->O.M.G<-

How you can create such big trigger and dont be lost after 20 lines?
Btw if you already have abilites to create such thing i prefer switching to JASS. then you can skip like half of thing (including MUI pain). btw why you remove TempPoint twice in row?

nice skill tho
edit: actually sweet f*** nice spell
 

BRUTAL

I'm working
Reaction score
118
theres a small problemish
if you cast the spell to a really like melee range close, when you try moving its bad
i think you should turn off the targets collision in the second trigger if you havent
 

Dirac

22710180
Reaction score
147
I know my trigger is insane xD. I removed temppoint twice in row because i forgot to change the name the second temppoint removed to (udg_TempPoint2).
I think i remove it too much because im not very good at detecting leaks so, is better to remove them than not to.
Cant move to JASS :( my W3E crashes when using it lol

Updated: Removed minor leak

It really bothers me if it leaks. Plz check the code and tell me where is it leaking
 

Daskunk

SC2 Forum MVP - TheSkunk #386
Reaction score
186
Unit - Move (Picked unit) instantly to TempPoint, facing (Angle from (Position of MUICaster. . . .

Doesnt that leak at the part it says "Position of MUICaster"? (Line 17) That would be a point leak wouldn't it? I could be wrong but I though it did.

Same with places such as Lines 40, 68, 74, 106, and 138.
 

Dirac

22710180
Reaction score
147
Bump.

I would like to get more comments about my spell :p or maybe a moderator to tell me if its approved.

Doesnt that leak at the part it says "Position of MUICaster"? (Line 17) That would be a point leak wouldn't it? I could be wrong but I though it did.

Same with places such as Lines 40, 68, 74, 106, and 138.

Thnx for the help (+rep) Now the map is updated with LOTS of leaks fixed. Does no longer lags when pulling multiple units at the same time (so have fun testing it).
 

Nexor

...
Reaction score
74
Change the MUI variable to a larger value (about 50 will do it)
I tried it with 50 and the spell couldnt get bugged, atm 10 is too small, and there will be some parts of the chain floating in the map.
 

Bronxernijn

You can change this now in User CP.
Reaction score
43
Casting the hook twice on the same target kills it almost instantly. Is that how it's meant to be?
 

Viikuna

No Marlo no game.
Reaction score
265
Cant move to JASS my W3E crashes when using it lol
Get NewGen, it doesnt crash.


I never tought someone would do something like this with GUI. This is pretty insane actually. :D
 

Dirac

22710180
Reaction score
147
Update!
-MUI is now increased to 50! (Nexor: Change the MUI variable to a larger value (about 50 will do it))
-Hooked units are not possible targets while remain hooked (Bronxernijn: Casting the hook twice on the same target kills it almost instantly. Is that how it's meant to be?)
 
Reaction score
91
A few bugs I found while playing around with the spell:
- If you hook a unit and start moving left and right (as well as backwards) the enemy stands still but still gets damaged.
- If you hook from melee range the unit will move next to you forever or until it dies (and will get damaged).
 

BlackRose

Forum User
Reaction score
239
Maybe you should fix those things?

It looks weird if you cast it right next to an enemy unit.

It also lags so much if you try to increase the distance or have more than 1 Chain Hook active.

I changed the distance to like 2000 and guess what?

EDIT:
Code:
* ChainHook
          o Events
                + Unit - A unit Starts the effect of an ability
          o Conditions
                + (Ability being cast) Equal to Chain Hook
          o Actions
                + If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      # If - Conditions
                            * MUI Less than or equal to 10
                      # Then - Actions
                            * Set MUI = (MUI + 1)
                      # Else - Actions
                            * Set MUI = 1
                + Set MUICaster[MUI] = (Casting unit)
                + Set MUIPoint[MUI] = (Target point of ability being cast)
                + Set TempPoint = (Position of MUICaster[MUI])
[B]                + Unit - Create 1 ChainHook for (Owner of MUICaster[MUI]) at TempPoint facing (Angle from TempPoint to (Target point of ability being cast)) degrees[/B]
                + 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)

Read this bolded part.
 

Dirac

22710180
Reaction score
147
Update! (1.3)
-Units that are near the caster are not suitable targets (Tyrande_ma3x: If you hook from melee range the unit will move next to you forever or until it dies (and will get damaged).
-Removed Minor Leak (Thanks to BlackRose)
-Fixed Tooltip
-Hooked units now are dragged "smoothly"
 

BlackRose

Forum User
Reaction score
239
The spell is impressive, considering it is done in GUI. One thing I don't know is how you manage to keep track of the trigger, when it is that long...

One thing is, why is it ChainHook for the thread and map name, it looks weird :).

[ REP + ]
 

RaiJin

New Member
Reaction score
40
this line leaks

Code:
Set TempPoint = ((Position of ChainHookDummys[(TempInteger2 - 1)]) offset by 40.00 towards (Angle from (Position of ChainHookDummys[(TempInteger2 - 1)]) to (Position of ChainHookDummys[TempInteger2])) degrees)
 

Dirac

22710180
Reaction score
147
Bump

I just want a moderator to tell me if my spell is approved/disapproved and why :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top