# Unit Absorbs Damage

Grammaru absorbs damage with behavior behavior
FlagsNative | 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> — Unit
  • string<gamelink::Behavior> — Behavior

Returns — void

native void TriggerAddEventUnitDamageAbsorbed(
	trigger inTrigger,
	unitref inUnit,
	string inBehavior,
);

# Event parameters

Category: Unit / Combat

# Examples

campaigns/voidstory.sc2campaignbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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){