# Unit Gains Experience

Grammaru gains experience
FlagsNative | Event

This event fires when a unit gains experience. Use “Triggering Behavior” to get the behavior. Use “Triggering Experience Gained” to get the amount of experience. Use “Triggering Player” to get the owner of the unit that gained experience. Use “Triggering Unit” to get the unit that gained experience.

# Arguments

  • unitref<unit> — Unit

Returns — void

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

# Event parameters

Category: Unit / Attributes And Experience

# Examples

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:13601

    libGDHL_gt_HeroLostVikingsXPGain = TriggerCreate("libGDHL_gt_HeroLostVikingsXPGain_Func");
    TriggerEnable(libGDHL_gt_HeroLostVikingsXPGain, false);
    TriggerAddEventUnitGainExperience(libGDHL_gt_HeroLostVikingsXPGain, null);
}

mods/heromods/dva.stormmodbase.stormdata/LibHDVA.galaxy:1864

void libHDVA_gt_DEBUGDVaXPEqualizer_Init () {
    libHDVA_gt_DEBUGDVaXPEqualizer = TriggerCreate("libHDVA_gt_DEBUGDVaXPEqualizer_Func");
    TriggerAddEventUnitGainExperience(libHDVA_gt_DEBUGDVaXPEqualizer, null);
}