Spellpack Hero: Leecher

duyen

New Member
Reaction score
214
Thanks to the mod who cleaned up all the spam.

Can't post all screenies sorry, but heres the spells.

Touch of Death

Code:
Creates a void at the a point, dealing 50/100/150/200 damage to all surrounding units.


Touch of Death
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Touch of Death 
    Actions
        Set Temp_TOD_Caster = (Triggering unit)
        Set TOD_Level = (Level of Touch of Death  for Temp_TOD_Caster)
        Set Temp_TOD_CasterPoint = (Position of Temp_TOD_Caster)
        Set Temp_TOD_CasterTarget = (Target point of ability being cast)
        Lightning - Create a Drain Life lightning effect from source Temp_TOD_CasterPoint to target Temp_TOD_CasterTarget
        Set TOD_Lightning = (Last created lightning effect)
        Special Effect - Create a special effect at Temp_TOD_CasterTarget using Abilities\Spells\Other\Charm\CharmTarget.mdl
        Unit Group - Pick every unit in (Units within 100.00 of Temp_TOD_CasterTarget) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        TOD_Level Equal to 1
                    Then - Actions
                        Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 50.00)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        TOD_Level Equal to 2
                    Then - Actions
                        Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 100.00)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        TOD_Level Equal to 3
                    Then - Actions
                        Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 150.00)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                TOD_Level Equal to 4
                            Then - Actions
                                Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 200.00)
                            Else - Actions
                                Do nothing
        Wait 2.00 seconds
        Custom script:   call RemoveLocation (udg_Temp_TOD_CasterPoint)
        Custom script:   call RemoveLocation (udg_Temp_TOD_CasterTarget)
        Lightning - Destroy TOD_Lightning

Drain Life

drainlifescreenielz0.png


Code:
Creates a connection between the Leecher and up to 3 enemies letting the Leecher suck the life out of a unit. Level 1 - 85 damage per unit and life gained. Level 2 - 160 damage per unit and life gained. Level 3 - 250 damage per unit and life gained. Level 4 - 325 damage per unit and life gained.

Drain Life
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Drain Life 
    Actions
        Set DL_Level = (Level of Drain Life  for (Triggering unit))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                DL_Level Equal to 1
            Then - Actions
                Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 85.00)
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        DL_Level Equal to 2
                    Then - Actions
                        Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 160.00)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                DL_Level Equal to 3
                            Then - Actions
                                Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 250.00)
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        DL_Level Equal to 4
                                    Then - Actions
                                        Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 325.00)
                                    Else - Actions
                                        Do nothing
Sleep (Blizzard Spell)

Code:
Puts a target enemy unit to sleep. A sleeping unit can be awoken by attacking it. Level 1 - 20 second sleep for 100 mana. Level 2 - 40 second sleep for 75 mana. Level 3 - 60 second sleep for 50 mana. Level 4 - 80 second sleep for 25 mana.
Death (Ultimate)

Code:
Causes rains of death to pour down in a large area, killing enemy units for 40 hit points per second. Lasts 45 seconds.
 

Naminator

Coming Back To Life
Reaction score
76
That group you can set that as a variable and destroy like this: The red letters are the group variable.

Code:
Touch of Death
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Touch of Death 
    Actions
        Set Temp_TOD_Caster = (Triggering unit)
        Set TOD_Level = (Level of Touch of Death  for Temp_TOD_Caster)
        Set Temp_TOD_CasterPoint = (Position of Temp_TOD_Caster)
        Set Temp_TOD_CasterTarget = (Target point of ability being cast)
        [COLOR="Red"]Set Group_TOD = (Units within 100.00 of Tempo_TOD_CasterTarget) Matching condition..(Is an enemy or whatever you want.)[/COLOR]
        Lightning - Create a Drain Life lightning effect from source Temp_TOD_CasterPoint to target Temp_TOD_CasterTarget
        Set TOD_Lightning = (Last created lightning effect)
        Special Effect - Create a special effect at Temp_TOD_CasterTarget using Abilities\Spells\Other\Charm\CharmTarget.mdl
        Unit Group - Pick every unit in [B](Units within 100.00 of Temp_TOD_CasterTarget)[/B] and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        TOD_Level Equal to 1
                    Then - Actions
                        Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 50.00)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        TOD_Level Equal to 2
                    Then - Actions
                        Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 100.00)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        TOD_Level Equal to 3
                    Then - Actions
                        Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 150.00)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                TOD_Level Equal to 4
                            Then - Actions
                                Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 200.00)
                            Else - Actions
                                Do nothing
        Wait 2.00 seconds
        Custom script:   call RemoveLocation (udg_Temp_TOD_CasterPoint)
        Custom script:   call RemoveLocation (udg_Temp_TOD_CasterTarget)
        [COLOR="Red"]Custom script:   call DestroyGroup (udg_Group_TOD)[/COLOR]
        Lightning - Destroy TOD_Lightning
 

H34DhUnT3r

Ultra Cool Member
Reaction score
36
~Gals~, READ!

Tysm

(Thank you so much)

And for the spells

why is it everywhere:
Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        TOD_Level Equal to 1
                    Then - Actions
                        Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 50.00)
                    Else - Actions
and not with "for each integer"?
 

Tinki3

Special Member
Reaction score
418
Touch of Death

Please take a look at the text in bold:
Code:
Touch of Death
    Events
        [B]Unit - A unit Begins casting an ability[/B]
    Conditions
        (Ability being cast) Equal to Touch of Death 
    Actions
        Set Temp_TOD_Caster = (Triggering unit)
        Set TOD_Level = (Level of Touch of Death  for Temp_TOD_Caster)
        Set Temp_TOD_CasterPoint = (Position of Temp_TOD_Caster)
        Set Temp_TOD_CasterTarget = (Target point of ability being cast)
        Lightning - Create a Drain Life lightning effect from source Temp_TOD_CasterPoint to target Temp_TOD_CasterTarget
        Set TOD_Lightning = (Last created lightning effect)
        [B]Special Effect - Create a special effect at Temp_TOD_CasterTarget using Abilities\Spells\Other\Charm\CharmTarget.mdl[/B]
        [B]Unit Group - Pick every unit in (Units within 100.00 of Temp_TOD_CasterTarget) and do (Actions)[/B]
            Loop - Actions
                [B]If (All Conditions are True) then do (Then Actions) else do (Else Actions)[/B]
                    If - Conditions
                        TOD_Level Equal to 1
                    Then - Actions
                        [B]Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 50.00)[/B]
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        TOD_Level Equal to 2
                    Then - Actions
                        Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 100.00)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        TOD_Level Equal to 3
                    Then - Actions
                        Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 150.00)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                TOD_Level Equal to 4
                            Then - Actions
                                Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 200.00)
                            Else - Actions
                                [B]Do nothing[/B]
        Wait 2.00 seconds
        Custom script:   call RemoveLocation (udg_Temp_TOD_CasterPoint)
        Custom script:   call RemoveLocation (udg_Temp_TOD_CasterTarget)
        Lightning - Destroy TOD_Lightning
Unit - A unit Begins casting an ability -> We use "Unit - A unit Starts the effect of an ability" here.
For the simple reason that mana has already been used and cooldown has started. Begins happens before mana/cooldown.
On communal maps, or some minor b.net lag, it's almost always possible to cancel
the spell before you use any mana, but you still get the effect from the trigger,
which is rigged, basically imba, and most of all, not wanted.

Special Effect - Create a special effect at Temp_TOD_CasterTarget using.. -> This line leaks a special effect.
All it needs, is a "Special Effect - Destroy (Last created special effect)" line directly afterwards.

Unit Group - Pick every unit in (Units within 100.00 of Temp_TOD_CasterTarget) -> This line leaks a unit group.
Add a Custom Script containing, "set bj_wantDestroyGroup = true" directly
before that action. That way, it's destroyed after use, which is what we want.

If (All Conditions are True) then do (Then Actions) else do (Else Actions) -> This big, messy, ugly, bulging mass of "Ifs" and "Elses" really
is not needed. I'll explain how to remove it further forward.

Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 50.00) -> Setting the life of units to damage them is not "right" - its wrong :).
The caster will not gain bounty or exp from the units that it "killed" with the spell. Use the "Unit - Damage Target" action - that will award those things.

Do nothing -> You don't need to fill up that extra space with a Do nothing
action - it's doing nothing anyway! It's a function defined in Blizzard.j:
JASS:
function DoNothing takes nothing returns nothing
endfunction

As you can see... it's not doing much.
Basically, you waste time on a function call that adds no value.

Now, we can come back to the messy bunch of "Ifs" and "Elses" :)
Delete them all, and simply add a "Unit - Cause Temp_TOD_Caster to damage (Picked unit), dealing (50.00 x (Real(TOD_Level))) damage of attack type Spells and damage type Normal" line instead.

It does the same thing, but saves all those lines, and makes your code look
more efficient. Not to mention it is more efficient. Much more efficient.
You should use formulas like the one I showed you above in future.

Your optimized/leakless trigger:
Code:
Touch of Death Fixed
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Touch of Death 
    Actions
        Set Temp_TOD_Caster = (Triggering unit)
        Set TOD_Level = (Level of Touch of Death  for Temp_TOD_Caster)
        Set Temp_TOD_CasterPoint = (Position of Temp_TOD_Caster)
        Set Temp_TOD_CasterTarget = (Target point of ability being cast)
        Lightning - Create a Drain Life lightning effect from source Temp_TOD_CasterPoint to target Temp_TOD_CasterTarget
        Set TOD_Lightning = (Last created lightning effect)
        Special Effect - Create a special effect at Temp_TOD_CasterTarget using Abilities\Spells\Other\Charm\CharmTarget.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script:   set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units within 100.00 of Temp_TOD_CasterTarget) and do (Actions)
            Loop - Actions
                Unit - Cause Temp_TOD_Caster to damage (Picked unit), dealing (50.00 x (Real(TOD_Level))) damage of attack type Spells and damage type Normal
                [COLOR="Green"]//You could also add SFX to the picked units here[/COLOR]
        Wait 2.00 seconds
        Custom script:   call RemoveLocation (udg_Temp_TOD_CasterPoint)
        Custom script:   call RemoveLocation (udg_Temp_TOD_CasterTarget)
        Lightning - Destroy TOD_Lightning

Drain Life

Again, the big bunch of Ifs and Elses aren't needed.
Instead, a single variable with an array size of 1 can do the trick.

Your whole trigger can be simplified down to this:
Code:
Drain Life
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Drain Life 
    Actions
        Set DL_Amount[1] = 85.00
        Set DL_Amount[2] = 160.00
        Set DL_Amount[3] = 250.00
        Set DL_Amount[4] = 325.00
        Set DL_Level = (Level of Drain Life  for (Triggering unit))
        Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + DL_Amount[DL_Level])
Which makes me wonder.. "is it worth it"?
I've also already made a life drain spell very similar. Find it here.
 

duyen

New Member
Reaction score
214
Now, we can come back to the messy bunch of "Ifs" and "Elses"
Delete them all, and simply add a "Unit - Cause Temp_TOD_Caster to damage (Picked unit), dealing (50.00 x (Real(TOD_Level))) damage of attack type Spells and damage type Normal" line instead.

I tried that, wouldn't let me add Reals.
 

emjlr3

Change can be a good thing
Reaction score
395
graveyarded due to lack of an update
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top