• 🏆 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 Penalty v1,00

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Lashes Target with its own Sins, dealing damage on cast and little later.

I don't know much about balancing, but I can already tell that this spell is highly inbalanced. Balance the numbers yourself.
In this spell I used non-arrayed variables (except for Angle Variables), thus having alot more work with finding right variables to use, so this should be somekind of excuse for a mistake ;)


  • Death Penalty Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Death Penalty
    • Actions
      • -------- Stores Caster and Target into varibles --------
      • -------- From now on, I'll say 'Duo' instead of 'Caster and Target' --------
      • Set Caster = (Triggering unit)
      • Set Target = (Target unit of ability being cast)
      • -------- Counts total damage dealt --------
      • -------- NOTE 1: Set your damage here --------
      • Set Damage = ((Max life of Target) x (0.10 + (0.05 x (Real((Level of Death Penalty for Caster))))))
      • Set Damage = (Damage / 2.00)
      • -------- Sets number of black bolts, flying out and around the target, the 'Sins' --------
      • -------- NOTE 2: Change your sin number here --------
      • Set SFXes = 7
      • -------- Prepares angle variables for creating the Sins --------
      • Set Angles[1] = (360.00 / (Real(SFXes)))
      • Set Angles[2] = 0.00
      • -------- Nulifies Distance variable --------
      • Set Distance = 0.00
      • -------- Finds Caster's Location and creates a Dummy unit there --------
      • Set Point1 = (Position of Target)
      • Unit - Create 1 Dummy Unit for (Owner of Caster) at Point1 facing Default building facing degrees
      • -------- Stores Dummy Unit and it's HandleID into variables --------
      • Set DummyUnit = (Last created unit)
      • Set IDHandle = (Key (Last created unit))
      • -------- Causes Caster deal damage to Target, causing half of total damage --------
      • Unit - Cause Caster to damage Target, dealing Damage damage of attack type Spells and damage type Normal
      • -------- Stores necessary information into hashtable --------
      • -------- NOTE 3: All information is attached to the Dummy Unit --------
      • Hashtable - Save Handle OfTarget as 0 of IDHandle in Hashtable
      • Hashtable - Save Handle OfCaster as 1 of IDHandle in Hashtable
      • Hashtable - Save Damage as 2 of IDHandle in Hashtable
      • Hashtable - Save SFXes as 3 of IDHandle in Hashtable
      • Hashtable - Save LoopsForASFX2 as 4 of IDHandle in Hashtable
      • Hashtable - Save Distance as 5 of IDHandle in Hashtable
      • -------- Creates Sins and stores them into hashtable --------
      • -------- NOTE 4: Change Sin's model in Object Editor, Unit named Sin --------
      • For each (Integer LoopVariable) from 1 to SFXes, do (Actions)
        • Loop - Actions
          • Set Point2 = (Point1 offset by 70.00 towards Angles[2] degrees)
          • Unit - Create 1 Sin for (Owner of Caster) at Point2 facing Default building facing degrees
          • Animation - Change (Last created unit) flying height to ((Current flying height of Target) + 70.00) at 0.00
          • Hashtable - Save Handle Of(Last created unit) as (5 + LoopVariable) of IDHandle in Hashtable
          • Set Angles[2] = (Angles[2] + Angles[1])
          • Custom script: call RemoveLocation(udg_Point2)
      • -------- Checks if there is any instace of spell in game. If not, turns the first part of spell --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (PenaltiesAway is empty) Equal to True
        • Then - Actions
          • Trigger - Turn on Death Penalty Away <gen>
        • Else - Actions
      • -------- Adds Dummy Unit to Dummy group, which controls sins going away from target --------
      • Unit Group - Add DummyUnit to PenaltiesAway
      • -------- Fixes the leak --------
      • Custom script: call RemoveLocation(udg_Point1)
  • Death Penalty Away
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in PenaltiesAway and do (Actions)
        • Loop - Actions
          • -------- Stores Dummy Unit's HandleID into variable --------
          • Set IDHandle = (Key (Picked unit))
          • -------- Loads number of sins --------
          • Set SFXes = (Load 3 of IDHandle from Hashtable)
          • -------- Sets Speed --------
          • Set Speed = 35.00
          • -------- Loads Sins' Distance to Target and increases it by Speed --------
          • Set Distance = (Load 5 of IDHandle from Hashtable)
          • Set Distance = (Distance + Speed)
          • -------- Loads target and finds its location --------
          • Set Target = (Load 0 of IDHandle in Hashtable)
          • Set Point1 = (Position of Target)
          • -------- Moves all Sins away from target by distance --------
          • For each (Integer LoopVariable) from 1 to SFXes, do (Actions)
            • Loop - Actions
              • Set DummyUnit = (Load (5 + LoopVariable) of IDHandle in Hashtable)
              • Set Point2 = (Position of DummyUnit)
              • Set Point3 = (Point1 offset by Distance towards (Angle from Point1 to Point2) degrees)
              • Unit - Move DummyUnit instantly to Point3
              • Custom script: call RemoveLocation(udg_Point2)
              • Custom script: call RemoveLocation(udg_Point3)
          • -------- Checks if it is time to start spinning the Sins --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Distance Less than or equal to 600.00
            • Then - Actions
              • -------- If not, updates the Distance --------
              • Hashtable - Save Distance as 5 of IDHandle in Hashtable
            • Else - Actions
              • -------- If it is, switches Dummy Unit's group from -Away to -Spin --------
              • Unit Group - Remove (Picked unit) from PenaltiesAway
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (PenaltiesAway is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (PenaltiesSpin is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn on Death Penalty Spin <gen>
                • Else - Actions
              • Unit Group - Add (Picked unit) to PenaltiesSpin
          • -------- Fixes the leak --------
          • Custom script: call RemoveLocation(udg_Point1)
  • Death Penalty Spin
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in PenaltiesSpin and do (Actions)
        • Loop - Actions
          • -------- Loads Dummy's HandleID --------
          • Set IDHandle = (Key (Picked unit))
          • -------- Loads number of Sins --------
          • Set SFXes = (Load 3 of IDHandle from Hashtable)
          • -------- Loads loops needed for next SFX closing to the Target and increases it by 1 (current loop) --------
          • Set LoopsForASFX2 = (Load 4 of IDHandle from Hashtable)
          • Set LoopsForASFX2 = (LoopsForASFX2 + 1)
          • -------- Sets number of loops needed to play the SFX --------
          • -------- NOTE 1: Set your Loops needed for sfx here --------
          • Set PlaySFXInteger = 5
          • -------- Loads Sins' Distance to Target --------
          • Set Distance = (Load 5 of IDHandle from Hashtable)
          • -------- Loads target and finds its location --------
          • Set Target = (Load 0 of IDHandle in Hashtable)
          • Set Point1 = (Position of Target)
          • -------- Sets spinning speed --------
          • -------- NOTE 1: Set your spinning speed here --------
          • Set Speed = 5.00
          • -------- Spins all Sins and plays Closing animations if needed --------
          • For each (Integer LoopVariable) from 1 to SFXes, do (Actions)
            • Loop - Actions
              • Set DummyUnit = (Load (5 + LoopVariable) of IDHandle in Hashtable)
              • Set Point2 = (Position of DummyUnit)
              • Set Point3 = (Point1 offset by 600.00 towards ((Angle from Point1 to Point2) + Speed) degrees)
              • Unit - Move DummyUnit instantly to Point3
              • Custom script: call RemoveLocation(udg_Point3)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LoopsForASFX2 Equal to PlaySFXInteger
                • Then - Actions
                  • Set Point3 = (Point1 offset by Distance towards ((Angle from Point1 to Point2) + (Real((Custom value of (Picked unit))))) degrees)
                  • -------- NOTE 2: Change your SFX played HERE! --------
                  • Special Effect - Create a special effect at Point3 using Abilities\Spells\Undead\OrbOfDeath\AnnihilationMissile.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
              • Custom script: call RemoveLocation(udg_Point2)
              • Custom script: call RemoveLocation(udg_Point3)
          • -------- If it was time to play the closing SFX, increases Custom Value of Dummy Unit and resets the Timer of Loops --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LoopsForASFX2 Equal to PlaySFXInteger
            • Then - Actions
              • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 40)
              • Set LoopsForASFX2 = 0
              • Set Distance = (Distance - 50.00)
              • Hashtable - Save Distance as 5 of IDHandle in Hashtable
            • Else - Actions
          • -------- Updates the Loops made --------
          • Hashtable - Save LoopsForASFX2 as 4 of IDHandle in Hashtable
          • -------- Checks if it is time for last part of spell --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Distance Less than 0.00
            • Then - Actions
              • -------- If it is... --------
              • -------- Resets distance --------
              • Hashtable - Save 600.00 as 5 of IDHandle in Hashtable
              • -------- Creates an ending SFX on target --------
              • -------- NOTE 3: Change your ending SFX here --------
              • Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- Changes Dummy's Group from -Spin to -Return --------
              • Unit Group - Remove (Picked unit) from PenaltiesSpin
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (PenaltiesSpin is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (PenaltiesReturn is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn on Death Penalty Return <gen>
                • Else - Actions
              • Unit Group - Add (Picked unit) to PenaltiesReturn
            • Else - Actions
          • -------- Fixes the leak --------
          • Custom script: call RemoveLocation(udg_Point1)
  • Death Penalty Return
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in PenaltiesReturn and do (Actions)
        • Loop - Actions
          • -------- Stores Dummy's HandleID into variable --------
          • Set IDHandle = (Key (Picked unit))
          • -------- Loads the Duo --------
          • Set Target = (Load 0 of IDHandle in Hashtable)
          • Set Caster = (Load 1 of IDHandle in Hashtable)
          • -------- Loads the Number of Sins --------
          • Set SFXes = (Load 3 of IDHandle from Hashtable)
          • -------- Sets Speed of returning --------
          • -------- NOTE 1: Change your return speed here --------
          • Set Speed = 35.00
          • -------- Loads Sins' Distance to Target and reduces it by Speed --------
          • Set Distance = (Load 5 of IDHandle from Hashtable)
          • Set Distance = (Distance - Speed)
          • -------- Finds Target's Location --------
          • Set Point1 = (Position of Target)
          • -------- Moves all Sins --------
          • For each (Integer LoopVariable) from 1 to SFXes, do (Actions)
            • Loop - Actions
              • Set DummyUnit = (Load (5 + LoopVariable) of IDHandle in Hashtable)
              • Set Point2 = (Position of DummyUnit)
              • Set Point3 = (Point1 offset by Distance towards (Angle from Point1 to Point2) degrees)
              • Unit - Move DummyUnit instantly to Point3
              • Custom script: call RemoveLocation(udg_Point2)
              • Custom script: call RemoveLocation(udg_Point3)
          • -------- Checks if it is time to finish the spell --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Distance Less than or equal to 0.00
            • Then - Actions
              • -------- If it is... --------
              • -------- Kills all Sins --------
              • For each (Integer LoopVariable) from 1 to SFXes, do (Actions)
                • Loop - Actions
                  • Set DummyUnit = (Load (5 + LoopVariable) of IDHandle in Hashtable)
                  • Unit - Kill DummyUnit
              • -------- Creates an Impact SFX on target --------
              • -------- NOTE 2: Change your impact animation here --------
              • Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- Loads Damage-to-Deal and causes Caster to damage Target --------
              • Set Damage = (Load 2 of IDHandle from Hashtable)
              • Unit - Cause Caster to damage Target, dealing Damage damage of attack type Spells and damage type Normal
              • -------- Fixes the Dummy Unit and removes it from game --------
              • Hashtable - Clear all child hashtables of child IDHandle in Hashtable
              • Unit Group - Remove (Picked unit) from PenaltiesReturn
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (PenaltiesReturn is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
              • Unit - Remove (Picked unit) from the game
            • Else - Actions
              • -------- If not, updates the distance --------
              • Hashtable - Save Distance as 5 of IDHandle in Hashtable
          • -------- Fixes the Leak --------
          • Custom script: call RemoveLocation(udg_Point1)



v1.00 - First release


Keywords:
death, penalty, spin, double, attack, three-part
Contents

Death Penalty v1.00 (Map)

Reviews
12th Dec 2015 IcemanBo: For long time as NeedsFix. Rejected. Bribe: Recommend caching some variables before entering loops - (Owner of Caster) should be set to a variable (Could literally be simplified as (Triggering player)) Same with...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: For long time as NeedsFix. Rejected.

Bribe:

Recommend caching some variables before entering loops - (Owner of Caster) should be set to a variable (Could literally be simplified as (Triggering player))

Same with ((Current flying height of Target) + 70.00) - obviously this isn't going to change from within the loop, so qualify it before entering the loop so that you don't waste function calls & math.

In Death Penalty Spin, you should move "Custom script: call RemoveLocation(udg_Point3)" into the if-block where Point3 was set, in order to avoid "removing" a location which was already removed (null). This is a logical improvement and a slight efficiency improvement.

You are using custom value of units in this trigger as well, which conflicts with other systems that might use it. Please do everything in the hashtable (good) or get a GUI unit indexing system (great).

Maker:
Leaks here
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • LoopsForASFX2 Equal to PlaySFXInteger
    • Then - Actions
      • Set Point3 = (Point1 offset by Distance towards ((Angle from Point1 to Point2) + (Real((Custom value of (Picked unit))))) degrees)
      • -------- NOTE 2: Change your SFX played HERE! --------
      • Special Effect - Create a special effect at Point3 using Abilities\Spells\Undead\OrbOfDeath\AnnihilationMissile.mdl
      • Special Effect - Destroy (Last created special effect)
    • Else - Actions
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
The hashtable creating should have it's own trigger in the spell folder. Also set all configurable variables there, like SFxes and speeds. Don't set things in the looping triggers that should only be set once in a init trigger.
Rename the variables that are spesific for this spell, like the hashtable. Give them some prefix.
Combine the damage lines:
  • Set Damage = ((Max life of Target) x (0.10 + (0.05 x (Real((Level of Death Penalty for Caster))))))
  • Set Damage = (Damage / 2.00)
Angles array variable could be one non array variable. You don't need to use more than one index, thus an array should not be used.
You could use triggering player here instaed of owner of unit. One less function call.
  • Unit - Create 1 Dummy Unit for (Owner of Caster) at Point1 facing Default building facing degrees
I think the effects are too large. Make the radiuss which is 600, configurable.
The latter point3 removal line is in wrong place here:
  • For each (Integer LoopVariable) from 1 to SFXes, do (Actions)
    • Loop - Actions
      • Set DummyUnit = (Load (5 + LoopVariable) of IDHandle in Hashtable)
      • Set Point2 = (Position of DummyUnit)
      • Set Point3 = (Point1 offset by 600.00 towards ((Angle from Point1 to Point2) + Speed) degrees)
      • Unit - Move DummyUnit instantly to Point3
      • Custom script: call RemoveLocation(udg_Point3)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LoopsForASFX2 Equal to PlaySFXInteger
        • Then - Actions
          • Set Point3 = (Point1 offset by Distance towards ((Angle from Point1 to Point2) + (Real((Custom value of (Picked unit))))) degrees)
          • -------- NOTE 2: Change your SFX played HERE! --------
          • Special Effect - Create a special effect at Point3 using Abilities\Spells\Undead\OrbOfDeath\AnnihilationMissile.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Point2)
      • Custom script: call RemoveLocation(udg_Point3)


Overall the triggering is good, and the effects are nice. Although the idea is pretty basic, it's still well done. Good spell.
 
Top