• 🏆 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 Interface [vJASS][LUA]

Damage Interface v2.4 [Custom Evasion][Critical Strike][Spell Power][Life Steal][Spell Vamp]

Intro
Damage Interface provides an easy way to register, detect, and modify custom on damage events, like Critical Strikes and Evasion, as well as introduce new functionalities like Spell Power and Spell Vamp and simulate functionalities like Life Steal.
You will also have access to quick specific damage types registration, like On Attack Damage or On Spell Damage events.
How it Works?
By using the new damage natives that for now are only accessible to Jassers and Lunatics (see what i did there), I created custom events for Critical Strike and Evasion and provided a way to register functions to be executed when these custom events fire. Of course, given the circumstances these custom events will not fire for normal critical strikes and evasion in the game, so if you want to detect a critical strike for example, you will have to give a chance and a multiplier to the desired unit using the public API of each system.
Apart from Damage Interface library, all other libraries are modular and do not depend on each other.
Warning* For the Custom Evasion System, please be aware that a few hard coded functionalities in the game like bash, cleave, critical strikes, orb effects will still trigger damage events, so in order to make a full simulation of an Evasion event all of those functionalities would have to be custom made as well. All that being said, this system by itself offers you the ability to create all of those custom system the way you want.
How To Import?
Simply copy the Damage Interface folder from the test map into your map. You also will need a Unit Indexer. In the test map I used the Unit Indexer created by @Bribe so credits to him, but any unit indexer will do the required job.
Requirements
Damage Interface requires patch 1.31+ and a Unit Indexer.

vJASS:
/* -------------------------------------------------------------------------- */
/*                              Damage Interface                              */
/* -------------------------------------------------------------------------- */
function RegisterAttackDamageEvent takes code c returns nothing
    -> Code will run when a unit attacks another.

function RegisterSpellDamageEvent takes code c returns nothing
    -> Code will run when a unit takes spell damage.

function RegisterDamageEvent takes attacktype attack, damagetype damage, code c returns nothing
    -> Code will run when the attacktype and damagetype of the
    -> damage event match the parameters.

function RegisterAnyDamageEvent takes code c returns nothing
    -> Code will run when any damage is dealt.

function RegisterAttackDamagingEvent takes code c returns nothing
    -> Code will run when a unit attacks another
    -> Before the mitigation.

function RegisterSpellDamagingEvent takes code c returns nothing
    -> Code will run when a unit takes spell damage
    -> Before the mitigation.

function RegisterDamagingEvent takes attacktype attack, damagetype damage, code c returns nothing
     -> Code will run when the attacktype and damagetype of the
     -> damage event match the parameters. Before the mitigation.

function RegisterAnyDamagingEvent takes code c returns nothing
    -> Code will run when any damage is dealt
    -> Before the mitigation.

/* -------------------------------------------------------------------------- */
/*                                   Evasion                                  */
/* -------------------------------------------------------------------------- */
function RegisterEvasionEvent takes code c returns nothing
    -> YourFunction will run when a unit evades an attack.

function GetMissingUnit takes nothing returns unit
    -> Returns the unit missing the attack

function GetEvadingUnit takes nothing returns unit
    -> Returns the unit evading the attack

function GetEvadedDamage takes nothing returns real
    -> Returns the amount of evaded damage

function GetUnitEvasionChance takes unit u returns real
    -> Returns this system amount of evasion chance given to a unit

function GetUnitMissChance takes unit u returns real
    -> Returns this system amount of miss chance given to a unit

function SetUnitEvasionChance takes unit u, real chance returns nothing
    -> Sets unit evasion chance to specified amount

function SetUnitMissChance takes unit u, real chance returns nothing
    -> Sets unit miss chance to specified amount

function UnitAddEvasionChance takes unit u, real chance returns nothing
    -> Add to a unit Evasion chance the specified amount

function UnitAddMissChance takes unit u, real chance returns nothing
    -> Add to a unit Miss chance the specified amount

function MakeUnitNeverMiss takes unit u, boolean flag returns nothing
    -> Will make a unit never miss attacks no matter the evasion chance of the attacked unit

function DoUnitNeverMiss takes unit u returns boolean
    -> Returns true if the unit will never miss an attack

/* -------------------------------------------------------------------------- */
/*                                  Critical                                  */
/* -------------------------------------------------------------------------- */
function RegisterCriticalStrikeEvent takes code c returns nothing
    -> YourFunction will run when a unit hits a critical strike.

function GetCriticalSource takes nothing returns unit
    -> Returns the unit hitting a critical strike.

function GetCriticalTarget takes nothing returns unit
    -> Returns the unit being hit by a critical strike.

function GetCriticalDamage takes nothing returns real
    -> Returns the critical strike damage amount.

function GetUnitCriticalChance takes unit u returns real
    -> Returns the chance to hit a critical strike to specified unit.

function GetUnitCriticalMultiplier takes unit u returns real
    -> Returns the chance to hit a critical strike to specified unit.

function SetUnitCriticalChance takes unit u, real value returns nothing
    -> Set's the unit chance to hit a critical strike to specified value.
    -> 15.0 = 15%

function SetUnitCriticalMultiplier takes unit u, real value returns nothing
    -> Set's the unit multiplier of damage when hitting a critical to value
    -> 1.0 = increases the multiplier by 1. all units have a multiplier of 1.0
    -> by default, so by adding 1.0, for example, the critical damage will be
    -> 2x the normal damage

function SetCriticalEventDamage takes real newValue returns nothing
    -> Modify the critical damage dealt to the specified value.

function UnitAddCriticalStrike takes unit u, real chance, real multiplier returns nothing
    -> Adds the specified values of chance and multiplier to a unit

/* -------------------------------------------------------------------------- */
/*                                 Spell Power                                */
/* -------------------------------------------------------------------------- */
function GetUnitSpellPowerFlat takes unit u returns real
    -> Returns the Flat bonus of spell power of a unit

function GetUnitSpellPowerPercent takes unit u returns real
    -> Returns the Percent bonus of spell power of a unit

function SetUnitSpellPowerFlat takes unit u, real value returns nothing
    -> Set's the Flat amount of Spell Power of a unit

function SetUnitSpellPowerPercent takes unit u, real value returns nothing
    -> Set's the Flat amount of Spell Power of a unit

function UnitAddSpellPowerFlat takes unit u, real amount returns nothing
    -> Add to the Flat amount of Spell Power of a unit

function UnitAddSpellPowerPercent takes unit u, real amount returns nothing
    -> Add to the Percent amount of Spell Power of a unit

function GetSpellDamage takes real amount, unit u returns real
    -> Returns the amount of spell damage that would be dealt given an initial damage

/* -------------------------------------------------------------------------- */
/*                                 Life Steal                                 */
/* -------------------------------------------------------------------------- */
function SetUnitLifeSteal takes unit u, real amount returns nothing
    -> Set the Life Steal amount for a unit

function GetUnitLifeSteal takes unit u returns real
    -> Returns the Life Steal amount of a unit

function UnitAddLifeSteal takes unit u, real amount returns nothing
    -> Add to the Life Steal amount of a unit the given amount

/* -------------------------------------------------------------------------- */
/*                                 Spell Vamp                                 */
/* -------------------------------------------------------------------------- */
function SetUnitSpellVamp takes unit u, real amount returns nothing
    -> Set the Spell Vamp amount for a unit

function GetUnitSpellVamp takes unit u returns real
    -> Returns the Spell Vamp amount of a unit

function UnitAddSpellVamp takes unit u, real amount returns nothing
    -> Add to the Spell Vamp amount of a unit the given amount

/* -------------------------------------------------------------------------- */
/*                           Damage Interface Utils                           */
/* -------------------------------------------------------------------------- */
function UnitAddEvasionChanceTimed takes unit u, real amount, real duration returns nothing
    -> Add to a unit Evasion chance the specified amount for a given period

function UnitAddMissChanceTimed takes unit u, real amount, real duration returns nothing
    -> Add to a unit Miss chance the specified amount for a given period

function UnitAddCriticalStrikeTimed takes unit u, real chance, real multiplier, real duration returns nothing
    -> Adds the specified values of chance and multiplier to a unit for a given period

function UnitAddCriticalChanceTimed takes unit u, real chance, real duration returns nothing
    -> Adds the specified values of critical chance to a unit for a given period

function UnitAddCriticalMultiplierTimed takes unit u, real multiplier, real duration returns nothing
    -> Adds the specified values of critical multiplier to a unit for a given period

function UnitAddSpellPowerFlatTimed takes unit u, real amount, real duration returns nothing
    -> Add to the Flat amount of Spell Power of a unit for a given period

function UnitAddSpellPowerPercentTimed takes unit u, real amount, real duration returns nothing
    -> Add to the Percent amount of Spell Power of a unit for a given period

function AbilitySpellDamage takes unit u, integer abilityId, abilityreallevelfield field returns string
    -> Given an ability field, will return a string that represents the damage that would be dealt
    -> taking into consideration the spell power bonusses of a unit.

function AbilitySpellDamageEx takes real amount, unit u returns string
    -> Similar to GetSpellDamage will return the damage that would be dealt but as a string

function UnitAddLifeStealTimed takes unit u, real amount, real duration returns nothing
    -> Add to the Life Steal amount of a unit the given amount for a given period

function UnitAddSpellVampTimed takes unit u, real amount, real duration returns nothing
    -> Add to the Spell Vamp amount of a unit the given amount for a given period
Lua:
/* -------------------------------------------------------------------------- */
/*                              Damage Interface                              */
/* -------------------------------------------------------------------------- */
function RegisterDamageEvent(attacktype, damagetype, code)
    -> Code will run when attacktype and damagetype match.

function RegisterAttackDamageEvent(code)
    -> Code will run when a unit is attacked.

function RegisterSpellDamageEvent(code)
    -> Code will run when Spell damage is dealt.

function RegisterAnyDamageEvent(code)
    -> Code will run when any damage is dealt.

function RegisterDamagingEvent(attacktype, damagetype, code)
    -> Code will run when attacktype and damagetype match.
    -> Before Mitigation.

function RegisterAttackDamagingEvent(code)
    -> Code will run when a unit is attacked.
    -> Before Mitigation.

function RegisterSpellDamagingEvent(code)
    -> Code will run when Spell damage is dealt.
    -> Before Mitigation.

function RegisterAnyDamagingEvent(code)
    -> Code will run when any damage is dealt.
    -> Before Mitigation.

/* -------------------------------------------------------------------------- */
/*                                   Evasion                                  */
/* -------------------------------------------------------------------------- */
function RegisterEvasionEvent(code)
    -> YourFunction will run when a unit evades an attack.

function GetMissingUnit()
    -> Returns the unit missing the attack

function GetEvadingUnit()
    -> Returns the unit evading the attack

function GetEvadedDamage()
    -> Returns the amount of evaded damage

function GetUnitEvasionChance(unit)
    -> Returns this system amount of evasion chance given to a unit

function GetUnitMissChance(unit)
    -> Returns this system amount of miss chance given to a unit

function SetUnitEvasionChance(unit, real)
    -> Sets unit evasion chance to specified amount

function SetUnitMissChance(unit, real)
    -> Sets unit miss chance to specified amount

function UnitAddEvasionChance(unit, real)
    -> Add to a unit Evasion chance the specified amount

function UnitAddMissChance(unit, real)
    -> Add to a unit Miss chance the specified amount

function MakeUnitNeverMiss(unit, flag)
    -> Will make a unit never miss attacks no matter the evasion chance of the attacked unit

function DoUnitNeverMiss(unit)
    -> Returns true if the unit will never miss an attack

/* -------------------------------------------------------------------------- */
/*                                  Critical                                  */
/* -------------------------------------------------------------------------- */
function RegisterCriticalStrikeEvent(code)
    -> YourFunction will run when a unit hits a critical strike.

function GetCriticalSource()
    -> Returns the unit hitting a critical strike.

function GetCriticalTarget()
    -> Returns the unit being hit by a critical strike.

function GetCriticalDamage()
    -> Returns the critical strike damage amount.

function GetUnitCriticalChance(unit)
    -> Returns the chance to hit a critical strike to specified unit.

function GetUnitCriticalMultiplier(unit)
    -> Returns the chance to hit a critical strike to specified unit.

function SetUnitCriticalChance(unit, real)
    -> Set's the unit chance to hit a critical strike to specified value.
    -> 15.0 = 15%

function SetUnitCriticalMultiplier(unit, real)
    -> Set's the unit multiplier of damage when hitting a critical to value
    -> 1.0 = increases the multiplier by 1. all units have a multiplier of 1.0
    -> by default, so by adding 1.0, for example, the critical damage will be
    -> 2x the normal damage

function SetCriticalEventDamage(real)
    -> Modify the critical damage dealt to the specified value.

function UnitAddCriticalStrike(unit, chance, multiplier)
    -> Adds the specified values of chance and multiplier to a unit

/* -------------------------------------------------------------------------- */
/*                                 Spell Power                                */
/* -------------------------------------------------------------------------- */
function GetUnitSpellPowerFlat(unit)
    -> Returns the Flat bonus of spell power of a unit

function GetUnitSpellPowerPercent(unit)
    -> Returns the Percent bonus of spell power of a unit

function SetUnitSpellPowerFlat(unit, real)
    -> Set the Flat amount of Spell Power of a unit

function SetUnitSpellPowerPercent(unit, real)
    -> Set the Flat amount of Spell Power of a unit

function UnitAddSpellPowerFlat(unit, real)
    -> Add to the Flat amount of Spell Power of a unit

function UnitAddSpellPowerPercent(unit, real)
    -> Add to the Percent amount of Spell Power of a unit

function GetSpellDamage(unit, real)
    -> Returns the amount of spell damage that would be dealt given an initial damage

/* -------------------------------------------------------------------------- */
/*                                 Life Steal                                 */
/* -------------------------------------------------------------------------- */
function SetUnitLifeSteal(unit, real)
    -> Set the Life Steal amount for a unit

function GetUnitLifeSteal(unit)
    -> Returns the Life Steal amount of a unit

function UnitAddLifeSteal(unit, real)
    -> Add to the Life Steal amount of a unit the given amount

/* -------------------------------------------------------------------------- */
/*                                 Spell Vamp                                 */
/* -------------------------------------------------------------------------- */
function SetUnitSpellVamp(unit, real)
    -> Set the Spell Vamp amount for a unit

function GetUnitSpellVamp(unit)
    -> Returns the Spell Vamp amount of a unit

function UnitAddSpellVamp(unit, real)
    -> Add to the Spell Vamp amount of a unit the given amount

/* -------------------------------------------------------------------------- */
/*                           Damage Interface Utils                           */
/* -------------------------------------------------------------------------- */
function UnitAddEvasionChanceTimed(unit, amount, duration)
    -> Add to a unit Evasion chance the specified amount for a given period

function UnitAddMissChanceTimed(unit, amount, duration)
    -> Add to a unit Miss chance the specified amount for a given period

function UnitAddCriticalStrikeTimed(unit, chance, multiplier, duration)
    -> Adds the specified values of chance and multiplier to a unit for a given period

function UnitAddCriticalChanceTimed(unit, chance, duration)
    -> Adds the specified values of critical chance to a unit for a given period

function UnitAddCriticalMultiplierTimed(unit, multiplier, duration)
    -> Adds the specified values of critical multiplier to a unit for a given period

function UnitAddSpellPowerFlatTimed(unit, amount, duration)
    -> Add to the Flat amount of Spell Power of a unit for a given period

function UnitAddSpellPowerPercentTimed(unit, amount, duration)
    -> Add to the Percent amount of Spell Power of a unit for a given period

function AbilitySpellDamage(unit, ability, field)
    -> Given an ability field, will return a string that represents the damage
    -> that would be dealt taking into consideration the spell power bonusses of a unit.

function AbilitySpellDamageEx(real, unit)
    -> Similar to GetSpellDamage will return the damage that would be dealt but as a string

function UnitAddLifeStealTimed(unit, amount, duration)
    -> Add to the Life Steal amount of a unit the given amount for a given period

function UnitAddSpellVampTimed(unit, amount, duration)
    -> Add to the Spell Vamp amount of a unit the given amount for a given period
vJASS:
Damage.source.unit          -> The source unit of the damage event
Damage.source.player        -> The owning player of the source unit
Damage.source.handle        -> The handle id of the source unit
Damage.source.id            -> The unit user data (UnitIndexer) of the source unit
Damage.source.x             -> The x coordinate of the source unit
Damage.source.y             -> The y coordinate of the source unit
Damage.source.z             -> The z coordinate of the source unit
Damage.source.isHero        -> True if the source unit is a Hero unit
Damage.source.isMelee       -> True if the source unit is a Melee unit
Damage.source.isRanged      -> True if the source unit is a Ranged unit
Damage.source.isStructure   -> True if the source unit is a Structure unit
Damage.source.isMagicImmune -> True if the source unit is a Magic Immune unit

Damage.target.unit          -> The target unit of the damage event
Damage.target.player        -> The owning player of the target unit
Damage.target.handle        -> The handle id of the target unit
Damage.target.id            -> The unit user data (UnitIndexer) of the target unit
Damage.target.x             -> The x coordinate of the target unit
Damage.target.y             -> The y coordinate of the target unit
Damage.target.z             -> The z coordinate of the target unit
Damage.target.isHero        -> True if the target unit is a Hero unit
Damage.target.isMelee       -> True if the target unit is a Melee unit
Damage.target.isRanged      -> True if the target unit is a Ranged unit
Damage.target.isStructure   -> True if the target unit is a Structure unit
Damage.target.isMagicImmune -> True if the target unit is a Magic Immune unit

Damage.damagetype           -> The damagetype of the damage event
Damage.attacktype           -> The attacktype of the damage event
Damage.isSpell              -> True if the damage is Spell type damage
Damage.isAttack             -> True if the damage is Attack type damage
Damage.isEnemy              -> True if the source unit is an enemy of the target unit
Damage.isAlly               -> True if the source unit is an ally of the target unit

(v1.0)
  • Submission
(v1.1)
  • Core System renamed to Damage Interface
  • Included the ability to register damage before mitigation
(v1.2)
  • Add a configuration constant for the text size of Critical Strike and Evasion. Also increased the default text size from 0.016 to 0.019.
  • Attack Projectlies that do not play sound on death (hit) and melee attack will no longer play a sound when a unit evades an attack.
(v1.3)
  • Added a few global variables to assist reducing the amount of code when using this system

    • src -> the source of damage
    • tgt -> the target of damage
    • isEnemy -> true if the source is an enemy of the target
    • isAlly -> same as isEnemy but for allied units
    • isMelee -> indicates if the source of damage is a melee unit
    • structure -> indicates if the target of damage is a structure
    • magicImmune -> indicates if the target of damage is magic immune
    • sIdx -> represents the custom index of the source of damage
    • tIdx -> represents the custom index of the target of damage
    • sId -> represents the unit handle of the source of damage
    • tId -> represents the unit handle of the target of damage
    • p -> the owning player of the source
  • Renamed the Cleave event to Enhanced, as well observed by @Bribe
    • Added a condition to the evaluation of an Attack Event to not run when an attack is evaded (Evasion System)
  • Changed the logic for the NeverMiss functionality to avoid a Condition run (Evasion System)
  • Corrected a spelling error on the RegisterCriticalStrikeEvent() function call (Critical System)
v(1.4)
  • Redone the globlas to use struct members and to be more readable as suggested
    • DamageI.source -> the source of damage
    • DamageI.target -> the target of damage
    • DamageI.sourcePlayer -> the player who owns the source unit
    • DamageI.targetPlayer -> the player who owns the target unit
    • DamageI.isEnemy -> true if the source is an enemy of the target
    • DamageI.isAlly -> same as isEnemy but for allied units
    • DamageI.isMelee -> indicates if the source of damage is a melee unit
    • DamageI.isRanged -> indicates if the source of damage is a ranged unit
    • DamageI.isAttack -> true if the damage type is an attack damage
    • DamageI.isSpell -> true if the damage type is an spell damage
    • DamageI.isPure -> true if the damage type is pure damage
    • DamageI.isEnhanced -> true if the damage type is enhanced
    • DamageI.sourceIsHero -> indicates if the source of damage is a hero unit
    • DamageI.targetIsHero -> indicates if the target of damage is a hero unit
    • DamageI.structure -> indicates if the target of damage is a structure
    • DamageI.magicImmune -> indicates if the target of damage is a magic immune unit
    • DamageI.sourceX -> the X coordinate of the source unit
    • DamageI.sourceY -> the Y coordinate of the source unit
    • DamageI.targetX -> the X coordinate of the target unit
    • DamageI.targetY -> the Y coordinate of the target unit
    • DamageI.sIdx -> represents the custom index of the source of damage
    • DamageI.tIdx -> represents the custom index of the target of damage
    • DamageI.sId -> represents the unit handle of the source of damage
    • DamageI.tId -> represents the unit handle of the target of damage
    • DamageI.damageType -> the damage type of the damage event
    • DamageI.attackType -> the attack type of the damage event
  • Hopefully all those members will help the user to create code with less function calls and less amount of code created overall.
(v1.5)
  • New Configurable Constant CACHE_EXTRA: if true struct members will be set for every event.
  • Code Cleaning
(v1.6)
  • Fixed a minor bug on a global initialization
(v1.7)
  • System Overhauled for more flexibility and opportunities.
  • function RegisterDamageEvent takes attacktype attack, damagetype damage, code c returns nothing and function RegisterDamagingEvent takes attacktype attack, damagetype damage, code c returns nothing now takes the attack type and damage type as parameters for specialization. Example:
    • call RegisterDamageEvent(ATTACK_TYPE_HERO, DAMAGE_TYPE_FIRE, function OnDamage).
      • function OnDamage will execute whenever the Attack Type of the damage event is equal to ATTACK_TYPE_HERO and the Damage Type is equal to DAMAGE_TYPE_FIRE
    • call RegisterDamageEvent(ATTACK_TYPE_HERO, null, function OnDamage).
      • function OnDamage will run whenever the Attack Type of the damage event is equal to ATTACK_TYPE_HERO (null for the damage type parameter means that it doesn't matter)
    • call RegisterDamageEvent(null, DAMAGE_TYPE_COLD, function OnDamage.
      • function OnDamage will run whenever the Damage Type of the damage event is equal to DAMAGE_TYPE_COLD (null for the attack type parameter means that it doesn't matter)
  • Use function RegisterAnyDamageEvent takes code c returns nothing to register functions to any damage event or the equivalent call RegisterDamageEvent(null, null, function OnDamage)
  • The following functions were kept to keep backward compatibility:
    • function RegisterAttackDamageEvent takes code c returns nothing
    • function RegisterSpellDamageEvent takes code c returns nothing
    • function RegisterPureDamageEvent takes code c returns nothing
    • function RegisterEnhancedDamageEvent takes code c returns nothing
    • function RegisterEnhancedDamageEvent takes code c returns nothing
    • function RegisterSpellDamagingEvent takes code c returns nothing
    • function RegisterPureDamagingEvent takes code c returns nothing
    • function RegisterEnhancedDamagingEvent takes code c returns nothing
  • New library DamageInterfaceUtils containing all the extra functionalities of every system that were previously implemented on each system core implementation.
  • Some Code cleaning and optimization.
  • library DamageInterface uses optionally Bribe's Table Library. If not found it will use hashtables.
(v1.8)
  • Fixed a bug for the RegisterSpellDamageEvent not respecting correct flow of the system
  • Removed functions due to alternative registration (Attack and Spell kept because they are the most commonly used):
    • Removed: function RegisterPureDamageEvent takes code c returns nothing Equivalent: RegisterDamageEvent(null, DAMAGE_TYPE_UNIVERSAL, function OnDamage)
    • Removed: function RegisterEnhancedDamageEvent takes code c returns nothing Equivalent: RegisterDamageEvent(null, DAMAGE_TYPE_ENHANCED, function OnDamage)
    • Removed: function RegisterPureDamagingEvent takes code c returns nothing Equivalent: RegisterDamagingEvent(null, DAMAGE_TYPE_UNIVERSAL, function OnDamage)
    • Removed: function RegisterEnhancedDamagingEvent takes code c returns nothing Equivalent: RegisterDamagingEvent(null, DAMAGE_TYPE_ENHANCED, function OnDamage)
  • Removed an global variable used by the Evasion system, It's now a member
  • Code cleaning and formatting.
(v1.9)
  • Removed the members isPure and isEnhanced
(v2.0)
  • System ported to LUA.
  • Damage members redesigned for more intuitive usage (See API).
(v2.1)
  • Small adjustment for the z coordinate of the units in the members.
(V2.2)
  • Had to remove the Damage.damage member due to a bug when calling UnitDamageTarget inside a damage event. So back to using the natives GetEventDamage and BlzSetEventDamage
  • Updated some of the Utilities libraries.
(v2.3)
  • Fixed a small bug for the Spell Power in lua version
(v2.4)
  • Removed the use of GetUnitUserData from the LUA version, now it uses the unit it self as key.
Contents

Damage Interface (Map)

Damage Interface (Map)

Reviews
MyPad
Due to a number of resources already using this being approved, this will retroactively be approved. Status: Damage Interface is Approved

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,870
I really think you should base velocity, text height, lifespan and fadepoint from standard text tags, the one i'm refering to is "missile miss", velocity = 0.04 on yvel.
Displayed:
In UI\MiscData.txt
// gold text data
GoldTextColor=255,255,220,0
GoldTextVelocity=0,0.03,100
GoldTextLifetime=2
GoldTextFadeStart=1

// lumber text data
LumberTextColor=255,0,200,80
LumberTextVelocity=0,0.03,100
LumberTextLifetime=2
LumberTextFadeStart=1

// bounty text data
BountyTextColor=255,255,220,0
BountyTextVelocity=0,0.03,100
BountyTextLifetime=3
BountyTextFadeStart=2

// lumber bounty text data
LumberBountyTextColor=255,0,200,80
LumberBountyTextVelocity=0,0.03,100
LumberBountyTextLifetime=3
LumberBountyTextFadeStart=2

// missile 'miss' text tag data
MissTextColor=255,255,0,0
MissTextVelocity=0,0.03,100
MissTextLifetime=3
MissTextFadeStart=1

// CriticalStrike text tag data
CriticalStrikeTextColor=255,255,0,0
CriticalStrikeTextVelocity=0,0.04,100
CriticalStrikeTextLifetime=5
CriticalStrikeTextFadeStart=2

// ShadowStrike text tag data
ShadowStrikeTextColor=255,160,255,0
ShadowStrikeTextVelocity=0,0.04,100
ShadowStrikeTextLifetime=5
ShadowStrikeTextFadeStart=2

// ManaBurn text tag data
ManaBurnTextColor=255,82,82,255
ManaBurnTextVelocity=0,0.04,100
ManaBurnTextLifetime=5
ManaBurnTextFadeStart=2
// CriticalStrike text tag data
BashTextColor=255,0,0,255
BashTextVelocity=0,0.04,100
BashTextLifetime=5
BashTextFadeStart=2

Standard size in: UI\MiscUI.txt
[Misc]

FontTexture=FRIZQT__.TTF

GoldTextHeight=0.024
LumberTextHeight=0.024
BountyTextHeight=0.024
LumberBountyTextHeight=0.024
MissTextHeight=0.024
CriticalStrikeTextHeight=0.024
ShadowStrikeTextHeight=0.024
ManaBurnTextHeight=0.024
BashTextHeight=0.024
Those are probably the only things I have to be picky about this resource :p
Also, texttag is set on unit instead of on unit X and Y? o.o
 
Last edited:
Level 1
Joined
Mar 28, 2009
Messages
5
I have not tried it, but this exists:
Where there is a file for this DamageInterface. Maybe just put in this, Bribes Damage Engine and the content of chopinkski's Damage Interface.j in your map.
Thanks, but is the compatibility patch outdated? I still can't seem to compile, or I might be doing something wrong
 
Top