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

[General] Damage Detection function

Status
Not open for further replies.
Level 5
Joined
Dec 25, 2018
Messages
110
I heard that newest patch added a way to detect damage like GDD does, but I can't find it anywhere.
Could anyone show me an example?
 
Level 9
Joined
Jul 30, 2018
Messages
445
Yes, there are no GUI equivalents for the new natives. Even though there are now new natives by Blizzard for damage detection, I'd still suggest to use Damage Engine or something, since it's a lot easier to use than to make your own triggers. Also Damage Engine for example has a lot of other features too.
 
Level 5
Joined
Dec 25, 2018
Messages
110
Yes, there are no GUI equivalents for the new natives. But I'd still suggest to use Damage Engine or something, since it's a lot easier to use than to make your own triggers. Also Damage Engine for example has a lot of other features too.
My fear is that those might break in future wc3 patches.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
I would recommend using Damage Engine 5.4.2.0. Yeah the events aren't public to GUI yet, but you wouldn't believe the hurdles that need to be gone over in order to compensate of the glitchy and complex rhythm of WarCraft 3's damage processing. In the end you'd want to use a system as flushed out as Damage Engine if you want to take advantage of all the game has to offer - there's no other system like it.

A basic damage detection trigger looks like this:

  • On Damage
    • Events
      • Game - Value of DamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Game - Display to (All Players) the text (Name of DamageEventSource) + Damaged + (Name of DamageEventTarget) + for (DamageEventAmount)
Basic modification to double the damage looks like this:

  • Mod Damage
    • Events
      • Game - Value of DamageModifierEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Set DamageEventAmount = (DamageEventAmount x 2)
Those cover really simple scenarios. Here's how you detect things like Ranged or Spell Damage:

  • Ranged Damage
    • Events
      • Game - Value of DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageRanged Equal to True
    • Actions
  • Spell Damage
    • Events
      • Game - Value of DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to True
    • Actions
And here's a more complex feature recently added about how you can "deflect" an attack from the target back at the source:

  • Deflect Damage
    • Events
      • Game - Value of DamageModifierEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Unit - Cause DamageEventTarget to damage DamageEventSource for DamageEventAmount using attack type CONVERTED_ATTACK_TYPE[DamageEventAttackT] and damage type CONVERTED_DAMAGE_TYPE[DamageEventDamageT]
      • Set DamageEventAmount = 0.00
Here's "dodging" damage (no impact sound is played):

  • Dodge Damage
    • Events
      • Game - Value of DamageModifierEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Set DamageEventWeaponT = WEAPON_TYPE_NONE
      • Set DamageEventArmorT = ARMOR_TYPE_NONE
      • Set DamageEventAmount = 0.00
 
Last edited:
Status
Not open for further replies.
Top