# Unit XP Set Current Level

Grammar — Sets the current level in veterancyBehavior for unit to level
FlagsNative | Action

Sets the current level of a unit

# Arguments

  • unit — Unit
  • string<gamelink::Behavior> — Veterancy Behavior
  • int — Level

Returns — void

native void UnitXPSetCurrentLevel(
	unit inUnit,
	string inVeterancyBehavior,
	int inLevel,
);

Category: Unit / Attributes And Experience

# Examples

mods/heroesdata.stormmodbase.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.sc2modbase.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.sc2modbase.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);
            }