• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

[Trigger] Critical Strike like Spell using DD system

Status
Not open for further replies.
Hello guys,

I'm making a custom passive spell close to Critical Strike and Bash. The spell goes like this:
A hero connects with attacks (meaning it deals physical damage from attacks that connect) it has a 10% chance to deal the amount of the hero's Strength on top the attack damage.

I'm intentionally still using the patch 1.26a for my map. So, i used Physical Damage Detection for GUI v1.3.0.0 to create this trigger:
  • Chance
    • Events
      • Game - PDD_damageEventTrigger becomes Equal to 1.00
    • Conditions
      • PDD_damageType Equal to PDD_PHYSICAL
      • (Level of Evasion for PDD_source) Greater than 0
      • (PDD_target is A structure) Equal to False
      • (Random integer number between 1 and 100) Less than or equal to 10
    • Actions
      • Set PDD_amount = (PDD_amount + (Real((Strength of PDD_source (Include bonuses)))))
      • Floating Text - Create floating text that reads (|c0020C000 + ((String((Integer(PDD_amount)))) + !)) above PDD_target with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Hide (Last created floating text) for (All players)
      • Floating Text - Show (Last created floating text) for Player Group - Player 1 (Red)
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 1.50 seconds
      • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
Here are the problems:
1) My main problem is that when i set the PDD_amount = PDD_amount + Hero's Strength, the Hero's Strength damage will be dealt as pure damage meaning it will ignore the armor of the damaged target.
So, is there a way to fix that and make the total damage recognize armor reduction?

2) What if the Hero who has this spell, deals other physical damage than attacking?
For example like this:
  • Unit - Cause Hero to damage (Picked unit), dealing 200 damage of attack type Hero and damage type Normal
That will trigger my passive spell. So, is there a way to distinguish physical damage that has been dealt from attacks and physical damage from triggers?

Please let me know guys if my trigger leaks or not, what about the Floating Text, is that alright? and if there's any other way to further improve the trigger. (The 10% chance is it alright that way?)

As i've mentioned before, I'm intentionally still using the patch 1.26a for my map. So, i won't be able to use Damage Engine by Bribe. Maybe there's a better DD system than the one that i'm using that works with 1.26a!

Thank you. :)
 
Level 39
Joined
Feb 27, 2007
Messages
5,031
It appears you are leaking a player group, but it’s possible I’m ignorant and “Player Group - Player 1 (Red)” is a static force variable like All Players is.

You can differentiate between physical/spell/code damage by checking PDD_damageType. You can use UnitDamageTargetEx to deal additional damage without running damage events. Read the system documentation.
 
Thank your for your reply Pyrogasm :)
You can differentiate between physical/spell/code damage by checking PDD_damageType.
That's not an issue, cuz i'm having trouble between 2 kinds of damage (1 from attacks 1 from trigger) with the same type which is physical. I've tested Code damage and it's being treated as physical damage in my case too. :)

You can use UnitDamageTargetEx to deal additional damage without running damage events. Read the system documentation.
Yep i'm aware of that function, it's used for recursion but it can't be used outside of an onDamage event. In my case, i'm using a normal Unit is attacked event in the other trigger that i was talking about.

You can use Damage Engine 3.8.0.0 | HIVE - it isn't using anything that requires patches beyond 1.26a. You should be able to open it up and disregard any messages that says it was saved with a newer version of WarCraft 3.

Thank your for your reply Bribe:)
I used the Damage Engine 3.8.0.0 but still i couldn't solve my main problem which is make the total damage (Hero attack damage + Strength) recognize armor reduction.

  • Chance
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsDamageSpell Equal to False
          • (Level of Evasion for DamageEventSource) Greater than 0
          • (Random integer number between 1 and 100) Less than or equal to 100
        • Then - Actions
          • Set DamageEventAmount = (DamageEventAmount + (Real((Strength of DamageEventSource (Include bonuses)))))
          • Floating Text - Create floating text that reads (|c0020C000 + ((String((Integer(DamageEventAmount)))) + !)) above DamageEventTarget with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Hide (Last created floating text) for (All players)
          • Floating Text - Show (Last created floating text) for Player Group - Player 1 (Red)
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 1.50 seconds
          • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
        • Else - Actions
I've tried also DamageEventPrevAmt and it didn't work too. Is there a way to fix that in either of the DD systems? :)
 
In Damage Engine 3.8 and PDD, armor is already taken into consideration prior to the damage event. To get the pre-armor value was always a hotly-requested feature and Blizzard added a way for us to get it in patch 1.31.

To force your value to be reduced, you have to overlay a second damage instance instead of modifying DamageEventAmount:

Trigger - Turn off (this trigger)
Unit - Cause DamageEventSource to damage DamageEventTarget for (Real((Strength of DamageEventSource (Include bonuses)))) using attack type Hero and damage type Normal.
Trigger - Turn on (this trigger)

That will work and will not cause recursion.
 
Level 39
Joined
Feb 27, 2007
Messages
5,031
That's not an issue, cuz i'm having trouble between 2 kinds of damage (1 from attacks 1 from trigger) with the same type which is physical. I've tested Code damage and it's being treated as physical damage in my case too.
It was my understanding that Code damage is specifically from UnitDamageTarget and UnitDamageTargetEx used in triggers. Unsure why you aren't able to detect that.
In my case, i'm using a normal Unit is attacked event in the other trigger that i was talking about.
Why would you use the attacked event when you already have a DDS in the map? Attacked event is terrible.
 
It was my understanding that Code damage is specifically from UnitDamageTarget and UnitDamageTargetEx used in triggers.

Code damage is only detected when using UnitDamageTargetEx. So he's in a bit of a bind.

He could be using the "attacked" event in order to interact with the attacking unit via a special effect or animation.
 
Level 3
Joined
Dec 17, 2017
Messages
39
You could also calcuate the damage-reduction the target has:
1/(1+0.06*armor) multiplied with the damage should give you the amount of damage that would be dealt after the damage reduction from armor takes place.

if armortypes need to be considered additionally you could use an >>if then<< for that.
 
I'm using the attacked event because i wanna simply trigger a passive spell from the moment that a unit attacks a target with that spell without the need of the attack to connect. :)

In Damage Engine 3.8 and PDD, armor is already taken into consideration prior to the damage event. To get the pre-armor value was always a hotly-requested feature and Blizzard added a way for us to get it in patch 1.31.

To force your value to be reduced, you have to overlay a second damage instance instead of modifying DamageEventAmount:

Trigger - Turn off (this trigger)
Unit - Cause DamageEventSource to damage DamageEventTarget for (Real((Strength of DamageEventSource (Include bonuses)))) using attack type Hero and damage type Normal.
Trigger - Turn on (this trigger)

That will work and will not cause recursion.

That works for me thanks. :)
But now the problem is the floating text value of the total damage. For example, if the Hero deals 35 damage from attacks and has 50 strength, the floating text should display the value 85! no matter what the target's armor amount is. (Just like Critical Strike, 50 attack damage * 2 shows 100! on any unit whether it has 0 armor or 999999.)
Could you please help with accomplishing this? :)

This is the trigger that i'm using now:

  • Chance
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsDamageSpell Equal to False
          • (Level of Evasion for DamageEventSource) Greater than 0
          • (Random integer number between 1 and 100) Less than or equal to 100
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • -------- Calculate the total of the Detected Attack damage and the hero's current Strength --------
          • Floating Text - Create floating text that reads (|c0020C000 + ((String((Integer((DamageEventPrevAmt + (Real((Strength of DamageEventSource (Include bonuses))))))))) + !)) above DamageEventTarget with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Hide (Last created floating text) for (All players)
          • Floating Text - Show (Last created floating text) for Player Group - Player 1 (Red)
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 1.50 seconds
          • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
          • -------- Deal the Str damage --------
          • Unit - Cause DamageEventSource to damage DamageEventTarget, dealing (Real((Strength of DamageEventSource (Include bonuses)))) damage of attack type Normal and damage type Normal
          • Trigger - Turn on (This trigger)
        • Else - Actions



I have some questions about Damage Engine 3.8.0.0:

1) Why does Mana Shield require a fix? I disabled the Mana Shield Fix in your test map and i reset the ability to default, and it works fine i think. Can i not use the Trigger Fix?(In my map i'm using a spell based on Mana Shield that deals damage to attackers, that's why i have to be extra careful.)

2) I disabled the Life Drain Fix and it the ability seems to work fine. It heals the caster. Can i not use the Trigger Fix since it's not legit?

3) I'm using the Anti-magic Shell in my map (the old one that doesn't have a Shield life, it only gives spell immunity until it gets dispelled or fades out). It seems to work fine. Can i not use the Anti Magic Shield Trigger Fix?

4) I'm using many "Unit Takes Damage" triggers in my map? Should i fix them all with "DamageEvent becomes Equal to 1.00" or can i ignore that? (Many of those triggers are simple, like Unit takes damage, unpause that unit and turn off that trigger - I use this to prevent luring enemy units in a linear rpg map)

5) As i said before, i'm intentionally using 1.26a so that my map will be playable by most people (there are many players still using 1.26a). If i implement Damage Engine 3.8.0.0 in my map using 1.26a, will there be any problems when i run it on future patches like 1.30? ( The latest Dota for example has been released on 1.26a and it uses a damage detection system and it works fine with all kinds of patches beyond 1.26a.)

6) This is just for learning purposes, cuz their fix is really easy. Why doesn't finger of death explode units when we implement DD? (I actually disabled the Finger of Death Trigger Fix and it works fine in the test map but in other DD systems doesn't work). Also, Locust Swarm needs its Damage Return Factor changed due to spells originally using negative values?

Please let me know what you think Bribe. I'm just being extremely careful. (The issues from 1 to 5 are extremely critical in my case)

:)
 
Level 9
Joined
Jul 30, 2018
Messages
445
You don't need to calculate the damage for the Critical Strike floating text when you do it in the DamageEvent instead of DamageModifierEvent and you can just use DamageAmount as the text for the Floating Text.
 
I have some questions about Damage Engine 3.8.0.0:

1) Why does Mana Shield require a fix? I disabled the Mana Shield Fix in your test map and i reset the ability to default, and it works fine i think. Can i not use the Trigger Fix?(In my map i'm using a spell based on Mana Shield that deals damage to attackers, that's why i have to be extra careful.)

2) I disabled the Life Drain Fix and it the ability seems to work fine. It heals the caster. Can i not use the Trigger Fix since it's not legit?

3) I'm using the Anti-magic Shell in my map (the old one that doesn't have a Shield life, it only gives spell immunity until it gets dispelled or fades out). It seems to work fine. Can i not use the Anti Magic Shield Trigger Fix?

4) I'm using many "Unit Takes Damage" triggers in my map? Should i fix them all with "DamageEvent becomes Equal to 1.00" or can i ignore that? (Many of those triggers are simple, like Unit takes damage, unpause that unit and turn off that trigger - I use this to prevent luring enemy units in a linear rpg map)

5) As i said before, i'm intentionally using 1.26a so that my map will be playable by most people (there are many players still using 1.26a). If i implement Damage Engine 3.8.0.0 in my map using 1.26a, will there be any problems when i run it on future patches like 1.30? ( The latest Dota for example has been released on 1.26a and it uses a damage detection system and it works fine with all kinds of patches beyond 1.26a.)

6) This is just for learning purposes, cuz their fix is really easy. Why doesn't finger of death explode units when we implement DD? (I actually disabled the Finger of Death Trigger Fix and it works fine in the test map but in other DD systems doesn't work). Also, Locust Swarm needs its Damage Return Factor changed due to spells originally using negative values?

Please let me know what you think Bribe. I'm just being extremely careful. (The issues from 1 to 5 are extremely critical in my case)

:)

1) Mana Shield doesn't "need" a fix if you don't care about modifying the pre-shield damage. But if the damage is blocked by something or reduced/enhanced, the mana shield will not factor in any user damage.

2) It sounds like you didn't configure the spell damage ability correctly, so you're probably detecting everything as physical. So no reversal is needed because your setup is wrong.

3) The fix is only needed for value-based Anti-Magic shell. The spell immunity is fine.

4) Sounds like you don't need to change those.

5) 3.8 fixed compatibility issues with patch 1.29, and patch 1.31 shouldn't be much of an issue (but I haven't tested the old DE on the latest patch, so there's no way to be 100%).

6) Again, sounds like your Spell damage ability isn't set correctly. Finger of Death won't explode the unit when the system is installed correctly, unless you use my trigger fix.

About your Critical Strike text tag, there's probably a multi-step solution where you can do something whacky to roughly get the pre-damage value, such as damaging the target unit with normal damage, seeing what the reduction rate is and then reversing that scaling against the original damageventamount, and THEN displaying the text tag.

Again, I strongly recommend upgrading your WarCraft 3 to the latest patch. I bought a new laptop just to be able to keep up with the modding scene. 1.26a sounds like a patch that a lot of illegitimate WarCraft 3 owners might be on.
 
Last edited:
Status
Not open for further replies.
Top