• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Unholy Strike

Status
Not open for further replies.
Level 9
Joined
Dec 16, 2017
Messages
343
Hello guys, i am making an talent for the unholy strike spell(it is a passive spell with a % to do instant damage and ministun a target) of the death knight unholy i have in my map, and i want for this talent to give a %(beside the instant dmg) to apply a debuff that damages the target for 8 seconds.
In what i struggle is how to add the debuff to the target just once and get it removed when the target dies or when the spell finishes. This is what i got so far.

  • Rapid Decomposition Unholy Talent Research
    • Events
      • Unit - A unit Finishes research
    • Conditions
      • (Researched tech-type) Equal to Rapid Decomposition (Death Knight Talent)
    • Actions
      • Trigger - Turn on Rapid Decomposition Unholy Talent Cast <gen>
  • Rapid Decomposition Unholy Talent Cast
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Unholy Strike (Death Knight UNHOLY) for (Attacking unit)) Greater than 0
    • Actions
      • Set US_Chance = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • US_Chance Less than or equal to 15
        • Then - Actions
          • Set US_Index = (US_Index + 1)
          • Set US_Caster[US_Index] = (Attacking unit)
          • Set US_Target[US_Index] = (Attacked unit)
          • Set US_Damage[US_Index] = (0.50 x (Real((Strength of US_Caster[US_Index] (Include bonuses)))))
          • Set US_Duration[US_Index] = 8
          • Set US_Buff[US_Index] = Virulent Plague (Death Knight UNHOLY)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • US_Index Equal to 1
            • Then - Actions
              • Trigger - Turn on Rapid Decomposition Unholy Talent Loop <gen>
            • Else - Actions
        • Else - Actions
  • Rapid Decomposition Unholy Talent Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer US_Loop) from 1 to US_Index, do (Actions)
        • Loop - Actions
          • Set US_Duration[US_Loop] = (US_Duration[US_Loop] - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • US_Duration[US_Loop] Greater than or equal to 0
              • (US_Target[US_Loop] is alive) Equal to True
            • Then - Actions
              • Unit - Cause US_Caster[US_Loop] to damage US_Target[US_Loop], dealing US_Damage[US_Loop] damage of attack type Spells and damage type Normal
            • Else - Actions
              • Set US_Caster[US_Loop] = US_Caster[US_Index]
              • Set US_Target[US_Loop] = US_Target[US_Index]
              • Set US_Damage[US_Loop] = US_Damage[US_Index]
              • Set US_Duration[US_Loop] = US_Duration[US_Index]
              • Set US_Index = (US_Index - 1)
              • Set US_Loop = (US_Loop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • US_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
you could trigger it from scratch f you want to, but what you want is basically just a poison effect. you could just have a dummy apply the poison affect. or use shadow strike and trigger the stun part of the ability. basically there are many existing abilities that do pretty much what you are looking for. so unless you specifically want to trigger this from scratch, you can just mix and match existing abilities for a lot less work for you (and probably the computer).
 
Level 9
Joined
Dec 16, 2017
Messages
343
The main spell, Unholy Strike is based of bash, but with the talent i want to add the possibility of overlapping the damage i am triggering on the same target multiple times, if i do with the spells from the object editor dirrectly, they don't stack on the same target. Yes, i was thinking of the dummy with poison effect, but if the same target is affected more times, and when you remove the debuff, it removes all of them, not just one?
 
Level 13
Joined
Oct 16, 2010
Messages
731
I'm not sure on the exacts of how stacking poison damage works, but if damage was set to stacking this would refresh the duration of the debuff while keeping the damage increasing? Not sure if each individual instance would get removed one at a time or just when the buff dissapears though...

In terms of the trigger version you can check if the unit has your buff, this also elimates needing to check if the unit is alive as the unit can't have the buff if it's dead!
 
Level 9
Joined
Dec 16, 2017
Messages
343
Ok, so i've done it like this

  • Rapid Decomposition Unholy Talent Cast
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Unholy Strike (Death Knight UNHOLY) for (Attacking unit)) Greater than 0
    • Actions
      • Set US_Chance = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • US_Chance Less than or equal to 99
        • Then - Actions
          • Set US_Index = (US_Index + 1)
          • Set US_Caster[US_Index] = (Attacking unit)
          • Set US_Target[US_Index] = (Attacked unit)
          • Set US_CPosition[US_Index] = (Position of US_Caster[US_Index])
          • Set US_Damage[US_Index] = (0.50 x (Real((Strength of US_Caster[US_Index] (Include bonuses)))))
          • Set US_Duration[US_Index] = 8
          • Set US_Spell[US_Index] = Virulent Plague Dummy (Death Knight UNHOLY)
          • Unit - Create 1 Dummy Empty for (Owner of US_Caster[US_Index]) at US_CPosition[US_Index] facing Default building facing degrees
          • Set US_Dummy[US_Index] = (Last created unit)
          • Unit - Add US_Spell[US_Index] to US_Dummy[US_Index]
          • Unit - Order US_Dummy[US_Index] to Undead Necromancer - Cripple US_Target[US_Index]
          • Unit - Add a 0.50 second Generic expiration timer to US_Dummy[US_Index]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • US_Index Equal to 1
            • Then - Actions
              • Trigger - Turn on Rapid Decomposition Unholy Talent Loop <gen>
            • Else - Actions
        • Else - Actions
      • Custom script: call RemoveLocation(udg_US_CPosition[udg_US_Index])
But not sure if i need to deindex the dummy,spell and position in the loop trigger, since i remove them in the cast trigger, what you guys think?
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
But not sure if i need to deindex the dummy,spell and position in the loop trigger, since i remove them in the cast trigger, what you guys think?

Dummy - Yes

Spell - No, infact get rid of this variable

Position - No, you already cleared it at the end of the cast but move it into the chance section instead.
1639327047512.png
 
Status
Not open for further replies.
Top