1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. Hey guys, we've posted the Results for the 30th Modeling Contest. Check them out!
    Dismiss Notice
  4. The 15th Mini-Mapping Contest came to an end. The Secrets of Warcraft 3 are soon to be revealed! Come and vote in the public poll for your favorite maps.
    Dismiss Notice
  5. The 12th incarnation of the Music Contest is LIVE! The theme is Synthwave. Knight Rider needs a song to listen to on his journey. You should definitely have some fun with this theme!
    Dismiss Notice
  6. Join other hivers in a friendly concept-art contest. The contestants have to create a genie coming out of its container. We wish you the best of luck!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Death Grip (Hero Ability) 1.07

Submitted by Laercio
This bundle is marked as approved. It works and satisfies the submission rules.
This is my version of the Death Grip spell from WoW

Features:

-Damages the target based in the percentage of it's current life (configurable)
-Grips the target and the aplies the damage over the time it is being moved
-Fully configurable (damage, final "distance" between caster and target, effect used and duration via the Config Trigger)
-Can be easily installed in your map (one CnP of the trigger category and one CnP of the ability)

Config
  • DG Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Creating the Hashtable --------
      • Hashtable - Create a hashtable
      • Set HashGrip = (Last created hashtable)
      • -------- Set the Total Damage for each level of the ability --------
      • Set DG_Damage[1] = 0.15
      • Set DG_Damage[2] = 0.30
      • Set DG_Damage[3] = 0.45
      • -------- Casting Time --------
      • Set DG_CastingTime = 1.35
      • -------- Set Effects to be used --------
      • Set DG_TargetEffect = Abilities\Spells\Undead\DarkSummoning\DarkSummonMissile.mdl
      • Set DG_Attach_Target = chest
      • -------- Set Collision of the Caster --------
      • Set DG_Collision = 125.00
      • -------- Set the used Ability --------
      • Set DGAbility = Death Grip


Cast
  • DG Target
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to DGAbility
    • Actions
      • -------- Turn on the loop --------
      • Trigger - Turn on DG Loop <gen>
      • -------- Setting variables --------
      • Set DG_Caster = (Triggering unit)
      • Set DG_Target = (Target unit of ability being cast)
      • Custom script: set udg_DGTargetKey = GetHandleId(udg_DG_Target)
      • Set DGPoint1 = (Position of DG_Caster)
      • Set DGPoint2 = (Position of DG_Target)
      • Set DG_Angle = (Angle from DGPoint2 to DGPoint1)
      • Set DG_Timer = DG_CastingTime
      • Set DG_CurrentDist = (((Distance between DGPoint1 and DGPoint2) - DG_Collision) x (0.03 / DG_Timer))
      • Set DG_Life = (Life of DG_Target)
      • Set DGDamageLoop = ((DG_Life x DG_Damage[(Level of DGAbility for DG_Caster)]) / (DG_CastingTime / 0.03))
      • -------- Check if Unit is already with Special Effect, if not, create the special effect --------
      • If ((3 is stored as a Handle of DGTargetKey in HashGrip) Equal to True) then do (-------- Do Nothing --------) else do (Special Effect - Create a special effect attached to the DG_Attach_Target of DG_Target using DG_TargetEffect)
      • -------- Removing Leaks --------
      • Custom script: call RemoveLocation(udg_DGPoint1)
      • Custom script: call RemoveLocation(udg_DGPoint2)
      • -------- Saving values in the Hashtable --------
      • Hashtable - Save DG_Angle as 0 of DGTargetKey in HashGrip
      • Hashtable - Save DG_CurrentDist as 1 of DGTargetKey in HashGrip
      • Hashtable - Save DG_Timer as 2 of DGTargetKey in HashGrip
      • Hashtable - Save Handle Of(Last created special effect) as 3 of DGTargetKey in HashGrip
      • Hashtable - Save DGDamageLoop as 4 of DGTargetKey in HashGrip
      • Hashtable - Save Handle OfDG_Caster as 5 of DGTargetKey in HashGrip
      • -------- Add the target to the unit group --------
      • Unit Group - Add DG_Target to DG_Group


Loop
  • DG Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DG_Group and do (Actions)
        • Loop - Actions
          • Set DG_Target = (Picked unit)
          • Custom script: set udg_DGTargetKey = GetHandleId(udg_DG_Target)
          • -------- Load values from the Hashtable --------
          • Set DG_Timer = (Load 2 of DGTargetKey from HashGrip)
          • -------- ----------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DG_Timer Greater than 0.00
              • (Life of (Load 5 of DGTargetKey in HashGrip)) Greater than 0.00
            • Then - Actions
              • -------- Moving unit --------
              • Set DGPoint1 = (Position of DG_Target)
              • Set DGPoint2 = (DGPoint1 offset by (Load 1 of DGTargetKey from HashGrip) towards (Load 0 of DGTargetKey from HashGrip) degrees)
              • Unit - Move DG_Target instantly to DGPoint2
              • Custom script: call RemoveLocation(udg_DGPoint1)
              • Custom script: call RemoveLocation(udg_DGPoint2)
              • -------- Decrease Timer for the movement of the unit --------
              • Hashtable - Save (DG_Timer - 0.03) as 2 of DGTargetKey in HashGrip
              • -------- Apply the damage on the unit --------
              • Unit - Set life of DG_Target to ((Life of DG_Target) - (Load 4 of DGTargetKey from HashGrip))
            • Else - Actions
              • -------- When the spell is done, clear the values... --------
              • Special Effect - Destroy (Load 3 of DGTargetKey in HashGrip)
              • Hashtable - Clear all child hashtables of child DGTargetKey in HashGrip
              • Unit Group - Remove DG_Target from DG_Group
              • -------- This actions checks if the unit group is empty and turns off the trigger if that case --------
              • If ((DG_Group is empty) Equal to True) then do (Trigger - Turn off (This trigger)) else do (-------- Do Nothing :) --------)


The trigger above is initially off and is turned on while the spell is "working".




If you use the ability I used on the map, maybe you must enter the "DG Configuration" trigger and do this:

  • -------- Set the used Ability --------
  • Set DGAbility = Death Grip


I think that's all guys. Feedback, constructive criticism and help is welcome.

Changelog


1.00 - Uploaded
1.01a - Fixed an action that was calculating the damage the wrong way
1.01b - Turned on the instructions in the test map
1.02 - Stored (Picked Unit) into a variable in the Loop trigger
1.03a - Fixed an issue that was calculating the damage using the wrong value
1.03b - Removed leak in Loop trigger
1.03c - The Loop trigger now is turned off when the unit group is empty
1.03d - The effect leak is fixed (now you can cast twice in the same unit)
1.04 - Polished the triggers
1.04a - Polished the triggers
1.04b - Polished the Triggers
1.04c - Fixed Loop trigger
1.05 - Polished Triggers
1.05a - Polished Triggers
1.06 - Remade the movement action, removed variables from the loop and stored damage and handle of caster in the hashtable
1.06a - Polished the triggers :)
1.06b - Polished the triggers...
1.07 - Effect is no longer removed and created again, removed useless variables, changed the icon (now icon has disabled variation), hashtable is now created in the configuration trigger. The location variable is now in the right place, inside the "then" actions, in the loop...


Credits:

- Maker (for great tips and a good review (preview))
- Forsaken (for giving me the idea and requesting this via PM, and review)
- deathismyfriend (for great tips on the triggers)

Fell free to change the icon and the values to fit your map.

Give credits if you use/edit this spell.

Keywords:
Death Knight, Death, Grip, Knockback, Movement, DoT, Damage, Damage Over Time, Undead, WOW, World of Warcraft.
Contents

Death Grip by Laercio (Map)

Reviews
Moderator
Death Grip 1.06b | Reviewed by Maker | 23rd Jul 2013 APPROVED [IMG] A useful spell [IMG] Instead of destroying/recreating the effect, don't destroy the effect and don't create an new one Don't set temp point in the...
  1. Death Grip 1.06b | Reviewed by Maker | 23rd Jul 2013
    APPROVED

    [​IMG]
    • A useful spell
    [​IMG]
    • Instead of destroying/recreating the effect,
      don't destroy the effect and don't create an new one
    • Don't set temp point in the looping trigger if you don't need it
    • You don't need four point variables for the spell,
      only two
    • Create the hashtable in DG Configuration and delete Create HashGrip
    • The ability is missing disabled version of the icon

    [tr]

    Old reviews

    Death Grip (Hero Ability) 1.05a | Reviewed by Maker | 30th Jun 2013
    NEEDS FIX

    [​IMG]
    • You leak the offset point when you move a unit
    • You set a point and instantly remove it in the looping trigger
      without doing anything with the point
    [​IMG]
    • Don't set variables if you don't need them, in the looping
    • Store the damage in the cast trigger
      trigger

    [tr]
    [/tr]
    [/tr]
     
  2. Laercio

    Laercio

    Joined:
    Nov 12, 2012
    Messages:
    115
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Any bugs, leaks, improvement tips and any kind of feedback is very welcome...
     
    Last edited: Jun 26, 2013
  3. Forsaken

    Forsaken

    Joined:
    Apr 5, 2012
    Messages:
    1,818
    Resources:
    14
    Maps:
    3
    Template:
    11
    Resources:
    14
    I love it *_*
     
  4. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,193
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    -It is not MUI, if you cast the spell on the same unit, the effect leaks and stays there forever
    -You leak a location in the looping trigger
    -Turn the trigger off when the unit group is empty, don't turn it on in the looping trigger
     
  5. FRENGERS

    FRENGERS

    Joined:
    Aug 4, 2012
    Messages:
    971
    Resources:
    4
    Icons:
    3
    Maps:
    1
    Resources:
    4
    I want vJASS :D :D
    If you can ;) ;)[
    + REPT
     
  6. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,532
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    to learn how to do MUI u can use the method i use called indexed arrays. check out my tutorial things a GUIer should know. the chapter called how to index.
     
  7. Laercio

    Laercio

    Joined:
    Nov 12, 2012
    Messages:
    115
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Thank you, but I'm not the first to make one, I just made a version with three levels for myself, to use as a hero ability (not ultimate)...

    It may be a bit (or a lot) different from the WoW death grip, but I think it will suffice...

    -The effect does not leak anymore
    -Moved the custom script down to remove the location after moving the unit and then set the second location to be removed as well (if it is wrong, tell me)
    -Now the loop trigger turns off when unit group is empty

    Let me know if I'm missing something yet...

    Thank you...

    Sorry, I'm a GUI user, I have not yet learned vJass ;P

    But thanks anyway

    Whoa, I just readed your post after the 1.03 update, but thanks anyway...
    I know the indexing and I know that it is a lot easier to use (I'm talking about bribe's) arrays, but I just wanted to do it the hard way ;P

    Thank you, I'll read your tutorial now (or maybe later, you know, its 1:05 am here :p)
     
    Last edited: Jun 27, 2013
  8. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,193
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    -Only check if the group is empty when removing a unit from it
    -You don't need a variable for the special effect, Destroy load 3... and you can save last created special effect
    -The proper way to destroy the effect is first to check if it exists, Boolean - Hashtable value exists. 3 is saved as a handle
     
  9. Laercio

    Laercio

    Joined:
    Nov 12, 2012
    Messages:
    115
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Changes made... Thank you...
     
  10. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,532
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    this isnt needed.
    • Set DGTempPoint = (Position of DGTempUnit)
    • Custom script: call RemoveLocation(udg_DGTempPoint)


    this leaks change it to the variable u set right above it.
    • Unit - Move DGTempUnit instantly to ((Position of DGTempUnit) offset by DG_CurrentDist towards DG_Angle degrees)
     
  11. Laercio

    Laercio

    Joined:
    Nov 12, 2012
    Messages:
    115
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Whoa, I haven't noticed that... I'll change it... Thank you...
     
  12. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,532
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
  13. Daffa the Mage

    Daffa the Mage

    Map Moderator

    Joined:
    Jan 30, 2013
    Messages:
    7,573
    Resources:
    27
    Packs:
    1
    Maps:
    8
    Spells:
    16
    Tutorials:
    2
    Resources:
    27
    Replace do nothing with comment for more efficient trigger :)
     
  14. Laercio

    Laercio

    Joined:
    Nov 12, 2012
    Messages:
    115
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Replaced :)
     
  15. Marcos_M

    Marcos_M

    Joined:
    Jan 23, 2011
    Messages:
    346
    Resources:
    0
    Resources:
    0
    Set DGTempPoint = (Position of DGTempUnit)
    Unit - Move DGTempUnit instantly to (DGTempPoint offset by DG_CurrentDist towards DG_Angle degrees)


    Here you need to set another point for the polar offset, because this leaks
     
  16. Laercio

    Laercio

    Joined:
    Nov 12, 2012
    Messages:
    115
    Resources:
    1
    Spells:
    1
    Resources:
    1
    That position is destroyed with each loop, as the position of the unit (the point you are speaking of) is set before the movement and is destroyed with each loop (every 0.03 seconds) . I think the leak in this point does not exists, but thanks anyway... :)
     
  17. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,532
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    no he is correct. this specifically leaks.
    • (DGTempPoint offset by DG_CurrentDist towards DG_Angle degrees)


    whenever u offset it creates a new point/location which leaks.
     
  18. Laercio

    Laercio

    Joined:
    Nov 12, 2012
    Messages:
    115
    Resources:
    1
    Spells:
    1
    Resources:
    1
    At first I removed both locations inside the loop, and that was like removing the same location twice (the first time being as the offset location and the second time as the first location), them you came and said it was not necessary, that made sense to me, since the unit location was removed with each loop.

    Now what would really make sense is to remove the position of the unit in the "Else" actions of the loop...

    As I see now, I am removing the current position/location of the unit and, as that action creates a second location (the offset location), that second location is removed when the trigger "loops" and, when the spell is done, the final location is removed too.

    But as I am learning how to make spells, I may be wrong tough... Let me now if I am (or if you did not understand what I said above)
     
  19. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,532
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    ur storing picked unit in the wrong way.

    change this
    • DG Loop
      • Events
        • Time - Every 0.03 seconds of game time
      • Conditions
      • Actions
        • Unit Group - Pick every unit in DG_Group and do (Actions)
          • Loop - Actions
            • -------- Load values from the Hashtable --------
            • Set DG_Angle = (Load 0 of (Key (Picked unit)) from HashGrip)
            • Set DG_CurrentDist = (Load 1 of (Key (Picked unit)) from HashGrip)
            • Set DG_Timer = (Load 2 of (Key (Picked unit)) from HashGrip)
            • Set DG_Life = (Load 4 of (Key (Picked unit)) from HashGrip)
            • -------- ----------------------- --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • DG_Timer Greater than 0.00
                • (Life of DG_Caster) Greater than 0.00
              • Then - Actions
                • -------- Moving unit --------
                • Set DGTempUnit = (Picked unit)
                • Set DGTempPoint = (Position of DGTempUnit)
                • Unit - Move DGTempUnit instantly to (DGTempPoint offset by DG_CurrentDist towards DG_Angle degrees)
                • Custom script: call RemoveLocation(udg_DGTempPoint)
                • -------- Decrease Timer for the movement of the unit --------
                • Hashtable - Save (DG_Timer - 0.03) as 2 of (Key (Picked unit)) in HashGrip
                • -------- Apply the damage on the unit --------
                • Unit - Set life of DGTempUnit to ((Life of DGTempUnit) - ((DG_Life x DG_Damage[(Level of Death Grip for DG_Caster)]) / (DG_CastingTime / 0.03)))
              • Else - Actions
                • -------- When the spell is done, clear the values... --------
                • Set DGTempPoint = (Position of (Picked unit))
                • Custom script: call RemoveLocation(udg_DGTempPoint)
                • Set DG_Target_Effect = (Load 3 of (Key (Picked unit)) in HashGrip)
                • Special Effect - Destroy DG_Target_Effect
                • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in HashGrip
                • Unit Group - Remove (Picked unit) from DG_Group
                • -------- This actions checks if the unit group is empty and turns off the trigger if that case --------
                • If ((DG_Group is empty) Equal to True) then do (Trigger - Turn off (This trigger)) else do (-------- Do Nothing :) --------)

    to this and change every picked unit to the temp unit variable
    • DG Loop
      • Events
        • Time - Every 0.03 seconds of game time
      • Conditions
      • Actions
        • Unit Group - Pick every unit in DG_Group and do (Actions)
          • Loop - Actions
            • Set DGTempUnit = (Picked unit)
            • Set DGTempPoint = (Position of DGTempUnit)
            • -------- Load values from the Hashtable --------
            • Set DG_Angle = (Load 0 of (Key (Picked unit)) from HashGrip)
            • Set DG_CurrentDist = (Load 1 of (Key (Picked unit)) from HashGrip)
            • Set DG_Timer = (Load 2 of (Key (Picked unit)) from HashGrip)
            • Set DG_Life = (Load 4 of (Key (Picked unit)) from HashGrip)
            • -------- ----------------------- --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • DG_Timer Greater than 0.00
                • (Life of DG_Caster) Greater than 0.00
              • Then - Actions
                • -------- Moving unit --------
                • -------- fix the line under this --------
                • Unit - Move DGTempUnit instantly to (DGTempPoint offset by DG_CurrentDist towards DG_Angle degrees)
                • -------- Decrease Timer for the movement of the unit --------
                • Hashtable - Save (DG_Timer - 0.03) as 2 of (Key (Picked unit)) in HashGrip
                • -------- Apply the damage on the unit --------
                • Unit - Set life of DGTempUnit to ((Life of DGTempUnit) - ((DG_Life x DG_Damage[(Level of Death Grip for DG_Caster)]) / (DG_CastingTime / 0.03)))
              • Else - Actions
                • -------- When the spell is done, clear the values... --------
                • Set DG_Target_Effect = (Load 3 of (Key (Picked unit)) in HashGrip)
                • Special Effect - Destroy DG_Target_Effect
                • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in HashGrip
                • Unit Group - Remove (Picked unit) from DG_Group
                • -------- This actions checks if the unit group is empty and turns off the trigger if that case --------
                • If ((DG_Group is empty) Equal to True) then do (Trigger - Turn off (This trigger)) else do (-------- Do Nothing :) --------)
            • Custom script: call RemoveLocation(udg_DGTempPoint)


    also use the variable u have set above these. and use that variable
    • Hashtable - Save DG_Angle as 0 of (Key (Target unit of ability being cast)) in HashGrip
    • Hashtable - Save DG_CurrentDist as 1 of (Key (Target unit of ability being cast)) in HashGrip
    • Hashtable - Save DG_Timer as 2 of (Key (Target unit of ability being cast)) in HashGrip
    • Hashtable - Save Handle Of(Last created special effect) as 3 of (Key (Target unit of ability being cast)) in HashGrip
    • Hashtable - Save DG_Life as 4 of (Key (Target unit of ability being cast)) in HashGrip