# Unit Is Attacked (Deprecated)

Grammaru is attacked
FlagsNative | Event | Hidden

This event fires when a unit is attacked. Use “Attacking Unit” to refer to the unit performing the attack. Use “Triggering Unit” to refer to the unit being attacked. Use “Triggering Player” to get the owner of the unit being attacked.

# Arguments

  • unitref [ unit ] — Unit

Returns — void

native void TriggerAddEventUnitAttacked(
	trigger t,
	unitref u,
);

# Event parameters

Category: Unit / Combat

# Examples

# campaigns/liberty.sc2campaign

MapScript.galaxy

// L2558
TriggerAddEventUnitAttacked(gt_AggroPassiveUnits, null)
// L6261
TriggerAddEventUnitAttacked(gt_Vikingattackback, UnitRefFromUnit(UnitFromId(215)))
// L6289
TriggerAddEventUnitAttacked(gt_Thorattackback, UnitRefFromUnit(UnitFromId(68)))
// L2004
TriggerAddEventUnitAttacked(gt_SouthieMarineaggroStatue, null)
// L3134
TriggerAddEventUnitAttacked(gt_DominionCompoundReticleKiller, null)
// L3393
TriggerAddEventUnitAttacked(gt_HoloReticuleKiller, null)
// L1556
TriggerAddEventUnitAttacked(gt_P1GateReticleKiller, UnitRefFromUnit(UnitFromId(456)))
// L2200
TriggerAddEventUnitAttacked(gt_P1Designatorremover, null)
// L3102
TriggerAddEventUnitAttacked(gt_P2GateReticleKiller, UnitRefFromUnit(UnitFromId(455)))
// L3646
TriggerAddEventUnitAttacked(gt_P2Designatorremover, null)
// L4645
TriggerAddEventUnitAttacked(gt_P3Designatorremover, null)
// L4334
TriggerAddEventUnitAttacked(gt_Combat01AttackStarted, null)
// L2296
TriggerAddEventUnitAttacked(gt_LaserSoundFiringDelay, null)
// L2203
TriggerAddEventUnitAttacked(gt_Site1ReticuleKiller, null)
// L2240
TriggerAddEventUnitAttacked(gt_Site2ReticuleKiller, null)
// L2277
TriggerAddEventUnitAttacked(gt_Site3ReticuleKiller, null)
// L6010
TriggerAddEventUnitAttacked(gt_BrutaliskReticuleKiller, null)
// L818
TriggerAddEventUnitAttacked(gt_PlayerIsInCombatbeingattacked, null)
// L1735
TriggerAddEventUnitAttacked(gt_PrisonReticuleKiller, null)
// L2310
TriggerAddEventUnitAttacked(gt_ReticuleKiller, null)
// L2934
TriggerAddEventUnitAttacked(gt_XelnagaVaultReticuleKiller, null)
// L2143
TriggerAddEventUnitAttacked(gt_Gank_Drop01_Attacked, null)
// L2176
TriggerAddEventUnitAttacked(gt_Gank_Drop02_Attacked, null)
// L2209
TriggerAddEventUnitAttacked(gt_Gank_Drop03_Attacked_Factory, null)
// L2242
TriggerAddEventUnitAttacked(gt_Gank_Drop04_Attacked, null)
// L2275
TriggerAddEventUnitAttacked(gt_Gank_Drop05_Attacked_Starport, null)
// L2308
TriggerAddEventUnitAttacked(gt_Gank_Drop06_Attacked, null)
// L2341
TriggerAddEventUnitAttacked(gt_Gank_Drop07_Attacked, null)
// L2374
TriggerAddEventUnitAttacked(gt_Gank_Drop08_Attacked, null)
// L2407
TriggerAddEventUnitAttacked(gt_Gank_Drop09_Attacked, null)
// L2440
TriggerAddEventUnitAttacked(gt_Gank_Drop10_Attacked, null)
// L1470
TriggerAddEventUnitAttacked(gt_RemovetheCoolantTowerPing, null)
// L4197
TriggerAddEventUnitAttacked(gt_ProtossGetAttackedFirstSetAlliance, null)
// L2558
TriggerAddEventUnitAttacked(gt_AggroPassiveUnits, null)
// L6261
TriggerAddEventUnitAttacked(gt_Vikingattackback, UnitRefFromUnit(UnitFromId(215)))
// L6289
TriggerAddEventUnitAttacked(gt_Thorattackback, UnitRefFromUnit(UnitFromId(68)))
// L2004
TriggerAddEventUnitAttacked(gt_SouthieMarineaggroStatue, null)
// L3134
TriggerAddEventUnitAttacked(gt_DominionCompoundReticleKiller, null)
// L3393
TriggerAddEventUnitAttacked(gt_HoloReticuleKiller, null)
// L1556
TriggerAddEventUnitAttacked(gt_P1GateReticleKiller, UnitRefFromUnit(UnitFromId(456)))
// L2200
TriggerAddEventUnitAttacked(gt_P1Designatorremover, null)
// L3102
TriggerAddEventUnitAttacked(gt_P2GateReticleKiller, UnitRefFromUnit(UnitFromId(455)))
// L3646
TriggerAddEventUnitAttacked(gt_P2Designatorremover, null)
// L4645
TriggerAddEventUnitAttacked(gt_P3Designatorremover, null)
// L4334
TriggerAddEventUnitAttacked(gt_Combat01AttackStarted, null)
// L2296
TriggerAddEventUnitAttacked(gt_LaserSoundFiringDelay, null)
// L2203
TriggerAddEventUnitAttacked(gt_Site1ReticuleKiller, null)
// L2240
TriggerAddEventUnitAttacked(gt_Site2ReticuleKiller, null)
// L2277
TriggerAddEventUnitAttacked(gt_Site3ReticuleKiller, null)
// L6010
TriggerAddEventUnitAttacked(gt_BrutaliskReticuleKiller, null)
// L818
TriggerAddEventUnitAttacked(gt_PlayerIsInCombatbeingattacked, null)
// L1735
TriggerAddEventUnitAttacked(gt_PrisonReticuleKiller, null)
// L2310
TriggerAddEventUnitAttacked(gt_ReticuleKiller, null)
// L2934
TriggerAddEventUnitAttacked(gt_XelnagaVaultReticuleKiller, null)
// L2143
TriggerAddEventUnitAttacked(gt_Gank_Drop01_Attacked, null)
// L2176
TriggerAddEventUnitAttacked(gt_Gank_Drop02_Attacked, null)
// L2209
TriggerAddEventUnitAttacked(gt_Gank_Drop03_Attacked_Factory, null)
// L2242
TriggerAddEventUnitAttacked(gt_Gank_Drop04_Attacked, null)
// L2275
TriggerAddEventUnitAttacked(gt_Gank_Drop05_Attacked_Starport, null)
// L2308
TriggerAddEventUnitAttacked(gt_Gank_Drop06_Attacked, null)
// L2341
TriggerAddEventUnitAttacked(gt_Gank_Drop07_Attacked, null)
// L2374
TriggerAddEventUnitAttacked(gt_Gank_Drop08_Attacked, null)
// L2407
TriggerAddEventUnitAttacked(gt_Gank_Drop09_Attacked, null)
// L2440
TriggerAddEventUnitAttacked(gt_Gank_Drop10_Attacked, null)
// L1470
TriggerAddEventUnitAttacked(gt_RemovetheCoolantTowerPing, null)
// L4197
TriggerAddEventUnitAttacked(gt_ProtossGetAttackedFirstSetAlliance, null)
// L2926
TriggerAddEventUnitAttacked(gt_FirebatAttacked, null)
// L1393
TriggerAddEventUnitAttacked(gt_RemoveHarmless, UnitRefFromUnit(UnitFromId(795)))
// L1394
TriggerAddEventUnitAttacked(gt_RemoveHarmless, UnitRefFromUnit(UnitFromId(115)))
// L1556
TriggerAddEventUnitAttacked(gt_PlayerIsInCombat, null)
// L1442
TriggerAddEventUnitAttacked(gt_PlayerIsInCombat, null)
// L4595
TriggerAddEventUnitAttacked(gt_KillHelperModelPsiBroadcaster01, UnitRefFromUnit(UnitFromId(18)))
// L1242
TriggerAddEventUnitAttacked(gt_PlayerIsInCombat, null)
// L2743
TriggerAddEventUnitAttacked(gt_VirophageAttacked, null)
// L1761
TriggerAddEventUnitAttacked(gt_PlayerIsInCombat, null)
// L1151
TriggerAddEventUnitAttacked(gt_InCombatCheck, null)
// L2873
TriggerAddEventUnitAttacked(gt_Crystal1Defense, UnitRefFromUnit(UnitFromId(749)))
// L2982
TriggerAddEventUnitAttacked(gt_Crystal2Defense, UnitRefFromUnit(UnitFromId(773)))
// L3081
TriggerAddEventUnitAttacked(gt_Crystal3Defense, UnitRefFromUnit(UnitFromId(778)))
// L1426
TriggerAddEventUnitAttacked(gt_PlayerIsInCombat, null)
// L1439
TriggerAddEventUnitAttacked(gt_PlayerIsInCombat, null)
// L4278
TriggerAddEventUnitAttacked(gt_PowerLink1DominionReaction, null)
// L3146
TriggerAddEventUnitAttacked(gt_PalaceGateat90, UnitRefFromUnit(UnitFromId(675)))
// L3243
TriggerAddEventUnitAttacked(gt_PalaceGateat50, UnitRefFromUnit(UnitFromId(675)))
// L3406
TriggerAddEventUnitAttacked(gt_HyperionAttacked, UnitRefFromVariable("gv_hYPERION"))
// L1802
TriggerAddEventUnitAttacked(gt_RemoveHarmless, null)
// L6237
TriggerAddEventUnitAttacked(gt_Platform02SentryBotsReact, UnitRefFromUnit(UnitFromId(415)))
// L6238
TriggerAddEventUnitAttacked(gt_Platform02SentryBotsReact, UnitRefFromUnit(UnitFromId(416)))
// L6239
TriggerAddEventUnitAttacked(gt_Platform02SentryBotsReact, UnitRefFromUnit(UnitFromId(414)))
// L6240
TriggerAddEventUnitAttacked(gt_Platform02SentryBotsReact, UnitRefFromUnit(UnitFromId(115)))
// L6241
TriggerAddEventUnitAttacked(gt_Platform02SentryBotsReact, UnitRefFromUnit(UnitFromId(114)))
// L7035
TriggerAddEventUnitAttacked(gt_Room04KillTurretHelperAttacked, UnitRefFromUnit(UnitFromId(255)))
// L7036
TriggerAddEventUnitAttacked(gt_Room04KillTurretHelperAttacked, UnitRefFromUnit(UnitFromId(258)))
// L7037
TriggerAddEventUnitAttacked(gt_Room04KillTurretHelperAttacked, UnitRefFromUnit(UnitFromId(292)))
// L1641
TriggerAddEventUnitAttacked(gt_PlayerIsInCombat, null)
// L4441
TriggerAddEventUnitAttacked(gt_QueenRescueBeingAttackedRight, null)
// L4704
TriggerAddEventUnitAttacked(gt_QueenRescueBeingAttackedLeft, null)
// L4967
TriggerAddEventUnitAttacked(gt_QueenRescueBeingAttackedCenter, null)
// L7153
TriggerAddEventUnitAttacked(gt_InfestedHutRemoveHarmless, null)
// L3454
TriggerAddEventUnitAttacked(gt_HyperionFightersInCombat, null)