Voodoo Drain v1.1

This bundle is marked as approved. It works and satisfies the submission rules.
The outcome of another 3 day weekend, I present to you: Voodoo Drain

It's basically Terrorblade's old life drain skill, but it looks sexier and it has a chain break effect! How snazzy!

Magically links to another unit, draining life per second as long as they are within 550 range of each other. If the link is broken, both units will suffer damage and lose mana.

  • Set Up
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set voodohash = (Last created hashtable)
      • -------- Declaring variables --------
      • -------- Amount drained per 0.03 seconds. --------
      • Set voodoodps[1] = 1.00
      • Set voodoodps[2] = 2.00
      • Set voodoodps[3] = 3.00
      • -------- Duration --------
      • Set voodooduration[1] = 4.00
      • Set voodooduration[2] = 5.00
      • Set voodooduration[3] = 6.00
      • -------- Leash Range --------
      • Set leashrange[1] = 550.00
      • Set leashrange[2] = 550.00
      • Set leashrange[3] = 550.00
      • -------- Lightning Type --------
      • Set lightningtype = Forked Lightning
      • -------- Lightning Coloring (R, G, B, ALPHA) --------
      • -------- Use values between 0 and 1 --------
      • Set lightningcoloring[1] = 1.00
      • Set lightningcoloring[2] = 0.00
      • Set lightningcoloring[3] = 1.00
      • Set lightningcoloring[4] = 1.00
      • -------- Leash Break --------
      • Set leashbreakdamage = True
      • -------- Leash Break Damage --------
      • Set voodoobreakdamage[1] = 200.00
      • Set voodoobreakdamage[2] = 300.00
      • Set voodoobreakdamage[3] = 400.00
      • -------- Leash Break SFX --------
      • Set sfx = Abilities\Spells\Undead\DeathPact\DeathPactTarget.mdl
      • -------- Leash Break SFX Attachment Point --------
      • Set attachmentpoint = chest
      • -------- Lesh Break Manaburn --------
      • -------- Will only work if Leash Break = true --------
      • Set leashbreakmanaburn = True
      • -------- Percentage of damage as manaburn --------
      • Set voodooburnpercent[1] = 0.75
      • Set voodooburnpercent[2] = 0.75
      • Set voodooburnpercent[3] = 0.75
  • Voodoo Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Voodoo Drain
    • Actions
      • -------- Setting variables --------
      • Set caster = (Triggering unit)
      • Set target = (Target unit of ability being cast)
      • Set level = (Level of Voodoo Drain for caster)
      • Set point1 = (Position of caster)
      • Set point2 = (Position of target)
      • Set timer = voodooduration[level]
      • Custom script: set udg_handle = GetHandleId(udg_caster)
      • -------- To prevent the spell from overriding itself we flush the values. It can only have 1 instance of a link going at a time or it will bug. --------
      • Lightning - Destroy (Load 4 of handle in voodohash)
      • Hashtable - Clear all child hashtables of child handle in voodohash
      • -------- Creating the lightning. Feel free to change the color --------
      • Custom script: set udg_lightning = AddLightningEx(udg_lightningtype, true, GetUnitX(udg_caster), GetUnitY(udg_caster), GetUnitFlyHeight(udg_caster), GetUnitX(udg_target), GetUnitY(udg_target), GetLocationZ(udg_point2) + GetUnitFlyHeight(udg_target))
      • Lightning - Change color of lightning to (lightningcoloring[1] lightningcoloring[2] lightningcoloring[3]) with lightningcoloring[4] alpha
      • Unit Group - Add caster to voodoogroup
      • Trigger - Turn on Voodoo Loop <gen>
      • Hashtable - Save Handle Oftarget as 1 of handle in voodohash
      • Hashtable - Save level as 2 of handle in voodohash
      • Hashtable - Save timer as 3 of handle in voodohash
      • Hashtable - Save Handle Oflightning as 4 of handle in voodohash
      • Custom script: call RemoveLocation(udg_point1)
      • Custom script: call RemoveLocation(udg_point2)
  • Voodoo Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in voodoogroup and do (Actions)
        • Loop - Actions
          • Set caster = (Picked unit)
          • Custom script: set udg_handle = GetHandleId(udg_caster)
          • Set timer = (Load 3 of handle from voodohash)
          • Set lightning = (Load 4 of handle in voodohash)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (timer Greater than 0.00) and (((caster is alive) Equal to True) and ((target is alive) Equal to True))
            • Then - Actions
              • Set target = (Load 1 of handle in voodohash)
              • Set level = (Load 2 of handle from voodohash)
              • Set point1 = (Position of caster)
              • Set point2 = (Position of target)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between point1 and point2) Less than or equal to leashrange[level]
                • Then - Actions
                  • Unit - Set life of caster to ((Life of caster) + voodoodps[level])
                  • Unit - Cause caster to damage target, dealing voodoodps[level] damage of attack type Spells and damage type Universal
                  • Custom script: call MoveLightningEx(udg_lightning, true, GetUnitX(udg_caster), GetUnitY(udg_caster), GetUnitFlyHeight(udg_caster), GetUnitX(udg_target), GetUnitY(udg_target), GetLocationZ(udg_point2) + GetUnitFlyHeight(udg_target))
                  • Hashtable - Save (timer - 0.03) as 3 of handle in voodohash
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • leashbreakdamage Equal to True
                    • Then - Actions
                      • Unit - Cause caster to damage target, dealing voodoobreakdamage[level] damage of attack type Spells and damage type Universal
                      • Unit - Cause target to damage caster, dealing voodoobreakdamage[level] damage of attack type Spells and damage type Universal
                      • Special Effect - Create a special effect attached to the attachmentpoint of caster using sfx
                      • Special Effect - Create a special effect attached to the attachmentpoint of target using sfx
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • leashbreakmanaburn Equal to True
                        • Then - Actions
                          • Unit - Set mana of caster to ((Mana of caster) - (voodoobreakdamage[level] x voodooburnpercent[level]))
                          • Unit - Set mana of target to ((Mana of target) - (voodoobreakdamage[level] x voodooburnpercent[level]))
                        • Else - Actions
                    • Else - Actions
                  • Lightning - Destroy lightning
                  • Hashtable - Clear all child hashtables of child handle in voodohash
                  • Unit Group - Remove caster from voodoogroup
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in voodoogroup) Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
              • Custom script: call RemoveLocation(udg_point1)
              • Custom script: call RemoveLocation(udg_point2)
            • Else - Actions
              • Lightning - Destroy lightning
              • Hashtable - Clear all child hashtables of child handle in voodohash
              • Unit Group - Remove caster from voodoogroup
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in voodoogroup) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
As always credits go to Jazztastic.

Keywords:
voodoo, drain, voodoo drain, lasers, orc, legit, swag, life, life drain, #yolo, swaggasaurus rex, fort swagner, brofessor, broseidon, bro
Contents

Just another Warcraft III map (Map)

Reviews
02:28, 14th Oct 2012 Magtheridon96: Approved. You're one of the 3 or 4 people who get it right on the first upload ;) The concept is cool, as it's not just another "DIE DSFBHDS PEW PEW LFDSHD DIE" spell, but something that involves a mighty...

Moderator

M

Moderator

02:28, 14th Oct 2012
Magtheridon96: Approved.
You're one of the 3 or 4 people who get it right on the first upload ;)

The concept is cool, as it's not just another "DIE DSFBHDS PEW PEW LFDSHD DIE" spell, but something that involves a mighty gambit.

Tip:
- The "chest" attachment point string can be a configurable too ^_^

edit
Other tip:
- You can move that block of code that checks if you can turn off the looping trigger to the end of the trigger (outside the Enumeration block) so you wouldn't have to repeat it twice in your code. Nevermind ;_;
 
Level 7
Joined
Sep 2, 2011
Messages
355
Haven't tested the map yet but based on the description, I'm loving the simplicity already. Good job!
 
Level 16
Joined
Apr 4, 2011
Messages
997
Really nice spell I gotta say.

I tested the spell and found that if the target the link is attatched to dies while the link effect is still going on, you will recive damage even though the link wasn't broken.

Apart from that, very good job!

That's a very good find and also an easy fix. I have to update this to add more versatility to the effects so I can fix this pretty easy, but like I said a very good find thank you.

EDIT: Fixed up the stuff, it should work without that bug now. I also added a manaburn effect that works off of percentage of damage dealt (of course subtractable if you don't want). I also fixed up the aesthetics to make it easier to modify, it now includes the attachment point for the special effect, as well as all the lightning coloring.
 
Last edited:
Level 16
Joined
Apr 4, 2011
Messages
997
jazztastic, maggy and bribe maybe?

btw, when I saw the pic I was like "not another drain please"...

after seeing it, it was a really nice piece of spell you got...

btw, can you possibly give it either like a chain-lightning or a forked lightning style?

Lol I know there are so many drain spellllllsssss I just had to make my own.

Yeah the lightning style is configurable. I'm using forked lightning as the type and just changing the colors to get that weird purple.
 
I mean chain-lightning or forked lightning style in a sense of the mechanics... like a chain drain, or a multi-target drain... :)

you'd just need to rework the way you use the hashes, maybe use indexes instead of unit handle and whatever in order to make the chain/fork possibility [because you can't when you're using the unit's handle as the parent, essentially locking it to one instance per unit]... or maybe try making it in vJASS... XD
 
Level 16
Joined
Apr 4, 2011
Messages
997
I mean chain-lightning or forked lightning style in a sense of the mechanics... like a chain drain, or a multi-target drain... :)

you'd just need to rework the way you use the hashes, maybe use indexes instead of unit handle and whatever in order to make the chain/fork possibility [because you can't when you're using the unit's handle as the parent, essentially locking it to one instance per unit]... or maybe try making it in vJASS... XD

Oh my lord you've given me my next idea. Chain drain.
 
I mean chain-lightning or forked lightning style in a sense of the mechanics... like a chain drain, or a multi-target drain... :)

you'd just need to rework the way you use the hashes, maybe use indexes instead of unit handle and whatever in order to make the chain/fork possibility [because you can't when you're using the unit's handle as the parent, essentially locking it to one instance per unit]... or maybe try making it in vJASS... XD

Jazztastic may be cool, but something like that would be Jizztastic.
 
Level 16
Joined
Apr 4, 2011
Messages
997
Fork, yeah...

but chain, well at least not for us... :)

I guess it would really be useful for the normal people of The Hive if you create a chain... :)

Adiktuz I don't really think it's beyond you. If anything you're a far more experienced coder than I.

I've rationalized how I'm going to do it and I don't believe it would be that hard to do. I'm going to have to look at how chain lightning acts a bit before I make it.
 
Level 4
Joined
Sep 6, 2012
Messages
88
Hi, is there any tutorial explaining about how to use this system ? I think there's no explanation in the map.

Thanks a lot !

Edit: Hi again, I was able to make the spell work. However there's this slight problem. The effect works nicely for units on the ground for me. However, for units standing on higher grounds (like in the screenshot), the effect position is incorrect. How can I fix this ? Thanks a lot.

Untitled-3.png
 
Last edited:
Level 16
Joined
Apr 4, 2011
Messages
997
The way the code is set up auto-detects the height of the caster and should automatically attach it correctly. Did you edit the code at all? That could cause this bug.

In order to get this to work properly, copy paste the entire trigger folder, after copy pasting the ability. It should work correctly.
 
Level 4
Joined
Sep 6, 2012
Messages
88
Hi Jazztastic,

I tried to re-confirm the problem by testing directly from your original map. These are the results:

Untitled1.png


Untitled.png


As you can see, the problem also exists in the first screenshot. The unit with incorrect effect positioning was the caster. When I tried to reverse the role, the effects look much better.

From these examples, I've come to the conclusion that when the caster is on a higher ground than the target, somehow the effect went wrong and got misplaced. Can you test the map and help me with this ?

Thank you very much !
 
Level 16
Joined
Apr 4, 2011
Messages
997
find this line

  • Custom script: set udg_lightning = AddLightningEx(udg_lightningtype, true, GetUnitX(udg_caster), GetUnitY(udg_caster), GetUnitFlyHeight(udg_caster), GetUnitX(udg_target), GetUnitY(udg_target), GetLocationZ(udg_point2) + GetUnitFlyHeight(udg_target))
change it to this

  • Custom script: set udg_lightning = AddLightningEx(udg_lightningtype, true, GetUnitX(udg_caster), GetUnitY(udg_caster), GetLocationZ(udg_point1) + GetUnitFlyHeight(udg_caster), GetUnitX(udg_target), GetUnitY(udg_target), GetLocationZ(udg_point2) + GetUnitFlyHeight(udg_target))
  • ------
Inside the looping trigger change this

  • Custom script: call MoveLightningEx(udg_lightning, true, GetUnitX(udg_caster), GetUnitY(udg_caster), GetUnitFlyHeight(udg_caster), GetUnitX(udg_target), GetUnitY(udg_target), GetLocationZ(udg_point2) + GetUnitFlyHeight(udg_target))
to this

  • Custom script: call MoveLightningEx(udg_lightning, true, GetUnitX(udg_caster), GetUnitY(udg_caster), GetLocationZ(udg_point1) + GetUnitFlyHeight(udg_caster), GetUnitX(udg_target), GetUnitY(udg_target), GetLocationZ(udg_point2) + GetUnitFlyHeight(udg_target))
That will solve your problem, before it wasn't detecting the ground heighth of the caster only the flying heighth.
 
Level 4
Joined
Sep 6, 2012
Messages
88
Hi Jazztastic,

Thanks for the reply ! I tried to fix things as you said. However, whenever I try to change this line

  • set udg_lightning = AddLightningEx(udg_lightningtype, true, GetUnitX(udg_caster), GetUnitY(udg_caster), GetUnitFlyHeight(udg_caster), GetUnitX(udg_target), GetUnitY(udg_target), GetLocationZ(udg_point2) + GetUnitFlyHeight(udg_target))
the World Editor crashes...

Do you know why ?
 
Top