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

Damage Per Fight 1.60

This bundle is marked as pending. It has not been reviewed by a staff member yet.
  • 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)

Top