# Unit Absorbs Damage
Grammar — u absorbs damage with behavior behavior
Flags —Native
|Event
This event fires when a unit absorbs damage due to a behavior damage response. Use “Triggering Unit” to get the unit that absorbed damage. Use “Triggering Behavior” to get the behavior that absorbed damage on the unit. Use “Triggering Damage Absorbed” to get the amount of damage absorbed. Use “Damaging Unit” and “Damaging Player” to get the unit and player that caused the damage. Use “Damaging Effect” to get the effect that caused the damage.
# Arguments
unitref
<unit> — Unitstring
<gamelink::Behavior> — Behavior
Returns — void
native void TriggerAddEventUnitDamageAbsorbed(
trigger inTrigger,
unitref inUnit,
string inBehavior,
);
# Event parameters
- Triggering Behavior — EventUnitBehavior
- Triggering Unit — EventUnit
- Damaging Unit — EventUnitDamageSourceUnit
- Damaging Player — EventUnitDamageSourcePlayer
- Triggering Damage Absorbed — EventUnitDamageAbsorbed
- Healing Unit — EventUnitHealLaunchUnit
- Healing Player — EventUnitHealLaunchPlayer
# Related
Category: Unit / Combat
- Get Unit Damage Dealt Time —
fixed
— UnitGetDamageDealtTime - Get Unit Damage Taken Time —
fixed
— UnitGetDamageTakenTime - Weapon Used In Attack —
string
<gamelink::Weapon> — EventUnitGetWeapon - Item Used In Attack —
unit
— EventUnitGetItem - Item Type Used In Attack —
string
<gamelink::Item> — EventUnitGetItemType - Unit Dies —
void
— TriggerAddEventUnitDied - Killing Unit —
unit
— libNtve_gf_KillingUnit - Killing Player —
int
— libNtve_gf_KillingPlayer - Triggering Death Type Check —
bool
— EventUnitDamageDeathCheck - Unit Is Being Removed —
void
— TriggerAddEventUnitRemoved - Unit Starts Attacking (Deprecated) —
void
— TriggerAddEventUnitStartedAttack - Unit Starts Attacking —
void
— TriggerAddEventUnitStartedAttack2 - Unit Is Attacked (Deprecated) —
void
— TriggerAddEventUnitAttacked - Unit Is Attacked —
void
— TriggerAddEventUnitAttacked2 - Attacking Unit —
unit
— EventUnitTarget - Unit Absorbs Damage —
void
— TriggerAddEventUnitDamageAbsorbed - Unit Takes Damage —
void
— TriggerAddEventUnitDamaged - Damaging Unit —
unit
— EventUnitDamageSourceUnit - Damaging Player —
int
— EventUnitDamageSourcePlayer - Damaging Effect —
string
<gamelink::Effect> — EventUnitDamageEffect - Triggering Damage Taken —
fixed
— EventUnitDamageAmount - Triggering Damage Attempted —
fixed
— EventUnitDamageAttempted - Triggering Damage Attempted Vitals —
fixed
— EventUnitDamageAttemptedVitals - Triggering Damage Absorbed —
fixed
— EventUnitDamageAbsorbed - Triggering Damage Behavior Shield —
fixed
— EventUnitDamageBehaviorShield - Triggering Vitals Leeched —
fixed
— EventUnitDamageVitalsLeeched - Triggering Unit Kill XP —
int
— EventUnitDamageKillXP - Damage Source Position —
point
— EventUnitDamageSourcePoint - Unit is Healed —
void
— TriggerAddEventUnitHealed - Healing Unit —
unit
— EventUnitHealLaunchUnit - Healing Player —
int
— EventUnitHealLaunchPlayer - Triggering Heal Vital Type —
int
<preset::UnitVitalType> — EventUnitHealVital - Triggering Heal Given —
fixed
— EventUnitHealAmount - Healing Effect —
string
<gamelink::Effect> — EventUnitHealEffect - Unit Spends Vital —
void
— TriggerAddEventUnitSpendVital - Triggering Spent Vital Type —
int
<preset::UnitVitalType> — EventUnitSpentVitalVital - Triggering Vital Spent —
fixed
— EventUnitSpentVitalAmount - Unit Acquires Target —
void
— TriggerAddEventUnitAcquiredTarget - Acquired Target —
unit
— libNtve_gf_AcquiredTarget - Unit Is Revived —
void
— TriggerAddEventUnitRevive - Triggering Victim Unit —
unit
— EventUnitVictimUnit - Triggering Item Used —
unit
— EventUnitItemUsed - Triggering Effect Used —
string
<gamelink::Effect> — EventUnitEffectUsed
# Examples
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignLib.galaxy:10286
void libVoiC_gt_PC_AchievementShieldAbsorb_Init () {
libVoiC_gt_PC_AchievementShieldAbsorb = TriggerCreate("libVoiC_gt_PC_AchievementShieldAbsorb_Func");
TriggerAddEventUnitDamageAbsorbed(libVoiC_gt_PC_AchievementShieldAbsorb, null, "SOASuperShield");
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:6313
libGDHL_gt_HeroArthasAntiMagicShellHeal = TriggerCreate("libGDHL_gt_HeroArthasAntiMagicShellHeal_Func");
TriggerEnable(libGDHL_gt_HeroArthasAntiMagicShellHeal, false);
TriggerAddEventUnitDamageAbsorbed(libGDHL_gt_HeroArthasAntiMagicShellHeal, null, "ArthasAntiMagicShellCaster");
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:8906
libGDHL_gt_HeroChenStaggerDamageResponse = TriggerCreate("libGDHL_gt_HeroChenStaggerDamageResponse_Func");
TriggerEnable(libGDHL_gt_HeroChenStaggerDamageResponse, false);
TriggerAddEventUnitDamageAbsorbed(libGDHL_gt_HeroChenStaggerDamageResponse, null, "ChenStaggerProtectedBuff");
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:15373
void libGame_gt_ProtectorDataCollection_Init () {
libGame_gt_ProtectorDataCollection = TriggerCreate("libGame_gt_ProtectorDataCollection_Func");
TriggerAddEventUnitDamageAbsorbed(libGame_gt_ProtectorDataCollection, null, null);
}
mods/heromods/genji.stormmod — base.stormdata/LibHGen.galaxy:353
libHGen_gt_HeroGenjiDeflectMissileLauncher = TriggerCreate("libHGen_gt_HeroGenjiDeflectMissileLauncher_Func");
TriggerEnable(libHGen_gt_HeroGenjiDeflectMissileLauncher, false);
TriggerAddEventUnitDamageAbsorbed(libHGen_gt_HeroGenjiDeflectMissileLauncher, null, "GenjiDeflectMissileLauncher");
}
mods/heromods/genji.stormmod — base.stormdata/LibHGen.galaxy:423
libHGen_gt_HeroGenjiDeflectAbsorbDamage = TriggerCreate("libHGen_gt_HeroGenjiDeflectAbsorbDamage_Func");
TriggerEnable(libHGen_gt_HeroGenjiDeflectAbsorbDamage, false);
TriggerAddEventUnitDamageAbsorbed(libHGen_gt_HeroGenjiDeflectAbsorbDamage, null, "GenjiDeflectProtected");
}
mods/heromods/zarya.stormmod — base.stormdata/LibHZAR.galaxy:1089
libHZAR_gt_HeroZaryaEnergyGain = TriggerCreate("libHZAR_gt_HeroZaryaEnergyGain_Func");
TriggerEnable(libHZAR_gt_HeroZaryaEnergyGain, false);
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaPersonalBarrier");
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaShieldAlly");
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaPersonalBarrierIAmTheStrongest");
mods/heromods/zarya.stormmod — base.stormdata/LibHZAR.galaxy:1090
TriggerEnable(libHZAR_gt_HeroZaryaEnergyGain, false);
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaPersonalBarrier");
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaShieldAlly");
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaPersonalBarrierIAmTheStrongest");
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaPainIsTemporary");
mods/heromods/zarya.stormmod — base.stormdata/LibHZAR.galaxy:1091
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaPersonalBarrier");
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaShieldAlly");
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaPersonalBarrierIAmTheStrongest");
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaPainIsTemporary");
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaShieldAllyGainTrain");
mods/heromods/zarya.stormmod — base.stormdata/LibHZAR.galaxy:1092
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaShieldAlly");
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaPersonalBarrierIAmTheStrongest");
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaPainIsTemporary");
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaShieldAllyGainTrain");
}
mods/heromods/zarya.stormmod — base.stormdata/LibHZAR.galaxy:1093
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaPersonalBarrierIAmTheStrongest");
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaPainIsTemporary");
TriggerAddEventUnitDamageAbsorbed(libHZAR_gt_HeroZaryaEnergyGain, null, "ZaryaShieldAllyGainTrain");
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:18120
libCOMI_gt_CM_Fenix_SentryNullShield = TriggerCreate("libCOMI_gt_CM_Fenix_SentryNullShield_Func");
TriggerEnable(libCOMI_gt_CM_Fenix_SentryNullShield, false);
TriggerAddEventUnitDamageAbsorbed(libCOMI_gt_CM_Fenix_SentryNullShield, null, "SentryFenixNullShield");
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:26124
libCOMI_gt_CM_Tychus_OilBombFireDamageResponse = TriggerCreate("libCOMI_gt_CM_Tychus_OilBombFireDamageResponse_Func");
TriggerEnable(libCOMI_gt_CM_Tychus_OilBombFireDamageResponse, false);
TriggerAddEventUnitDamageAbsorbed(libCOMI_gt_CM_Tychus_OilBombFireDamageResponse, null, "TychusFirebatOilBombed");
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOOC.galaxy:6542
libCOOC_gt_CC_ScoreArtanisAbsorb = TriggerCreate("libCOOC_gt_CC_ScoreArtanisAbsorb_Func");
TriggerEnable(libCOOC_gt_CC_ScoreArtanisAbsorb, false);
TriggerAddEventUnitDamageAbsorbed(libCOOC_gt_CC_ScoreArtanisAbsorb, null, "SOASuperShield");
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOOC.galaxy:7503
libCOOC_gt_CC_ScoreNovaAbsorb = TriggerCreate("libCOOC_gt_CC_ScoreNovaAbsorb_Func");
TriggerEnable(libCOOC_gt_CC_ScoreNovaAbsorb, false);
TriggerAddEventUnitDamageAbsorbed(libCOOC_gt_CC_ScoreNovaAbsorb, null, "NovaCoopCasterDefensiveMatrix");
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOOC.galaxy:8231
libCOOC_gt_CC_ScoreTychusMedicAbsorb = TriggerCreate("libCOOC_gt_CC_ScoreTychusMedicAbsorb_Func");
TriggerEnable(libCOOC_gt_CC_ScoreTychusMedicAbsorb, false);
TriggerAddEventUnitDamageAbsorbed(libCOOC_gt_CC_ScoreTychusMedicAbsorb, null, "TychusMedicDefensiveMatrix");
}
mods/warcoop/warclassic.sc2mod — base.sc2data/TriggerLibs/WarClassic.galaxy:34
void GAw3_TriggerAddEventUnitDamageAbsorbed (trigger t, unit u, string inBehavior){
unitref ur=UnitRefFromUnit(u);
TriggerAddEventUnitDamageAbsorbed(t,ur,inBehavior);
}
void GAw3_AddEventUnitCreated(trigger t,unit u,string creatorAbil,string creatorBehavior){