• 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] How to make a damege over time effect if the target unit is specific buff?

Status
Not open for further replies.
Level 2
Joined
Sep 11, 2022
Messages
14
Greetings, I've recently been trying to restore some of Naj'entus' skills in WOW. His first ability is Impaling Spine, which stuns enemies and causes bleeding. In order to remake this ability, I made a new ability "Impaling Spine" based on MK's Storm Bolt, and added a new UI called Puncture(ImpalingSpine). I tried to achieve 20 damage per second bleeding through a trigger, so I wrote the following trigger:
  • Impaling Spine
    • Events
      • Unit - A unit start casting an ability
    • Conditions
      • (Ability being cast) Equal to ImpalingSpine
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Ability target unit) has Puncture(ImpalingSpine)) equal to TRUE
        • Then - Actions
          • Unit - (Cast unit) to damage (Ability target unit) 20.00 damage, of attack type Spells and damage type Normal
        • Else - Actions
          • Do nothing
However, this trigger has no effect, I don't know what is wrong, should I set multiple variables and use multiple triggers?
 
Level 2
Joined
Sep 11, 2022
Messages
14
Your description of the spell is insufficient. However your if then else condition doesnt return true because the target doesnt have the buff.
EDIT: Sry bout the post. Dont have time to say anything useful but I will add this link Visualize: Dynamic Indexing
I'm trying to make a targeted skill that will only work on a single enemy unit. It will cause a stun effect, and I want it to cause a bleed effect in the duration of the stun effect, losing 20 health per second. I tried to mimic the approach in Link, but it only deals bleed damage once, and it only works on one enemy unit, casting the spell on another enemy breaks the effect.
 
Level 2
Joined
Sep 11, 2022
Messages
14
Now it's look like this:
  • Impaling Spine start
    • Event
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Siphon Life
    • Actions
      • Set IS_Caster=(Triggering unit)
      • Set IS_Target=(Target unit of ability being cast)
      • Trigger - Turn on Impaling Spine effect<gen>
  • Impaling Spine effect
    • Event
      • Time - Every 1.00 seconds of game time
    • Conditions
      • (IS_Target has Puncture(ImpalingSpine)) equal to TRUE
    • Actions
      • Units - Cause IS_Caster to damage IS_Target, dealing 2 damage of attack type Chaos and damage type Normal
      • If (All Conditions are True) then do (Then Actions) else do (Else actions)
        • If - Conditions
          • (IS_Target has Puncture(ImpalingSpine)) Equal to FALSE
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Do nothing
It worked successfully but only caused bleed damage to the enemy for 1 second, but the stun effect was still working on the enemy for 4 more seconds.
 
Level 2
Joined
Sep 11, 2022
Messages
14
My mistake. What I meant was IS_Target does not have the buff Puncutre(ImpalingSpine) otherwise it would work.
I tried to delete this condition, but the only thing happened the bleed effect takes effect immediately before the projectile arrives, and still only takes effect once is
 
Level 23
Joined
Feb 27, 2019
Messages
768
Very strange since the boolean cant both be true and false. It would have to be true for the bleed to occur and it would have to be false for the trigger to be turned off. The only option is that the unit does not have the buff after it has taken damage from the bleed. That is if these variables are only used within these triggers. I could imagine the trigger being turned off before since Storm Bolt has a minimum time to take effect of one frame but that would not statistically happen each time while testing. This trigger requires that storm bolt doesnt have a missile speed. Even then, it could malfunction because of the one frame it requires. What happens if its cast while standing next to the target or if the missile speed is set to 0?

EDIT: I would advice to add game messages when stuff occurs in the trigger.
 
Level 13
Joined
Feb 5, 2018
Messages
551
So is the unit stunned and also bleeds? Or is the unit just stunned briefly and then bleeds for an amount of seconds?

I made a testmap for you. Very simple, no indexing or anything. :)

Tested and working. To ensure that the unit has the buff before the loop runs, the missile speed must be pretty fast. Or you can use this: Relativistic Missiles [vJASS][LUA][GUI]

This would make sure that the loop runs only after the missile has reached it's target.

One option is also to:
1) Create dummy unit with Sphere ability added in Object Editor.
2) Change Sphere missile to whatever missile you want the skill to use
3) Create the dummy unit to the caster location when he uses Impaling Spine
4) Order dummy unit to cast the actual Impaling Spine with your desired missile.
5) This way the initial triggers "cast when a unit starts effect of an abilty runs when the sphere
projectile has reached the target.

Before copying the folder from the the testmap make sure you have:
1) Automatically create unkown variables while passsing trigger data checked in the map editor Preferences.

  • Impaling Spine
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Bolt
    • Actions
      • Set VariableSet ImpalingSpine_Caster = (Triggering unit)
      • Set VariableSet ImpalingSpine_Target = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (ImpalingSpine_Target is in ImpalingSpine_TargetGroup.) Equal to False
        • Then - Actions
          • Unit Group - Add ImpalingSpine_Target to ImpalingSpine_TargetGroup
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in ImpalingSpine_TargetGroup) Greater than or equal to 1
        • Then - Actions
          • Trigger - Turn on Impaling Spine Loop <gen>
        • Else - Actions
  • Impaling Spine Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Game - Display to (All players) the text: LOOP IS RUNNING
      • Unit Group - Pick every unit in ImpalingSpine_TargetGroup and do (Actions)
        • Loop - Actions
          • -------- Change the BUFF to your custom buff --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Bleed (Pause)) Equal to True
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Set VariableSet ImpalingSpine_Target = (Picked unit)
              • -------- DAMAGE TARGETS --------
              • -------- This is not needed, but if you want to add visuals --------
              • Special Effect - Create a special effect attached to the overhead of ImpalingSpine_Target using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- Damage Target --------
              • Unit - Cause ImpalingSpine_Caster to damage ImpalingSpine_Target, dealing 60.00 damage of attack type Normal and damage type Normal
            • Else - Actions
              • Unit Group - Remove (Picked unit) from ImpalingSpine_TargetGroup.
      • -------- Turn of Loop if there are no targets --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in ImpalingSpine_TargetGroup) Less than or equal to 0
        • Then - Actions
          • Game - Display to (All players) the text: LOOP ENDED == NO TA...
          • Trigger - Turn off (This trigger)
        • Else - Actions
 

Attachments

  • ImpalingSpineTestMap.w3m
    18.7 KB · Views: 3
Level 2
Joined
Sep 11, 2022
Messages
14
So is the unit stunned and also bleeds? Or is the unit just stunned briefly and then bleeds for an amount of seconds?

I made a testmap for you. Very simple, no indexing or anything. :)

Tested and working. To ensure that the unit has the buff before the loop runs, the missile speed must be pretty fast. Or you can use this: Relativistic Missiles [vJASS][LUA][GUI]

This would make sure that the loop runs only after the missile has reached it's target.

One option is also to:
1) Create dummy unit with Sphere ability added in Object Editor.
2) Change Sphere missile to whatever missile you want the skill to use
3) Create the dummy unit to the caster location when he uses Impaling Spine
4) Order dummy unit to cast the actual Impaling Spine with your desired missile.
5) This way the initial triggers "cast when a unit starts effect of an abilty runs when the sphere
projectile has reached the target.

Before copying the folder from the the testmap make sure you have:
1) Automatically create unkown variables while passsing trigger data checked in the map editor Preferences.

  • Impaling Spine
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Bolt
    • Actions
      • Set VariableSet ImpalingSpine_Caster = (Triggering unit)
      • Set VariableSet ImpalingSpine_Target = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (ImpalingSpine_Target is in ImpalingSpine_TargetGroup.) Equal to False
        • Then - Actions
          • Unit Group - Add ImpalingSpine_Target to ImpalingSpine_TargetGroup
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in ImpalingSpine_TargetGroup) Greater than or equal to 1
        • Then - Actions
          • Trigger - Turn on Impaling Spine Loop <gen>
        • Else - Actions
  • Impaling Spine Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Game - Display to (All players) the text: LOOP IS RUNNING
      • Unit Group - Pick every unit in ImpalingSpine_TargetGroup and do (Actions)
        • Loop - Actions
          • -------- Change the BUFF to your custom buff --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Bleed (Pause)) Equal to True
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Set VariableSet ImpalingSpine_Target = (Picked unit)
              • -------- DAMAGE TARGETS --------
              • -------- This is not needed, but if you want to add visuals --------
              • Special Effect - Create a special effect attached to the overhead of ImpalingSpine_Target using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- Damage Target --------
              • Unit - Cause ImpalingSpine_Caster to damage ImpalingSpine_Target, dealing 60.00 damage of attack type Normal and damage type Normal
            • Else - Actions
              • Unit Group - Remove (Picked unit) from ImpalingSpine_TargetGroup.
      • -------- Turn of Loop if there are no targets --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in ImpalingSpine_TargetGroup) Less than or equal to 0
        • Then - Actions
          • Game - Display to (All players) the text: LOOP ENDED == NO TA...
          • Trigger - Turn off (This trigger)
        • Else - Actions
I solved this problem yesterday, thanks a lot still, I will take a look and see how should I improve it.
 
Status
Not open for further replies.
Top