# Unit Is Being Removed
Grammar — u is being removed from the game
Flags —Native
|Event
This event fires when a unit is removed from the game. Use “Triggering Player” to get the owner of the unit. Use “Triggering Unit” to get the unit.
# Arguments
unitref
<unit> — Unit
Returns — void
native void TriggerAddEventUnitRemoved(
trigger t,
unitref u,
);
# Event parameters
- Triggering Game User — EventGameUser
- Triggering Player — EventPlayer
- Triggering Unit — EventUnit
# 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/VoidCampaignMissionLib.galaxy:8111
libVCMI_gt_PM_CampaignCyberneticsRemoved = TriggerCreate("libVCMI_gt_PM_CampaignCyberneticsRemoved_Func");
TriggerEnable(libVCMI_gt_PM_CampaignCyberneticsRemoved, false);
TriggerAddEventUnitRemoved(libVCMI_gt_PM_CampaignCyberneticsRemoved, null);
}
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:8196
void libVCMI_gt_PM_UnitBeingRemoved_Init () {
libVCMI_gt_PM_UnitBeingRemoved = TriggerCreate("libVCMI_gt_PM_UnitBeingRemoved_Func");
TriggerAddEventUnitRemoved(libVCMI_gt_PM_UnitBeingRemoved, null);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:13433
libGDHL_gt_HeroLostVikingsVikingRemoved = TriggerCreate("libGDHL_gt_HeroLostVikingsVikingRemoved_Func");
TriggerEnable(libGDHL_gt_HeroLostVikingsVikingRemoved, false);
TriggerAddEventUnitRemoved(libGDHL_gt_HeroLostVikingsVikingRemoved, null);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:19635
libGDHL_gt_HeroRexxarRemoveMisha = TriggerCreate("libGDHL_gt_HeroRexxarRemoveMisha_Func");
TriggerEnable(libGDHL_gt_HeroRexxarRemoveMisha, false);
TriggerAddEventUnitRemoved(libGDHL_gt_HeroRexxarRemoveMisha, null);
}
mods/heromods/chogall.stormmod — base.stormdata/LibHCHO.galaxy:2214
libHCHO_gt_HeroChoGallChoRemovedRemoveGall = TriggerCreate("libHCHO_gt_HeroChoGallChoRemovedRemoveGall_Func");
TriggerEnable(libHCHO_gt_HeroChoGallChoRemovedRemoveGall, false);
TriggerAddEventUnitRemoved(libHCHO_gt_HeroChoGallChoRemovedRemoveGall, null);
}
mods/missionpacks/novacampaign.sc2mod — base.sc2data/LibNCMI.galaxy:6594
void libNCMI_gt_NM_UnitBeingRemoved_Init () {
libNCMI_gt_NM_UnitBeingRemoved = TriggerCreate("libNCMI_gt_NM_UnitBeingRemoved_Func");
TriggerAddEventUnitRemoved(libNCMI_gt_NM_UnitBeingRemoved, null);
}