• 🏆 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] Any idea in how to achieve "Total Damage Dealt"?

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
3,213
Use some Damage Detection System found in "Spell" sections. I'll do the example with Weep¡s GDD.

GDD_Event becomes equal to 0
-> If Then Else
-> If Unit Type of GDD_DamagedUnit equal to *YourBossUnitType* then:
-> Set BossDamage (real variable) = BossDamage + GDD_Damage

You can also do this with Hashtable on the boss unit ID instead of UnitType.

You can use an If THen else later to display the message when the unit dies, or another trigger with "A unit dies" bla bla...
 
Level 4
Joined
Aug 5, 2011
Messages
99
  • calculate damage
    • Events
      • Unit - select your boss <gen> Takes damage
    • Conditions
    • Actions
      • Set dmgDealt[(Player number of (Owner of (Damage source)))] = (dmgDealt[(Player number of (Owner of (Triggering unit)))] + (Damage taken))
  • show damage
    • Events
      • Unit - select your boss <gen> Dies
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: (player + ((Name of (Player((Integer A)))) + ( dealt + ((String(dmgDealt[(Integer A)])) + damage))))
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
I would keep it simple. You don't necessarily need a damage detection system.

  • Damage
    • Events
      • Unit - Dreadlord 0004 <gen> Takes damage
    • Conditions
    • Actions
      • Set BOSS_DAMAGE[(Player number of (Owner of (Damage source)))] = (BOSS_DAMAGE[(Player number of (Owner of (Damage source)))] + (Damage taken))
  • Die
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to BOSS
    • Actions
      • Set r1 = 0.00
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: (Player + ((String((Integer A))) + ( dealt + ((String(BOSS_DAMAGE[(Integer A)])) + (to + (Proper name of BOSS))))))
          • Set r1 = (r1 + BOSS_DAMAGE[(Integer A)])
          • Set BOSS_DAMAGE[(Integer A)] = 0.00
      • Game - Display to (All players) the text: (Total damage was + (String((Integer(r1)))))
http://www.hiveworkshop.com/forums/pastebin.php?id=pj23lm

EDIT: Threads merged. Don't double post threads.
 
Level 11
Joined
May 13, 2010
Messages
167
I would keep it simple. You don't necessarily need a damage detection system.

  • Damage
    • Events
      • Unit - Dreadlord 0004 <gen> Takes damage
    • Conditions
    • Actions
      • Set BOSS_DAMAGE[(Player number of (Owner of (Damage source)))] = (BOSS_DAMAGE[(Player number of (Owner of (Damage source)))] + (Damage taken))
  • Die
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to BOSS
    • Actions
      • Set r1 = 0.00
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: (Player + ((String((Integer A))) + ( dealt + ((String(BOSS_DAMAGE[(Integer A)])) + (to + (Proper name of BOSS))))))
          • Set r1 = (r1 + BOSS_DAMAGE[(Integer A)])
          • Set BOSS_DAMAGE[(Integer A)] = 0.00
      • Game - Display to (All players) the text: (Total damage was + (String((Integer(r1)))))
http://www.hiveworkshop.com/forums/pastebin.php?id=pj23lm

EDIT: Threads merged. Don't double post threads.


I made a couple of modifications. Work pretty well, though. Thanks a lot everyone!
 
Status
Not open for further replies.
Top