# Unit Starts Attacking
Grammar — u starts attacking with weapon
Flags —Native
|Event
This event fires when a unit starts attacking. Use “Attacking Unit” or “Triggering Unit” to get the attacker. Use “Triggering Player” to get the owner of the attacker.
# Arguments
unitref
[ unit ] — Unitstring
[ gamelink::Weapon ] — Weapon
Returns — void
native void TriggerAddEventUnitStartedAttack2(
trigger t,
unitref u,
string inWeapon,
);
# Related
Category: Unit / Combat
- [F] —
fixed
— Get Unit Damage Dealt Time — ( UnitGetDamageDealtTime ) - [F] —
fixed
— Get Unit Damage Taken Time — ( UnitGetDamageTakenTime ) - [F] —
string
[ gamelink::Weapon ] — Weapon Used In Attack — ( EventUnitGetWeapon ) - [F] —
unit
— Item Used In Attack — ( EventUnitGetItem ) - [F] —
string
[ gamelink::Item ] — Item Type Used In Attack — ( EventUnitGetItemType ) - [F] —
void
— Unit Dies — ( TriggerAddEventUnitDied ) - [F] —
unit
— Killing Unit — ( libNtve_gf_KillingUnit ) - [F] —
int
— Killing Player — ( libNtve_gf_KillingPlayer ) - [F] —
bool
— Triggering Death Type Check — ( EventUnitDamageDeathCheck ) - [F] —
void
— Unit Is Being Removed — ( TriggerAddEventUnitRemoved ) - [F] —
void
— Unit Starts Attacking (Deprecated) — ( TriggerAddEventUnitStartedAttack ) - [F] —
void
— Unit Starts Attacking — ( TriggerAddEventUnitStartedAttack2 ) - [F] —
void
— Unit Is Attacked (Deprecated) — ( TriggerAddEventUnitAttacked ) - [F] —
void
— Unit Is Attacked — ( TriggerAddEventUnitAttacked2 ) - [F] —
unit
— Attacking Unit — ( EventUnitTarget ) - [F] —
void
— Unit Absorbs Damage — ( TriggerAddEventUnitDamageAbsorbed ) - [F] —
void
— Unit Takes Damage — ( TriggerAddEventUnitDamaged ) - [F] —
unit
— Damaging Unit — ( EventUnitDamageSourceUnit ) - [F] —
int
— Damaging Player — ( EventUnitDamageSourcePlayer ) - [F] —
string
[ gamelink::Effect ] — Damaging Effect — ( EventUnitDamageEffect ) - [F] —
fixed
— Triggering Damage Taken — ( EventUnitDamageAmount ) - [F] —
fixed
— Triggering Damage Attempted — ( EventUnitDamageAttempted ) - [F] —
fixed
— Triggering Damage Attempted Vitals — ( EventUnitDamageAttemptedVitals ) - [F] —
fixed
— Triggering Damage Absorbed — ( EventUnitDamageAbsorbed ) - [F] —
fixed
— Triggering Damage Behavior Shield — ( EventUnitDamageBehaviorShield ) - [F] —
fixed
— Triggering Vitals Leeched — ( EventUnitDamageVitalsLeeched ) - [F] —
int
— Triggering Unit Kill XP — ( EventUnitDamageKillXP ) - [F] —
point
— Damage Source Position — ( EventUnitDamageSourcePoint ) - [F] —
void
— Unit is Healed — ( TriggerAddEventUnitHealed ) - [F] —
unit
— Healing Unit — ( EventUnitHealLaunchUnit ) - [F] —
int
— Healing Player — ( EventUnitHealLaunchPlayer ) - [F] —
int
[ preset::UnitVitalType ] — Triggering Heal Vital Type — ( EventUnitHealVital ) - [F] —
fixed
— Triggering Heal Given — ( EventUnitHealAmount ) - [F] —
string
[ gamelink::Effect ] — Healing Effect — ( EventUnitHealEffect ) - [F] —
void
— Unit Spends Vital — ( TriggerAddEventUnitSpendVital ) - [F] —
int
[ preset::UnitVitalType ] — Triggering Spent Vital Type — ( EventUnitSpentVitalVital ) - [F] —
fixed
— Triggering Vital Spent — ( EventUnitSpentVitalAmount ) - [F] —
void
— Unit Acquires Target — ( TriggerAddEventUnitAcquiredTarget ) - [F] —
unit
— Acquired Target — ( libNtve_gf_AcquiredTarget ) - [F] —
void
— Unit Is Revived — ( TriggerAddEventUnitRevive ) - [F] —
unit
— Triggering Victim Unit — ( EventUnitVictimUnit ) - [F] —
unit
— Triggering Item Used — ( EventUnitItemUsed ) - [F] —
string
[ gamelink::Effect ] — Triggering Effect Used — ( EventUnitEffectUsed )
# Examples
# campaigns/swarm.sc2campaign
// L2080
TriggerAddEventUnitStartedAttack2(gt_HybridStartsAttackingQ, UnitRefFromUnit(UnitFromId(1485)), null)
// L2080
TriggerAddEventUnitStartedAttack2(gt_HybridStartsAttackingQ, UnitRefFromUnit(UnitFromId(1485)), null)
// L3083
TriggerAddEventUnitStartedAttack2(gt_ThorBark1Q, UnitRefFromUnit(UnitFromId(624)), null)
// L3124
TriggerAddEventUnitStartedAttack2(gt_HybridTauntQ, UnitRefFromUnit(UnitFromId(481)), null)
// L3083
TriggerAddEventUnitStartedAttack2(gt_ThorBark1Q, UnitRefFromUnit(UnitFromId(624)), null)
// L3124
TriggerAddEventUnitStartedAttack2(gt_HybridTauntQ, UnitRefFromUnit(UnitFromId(481)), null)
# mods/heromods/chromie.stormmod
// L193
TriggerAddEventUnitStartedAttack2(libHCHR_gt_HeroChromieSandEchoBasicAttackAnimationBegins, null, "ChromieHeroWeapon")
# mods/novastoryassets.sc2mod
// L3748
TriggerAddEventUnitStartedAttack2(gt_TrooperFindsNovaQ, null, null)
// L4385
TriggerAddEventUnitStartedAttack2(gt_SnipeHallReaperFindsNovaQ, null, null)
// L2546
TriggerAddEventUnitStartedAttack2(gt_DOMUnitsEngagingTargetTransmissionsQ, null, null)
// L3948
TriggerAddEventUnitStartedAttack2(gt_S1CombatInDefendRegionsController, null, null)
// L5791
TriggerAddEventUnitStartedAttack2(gt_S2CombatInDefendRegionsController, null, null)
// L3748
TriggerAddEventUnitStartedAttack2(gt_TrooperFindsNovaQ, null, null)
// L4385
TriggerAddEventUnitStartedAttack2(gt_SnipeHallReaperFindsNovaQ, null, null)
// L2546
TriggerAddEventUnitStartedAttack2(gt_DOMUnitsEngagingTargetTransmissionsQ, null, null)
// L3948
TriggerAddEventUnitStartedAttack2(gt_S1CombatInDefendRegionsController, null, null)
// L5791
TriggerAddEventUnitStartedAttack2(gt_S2CombatInDefendRegionsController, null, null)
# mods/warcoop/warclassic.sc2mod
// L54
TriggerAddEventUnitStartedAttack2(t,ur,weapon)