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

Death's Respite v1.2

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: X-OMG-X
Updated to v1.2

Based off of the Death's Respite spell in World of Warcraft's 5 man ToC boss encounter (the Black Knight)
-Target a unit with the spell; lifts the unit into the air for up to 1 second, dealing damage, and then throws the target back a good distance. Melee range, damage depends on Str and Int.

Leakless (i think...), MUI
  • init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set DR_Hash = (Last created hashtable)
      • -------- --------
      • -------- Globals for spell --------
      • -------- Max lift time --------
      • Set DR_MaxTime = 1.00
      • -------- --------
      • -------- Damage multiplier ( lvl x (str + int) x DmgConstant ) --------
      • Set DR_DmgConst = 0.60
      • -------- Initial Damage ( ( DmgInit x lvl ) + ( lvl x (str + int) x DmgConstant ) ) --------
      • Set DR_DmgInit = 30.00
      • -------- --------
      • -------- Height lifted per .02sec --------
      • Set DR_LiftSpeed = 2.00
      • -------- --------
      • -------- Distance thrown per .02sec --------
      • Set DR_ThrowSpeed = 20.00
      • -------- --------
      • -------- Overall length of the porabolic shape --------
      • -------- multiplied by the time used to lift --------
      • Set DR_PorabLength = 1200.00
      • -------- --------
      • -------- End distance from initial point for parabola --------
      • -------- multiplied by the time used to lift --------
      • Set DR_PorabEnd = 600.00
      • -------- --------
      • Custom script: call DestroyTrigger(GetTriggeringTrigger())
  • DR Init
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Death's Respite
    • Actions
      • -------- When ability is started: --------
      • -------- add one to the index used to keep track of who's who for specific situation info --------
      • Set DR_Index = (DR_Index + 1)
      • -------- save variables for this situation to the given index number --------
      • -------- --------
      • -------- Target of spell --------
      • Hashtable - Save Handle Of(Target unit of ability being cast) as (Key Target) of DR_Index in DR_Hash
      • -------- Caster --------
      • Hashtable - Save Handle Of(Triggering unit) as (Key Caster) of DR_Index in DR_Hash
      • -------- Start lift time --------
      • Hashtable - Save 0.00 as (Key Time) of DR_Index in DR_Hash
      • -------- set false to not throw yet --------
      • Hashtable - Save False as (Key Throw) of DR_Index in DR_Hash
      • -------- set true to start lifting --------
      • Hashtable - Save True as (Key Lifting) of DR_Index in DR_Hash
      • -------- caster's strength (for damage calc) --------
      • Hashtable - Save (Strength of (Triggering unit) (Include bonuses)) as (Key Str) of DR_Index in DR_Hash
      • -------- caster's intellect (for damage calc) --------
      • Hashtable - Save (Intelligence of (Triggering unit) (Include bonuses)) as (Key Int) of DR_Index in DR_Hash
      • -------- level of ability (for damage calc) --------
      • Hashtable - Save (Level of Death's Respite for (Triggering unit)) as (Key Lvl) of DR_Index in DR_Hash
      • -------- create a special effect on the target --------
      • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
      • -------- destroy it so it doesn't leak --------
      • Special Effect - Destroy (Last created special effect)
      • -------- turn on other triggers for the actual workings of the spell --------
      • Trigger - Turn on DR Periodic <gen>
      • Trigger - Turn on DR StopChanneling <gen>
      • -------- stop the target from doing anything --------
      • Unit - Pause (Target unit of ability being cast)
Initially off
  • DR Periodic
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • -------- every .02sec: --------
      • -------- go thru all the situations and... --------
      • For each (Integer A) from 1 to DR_Index, do (Actions)
        • Loop - Actions
          • -------- check if they are lifting --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load (Key Lifting) of (Integer A) from DR_Hash) Equal to True
            • Then - Actions
              • -------- if they are: --------
              • -------- check if they should be lifting --------
              • -------- if their current time they have been lifted is greater than the allowed max time then --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load (Key Time) of (Integer A) from DR_Hash) Greater than DR_MaxTime
                • Then - Actions
                  • -------- stop them from being lifted; set lift to false so they dont lift anymore --------
                  • Hashtable - Save False as (Key Lifting) of (Integer A) in DR_Hash
                  • -------- and unpause the target --------
                  • Unit - Unpause (Load (Key Target) of (Integer A) in DR_Hash)
                  • -------- start the throw portion --------
                  • -------- set throw to true so they start the throw portion of the spell --------
                  • Hashtable - Save True as (Key Throw) of (Integer A) in DR_Hash
                  • -------- set the max distance from the start to end point (depends on how far in the air the unit is) --------
                  • Hashtable - Save (DR_PorabLength x (Load (Key Time) of (Integer A) from DR_Hash)) as (Key MaxDist) of (Integer A) in DR_Hash
                  • -------- set the current distance from the target to the end point (depends on how far in the air the unit is) --------
                  • Hashtable - Save ((Load (Key MaxDist) of (Integer A) from DR_Hash) / 2.00) as (Key CurDist) of (Integer A) in DR_Hash
                  • -------- set the max height the unit will reach in the porabola, which is higher than the start height to make it curve up then back down (depends on how far in the air the unit is) --------
                  • Hashtable - Save (100.00 x (Load (Key Time) of (Integer A) from DR_Hash)) as (Key MaxHeight) of (Integer A) in DR_Hash
                  • -------- set a point for where the target currently is --------
                  • Hashtable - Save (X of (Position of (Load (Key Target) of (Integer A) in DR_Hash))) as (Key TargetPtX) of (Integer A) in DR_Hash
                  • Hashtable - Save (Y of (Position of (Load (Key Target) of (Integer A) in DR_Hash))) as (Key TargetPtY) of (Integer A) in DR_Hash
                  • -------- set a temp point for where the caster is --------
                  • Hashtable - Save (X of (Position of (Load (Key Caster) of (Integer A) in DR_Hash))) as (Key TempPtX) of (Integer A) in DR_Hash
                  • Hashtable - Save (Y of (Position of (Load (Key Caster) of (Integer A) in DR_Hash))) as (Key TempPtY) of (Integer A) in DR_Hash
                  • -------- set a point for the unit to move towards --------
                  • Set TempPt = ((Point((Load (Key TargetPtX) of (Integer A) from DR_Hash), (Load (Key TargetPtY) of (Integer A) from DR_Hash))) offset by (Load (Key CurDist) of (Integer A) from DR_Hash) towards (Angle from (Point((Load (Key TempPtX) of (Integer A) from DR_Hash), (Load (Key
                  • Hashtable - Save (X of TempPt) as (Key EndPtX) of (Integer A) in DR_Hash
                  • Hashtable - Save (Y of TempPt) as (Key EndPtY) of (Integer A) in DR_Hash
                  • Custom script: call RemoveLocation(udg_TempPt)
                  • -------- another special effect created and destroyed to stop the leak --------
                  • Special Effect - Create a special effect attached to the origin of (Load (Key Target) of (Integer A) in DR_Hash) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
                  • -------- if it still is lifting then --------
                  • -------- set the current time spent lifting to itself plus .02 because that's how often this trigger goes --------
                  • Hashtable - Save ((Load (Key Time) of (Integer A) from DR_Hash) + 0.02) as (Key Time) of (Integer A) in DR_Hash
                  • -------- add Storm Crow Form to allow the unit to change heights --------
                  • Unit - Add Storm Crow Form to (Load (Key Target) of (Integer A) in DR_Hash)
                  • -------- increase his height a little bit --------
                  • Animation - Change (Load (Key Target) of (Integer A) in DR_Hash) flying height to ((Current flying height of (Load (Key Target) of (Integer A) in DR_Hash)) + DR_LiftSpeed) at 0.00
                  • -------- remove the ability so the unit is stuck at that height --------
                  • Unit - Remove Storm Crow Form from (Load (Key Target) of (Integer A) in DR_Hash)
                  • -------- damage the unit --------
                  • Unit - Cause (Load (Key Caster) of (Integer A) in DR_Hash) to damage (Load (Key Target) of (Integer A) in DR_Hash), dealing (((DR_DmgInit x (Real((Load (Key Lvl) of (Integer A) from DR_Hash)))) + (((Real((Load (Key Str) of (Integer A) from DR_Hash))) + (Real((Load (Key Int) of (Integer A) from DR_Hash)))) x ((Real((Load (Key Lvl) of (Integer A) from DR_Hash))) x DR_DmgConst))) x 0 damage of attack type Magic and damage type Normal
            • Else - Actions
              • -------- if they aren't, this trigger shouldnt do anything for them --------
          • -------- Check if the unit should be thrown --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load (Key Throw) of (Integer A) from DR_Hash) Equal to True
            • Then - Actions
              • -------- if it is then check if it should be by compairing its current distance to its initial distance --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load (Key MaxDist) of (Integer A) from DR_Hash) Greater than (Load (Key CurDist) of (Integer A) from DR_Hash)
                • Then - Actions
                  • -------- if it should be being thrown then --------
                  • -------- create a point for the next location of the unit (i.e. just infront of where it is now) --------
                  • Set TempPt = ((Point((Load (Key TargetPtX) of (Integer A) from DR_Hash), (Load (Key TargetPtY) of (Integer A) from DR_Hash))) offset by DR_ThrowSpeed towards (Angle from (Point((Load (Key TargetPtX) of (Integer A) from DR_Hash), (Load (Key TargetPtY) of (Integer A) from D
                  • Hashtable - Save (X of TempPt) as (Key TargetPtX) of (Integer A) in DR_Hash
                  • Hashtable - Save (Y of TempPt) as (Key TargetPtY) of (Integer A) in DR_Hash
                  • Custom script: call RemoveLocation(udg_TempPt)
                  • -------- set the current distance thru the porabola again to match its new position --------
                  • Hashtable - Save ((Load (Key CurDist) of (Integer A) from DR_Hash) + DR_ThrowSpeed) as (Key CurDist) of (Integer A) in DR_Hash
                  • -------- use an equation to find at what height the target should be at related to the max distance, current distance and max height --------
                  • Set DR_TempReal = (((4.00 x (Load (Key MaxHeight) of (Integer A) from DR_Hash)) / (Load (Key MaxDist) of (Integer A) from DR_Hash)) x (((Load (Key MaxDist) of (Integer A) from DR_Hash) - (Load (Key CurDist) of (Integer A) from DR_Hash)) x ((Load (Key CurDist) of (Integer A) fr
                  • -------- move the unit to the new point --------
                  • Unit - Move (Load (Key Target) of (Integer A) in DR_Hash) instantly to (Point((Load (Key TargetPtX) of (Integer A) from DR_Hash), (Load (Key TargetPtY) of (Integer A) from DR_Hash)))
                  • -------- add Storm Crow Form to the unit so it can change heights --------
                  • Unit - Add Storm Crow Form to (Load (Key Target) of (Integer A) in DR_Hash)
                  • -------- set the height for the new height for the new location --------
                  • Animation - Change (Load (Key Target) of (Integer A) in DR_Hash) flying height to DR_TempReal at 0.00
                  • -------- remove the ability again so the unit is stuck at that height --------
                  • Unit - Remove Storm Crow Form from (Load (Key Target) of (Integer A) in DR_Hash)
                • Else - Actions
                  • -------- if it should not be thrown (aka is at the end of the porabola) then --------
                  • -------- add Storm Crow Form to the unit so it can change heights --------
                  • Unit - Add Storm Crow Form to (Load (Key Target) of (Integer A) in DR_Hash)
                  • -------- set the height to 0 because it should now be on the ground at the end of the path --------
                  • Animation - Change (Load (Key Target) of (Integer A) in DR_Hash) flying height to 0.00 at 0.00
                  • -------- remove the ability again so the unit is stuck at that height --------
                  • Unit - Remove Storm Crow Form from (Load (Key Target) of (Integer A) in DR_Hash)
                  • -------- clear all hash variables dealing with this situation to stop leaks --------
                  • Hashtable - Clear all child hashtables of child (Integer A) in DR_Hash
                  • -------- (set a boolean to false for the following loop) --------
                  • Set TempBool = False
                  • -------- this loop goes thru all the situations and checks if any of them are still active by checking if they have a caster unit stored --------
                  • -------- if any of them does, it sets the boolean to true, indicating the triggers are still in use for a situation --------
                  • For each (Integer B) from 1 to DR_Index, do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Load (Key Caster) of (Integer B) in DR_Hash) Not equal to No unit
                        • Then - Actions
                          • Set TempBool = True
                        • Else - Actions
                  • -------- if the triggers are in use then --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • TempBool Equal to True
                    • Then - Actions
                      • -------- dont do anything --------
                    • Else - Actions
                      • -------- else set the index back to zero to reset the index so it will not just continue growing forever; and turn off the triggers now that they are not in use --------
                      • Set DR_Index = 0
                      • Trigger - Turn off DR Periodic <gen>
                      • Trigger - Turn off DR StopChanneling <gen>
            • Else - Actions
              • -------- if the unit isnt being thrown dont do anything to it --------
Initially off
  • DR StopChanneling
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Death's Respite
    • Actions
      • -------- if the caster stops channeling early then --------
      • -------- chech which situation it is for --------
      • For each (Integer A) from 1 to DR_Index, do (Actions)
        • Loop - Actions
          • -------- if the triggering unit was the caster for this situation then --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to (Load (Key Caster) of (Integer A) in DR_Hash)
            • Then - Actions
              • -------- if the target is lifting --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load (Key Lifting) of (Integer A) from DR_Hash) Equal to True
                • Then - Actions
                  • -------- stop them from being lifted; set lift to false so they dont lift anymore --------
                  • Hashtable - Save False as (Key Lifting) of (Integer A) in DR_Hash
                  • -------- and unpause the target --------
                  • Unit - Unpause (Load (Key Target) of (Integer A) in DR_Hash)
                  • -------- start the throw portion --------
                  • -------- set throw to true so they start the throw portion of the spell --------
                  • Hashtable - Save True as (Key Throw) of (Integer A) in DR_Hash
                  • -------- set the max distance from the start to end point (depends on how far in the air the unit is) --------
                  • Hashtable - Save (DR_PorabLength x (Load (Key Time) of (Integer A) from DR_Hash)) as (Key MaxDist) of (Integer A) in DR_Hash
                  • -------- set the current distance from the target to the end point (depends on how far in the air the unit is) --------
                  • Hashtable - Save ((Load (Key MaxDist) of (Integer A) from DR_Hash) / 2.00) as (Key CurDist) of (Integer A) in DR_Hash
                  • -------- set the max height the unit will reach in the porabola, which is higher than the start height to make it curve up then back down (depends on how far in the air the unit is) --------
                  • Hashtable - Save (100.00 x (Load (Key Time) of (Integer A) from DR_Hash)) as (Key MaxHeight) of (Integer A) in DR_Hash
                  • -------- set a point for where the target currently is --------
                  • Hashtable - Save (X of (Position of (Load (Key Target) of (Integer A) in DR_Hash))) as (Key TargetPtX) of (Integer A) in DR_Hash
                  • Hashtable - Save (Y of (Position of (Load (Key Target) of (Integer A) in DR_Hash))) as (Key TargetPtY) of (Integer A) in DR_Hash
                  • -------- set a temp point for where the caster is --------
                  • Hashtable - Save (X of (Position of (Load (Key Caster) of (Integer A) in DR_Hash))) as (Key TempPtX) of (Integer A) in DR_Hash
                  • Hashtable - Save (Y of (Position of (Load (Key Caster) of (Integer A) in DR_Hash))) as (Key TempPtY) of (Integer A) in DR_Hash
                  • -------- set a point for the unit to move towards --------
                  • Set TempPt = ((Point((Load (Key TargetPtX) of (Integer A) from DR_Hash), (Load (Key TargetPtY) of (Integer A) from DR_Hash))) offset by (Load (Key CurDist) of (Integer A) from DR_Hash) towards (Angle from (Point((Load (Key TempPtX) of (Integer A) from DR_Hash), (Load (Key
                  • Hashtable - Save (X of TempPt) as (Key EndPtX) of (Integer A) in DR_Hash
                  • Hashtable - Save (Y of TempPt) as (Key EndPtY) of (Integer A) in DR_Hash
                  • Custom script: call RemoveLocation(udg_TempPt)
                  • -------- another special effect created and destroyed to stop the leak --------
                  • Special Effect - Create a special effect attached to the origin of (Load (Key Target) of (Integer A) in DR_Hash) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
            • Else - Actions
v1.2 - Fixed location leaks dealing with hash and removing the points;
-Combined the two periodic triggers into one trigger

Keywords:
WoW, World of Warcraft, Death's Respite, Knockback
Contents

Just another Warcraft III map (Map)

Reviews
16:49, 27th Nov 2009 TriggerHappy: I can approve this once you fix leaks. (Position of (Load (Key Target)) leaks. And all the others like it.

Moderator

M

Moderator

16:49, 27th Nov 2009
TriggerHappy:

I can approve this once you fix leaks.

(Position of (Load (Key Target)) leaks. And all the others like it.
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
constants should be in the start trigger so you can make the spell multi-leveled by checking the casters level of the ability because right now the maths is in the loop trigger which is not comfertable lols comfertable to change

im not against pausing units but alot of ppl are so you should probably order the target unit to stop before pausing so it wont bug if the target channels

change integer A to a custom made variable
, integer B the same, else this is looking good
 
Top