# 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.stormmod

LibPEB1.galaxy

// L2584
UnitXPAddXP(libPEB1_gv_archangelAreas[lp_areaIndex].lv_archangelUnit, "TerranArchangelDefenderScaling", (lp_level - 1))
// L7409
UnitXPAddXP(libPEB1_gv_archangelAreas[auto565EB0CF_var].lv_archangelUnit, "TerranArchangelDefenderScaling", 1.0)

# mods/heroesdata.stormmod

GameDataHelperLib.galaxy

// L5192
UnitXPAddXP(lv_ultimateEvolutionUnit, null, libCore_gf_GetTotalXPForLevel(lv_abathurLevel))
// L13590
UnitXPAddXP(auto147025F9_var, null, EventUnitXPDelta())

# mods/heroesdata.stormmod

GameLib.galaxy

// L9407
UnitXPAddXP(libMapM_gv_jungleCreepCamps[lv_camp].lv_campOwnershipFlagUnit, null, lp_killXP)
// L10358
UnitXPAddXP(lv_heroUnit, null, lv_xP)
// L11069
UnitXPAddXP(lp_unit, null, lv_xPToApply)

# mods/heroesdata.stormmod

MapMechanicsLib.galaxy

// L4294
UnitXPAddXP(EventUnitCreatedUnit(), null, libGame_gv_scalingTicks)

# mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmod

LibSCHO.galaxy

// L1583
UnitXPAddXP(UnitLastCreated(), null, libSCHO_gv_mMHO_ScalingLevel)
// L2006
UnitXPAddXP(lv_itUnit, null, libSCHO_gv_mMHO_ScalingLevel)
// L2014
UnitXPAddXP(lv_itUnit, null, libSCHO_gv_mMHO_ScalingLevel)
// L2117
UnitXPAddXP(UnitLastCreated(), null, libSCHO_gv_mMHO_ScalingLevel)
// L2518
UnitXPAddXP(UnitLastCreated(), null, libSCHO_gv_mMHO_ScalingLevel)
// L2523
UnitXPAddXP(UnitLastCreated(), null, libSCHO_gv_mMHO_ScalingLevel)
// L2888
UnitXPAddXP(auto8529E143_var, null, 1.0)
// L2895
UnitXPAddXP(auto6DDA816B_var, null, 1.0)
// L2902
UnitXPAddXP(auto17CDE435_var, null, 1.0)
// L2909
UnitXPAddXP(auto23E8D062_var, null, 1.0)

# mods/heroesmapmods/battlegroundmapmods/hanamura.stormmod

LibNPLD.galaxy

// L922
UnitXPAddXP(EventUnitCreatedUnit(), "OverwatchTurretPlayerScaling", libGame_gv_teams[libGame_gf_TeamNumberOfPlayer(UnitGetOwner(EventUnit()))].lv_teamLevel)

# mods/heroesmapmods/battlegroundmapmods/infernalshrines.stormmod

LibMSHE.galaxy

// L613
UnitXPAddXP(UnitLastCreated(), null, libMSHE_gv_mMISMonsterXP)
// L1370
UnitXPAddXP(EventUnitCreatedUnit(), null, libMSHE_gv_mMISMonsterXP)

# mods/heroesmapmods/battlegroundmapmods/overwatchdata.stormmod

LibOVER.galaxy

// L520
UnitXPAddXP(EventUnitCreatedUnit(), "BioticEmitterScaling", libGame_gv_teams[libGame_gf_TeamNumberOfPlayer(UnitGetOwner(EventUnit()))].lv_teamLevel)
// L631
UnitXPAddXP(EventUnitCreatedUnit(), "OverwatchTurretPlayerScaling", libGame_gv_teams[libGame_gf_TeamNumberOfPlayer(UnitGetOwner(EventUnit()))].lv_teamLevel)

# mods/heroesmapmods/battlegroundmapmods/starcraft.stormmod

Lib566061C9.galaxy

// L438
UnitXPAddXP(EventUnitCreatedUnit(), null, lib566061C9_gv_mMSC_ScalingXP)

# mods/heromods/dva.stormmod

LibHDVA.galaxy

// L1854
UnitXPAddXP(lv_dVaPilot, null, EventUnitXPDelta())

# mods/heromods/samuro.stormmod

LibHSAM.galaxy

// L998
UnitXPAddXP(lv_mirrorImage, null, libCore_gf_GetTotalXPForLevel(lv_samuroLevel))

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L17697
UnitXPAddXP(lv_collectorUnit, libCOMI_gv_cM_DehakaVeterencyBehavior[lv_player], lv_essenceCountStored)
// L22173
UnitXPAddXP(auto9DCFEB60_var, null, lv_xp)