# Unit XP Set Current Level
Grammar — Sets the current level in veterancyBehavior for unit to level
Flags —Native
|Action
Sets the current level of a unit
# Arguments
unit
— Unitstring
<gamelink::Behavior> — Veterancy Behaviorint
— Level
Returns — void
native void UnitXPSetCurrentLevel(
unit inUnit,
string inVeterancyBehavior,
int inLevel,
);
# 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/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:11158
for ( ; ( (autoD19BFE26_ai >= 0 && lv_itTeam <= autoD19BFE26_ae) || (autoD19BFE26_ai < 0 && lv_itTeam >= autoD19BFE26_ae) ) ; lv_itTeam += autoD19BFE26_ai ) {
if ((UnitIsAlive(libGame_gv_teams[lv_itTeam].lv_core) == true) && (UnitHasBehavior2(libGame_gv_teams[lv_itTeam].lv_core, "CoreScaling") == true)) {
UnitXPSetCurrentLevel(libGame_gv_teams[lv_itTeam].lv_core, null, libGame_gv_scalingTicks);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:1702
lv_totalKills = libNtve_gf_UnitGetPropertyKills(lv_actualKiller, c_unitPropCurrent);
UnitBehaviorAdd(lv_actualKiller, "MutatorKarmaIncreasedDamageVet", lv_actualKiller, 1);
UnitXPSetCurrentLevel(lv_actualKiller, "MutatorKarmaIncreasedDamageVet", lv_totalKills);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:3011
if (lv_bonusUnit == null) { break; }
if ((UnitHasBehavior2(lv_bonusUnit, "MutatorKarmaIncreasedDamageVet") == true)) {
UnitXPSetCurrentLevel(lv_bonusUnit, "MutatorKarmaIncreasedDamageVet", 0);
UnitSetPropertyFixed(lv_bonusUnit, c_unitPropKills, 0.0);
}