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

Eternal Purge - DPS/Slow v2

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Eternal Purge:
Slows the units movement speed greatly for 0.5 seconds and deals 25 damage initially and causes the unit to bleed dealing damage according to the amount of hit points missing.
Deals 3 damage per 1% hit points missing, per second for 6 seconds. After the slow duration these units are taunted. forcing them to attack the caster for the duration. Attacks only deal 50% damage whilest taunted.
Can be cast on multiple enemies, does not stack on single target. Overwrites previous cast.
  • hashtable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set EP_Hash = (Last created hashtable)
  • purge cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Eternal Purge
    • Actions
      • Hashtable - Save Handle Of(Triggering unit) as (Key (Target unit of ability being cast)) of 0 in EP_Hash
      • Hashtable - Save 12 as (Key (Target unit of ability being cast)) of 1 in EP_Hash
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 25.00 damage of attack type Spells and damage type Magic
      • Unit - Order (Target unit of ability being cast) to Stop
      • Unit Group - Add (Target unit of ability being cast) to EP_UnitGroup
      • Trigger - Turn on purge dps <gen>
  • purge dps
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in EP_UnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load (Key (Picked unit)) of 1 from EP_Hash) Greater than 0
            • Then - Actions
              • Unit - Cause (Load (Key (Picked unit)) of 0 in EP_Hash) to damage (Picked unit), dealing ((100.00 - (Percentage life of (Picked unit))) x 1.50) damage of attack type Spells and damage type Magic
              • Hashtable - Save ((Load (Key (Picked unit)) of 1 from EP_Hash) - 1) as (Key (Picked unit)) of 1 in EP_Hash
              • Unit - Order (Picked unit) to Attack (Load (Key (Picked unit)) of 0 in EP_Hash)
            • Else - Actions
              • Unit Group - Remove (Picked unit) from EP_UnitGroup
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in EP_Hash
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in EP_UnitGroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • disable issues
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
      • ((Triggering unit) is in EP_UnitGroup) Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Order (Triggering unit) to Stop
      • Unit - Order (Triggering unit) to Attack (Load (Key (Picked unit)) of 0 in EP_Hash)
      • Trigger - Turn on (This trigger)
  • reducing damage
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (GDD_DamageSource is in EP_UnitGroup) Equal to True
    • Actions
      • Unit - Set life of GDD_DamagedUnit to ((Life of GDD_DamagedUnit) + (GDD_Damage / 2.00))
      • Set Temp_Point = (Position of GDD_DamagedUnit)
      • Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation (udg_Temp_Point)
Basically you cast purge on a unit, deals a small initial damage (in this case 25)
Then for the next 6 seconds, the target takes 3x percentage missing hp in damage.
(Note! It does not do that amount missing x3, but merely the % x3 - eg: on 75% hp, deals 25 x 3 = 75 damage)

However the next count will be updated amount of damage, therefore there shall be no constant damage dealt.

After purge slowing/stunning will then taunt the unit. Forcing it to attack for the duration of the dps. Whilest taunted attacks will deal 50% damage.

This spell makes use of Hashtables, and is easy to adjust or add.
It is MUI and GUi.
However it shall not stack apon itself (i can do this if anyone wants), instead it resets the timer/count.

I think it's leakless, but I am semi-new with Hashtables so I may have made a mistake.
Please comment critically and give suggestions. Thank you.

Keywords:
Pudge, DPS, Slow, per second, damage per second, missing hp, missing health, dps of missing hp
Contents

Eternal Purge - DPS/slow (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 19 Dec 2011 Bribe: Why are you forcing the unit to constantly be attacking? The taunt doesn't make sense. Well if you are going to keep it delete the "prevent orders" trigger because telling...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

19 Dec 2011
Bribe: Why are you forcing the unit to constantly be attacking? The taunt doesn't make sense. Well if you are going to keep it delete the "prevent orders" trigger because telling it to attack every 0.5 seconds is enough.

You should only check if the group is empty after removing a unit from the group.

You should add some comments to your code and tell people how to configure it. for example I can tell that the "12" integer keeps the buff going for 6 seconds, however you should allow it to be easily modified based on something like the ability level, for example.

The spell is way too simple to get approved. You need to add more stuff. Currently someone could easily make this in just object editor.
 
Level 4
Joined
Dec 14, 2011
Messages
61
lol i got bored and did this in 10 mins :p

felt like posting it here lmao.

*Set the hashtable into a variable, use the variable instead of last created hashtable
isnt that fairly obvious if somebody wants to use it?
Then they can use their own hashtable and edit it in.

*The looping trigger shoudn't be always on
yeah read the moderators comment.

*You should flush the child hashtables
kay, i need to learn that :/

Thank you tho.

--

EDIT: Fair point on the Unit Group, will edit and re-post. ty.
 
Level 4
Joined
Dec 14, 2011
Messages
61
done, will upload in a sec.

yeah not quite sure what the codes are here. Sorry about that, just took a guess at 'code' tags. [wc3] did not work :p

--

EDIT: Are there any leaks?

Currently someone could easily make this in just object editor.
I'm quite sure this is not possible to make in the OE. :/

Unless there is some hidden spell that I don't know of. I can't think of anything that uses % missing hp. :?

--

EDIT2:

Is this the correct use of Flushing Child Hashtables?
Kindof like clearing leaks? Not entirely sure..

  • purge dps
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in EP_UnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load (Key (Picked unit)) of 1 from EP_Hash) Greater than 0
            • Then - Actions
              • Unit - Cause (Load (Key (Picked unit)) of 0 in EP_Hash) to damage (Picked unit), dealing ((100.00 - (Percentage life of (Picked unit))) x 3.00) damage of attack type Spells and damage type Magic
              • Hashtable - Save ((Load (Key (Picked unit)) of 1 from EP_Hash) - 1) as (Key (Picked unit)) of 1 in EP_Hash
            • Else - Actions
              • Unit Group - Remove (Picked unit) from EP_UnitGroup
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in EP_Hash <---
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in EP_UnitGroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Level 4
Joined
Dec 14, 2011
Messages
61
u should prob spend more time on your spells if u want approval

blah blah blah, i lack creativity. And i only recently learned hashtables, and wanted to post here to see if I was doing everything correctly.

Besides the best way to learn is to try make things, learn from your mistakes etc.

And I learned something about flushingg child hashtables. So it's never a loss.

Only question I have left, (aimed at one of the mods) Should I remove this thread?
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
Well if you have an idea that you want constructive criticism on you can share your code/thoughts in the Triggers & Scripts forum: http://www.hiveworkshop.com/forums/triggers-scripts-269/. Typically the Spells section is for finished or mostly finished work and not so much for asking for advice how to make it better.

You don't have to delete your spell. Spells are only soft-deleted anyway, meaning they stay on the server whether or not it was deleted. I can put this in the "Rejected" category if you have no plans to update it, and if you do update it or plan to I can change its status then.
 
Top