• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[GUI] Meat Hook v.01c

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
:Spell:
Launches a bloody hook at a unit or location. The hook will snag the first target it encounters, dealing damage then dragging the victim back to the Butcher.
Level 1: Deals 100 damage. Costs 110 mana. Has 550 casting range. Cooldown: 14
Level 2: Deals 200 damage. Costs 120 mana. Has 700 casting range. Cooldown: 13
Level 3: Deals 300 damage. Costs 130 mana. Has 850 casting range. Cooldown: 12
Level 4: Deals 400 damage.

GUI: YES
MUI: i think so?
LEAK: hopefully not.

just a spell from the hero The Butcher from Dota.

I tried copying the Meat Hook from Pudge Wars which was coded in JASS into GUI.

[+]
- it kinda looks like the one from Pudge Wars ^_^ and in GUI!

[-]
- curving looks horrible, anyone willing to help me make it look better?



  • MeatHook Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Meat Hook
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in MeatHook_HeadGroup) Equal to 0
        • Then - Actions
          • Trigger - Turn on MeatHook Run <gen>
        • Else - Actions
      • Set TempUnitLoc = (Position of (Triggering unit))
      • Set TempTargetLoc = (Target point of ability being cast)
      • Set MeatHook_DummyHeadType = Meat Hook (Head)
      • Set MeatHook_ChainType = Meat Hook (Dummy)
      • Unit - Create 1 Meat Hook (Head) for (Owner of (Triggering unit)) at (TempUnitLoc offset by 25.00 towards (Angle from TempUnitLoc to TempTargetLoc) degrees) facing (Angle from TempUnitLoc to TempTargetLoc) degrees
      • Set MeatHook_Index = (Custom value of (Last created unit))
      • Set MeatHook_DamageIndex[MeatHook_Index] = (100.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))
      • Set MeatHook_RangeIndex[MeatHook_Index] = 1200.00
      • Set MeatHook_RadiusIndex[MeatHook_Index] = 128.00
      • Set MeatHook_SpeedIndex[MeatHook_Index] = 15.00
      • Set MeatHook_BoolIndex[MeatHook_Index] = True
      • Set MeatHook_BoolDoneIndex[MeatHook_Index] = False
      • Set MeatHook_CasterIndex[MeatHook_Index] = (Triggering unit)
      • Set MeatHook_CasterLocIndex[MeatHook_Index] = (Position of (Triggering unit))
      • Set MeatHook_OffsetIndex[MeatHook_Index] = 0.00
      • Set MeatHook_DummyHeadIndex[MeatHook_Index] = (Last created unit)
      • Unit Group - Add (Last created unit) to MeatHook_HeadGroup
      • Custom script: call RemoveLocation (udg_TempUnitLoc)
      • Custom script: call RemoveLocation (udg_TempTargetLoc)



  • MeatHook Run
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in MeatHook_HeadGroup and do (Actions)
        • Loop - Actions
          • Set MeatHook_DummyHead = (Picked unit)
          • Set MeatHook_DummyIndex = (Custom value of MeatHook_DummyHead)
          • Set MeatHook_Bool = MeatHook_BoolIndex[MeatHook_DummyIndex]
          • Set MeatHook_Range = MeatHook_RangeIndex[MeatHook_DummyIndex]
          • Set MeatHook_Radius = MeatHook_RadiusIndex[MeatHook_DummyIndex]
          • Set MeatHook_Speed = MeatHook_SpeedIndex[MeatHook_DummyIndex]
          • Set MeatHook_CasterLocIndex[MeatHook_DummyIndex] = (Position of MeatHook_CasterIndex[MeatHook_DummyIndex])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MeatHook_Bool Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MeatHook_OffsetIndex[MeatHook_DummyIndex] Less than MeatHook_Range
                • Then - Actions
                  • Set MeatHook_OffsetIndex[MeatHook_DummyIndex] = (MeatHook_OffsetIndex[MeatHook_DummyIndex] + MeatHook_Speed)
                  • Set MeatHook_DummyLoc = (Position of MeatHook_DummyHead)
                  • Set MeatHook_OffsetLoc = (MeatHook_DummyLoc offset by MeatHook_Speed towards (Facing of MeatHook_DummyHead) degrees)
                  • Unit - Move MeatHook_DummyHead instantly to MeatHook_OffsetLoc, facing (Facing of MeatHook_DummyHead) degrees
                  • Unit - Create 1 Meat Hook (Dummy) for (Owner of MeatHook_DummyHead) at (MeatHook_CasterLocIndex[MeatHook_DummyIndex] offset by MeatHook_Speed towards (Angle from MeatHook_CasterLocIndex[MeatHook_DummyIndex] to MeatHook_DummyLoc) degrees) facing (Angle from MeatHook_CasterLocIndex[MeatHook_DummyIndex] to MeatHook_DummyLoc) degrees
                  • Unit - Set the custom value of (Last created unit) to MeatHook_DummyIndex
                  • Unit Group - Add (Last created unit) to MeatHook_ChainGroup
                  • Set MeatHook_Group = (Units within MeatHook_Radius of MeatHook_OffsetLoc matching (((Matching unit) Not equal to MeatHook_CasterIndex[MeatHook_DummyIndex]) and ((((Unit-type of (Matching unit)) Not equal to Meat Hook (Dummy)) and (((Unit-type of (Matching unit)) Not equal to Meat
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in MeatHook_Group) Greater than 0
                    • Then - Actions
                      • Unit Group - Pick every unit in (Random 1 units from MeatHook_Group) and do (Actions)
                        • Loop - Actions
                          • Set MeatHook_BoolIndex[MeatHook_DummyIndex] = False
                          • Set MeatHook_TargetIndex[MeatHook_DummyIndex] = (Picked unit)
                          • Unit - Cause MeatHook_DummyHead to damage (Picked unit), dealing MeatHook_DamageIndex[MeatHook_DummyIndex] damage of attack type Spells and damage type Normal
                          • Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
                          • Set TempFX = (Last created special effect)
                          • Special Effect - Destroy TempFX
                    • Else - Actions
                  • Custom script: call RemoveLocation (udg_MeatHook_DummyLoc)
                  • Custom script: call RemoveLocation (udg_MeatHook_OffsetLoc)
                • Else - Actions
                  • Set MeatHook_BoolIndex[MeatHook_DummyIndex] = False
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MeatHook_BoolDoneIndex[MeatHook_DummyIndex] Equal to False
                • Then - Actions
                  • Set MeatHook_DummyLoc = (Position of MeatHook_DummyHead)
                  • Set MeatHook_OffsetLoc = (MeatHook_DummyLoc offset by (-1.00 x MeatHook_Speed) towards (Angle from MeatHook_CasterLocIndex[MeatHook_DummyIndex] to MeatHook_DummyLoc) degrees)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Distance between MeatHook_DummyLoc and MeatHook_CasterLocIndex[MeatHook_DummyIndex]) Greater than or equal to 90.00
                    • Then - Actions
                      • Unit - Move MeatHook_DummyHead instantly to MeatHook_OffsetLoc, facing (Facing of MeatHook_DummyHead) degrees
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • MeatHook_TargetIndex[MeatHook_DummyIndex] Not equal to No unit
                        • Then - Actions
                          • Unit - Move MeatHook_TargetIndex[MeatHook_DummyIndex] instantly to MeatHook_OffsetLoc, facing Default building facing degrees
                        • Else - Actions
                    • Else - Actions
                      • Unit - Turn collision for MeatHook_TargetIndex[MeatHook_DummyIndex] On
                      • Unit - Remove MeatHook_DummyHead from the game
                      • Set MeatHook_BoolDoneIndex[MeatHook_DummyIndex] = True
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • MeatHook_BoolDoneIndex[MeatHook_DummyIndex] Equal to True
                        • Then - Actions
                        • Else - Actions
                  • Custom script: call RemoveLocation (udg_MeatHook_DummyLoc)
                  • Custom script: call RemoveLocation (udg_MeatHook_OffsetLoc)
                • Else - Actions
          • Custom script: call RemoveLocation (udg_MeatHook_CasterLocIndex[udg_MeatHook_DummyIndex])
      • Unit Group - Pick every unit in MeatHook_ChainGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MeatHook_BoolIndex[(Custom value of (Picked unit))] Equal to True
            • Then - Actions
              • Set MeatHook_DummyHead = (Picked unit)
              • Set MeatHook_DummyIndex = (Custom value of MeatHook_DummyHead)
              • Set MeatHook_DummyLoc = (Position of MeatHook_DummyHead)
              • Set MeatHook_Speed = MeatHook_SpeedIndex[MeatHook_DummyIndex]
              • Set MeatHook_OffsetLoc = (MeatHook_DummyLoc offset by MeatHook_Speed towards (Facing of MeatHook_DummyHead) degrees)
              • Unit - Move MeatHook_DummyHead instantly to MeatHook_OffsetLoc, facing (Facing of MeatHook_DummyHead) degrees
              • Custom script: call RemoveLocation (udg_MeatHook_DummyLoc)
              • Custom script: call RemoveLocation (udg_MeatHook_OffsetLoc)
            • Else - Actions
              • Set MeatHook_DummyHead = (Picked unit)
              • Set MeatHook_DummyIndex = (Custom value of MeatHook_DummyHead)
              • Set MeatHook_DummyLoc = (Position of MeatHook_DummyHead)
              • Set MeatHook_Speed = MeatHook_SpeedIndex[MeatHook_DummyIndex]
              • Set MeatHook_CasterLocIndex[MeatHook_DummyIndex] = (Position of MeatHook_CasterIndex[MeatHook_DummyIndex])
              • Set MeatHook_OffsetLoc = (MeatHook_DummyLoc offset by (-1.00 x MeatHook_Speed) towards (Angle from MeatHook_CasterLocIndex[MeatHook_DummyIndex] to MeatHook_DummyLoc) degrees)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between MeatHook_DummyLoc and MeatHook_CasterLocIndex[MeatHook_DummyIndex]) Greater than or equal to 90.00
                • Then - Actions
                  • Unit - Move MeatHook_DummyHead instantly to MeatHook_OffsetLoc, facing (Facing of MeatHook_DummyHead) degrees
                • Else - Actions
                  • Unit - Remove MeatHook_DummyHead from the game
              • Custom script: call RemoveLocation (udg_MeatHook_CasterLocIndex[udg_MeatHook_DummyIndex])
              • Custom script: call RemoveLocation (udg_MeatHook_DummyLoc)
              • Custom script: call RemoveLocation (udg_MeatHook_OffsetLoc)





*fixed loops looping endlessly
*fixed hooked units being under hook when flying above river


*fixed hook's height change
*slight change in terrain to test hook's height change
*added "No Collision" to hooked units


*increased hook speed from 25 to 40
*changed hook chain and hook head. (i prefer the old one though)



Keywords:
pudge, pudge wars, wars, hook, meat, meat hook, butcher, dota, gui, mui,
Contents

[Spell] Meat Hook (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. Moderator: Maker Date: 28th Feb 2012 Spell: Meat Hook v.01c Required changes LeakUnit - Create 1 Meat Hook (Head) for (Owner of (Triggering unit)) at (TempUnitLoc offset by...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

160036-albums4747-picture55861.png

Moderator: Maker
Date: 28th Feb 2012
Spell: Meat Hook v.01c
Review

Required changes
  • Leak
    • Unit - Create 1 Meat Hook (Head) for (Owner of (Triggering unit)) at (TempUnitLoc offset by 25.00...
  • You are using unit indexer but then setting the custom value of a unit yourself. This causes unit indexer to leave several indexes unrecycled.
    You should disable unit indexer indexing when you create the dummy unit
  • Leak
    • Unit Group - Pick every unit in (Random 1 units from MeatHook_Group)
  • How to properly use crow form
  • You cause a leak with CasterLocIndex every time you cast the spell
  • Flying height manipulation is not done correctly, units and the chain head are at different heights.
    I recommend you try to set the dummy's movement type to none and flying height to 0 in object editor.
    Then add crow form and set height with triggers
Suggested changes
  • Change the version number to something more reasonable. V0.0x stuff shouldn't even be uploaded
  • You could check that the caster is alive in the looping trigger
  • Use less point variables, you can share them between the triggers
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
The hook is above units when the units are in water.
Leaks:
  • Unit - Create 1 Meat Hook (Head) for (Owner of (Triggering unit)) at (TempUnitLoc offset by 25.00...
  • Unit Group - Pick every unit in (Random 1 units from MeatHook_Group) and do (Actions)
The looping trigger doesn't turn off.

We already have GUI Meat Hook in the spell database, I have to check whether this is different enough or not.
 
To fix the curving, you would need to set the meat hook units' heights depending on the Terrain Z.

If you want all meat hook units to be above the ground with a height of something like 64, you would need to set the unit's flying height to 64 - terrainZ

You can get terrainZ by creating a location at a point, and in custom scripts, you would set a real variable to GetLocationZ(udg_Location) like this:

  • Custom script: set udg_LocationZ = GetLocationZ(udg_Location)
This assumes that the location variable is called Location.
You can change that.

LocationZ is a real variable.

Hope this helps.
 
Level 4
Joined
Jul 17, 2011
Messages
55
To fix the curving, you would need to set the meat hook units' heights depending on the Terrain Z.

If you want all meat hook units to be above the ground with a height of something like 64, you would need to set the unit's flying height to 64 - terrainZ

You can get terrainZ by creating a location at a point, and in custom scripts, you would set a real variable to GetLocationZ(udg_Location) like this:

  • Custom script: set udg_LocationZ = GetLocationZ(udg_Location)
This assumes that the location variable is called Location.
You can change that.

LocationZ is a real variable.

Hope this helps.

tested it. it worked with "terrainZ - 64", the chain's height is now constant passing over the river :thumbs_up:

though i tried to apply it to the hooked unit, nothing happens. :thumbs_down:

should i update the spell?

gorillabull said:
what an original spell

HAHA, I did this spell for kicks long long time ago, I didn't know it would actually work. Went through my spell folders, and found this, thought I might upload this, since I haven't seen a GUI Meat Hook like the one from Pudge Wars ^^
 
Level 4
Joined
Jul 17, 2011
Messages
55

oh i see. i'll work on that as soon as i use my computer. thanks!

Vista sucks said:
Nice, all I had to do is change the height of some units and, replace that spinning blade with a hood. Now we're going somewhere!

Off-topic: Don't we already have this spell on the spells section? Power Hook v1.3

i see, i guess the differences between my hook and his power hook is that the caster is not paused, the chain units move, and curves HORRIBLY. :xxd:

Off-Topic: you changed the spinning blade with a hood? :))
 
Level 13
Joined
Mar 24, 2010
Messages
950
when you set a special affect to a var without a wait time its not needed, its just 1 more action taking cpu cycles

  • Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
  • Set TempFX = (Last created special effect)
  • Special Effect - Destroy TempFX
you can just change that to Special Effect - Destroy last created affect.
 
Last edited:
Top