Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
This system basically allows a caster to launch a head towards a target point with a chain attach to it. It has many features that allows you to create a meathook, grapple or similar spell very easily.
Meathook ini
Events
Conditions
Actions
Set MeatHCount = (MeatHCount + 1)
Set Temp_Unit = (Triggering unit)
Set Temp_Point = (Position of Temp_Unit)
Set MeatHNewPoint = (Temp_Point offset by Config_MeatHStartOffset towards Config_MeatHAngle degrees)
Unit - Create 1 dummy for Neutral Passive at MeatHNewPoint facing Config_MeatHAngle degrees
Set MeatHRef = (Custom value of (Last created unit))
Set MeatHSpell[MeatHRef] = Config_MeatHSpell
Animation - Change UDexUnits[MeatHRef]'s size to (Config_MeatHHeadScale%, Config_MeatHHeadScale%, Config_MeatHHeadScale%) of its original size
Unit Group - Add UDexUnits[MeatHRef] to MeatHHeads
Set MeatHChainModel[MeatHRef] = Config_MeatHChainModel
Unit Group - Add UDexUnits[Temp_Int] to MeatHRow[MeatHRef]
Set MeatHSize[MeatHRef] = (MeatHSize[MeatHRef] + 1)
Set MeatHLst[Temp_Int] = MeatHSize[MeatHRef]
Set MeatHChainRef[MeatHSize[MeatHRef]] = Temp_Int
Set MeatHChainX[Temp_Int] = MeatHTempX
Set MeatHChainY[Temp_Int] = MeatHTempY
Animation - Change UDexUnits[Temp_Int]'s size to (MeatHChainScale[MeatHRef]%, MeatHChainScale[MeatHRef]%, MeatHChainScale[MeatHRef]%) of its original size
Special Effect - Create a special effect attached to the orign of UDexUnits[Temp_Int] using MeatHChainModel[MeatHRef]
Set MeatHEffect[Temp_Int] = (Last created special effect)
Set MeatHChain[MeatHSize[MeatHRef]] = UDexUnits[Temp_Int]
Set MeatHChainRate[MeatHRef] = (MeatHChainRate[MeatHRef] + 0.10)
Set Temp_Real = (Temp_Real - MeatHChainRate[MeatHRef])
Custom script: endloop
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Unit Group - Pick every unit in Temp_Targets and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MeatHT[MeatHRef] Equal to No unit
Then - Actions
Set Temp_Unit = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Temp_Unit Not equal to MeatHC[MeatHRef]
(Temp_Unit is A flying unit) Equal to False
(Temp_Unit is dead) Equal to False
Then - Actions
Set MeatHT[MeatHRef] = Temp_Unit
Set UDex = MeatHRef
Set MeatHEvent = 2.00
Set MeatHEvent = 0.00
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of MeatHT[MeatHRef]) is an enemy of (Owner of MeatHC[MeatHRef])) Equal to True
Then - Actions
Unit - Cause MeatHC[MeatHRef] to damage MeatHT[MeatHRef], dealing MeatHDamage[MeatHRef] damage of attack type MeatHDamageType[MeatHRef] and damage type Normal
Else - Actions
Set MeatHLaunch[MeatHRef] = False
Set MeatHFull[MeatHRef] = True
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MeatHGrapple[MeatHRef] Equal to False
Then - Actions
Unit - Turn collision for MeatHT[MeatHRef] Off
Set MeatHT[MeatHHooked[(Custom value of MeatHT[MeatHRef])]] = No unit
Set MeatHHooked[(Custom value of MeatHT[MeatHRef])] = MeatHRef
Set MeatHLockOn[MeatHRef] = No unit
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MeatHGrapling[(Custom value of MeatHC[MeatHRef])] Not equal to 0
Then - Actions
Set UDex = MeatHGrapling[(Custom value of MeatHC[MeatHRef])]
Trigger - Run Meathook end <gen> (ignoring conditions)
Else - Actions
Set MeatHGrapling[(Custom value of MeatHC[MeatHRef])] = MeatHRef
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of MeatHC[MeatHRef]) is an enemy of (Owner of MeatHT[MeatHRef])) Equal to True
Then - Actions
Unit - Cause MeatHC[MeatHRef] to damage MeatHT[MeatHRef], dealing MeatHDamageLoop[MeatHRef] damage of attack type MeatHDamageType[MeatHRef] and damage type Normal
Unit Group - Pick every unit in Temp_Targets and do (Actions)
Loop - Actions
Set Temp_Unit = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Temp_Unit Not equal to MeatHC[MeatHRef]
Temp_Unit Not equal to MeatHT[MeatHRef]
(Temp_Unit is A flying unit) Equal to False
((Owner of Temp_Unit) is an enemy of (Owner of MeatHC[MeatHRef])) Equal to True
Then - Actions
Unit - Cause MeatHC[MeatHRef] to damage Temp_Unit, dealing MeatHAoEDamage[MeatHRef] damage of attack type MeatHDamageType[MeatHRef] and damage type Normal
Game - Display to (All players) the text: (ERROR: Attempted to remove an invalid meathook with ID + (String(UDex)))
Launces a hook towards a target point or unit that grabs the first target it encounters, dealing 150/200/250/300 damage to enemies plus 75/100/125/150 DPS. The target will be dragged back to the Warden.
Range: 2250/2500/2750/3000
Meathook
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Meat Hook
Actions
Set Config_MeatHSpell = Meat Hook
Set Config_MeatHlvl = (Level of Meat Hook for (Triggering unit))
-------- set the angle --------
Set Temp_Point = (Position of (Triggering unit))
Set Temp_Point2 = (Target point of ability being cast)
Set Config_MeatHAngle = (Angle from Temp_Point to Temp_Point2)
-------- If Config_MeatHHook is false then this variables means nothing (you can't grapple something if your hook doesn't accepts a target) --------
Set Config_MeatHGrapple = False
-------- if the target die in a hook, can the same hook hook a new target? --------
Set Config_MeatHRecicle = True
Set Config_MeatHDestroyTrees = True
-------- Distance from meat hook's head to caster upon cast --------
Set Config_MeatHStartOffset = 128.00
-------- Distance between the caster and the chain's tale --------
Set Config_MeatHOffset = 64.00
-------- sets the unit type for the head and chain --------
Set Config_MeatHHeadModel = Abilities\Weapons\GlaiveMissile\GlaiveMissile.mdl
Set Config_MeatHChainModel = Abilities\Weapons\WardenMissile\WardenMissile.mdl
Set Config_MeatHHeadScale = 100.00
Set Config_MeatHChainScale = 200.00
Set Config_MeatHLockOn = (Target unit of ability being cast)
-------- If MeatHIgnore is true, only the lockon unit can be hooked --------
-------- In this trigger, I only set MeatHIgnore to true if there is a LockOn unit to hook --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Config_MeatHLockOn Equal to No unit
Then - Actions
Set Config_MeatHIgnore = False
Else - Actions
Set Config_MeatHIgnore = True
Set Config_MeatHDistance = 2000.00
Set Config_MeatHlvlDistnace = 250.00
Set Config_MeatHSpeed = 25.00
Set Config_MeatHlvlSpeed = 0.00
Set Config_MeatHDamage = 100.00
Set Config_MeatHlvlDamage = 50.00
-------- target dps --------
Set Config_MeatHDamageLoop = 50.00
Set Config_MeatHlvlDamageLoop = 25.00
-------- ------------- --------
-------- AoE dps --------
-------- range --------
Set Config_MeatHDamageAoE = 200.00
Set Config_MeatHlvlDamageAoE = 0.00
-------- amount --------
Set Config_MeatHAoEDamage = 5.00
Set Config_MeatHlvlAoEDamage = 0.00
-------- ------------- --------
Set Config_MeatHDamageType = Hero
Set Config_MeatHAoE = 100.00
Set Config_MeatHlvlAoE = 0.00
-------- avoid a chain rate lower than MeatHSpeed (include MeatHlvlSpeed) | 0 = no chain --------
Set Config_MeatHChainRate = 60.00
Set Config_MeatHSFX = Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
Set Config_MeatHAoESFX = Abilities\Weapons\HydraliskImpact\HydraliskImpact.mdl
Trigger - Run Meathook ini <gen> (ignoring conditions)
Game - Display to (All players) the text: (ID of last created spell is: + (String(MeatHRef)))
Launces a hook towards a target point or unit that grabs the first target it encounters, dealing 325/400/475/550 damage and pulls the caster towards the target.
Range: 2250/2500/2750/3000
Grapple
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Grapple
Actions
Set Config_MeatHSpell = Grapple
Set Config_MeatHlvl = (Level of Meat Hook for (Triggering unit))
-------- set the angle --------
Set Temp_Point = (Position of (Triggering unit))
Set Temp_Point2 = (Target point of ability being cast)
Set Config_MeatHAngle = (Angle from Temp_Point to Temp_Point2)
-------- If Config_MeatHHook is false then this variables means nothing (you can't grapple something if your hook don't accepts a target) --------
Set Config_MeatHGrapple = False
-------- if the target die in a hook, can the same hook hook a new target? --------
Set Config_MeatHRecicle = True
Set Config_MeatHDestroyTrees = True
-------- Distance from meat hook's head to caster upon cast --------
Set Config_MeatHStartOffset = 32.00
-------- Distance between the caster and the chain's tale --------
Set Config_MeatHOffset = 32.00
-------- sets the unit type for the head and chain --------
Set Config_MeatHHeadModel = Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
Set Config_MeatHChainModel = Abilities\Weapons\SludgeMissile\SludgeMissile.mdl
Set Config_MeatHHeadScale = 250.00
Set Config_MeatHChainScale = 100.00
Set Config_MeatHLockOn = No unit
Set Config_MeatHIgnore = False
Set Config_MeatHDistance = 2500.00
Set Config_MeatHlvlDistnace = 250.00
Set Config_MeatHSpeed = 45.00
Set Config_MeatHlvlSpeed = 0.00
Set Config_MeatHDamage = 0.00
Set Config_MeatHlvlDamage = 0.00
-------- target dps --------
Set Config_MeatHDamageLoop = 0.00
Set Config_MeatHlvlDamageLoop = 0.00
-------- ------------- --------
-------- AoE dps --------
-------- range --------
Set Config_MeatHDamageAoE = 300.00
Set Config_MeatHlvlDamageAoE = 0.00
-------- amount --------
Set Config_MeatHAoEDamage = 30.00
Set Config_MeatHlvlAoEDamage = 10.00
-------- ------------- --------
Set Config_MeatHDamageType = Hero
Set Config_MeatHAoE = 0.00
Set Config_MeatHlvlAoE = 0.00
-------- avoid a chain rate lower than MeatHSpeed (include MeatHlvlSpeed) | 0 = no chain --------
Set Config_MeatHChainRate = 80.00
Set Config_MeatHSFX = Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
Set Config_MeatHAoESFX = Abilities\Spells\Other\Incinerate\IncinerateBuff.mdl
Trigger - Run Meathook ini <gen> (ignoring conditions)
Game - Display to (All players) the text: (ID of last created spell is: + (String(MeatHRef)))
Set Kamehameha[(Custom value of (Triggering unit))] = MeatHRef
Kamehameha end
Events
Unit - A unit Stops casting an ability
Conditions
(Ability being cast) Equal to Kamehameha
Kamehameha[(Custom value of (Triggering unit))] Not equal to 0
Actions
Set UDex = Kamehameha[(Custom value of (Triggering unit))]
Trigger - Run Meathook end <gen> (ignoring conditions)
Set Kamehameha[(Custom value of (Triggering unit))] = 0
on return
Events
Game - MeatHEvent becomes Equal to 5.00
Conditions
Actions
Game - Display to (All players) the text: ((Name of MeatHC[UDex]) + 's hook has reached it's maximum distance)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MeatHSpell[UDex] Equal to Kamehameha
Then - Actions
Trigger - Run Meathook end <gen> (ignoring conditions)
Set Kamehameha[(Custom value of MeatHC[UDex])] = 0
Else - Actions
Releases 16 electrical bolts in all directions, dealing 6/8/10/12 damage per second to nearby enemies.
AoE: 800
Tesla Coil
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Tesla Coil
Actions
Set Config_MeatHSpell = Tesla Coil
Set Config_MeatHlvl = (Level of Meat Hook for (Triggering unit))
-------- If Config_MeatHHook is false then this variables means nothing (you can't grapple something if your hook don't accepts a target) --------
Set Config_MeatHGrapple = False
-------- if the target die in a hook, can the same hook hook a new target? --------
Set Config_MeatHRecicle = True
Set Config_MeatHDestroyTrees = False
-------- Distance from meat hook's head to caster upon cast --------
Set Config_MeatHStartOffset = 150.00
-------- Distance between the caster and the chain's tale --------
Set Config_MeatHOffset = 150.00
-------- sets the unit type for the head and chain --------
Set Config_MeatHHeadScale = 150.00
Set Config_MeatHChainScale = 200.00
Set Config_MeatHLockOn = No unit
Set Config_MeatHIgnore = False
Set Config_MeatHHeadModel = Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
Set Config_MeatHHeadModel = Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
Set Config_MeatHDistance = 800.00
Set Config_MeatHlvlDistnace = 0.00
Set Config_MeatHSpeed = 20.00
Set Config_MeatHlvlSpeed = 0.00
Set Config_MeatHDamage = 100.00
Set Config_MeatHlvlDamage = 50.00
-------- target dps --------
Set Config_MeatHDamageLoop = 50.00
Set Config_MeatHlvlDamageLoop = 25.00
-------- ------------- --------
-------- AoE dps --------
-------- range --------
Set Config_MeatHDamageAoE = 150.00
Set Config_MeatHlvlDamageAoE = 0.00
-------- amount --------
Set Config_MeatHAoEDamage = 4.00
Set Config_MeatHlvlAoEDamage = 2.00
-------- ------------- --------
Set Config_MeatHDamageType = Hero
Set Config_MeatHAoE = 0.00
Set Config_MeatHlvlAoE = 0.00
-------- avoid a chain rate lower than MeatHSpeed (include MeatHlvlSpeed) | 0 = no chain --------
Set Config_MeatHChainRate = 0.00
Set Config_MeatHSFX = Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
Set Config_MeatHAoESFX = Abilities\Spells\Items\AIlb\AIlbSpecialArt.mdl
-------- set the angle --------
Set Config_MeatHAngle = (Facing of (Triggering unit))
-------- ------------- --------
For each (Integer Temp_Int) from 1 to 16, do (Actions)
Loop - Actions
Set Config_MeatHAngle = (Config_MeatHAngle + 22.50)
Trigger - Run Meathook ini <gen> (ignoring conditions)
requires Bribe's (or similar) unit indexer
fixed bug where damage per level is not applied correctly
added feature to hook only the targeted unit and ignores other targets
pauses chain dummies
removed unnecessary GroupClear() function
removed unnecessary variable and it's code
adding chains using CreateUnit() native
hook no longer follows a dead "locked on" unit
"on return" event now also fires when hook reaches map bounds (Kamehameha bug fix)
made chain offset configurable
removed some unnecessary code
added a spell property
improved the way chains are added and removed
a spell instance can now be removed on command
slightly improved performance
improved documentation
added +3 spell examples
fixed the way targets are chosen
removed an unnecessary variable and it's code
made slight improvement on how the chain return
removed 2 leaks
Fixed as suggested by BPower
BPower;2792751 said:
You move the chain members then you check for map boundaries.
That's not logical.
There is real onHook somewhere in the code. I guess it's from an older version.
The event real is never reset to 0.00 Therefore two equal events can't fire in a row.
This means that the event can't be fired for two different launching hooks.
removed 4 region leaks (thanks BPower)
removed havester's location leak
made spell level configuratable
greatly improved the method to create a new spell instance
tweaked conditions to improve performance
removed 2 unnecessary variables from the spell
spell is de-indexed more reliably
changed map boundary variables
increased performance by over 50%
also increased multicast performance
made damage-type configurable
accidently fixed a bug where chain rate becomes uneven
adjust chain rate with number of chain instances to further increase performance
improved some test conditions
improved the way how chain instances are removed
removed a memory leak
chain can now destroy trees
improved comments
grapple no longer removes target collusion
removed unnecessary variables and a spell
made changes as suggested by IcemanBo and Daffa the Mage
added 2 events
added instructions on how to add a custom property to the spell.
renamed some variables
optimized custom scripts
fixed bug when unit in grapple dies
changed AoE from 75 to 100
changed chain rate from 60 to 50
removed a memory leak
when a hooked unit is hooked again, it will be removed from the first hook
fixed a bug where curves slows the head down
MortAr;1488353 said:
More ... hook ... spells ... please ... we ... need ... more ... !
There there there, lets get you back to the hospital bed. He's suffering from Bad-Spell-Hook-Unoriginal-Owned Overload, an overload of a single spell being created on one single site. He'll recover soon, or at least that's what the doctors say. My estimate is once a few of a single type of spells are removed or edited to become original. If you want to cure him, fix your hook spell and create something new instead of standard mechanics.
24th Mar 2016
Your resource has been reviewed by BPower.
In case of any questions or for reconfirming the moderator's rating,
please make use of the Quick Reply function of this thread.
Review:
Ever since DotA was released Meathook is one...
For the third time I come here to make necessary changes to this resource because it was not done properly by the author. The use of an unecapsulated function called "distance" is a massive problem for integrating this with other existing code that also try to use "distance" as a variable or function name. The other functions in the Custom Script section are also unecapsulated though their names are a bit more arcane.
Fixing this requires making the functions themselves public functions of the library I added on the previous page, which then need to have their references throughout this system updated. Here is what needs to be changed (this is GUI so I can't just put a fix in the code myself):
Meathook Loop trigger: below the "Add / Remove chains" comment add "MeatHookUtils_" to the distance function call:
IsOutsideMap seems not to be used anywhere so idk on that one.
JASS:
library MeatHookUtils
public function distance takes real x1, real x2, real y1, real y2 returns real
return SquareRoot((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))
endfunction
//determine wheather a point is inside the configured map bounds
public function IsOutsideMap takes real x, real y returns boolean
return x < udg_minX or y < udg_minY or x > udg_maxX or y > udg_maxY
endfunction
//If MeatHLockOn != null and MeatHIgnore == true, this function is called to filter the locked unit
public function FilterLockedUnit takes nothing returns boolean
return ( GetFilterUnit() == udg_MeatHLockOn[udg_MeatHRef] )
endfunction
endlibrary
There are other problematic things with this resource, like hardcoded references to gg_ trigger variables. IMO this resource either needs to be re-reviewed and fully fixed or moved to Substandard.
For the third time I come here to make necessary changes to this resource because it was not done properly by the author. The use of an unecapsulated function called "distance" is a massive problem for integrating this with other existing code that also try to use "distance" as a variable or function name. The other functions in the Custom Script section are also unecapsulated though their names are a bit more arcane.
Fixing this requires making the functions themselves public functions of the library I added on the previous page, which then need to have their references throughout this system updated. Here is what needs to be changed (this is GUI so I can't just put a fix in the code myself):
Meathook Loop trigger: below the "Add / Remove chains" comment add "MeatHookUtils_" to the distance function call:
IsOutsideMap seems not to be used anywhere so idk on that one.
JASS:
library MeatHookUtils
public function distance takes real x1, real x2, real y1, real y2 returns real
return SquareRoot((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))
endfunction
//determine wheather a point is inside the configured map bounds
public function IsOutsideMap takes real x, real y returns boolean
return x < udg_minX or y < udg_minY or x > udg_maxX or y > udg_maxY
endfunction
//If MeatHLockOn != null and MeatHIgnore == true, this function is called to filter the locked unit
public function FilterLockedUnit takes nothing returns boolean
return ( GetFilterUnit() == udg_MeatHLockOn[udg_MeatHRef] )
endfunction
endlibrary
There are other problematic things with this resource, like hardcoded references to gg_ trigger variables. IMO this resource either needs to be re-reviewed and fully fixed or moved to Substandard.
You changed the system to vJass. The original trigger is directly made as not vJass. As a non vJass user it took me far too long to see why it was still not working with your fixes.
For anyone else coming in to this thread, here is a fixed version that is still just ordinary GUI and JASS, and does not use the public or library functions.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.