# Unit Gains Experience Level
Grammar — u gains an experience level
Flags —Native
|Event
This event fires when a unit gains an experience level. Use “Triggering Behavior” to get the behavior. Use “Triggering Player” to get the owner of the unit that gained a level. Use “Triggering Unit” to get the unit that gained a level.
# Arguments
unitref
<unit> — Unit
Returns — void
native void TriggerAddEventUnitGainLevel(
trigger t,
unitref u,
);
# Event parameters
- Triggering Behavior — EventUnitBehavior
- Triggering Game User — EventGameUser
- Triggering Player — EventPlayer
- Triggering Unit — EventUnit
# Related
Category: Unit / Attributes And Experience
- Unit Gains Experience —
void
— TriggerAddEventUnitGainExperience - Unit Gains Experience Level —
void
— TriggerAddEventUnitGainLevel - Unit XP Get Current XP —
fixed
— UnitXPGetCurrentXP - Unit XP Add XP —
void
— UnitXPAddXP - Unit XP Set Current XP —
void
— UnitXPSetCurrentXP - Unit XP Get XP For Level —
int
— UnitXPGetXPForLevel - Unit XP Set XP For Level —
void
— UnitXPSetXPForLevel - Unit XP Get Current Level —
int
— UnitXPGetCurrentLevel - Unit XP Set Current Level —
void
— UnitXPSetCurrentLevel - Unit XP Get Num Levels —
int
— UnitXPGetNumLevels - Triggering Experience Gained —
fixed
— EventUnitXPDelta - Unit Attribute Change —
void
— TriggerAddEventUnitAttributeChange - Triggering Attribute Points —
int
— EventUnitAttributePoints - Total Experience Of Unit —
fixed
— UnitXPTotal - Experience Level Of Unit —
int
— UnitLevel - Enable/Disable Experience Gain For Unit —
void
— UnitXPGainEnable
# Examples
mods/heroes.stormmod — base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorial01.stormmap/MapScript.galaxy:3103
void gt_LevelUpQ_Init () {
gt_LevelUpQ = TriggerCreate("gt_LevelUpQ_Func");
TriggerAddEventUnitGainLevel(gt_LevelUpQ, UnitRefFromVariable("gv_heroPlayer"));
}
mods/heroes.stormmod — base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorial01.stormmap/MapScript.galaxy:4309
gt_Level10gained = TriggerCreate("gt_Level10gained_Func");
TriggerEnable(gt_Level10gained, false);
TriggerAddEventUnitGainLevel(gt_Level10gained, UnitRefFromVariable("gv_heroPlayer"));
}
mods/heroes.stormmod — base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialmapmechanics.stormmap/MapScript.galaxy:1336
void gt_LevelUpStartMapEvent_Init () {
gt_LevelUpStartMapEvent = TriggerCreate("gt_LevelUpStartMapEvent_Func");
TriggerAddEventUnitGainLevel(gt_LevelUpStartMapEvent, UnitRefFromVariable("gv_heroPlayer"));
}
mods/heroes.stormmod — base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialveteran.stormmap/MapScript.galaxy:5245
gt__1E_RoamingLevelMonitor = TriggerCreate("gt__1E_RoamingLevelMonitor_Func");
TriggerEnable(gt__1E_RoamingLevelMonitor, false);
TriggerAddEventUnitGainLevel(gt__1E_RoamingLevelMonitor, UnitRefFromVariable("libStEx_gv_hERO_PlayerUnit"));
TriggerAddEventUnitGainLevel(gt__1E_RoamingLevelMonitor, UnitRefFromVariable("libStEx_gv_hERO_EnemyGreymane"));
}
mods/heroes.stormmod — base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialveteran.stormmap/MapScript.galaxy:5246
TriggerEnable(gt__1E_RoamingLevelMonitor, false);
TriggerAddEventUnitGainLevel(gt__1E_RoamingLevelMonitor, UnitRefFromVariable("libStEx_gv_hERO_PlayerUnit"));
TriggerAddEventUnitGainLevel(gt__1E_RoamingLevelMonitor, UnitRefFromVariable("libStEx_gv_hERO_EnemyGreymane"));
}
mods/heroes.stormmod — base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialveteran.stormmap/MapScript.galaxy:5833
gt__1E_RoamingTeamLevelUpLabel = TriggerCreate("gt__1E_RoamingTeamLevelUpLabel_Func");
TriggerEnable(gt__1E_RoamingTeamLevelUpLabel, false);
TriggerAddEventUnitGainLevel(gt__1E_RoamingTeamLevelUpLabel, null);
}
mods/heroes.stormmod — base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialveteran.stormmap/MapScript.galaxy:6864
gt__2B_SoakLanesLevelMonitor = TriggerCreate("gt__2B_SoakLanesLevelMonitor_Func");
TriggerEnable(gt__2B_SoakLanesLevelMonitor, false);
TriggerAddEventUnitGainLevel(gt__2B_SoakLanesLevelMonitor, UnitRefFromVariable("libStEx_gv_hERO_PlayerUnit"));
TriggerAddEventUnitGainLevel(gt__2B_SoakLanesLevelMonitor, UnitRefFromVariable("libStEx_gv_hERO_EnemyFalstad"));
}
mods/heroes.stormmod — base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialveteran.stormmap/MapScript.galaxy:6865
TriggerEnable(gt__2B_SoakLanesLevelMonitor, false);
TriggerAddEventUnitGainLevel(gt__2B_SoakLanesLevelMonitor, UnitRefFromVariable("libStEx_gv_hERO_PlayerUnit"));
TriggerAddEventUnitGainLevel(gt__2B_SoakLanesLevelMonitor, UnitRefFromVariable("libStEx_gv_hERO_EnemyFalstad"));
}
mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorial01.stormmap — MapScript.galaxy:3103
void gt_LevelUpQ_Init () {
gt_LevelUpQ = TriggerCreate("gt_LevelUpQ_Func");
TriggerAddEventUnitGainLevel(gt_LevelUpQ, UnitRefFromVariable("gv_heroPlayer"));
}
mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorial01.stormmap — MapScript.galaxy:4309
gt_Level10gained = TriggerCreate("gt_Level10gained_Func");
TriggerEnable(gt_Level10gained, false);
TriggerAddEventUnitGainLevel(gt_Level10gained, UnitRefFromVariable("gv_heroPlayer"));
}
mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialmapmechanics.stormmap — MapScript.galaxy:1336
void gt_LevelUpStartMapEvent_Init () {
gt_LevelUpStartMapEvent = TriggerCreate("gt_LevelUpStartMapEvent_Func");
TriggerAddEventUnitGainLevel(gt_LevelUpStartMapEvent, UnitRefFromVariable("gv_heroPlayer"));
}
mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialveteran.stormmap — MapScript.galaxy:5245
gt__1E_RoamingLevelMonitor = TriggerCreate("gt__1E_RoamingLevelMonitor_Func");
TriggerEnable(gt__1E_RoamingLevelMonitor, false);
TriggerAddEventUnitGainLevel(gt__1E_RoamingLevelMonitor, UnitRefFromVariable("libStEx_gv_hERO_PlayerUnit"));
TriggerAddEventUnitGainLevel(gt__1E_RoamingLevelMonitor, UnitRefFromVariable("libStEx_gv_hERO_EnemyGreymane"));
}
mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialveteran.stormmap — MapScript.galaxy:5246
TriggerEnable(gt__1E_RoamingLevelMonitor, false);
TriggerAddEventUnitGainLevel(gt__1E_RoamingLevelMonitor, UnitRefFromVariable("libStEx_gv_hERO_PlayerUnit"));
TriggerAddEventUnitGainLevel(gt__1E_RoamingLevelMonitor, UnitRefFromVariable("libStEx_gv_hERO_EnemyGreymane"));
}
mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialveteran.stormmap — MapScript.galaxy:5833
gt__1E_RoamingTeamLevelUpLabel = TriggerCreate("gt__1E_RoamingTeamLevelUpLabel_Func");
TriggerEnable(gt__1E_RoamingTeamLevelUpLabel, false);
TriggerAddEventUnitGainLevel(gt__1E_RoamingTeamLevelUpLabel, null);
}
mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialveteran.stormmap — MapScript.galaxy:6864
gt__2B_SoakLanesLevelMonitor = TriggerCreate("gt__2B_SoakLanesLevelMonitor_Func");
TriggerEnable(gt__2B_SoakLanesLevelMonitor, false);
TriggerAddEventUnitGainLevel(gt__2B_SoakLanesLevelMonitor, UnitRefFromVariable("libStEx_gv_hERO_PlayerUnit"));
TriggerAddEventUnitGainLevel(gt__2B_SoakLanesLevelMonitor, UnitRefFromVariable("libStEx_gv_hERO_EnemyFalstad"));
}
mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialveteran.stormmap — MapScript.galaxy:6865
TriggerEnable(gt__2B_SoakLanesLevelMonitor, false);
TriggerAddEventUnitGainLevel(gt__2B_SoakLanesLevelMonitor, UnitRefFromVariable("libStEx_gv_hERO_PlayerUnit"));
TriggerAddEventUnitGainLevel(gt__2B_SoakLanesLevelMonitor, UnitRefFromVariable("libStEx_gv_hERO_EnemyFalstad"));
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:19355
void libGame_gt_LevelUp_Init () {
libGame_gt_LevelUp = TriggerCreate("libGame_gt_LevelUp_Func");
TriggerAddEventUnitGainLevel(libGame_gt_LevelUp, null);
}
mods/heromods/zarya.stormmod — base.stormdata/LibHZAR.galaxy:1134
libHZAR_gt_HeroZaryaRefreshConversionRates = TriggerCreate("libHZAR_gt_HeroZaryaRefreshConversionRates_Func");
TriggerEnable(libHZAR_gt_HeroZaryaRefreshConversionRates, false);
TriggerAddEventUnitGainLevel(libHZAR_gt_HeroZaryaRefreshConversionRates, null);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:17788
libCOMI_gt_CM_Dehaka_LevelUp_Stage2_ColossusLegs = TriggerCreate("libCOMI_gt_CM_Dehaka_LevelUp_Stage2_ColossusLegs_Func");
TriggerEnable(libCOMI_gt_CM_Dehaka_LevelUp_Stage2_ColossusLegs, false);
TriggerAddEventUnitGainLevel(libCOMI_gt_CM_Dehaka_LevelUp_Stage2_ColossusLegs, null);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:17835
libCOMI_gt_CM_Dehaka_LevelUp_Stage3 = TriggerCreate("libCOMI_gt_CM_Dehaka_LevelUp_Stage3_Func");
TriggerEnable(libCOMI_gt_CM_Dehaka_LevelUp_Stage3, false);
TriggerAddEventUnitGainLevel(libCOMI_gt_CM_Dehaka_LevelUp_Stage3, null);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:31769
libCOMI_gt_CM_AbilityTransmissionDehakaChangeReminderLevel = TriggerCreate("libCOMI_gt_CM_AbilityTransmissionDehakaChangeReminderLevel_Func");
TriggerEnable(libCOMI_gt_CM_AbilityTransmissionDehakaChangeReminderLevel, false);
TriggerAddEventUnitGainLevel(libCOMI_gt_CM_AbilityTransmissionDehakaChangeReminderLevel, null);
}
mods/warcoop/warclassic.sc2mod — base.sc2data/TriggerLibs/WarClassic.galaxy:832
libGAw3_gt_EVENT_PLAYER_HERO_LEVEL = TriggerCreate("libGAw3_gt_EVENT_PLAYER_HERO_LEVEL_Func");
TriggerEnable(libGAw3_gt_EVENT_PLAYER_HERO_LEVEL, false);
TriggerAddEventUnitGainLevel(libGAw3_gt_EVENT_PLAYER_HERO_LEVEL, null);
}
mods/warcoop/warcoopdata.sc2mod — base.sc2data/TriggerLibs/WarCoopData.galaxy:4003
void libWCdr_gt_HeroLevelsUp_Init () {
libWCdr_gt_HeroLevelsUp = TriggerCreate("libWCdr_gt_HeroLevelsUp_Func");
TriggerAddEventUnitGainLevel(libWCdr_gt_HeroLevelsUp, null);
}