• 🏆 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] Shadow Strike Based Spell

Status
Not open for further replies.
Level 4
Joined
Sep 25, 2018
Messages
81
I've created a single targeted damaging nuke using Shadow Strike as a base. I wanted to have the damage triggered, so the little pop up in game wouldn't appear when it hits.

For the most part, the trigger works (scaling hero spell):

  • FireballBaseDamage
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fireball
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Fireball for (Triggering unit)) Equal to 1
        • Then - Actions
          • Wait until (((Target unit of ability being cast) has buff Fireball (Data Trigger)) Equal to True), checking every 0.10 seconds
          • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 90.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 Fireball for (Triggering unit)) Equal to 2
            • Then - Actions
              • Wait until (((Target unit of ability being cast) has buff Fireball (Data Trigger)) Equal to True), checking every 0.10 seconds
              • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), 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
                  • (Level of Fireball for (Triggering unit)) Equal to 3
                • Then - Actions
                  • Wait until (((Target unit of ability being cast) has buff Fireball (Data Trigger)) Equal to True), checking every 0.10 seconds
                  • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 150.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 Fireball for (Triggering unit)) Equal to 4
                    • Then - Actions
                      • Wait until (((Target unit of ability being cast) has buff Fireball (Data Trigger)) Equal to True), checking every 0.10 seconds
                      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 180.00 damage of attack type Spells and damage type Normal
                    • Else - Actions
Imgur <Ability>

However, if I try to run away after the projectile is in the air, or if I'm at a certain distance from the target, the damage doesn't register.

Please help
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,011
Why can't you use Acid Bomb or Chain Lightning as a base spell instead? Those are projectile-based damage spells that don't show damage numbers and don't have un-removable secondary effects like stun, silence, etc. (CL can have its lightning effect removed). If your hero already has a spell based on one of those you can use Channel ('ANcl') to make a dummy ability and cast the real ability with a dummy unit. The last line cleans a leak.

  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) equal to YOUR_DUMMY_HERO_ABILITY
  • Actions
    • Set Point1 = Position of (Triggering Unit)
    • Unit - Create one DUMMY_UNIT for (Owner of (Triggering Unit)) at Point1 facing Default building facing degrees
    • Unit - Add a 2.00 generic expiration timer to (Last created unit)
    • Unit - Add YOUR_AB_OR_CL_ABILITY to (Last created unit)
    • Unit - Set level of YOUR_AB_OR_CL_ABILITY for (last created unit) to (Level of YOUR_DUMMY_HERO_ABILITY for (Triggering Unit))
    • Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb (Target unit of ability being cast) //or Orc Far Seer - Chain Lightning
    • Custom script: call RemoveLocation(udg_Point1) //change this to match the name of your point variable, but keep the udg_ prefix
About your trigger itself: you can reduce the nested if-statements boogaloo in two different ways.
  1. Find a formula that computes the damage given any level of the spell. In your case it is:
    DMG = 60 + 30*LVL
    • Unit - Cause <unit> to damage <unit>, dealing (60.00 + (30.00 x (Level of <spell> for <unit>))) damage of attack type Spells and damage type Normal
  2. Define damage values in an array that you set on map init, with index [N] giving you the damage for that level of the spell. This works best when the damage doesn't have a simple scaling formula or is in some way weirdly calculated.
    • -------- In a map initialization trigger --------
    • Set FB_DMG[1] = 90.00
    • Set FB_DMG[2] = 120.00
    • Set FB_DMG[3] = 150.00
    • Set FB_DMG[4] = 180.00
    • -------- In your spellcast trigger --------
    • Unit - Cause <unit> to damage <unit>, dealing FB_DMG[(Level of <spell> for <unit>)] damage of attack type Spells and damage type Normal
Also waits are bad and will inevitably eventually break your spellcasting triggers. Many event responses like "Attacking unit" will not return the correct unit (or any unit at all) after a wait. There is a minimum wait duration of 0.27 seconds (defined in the internal Blizzard.j library) so your check actually doesn't happen every 0.10 seconds. In general I would advise against using the Wait or Wait until... actions in spellcast triggers unless you know 100% that only one unit at a time can ever cast the spell. Here's the best tutorial on waits I could find in the tutorials section: MUI Triggers with Waits

Instead of taking screenshots of your triggers you can right click them on their name (where it says FireballBaseDamage) and select "copy as text", then paste here between [trigger][/trigger] tags.
 
Last edited:
Level 4
Joined
Sep 25, 2018
Messages
81
Shadow Strike works fine because you can just set the damage on hit to 0, then trigger in the damage. So the damage pop up doesn’t appear. Also, it’s the closes thing Warcraft 3 has to a single targeted nuke. If I use acid bomb, I pretty much have to do exactly the same trigger to do the damage on hit. Which seems unnecessary.

I tried chain lighting, but you can’t change the projectile speed. So it always looks instant.

If I lower the buff duration on Shadow Strike to like 0.1 second, I do not need to worry about unremovable buffs.

The problem I think I have is finding a more efficient way of detecting that the spell has landed. I can’t have it do damage before the projectile has even hit.
 
Last edited:
Level 12
Joined
Nov 3, 2013
Messages
989
The problem I think I have is finding a more efficient way of detecting that the spell has landed. I can’t have it do damage before the projectile has even hit.

Use a Damage Detection System, and check if the unit has the debuff from shadow strike/acid bomb depending on which base ability you use, then remove the buff. (And deal damage and anything else.)

Damage Engine 3.8.0.0


p.s. I didn't check the imagine links. But you can show the triggers in posts by copying the text from world editor and then doing this:

[trigger]your trigger text[/trigger]
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,011
If I use acid bomb, I pretty much have to do exactly the same trigger to do the damage on hit. Which seems unnecessary.
I don't know what planet you're playing this game on, but Acid Bomb only does damage when the projectile actually hits the target. For it to damage on cast woild be ludicrous! Literally every damaging spell in Wc3 works this way except for Finger of Death which explicitly has a field to delay damage and things like Fan of Knives (looks like projectile but is really an AoE effect like Thunderclap) or Starfall (uses special effects with specific durations).

As for the benefits of using Acid Bomb over Shadow Strike: it doesn't show the green damage numbers you're trying to avoid and it doesn't have a funky damage decay fallof field that needs to be accounted for. Acid Bomb is the godsend single target/small AoE unit-target 'damage and buff applier' ability.

The problem I think I have is finding a more efficient way of detecting that the spell has landed. I can’t have it do damage before the projectile has even hit.
This is a bigger problem to solve than I think you realize. If you refuse to use AB, you will need to implement a Damage Detection System into your map and make the SS deal 1 damage (thus causing the numbers to appear again) so it actually fires the 'damaged' event the DDS adds. It's circular because short of the ability itself dealing damage there are no 'real' ways to know exactly when the spell hits its target. The closest you can get is periodically checking the target unit for a buff using a very low timeout timer (not waits or looped waits or anything like that, an actual timer the likes of which GUI generally doesn't make it easy to use)... and at that point you need to either implement some sort of data attaching to timers functionality or learn to use Dynamic Indexing (there's a tutorial on this here) in order to refer to the caster/player who should get kill credit/spell level, etc.
 
Level 39
Joined
Feb 27, 2007
Messages
5,011
Use a Damage Detection System, and check if the unit has the debuff from shadow strike/acid bomb depending on which base ability you use, then remove the buff. (And deal damage and anything else.)
DDS isn't going to fire its event if the spell deals no damage... and if the spell deals damage and applies its buff then when it should, then the DDS is unnecessary because the spell can deal its damage directly.

[.trigger]your trigger text[./trigger]
[plain] tags are your friend.
 
Level 4
Joined
Sep 25, 2018
Messages
81
I don't know what planet you're playing this game on, but Acid Bomb only does damage when the projectile actually hits the target.
I appreciate you trying to help out, but I think you may have misinterpreted what I said. Acid Bomb does tick damage, true? (Like Ogre Magi's Ignite spell, which I assume used Acid Bomb as a base). What I need is a spell that does just one instant of nuke damage upon arrival.

I suppose I could use what is used in this spell

If you want to cause damage after the projectile hits, you'll need to put a wait.

The most accurate would be "Wait (Distance between (Position of Triggering unit) and (Position of Target unit of ability being cast) / [Your spell missile's speed (e.g. 800, 1000, etc)] seconds", and then trigger the damage.
Of course, store points in variables and remove them at the end of the trigger to avoid leaks, and make sure nothing else gets affected because of the wait.

From: [Spell] - Some help with Corrosive Bolt

But you said you didn't really like the "wait" action.
 
Level 12
Joined
Nov 3, 2013
Messages
989
@rkemsley the wait there is because you don't know how long it will take before the projectile hits, so in the other thread one suggestion was to add a wait based on roughly how long it would usually take for the projectile to arrive, and then deal damage.


However, as it turns out you only need to deal a certain amount of damage based on ability level, which can be accomplished with the basic spells of the object editor and doesn't require any trigger at all.

As I didn't fully understand at first, you mentioned that the only reason you want to use trigger is to avoid having shadow strike show the damage floating text.

I've created a single targeted damaging nuke using Shadow Strike as a base. I wanted to have the damage triggered, so the little pop up in game wouldn't appear when it hits.
So in other words you don't need any trigger at all, since acid bomb can do what you want without the floating text.
 
Level 39
Joined
Feb 27, 2007
Messages
5,011
I appreciate you trying to help out, but I think you may have misinterpreted what I said. Acid Bomb does tick damage, true? (Like Ogre Magi's Ignite spell, which I assume used Acid Bomb as a base). What I need is a spell that does just one instant of nuke damage upon arrival.
Oh you're right I didn't realize that is what you meant you wanted to avoid. However, Acid bomb has a Data - Damage Interval field that controls how often it deals damage. The first tick (Data - Primary Damage per tick) always happens when the projectile hits and then once every Damage Interval after that. If the DI is equal to or divides evenly into Stats - Duration the spell doesn't deal damage simultaneously with the buff expiring at the end. Example:

Data - Damage Interval = 1.00
Data - Primary Damage = 50.00
Data - Secondary Damage = 0.00 (this is the aoe damage)
Stats - Duration - Hero = 1.00
Stats - Duration - Unit = 1.00

Result: 50 damage is dealt on impact and the buff stays visible for 1 second but the unit doesn't take any additional periodic damage.
 
Level 15
Joined
Aug 14, 2007
Messages
936
Alright I think I get what the OP is trying to say, the reason why the wait did not work is due to what Pyrogasm had mentioned where when the trigger variable "Target Unit of Ability Cast" times out very quickly as blizzard GUI system does not support MUI, since the suggestions were not accepted I want to give my own version of suggestion.

@rkenskey If you still insist on using shadow strike over Acid Bomb just for fun, you might want to use a timer and unit variable like what a normal GUI coder would do, with that you need two triggers. First Trigger is the spell cast detector which you already have and the second trigger being the Timer trigger with event of Periodic every 0.5 second of the game. When the player cast a spell, the first trigger fires and register the target as a unit variable and caster as a unit variable then turns on the second trigger which should be initially turned off. This will activate the timer which checks for the buff of the targeted unit, when that happens you can also use real variable to do a static timer stack which can expire, when it does then turn off second trigger to avoid system slow down.
 
Level 9
Joined
Apr 23, 2011
Messages
527
If you still insist on using shadow strike over Acid Bomb just for fun, you might want to use a timer and unit variable like what a normal GUI coder would do, with that you need two triggers. First Trigger is the spell cast detector which you already have and the second trigger being the Timer trigger with event of Periodic every 0.5 second of the game. When the player cast a spell, the first trigger fires and register the target as a unit variable and caster as a unit variable then turns on the second trigger which should be initially turned off. This will activate the timer which checks for the buff of the targeted unit, when that happens you can also use real variable to do a static timer stack which can expire, when it does then turn off second trigger to avoid system slow down.

Not MUI.

I don't see why it's such a hassle to switch to Acid Bomb in the first place.
 
Status
Not open for further replies.
Top