1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  5. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  6. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  7. The results are out! Check them out.
    Dismiss Notice
  8. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  9. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Damage Per Fight 1.60

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

  1. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,905
    Resources:
    1
    Spells:
    1
    Resources:
    1
    There are a bunch of erroneous [B]..[/B] in your trigger tags, and all of the trigger text is actually in bold. You should fix that, it looks weird.
     
  2. Shunpomaster

    Shunpomaster

    Joined:
    Jun 13, 2017
    Messages:
    83
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Fixed thanks





    Changed Damage Engine to older Version since it was requested and it work just fine either way.
     
    Last edited: Aug 13, 2019
  3. Ricola3D

    Ricola3D

    Joined:
    Feb 27, 2019
    Messages:
    218
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Nice system idea, it is please to know which player did the most damages (particularly if it's you :D)