• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Damage Per Fight 1.60

This bundle is marked as awaiting update. A staff member has requested changes to it before it can be approved.
  • Like
Reactions: Vinz
This system can be used to check damage for each player in a fight

Features:
  • Total Damage from each player not per unit
  • Show Damage of each player to all players to participate in the fight
  • Work on single Target (Boss) and on fights with multiple units like Adds that spawn mid fight
This system is mainly for RPG maps which have many Boss fights.

Triggers:

1-Single Target


  • DPF Start

  • DPF Start
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of DamageEventTarget) Equal to DPS Dummy
          • (Unit-type of DamageEventTarget) Equal to Rifleman
      • (DamageEventTarget is in DPF_TargetGroup) Equal to False
    • Actions
      • Set DPF_IndexSingle = (DPF_IndexSingle + 1)
      • Set DPF_TargetSingle[DPF_IndexSingle] = DamageEventTarget
      • -------- Change (OR) Condition Above --------
      • Unit Group - Add DamageEventTarget to DPF_TargetGroup
      • Set DPF_TargetPoint = (Position of DamageEventTarget)
      • -------- Range can be changed --------
      • Set DPF_Range = 600.00
      • Set DPF_Group[(Custom value of DamageEventTarget)] = (Units within DPF_Range of DPF_TargetPoint matching (((Matching unit) belongs to an enemy of (Owner of DamageEventTarget)) Equal to True))
      • Set DPF_TargetHealth[(Custom value of DamageEventTarget)] = (Life of DamageEventTarget)
      • Custom script: call RemoveLocation(udg_DPF_TargetPoint)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DPF_IndexSingle Equal to 1
        • Then - Actions
          • Trigger - Turn on DPF Damage <gen>
          • Trigger - Turn on DPF CheckEnd <gen>
        • Else - Actions



  • DPF Damage
  • DPF Damage
    • Events
      • Game - AfterDamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventTarget is in DPF_TargetGroup) Equal to True
      • (DamageEventTarget is in DPF_DamageGroup[(Custom value of DamageEventTarget)]) Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventTarget is alive) Equal to True
        • Then - Actions
          • Set DPF_TargetHealth[(Custom value of DamageEventTarget)] = (Life of DamageEventTarget)
          • Set DPF_UnitDamage[(Player number of (Owner of DamageEventSource))] = (DPF_UnitDamage[(Player number of (Owner of DamageEventSource))] + DamageEventAmount)
          • Set DPF_TotalDamage[(Custom value of DamageEventTarget)] = (DPF_TotalDamage[(Custom value of DamageEventTarget)] + DamageEventAmount)
        • Else - Actions
          • Set DPF_UnitDamage[(Player number of (Owner of DamageEventSource))] = (DPF_UnitDamage[(Player number of (Owner of DamageEventSource))] + DPF_TargetHealth[(Custom value of DamageEventTarget)])
          • Set DPF_TotalDamage[(Custom value of DamageEventTarget)] = (DPF_TotalDamage[(Custom value of DamageEventTarget)] + DPF_TargetHealth[(Custom value of DamageEventTarget)])


  • DPF CheckEnd
  • DPF CheckEnd
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • For each (Integer DPF_LoopSingle) from 1 to DPF_IndexSingle, do (Actions)
        • Loop - Actions
          • Set DPF_Range = 1000.00
          • Set DPF_TargetPoint = (Position of DPF_TargetSingle[DPF_LoopSingle])
          • Set DPF_AllyGroup = (Units within DPF_Range of DPF_TargetPoint matching ((((Matching unit) belongs to an enemy of (Owner of DPF_TargetSingle[DPF_LoopSingle])) Equal to True) and (((Matching unit) is alive) Equal to True)))
          • Unit Group - Pick every unit in DPF_AllyGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is in DPF_Group[(Custom value of DPF_TargetSingle[DPF_LoopSingle])]) Equal to False
                • Then - Actions
                  • Unit Group - Add (Picked unit) to DPF_Group[(Custom value of DPF_TargetSingle[DPF_LoopSingle])]
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Number of units in DPF_AllyGroup) Equal to 0
                  • (DPF_TargetSingle[DPF_LoopSingle] is alive) Equal to False
            • Then - Actions
              • Unit Group - Remove DPF_TargetSingle[DPF_LoopSingle] from DPF_TargetGroup
              • Unit Group - Pick every unit in DPF_Group[(Custom value of DPF_TargetSingle[DPF_LoopSingle])] and do (Actions)
                • Loop - Actions
                  • Set DPF_Index = (DPF_Index + 1)
                  • Set DPF_UnitDPS[DPF_Index] = 0.00
                  • Set DPF_Player[DPF_Index] = (Owner of (Picked unit))
                  • Set DPF_UnitDPS[DPF_Index] = ((DPF_UnitDamage[(Player number of (Owner of (Picked unit)))] / DPF_TotalDamage[(Custom value of DPF_TargetSingle[DPF_LoopSingle])]) x 100.00)
                  • Set DPF_DamageInteger[DPF_Index] = (Integer(DPF_UnitDamage[(Player number of (Owner of (Picked unit)))]))
                  • Set DPF_UnitDamage[(Player number of (Owner of (Picked unit)))] = 0.00
                  • Player Group - Add DPF_Player[DPF_Index] to DPF_PlayerGroup
              • Game - Display to DPF_PlayerGroup for 120.00 seconds the text: (-------------------- + ((Total Damage : + (String((Integer(DPF_TotalDamage[(Custom value of DPF_TargetSingle[DPF_LoopSingle])]))))) + --------------------))
              • Game - Display to DPF_PlayerGroup for 120.00 seconds the text: ...
              • For each (Integer DPF_Loop) from 1 to DPF_Index, do (Actions)
                • Loop - Actions
                  • Game - Display to DPF_PlayerGroup for 120.00 seconds the text: ((( + (Name of DPF_Player[DPF_Loop])) + -- ) + (((String(DPF_DamageInteger[DPF_Loop])) + ) + ((String(DPF_UnitDPS[DPF_Loop])) + %)))
              • Game - Display to DPF_PlayerGroup for 120.00 seconds the text: ...
              • Game - Display to DPF_PlayerGroup for 120.00 seconds the text: -------------------...
              • For each (Integer DPF_Loop) from 1 to DPF_Index, do (Actions)
                • Loop - Actions
                  • Unit Group - Pick every unit in DPF_Group[(Custom value of DPF_TargetSingle[DPF_LoopSingle])] and do (Actions)
                    • Loop - Actions
                      • Set DPF_DamageInteger[DPF_Loop] = 0
                  • Player Group - Remove DPF_Player[DPF_Loop] from DPF_PlayerGroup
              • Custom script: call DestroyGroup(udg_DPF_Group[GetUnitUserData(udg_DPF_TargetSingle[udg_DPF_LoopSingle])])
              • Set DPF_TotalDamage[(Custom value of DPF_TargetSingle[DPF_LoopSingle])] = 0.00
              • Set DPF_TargetSingle[DPF_LoopSingle] = DPF_TargetSingle[DPF_LoopSingle]
              • Set DPF_IndexSingle = (DPF_IndexSingle - 1)
              • Set DPF_Index = 0
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DPF_IndexSingle Equal to 0
                • Then - Actions
                  • Trigger - Turn off DPF Damage <gen>
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
          • Custom script: call RemoveLocation(udg_DPF_TargetPoint)
          • Custom script: call DestroyGroup(udg_DPF_AllyGroup)


2-Area

  • DPS Start Area

  • DPF Start Area
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of DamageEventTarget) Equal to DPS Dummy
          • (Unit-type of DamageEventTarget) Equal to Rifleman
      • (DamageEventTarget is in DPF_TargetGroup) Equal to False
    • Actions
      • -------- Change (OR) Condition Above --------
      • Unit Group - Add DamageEventTarget to DPF_TargetGroup
      • Set DPF_IndexArea = (DPF_IndexArea + 1)
      • Set DPF_TargetArea[DPF_IndexArea] = DamageEventTarget
      • -------- ----------------------- --------
      • -------- Range can be changed --------
      • Set DPF_Range = 1200.00
      • Set DPF_TargetPoint = (Position of DamageEventTarget)
      • Set DPF_Group[(Custom value of DamageEventTarget)] = (Units within DPF_Range of DPF_TargetPoint matching (((Matching unit) belongs to an enemy of (Owner of DamageEventTarget)) Equal to True))
      • Set DPF_DamageGroup[(Custom value of DamageEventTarget)] = (Units owned by (Owner of DamageEventTarget) matching ((Matching unit) Equal to DamageEventTarget))
      • Custom script: call RemoveLocation(udg_DPF_TargetPoint)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DPF_IndexArea Equal to 1
        • Then - Actions
          • Trigger - Turn on DPF Target Health <gen>
          • Trigger - Turn on DPF Damage Area <gen>
          • Trigger - Turn on DPF CheckEnd Area <gen>
        • Else - Actions

  • DPF Target Health


  • DPF Target Health
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DPF_TargetGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DamageEventTarget is in DPF_DamageGroup[(Custom value of (Picked unit))]) Equal to True
            • Then - Actions
              • Set DPF_TargetHealthArea[(Custom value of DamageEventTarget)] = (Life of DamageEventTarget)
            • Else - Actions
  • DPF Damage Area
  • DPF Damage Area
    • Events
      • Game - AfterDamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DPF_TargetGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DamageEventTarget is in DPF_DamageGroup[(Custom value of (Picked unit))]) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (DamageEventTarget is alive) Equal to False
                • Then - Actions
                  • Set DPF_UnitDamage[(Player number of (Owner of DamageEventSource))] = (DPF_UnitDamage[(Player number of (Owner of DamageEventSource))] + DPF_TargetHealthArea[(Custom value of DamageEventTarget)])
                  • Set DPF_TotalDamage[(Custom value of (Picked unit))] = (DPF_TotalDamage[(Custom value of (Picked unit))] + DPF_TargetHealthArea[(Custom value of DamageEventTarget)])
                • Else - Actions
                  • Set DPF_UnitDamage[(Player number of (Owner of DamageEventSource))] = (DPF_UnitDamage[(Player number of (Owner of DamageEventSource))] + DamageEventAmount)
                  • Set DPF_TotalDamage[(Custom value of (Picked unit))] = (DPF_TotalDamage[(Custom value of (Picked unit))] + DamageEventAmount)
            • Else - Actions
  • DPF CheckEnd Area
  • DPF CheckEnd Area
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • For each (Integer DPF_LoopArea) from 1 to DPF_IndexArea, do (Actions)
        • Loop - Actions
          • Set DPF_Range = 1200.00
          • Set DPF_TargetPoint = (Position of DPF_TargetArea[DPF_LoopArea])
          • Set DPF_EnemyGroup = (Units within DPF_Range of DPF_TargetPoint matching ((((Matching unit) belongs to an ally of (Owner of DPF_TargetArea[DPF_LoopArea])) Equal to True) and (((Matching unit) is alive) Equal to True)))
          • Unit Group - Pick every unit in DPF_EnemyGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is in DPF_DamageGroup[(Custom value of DPF_TargetArea[DPF_LoopArea])]) Equal to False
                • Then - Actions
                  • Unit Group - Add (Picked unit) to DPF_DamageGroup[(Custom value of DPF_TargetArea[DPF_LoopArea])]
                • Else - Actions
          • Set DPF_AllyGroup = (Units within DPF_Range of DPF_TargetPoint matching ((((Matching unit) belongs to an enemy of (Owner of DPF_TargetArea[DPF_LoopArea])) Equal to True) and (((Matching unit) is alive) Equal to True)))
          • Unit Group - Pick every unit in DPF_AllyGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is in DPF_Group[(Custom value of DPF_TargetArea[DPF_LoopArea])]) Equal to False
                • Then - Actions
                  • Unit Group - Add (Picked unit) to DPF_Group[(Custom value of DPF_TargetArea[DPF_LoopArea])]
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Number of units in DPF_AllyGroup) Equal to 0
                  • (DPF_TargetArea[DPF_LoopArea] is alive) Equal to False
            • Then - Actions
              • Unit Group - Remove DPF_TargetArea[DPF_LoopArea] from DPF_TargetGroup
              • Unit Group - Pick every unit in DPF_Group[(Custom value of DPF_TargetArea[DPF_LoopArea])] and do (Actions)
                • Loop - Actions
                  • Set DPF_Index = (DPF_Index + 1)
                  • Set DPF_UnitDPS[DPF_Index] = 0.00
                  • Set DPF_Player[DPF_Index] = (Owner of (Picked unit))
                  • Set DPF_UnitDPS[DPF_Index] = ((DPF_UnitDamage[(Player number of (Owner of (Picked unit)))] / DPF_TotalDamage[(Custom value of DPF_TargetArea[DPF_LoopArea])]) x 100.00)
                  • Set DPF_DamageInteger[DPF_Index] = (Integer(DPF_UnitDamage[(Player number of (Owner of (Picked unit)))]))
                  • Set DPF_UnitDamage[(Player number of (Owner of (Picked unit)))] = 0.00
                  • Player Group - Add DPF_Player[DPF_Index] to DPF_PlayerGroup
              • Game - Display to DPF_PlayerGroup for 120.00 seconds the text: (-------------------- + ((Total Damage : + (String((Integer(DPF_TotalDamage[(Custom value of DPF_TargetArea[DPF_LoopArea])]))))) + --------------------))
              • Game - Display to DPF_PlayerGroup for 120.00 seconds the text: ...
              • For each (Integer DPF_Loop) from 1 to DPF_Index, do (Actions)
                • Loop - Actions
                  • Game - Display to DPF_PlayerGroup for 120.00 seconds the text: ((( + (Name of DPF_Player[DPF_Loop])) + -- ) + (((String(DPF_DamageInteger[DPF_Loop])) + ) + ((String(DPF_UnitDPS[DPF_Loop])) + %)))
              • Game - Display to DPF_PlayerGroup for 120.00 seconds the text: ...
              • Game - Display to DPF_PlayerGroup for 120.00 seconds the text: -------------------...
              • For each (Integer DPF_Loop) from 1 to DPF_Index, do (Actions)
                • Loop - Actions
                  • Unit Group - Pick every unit in DPF_Group[(Custom value of DPF_TargetArea[DPF_LoopArea])] and do (Actions)
                    • Loop - Actions
                      • Set DPF_DamageInteger[DPF_Loop] = 0
                  • Player Group - Remove DPF_Player[DPF_Loop] from DPF_PlayerGroup
              • Custom script: call DestroyGroup(udg_DPF_Group[GetUnitUserData(udg_DPF_TargetArea[udg_DPF_LoopArea])])
              • Custom script: call DestroyGroup(udg_DPF_DamageGroup[GetUnitUserData(udg_DPF_TargetArea[udg_DPF_LoopArea])])
              • Set DPF_TotalDamage[(Custom value of DPF_TargetArea[DPF_LoopArea])] = 0.00
              • Set DPF_Index = 0
              • Set DPF_TargetArea[DPF_LoopArea] = DPF_TargetArea[DPF_IndexArea]
              • Set DPF_IndexArea = (DPF_IndexArea - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DPF_IndexArea Equal to 0
                • Then - Actions
                  • Trigger - Turn off DPF Target Health <gen>
                  • Trigger - Turn off DPF Damage Area <gen>
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
          • Custom script: call RemoveLocation(udg_DPF_TargetPoint)
          • Custom script: call DestroyGroup(udg_DPF_AllyGroup)
          • Custom script: call DestroyGroup(udg_DPF_EnemyGroup)





Changes:


Damag Per Fight 1.10
  • Now shows Damage + Percent. used to be only percent
Damage Per Fight 1.50
  • Added Area Damage Option
  • Improved Triggers

Damage Per Fight 1.60
  • Improved Triggers
  • Now detect all in range heroes instead of having to attack him at least once








How to copy:



  • Turn On "automaticly create unknown variables".
  • Copy Damage Engine to your map.
  • Unit indexing to your map
  • Copy DPF to your map.
Credits:

Thanks to Bribe's Damage Engine and unit indexing Systems I managed to make this.


Keywords:
Damage, Damage system, system
Contents

Damage Per Fight 1.50 (Map)

Reviews
Rheiko
This is a wonderful system idea. However, the execution is rather underwhelming. Currently, it looks more like a template than a system. While the more experienced user can try to get into the triggers and customize the system themselves, less...

Rheiko

Spell Reviewer
Level 27
Joined
Aug 27, 2013
Messages
4,216
This is a wonderful system idea. However, the execution is rather underwhelming. Currently, it looks more like a template than a system. While the more experienced user can try to get into the triggers and customize the system themselves, less experienced ones will have much more trouble delving into what is allowed to be altered and what is not. To help you upon improving this system:
  • Make a separate trigger that serves as a configuration. The user does not need to know the inner workings of your system, but they need to be able to customize the system to their needs easily through this configuration.
  • Write a documentation (using comments inside the trigger, another through resource description) to guide the users on how they can customize the system to their needs and preferences.
  • Currently you have two separate system for Single Target Fight and Area Fight. I think it will be more compact if you can combine them and allow the user to switch between them. Perhaps using a boolean value as a toggle or integer value as a mode.
I do realize the author of this system is inactive at the moment, but should they come back and decide to make an update to this resource, please consider the points I have mentioned above. Until then,

Awaiting Update
 
Top