- Joined
- Sep 26, 2009
- Messages
- 9,547
Damage Engine already works with Reforged, uses a well-established API and does a lot more, more accurately, etc.
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)
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
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
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)
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)
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))
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
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
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
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)