• 🏆 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!

Dota 2 Meat Hook Ability v1.1.2


228981-albums7784-picture93604.jpg


Description


Pudge throws his hook towards a target point and drags back the first unit it touches. Deals damage to enemy units.

Level 1 - 90 damage / 800 distance
Level 2 - 120 damage / 900 distance
Level 3 - 240 damage / 1000 distance
Level 4 - 360 damage / 1100 distance

The chain breaks if Pudge is dead or goes too far from the hook.

Ingame Screenshots


228981-albums7784-picture93598.jpg

228981-albums7784-picture93599.jpg

228981-albums7784-picture93600.jpg

228981-albums7784-picture93601.jpg

228981-albums7784-picture93602.jpg

228981-albums7784-picture93603.jpg



Triggers



[trigger="MH Setup"]
MH Setup
Events
Map initialization
Conditions
Actions
-------- [Configuration] --------
Set HookAbility = Meat Hook
Set HookDummy = MH_DummyUnit
Set HookTravelDuration = 5.00
Set HookTravelSpeed = 1600.00
-------- Reads value of HookTravelSpeed instead of HookTravelDuration --------
Set HookUseSpeed = True
-------- Just set another HookDamage[Level] for multiple levels. --------
Set HookAttackType = Spells
Set HookDamageType = Universal
Set HookDamage[1] = 90.00
Set HookDamage[2] = 180.00
Set HookDamage[3] = 270.00
Set HookDamage[4] = 360.00
-------- Just set another HookTravelDistance[Level] for multiple levels. --------
Set HookTravelDistance[1] = 1000.00
Set HookTravelDistance[2] = 1100.00
Set HookTravelDistance[3] = 1200.00
Set HookTravelDistance[4] = 1300.00
-------- [ Others ] --------
Set HookAllowAllyMagicImmune = True
Set HookAllowEnemyMagicImmune = False
Set HookChainBreakDistance = 150.00
Set HookDisableWhileInUse = False
Set HookGrabRadius = 100.00
-------- [ Special Effects ] --------
-------- For Newbie GUI users, set HookUseLightningEx to False --------
-------- For experienced GUI/JASS users who wants a custom lightning effect, set HookUseLightningEx to True --------
-------- Once HookUseLightningEx is set to False, the code reads value of HookLightningEffect. (Standard) --------
-------- Once HookUseLightningEx is set to True, the code reads value of HookLightningEffectEx. (Custom) --------
Set HookUseLightningEx = False
Set HookLightningEffect = Drain Mana
Set HookLightningEffectEx = CHAI
Set HookSoundEffect = HuntressMissileLaunch <gen>
Set HookSpecialEffect = Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
-------- [End Configuration] --------
Set MH_Index1 = 0
Set MH_Index2 = 0
Set MH_OffsetConstant = 80.00
Custom script: if ( udg_HookUseLightningEx == true ) then
Custom script: set udg_HookLightningEffect = udg_HookLightningEffectEx
Custom script: endif

[/trigger]
[trigger="MH Cast"]
MH Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to HookAbility
Actions
Set MH_Index1 = (MH_Index1 + 1)
Set MH_ApplyDamage[MH_Index1] = False
Set MH_Hooker[MH_Index1] = (Triggering unit)
Set MH_DistCounter[MH_Index1] = 0.00
Set MH_Level[MH_Index1] = (Level of HookAbility for MH_Hooker[MH_Index1])
Set MH_StartPoint = (Position of MH_Hooker[MH_Index1])
Set MH_Distance[MH_Index1] = (HookTravelDistance[MH_Level[MH_Index1]] + MH_OffsetConstant)
Set MH_HookOn[MH_Index1] = False
Set MH_EndPoint = (Target point of ability being cast)
Set MH_Angle[MH_Index1] = (Angle from MH_StartPoint to MH_EndPoint)
Set TempPoint = (MH_StartPoint offset by MH_OffsetConstant towards MH_Angle[MH_Index1] degrees)
Unit - Create 1 HookDummy for (Triggering player) at TempPoint facing MH_Angle[MH_Index1] degrees
Set MH_Hook[MH_Index1] = (Last created unit)
Set MH_HookerPos[MH_Index1] = (Position of MH_Hooker[MH_Index1])
Set MH_HookPos[MH_Index1] = (Position of MH_Hook[MH_Index1])
Lightning - Create a HookLightningEffect lightning effect from source MH_HookerPos[MH_Index1] to target MH_HookPos[MH_Index1]
Lightning - Change color of (Last created lightning effect) to (1.00 1.00 1.00) with 1.00 alpha
Set MH_HookChain[MH_Index1] = (Last created lightning effect)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
HookUseSpeed Equal to True
Then - Actions
Set MH_Dest = (HookTravelSpeed x 0.02)
Else - Actions
Set MH_Dest = ((MH_Distance[MH_Index1] / HookTravelDuration) / 10.00)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
HookDisableWhileInUse Equal to True
Then - Actions
Unit - Remove HookAbility from MH_Hooker[MH_Index1]
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MH_Index1 Equal to 1
Then - Actions
Trigger - Turn on MH Loop <gen>
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint)
Custom script: call RemoveLocation(udg_MH_StartPoint)
Custom script: call RemoveLocation(udg_MH_EndPoint)

[/trigger]
[trigger="MH Loop"]
MH Loop
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
For each (Integer MH_Index2) from 1 to MH_Index1, do (Actions)
Loop - Actions
Set MH_HookerPos[MH_Index2] = (Position of MH_Hooker[MH_Index2])
Set MH_HookPos[MH_Index2] = (Position of MH_Hook[MH_Index2])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MH_DistCounter[MH_Index2] Less than MH_Distance[MH_Index2]
(MH_Hooker[MH_Index2] is alive) Equal to True
Then - Actions
Set MH_DistCounter[MH_Index2] = (MH_DistCounter[MH_Index2] + MH_Dest)
Set MH_DestPoint = (MH_HookPos[MH_Index2] offset by MH_Dest towards MH_Angle[MH_Index2] degrees)
Unit - Move MH_Hook[MH_Index2] instantly to MH_DestPoint
Sound - Play HookSoundEffect at 100.00% volume, attached to MH_Hooker[MH_Index2]
Lightning - Move MH_HookChain[MH_Index2] to source MH_HookerPos[MH_Index2] and target MH_HookPos[MH_Index2]
Set MH_Detector = (Units within HookGrabRadius of MH_HookPos[MH_Index2])
Unit Group - Pick every unit in MH_Detector and do (Actions)
Loop - Actions
Set TempUnit = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnit is A structure) Not equal to True
(TempUnit is alive) Equal to True
TempUnit Not equal to MH_Hooker[MH_Index2]
TempUnit Not equal to MH_HookedUnit[MH_Index2]
(Unit-type of TempUnit) Not equal to HookDummy
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnit is Magic Immune) Equal to True
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnit belongs to an ally of (Owner of MH_Hooker[MH_Index2])) Equal to True
HookAllowAllyMagicImmune Equal to True
Then - Actions
Set MH_HookedUnit[MH_Index2] = TempUnit
Set MH_HookOn[MH_Index2] = True
Set MH_DistCounter[MH_Index2] = MH_Distance[MH_Index2]
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnit belongs to an enemy of (Owner of MH_Hooker[MH_Index2])) Equal to True
HookAllowEnemyMagicImmune Equal to True
Then - Actions
Set MH_HookedUnit[MH_Index2] = TempUnit
Set MH_HookOn[MH_Index2] = True
Set MH_DistCounter[MH_Index2] = MH_Distance[MH_Index2]
Else - Actions
Else - Actions
Set MH_HookedUnit[MH_Index2] = TempUnit
Set MH_HookOn[MH_Index2] = True
Set MH_DistCounter[MH_Index2] = MH_Distance[MH_Index2]
Unit - Turn collision for MH_HookedUnit[MH_Index2] Off
Else - Actions
Custom script: call RemoveLocation(udg_MH_DestPoint)
Custom script: call DestroyGroup(udg_MH_Detector)
Else - Actions
Set MH_Angle[MH_Index2] = ((Angle from MH_HookerPos[MH_Index2] to MH_HookPos[MH_Index2]) + 180.00)
Set MH_DestPoint = (MH_HookPos[MH_Index2] offset by MH_Dest towards MH_Angle[MH_Index2] degrees)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MH_HookOn[MH_Index2] Equal to True
Then - Actions
Unit - Move MH_HookedUnit[MH_Index2] instantly to MH_DestPoint
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(MH_Hooker[MH_Index2] is alive) Equal to True
MH_ApplyDamage[MH_Index2] Equal to False
(MH_HookedUnit[MH_Index2] belongs to an enemy of (Owner of MH_Hooker[MH_Index2])) Equal to True
Then - Actions
Set MH_ApplyDamage[MH_Index2] = True
Unit - Cause MH_Hooker[MH_Index2] to damage MH_HookedUnit[MH_Index2], dealing HookDamage[MH_Level[MH_Index2]] damage of attack type HookAttackType and damage type HookDamageType
Else - Actions
Else - Actions
Unit - Move MH_Hook[MH_Index2] instantly to MH_DestPoint
Unit - Make MH_Hook[MH_Index2] face (MH_Angle[MH_Index2] + 180.00) over 0.00 seconds
Sound - Play HookSoundEffect at 100.00% volume, attached to MH_Hooker[MH_Index2]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MH_HookedUnit[MH_Index2] Not equal to No unit
(MH_HookedUnit[MH_Index2] belongs to an ally of (Owner of MH_Hooker[MH_Index2])) Equal to False
Then - Actions
Special Effect - Create a special effect at MH_DestPoint using HookSpecialEffect
Special Effect - Destroy (Last created special effect)
Else - Actions
Lightning - Move MH_HookChain[MH_Index2] to source MH_HookerPos[MH_Index2] and target MH_DestPoint
Custom script: call RemoveLocation(udg_MH_DestPoint)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Distance between MH_HookerPos[MH_Index2] and MH_HookPos[MH_Index2]) Less than (MH_OffsetConstant - 25.00)
(Distance between MH_HookerPos[MH_Index2] and MH_HookPos[MH_Index2]) Greater than (MH_Distance[MH_Index2] + HookChainBreakDistance)
(MH_Hooker[MH_Index2] is dead) Equal to True
Then - Actions
Lightning - Destroy MH_HookChain[MH_Index2]
Unit - Remove MH_Hook[MH_Index2] from the game
Unit - Turn collision for MH_HookedUnit[MH_Index2] On
Set MH_ApplyDamage[MH_Index2] = False
Set MH_HookOn[MH_Index2] = False
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
HookDisableWhileInUse Equal to True
Then - Actions
Unit - Add HookAbility to MH_Hooker[MH_Index2]
Unit - Set level of HookAbility for MH_Hooker[MH_Index2] to MH_Level[MH_Index2]
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(MH_HookedUnit[MH_Index2] belongs to an enemy of (Owner of MH_HookedUnit[MH_Index2])) Equal to True
Then - Actions
Unit - Order MH_Hooker[MH_Index2] to Attack MH_HookedUnit[MH_Index2]
Else - Actions
Set MH_Angle[MH_Index2] = MH_Angle[MH_Index1]
Set MH_ApplyDamage[MH_Index2] = MH_ApplyDamage[MH_Index1]
Set MH_DistCounter[MH_Index2] = MH_DistCounter[MH_Index1]
Set MH_Distance[MH_Index2] = MH_Distance[MH_Index1]
Set MH_Level[MH_Index2] = MH_Level[MH_Index1]
Set MH_Hook[MH_Index2] = MH_Hook[MH_Index1]
Set MH_HookChain[MH_Index2] = MH_HookChain[MH_Index1]
Set MH_Hooker[MH_Index2] = MH_Hooker[MH_Index1]
Set MH_HookedUnit[MH_Index2] = MH_HookedUnit[MH_Index1]
Set MH_HookOn[MH_Index2] = MH_HookOn[MH_Index1]
Set MH_Hooker[MH_Index1] = No unit
Set MH_HookedUnit[MH_Index1] = No unit
Set MH_Hook[MH_Index1] = No unit
Set MH_Index1 = (MH_Index1 - 1)
Set MH_Index2 = (MH_Index2 - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MH_Index1 Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Else - Actions
Custom script: call RemoveLocation(udg_MH_HookerPos[udg_MH_Index2])
Custom script: call RemoveLocation(udg_MH_HookPos[udg_MH_Index2])

[/trigger]



How To Use


- Make sure to enable "Automatically create unknown variables while pasting trigger data" on the General tab of your World Editor Preferences.
- Copy the whole Hook folder and paste in onto your Trigger Editor.
- Copy the Meat Hook ability and the MH_DummyUnit unit from the Object Editor and paste it onto yours. (If you don't want to create yours.)
- Make sure to configure everything in the MH Setup Trigger.


Changelogs


* Version 1.0.1 - initial release
* Version 1.0.1 - Fixed several leaks. Added few configuration options. Few terrain changes. Added sound.
* Version 1.0.2 - Optimized code. Now supports multiple level variables for HookDamage and HookDistance. Added HookDummy variable.
* Version 1.0.3 - Fixed some leaks. Added new configuration options. Modified some variables.
* Version 1.0.4 - Optimized code. Prevented some future bugs.
* Version 1.0.5 - As required, optimized variable names and made few changes on the triggers.
* Version 1.0.6 - Got rid of unused variables as well as reworked the test unit from a standard unit to hero. Modified ability from a unit to a hero ability type. Added Bot to play along. Also added additional variables for easy configuration.
* Version 1.0.7 - Relocated Hook Break code to hook return as mentioned and added MH_OffsetConstant for the hook creation and return detection offsets.
* Version 1.0.8 - Removed point leak and changed MH_StartPoint from an array variable to a regular one. Renamed MH_Point to MH_EndPoint and also de-arrayed.
* Version 1.0.9 - Reverted some variables in MH Loop regarding hook returning when magic immune enemy is detected and option of magic immunity check for enemy is false. Hook now successfully goes through magic immune enemies when the configuration is equal to false.
* Version 1.1.0 - Dearrayed some variables and removed MH_DestPoint from deindexing as mentioned. Also removed some variables. Fixed a bug regarding damage applied to a nearby enemy unit while MH_HookedUnit is not an enemy. Hook now breaks if caster is dead.
* Version 1.1.1 - Hook now detects Distance to Break on cast and not on the return of the hook. Added optional Lightning Effect parameter for advanced users. Imported optional skin for tests.
* Version 1.1.2 - As mentioned, added caster death check in Loop Trigger. Changed Hook Speed formula, speed is now the same as in-game projectile speeds. Corrected data and added a pause on cast. (as mentioned on the wiki)


Resources included:

[box]
Chain by stonneash (Optional - Recommended)
Link: http://www.hiveworkshop.com/forums/...d1355776281-manaburnbeam-blp-manaburnbeam.blp

Custom LightningData.slk (Optional - Recommended)

[/box]

"Don't forget! Credits for use."

Keywords:
hook,dota2,pudge,meat hook
Contents

Untitled (Map)

Reviews
13:40, 01st Feb 2015 Changed were made, and it works fine. Approved. 23:53, 27th Jan 2015 IcemanBo: Read my posts in thread. You don't change it in your updates. IcemanBo...
Level 5
Joined
May 14, 2013
Messages
48
How to make the hook only to grab enemies not allies?

Well that is not included yet? Should I put it?

The problem using Lightning Effect as the chain is that once a player saw the tip of the hook, he can also know where the hook caster is positioned because the whole lightning effect will be visible. Nevertheless, its a good spell so +rep.

I used GUI for creating Lightning Effect that's why its visible on fog. AddLightningEx though is able to solve this.

Proved I'm wrong. Multiple moves still reveal lightning on fog.
 
Last edited:

TKF

TKF

Level 19
Joined
Nov 29, 2006
Messages
1,266
Well I should have looked in spell section first before I made a meat hook of my own. I would probably base it on yours, but I have a bad habit of reinventing the wheel in everything I do, heres my version:

Hook Head
models_11067_screenshot_tnb.jpg

Chain Element
models_11066_screenshot_tnb.jpg

Example of my version of "meathook" in Naval Battle

132929-albums387-picture97200.jpg

The chain head is a projectile dummy unit
Each chain is a locust dummy unit added into unit group

My system is somewhat much more ridiculously complex that yours, that it relolates the chain when if the caster moves after starting dragging, since each chain element is a dummy. However that happens when it starts dragging the target. But I made it only MPI
 
Level 5
Joined
May 14, 2013
Messages
48
Well I should have looked in spell section first before I made a meat hook of my own. I would probably base it on yours, but I have a bad habit of reinventing the wheel in everything I do, heres my version:

Hook Head
models_11067_screenshot_tnb.jpg

Chain Element
models_11066_screenshot_tnb.jpg

Example of my version of "meathook" in Naval Battle

132929-albums387-picture97200.jpg

The chain head is a projectile dummy unit
Each chain is a locust dummy unit added into unit group

My system is somewhat much more ridiculously complex that yours, that it relolates the chain when if the caster moves after starting dragging, since each chain element is a dummy. However that happens when it starts dragging the target. But I made it only MPI

It's not unique anymore done that many times. Didn't bother uploading because its already common. I'm quite a unique individual.
 
Top