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

Chain Hook

Status
Not open for further replies.
Level 17
Joined
Mar 21, 2011
Messages
1,597
Hi guys.
I tried to do an ability... and well, it works. but there are some things im not sure about and some things i dont like.

Chain Hook: Sends a chain hook to the targeted unit. If it collides with the target gets pulled to the caster.

first thing is the movement of the hook chains, it looks weird, same to the hook head.

im also not sure about the efficiency of the spell

here is the map, i hope you can help or fix it. thanks

Trigger Part:

Bribe's Unit Indexer


  • init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Hashtable = (Last created hashtable)


  • Hook
    • Events
      • Unit - A unit starts the effect of an ability
    • Conditions
      • (Ability being cast) equal to Hook
    • Actions
      • Set ChainHook_Caster = (Triggering unit)
      • Set ChainHook_Index = (Custom value of ChainHook_Caster)
      • Set ChainHook_Target[ChainHook_Index] = (Target unit of ability being cast)
      • Set ChainHook_Boolean[ChainHook_Index] = True
      • Set ChainHook_Counter = (ChainHook_Counter + 1)
      • Unit - Pause ChainHook_Caster
      • Unit Group - Add ChainHook_Caster to ChainHook_Group
      • Trigger - Turn on Loop <gen>
  • Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in ChainHook_Group and do (Actions)
        • Loop - Actions
          • Set ChainHook_Caster = (Picked unit)
          • Set ChainHook_Index = (Custom value of ChainHook_Caster)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • ChainHook_Boolean[ChainHook_Index] equal to True
            • 'THEN'-Actions
              • Set ChainHook_Point = (Position of ChainHook_Caster)
              • Set ChainHook_Location = (Position of ChainHook_Target[ChainHook_Index])
              • Set ChainHook_RangeCounter[ChainHook_Index] = (ChainHook_RangeCounter[ChainHook_Index] + 1)
              • Set ChainHook_ChainPoint = (ChainHook_Point offset by (30.00 x (Real(ChainHook_RangeCounter[ChainHook_Index]))) towards (Angle from ChainHook_Point to ChainHook_Location) degrees)
              • Unit - Remove ChainHook_Head[ChainHook_Index] from the game
              • Set ChainHook_HeadPoint = (ChainHook_ChainPoint offset by 50.00 towards (Angle from ChainHook_Point to ChainHook_Location) degrees)
              • Unit - Create 1 Chain for Neutral passive at ChainHook_ChainPoint facing (Angle from ChainHook_ChainPoint to ChainHook_Location) degrees
              • Hashtable - Save Handle Of(Last created unit) as ChainHook_RangeCounter[ChainHook_Index] of (Key (Picked unit)) in Hashtable
              • Unit - Create 1 Head for Neutral passive at ChainHook_HeadPoint facing (Angle from ChainHook_ChainPoint to ChainHook_Location) degrees
              • Set ChainHook_Head[ChainHook_Index] = (Last created unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Conditions
                  • ((Distance between ChainHook_Location and ChainHook_HeadPoint) smaller than 40.00) or ((Distance between ChainHook_Location and ChainHook_ChainPoint) greater than 3000.00)
                • 'THEN'-Actions
                  • Set ChainHook_Boolean[ChainHook_Index] = False
                • 'ELSE'-Actions
              • Custom script: call RemoveLocation (udg_ChainHook_Point)
              • Custom script: call RemoveLocation (udg_ChainHook_Location)
              • Custom script: call RemoveLocation (udg_ChainHook_ChainPoint)
              • Custom script: call RemoveLocation (udg_ChainHook_HeadPoint)
            • 'ELSE'-Actions
              • Set ChainHook_Chain = (Load ChainHook_RangeCounter[ChainHook_Index] of (Key (Picked unit)) in Hashtable)
              • Set ChainHook_ChainPoint = (Position of ChainHook_Chain)
              • Unit - Remove ChainHook_Head[ChainHook_Index] from the game
              • Set ChainHook_HeadPoint = (ChainHook_ChainPoint offset by 50.00 towards (Facing of ChainHook_Chain) degrees)
              • Unit - Create 1 Head for Neutral passive at ChainHook_HeadPoint facing (Facing of ChainHook_Chain) degrees
              • Set ChainHook_Head[ChainHook_Index] = (Last created unit)
              • Unit - Move ChainHook_Target[ChainHook_Index] instantly to ChainHook_HeadPoint
              • Unit - Remove ChainHook_Chain from the game
              • Set ChainHook_RangeCounter[ChainHook_Index] = (ChainHook_RangeCounter[ChainHook_Index] - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Conditions
                  • ChainHook_RangeCounter[ChainHook_Index] equal to 0
                • 'THEN'-Actions
                  • Set ChainHook_Counter = (ChainHook_Counter - 1)
                  • Unit Group - Remove ChainHook_Caster from ChainHook_Group
                  • Unit - Unpause ChainHook_Caster
                  • Unit - Remove ChainHook_Head[ChainHook_Index] from the game
                • 'ELSE'-Actions
              • Custom script: call RemoveLocation (udg_ChainHook_ChainPoint)
              • Custom script: call RemoveLocation (udg_ChainHook_HeadPoint)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • ChainHook_Counter equal 0
        • 'THEN'-Actions
          • Trigger - Turn off (This trigger)
        • 'ELSE'-Actions
 

Attachments

  • Hook by GIMLI_2.w3x
    24.2 KB · Views: 110
Status
Not open for further replies.
Top