# Unit XP Add XP

Grammar — Adds xP xp to veterancyBehavior for unit
FlagsNative | Action

Adds XP to the current unit

# Arguments

  • unit — Unit
  • string<gamelink::Behavior> — Veterancy Behavior
  • fixed — XP

Returns — void

native void UnitXPAddXP(
	unit inUnit,
	string inVeterancyBehavior,
	fixed inXP,
);

Category: Unit / Attributes And Experience

# Examples

mods/heroesbrawlmods/brawlmapmods/coop/deadmansstand.stormmodbase.stormdata/LibPEB1.galaxy:2584

    libPEB1_gv_archangelAreas[lp_areaIndex].lv_archangelUnit = UnitLastCreated();
    libNtve_gf_SendActorMessageToUnit(libPEB1_gv_archangelAreas[lp_areaIndex].lv_archangelUnit, "Signal FlyingBirth");
    UnitXPAddXP(libPEB1_gv_archangelAreas[lp_areaIndex].lv_archangelUnit, "TerranArchangelDefenderScaling", (lp_level - 1));
    UnitDestroyAIThinkTree(libPEB1_gv_archangelAreas[lp_areaIndex].lv_archangelUnit);
    libPVEM_gf_PvECreateDefenderAI(libNtve_gf_ConvertUnitToUnitGroup(libPEB1_gv_archangelAreas[lp_areaIndex].lv_archangelUnit), RegionCircle(UnitGetPosition(libPEB1_gv_archangelAreas[lp_areaIndex].lv_archangelUnit), 10.0), libPEB1_gv_archangelAreas[lp_areaIndex].lv_region, true);

mods/heroesbrawlmods/brawlmapmods/coop/deadmansstand.stormmodbase.stormdata/LibPEB1.galaxy:7409

        for ( ; auto565EB0CF_var <= auto565EB0CF_ae; auto565EB0CF_var += 1 ) {
            if ((UnitIsAlive(libPEB1_gv_archangelAreas[auto565EB0CF_var].lv_archangelUnit) == true)) {
                UnitXPAddXP(libPEB1_gv_archangelAreas[auto565EB0CF_var].lv_archangelUnit, "TerranArchangelDefenderScaling", 1.0);
                break;
            }

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

    UnitBehaviorAdd(lv_ultimateEvolutionUnit, "CapturePointAllowed", libGame_gv_players[lv_abathurPlayer].lv_heroUnit, 1);
    SoundPlayForPlayer(SoundLink("Abathur_UltimateEvolution_Screen_Loop", -1), lv_abathurPlayer, PlayerGroupSingle(lv_abathurPlayer), 100.0, 0.0);
    UnitXPAddXP(lv_ultimateEvolutionUnit, null, libCore_gf_GetTotalXPForLevel(lv_abathurLevel));
    CatalogFieldValueSet(c_gameCatalogAbil, "Mount", "CastIntroTime[" + IntToString(0) + "]", UnitGetOwner(lv_abathur), CatalogFieldValueGet(c_gameCatalogAbil, "Mount", "CastIntroTime[" + IntToString(0) + "]", 0));
    if ((libMapM_gf_MapMechanicExistsOnMap("BlackheartsBay") == true)) {

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

        if (auto147025F9_var == null) { break; }
        if ((UnitGetType(auto147025F9_var) != "HeroLostVikingsController")) {
            UnitXPAddXP(auto147025F9_var, null, EventUnitXPDelta());
        }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:9407

    }

    UnitXPAddXP(libMapM_gv_jungleCreepCamps[lv_camp].lv_campOwnershipFlagUnit, null, lp_killXP);
    libGame_gf_SendEventHeroParticipatedInCreepTakedown(lp_killingPlayer, lp_creepUnit);
}

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:10358

    }

    UnitXPAddXP(lv_heroUnit, null, lv_xP);
    auto993D99AD_val = lp_source;
    if (auto993D99AD_val == libGame_ge_XPSources_Creep) {

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:11069

    lv_xPToApply = (lp_desiredLevel - lp_existingLevel);
    if ((lv_xPToApply > 0)) {
        UnitXPAddXP(lp_unit, null, lv_xPToApply);
    }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/MapMechanicsLib.galaxy:4294

    }

    UnitXPAddXP(EventUnitCreatedUnit(), null, libGame_gv_scalingTicks);
    lv_summoner = UnitGroupUnit(UnitGroup("MercSummonerLaner", UnitGetOwner(EventUnitCreatedUnit()), RegionCircle(UnitGetPosition(EventUnitCreatedUnit()), 6.0), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), 1);
    if ((lv_summoner != null)) {

mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmodbase.stormdata/LibSCHO.galaxy:1583

            libNtve_gf_CreateUnitsWithDefaultFacing(1, UserDataGetUnit("BeaconWaves", lv_tier, lv_wave, lv_itUserData), 0, lv_owner, RegionRandomPoint(lp_spawnRegion), null);
            UnitGroupAdd(libSCHO_gv_mMHO_AttackGroups[lp_attackLane][libSCHO_gv_mMHO_WaveTracker], UnitLastCreated());
            UnitXPAddXP(UnitLastCreated(), null, libSCHO_gv_mMHO_ScalingLevel);
            Wait(RandomFixed(0.0625, 0.125), c_timeGame);
            autoE1768950_val = libSCHO_gv_mMHO_WaveTracker;

mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmodbase.stormdata/LibSCHO.galaxy:2006

        if (lv_itUnit == null) { break; }
        UnitBehaviorRemove(lv_itUnit, "ZergStasisBehavior", 1);
        UnitXPAddXP(lv_itUnit, null, libSCHO_gv_mMHO_ScalingLevel);
    }
    auto62836594_g = libSCHO_gv_mMHO_AttackGroups[libGame_gv_teamChaosIndex_C][libSCHO_gv_mMHO_WaveTracker];

mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmodbase.stormdata/LibSCHO.galaxy:2014

        if (lv_itUnit == null) { break; }
        UnitBehaviorRemove(lv_itUnit, "ZergStasisBehavior", 1);
        UnitXPAddXP(lv_itUnit, null, libSCHO_gv_mMHO_ScalingLevel);
    }
}

mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmodbase.stormdata/LibSCHO.galaxy:2117

        libNtve_gf_CreateUnitsWithDefaultFacing(1, "TerranArchangelLaner", c_unitCreateIgnorePlacement, libGame_gf_ComputerPlayerInTeam(lp_team), libSCHO_gv_mMHO_ArchangelSpawnLocationCenter, null);
        libSCHO_gv_mMHO_ArchangelLaner = UnitLastCreated();
        UnitXPAddXP(UnitLastCreated(), null, libSCHO_gv_mMHO_ScalingLevel);
        libSCHO_gf_MMHOCalculateArchangelRallyPoint();
        libGame_gf_CalculateSpawnedMinionGoalPoints(libGame_gf_ComputerPlayerInTeam(lp_team), libSCHO_gv_mMHO_ArchangelSpawnLocationCenter);

mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmodbase.stormdata/LibSCHO.galaxy:2518

    for (auto72A1A2A5_i = 1; auto72A1A2A5_i <= auto72A1A2A5_n; auto72A1A2A5_i += 1) {
        libNtve_gf_CreateUnitsWithDefaultFacing(1, "ZergZergling", 0, lp_dropPodOwner, lp_dropPodPosition, null);
        UnitXPAddXP(UnitLastCreated(), null, libSCHO_gv_mMHO_ScalingLevel);
        UnitCreateAIThinkTree(UnitLastCreated());
    }

mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmodbase.stormdata/LibSCHO.galaxy:2523

    for (autoD8D71635_i = 1; autoD8D71635_i <= autoD8D71635_n; autoD8D71635_i += 1) {
        libNtve_gf_CreateUnitsWithDefaultFacing(1, "ZergHydralisk", 0, lp_dropPodOwner, lp_dropPodPosition, null);
        UnitXPAddXP(UnitLastCreated(), null, libSCHO_gv_mMHO_ScalingLevel);
        UnitCreateAIThinkTree(UnitLastCreated());
    }

mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmodbase.stormdata/LibSCHO.galaxy:2888

        auto8529E143_var = UnitGroupUnitFromEnd(auto8529E143_g, auto8529E143_u);
        if (auto8529E143_var == null) { break; }
        UnitXPAddXP(auto8529E143_var, null, 1.0);
    }
    auto6DDA816B_g = UnitGroup("TerranHellbat", c_playerAny, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);

mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmodbase.stormdata/LibSCHO.galaxy:2895

        auto6DDA816B_var = UnitGroupUnitFromEnd(auto6DDA816B_g, auto6DDA816B_u);
        if (auto6DDA816B_var == null) { break; }
        UnitXPAddXP(auto6DDA816B_var, null, 1.0);
    }
    auto17CDE435_g = UnitGroup("TerranGoliath", c_playerAny, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);

mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmodbase.stormdata/LibSCHO.galaxy:2902

        auto17CDE435_var = UnitGroupUnitFromEnd(auto17CDE435_g, auto17CDE435_u);
        if (auto17CDE435_var == null) { break; }
        UnitXPAddXP(auto17CDE435_var, null, 1.0);
    }
    auto23E8D062_g = UnitGroup("TerranRaven", c_playerAny, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);

mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmodbase.stormdata/LibSCHO.galaxy:2909

        auto23E8D062_var = UnitGroupUnitFromEnd(auto23E8D062_g, auto23E8D062_u);
        if (auto23E8D062_var == null) { break; }
        UnitXPAddXP(auto23E8D062_var, null, 1.0);
    }
}

mods/heroesmapmods/battlegroundmapmods/hanamura.stormmodbase.stormdata/LibNPLD.galaxy:922

    }

    UnitXPAddXP(EventUnitCreatedUnit(), "OverwatchTurretPlayerScaling", libGame_gv_teams[libGame_gf_TeamNumberOfPlayer(UnitGetOwner(EventUnit()))].lv_teamLevel);
    return true;
}

mods/heroesmapmods/battlegroundmapmods/infernalshrines.stormmodbase.stormdata/LibMSHE.galaxy:613

        UnitCreate(1, "MercPunisherLaner", 0, libGame_gf_ComputerPlayerInTeam(lp_team), PointWithOffset(UnitGetPosition(libMSHE_gv_mMISShrines[libMSHE_gv_mMISCurrentShrine]), -1.826, -5.018), -110.0, null);
    }
    UnitXPAddXP(UnitLastCreated(), null, libMSHE_gv_mMISMonsterXP);
    AddUnitOfInterest(UnitLastCreated(), 15.0, 0.0, "EscortPunisher", libAIAI_gf_ConvertIntegertoGoalTeam(lp_team), 0);
    AddUnitOfInterest(UnitLastCreated(), 15.0, 0.0, "KillEnemyPunisher", libAIAI_gf_ConvertIntegertoGoalTeam(libGame_gf_EnemyTeam(lp_team)), 0);

mods/heroesmapmods/battlegroundmapmods/infernalshrines.stormmodbase.stormdata/LibMSHE.galaxy:1370


    UnitSetOwner(EventUnitCreatedUnit(), 15, true);
    UnitXPAddXP(EventUnitCreatedUnit(), null, libMSHE_gv_mMISMonsterXP);
    UnitGroupAdd(libMSHE_gv_mMISCursedCreatures, EventUnitCreatedUnit());
    return true;

mods/heroesmapmods/battlegroundmapmods/overwatchdata.stormmodbase.stormdata/LibOVER.galaxy:520

    }

    UnitXPAddXP(EventUnitCreatedUnit(), "BioticEmitterScaling", libGame_gv_teams[libGame_gf_TeamNumberOfPlayer(UnitGetOwner(EventUnit()))].lv_teamLevel);
    return true;
}

mods/heroesmapmods/battlegroundmapmods/overwatchdata.stormmodbase.stormdata/LibOVER.galaxy:631

    }

    UnitXPAddXP(EventUnitCreatedUnit(), "OverwatchTurretPlayerScaling", libGame_gv_teams[libGame_gf_TeamNumberOfPlayer(UnitGetOwner(EventUnit()))].lv_teamLevel);
    return true;
}

mods/heroesmapmods/battlegroundmapmods/starcraft.stormmodbase.stormdata/Lib566061C9.galaxy:438

    }

    UnitXPAddXP(EventUnitCreatedUnit(), null, lib566061C9_gv_mMSC_ScalingXP);
    return true;
}

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

    lv_pilotXP = UnitXPTotal(lv_dVaPilot);
    if ((lv_mechXP > lv_pilotXP)) {
        UnitXPAddXP(lv_dVaPilot, null, EventUnitXPDelta());
        TriggerDebugOutput(1, StringExternal("Param/Value/lib_HDVA_B161F94A"), true);
    }

mods/heromods/samuro.stormmodbase.stormdata/LibHSAM.galaxy:998

    }

    UnitXPAddXP(lv_mirrorImage, null, libCore_gf_GetTotalXPForLevel(lv_samuroLevel));
    if ((PlayerHasTalent(lv_samuroPlayer, "SamuroThreeBladeStyle") == true)) {
        UnitSetPropertyFixed(lv_mirrorImage, c_unitPropLifeMax, UnitGetPropertyFixed(lv_samuro, c_unitPropLifeMax, c_unitPropCurrent));

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:17700

    CatalogFieldValueSet(c_gameCatalogEffect, "EssenceDehakaDummyStacks", "Amount", EventPlayerEffectUsedUnitOwner(c_effectPlayerTarget), FixedToString(libCOMI_gv_cM_Dehaka_TotalEssence[lv_player], c_fixedPrecisionAny));
    UnitSetAttributePoint(lv_collectorUnit, libCOMI_gv_cM_Dehaka_EssenceAttribute, true, RoundI(UnitGetCustomValue(lv_collectorUnit, libCOMI_gv_cM_DehakaEssenceIndex)));
    UnitXPAddXP(lv_collectorUnit, libCOMI_gv_cM_DehakaVeterencyBehavior[lv_player], lv_essenceCountStored);
    libCOMI_gf_CM_Dehaka_LevelUp(lv_player, lv_collectorUnit);
    if ((RandomInt(1, 100) <= lv_doublehealmastery)) {

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:22176

        auto9DCFEB60_var = UnitGroupUnitFromEnd(auto9DCFEB60_g, auto9DCFEB60_u);
        if (auto9DCFEB60_var == null) { break; }
        UnitXPAddXP(auto9DCFEB60_var, null, lv_xp);
    }
    return true;