• 🏆 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!

Need help with a delayed damage ability

Status
Not open for further replies.
Level 2
Joined
Oct 16, 2013
Messages
18
Hello friends, I've posted here before and gotten extremely helpful advice. I've come back because I have a problem with one of my abilities.

Essentially the idea was to make a passive ability using Orb of Slow. The ability would cast when you auto attacked them and then go on cooldown for a certain amount of time.

The ability that I made cast when you auto attacked them deals initial damage, silences, and slows for 3 seconds.

Here's where the trigger comes in. When the silence / slow debuff wore off, I wanted to deal additional damage to the unit and create a special effect over their head.

This sounds simple but for some reason it's proving a challenge. I had a working version of the ability, but it was script leaking badly so I scrapped it and started over. Now what I have doesn't even work correctly (you have to click a second time on them to activate the trigger) and I'm still not sure if I fixed the script leaking.

I think I'd probably benefit more from starting over if you guys had a better idea of how to do it, but this is what I have right now:

  • Nether Strike Copy 2
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Attacking unit)) Equal to Nether Warrior
          • ((Attacked unit) has buff Nether Strike ) Equal to True
    • Actions
      • Set netherstrikeattacker = (Attacking unit)
      • Set netherstrikenemy = (Attacked unit)
      • Unit - Cause (Attacking unit) to damage (Attacked unit), dealing (((Real((Strength of (Attacking unit) (Include bonuses)))) x 0.50) + ((Real((Intelligence of (Attacking unit) (Include bonuses)))) x 0.75)) damage of attack type Spells and damage type Normal
      • Trigger - Turn off (This trigger)
      • Wait until ((netherstrikenemy has buff Nether Strike ) Equal to False), checking every 0.10 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Nether Strike for netherstrikeattacker) Equal to 1
        • Then - Actions
          • Unit - Cause netherstrikeattacker to damage netherstrikenemy, dealing 40.00 damage of attack type Spells and damage type Normal
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Nether Strike for netherstrikeattacker) Equal to 2
        • Then - Actions
          • Unit - Cause netherstrikeattacker to damage netherstrikenemy, dealing 80.00 damage of attack type Spells and damage type Normal
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Nether Strike for netherstrikeattacker) Equal to 3
        • Then - Actions
          • Unit - Cause netherstrikeattacker to damage netherstrikenemy, dealing 120.00 damage of attack type Spells and damage type Normal
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Unit - Cause netherstrikeattacker to damage netherstrikenemy, dealing (((Real((Strength of netherstrikeattacker (Include bonuses)))) x 0.50) + ((Real((Intelligence of netherstrikeattacker (Include bonuses)))) x 0.75)) damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect attached to the overhead of netherstrikenemy using Abilities\Spells\Undead\DeathandDecay\DeathandDecayTarget.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Real((Level of Nether Strike for netherstrikeattacker))) Equal to 1.00
        • Then - Actions
          • Wait 7.20 seconds
          • Trigger - Turn on (This trigger)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Real((Level of Nether Strike for netherstrikeattacker))) Equal to 2.00
        • Then - Actions
          • Wait 5.20 seconds
          • Trigger - Turn on (This trigger)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Real((Level of Nether Strike for netherstrikeattacker))) Equal to 3.00
        • Then - Actions
          • Wait 3.20 seconds
          • Trigger - Turn on (This trigger)
        • Else - Actions

Any input or suggestions are welcome, thanks!
 
Level 17
Joined
Mar 21, 2011
Messages
1,597
it works for the second time because "a unit is attacked" event starts when a unit starts the attack, not when it lands it. so it does not have the buff on it when you attack the first time.
I'd recommend you to use a Physical Damage Detection System and trigger the orb of slow or you could add every unit that is target of your ability to a group and loop through the group in a periodic timer trigger. when it has the buff equal to false, you can do your actions
 
Level 7
Joined
Jun 14, 2009
Messages
235
Not necessarily what you asked for, but instead of using an If/Then for each of the ability levels, you can just use math.

eg. 40 x Level of Nether Strike
 
Status
Not open for further replies.
Top