Triggered Spell Damage Help

MorbazanRhot

New Member
Reaction score
7
Hi, I wanted to see if anyone could help me with making an effect for a spell. Essentially what I want is for 10 seconds after casting a spell on a target unit, all the damage the target receives will be added up and then at the end of 10 seconds the target will take that much damage again (if my description is vague and you are familiar with the Witch Doctor in DOTA, I want something along the lines of the Maledict effect). My biggest problem with making this spell is that I don't know how to make it record the damage that is taken by the debuffed unit. Any help would be great, and easy +rep. Thanks in advance! :)
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
You have to have a trigger that you add the event (Target Unit of Ability Being Cast) Takes Damage. Then you could use the custom value of the unit and set it to the current custom value + (Damage Taken). Then at the end, you damage the unit for its custom value. Make sense?
 
D

Down

Guest
You would need 2 triggers
the first one would be

A unit is the target of a spell
Spell Equal to your spell
Set Varible Target of ablility being cast
Trigger add event - A unit takes damage Unit equal to (varible unit)

the other trigger would be
If/Then/Else
If Unit has buff :

then:set custom value of attacked unit equal to Custom value of damaged unit + event respond damage taken

else: deal damage to unit equal to custom value of damaged unit
Set custom value of damaged unit to 0
 

MorbazanRhot

New Member
Reaction score
7
To Ghan: Yes, I already understood the custom value way of executing the trigger, I just couldn't make an event that worked (because in specific unit events it would only let me select units), but by using the add event action I see that I can now use variables, which rocks. Thanks a lot.

To Down: Likewise, thank you for showing me the add event action that allows me to have an event that works properly for this trigger, however your description of the trigger is a little fuzzy to me, so...

To Both of you: I think I'd do it like Down says, with 2 triggers, however I'm not completely sure on how to make them work. The first trigger would go like this I think?
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to <The Ability>
Actions
[If:
<Variable Boolean 2> = to OFF
Then:
Add Event <Variable Unit> Takes Damage to Other Trigger
Else:
Nothing]
Set <Varaible Unit> = to the target unit of ability being cast
Set <Variable Boolean> = ON
Wait 10 seconds
Set <Variable Boolean> = OFF
Damage <Variable Unit> dealing <Custom Value of Variable Unit>
Wait 1 second
Set <Custom Value of Variable Unit> = to 0
Set <Variable Boolean 2> = ON (I added this here and the IF/THEN/ELSE earlier to prevent the trigger from adding the event to the other trigger multiple times and potentially making it run more times than it should)

Now I should add that event to another trigger I've already made that previously would have no events, right? Something like this?
Events
Conditions
<Varaible Boolean> = ON
Actions
Set <Custom Value of Variable Unit> = to <Custom Value of Variable Unit> + Damage Taken

Edit: And this spell will not be multi-instanced so the waits don't cause a problem in that regard.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
That looks like it should work.
 

MorbazanRhot

New Member
Reaction score
7
Alright, well I tried implementing the triggers into my map and testing and it isn't working, first I'll give you my triggers then I'll explain what's happening:

Trigger 1:
Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        (random Greater than or equal to 76) and (random Less than or equal to 100)
    Then - Actions
        [If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                DecimateSpecial2 Equal to False
            Then - Actions
                Trigger - Add to Decimate Damage Counter <gen> the event (Unit - DecimateUnit Takes damage)
            Else - Actions]
        Set DecimateSpecial1 = True
        Special Effect - Create a special effect attached to the chest of DecimateUnit using Abilities\Spells\Other\HowlOfTerror\HowlTarget.mdl
        Set DecimateSFX = (Last created special effect)
        Wait 5.00 seconds
        Set DecimateSpecial1 = False
        Unit - Cause TheNecro to damage DecimateUnit, dealing (Real((Custom value of DecimateUnit))) damage of attack type Spells and damage type Death
        Special Effect - Create a special effect attached to the overhead of DecimateUnit using Abilities\Spells\Other\HowlOfTerror\HowlCaster.mdl
        Floating Text - Create floating text that reads (String((Custom value of DecimateUnit))) above DecimateUnit with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 20.00 towards 90.00 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
        Special Effect - Destroy DecimateSFX
        Wait 1.00 seconds
        Set DecimateSpecial2 = True
        Unit - Set the custom value of DecimateUnit to 0
    Else - Actions

Code:
Trigger 2:
    Events
    Conditions
        DecimateSpecial1 Equal to True
    Actions
        Unit - Set the custom value of DecimateUnit to ((Custom value of DecimateUnit) + (Integer((Damage taken))))

Alright, first of all, the reason the first trigger begins like that is because it's actually part of a larger trigger and I didn't want to list the whole thing because it'd be a long read and I don't think it's really relevant. Needless to say when the spell is cast the target unit gets set as the variable. I know it's not a problem with getting the unit right, because the special effects always work and the floating text always reads "0". Therefore I've reasoned that the problem must be related to recording the damage taken or reproducing it. Any help whatsoever would be great and as always +rep.

edit: Sorry, thought I did that this time, guess it was just last time, and I'll gladly upload my map but right now I'm practically falling asleep at my desk so I'm gonna call it a night, when I wake up tomorrow morning if this wasn't enough to figure it out then I'll upload the map. Thanks again.
 

MorbazanRhot

New Member
Reaction score
7
Sorry, not to needlessly bump my own post, but I really can't find the problem with the triggers given that I don't have much experience with this area of triggering, so could anyone at all please help? Thanks in advance.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
It's hard to see what you If functions look like because you didn't use
Code:
 tags around your text. Could you either do that or upload your map? (Maybe both. :P  )
 

MorbazanRhot

New Member
Reaction score
7
Alright, well I updated the text hopefully making it more readable, and I tried uploading my map but it's 800 KB too big, so... if you still need to see the map just either post or message me with your email address and I'll send it to you directly. Thanks again and to anyone else who could help me with this.
 

CrazyImpling

New Member
Reaction score
3
ninja_impling.gif
Well, if I understood any of this right, I think I can help. First, you would need a variable that keeps track of all the damage. Second, you would need to use a function that gets the target units health before and after the spell is cast. Then you just subtract Before-After and add that to the damage. I think it happens to be this line in your code:
Unit - Set the custom value of DecimateUnit to ((Custom value of DecimateUnit) + (Integer((Damage taken))))
Isn't the custom value used as a point system or something? Good luck!​
ninja_impling.gif
"You dare to catch me?"
 

MorbazanRhot

New Member
Reaction score
7
First off, yeah the custom value is used as a point system that's tied to an individual unit, so it should work the same as a variable, but I'll give doing it as a variable a try and see if it fixes anything. The problem with doing the whole (before-after) = damage taken is that if the target were to get healed during the debuff time it would say it had taken that much less damage when it actually had taken more.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top