1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. The poll for our 11th Music Contest is up! Help us choose the most awesome cinematic tracks by casting a vote!
    Dismiss Notice
  3. Melee Mapping contest #3 - Poll is up! Vote for the best 4v4 melee maps!
    Dismiss Notice
  4. The 30th edition of the Modeling Contest is finally up! The Portable Buildings need your attention, so come along and have a blast!
    Dismiss Notice
  5. The Aftermath has been revealed for the 19th Terraining Contest! Be sure to check out the Results and see what came out of it.
    Dismiss Notice

Huskar Life Break [V1.4]

Submitted by TheBeautifulPeople
This bundle is marked as pending. It has not been reviewed by a staff member yet.
Hello!, this is my first spell ever created.

Life Break:

The Sacred warrior draws upon his health to break an enemy's life, leaping at a target within attack range to shatter a percentage of that hero's current health, and slowing them.
Cast Range: 550
Current Health as Cost: 35%/40%/45%
Target's Current Health as Damage: 35%/40%/45%
Move Speed Slow: 40%/50%/60%
Attack Speed Slow: 20%/30%/40%
Slow Duration: 4/5/6
First Release

-Tried to fix the location leak
-Prefix renamed to HuskarLB_
-The Spell no longer pauses the Caster
-The Spell no longer activates/deactivates the Caster Collision
-Added the animation speed, animation index, damage type, attack type and dummy ability configs.
-Removed EffectCount

-Tried to fix the location leak another time
-Renamed to Huskar Life Break, from Life Break - Huskar
-Tried to avoid the calls like ( Triggering Unit, Last Created Unit, Picked Unit )
-Do Nothing was removed from the Map.

-Remake :D
-Using Instance ID instead of multiple "get key of Picked Unit"
-Tried to fix(i think i've fixed all) the leaks
-Using HuskarLB_CastersAlive instead of Number of units in Unit Group
-Using 0.03 delay instead of 0.02

-Changed the generic Temp* to HuskarLB_Temp*
-Avoiding the use of many [Triggering Unit] in the Cast Trigger
Contents

Huskar Life Break [Redone] 1.4 (Map)

Reviews
KILLCIDE
Needs Fixed The name of some of the variables are lacking prefixes so are way too generic (TempUnit, TempUnit2, TempInteger, etc) Suggestions Make the attachment point of the special effects configurable Avoid repeating function calls (ex:...
  1. Daffa the Mage

    Daffa the Mage

    Map Moderator

    Joined:
    Jan 30, 2013
    Messages:
    7,311
    Resources:
    22
    Packs:
    1
    Maps:
    8
    Spells:
    12
    Tutorials:
    1
    Resources:
    22
    Be careful with Pause Unit, that thing has a lot of mess.
    I'm not sure manipulatig collision is a good idea, it risk players to get the unit stuck.

    Still, pretty neat.
     
  2. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,138
    Resources:
    3
    Models:
    1
    Icons:
    1
    JASS:
    1
    Resources:
    3
    @Tasyen

    Would you mind taking this?
     
  3. KILLCIDE

    KILLCIDE

    Administrator

    Joined:
    Jul 22, 2015
    Messages:
    3,446
    Resources:
    20
    Models:
    2
    Icons:
    10
    Spells:
    7
    Tutorials:
    1
    Resources:
    20

    Needs Fixed

    • There are a few too much hardcoded stuff that should be configurable. Here are some from what I can see: special effects, attachment points of the special effects, attack type, damage type, speed of the charge, animation speed, & dummy ability.
    • You leak a lot of locations in the loop.
    • Instead of using the single If/Then/Else statement at the top of the loop to turn off the trigger, just make the check when the spell has ended.

    Suggestions

    • LB is too generic for a prefix.
    • It's not apparent what LB_EffectCount does until you look through the code. I'd add a note on what that is.
    • Avoid repeating function calls.
    • Avoid using Integer A as a loop integer. Create your own.
    • @Daffa the Mage mentioned some good points you should consider.

    Status



    Awaiting Update
     
  4. TheBeautifulPeople

    TheBeautifulPeople

    Joined:
    Feb 5, 2017
    Messages:
    22
    Resources:
    0
    Resources:
    0
    I'm a newbie :cry:
     
  5. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,138
    Resources:
    3
    Models:
    1
    Icons:
    1
    JASS:
    1
    Resources:
    3
    Use this event:

    • Events
      • A unit ends casting an ability.
    • Conditions
      • ....
     
  6. TheBeautifulPeople

    TheBeautifulPeople

    Joined:
    Feb 5, 2017
    Messages:
    22
    Resources:
    0
    Resources:
    0
    How?

    • Life Break Loop
      • Events
        • Time - Every 0.02 seconds of game time
      • Conditions
      • Actions
        • Unit Group - Pick every unit in HuskarLB_Group and do (Actions)
          • Loop - Actions
            • Set HuskarLB_Unit = (Picked unit)
            • Set HuskarLB_Target = (Load 1 of (Key (Picked unit)) in HuskarLB_Table)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (HuskarLB_Unit is alive) Equal to True
                • (Distance between (Position of HuskarLB_Unit) and (Position of HuskarLB_Target)) Less than HuskarLB_Distance_Broke
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Distance between (Position of HuskarLB_Unit) and (Position of HuskarLB_Target)) Greater than or equal to HuskarLB_Distance_ToClose
                  • If - Actions
                    • Set HuskarLB_TempLoc = ((Position of HuskarLB_Unit) offset by ((HuskarLB_ChargeSpeed / 50.00) + (((Current movement speed of (HuskarLB_Unit)) x 0.01) x 0.10)) towards (Facing of HuskarLB_Unit) degrees)
                    • Set HuskarLB_X = (X of HuskarLB_TempLoc)
                    • Set HuskarLB_Y = (Y of HuskarLB_TempLoc)
                    • Custom script: call RemoveLocation(udg_HuskarLB_TempLoc)
                    • Custom script: call SetUnitX(udg_HuskarLB_Unit, udg_HuskarLB_X)
                    • Custom script: call SetUnitY(udg_HuskarLB_Unit, udg_HuskarLB_Y)
                    • Unit - Make HuskarLB_Unit face HuskarLB_Target over 0.00 seconds
                    • -------- Apply the "Run" Animation --------
                    • Custom script: call SetUnitAnimationByIndex( udg_HuskarLB_Unit, udg_HuskarLB_ChargeAnimIndex)
                  • Otros: Acciones
                    • Unit - Make (Picked unit) Vulnerable
                    • Unit Group - Remove (Picked unit) from HuskarLB_Group
                    • Unit - Cause HuskarLB_Unit to damage HuskarLB_Target, dealing ((Life of HuskarLB_Target) x (Load 2 of (Key (Picked unit)) from HuskarLB_Table)) damage of attack type HuskarLB_AttackType and damage type HuskarLB_DamageType
                    • Special Effect - Destroy (Load 80 of (Key (Picked unit)) in HuskarLB_Table)
                    • Special Effect - Destroy (Load 81 of (Key (Picked unit)) in HuskarLB_Table)
                    • Special Effect - Create a special effect attached to the overhead of HuskarLB_Target using HuskarLB_SpecialEffect
                    • Special Effect - Destroy (Last created special effect)
                    • -------- Setting the Huskar to Normal --------
                    • Animation - Change HuskarLB_Unit's animation speed to 100.00% of its original speed
                    • Animation - Reset HuskarLB_Unit's animation
                    • -------- Applying the Slow Effect --------
                    • Set HuskarLB_TempLoc = (Position of HuskarLB_Unit)
                    • Unit - Create 1 Dummy for (Owner of HuskarLB_Unit) at HuskarLB_TempLoc facing HuskarLB_TempLoc
                    • Unit - Add HuskarLB_ABILITY_Dummy to (Last created unit)
                    • Unit - Set level of HuskarLB_ABILITY_Dummy for (Last created unit) to (Level of HuskarLB_ABILITY for HuskarLB_Unit)
                    • Unit - Order (Last created unit) to Sorceress : Slow HuskarLB_Target
                    • Unit - Add a 0.01 second Generic expiration timer to (Last created unit)
                    • -------- Removing the Location --------
                    • Custom script: call RemoveLocation(udg_HuskarLB_TempLoc)
                    • -------- - --------
                    • Unit - Order HuskarLB_Unit to Attack HuskarLB_Target
                    • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in HuskarLB_Table
              • Otros: Acciones
                • Unit - Make (Picked unit) Vulnerable
                • Unit - Order HuskarLB_Unit to Stop
                • Unit Group - Remove (Picked unit) from HuskarLB_Group
                • Special Effect - Destroy (Load 80 of (Key (Picked unit)) in HuskarLB_Table)
                • Special Effect - Destroy (Load 81 of (Key (Picked unit)) in HuskarLB_Table)
                • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in HuskarLB_Table
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Number of units in HuskarLB_Group) Equal to 0
          • Then - Actions
            • Trigger - Turn off (This trigger)
          • Else - Actions
            • Do nothing
     
  7. KILLCIDE

    KILLCIDE

    Administrator

    Joined:
    Jul 22, 2015
    Messages:
    3,446
    Resources:
    20
    Models:
    2
    Icons:
    10
    Spells:
    7
    Tutorials:
    1
    Resources:
    20

    Needs Fixed

    • You still leak a lot of locations. I'll point out the ones I can see here:
      • (Distance between (Position of HuskarLB_Unit) and (Position of HuskarLB_Target)) Less than HuskarLB_Distance_Broke
      • (Distance between (Position of HuskarLB_Unit) and (Position of HuskarLB_Target)) Greater than or equal to HuskarLB_Distance_ToClose
      • ((Position of HuskarLB_Unit) offset by ((HuskarLB_ChargeSpeed / 50.00) + (((Current movement speed of (Picked unit)) x 0.01) x 0.10)) towards (Facing of HuskarLB_Unit) degrees)

    Suggestions

    • You still have A LOT of repeating function calls in your code. If you're going to call the functions (Triggering unit), (Picked unit), or (Last created unit) more than once, it's best to just store it into a variable.
    • Move that If/Then/Else that checks if it is time to turn off the trigger inside the actions block that ends the current spell instance
    • It's not necessary to have a Do nothing action. It literally calls a function that does nothing.

    Status


    Awaiting Update
     
  8. KILLCIDE

    KILLCIDE

    Administrator

    Joined:
    Jul 22, 2015
    Messages:
    3,446
    Resources:
    20
    Models:
    2
    Icons:
    10
    Spells:
    7
    Tutorials:
    1
    Resources:
    20

    Needs Fixed

    • FirstPos & EndPos leaks. Be sure to clear them after the giant If/Then/Else block like this:
      • Set HuskarLB_FirstPos = (Position of HuskarLB_Unit)
      • Set HuskarLB_EndPos = (Position of HuskarLB_Target)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • ...
      • Custom script: call RemoveLocation(udg_HuskarLB_FirstPos)
      • Custom script: call RemoveLocation(udg_HuskarLB_EndPos)

    Suggestions

    • Instead of using Identifier to store the (Picked unit), it would be better to store the Key of (Picked unit). This would go for both onCast and loop triggers.
    • The SFX you attach to the weapon left and weapon right attachment points should be configurable (attachement point should be configurable too)
    • (Level of HuskarLB_ABILITY could be stored into a variable onCast for slightly better efficiency
    • You should only turn on the loop if it hasn't been already turned on. A workaround to this is having an integer keep track of the number of units you add to the group, and then checking if the integer is 1 to turn on. You could also use this check to turn off the trigger (if integer is 0, turn off). You would have to increment the integer for every onCast, and decrement the integer everytime you end a spell instance. This is honestly much better than using (Number of units in Unit Group)
    • It seems useless to have "Order HuskarLB_Unit to Stop" because this action will only run if the unit is not alive.

    Status


    Awaiting Update
     
  9. Daffa the Mage

    Daffa the Mage

    Map Moderator

    Joined:
    Jan 30, 2013
    Messages:
    7,311
    Resources:
    22
    Packs:
    1
    Maps:
    8
    Spells:
    12
    Tutorials:
    1
    Resources:
    22
    I suggest 0.03 instead of 0.02 for loop timer for slight efficiency. it saves 16,7 execution per second.
     
    Last edited: Jul 10, 2018
  10. TheBeautifulPeople

    TheBeautifulPeople

    Joined:
    Feb 5, 2017
    Messages:
    22
    Resources:
    0
    Resources:
    0
    Tried to fix it :)
     
  11. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,839
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    The minor thing I find here is that the escape proximity for the target that cancels the Life Break effect, is not implemented.

    You can check the mechanic more in dota2.gamepedia.com/Huskar
     
  12. KILLCIDE

    KILLCIDE

    Administrator

    Joined:
    Jul 22, 2015
    Messages:
    3,446
    Resources:
    20
    Models:
    2
    Icons:
    10
    Spells:
    7
    Tutorials:
    1
    Resources:
    20

    Needs Fixed

    • The name of some of the variables are lacking prefixes so are way too generic (TempUnit, TempUnit2, TempInteger, etc)

    Suggestions

    • Make the attachment point of the special effects configurable
    • Avoid repeating function calls (ex:
      GetTriggerUnit()
      is called 10 times in the cast trigger)
    • Make attack type and damage type configurable

    Status


    Awaiting Update