# Total Experience Of Unit

Grammar — Total experience of unit
FlagsNative | Function

Returns the total experience a unit possesses.

# Arguments

  • unit — Unit

Returns — fixed

native fixed UnitXPTotal(unit inUnit);

# Supported triggers

Category: Unit / Attributes And Experience

# Examples

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

    UISetSelectionTypeEnabled(PlayerGroupSingle(lv_ownerOfCreatedUnit), c_localSelectionTypeWorldPanelHero, false);
    UnitSetFacing(lv_createdUnit, UnitGetFacing(lv_creatingUnit), 0.0);
    UnitSetPropertyFixed(lv_createdUnit, c_unitPropXP, UnitXPTotal(lv_creatingUnit));
    UnitSetPropertyFixed(lv_createdUnit, c_unitPropLifeMax, UnitGetPropertyFixed(lv_creatingUnit, c_unitPropLifeMax, c_unitPropCurrent));
    UnitSetPropertyFixed(lv_createdUnit, c_unitPropLife, UnitGetPropertyFixed(lv_creatingUnit, c_unitPropLife, c_unitPropCurrent));

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/SupportLib.galaxy:4685

    for ( ; lv_iterPlayer <= auto1BAA646D_ae ; lv_iterPlayer += 1 ) {
        if ((UnitIsValid(libGame_gv_players[lv_iterPlayer].lv_heroUnit) == true)) {
            if ((UnitXPTotal(libGame_gv_players[lv_iterPlayer].lv_heroUnit) > lv_highestXP)) {
                lv_highestXP = UnitXPTotal(libGame_gv_players[lv_iterPlayer].lv_heroUnit);
            }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/SupportLib.galaxy:4686

        if ((UnitIsValid(libGame_gv_players[lv_iterPlayer].lv_heroUnit) == true)) {
            if ((UnitXPTotal(libGame_gv_players[lv_iterPlayer].lv_heroUnit) > lv_highestXP)) {
                lv_highestXP = UnitXPTotal(libGame_gv_players[lv_iterPlayer].lv_heroUnit);
            }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/SupportLib.galaxy:4743

    }

    lv_lowestXP = UnitXPTotal(libGame_gv_players[1].lv_heroUnit);
    auto5C858753_ae = libCore_gv_bALMaxPlayers;
    lv_iterPlayer = 1;

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/SupportLib.galaxy:4748

    for ( ; lv_iterPlayer <= auto5C858753_ae ; lv_iterPlayer += 1 ) {
        if ((UnitIsValid(libGame_gv_players[lv_iterPlayer].lv_heroUnit) == true)) {
            if ((UnitXPTotal(libGame_gv_players[lv_iterPlayer].lv_heroUnit) >= lv_highestXP)) {
                lv_highestXP = UnitXPTotal(libGame_gv_players[lv_iterPlayer].lv_heroUnit);
                lv_highestXPUnit = libGame_gv_players[lv_iterPlayer].lv_heroUnit;

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/SupportLib.galaxy:4749

        if ((UnitIsValid(libGame_gv_players[lv_iterPlayer].lv_heroUnit) == true)) {
            if ((UnitXPTotal(libGame_gv_players[lv_iterPlayer].lv_heroUnit) >= lv_highestXP)) {
                lv_highestXP = UnitXPTotal(libGame_gv_players[lv_iterPlayer].lv_heroUnit);
                lv_highestXPUnit = libGame_gv_players[lv_iterPlayer].lv_heroUnit;
            }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/SupportLib.galaxy:4753

            }

            if ((UnitXPTotal(libGame_gv_players[lv_iterPlayer].lv_heroUnit) <= lv_lowestXP)) {
                lv_lowestXP = UnitXPTotal(libGame_gv_players[lv_iterPlayer].lv_heroUnit);
                lv_lowestXPUnit = libGame_gv_players[lv_iterPlayer].lv_heroUnit;

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/SupportLib.galaxy:4754


            if ((UnitXPTotal(libGame_gv_players[lv_iterPlayer].lv_heroUnit) <= lv_lowestXP)) {
                lv_lowestXP = UnitXPTotal(libGame_gv_players[lv_iterPlayer].lv_heroUnit);
                lv_lowestXPUnit = libGame_gv_players[lv_iterPlayer].lv_heroUnit;
            }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/SupportLib.galaxy:4767

    else {
        libSprt_gv_dEBUGXPBoostEnable = true;
        if ((UnitXPTotal(lv_highestXPUnit) > UnitXPTotal(lv_lowestXPUnit))) {
            libSprt_gv_dEBUGXPBoostTeam = libGame_gf_TeamNumberOfPlayer(UnitGetOwner(lv_lowestXPUnit));
        }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/SupportLib.galaxy:4767

    else {
        libSprt_gv_dEBUGXPBoostEnable = true;
        if ((UnitXPTotal(lv_highestXPUnit) > UnitXPTotal(lv_lowestXPUnit))) {
            libSprt_gv_dEBUGXPBoostTeam = libGame_gf_TeamNumberOfPlayer(UnitGetOwner(lv_lowestXPUnit));
        }

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

    lv_dVaMech = EventUnit();
    lv_dVaPilot = UnitCargo(lv_dVaMech, 1);
    lv_mechXP = UnitXPTotal(lv_dVaMech);
    lv_pilotXP = UnitXPTotal(lv_dVaPilot);
    if ((lv_mechXP > lv_pilotXP)) {

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

    lv_dVaPilot = UnitCargo(lv_dVaMech, 1);
    lv_mechXP = UnitXPTotal(lv_dVaMech);
    lv_pilotXP = UnitXPTotal(lv_dVaPilot);
    if ((lv_mechXP > lv_pilotXP)) {
        UnitXPAddXP(lv_dVaPilot, null, EventUnitXPDelta());