• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Triggered Ignite Spell

Level 28
Joined
Dec 3, 2020
Messages
971
Greetings hive, I need help once more...

I want to make an Ignite spell which uses Faerie Fire as a base spell. Upon being cast, the targeted unit will take damage over time and be slowed.
I am using the neutral hostile Rejuvenation for the damage over time (with negative values for heal) and the Sorceress' Slow for the slow.

But it's not working as intended, when I use it the 1st time nothing happens, then when another unit uses the faerie fire ability, one of my own units gets affected with the Slow.

Any way to fix it?

Screenshots below:
1722331964582.png

1722331989217.png

1722332009041.png

1722332032482.png
 
Level 14
Joined
Jan 10, 2023
Messages
248
Although if possible, I wouldn't mind an optimization for the trigger :)

It looks to me like your trigger is as optimal as it will be without writing it as Lua or JASS.

Also, I don't have a link handy, but if you right click on the line above the 'events' category in the trigger, (the line with the trigger's name) and then click 'copy as text', you will be able to present it here with (trigger) (/trigger) tags, replacing the "()" with "[]".

A screenshot can be a real pain sometimes, and with the trigger text we can rewrite the trigger for you and/or more easily to say what we mean.
 
Level 14
Joined
Jan 10, 2023
Messages
248
Edit: I fixed it by changing the units owner from Neutral Hostile to any actual player slot (not neutral slots).

Sorry to double post, but I had another thought about your solution here, you've set the ability to target enemies, so making the ownership 'any other player' may only work if 'any other player' happens to be an enemy.

If the abilities can only be used by the dummies, maybe set them to target more than just enemy units as a solution, if this persists.
 
Level 29
Joined
Sep 26, 2009
Messages
2,596
My two cents about the GUI trigger:
1. Is there a need to have multiple events but for different players? Can it ever happen in your map that any other player than those already specified would gain access to this ability and cast it? I daresay a single generic even would work just as well.

2. Replace 'Begins casting an ability' event for 'Starts casting an ability'. The 'Begins...' event fires before mana is taken and before cooldown starts. The 'Starts...' event fires at the point where the mana has been taken and cooldown will start no matter what. There is a slight delay between those two events (equal to caster's 'Art - Animation - Cast Point' in seconds). In practices, it means that with your current event if player interrupts the spell fast enough, it will still apply its effects but not take mana/start CD.

3. You can get rid of the 'Do Nothing' as it serves no purpose here, just bloats the trigger. You can actually get rid of the entire If/Then/Else construct and move the condition to trigger's Condition block.

4. You leak position

5. If you set up your dummy unit correctly, a single dummy can cast both spells immediately and be removed immediately as well. The below will work for correctly setup dummy:
  • Actions
    • Set VariableSet target = <some unit>
    • Unit - Create 1 Dummy for (Triggering player) at (Position of target) facing Default building facing degrees
    • Set VariableSet dummy = (Last created unit)
    • Unit - Add DoT (Dummy) to dummy
    • Unit - Add Slow (Dummy) to dummy
    • Unit - Order dummy to Night Elf Druid Of The Claw - Rejuvenation target
    • Unit - Order dummy to Human Sorceress - Slow target
    • Unit - Remove dummy from the game
 
Level 14
Joined
Jan 10, 2023
Messages
248
My two cents about the GUI trigger:
1. Is there a need to have multiple events but for different players? Can it ever happen in your map that any other player than those already specified would gain access to this ability and cast it? I daresay a single generic even would work just as well.
I thought about this, but the way it is currently is technically better for performance and worse on memory - both by minuscule amounts, but it's better to check only when these players cast an ability, rather than any time any unit casts an ability.


I looked over the rest of Nichilus' remarks and agree with all of them except the one I questioned above.

Sorry for the false positive.
 
Level 28
Joined
Dec 3, 2020
Messages
971
My two cents about the GUI trigger:
1. Is there a need to have multiple events but for different players? Can it ever happen in your map that any other player than those already specified would gain access to this ability and cast it? I daresay a single generic even would work just as well.

2. Replace 'Begins casting an ability' event for 'Starts casting an ability'. The 'Begins...' event fires before mana is taken and before cooldown starts. The 'Starts...' event fires at the point where the mana has been taken and cooldown will start no matter what. There is a slight delay between those two events (equal to caster's 'Art - Animation - Cast Point' in seconds). In practices, it means that with your current event if player interrupts the spell fast enough, it will still apply its effects but not take mana/start CD.

3. You can get rid of the 'Do Nothing' as it serves no purpose here, just bloats the trigger. You can actually get rid of the entire If/Then/Else construct and move the condition to trigger's Condition block.

4. You leak position

5. If you set up your dummy unit correctly, a single dummy can cast both spells immediately and be removed immediately as well. The below will work for correctly setup dummy:
  • Actions
    • Set VariableSet target = <some unit>
    • Unit - Create 1 Dummy for (Triggering player) at (Position of target) facing Default building facing degrees
    • Set VariableSet dummy = (Last created unit)
    • Unit - Add DoT (Dummy) to dummy
    • Unit - Add Slow (Dummy) to dummy
    • Unit - Order dummy to Night Elf Druid Of The Claw - Rejuvenation target
    • Unit - Order dummy to Human Sorceress - Slow target
    • Unit - Remove dummy from the game
Good remarks, just 1 thing that in my opinion is a better thing to do.
In this case it doesn't matter where the dummy is created (position of caster or position of target), but for example I have a custom firebolt ability for the orc warlocks so I need the dummy to be spawned at caster's position so the firebolt projectile flies from the caster towards the target (using faerie fire as base ability).

But very good help, thank you.
Thank you @Tristronic too!

Marking thread as solved.
 
Level 28
Joined
Dec 3, 2020
Messages
971
Negative healing is not considered damage by the game and will not trigger anything associated with it: no damage events, no kill credit, no kill gold or experience.
Thanks for the info, it shall definitely come in handy for the future!
Although for this map the negative healing from rejuvenation serves my purposes just right!

Are there any alternatives to this that do not require triggering? I wanted to use Soul Burn but it applies a silence which I do not want
 
Level 28
Joined
Dec 3, 2020
Messages
971
Hmm if I can make the damage interval something like 0.5 seconds, all I need to do is calculate the damage per interval!
Doesn't the slow get reduced though? I have to open the WE tomorrow to check if I can make the slow always slow for 30% during the entire duration.
And lastly that buff on the overhead of the unit, I could replace it with my own custom buff easily.

The only problem though is that the damage is displayed on the screen on each interval... so not good...
(Note that rejuvenation works perfectly for me but maybe figuring out an alternative could help someone else one day in the future)
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
Acid Bomb is a good all-purpose DoT. It can choose a tick rate, hits targets around the initial target, deals flat damage and damage over time, scales damage differently for primary/secondary targets, applies a buff, and can be dispelled. The only downside is that it’s technically a projectile so can never take effect ‘instantaneously’ (it can be cast instantly with max projectile speed but it will still take some finite time to hit).

Soul Burn applies a silence/doom effect. Shadow Strike has hardcoded numbers. Unholy Frenzy isn’t technically damage, it’s negative healing or health degen. Parasite spawns a unit when the target is killed under its effect but that can be removed easily.
 
Level 28
Joined
Dec 3, 2020
Messages
971
Acid Bomb is a good all-purpose DoT. It can choose a tick rate, hits targets around the initial target, deals flat damage and damage over time, scales damage differently for primary/secondary targets, applies a buff, and can be dispelled. The only downside is that it’s technically a projectile so can never take effect ‘instantaneously’ (it can be cast instantly with max projectile speed but it will still take some finite time to hit).

Soul Burn applies a silence/doom effect. Shadow Strike has hardcoded numbers. Unholy Frenzy isn’t technically damage, it’s negative healing or health degen. Parasite spawns a unit when the target is killed under its effect but that can be removed easily.
Acid Bomb is something I never thought of!
It is useful indeed and it makes sense for a burning spell to have some AoE. I could honestly use it in the future.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
Simple solutions aside, here's how you can trigger it yourself and bypass any limitations.

For an effect that can stack or have multiple instances active at once (IE: Shockwave) you'd want to use Dynamic Indexing.

For an effect that functions like a traditional Warcraft 3 ability where a new buff replaces an old buff (IE: Howl of Terror) use Unit Indexing.

In this case you can use Unit Indexing since your spell shouldn't stack DOT effects on the same target:
  • DOT Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Faerie Fire (DOT)
    • Actions
      • Set VariableSet DOT_Target = (Target unit of ability being cast)
      • Set VariableSet DOT_CV = (Custom value of DOT_Target)
      • -------- --------
      • -------- Link the caster to the target unit (the caster will be our damage source later on): --------
      • Set VariableSet DOT_Source[DOT_CV] = (Triggering unit)
      • -------- --------
      • -------- Define your damage per second and total duration: --------
      • Set VariableSet DOT_Damage[DOT_CV] = (15.00 x (Real((Level of (Ability being cast) for DOT_Source[DOT_CV]))))
      • Set VariableSet DOT_Duration[DOT_CV] = 5.00
      • -------- --------
      • -------- Define your damage interval (time between damage ticks): --------
      • -------- Note: Units don't use custom value 0 so we can use that [index] to store constant data for our spell. --------
      • Set VariableSet DOT_Interval[0] = 1.00
      • Set VariableSet DOT_Interval[DOT_CV] = DOT_Interval[0]
      • -------- --------
      • -------- Add the target to the loop trigger which handles periodic damage: --------
      • Unit Group - Add DOT_Target to DOT_Group
      • Trigger - Turn on DOT Loop <gen>
  • DOT Loop
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DOT_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet DOT_Target = (Picked unit)
          • -------- --------
          • -------- END early if the buff is gone (unit died or buff was dispelled): --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DOT_Target has buff Faerie Fire (DOT)) Equal to False
            • Then - Actions
              • Unit Group - Remove DOT_Target from DOT_Group.
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in DOT_Group) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
              • -------- The unit still has the buff - Proceed with the rest of the effects: --------
              • Set VariableSet DOT_CV = (Custom value of DOT_Target)
              • -------- --------
              • -------- Another 0.04 seconds has passed: --------
              • Set VariableSet DOT_Interval[DOT_CV] = (DOT_Interval[DOT_CV] - 0.04)
              • -------- --------
              • -------- Check if it's been 1 second in total: --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DOT_Interval[DOT_CV] Less than or equal to 0.01
                • Then - Actions
                  • -------- Deal damage: --------
                  • Unit - Cause DOT_Source[DOT_CV] to damage DOT_Target, dealing DOT_Damage[DOT_CV] damage of attack type Spells and damage type Normal
                  • -------- --------
                  • -------- Another 1 second has passed: --------
                  • Set VariableSet DOT_Duration[DOT_CV] = (DOT_Duration[DOT_CV] - 1.00)
                  • -------- --------
                  • -------- END if the total duration has been reached: --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • DOT_Duration[DOT_CV] Less than or equal to 0.01
                    • Then - Actions
                      • Unit Group - Remove DOT_Target from DOT_Group.
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in DOT_Group) Equal to 0
                        • Then - Actions
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
                      • -------- OTHERWISE, reset the interval to allow another damage tick: --------
                      • Set VariableSet DOT_Interval[DOT_CV] = DOT_Interval[0]
                • Else - Actions
You can copy and repurpose these two triggers for A LOT of your custom spells. You just have to ask yourself, do I need to use a Unit Indexing or a Dynamic Indexing approach? Unit Indexing is generally more common because it's how Warcraft 3 spells function for the most part.

You can then use these design methods for other triggers, it's not like they're exclusive to spells. You're simply:
  • Keeping track of multiple units at once.
  • Keeping track of unique data per unit (your variable arrays).
  • Managing this data and the units over time.
 

Attachments

  • Damage Over Time 1.w3m
    25.3 KB · Views: 2
Last edited:
Top