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
890
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
890
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
890
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

      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