• 🏆 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 Detection System (GUI) For Reforged v0.6b

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: IcemanBo
Small & Simple GUI Damage Detection System (Reforged)
In Reforged exists native DDS and that system to handle these functions and methods.
Using same variables and methods as Bribe's DDS.
Differences:
1 - To detect Damage Type/Armor Type/Defense Type/Weapon Type/Attack Type BOOL variables are used. Instead of custom integer. for example - if (DEFENSE_TYPE_MEDIUM == true)
2 - To change Damage Type/Attack Type new variables are used.
for example - DamageEventDamageT == Spell)
3 - To change Armor Type/Defense Type/Weapon Type used BOOL variables. Just set value to TRUE and engine will change the type.
4 - It is made on triggers that allows you to simply understand and change according to needs.
5 - New Event Response and Variables from Blizzard are used.

It is a tiny system which gives you a powerful tool to detect and Modify:

  • Damage Source
  • Damage Target
  • Damage Amount + Modification +/-
  • Damage Type + Modification (by setting type)
  • Defense Type (Medium/Heavy/Hero etc)
  • Armor Type (flesh/metal/stone etc)
  • Attack Type+ Modification (by setting type)
  • Weapon Type+ Modification (by bool)
  • Attack is Normal or Not (if skill or regular attack)
  • IsSpell
  • is Melee/ IsRange
  • isLethal
Features:

  • Easy BOOL conditions usage for detecting any types of Damage or Armor
  • Modify dealing damage through any deep modifications.
  • Attaching unique Key to each damage event to prevent useless conditions during several damage modifications
  • Based on GUI triggers for any modifications.
  • Full Version and Tiny.
  • new Native Blizzard's functions and methods. Which makes you free out of tones of JASS and so on.
  • Same varibales as in Bribe's system so you can easly implement.

Reworked all variables to compare with Bribe's DDS. Added Lethal detection and HP, Weapon Type Detection and Modification. IsMelee or IsRange detection.
New Events:
  • AfterDamageEvent
  • DamageModifierEvent
  • LethalDamageEvent
New modification:
  • Attack Type (by setting variable DamageEventAttackT = Type of Attack)
  • Damage Type (by setting variable DamageEventDamageT = Type of Damage)
  • Weapon Type (by setting bool variable WEAPON_TYPE_ML_CHOP = true)

Added an event key let you to generate unique key to work with futher damage (attach key to event) modifications without repeating conditions. Just one time generate a key and then check its value and make the operations with future damage modifications. Needs 1 extra real variable and generator trigger (1 action) also need a real variable (or array) for each case when you want to handle unique modification events.

Added event after damage modification - now it is possible to handle event after damage been modified to get new damage amount and make extra actions with it. (in both verisons) in Verison 0.5a Added several stages of handing.

Added Armor Type detection for Damage Target.

Added Defense Type of Damage Target. In BOOL variables implementation. Now its possible to modify damage depending on units defense type.

Added Damage Modifier to change amout of dealing damage can be possitive or negative value. Must be not equal to 0 to modify.
Important! - if you causing damage via trigger and using Damage Modifier variable you need to paste Damage Modifier AFTER damaging action. (Its Blizzard's mechanics) - in v 0.5 added way how to make it possible


At first you need to attach Engine to Event:

  • Damage Engine Event
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet Damage_Trigger = Damage Engine Core <gen>
      • Custom script: call TriggerRegisterAnyUnitEventBJ(udg_Damage_Trigger, EVENT_PLAYER_UNIT_DAMAGED)

The system itself is made in two versions - Light and Full

Light version allows you to detect:

  • Damage Source
  • Damage Target
  • Damage Amount
  • Attack is Normal or Not
Its enought for common usage. Attack is Normal or Not is a BOOL which is true if Attack is Normal or False if Attack is skill. That means you can easly use it for custom spells, abilities and so on. It needs only 5 variables to work!


The Full Verison Gives you full information about type of damage and type of attack (normal/divine/hero/pierce/cold/fire and so on)

added detection and modify - weapon, armor and defense
Added Armor types.
All Variables are BOOL so it let you to make checks easly.

  • Damage Engine Core
    • Events
    • Conditions
    • Actions
      • Custom script: local real DamageAmount = 0.00
      • Custom script: local attacktype AttackType = null
      • Custom script: local damagetype DamageType = null
      • Custom script: local armortype ArmorType = null
      • Custom script: local integer ArmorTypeTemp = 0
      • Custom script: local defensetype DefenseType = null
      • Custom script: local integer DefenseTypeTemp = 0
      • Custom script: local weapontype WeaponType = null
      • Custom script: local integer WeaponTypeIndex = 0
      • Custom script: local integer WeaponTypeIndexMod = 0
      • Set VariableSet DamageEvent = 0.00
      • -------- Set Basic Variables --------
      • Set VariableSet DamageEventSource = (Damage source)
      • Set VariableSet DamageEventTarget = (Damage Target)
      • Set VariableSet DamageEventAmount = (Damage taken)
      • Set VariableSet DamageEventDamageT = (Damage Type)
      • Set VariableSet DamageEventAttackT = (Damage Attack Type)
      • Custom script: set DamageAmount = udg_DamageEventAmount
      • Custom script: set DamageType = udg_DamageEventDamageT
      • Custom script: set AttackType = udg_DamageEventAttackT
      • Custom script: set WeaponType = BlzGetEventWeaponType()
      • -------- Detect Targets Defense type --------
      • Custom script: set DefenseTypeTemp = BlzGetUnitIntegerField(udg_DamageEventTarget, UNIT_IF_DEFENSE_TYPE)
      • Custom script: if (DefenseTypeTemp == 0) then
      • Set VariableSet DEFENSE_TYPE_LIGHT = True
      • Custom script: elseif (DefenseTypeTemp == 1) then
      • Set VariableSet DEFENSE_TYPE_MEDIUM = True
      • Custom script: elseif (DefenseTypeTemp == 2) then
      • Set VariableSet DEFENSE_TYPE_HEAVY = True
      • Custom script: elseif (DefenseTypeTemp == 3) then
      • Set VariableSet DEFENSE_TYPE_FORTIFIED = True
      • Custom script: elseif (DefenseTypeTemp == 4) then
      • Set VariableSet DEFENSE_TYPE_NORMAL = True
      • Custom script: elseif (DefenseTypeTemp == 5) then
      • Set VariableSet DEFENSE_TYPE_HERO = True
      • Custom script: elseif (DefenseTypeTemp == 6) then
      • Set VariableSet DEFENSE_TYPE_DIVINE = True
      • Custom script: else
      • Set VariableSet DEFENSE_TYPE_UNARMORED = True
      • Custom script: endif
      • -------- Detect Targets Armor type --------
      • Custom script: set ArmorTypeTemp = BlzGetUnitIntegerField(udg_DamageEventTarget, UNIT_IF_ARMOR_TYPE)
      • Custom script: if (ArmorTypeTemp == 1) then
      • Set VariableSet ARMOR_TYPE_FLESH = True
      • Custom script: elseif (ArmorTypeTemp == 2) then
      • Set VariableSet ARMOR_TYPE_METAL = True
      • Custom script: elseif (ArmorTypeTemp == 3) then
      • Set VariableSet ARMOR_TYPE_WOOD = True
      • Custom script: elseif (ArmorTypeTemp == 4) then
      • Set VariableSet ARMOR_TYPE_ETHEREAL = True
      • Custom script: elseif (ArmorTypeTemp == 5) then
      • Set VariableSet ARMOR_TYPE_STONE = True
      • Custom script: else
      • Set VariableSet ARMOR_TYPE_NONE = True
      • Custom script: endif
      • -------- Detect Attack Type --------
      • Custom script: if udg_DamageEventAttackT == ATTACK_TYPE_NORMAL then
      • Set VariableSet ATTACK_TYPE_SPELLS = True
      • Custom script: elseif udg_DamageEventAttackT == ATTACK_TYPE_MELEE then
      • Set VariableSet ATTACK_TYPE_NORMAL = True
      • Custom script: elseif udg_DamageEventAttackT == ATTACK_TYPE_PIERCE then
      • Set VariableSet ATTACK_TYPE_PIERCE = True
      • Custom script: elseif udg_DamageEventAttackT == ATTACK_TYPE_SIEGE then
      • Set VariableSet ATTACK_TYPE_SIEGE = True
      • Custom script: elseif udg_DamageEventAttackT == ATTACK_TYPE_MAGIC then
      • Set VariableSet ATTACK_TYPE_MAGIC = True
      • Custom script: elseif udg_DamageEventAttackT == ATTACK_TYPE_CHAOS then
      • Set VariableSet ATTACK_TYPE_CHAOS = True
      • Custom script: elseif udg_DamageEventAttackT == ATTACK_TYPE_HERO then
      • Set VariableSet ATTACK_TYPE_HERO = True
      • Custom script: endif
      • -------- Detect Damage Type --------
      • Custom script: if udg_DamageEventDamageT == DAMAGE_TYPE_UNKNOWN then
      • Set VariableSet DAMAGE_TYPE_UNKNOWN = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_NORMAL then
      • Set VariableSet DAMAGE_TYPE_NORMAL = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_ENHANCED then
      • Set VariableSet DAMAGE_TYPE_ENCHANCED = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_FIRE then
      • Set VariableSet DAMAGE_TYPE_FIRE = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_COLD then
      • Set VariableSet DAMAGE_TYPE_COLD = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_LIGHTNING then
      • Set VariableSet DAMAGE_TYPE_LIGHTNING = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_POISON then
      • Set VariableSet DAMAGE_TYPE_POISON = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_DISEASE then
      • Set VariableSet DAMAGE_TYPE_DISEASE = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_DIVINE then
      • Set VariableSet DAMAGE_TYPE_DIVINE = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_MAGIC then
      • Set VariableSet DAMAGE_TYPE_MAGIC = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_SONIC then
      • Set VariableSet DAMAGE_TYPE_SONIC = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_ACID then
      • Set VariableSet DAMAGE_TYPE_ACID = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_FORCE then
      • Set VariableSet DAMAGE_TYPE_FORCE = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_DEATH then
      • Set VariableSet DAMAGE_TYPE_DEATH = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_MIND then
      • Set VariableSet DAMAGE_TYPE_MIND = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_PLANT then
      • Set VariableSet DAMAGE_TYPE_PLANT = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_DEFENSIVE then
      • Set VariableSet DAMAGE_TYPE_DEFENSIVE = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_DEMOLITION then
      • Set VariableSet DAMAGE_TYPE_DEMOLITION = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_SLOW_POISON then
      • Set VariableSet DAMAGE_TYPE_SLOW_POISON = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_SPIRIT_LINK then
      • Set VariableSet DAMAGE_TYPE_SPIRIT_LINK = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_SHADOW_STRIKE then
      • Set VariableSet DAMAGE_TYPE_SHADOW_STRIKE = True
      • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_UNIVERSAL then
      • Set VariableSet DAMAGE_TYPE_UNIVERSAL = True
      • Custom script: endif
      • -------- Detect Weapon Type --------
      • Custom script: if WeaponType == WEAPON_TYPE_METAL_LIGHT_CHOP then
      • Custom script: set WeaponTypeIndex = 1
      • Set VariableSet WEAPON_TYPE_ML_CHOP = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_MEDIUM_CHOP then
      • Custom script: set WeaponTypeIndex = 2
      • Set VariableSet WEAPON_TYPE_MM_CHOP = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_HEAVY_CHOP then
      • Custom script: set WeaponTypeIndex = 3
      • Set VariableSet WEAPON_TYPE_MH_CHOP = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_LIGHT_SLICE then
      • Custom script: set WeaponTypeIndex = 4
      • Set VariableSet WEAPON_TYPE_ML_SLICE = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_MEDIUM_SLICE then
      • Custom script: set WeaponTypeIndex = 5
      • Set VariableSet WEAPON_TYPE_MM_SLICE = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_HEAVY_SLICE then
      • Custom script: set WeaponTypeIndex = 6
      • Set VariableSet WEAPON_TYPE_MH_SLICE = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_MEDIUM_BASH then
      • Custom script: set WeaponTypeIndex = 7
      • Set VariableSet WEAPON_TYPE_MM_BASH = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_HEAVY_BASH then
      • Custom script: set WeaponTypeIndex = 8
      • Set VariableSet WEAPON_TYPE_MH_BASH = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_MEDIUM_STAB then
      • Custom script: set WeaponTypeIndex = 9
      • Set VariableSet WEAPON_TYPE_MM_STAB = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_HEAVY_STAB then
      • Custom script: set WeaponTypeIndex = 10
      • Set VariableSet WEAPON_TYPE_MH_STAB = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_LIGHT_SLICE then
      • Custom script: set WeaponTypeIndex = 11
      • Set VariableSet WEAPON_TYPE_WL_SLICE = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_MEDIUM_SLICE then
      • Custom script: set WeaponTypeIndex = 12
      • Set VariableSet WEAPON_TYPE_WM_SLICE = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_HEAVY_SLICE then
      • Custom script: set WeaponTypeIndex = 13
      • Set VariableSet WEAPON_TYPE_WH_SLICE = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_LIGHT_BASH then
      • Custom script: set WeaponTypeIndex = 14
      • Set VariableSet WEAPON_TYPE_WL_BASH = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_MEDIUM_BASH then
      • Custom script: set WeaponTypeIndex = 15
      • Set VariableSet WEAPON_TYPE_WM_BASH = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_HEAVY_BASH then
      • Custom script: set WeaponTypeIndex = 16
      • Set VariableSet WEAPON_TYPE_WH_BASH = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_LIGHT_STAB then
      • Custom script: set WeaponTypeIndex = 17
      • Set VariableSet WEAPON_TYPE_WL_STAB = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_MEDIUM_STAB then
      • Custom script: set WeaponTypeIndex = 18
      • Set VariableSet WEAPON_TYPE_WM_STAB = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_CLAW_LIGHT_SLICE then
      • Custom script: set WeaponTypeIndex = 19
      • Set VariableSet WEAPON_TYPE_CL_SLICE = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_CLAW_MEDIUM_SLICE then
      • Custom script: set WeaponTypeIndex = 20
      • Set VariableSet WEAPON_TYPE_CM_SLICE = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_CLAW_HEAVY_SLICE then
      • Custom script: set WeaponTypeIndex = 21
      • Set VariableSet WEAPON_TYPE_CH_SLICE = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_AXE_MEDIUM_CHOP then
      • Custom script: set WeaponTypeIndex = 22
      • Set VariableSet WEAPON_TYPE_AM_CHOP = True
      • Custom script: elseif WeaponType == WEAPON_TYPE_ROCK_HEAVY_BASH then
      • Custom script: set WeaponTypeIndex = 23
      • Set VariableSet WEAPON_TYPE_RH_BASH = True
      • Custom script: else
      • Set VariableSet WEAPON_TYPE_NONE = True
      • Custom script: endif
      • -------- End Damage Type Detecting --------
      • -------- Detection IsNormal (Melee/Range) OR IsSpell --------
      • Custom script: if (AttackType != null and BlzGetEventIsAttack() == true) then
      • Set VariableSet IsDamageAttack = True
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventSource is A melee attacker) Equal to True
        • Then - Actions
          • Set VariableSet IsDamageMelee = True
        • Else - Actions
          • Set VariableSet IsDamageRanged = True
      • Custom script: else
      • Set VariableSet IsDamageSpell = True
      • Custom script: endif
      • -------- If Lethal Dmg --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of DamageEventTarget) Less than or equal to DamageEventAmount
        • Then - Actions
          • Set VariableSet IsDamageLethal = True
          • Set VariableSet LethalDamageEvent = 1.00
          • Set VariableSet LethalDamageHP = (Life of DamageEventTarget)
        • Else - Actions
      • -------- Run Event --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventAmount Greater than 0.00
        • Then - Actions
          • Set VariableSet DamageEvent = 1.00
        • Else - Actions
      • -------- Modify Params --------
      • -------- Detect Weapon Type --------
      • Custom script: if (udg_WEAPON_TYPE_ML_CHOP == true and WeaponTypeIndex != 1) then
      • Custom script: set WeaponTypeIndexMod = 1
      • Custom script: set WeaponType = WEAPON_TYPE_METAL_LIGHT_CHOP
      • Custom script: elseif (udg_WEAPON_TYPE_MM_CHOP == true and WeaponTypeIndex != 2) then
      • Custom script: set WeaponTypeIndexMod = 2
      • Custom script: set WeaponType = WEAPON_TYPE_METAL_MEDIUM_CHOP
      • Custom script: elseif (udg_WEAPON_TYPE_MH_CHOP == true and WeaponTypeIndex != 3) then
      • Custom script: set WeaponTypeIndexMod = 3
      • Custom script: set WeaponType = WEAPON_TYPE_METAL_HEAVY_CHOP
      • Custom script: elseif (udg_WEAPON_TYPE_ML_SLICE == true and WeaponTypeIndex != 4) then
      • Custom script: set WeaponTypeIndexMod = 4
      • Custom script: set WeaponType = WEAPON_TYPE_METAL_LIGHT_SLICE
      • Custom script: elseif (udg_WEAPON_TYPE_MM_SLICE == true and WeaponTypeIndex != 5) then
      • Custom script: set WeaponTypeIndexMod = 5
      • Custom script: set WeaponType = WEAPON_TYPE_METAL_MEDIUM_SLICE
      • Custom script: elseif (udg_WEAPON_TYPE_MH_SLICE == true and WeaponTypeIndex != 6) then
      • Custom script: set WeaponTypeIndexMod = 6
      • Custom script: set WeaponType = WEAPON_TYPE_METAL_HEAVY_SLICE
      • Custom script: elseif (udg_WEAPON_TYPE_MM_BASH == true and WeaponTypeIndex != 7) then
      • Custom script: set WeaponTypeIndexMod = 7
      • Custom script: set WeaponType = WEAPON_TYPE_METAL_MEDIUM_BASH
      • Custom script: elseif (udg_WEAPON_TYPE_MH_BASH == true and WeaponTypeIndex != 8) then
      • Custom script: set WeaponTypeIndexMod = 8
      • Custom script: set WeaponType = WEAPON_TYPE_METAL_HEAVY_BASH
      • Custom script: elseif (udg_WEAPON_TYPE_MM_STAB == true and WeaponTypeIndex != 9) then
      • Custom script: set WeaponTypeIndexMod = 9
      • Custom script: set WeaponType = WEAPON_TYPE_METAL_MEDIUM_STAB
      • Custom script: elseif (udg_WEAPON_TYPE_MH_STAB == true and WeaponTypeIndex != 10) then
      • Custom script: set WeaponTypeIndexMod = 10
      • Custom script: set WeaponType = WEAPON_TYPE_METAL_HEAVY_STAB
      • Custom script: elseif (udg_WEAPON_TYPE_WL_SLICE == true and WeaponTypeIndex != 11) then
      • Custom script: set WeaponTypeIndexMod = 11
      • Custom script: set WeaponType = WEAPON_TYPE_WOOD_LIGHT_SLICE
      • Custom script: elseif (udg_WEAPON_TYPE_WM_SLICE == true and WeaponTypeIndex != 12) then
      • Custom script: set WeaponTypeIndexMod = 12
      • Custom script: set WeaponType = WEAPON_TYPE_WOOD_MEDIUM_SLICE
      • Custom script: elseif (udg_WEAPON_TYPE_WH_SLICE == true and WeaponTypeIndex != 13) then
      • Custom script: set WeaponTypeIndexMod = 13
      • Custom script: set WeaponType = WEAPON_TYPE_WOOD_HEAVY_SLICE
      • Custom script: elseif (udg_WEAPON_TYPE_WL_BASH == true and WeaponTypeIndex != 14) then
      • Custom script: set WeaponTypeIndexMod = 14
      • Custom script: set WeaponType = WEAPON_TYPE_WOOD_LIGHT_BASH
      • Custom script: elseif (udg_WEAPON_TYPE_WM_BASH == true and WeaponTypeIndex != 15) then
      • Custom script: set WeaponTypeIndexMod = 15
      • Custom script: set WeaponType = WEAPON_TYPE_WOOD_MEDIUM_BASH
      • Custom script: elseif (udg_WEAPON_TYPE_WH_BASH == true and WeaponTypeIndex != 16) then
      • Custom script: set WeaponTypeIndexMod = 16
      • Custom script: set WeaponType = WEAPON_TYPE_WOOD_HEAVY_BASH
      • Custom script: elseif (udg_WEAPON_TYPE_WL_STAB == true and WeaponTypeIndex != 17) then
      • Custom script: set WeaponTypeIndexMod = 17
      • Custom script: set WeaponType = WEAPON_TYPE_WOOD_LIGHT_STAB
      • Custom script: elseif (udg_WEAPON_TYPE_WM_STAB == true and WeaponTypeIndex != 18) then
      • Custom script: set WeaponTypeIndexMod = 18
      • Custom script: set WeaponType = WEAPON_TYPE_WOOD_MEDIUM_STAB
      • Custom script: elseif (udg_WEAPON_TYPE_CL_SLICE == true and WeaponTypeIndex != 19) then
      • Custom script: set WeaponTypeIndexMod = 19
      • Custom script: set WeaponType = WEAPON_TYPE_CLAW_LIGHT_SLICE
      • Custom script: elseif (udg_WEAPON_TYPE_CM_SLICE == true and WeaponTypeIndex != 20) then
      • Custom script: set WeaponTypeIndexMod = 20
      • Custom script: set WeaponType = WEAPON_TYPE_CLAW_MEDIUM_SLICE
      • Custom script: elseif (udg_WEAPON_TYPE_CH_SLICE == true and WeaponTypeIndex != 21) then
      • Custom script: set WeaponTypeIndexMod = 21
      • Custom script: set WeaponType = WEAPON_TYPE_CLAW_HEAVY_SLICE
      • Custom script: elseif (udg_WEAPON_TYPE_AM_CHOP == true and WeaponTypeIndex != 22) then
      • Custom script: set WeaponTypeIndexMod = 22
      • Custom script: set WeaponType = WEAPON_TYPE_AXE_MEDIUM_CHOP
      • Custom script: elseif (udg_WEAPON_TYPE_RH_BASH == true and WeaponTypeIndex != 23) then
      • Custom script: set WeaponTypeIndexMod = 23
      • Custom script: set WeaponType = WEAPON_TYPE_ROCK_HEAVY_BASH
      • Custom script: endif
      • Custom script: if (WeaponTypeIndex != WeaponTypeIndexMod) then
      • Custom script: call BlzSetEventWeaponType(WeaponType)
      • Custom script: endif
      • -------- Attack Type Modify --------
      • Custom script: if (udg_DamageEventAttackT != AttackType) then
      • Event Response - Set Attack Type of Unit Damaged Event to DamageEventAttackT
      • Custom script: endif
      • -------- Damage Type Modify --------
      • Custom script: if (udg_DamageEventDamageT != DamageType) then
      • Event Response - Set Damage Type of Unit Damaged Event to DamageEventDamageT
      • Custom script: endif
      • -------- Apply damage modify --------
      • Custom script: if (udg_DamageEventAmount != DamageAmount) then
      • Set VariableSet DamageModifierEvent = 1.00
      • Event Response - Set Damage of Unit Damaged Event to DamageEventAmount
      • Set VariableSet AfterDamageEvent = 1.00
      • Set VariableSet DamageEvent = 2.00
      • Custom script: endif
      • -------- Clear --------
      • -------- Variables --------
      • Set VariableSet IsDamageAttack = False
      • Set VariableSet IsDamageSpell = False
      • Set VariableSet DamageModifierEvent = 0.00
      • Set VariableSet AfterDamageEvent = 0.00
      • Set VariableSet DamageEventSource = No unit
      • Set VariableSet DamageEventTarget = No unit
      • Set VariableSet DamageEventAmount = 0.00
      • Set VariableSet DamageEventDamageT = Unknown
      • Set VariableSet DamageKey = 0.00
      • Set VariableSet IsDamageLethal = False
      • Set VariableSet IsDamageRanged = False
      • Set VariableSet IsDamageMelee = False
      • Set VariableSet IsDamageLethal = False
      • Set VariableSet LethalDamageEvent = 0.00
      • Set VariableSet LethalDamageHP = 0.00
      • -------- ----- --------
      • Set VariableSet DEFENSE_TYPE_DIVINE = False
      • Set VariableSet DEFENSE_TYPE_FORTIFIED = False
      • Set VariableSet DEFENSE_TYPE_HEAVY = False
      • Set VariableSet DEFENSE_TYPE_HERO = False
      • Set VariableSet DEFENSE_TYPE_LIGHT = False
      • Set VariableSet DEFENSE_TYPE_MEDIUM = False
      • Set VariableSet DEFENSE_TYPE_NORMAL = False
      • Set VariableSet DEFENSE_TYPE_UNARMORED = False
      • -------- ----- --------
      • Set VariableSet ATTACK_TYPE_CHAOS = False
      • Set VariableSet ATTACK_TYPE_HERO = False
      • Set VariableSet ATTACK_TYPE_MAGIC = False
      • Set VariableSet ATTACK_TYPE_NORMAL = False
      • Set VariableSet ATTACK_TYPE_PIERCE = False
      • Set VariableSet ATTACK_TYPE_SIEGE = False
      • Set VariableSet ATTACK_TYPE_SPELLS = False
      • -------- ----- --------
      • Set VariableSet DAMAGE_TYPE_UNKNOWN = False
      • Set VariableSet DAMAGE_TYPE_NORMAL = False
      • Set VariableSet DAMAGE_TYPE_ENCHANCED = False
      • Set VariableSet DAMAGE_TYPE_FIRE = False
      • Set VariableSet DAMAGE_TYPE_COLD = False
      • Set VariableSet DAMAGE_TYPE_LIGHTNING = False
      • Set VariableSet DAMAGE_TYPE_POISON = False
      • Set VariableSet DAMAGE_TYPE_DISEASE = False
      • Set VariableSet DAMAGE_TYPE_DIVINE = False
      • Set VariableSet DAMAGE_TYPE_MAGIC = False
      • Set VariableSet DAMAGE_TYPE_SONIC = False
      • Set VariableSet DAMAGE_TYPE_ACID = False
      • Set VariableSet DAMAGE_TYPE_FORCE = False
      • Set VariableSet DAMAGE_TYPE_DEATH = False
      • Set VariableSet DAMAGE_TYPE_MIND = False
      • Set VariableSet DAMAGE_TYPE_PLANT = False
      • Set VariableSet DAMAGE_TYPE_DEFENSIVE = False
      • Set VariableSet DAMAGE_TYPE_DEMOLITION = False
      • Set VariableSet DAMAGE_TYPE_SLOW_POISON = False
      • Set VariableSet DAMAGE_TYPE_SPIRIT_LINK = False
      • Set VariableSet DAMAGE_TYPE_UNIVERSAL = False
      • -------- ----- --------
      • Set VariableSet ARMOR_TYPE_ETHEREAL = False
      • Set VariableSet ARMOR_TYPE_FLESH = False
      • Set VariableSet ARMOR_TYPE_METAL = False
      • Set VariableSet ARMOR_TYPE_NONE = False
      • Set VariableSet ARMOR_TYPE_STONE = False
      • Set VariableSet ARMOR_TYPE_WOOD = False
      • -------- -------------- --------
      • Set VariableSet WEAPON_TYPE_ML_CHOP = False
      • Set VariableSet WEAPON_TYPE_MM_CHOP = False
      • Set VariableSet WEAPON_TYPE_MH_CHOP = False
      • Set VariableSet WEAPON_TYPE_ML_SLICE = False
      • Set VariableSet WEAPON_TYPE_MM_SLICE = False
      • Set VariableSet WEAPON_TYPE_MH_SLICE = False
      • Set VariableSet WEAPON_TYPE_MM_BASH = False
      • Set VariableSet WEAPON_TYPE_MH_BASH = False
      • Set VariableSet WEAPON_TYPE_MM_STAB = False
      • Set VariableSet WEAPON_TYPE_MH_STAB = False
      • Set VariableSet WEAPON_TYPE_WL_SLICE = False
      • Set VariableSet WEAPON_TYPE_WM_SLICE = False
      • Set VariableSet WEAPON_TYPE_WH_SLICE = False
      • Set VariableSet WEAPON_TYPE_WL_BASH = False
      • Set VariableSet WEAPON_TYPE_WM_BASH = False
      • Set VariableSet WEAPON_TYPE_WH_BASH = False
      • Set VariableSet WEAPON_TYPE_WL_STAB = False
      • Set VariableSet WEAPON_TYPE_WM_STAB = False
      • Set VariableSet WEAPON_TYPE_CL_SLICE = False
      • Set VariableSet WEAPON_TYPE_CM_SLICE = False
      • Set VariableSet WEAPON_TYPE_CH_SLICE = False
      • Set VariableSet WEAPON_TYPE_AM_CHOP = False
      • Set VariableSet WEAPON_TYPE_RH_BASH = False
      • Set VariableSet WEAPON_TYPE_NONE = False

After we attach units to engine we need to handle the event it is looks like in others damage systems:

  • Event Attack Damage Type
    • Events
      • Game - Damage_event becomes Equal to 1.00
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (String(Damage_amount))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AttackType_HERO Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Attack type HERO
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AttackType_PIERCE Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Attack type PIERCE
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Damage_isNormal Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: is normal damage
        • Else - Actions
          • Game - Display to (All players) the text: not a normal damage...
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageType_MAGIC Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Damage type is magic
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageType_COLD Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Damage type is cold
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageType_DIVINE Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Damage type is divi...
        • Else - Actions


  • Event Modify Damage
    • Events
      • Game - Damage_event becomes Equal to 1.00
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (String(Damage_amount))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of Damage_source) Equal to Паладин
          • Damage_isNormal Equal to True
        • Then - Actions
          • Unit - Cause Damage_source to damage Damage_target, dealing 500.00 damage of attack type Chaos and damage type Universal
          • Set VariableSet Damage_modifier = 20.00
          • -------- DMG = 500+20 --------
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AttackType_MAGIC Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Magic
        • Else - Actions
          • Game - Display to (All players) the text: Type is not a Magic
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of Damage_source) Equal to Верховный маг
        • Then - Actions
          • Set VariableSet Damage_modifier = -100.00
          • Game - Display to (All players) the text: Set -100 Damage for...
        • Else - Actions


  • Event Defence Type
    • Events
      • Game - Damage_event becomes Equal to 1.00
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (String(Damage_amount))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DefenseType_HERO Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Target has hero Def...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DefenseType_LARGE Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Target has Heavy De...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DefenseType_FORT Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Target has Fortifie...
        • Else - Actions
  • Event Armor Type
    • Events
      • Game - Damage_event becomes Equal to 1.00
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (String(Damage_amount))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ArmorType_FLESH Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Armor type flesh
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ArmorType_METAL Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Armor type metal
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ArmorType_STONE Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Armor type stone
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ArmorType_WOOD Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Armor type wood
        • Else - Actions

Examples With Handling Damage Modify Event
For example makes 2x damage modifier:
  • Event Modify Damage x2
    • Events
      • Game - Damage_event becomes Equal to 1.00
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Basic Damage
      • Game - Display to (All players) the text: (String(Damage_amount))
      • Set VariableSet Damage_modifier = (Damage_amount x 2.00)

After that the Variable Damage_event becomes 2.0 and we can get new Damage_amount value and do what we want:
  • Event Modify Damage 2nd Call
    • Events
      • Game - Damage_event becomes Equal to 2.00
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Damage after Modify
      • Game - Display to (All players) the text: (String(Damage_amount))
      • Set VariableSet Damage_modifier = (Damage_amount x 2.00)

And After 2nd modification you can handle 3rd stage of that event

  • Event Modify Damage 3rd Call
    • Events
      • Game - Damage_event becomes Equal to 3.00
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Damage after 2nd Mo...
      • Game - Display to (All players) the text: (String(Damage_amount))

Work with Event Key same 3 previous triggers with Key usage. Here we run key generator and getting random value then store it in our variable:

  • Event Modify Damage 1st Call
    • Events
      • Game - Damage_event becomes Equal to 1.00
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Basic Damage
      • Game - Display to (All players) the text: (String(Damage_amount))
      • -------- IF MK generate custom key to make future work easly --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of Damage_source) Equal to Горный король
        • Then - Actions
          • Trigger - Run Damage Key Gen <gen> (checking conditions)
          • Set VariableSet Damage_key_MK = Damage_key
          • Set VariableSet Damage_modifier = (Damage_amount x 2.00)
        • Else - Actions

Now you dont need to check if hero is MK or any conditios which were in 1st trigger, just use the key to handle the event:

  • Event Modify Damage 2nd Call
    • Events
      • Game - Damage_event becomes Equal to 2.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Damage_key Equal to Damage_key_MK
        • Then - Actions
          • Game - Display to (All players) the text: Key is MK 2nd call
          • Game - Display to (All players) the text: Damage after Modify
          • Game - Display to (All players) the text: (String(Damage_amount))
          • Set VariableSet Damage_modifier = (Damage_amount x 2.00)
        • Else - Actions

Same solution for 3rd deep of trigger (deeps could be changed in core by any count):
  • Event Modify Damage 3rd Call
    • Events
      • Game - Damage_event becomes Equal to 3.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Damage_key Equal to Damage_key_MK
        • Then - Actions
          • Game - Display to (All players) the text: Key is MK 3nd call
          • Game - Display to (All players) the text: Damage after 2nd Mo...
          • Game - Display to (All players) the text: (String(Damage_amount))
        • Else - Actions
For using it just add 1 variable Damage_key (real) and one simple trigger:

  • Damage Key Gen
    • Events
    • Conditions
      • Damage_event Not equal to 0.00
    • Actions
      • Set VariableSet Damage_key = (Random real number between 0.00 and 1000.00)
v 0.6b - Fixed damage event fire.
v 0.6 Updated - Added Attack Type/Armor Type/Weapon Type modificator. And used same variables as Bribe's DDS
v 0.5b Updated - Added key damage generator for each event to prevent unnessery extra conditions.
v 0.5a Updated - Added extra handle after second call of damage modification
v 0.5 Updated - New event added when damage has been modified
v 0.4b Updated - Added TYPE OF ARMOR of target unit.
v 0.4 Updated - Added TYPE OF DEFENSE of target unit.
v 0.3b Updated - Added Test For Reccursion in Event trigger. System is safe out of it.
v 0.3 Updated - Added Damage Modify variable to change amount of damage.
v 0.2 Updated - Changed specific to generic damage event to avoid leaks.
That's all. Try test map it gives more info.


Keywords: damage detection, damage modification, gui, dds, armor type, attack type
Contents

Damage Engine (GUI) Reforged by M4gz (Map)

Level 4
Joined
Dec 30, 2019
Messages
55
Damage Engine already works with Reforged, uses a well-established API and does a lot more, more accurately, etc.
Thanks for you comment. That system using native reforged functions and variables. It saves tones lines of unnecessary JASS code and gives overall same as other damage engines. For example in your great DDS is a big problem to detect Attack type is normal i was need to detect if not a spell but it doesnt works in every case. That solution can easly filtering by damage and attack types, or in lightweight version just by BOOL is attack type is normal = false
 
Level 38
Joined
Feb 27, 2007
Messages
4,951
Damage Engine can modify damage in the damaged event, but this system cannot. For that reason alone I would never use this, as modifying event damage is often one of the core things you want to do with a DDS.

This system should use the new “any unit takes damage” event instead of manually adding specific unit events for all units on the map. This method results in many erroneous and useless events populating the trigger. I do not know of a reason this is explicitly bad but it surely can’t be good.
 
Level 4
Joined
Dec 30, 2019
Messages
55
Damage Engine can modify damage in the damaged event, but this system cannot. For that reason alone I would never use this, as modifying event damage is often one of the core things you want to do with a DDS.

This system should use the new “any unit takes damage” event instead of manually adding specific unit events for all units on the map. This method results in many erroneous and useless events populating the trigger. I do not know of a reason this is explicitly bad but it surely can’t be good.
Thanks for your comment. That system made on GUI triggers and its not able to use event like "any unit damaged" blizzard gives only event "specific unit event" but in other way it makes more accurate and less costly solution if you need to determinate units to save resources. Can you show "erroneous and useless events populating the trigger" for me to fix it. As for me that is what blizzard's did to make in game DDS more friendly.
About modify damage you have same variables as in DDS and you can deal extra damage as you like. You have type of damage, amount, target and source - just make 1 trigger to deal damage to the target as type and amount you want - it's just 1 action. I was thinking about that but as i get the right way is to make it clean and let maker to do what he wants with damage.
PS it's a damage detect system not a damage modify system.
 
Last edited:

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,456
Isn't there a limit with using Specific Unit Events like this? I'm pretty sure after a certain number of units are added to the Events it will stop supporting newer units.
 
Level 11
Joined
Jul 4, 2016
Messages
626
I'm not sure what patch you are on, but Blizzard did made available a "any unit damaged" event in the latest patches. Bribe's Damage Engine essentially adds this jass only(afaik) event to GUIers. Since I don't have reforged, I have no clue if blizzard added the event to GUI.

What Pryogasm meant was is that these events you add to the trigger will stay after the unit dies, essentially causing a permanent leak since the events are no longer in use or traceable until the trigger is destroyed (jass only)
 
Last edited:

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,456
He's using:
  • Trigger - Add to Damage Engine Core <gen> the event (Unit - (Triggering unit) Takes damage)
I'm like 90% sure this will stop working once you add a certain number of units.
 
Level 38
Joined
Feb 27, 2007
Messages
4,951
That system made on GUI triggers and its not able to use event like "any unit damaged"
Blizzard did made available a "any unit damaged" event in the latest patches. Bribe's Damage Engine essentially adds this jass only(afaik) event to GUIers.
I forgot it was JASS only but yes this is what I meant.
Can you show "erroneous and useless events populating the trigger" for me to fix it.
What Pryogasm meant was is that these events you add to the trigger will stay after the unit dies, essentially causing a permanent leak since the events are no longer in use or traceable until the trigger is destroyed
About modify damage you have same variables as in DDS and you can deal extra damage as you like.
I can't deal negative damage to reduce the damage dealt by something.
PS it's a damage detect system not a damage modify system.
modifying event damage is often one of the core things you want to do with a DDS
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
Thanks for you comment. That system using native reforged functions and variables. It saves tones lines of unnecessary JASS code and gives overall same as other damage engines. For example in your great DDS is a big problem to detect Attack type is normal i was need to detect if not a spell but it doesnt works in every case. That solution can easly filtering by damage and attack types, or in lightweight version just by BOOL is attack type is normal = false
Looks like Blizzard quietly added a nee native! I'm preparing an update to Damage Engine in light of this exciting news! Nice discovery, +rep
 
Level 4
Joined
Dec 30, 2019
Messages
55
Thank you all for your interest. I changed the event made generic event instead of specific as you told. Unfortunately in WE Reforged (Im using regular WE in Reforged) event is not exists and i was need to make like that:

  • Damage Engine Event
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet Damage_Trigger = Damage Engine Core <gen>
      • Custom script: call TriggerRegisterAnyUnitEventBJ(udg_Damage_Trigger, EVENT_PLAYER_UNIT_DAMAGED)
Variable Damage_Trigger is not necessary you can replace it with trigger name in custom script.
Also found an interesting thing how to detect last hit (dying moment)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Life of (Damage Target)) Less than or equal to (Damage taken)
    • Then - Actions
      • Game - Display to (All players) the text: Unit is dead (lasth...
    • Else - Actions
 
Last edited:
Level 4
Joined
Dec 30, 2019
Messages
55
New Verison 0.3
Now its possible to use damage modifier as you like. It can be possitive to deal extra damage or reduce incoming damage. Or negative to up hp.
Just set variable value:
  • Set VariableSet Damage_modifier = 10.00
Or
  • Set VariableSet Damage_modifier = -100.00
Damage Engine can modify damage in the damaged event, but this system cannot. For that reason alone I would never use this, as modifying event damage is often one of the core things you want to do with a DDS
Done.
 
Last edited:

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
Sad to hear that. Could you give a review or some ideads to make it better
Philosophically I am against having two differing systems with two different sets of APIs. If the idea is that you want yours to be a minimalist Damage Engine, I give you permission to have your API match mine so that implementers can at least have an easier time switching between the two.

As far as approvals go, I'm thankfully no longer a moderator so that's up to them to decide.
 
Level 4
Joined
Dec 30, 2019
Messages
55
Philosophically I am against having two differing systems with two different sets of APIs. If the idea is that you want yours to be a minimalist Damage Engine, I give you permission to have your API match mine so that implementers can at least have an easier time switching between the two.

As far as approvals go, I'm thankfully no longer a moderator so that's up to them to decide.

Thanks for answer. Ill try to implement with your system. If i add Armor type and Defence type (Do i need to store both types? Or only Defence type) And do i need to store these type/types for both - Source and Target unit or only for target?
 
Level 4
Joined
Dec 30, 2019
Messages
55
Update 0.4 : now its possible to detect targets type of defense (normal/heavy/fort/hero and so on)
-------
Update 0.4b : now its possible to detect targets type of armor (flesh/metal/wood/stone and so on)
 
Last edited:
Level 4
Joined
Dec 30, 2019
Messages
55
Update 0.5 : New event added when damage has been modified. You can handle new event after modification to get new value of damage and, for example, do extra damage or what you need.
----------------
Update 0.5a : Added extra handle for damage modification. Now it is possible to catch the event after 1st damage modification and after 2nd damage modification. For example tt would be usefully if you need to modificate damage by item then by passive skill and so on. You can add any count of handling just copypaste that part of code in core and change damage_event variable to +1
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Damage_modifier Not equal to 0.00
    • Then - Actions
      • Custom script: call BlzSetEventDamage(udg_Damage_modifier)
      • Set VariableSet Damage_amount = (Damage taken)
      • Set VariableSet Damage_event = 2.00
    • Else - Actions
Next will be = 3.00 then = 4.00 and so on.
----------------
Update 0.5b : added damage key now you can get uniue key and compare it in future damage modifications to prevent useless conditions. For example make 1 time a key allow you to detect if event call was from point where you generate it.
 
Last edited:

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
I've gone through the description and features and I can't seem to find what does this system provide that @Bribe 's Damage Engine doesn't?

Even worse, it seems to include things directly based off of Bribe's Damage Engine.

Keep in mind that it needs to have something unique otherwise it would contradict the Resource Submission Rules (Models, skins, icons, spells).
upload_2020-2-29_13-49-5.png

All and any resources (including spells and systems) should provide something that users don't already have in the site.

If there is a such unique feature in the system, then I'd suggest focusing on it and building the system around it. Explain in the description what people can find in your system that they can't elsewhere. I may be wrong, but I haven't noticed one.
 
Level 4
Joined
Dec 30, 2019
Messages
55
Thanks for your anwers!
I've gone through the description and features and I can't seem to find what does this system provide that @Bribe 's Damage Engine doesn't?

Even worse, it seems to include things directly based off of Bribe's Damage Engine.

Keep in mind that it needs to have something unique otherwise it would contradict the Resource Submission Rules (Models, skins, icons, spells).
View attachment 348359
All and any resources (including spells and systems) should provide something that users don't already have in the site.

If there is a such unique feature in the system, then I'd suggest focusing on it and building the system around it. Explain in the description what people can find in your system that they can't elsewhere. I may be wrong, but I haven't noticed one.
Differences:
1 - To detect Damage Type/Armor Type/Defense Type/Weapon Type/Attack Type BOOL variables are used. Instead of custom integer. for example - if (DEFENSE_TYPE_MEDIUM == true)
2 - To change Damage Type/Attack Type new variables are used.
for example - DamageEventDamageT == Spell)
3 - To change Armor Type/Defense Type/Weapon Type used BOOL variables. Just set value to TRUE and engine will change the type.
4 - It is made on triggers that allows you to simply understand and change according to needs.
5 - New Event Response and Variables from Blizzard are used.
6 - Its lighter and less coded - Just 1 trigger which makes all work.
@M4gz originally found this cool new native that led to me updating to Damage Engine 5.5, so I'm interested to see if he/she will cook up another new, undiscovered thing with this resource.
Only in 1 place i used same condition as in Bribe's DDS AttackType != null in isSpell detection method. I used it to compare with condition who used it already and prevent breaks.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
When setting the armor type or defense type, it doesn't make sense to use a boolean...

as then you have to check in your resource which boolean is set.

Which boolean do you choose, in case of multiple TRUE values?

You then have to un-set all of the booleans at the end to ensure there are no misflags.

I don't like the syntax of "DamageEventXT == DAMAGE_CONSTANT_VARIABLE" particularly much, and booleans clean up that a bit, but I don't think this is the answer.
 
Level 4
Joined
Dec 30, 2019
Messages
55
Thanks for Your answer
When setting the armor type or defense type, it doesn't make sense to use a boolean...

as then you have to check in your resource which boolean is set.

Which boolean do you choose, in case of multiple TRUE values?

You then have to un-set all of the booleans at the end to ensure there are no misflags.

I don't like the syntax of "DamageEventXT == DAMAGE_CONSTANT_VARIABLE" particularly much, and booleans clean up that a bit, but I don't think this is the answer.
As you see armor and defense type changing using common variables not boolean.
Boolean used ONLY for Weapon type because that type of variable doesnt exists in GUI.
1st Boolean will be used in list of variables i think its a logical. What case to use several same modifications at the same time?
At the end of what? Bool is used only for weapon types and it compare previous value with new one (if it exists). They are nulled after event.
Yes that syntax is not pretty looks buy if used these names i was need to use the same. But booleans make it clean and remove part of code and variables.
Also that resource gives a good and easy explaination of DDS in GUI and a lot of ways to change/edit/modify without any JASS/LUA knowledges.
 
Level 4
Joined
Nov 4, 2019
Messages
47
If you deal damage inside the damage detection function, everything breaks and all damage is set to 0. How can I do additional damage (without increasing the current one) inside the function? I first need to deal damage to one target, and then additional damage to targets around it.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
If you deal damage inside the damage detection function, everything breaks and all damage is set to 0. How can I do additional damage (without increasing the current one) inside the function? I first need to deal damage to one target, and then additional damage to targets around it.
The resource you are replying to is unapproved and - according to the author- still in beta testing. If you want a working damage system for all needs, you need look no further than Damage Engine 5.5.0.0
 
Level 4
Joined
Nov 4, 2019
Messages
47
Bribe Yes, I've seen your system. I found it too cumbersome, too many settings and not enough hints (for me personally). And then I opened it and immediately see what and where to install. In your system, I didn't fully understand how your trigger "Set damage" differs from "Damage tag". I didn't find any hints on how to use "on AOE" or what the "On Zero"trigger is. Etc. Need more hints for noobs like me.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
Bribe Yes, I've seen your system. I found it too cumbersome, too many settings and not enough hints (for me personally). And then I opened it and immediately see what and where to install. In your system, I didn't fully understand how your trigger "Set damage" differs from "Damage tag". I didn't find any hints on how to use "on AOE" or what the "On Zero"trigger is. Etc. Need more hints for noobs like me.
1) copy the damage engine category into your map

2) it's installed

The stuff you don't understand is not meant to be picked up on right away. Over the years I added a bunch of a features to satisfy requests. But the main usage is straightforward:

DamageEvent becomes equal to 1.00 - detects when DamageEventSource damages DamageEventTarget for DamageEventAmount.

If you instead use DamageModifierEvent becomes equal yo 1.00, you can change the damage before it's modified by armor or mana shield.

If you instead use DamageModifierEvent 4.00, you can change it AFTER it has been modified by armor or mana shield.

That's the core of the system. The rest is just meant for specialized stuff or exists just for demo purposes.
 
Level 4
Joined
Dec 30, 2019
Messages
55
If you deal damage inside the damage detection function, everything breaks and all damage is set to 0. How can I do additional damage (without increasing the current one) inside the function? I first need to deal damage to one target, and then additional damage to targets around it.
Can you show a trigger or test map? If it breaks ill fix it ASAP. I was testing for dealing damage inside the event and all works ok. You can check test triggers.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,182
I am all for using a system that only does what I need to.
For example, I still recommend Weep's DDS: GUI-Friendly Damage Detection v1.2.1 to new users as it is not overwhelming with features like the more modern options.

I'd even use it myself most of the time as I very rarely need the fancy features anyway.

This seems to be somewhere in the middle, not quite as simple as Weeps, but not good enough to compete with Damage Engine (among others)
 
Level 4
Joined
Nov 4, 2019
Messages
47
M4gz, Yes, it's just that if I deal damage inside the function, the damage is set to 0. I'm checking this with debag. If you put "FaerieFire" on the enemy, which reduces the armor, the damage is also set to 0. I checked your code and saw that if the damage is not actual, then the next trigger "Event Modify" is triggered, but it does not save this damage, but sets it to 0 (why?). More precisely, it doesn't set it to 0, it only saves it if it is larger (as you have in the example of the mountain king, you increase the damage by 2 times), but I don't need it. I did everything by your example, checked it repeatedly. I like your system so much, but I just don't understand why I can't do damage inside the function. I have the ability to "reflect damage". When receiving damage-I deal part of the damage response and it does not work, the system does not "catch" "reflected damage", and the damage taked by the hero at this moment is set to 0. I believe that the error lies in the fact that applying new damage simply resets the variables "DamageEvent Target and Source". Because in this cases, debug returns null.
 

Attachments

  • 321.png
    321.png
    63.7 KB · Views: 87
  • -------- Detect Targets Defense type --------
  • Custom script: set DefenseTypeTemp = BlzGetUnitIntegerField(udg_DamageEventTarget, UNIT_IF_DEFENSE_TYPE)
  • Custom script: if (DefenseTypeTemp == 0) then
  • Set VariableSet DEFENSE_TYPE_LIGHT = True
  • Custom script: elseif (DefenseTypeTemp == 1) then
  • Set VariableSet DEFENSE_TYPE_MEDIUM = True
  • Custom script: elseif (DefenseTypeTemp == 2) then
  • Set VariableSet DEFENSE_TYPE_HEAVY = True
  • Custom script: elseif (DefenseTypeTemp == 3) then
  • Set VariableSet DEFENSE_TYPE_FORTIFIED = True
  • Custom script: elseif (DefenseTypeTemp == 4) then
  • Set VariableSet DEFENSE_TYPE_NORMAL = True
  • Custom script: elseif (DefenseTypeTemp == 5) then
  • Set VariableSet DEFENSE_TYPE_HERO = True
  • Custom script: elseif (DefenseTypeTemp == 6) then
  • Set VariableSet DEFENSE_TYPE_DIVINE = True
  • Custom script: else
  • Set VariableSet DEFENSE_TYPE_UNARMORED = True
  • Custom script: endif
  • -------- Detect Targets Armor type --------
  • Custom script: set ArmorTypeTemp = BlzGetUnitIntegerField(udg_DamageEventTarget, UNIT_IF_ARMOR_TYPE)
  • Custom script: if (ArmorTypeTemp == 1) then
  • Set VariableSet ARMOR_TYPE_FLESH = True
  • Custom script: elseif (ArmorTypeTemp == 2) then
  • Set VariableSet ARMOR_TYPE_METAL = True
  • Custom script: elseif (ArmorTypeTemp == 3) then
  • Set VariableSet ARMOR_TYPE_WOOD = True
  • Custom script: elseif (ArmorTypeTemp == 4) then
  • Set VariableSet ARMOR_TYPE_ETHEREAL = True
  • Custom script: elseif (ArmorTypeTemp == 5) then
  • Set VariableSet ARMOR_TYPE_STONE = True
  • Custom script: else
  • Set VariableSet ARMOR_TYPE_NONE = True
  • Custom script: endif
  • -------- Detect Attack Type --------
  • Custom script: if udg_DamageEventAttackT == ATTACK_TYPE_NORMAL then
  • Set VariableSet ATTACK_TYPE_SPELLS = True
  • Custom script: elseif udg_DamageEventAttackT == ATTACK_TYPE_MELEE then
  • Set VariableSet ATTACK_TYPE_NORMAL = True
  • Custom script: elseif udg_DamageEventAttackT == ATTACK_TYPE_PIERCE then
  • Set VariableSet ATTACK_TYPE_PIERCE = True
  • Custom script: elseif udg_DamageEventAttackT == ATTACK_TYPE_SIEGE then
  • Set VariableSet ATTACK_TYPE_SIEGE = True
  • Custom script: elseif udg_DamageEventAttackT == ATTACK_TYPE_MAGIC then
  • Set VariableSet ATTACK_TYPE_MAGIC = True
  • Custom script: elseif udg_DamageEventAttackT == ATTACK_TYPE_CHAOS then
  • Set VariableSet ATTACK_TYPE_CHAOS = True
  • Custom script: elseif udg_DamageEventAttackT == ATTACK_TYPE_HERO then
  • Set VariableSet ATTACK_TYPE_HERO = True
  • Custom script: endif
  • -------- Detect Damage Type --------
  • Custom script: if udg_DamageEventDamageT == DAMAGE_TYPE_UNKNOWN then
  • Set VariableSet DAMAGE_TYPE_UNKNOWN = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_NORMAL then
  • Set VariableSet DAMAGE_TYPE_NORMAL = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_ENHANCED then
  • Set VariableSet DAMAGE_TYPE_ENCHANCED = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_FIRE then
  • Set VariableSet DAMAGE_TYPE_FIRE = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_COLD then
  • Set VariableSet DAMAGE_TYPE_COLD = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_LIGHTNING then
  • Set VariableSet DAMAGE_TYPE_LIGHTNING = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_POISON then
  • Set VariableSet DAMAGE_TYPE_POISON = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_DISEASE then
  • Set VariableSet DAMAGE_TYPE_DISEASE = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_DIVINE then
  • Set VariableSet DAMAGE_TYPE_DIVINE = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_MAGIC then
  • Set VariableSet DAMAGE_TYPE_MAGIC = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_SONIC then
  • Set VariableSet DAMAGE_TYPE_SONIC = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_ACID then
  • Set VariableSet DAMAGE_TYPE_ACID = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_FORCE then
  • Set VariableSet DAMAGE_TYPE_FORCE = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_DEATH then
  • Set VariableSet DAMAGE_TYPE_DEATH = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_MIND then
  • Set VariableSet DAMAGE_TYPE_MIND = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_PLANT then
  • Set VariableSet DAMAGE_TYPE_PLANT = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_DEFENSIVE then
  • Set VariableSet DAMAGE_TYPE_DEFENSIVE = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_DEMOLITION then
  • Set VariableSet DAMAGE_TYPE_DEMOLITION = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_SLOW_POISON then
  • Set VariableSet DAMAGE_TYPE_SLOW_POISON = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_SPIRIT_LINK then
  • Set VariableSet DAMAGE_TYPE_SPIRIT_LINK = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_SHADOW_STRIKE then
  • Set VariableSet DAMAGE_TYPE_SHADOW_STRIKE = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_UNIVERSAL then
  • Set VariableSet DAMAGE_TYPE_UNIVERSAL = True
  • Custom script: endif
  • -------- Detect Weapon Type --------
  • Custom script: if WeaponType == WEAPON_TYPE_METAL_LIGHT_CHOP then
  • Custom script: set WeaponTypeIndex = 1
  • Set VariableSet WEAPON_TYPE_ML_CHOP = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_MEDIUM_CHOP then
  • Custom script: set WeaponTypeIndex = 2
  • Set VariableSet WEAPON_TYPE_MM_CHOP = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_HEAVY_CHOP then
  • Custom script: set WeaponTypeIndex = 3
  • Set VariableSet WEAPON_TYPE_MH_CHOP = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_LIGHT_SLICE then
  • Custom script: set WeaponTypeIndex = 4
  • Set VariableSet WEAPON_TYPE_ML_SLICE = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_MEDIUM_SLICE then
  • Custom script: set WeaponTypeIndex = 5
  • Set VariableSet WEAPON_TYPE_MM_SLICE = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_HEAVY_SLICE then
  • Custom script: set WeaponTypeIndex = 6
  • Set VariableSet WEAPON_TYPE_MH_SLICE = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_MEDIUM_BASH then
  • Custom script: set WeaponTypeIndex = 7
  • Set VariableSet WEAPON_TYPE_MM_BASH = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_HEAVY_BASH then
  • Custom script: set WeaponTypeIndex = 8
  • Set VariableSet WEAPON_TYPE_MH_BASH = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_MEDIUM_STAB then
  • Custom script: set WeaponTypeIndex = 9
  • Set VariableSet WEAPON_TYPE_MM_STAB = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_HEAVY_STAB then
  • Custom script: set WeaponTypeIndex = 10
  • Set VariableSet WEAPON_TYPE_MH_STAB = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_LIGHT_SLICE then
  • Custom script: set WeaponTypeIndex = 11
  • Set VariableSet WEAPON_TYPE_WL_SLICE = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_MEDIUM_SLICE then
  • Custom script: set WeaponTypeIndex = 12
  • Set VariableSet WEAPON_TYPE_WM_SLICE = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_HEAVY_SLICE then
  • Custom script: set WeaponTypeIndex = 13
  • Set VariableSet WEAPON_TYPE_WH_SLICE = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_LIGHT_BASH then
  • Custom script: set WeaponTypeIndex = 14
  • Set VariableSet WEAPON_TYPE_WL_BASH = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_MEDIUM_BASH then
  • Custom script: set WeaponTypeIndex = 15
  • Set VariableSet WEAPON_TYPE_WM_BASH = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_HEAVY_BASH then
  • Custom script: set WeaponTypeIndex = 16
  • Set VariableSet WEAPON_TYPE_WH_BASH = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_LIGHT_STAB then
  • Custom script: set WeaponTypeIndex = 17
  • Set VariableSet WEAPON_TYPE_WL_STAB = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_MEDIUM_STAB then
  • Custom script: set WeaponTypeIndex = 18
  • Set VariableSet WEAPON_TYPE_WM_STAB = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_CLAW_LIGHT_SLICE then
  • Custom script: set WeaponTypeIndex = 19
  • Set VariableSet WEAPON_TYPE_CL_SLICE = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_CLAW_MEDIUM_SLICE then
  • Custom script: set WeaponTypeIndex = 20
  • Set VariableSet WEAPON_TYPE_CM_SLICE = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_CLAW_HEAVY_SLICE then
  • Custom script: set WeaponTypeIndex = 21
  • Set VariableSet WEAPON_TYPE_CH_SLICE = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_AXE_MEDIUM_CHOP then
  • Custom script: set WeaponTypeIndex = 22
  • Set VariableSet WEAPON_TYPE_AM_CHOP = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_ROCK_HEAVY_BASH then
  • Custom script: set WeaponTypeIndex = 23
  • Set VariableSet WEAPON_TYPE_RH_BASH = True
  • Custom script: else
  • Set VariableSet WEAPON_TYPE_NONE = True
  • Custom script: endif
  • -------- End Damage Type Detecting --------
The trigger reeks of if-then statements (There are too many of them). As far as code inspection goes, all of that set WeaponTypeIndex fiasco can be reduced to set WeaponTypeIndex = GetHandleId(WeaponType)

Given the current setup, if a new damage type, attack type, or armor type would be introduced (unlikely, though), the system will have to be updated to accommodate for that. This would be tedious to maintain or update if any bug arises, in conjunction with using the system or due to the system itself.

Considering the way weapon type is modified, it would appear that when changing the weapon type, the weapon type with the smallest index will be assigned to the damage instance, as opposed to the latest weapon type taking precedence. As shown below (this is assuming that there are at least 2 triggers modifying weapon type).

  • Set VariableSet WEAPON_TYPE_ML_CHOP = true
  • -------- Some other trigger running --------
  • Set VariableSet WEAPON_TYPE_MM_CHOP = true
This would apply the first weapon type WEAPON_TYPE_ML_CHOP (index 1), as opposed to WEAPON_TYPE_MM_CHOP (index 2). In this case, the most recent assignment to the weapon type is not respected. Doing the same thing with Bribe's Damage Engine:

  • [B] [/B]Set VariableSet DamageEventWeaponT = WEAPON_TYPE_ML_CHOP
    • -------- Some other trigger running --------
    • Set VariableSet DamageEventWeaponT = WEAPON_TYPE_MM_CHOP
The weapon type will be assigned as WEAPON_TYPE_MM_CHOP (index 2), the more recent assignment, as opposed to WEAPON_TYPE_ML_CHOP (index 1).
 
This is a rather decent attempt at a damage detection system, although it is held back by a lot of factors, adding too much complexity to the system. Quoting my previous post:

  • -------- Detect Targets Defense type --------
  • Custom script: set DefenseTypeTemp = BlzGetUnitIntegerField(udg_DamageEventTarget, UNIT_IF_DEFENSE_TYPE)
  • Custom script: if (DefenseTypeTemp == 0) then
  • Set VariableSet DEFENSE_TYPE_LIGHT = True
  • Custom script: elseif (DefenseTypeTemp == 1) then
  • Set VariableSet DEFENSE_TYPE_MEDIUM = True
  • Custom script: elseif (DefenseTypeTemp == 2) then
  • Set VariableSet DEFENSE_TYPE_HEAVY = True
  • Custom script: elseif (DefenseTypeTemp == 3) then
  • Set VariableSet DEFENSE_TYPE_FORTIFIED = True
  • Custom script: elseif (DefenseTypeTemp == 4) then
  • Set VariableSet DEFENSE_TYPE_NORMAL = True
  • Custom script: elseif (DefenseTypeTemp == 5) then
  • Set VariableSet DEFENSE_TYPE_HERO = True
  • Custom script: elseif (DefenseTypeTemp == 6) then
  • Set VariableSet DEFENSE_TYPE_DIVINE = True
  • Custom script: else
  • Set VariableSet DEFENSE_TYPE_UNARMORED = True
  • Custom script: endif
  • -------- Detect Targets Armor type --------
  • Custom script: set ArmorTypeTemp = BlzGetUnitIntegerField(udg_DamageEventTarget, UNIT_IF_ARMOR_TYPE)
  • Custom script: if (ArmorTypeTemp == 1) then
  • Set VariableSet ARMOR_TYPE_FLESH = True
  • Custom script: elseif (ArmorTypeTemp == 2) then
  • Set VariableSet ARMOR_TYPE_METAL = True
  • Custom script: elseif (ArmorTypeTemp == 3) then
  • Set VariableSet ARMOR_TYPE_WOOD = True
  • Custom script: elseif (ArmorTypeTemp == 4) then
  • Set VariableSet ARMOR_TYPE_ETHEREAL = True
  • Custom script: elseif (ArmorTypeTemp == 5) then
  • Set VariableSet ARMOR_TYPE_STONE = True
  • Custom script: else
  • Set VariableSet ARMOR_TYPE_NONE = True
  • Custom script: endif
  • -------- Detect Attack Type --------
  • Custom script: if udg_DamageEventAttackT == ATTACK_TYPE_NORMAL then
  • Set VariableSet ATTACK_TYPE_SPELLS = True
  • Custom script: elseif udg_DamageEventAttackT == ATTACK_TYPE_MELEE then
  • Set VariableSet ATTACK_TYPE_NORMAL = True
  • Custom script: elseif udg_DamageEventAttackT == ATTACK_TYPE_PIERCE then
  • Set VariableSet ATTACK_TYPE_PIERCE = True
  • Custom script: elseif udg_DamageEventAttackT == ATTACK_TYPE_SIEGE then
  • Set VariableSet ATTACK_TYPE_SIEGE = True
  • Custom script: elseif udg_DamageEventAttackT == ATTACK_TYPE_MAGIC then
  • Set VariableSet ATTACK_TYPE_MAGIC = True
  • Custom script: elseif udg_DamageEventAttackT == ATTACK_TYPE_CHAOS then
  • Set VariableSet ATTACK_TYPE_CHAOS = True
  • Custom script: elseif udg_DamageEventAttackT == ATTACK_TYPE_HERO then
  • Set VariableSet ATTACK_TYPE_HERO = True
  • Custom script: endif
  • -------- Detect Damage Type --------
  • Custom script: if udg_DamageEventDamageT == DAMAGE_TYPE_UNKNOWN then
  • Set VariableSet DAMAGE_TYPE_UNKNOWN = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_NORMAL then
  • Set VariableSet DAMAGE_TYPE_NORMAL = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_ENHANCED then
  • Set VariableSet DAMAGE_TYPE_ENCHANCED = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_FIRE then
  • Set VariableSet DAMAGE_TYPE_FIRE = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_COLD then
  • Set VariableSet DAMAGE_TYPE_COLD = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_LIGHTNING then
  • Set VariableSet DAMAGE_TYPE_LIGHTNING = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_POISON then
  • Set VariableSet DAMAGE_TYPE_POISON = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_DISEASE then
  • Set VariableSet DAMAGE_TYPE_DISEASE = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_DIVINE then
  • Set VariableSet DAMAGE_TYPE_DIVINE = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_MAGIC then
  • Set VariableSet DAMAGE_TYPE_MAGIC = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_SONIC then
  • Set VariableSet DAMAGE_TYPE_SONIC = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_ACID then
  • Set VariableSet DAMAGE_TYPE_ACID = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_FORCE then
  • Set VariableSet DAMAGE_TYPE_FORCE = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_DEATH then
  • Set VariableSet DAMAGE_TYPE_DEATH = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_MIND then
  • Set VariableSet DAMAGE_TYPE_MIND = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_PLANT then
  • Set VariableSet DAMAGE_TYPE_PLANT = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_DEFENSIVE then
  • Set VariableSet DAMAGE_TYPE_DEFENSIVE = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_DEMOLITION then
  • Set VariableSet DAMAGE_TYPE_DEMOLITION = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_SLOW_POISON then
  • Set VariableSet DAMAGE_TYPE_SLOW_POISON = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_SPIRIT_LINK then
  • Set VariableSet DAMAGE_TYPE_SPIRIT_LINK = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_SHADOW_STRIKE then
  • Set VariableSet DAMAGE_TYPE_SHADOW_STRIKE = True
  • Custom script: elseif udg_DamageEventDamageT == DAMAGE_TYPE_UNIVERSAL then
  • Set VariableSet DAMAGE_TYPE_UNIVERSAL = True
  • Custom script: endif
  • -------- Detect Weapon Type --------
  • Custom script: if WeaponType == WEAPON_TYPE_METAL_LIGHT_CHOP then
  • Custom script: set WeaponTypeIndex = 1
  • Set VariableSet WEAPON_TYPE_ML_CHOP = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_MEDIUM_CHOP then
  • Custom script: set WeaponTypeIndex = 2
  • Set VariableSet WEAPON_TYPE_MM_CHOP = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_HEAVY_CHOP then
  • Custom script: set WeaponTypeIndex = 3
  • Set VariableSet WEAPON_TYPE_MH_CHOP = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_LIGHT_SLICE then
  • Custom script: set WeaponTypeIndex = 4
  • Set VariableSet WEAPON_TYPE_ML_SLICE = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_MEDIUM_SLICE then
  • Custom script: set WeaponTypeIndex = 5
  • Set VariableSet WEAPON_TYPE_MM_SLICE = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_HEAVY_SLICE then
  • Custom script: set WeaponTypeIndex = 6
  • Set VariableSet WEAPON_TYPE_MH_SLICE = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_MEDIUM_BASH then
  • Custom script: set WeaponTypeIndex = 7
  • Set VariableSet WEAPON_TYPE_MM_BASH = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_HEAVY_BASH then
  • Custom script: set WeaponTypeIndex = 8
  • Set VariableSet WEAPON_TYPE_MH_BASH = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_MEDIUM_STAB then
  • Custom script: set WeaponTypeIndex = 9
  • Set VariableSet WEAPON_TYPE_MM_STAB = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_METAL_HEAVY_STAB then
  • Custom script: set WeaponTypeIndex = 10
  • Set VariableSet WEAPON_TYPE_MH_STAB = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_LIGHT_SLICE then
  • Custom script: set WeaponTypeIndex = 11
  • Set VariableSet WEAPON_TYPE_WL_SLICE = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_MEDIUM_SLICE then
  • Custom script: set WeaponTypeIndex = 12
  • Set VariableSet WEAPON_TYPE_WM_SLICE = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_HEAVY_SLICE then
  • Custom script: set WeaponTypeIndex = 13
  • Set VariableSet WEAPON_TYPE_WH_SLICE = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_LIGHT_BASH then
  • Custom script: set WeaponTypeIndex = 14
  • Set VariableSet WEAPON_TYPE_WL_BASH = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_MEDIUM_BASH then
  • Custom script: set WeaponTypeIndex = 15
  • Set VariableSet WEAPON_TYPE_WM_BASH = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_HEAVY_BASH then
  • Custom script: set WeaponTypeIndex = 16
  • Set VariableSet WEAPON_TYPE_WH_BASH = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_LIGHT_STAB then
  • Custom script: set WeaponTypeIndex = 17
  • Set VariableSet WEAPON_TYPE_WL_STAB = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_WOOD_MEDIUM_STAB then
  • Custom script: set WeaponTypeIndex = 18
  • Set VariableSet WEAPON_TYPE_WM_STAB = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_CLAW_LIGHT_SLICE then
  • Custom script: set WeaponTypeIndex = 19
  • Set VariableSet WEAPON_TYPE_CL_SLICE = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_CLAW_MEDIUM_SLICE then
  • Custom script: set WeaponTypeIndex = 20
  • Set VariableSet WEAPON_TYPE_CM_SLICE = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_CLAW_HEAVY_SLICE then
  • Custom script: set WeaponTypeIndex = 21
  • Set VariableSet WEAPON_TYPE_CH_SLICE = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_AXE_MEDIUM_CHOP then
  • Custom script: set WeaponTypeIndex = 22
  • Set VariableSet WEAPON_TYPE_AM_CHOP = True
  • Custom script: elseif WeaponType == WEAPON_TYPE_ROCK_HEAVY_BASH then
  • Custom script: set WeaponTypeIndex = 23
  • Set VariableSet WEAPON_TYPE_RH_BASH = True
  • Custom script: else
  • Set VariableSet WEAPON_TYPE_NONE = True
  • Custom script: endif
  • -------- End Damage Type Detecting --------
The trigger reeks of if-then statements (There are too many of them). As far as code inspection goes, all of that set WeaponTypeIndex fiasco can be reduced to set WeaponTypeIndex = GetHandleId(WeaponType)

Given the current setup, if a new damage type, attack type, or armor type would be introduced (unlikely, though), the system will have to be updated to accommodate for that. This would be tedious to maintain or update if any bug arises, in conjunction with using the system or due to the system itself.

Considering the way weapon type is modified, it would appear that when changing the weapon type, the weapon type with the smallest index will be assigned to the damage instance, as opposed to the latest weapon type taking precedence. As shown below (this is assuming that there are at least 2 triggers modifying weapon type).

  • Set VariableSet WEAPON_TYPE_ML_CHOP = true
  • -------- Some other trigger running --------
  • Set VariableSet WEAPON_TYPE_MM_CHOP = true
This would apply the first weapon type WEAPON_TYPE_ML_CHOP (index 1), as opposed to WEAPON_TYPE_MM_CHOP (index 2). In this case, the most recent assignment to the weapon type is not respected. Doing the same thing with Bribe's Damage Engine:

  • [B] [/B]Set VariableSet DamageEventWeaponT = WEAPON_TYPE_ML_CHOP
    • -------- Some other trigger running --------
    • Set VariableSet DamageEventWeaponT = WEAPON_TYPE_MM_CHOP
The weapon type will be assigned as WEAPON_TYPE_MM_CHOP (index 2), the more recent assignment, as opposed to WEAPON_TYPE_ML_CHOP (index 1).

Due to most of the features primarily overlapping with Bribe's Damage Engine 5.7.1.1, and that the aforementioned system, reputable for its use in a wide range of projects, and is being frequently updated by the author, I would have to mark this as Substandard.

By moving this to Substandard, I do not wish to imply that this system is too buggy to be useful. Rather, I would recommend those who are already using this system to stick with the system.
 
Top