# Add Player Talent

Grammar — Add Talent talent to Player player.
FlagsNative | Action

Adds the specified Talent to the Player. Validators and triggers can then test whether the player has the talent.

# Arguments

  • int — Player
  • string<gamelink::Talent> — Talent

Returns — void

native void PlayerAddTalent(int inPlayer, string inTalent);

Category: Player / Player Settings

# Examples

mods/heroesbrawlmods/arenamodemods/arenashared.stormmodbase.stormdata/LibMArS.galaxy:42

    if ((UnitGetType(lv_arenaHero) == "HeroMonk")) {
        if ((UnitHasBehavior2(lv_arenaHero, "Ultimate1Unlocked") == true)) {
            PlayerAddTalent(UnitGetOwner(lv_arenaHero), "MonkIronFists");
            UnitBehaviorAdd(lv_arenaHero, "MonkIronFistsCarryBehavior", lv_arenaHero, 1);
        }

mods/heroesbrawlmods/arenamodemods/arenashared.stormmodbase.stormdata/LibMArS.galaxy:46

        }
        else {
            PlayerAddTalent(UnitGetOwner(lv_arenaHero), "MonkTranscendence");
            UnitBehaviorAdd(lv_arenaHero, "MonkTranscendenceCarryBehavior", lv_arenaHero, 1);
        }

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

    // Implementation
    CatalogFieldValueSet(c_gameCatalogAbil, "DiabloShadowCharge", "Range", lp_playerIndex, FixedToString((CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "DiabloShadowCharge", "Range", 0) * CatalogFieldValueGetAsFixed(c_gameCatalogTalent, "DiabloMasteryFromTheShadowsShadowCharge", "AbilityModificationArray[" + IntToString(0) + "].Modifications[" + IntToString(0) + "].Value", 0)), c_fixedPrecisionAny));
    PlayerAddTalent(lp_playerIndex, "DiabloTalentDominationOverpower");
    if ((libPVEM_gf_PvEGameDifficulty() == libPVEM_ge_PvEGameDifficulty_PvEGameDifficulty_Heroic)) {
        CatalogFieldValueModifyFixed(c_gameCatalogEffect, "DiabloLightningBreathOffsetPersistent", "PeriodicOffsetArray[" + IntToString(0) + "]", lp_playerIndex, 2.25, c_upgradeOperationSubtract);

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

    // Implementation
    if ((libPVEM_gf_PvEGameDifficulty() == libPVEM_ge_PvEGameDifficulty_PvEGameDifficulty_Heroic)) {
        PlayerAddTalent(lp_playerIndex, "StukovPushComesToShove");
        PlayerAddTalent(lp_playerIndex, "StukovPushComesToShove");
        CatalogFieldValueModifyFixed(c_gameCatalogBehavior, "StukovMassiveShovePeriodicForce", "Modification.MoveSpeedMinimum", lp_playerIndex, 5.5, c_upgradeOperationAdd);

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

    if ((libPVEM_gf_PvEGameDifficulty() == libPVEM_ge_PvEGameDifficulty_PvEGameDifficulty_Heroic)) {
        PlayerAddTalent(lp_playerIndex, "StukovPushComesToShove");
        PlayerAddTalent(lp_playerIndex, "StukovPushComesToShove");
        CatalogFieldValueModifyFixed(c_gameCatalogBehavior, "StukovMassiveShovePeriodicForce", "Modification.MoveSpeedMinimum", lp_playerIndex, 5.5, c_upgradeOperationAdd);
        CatalogFieldValueModifyFixed(c_gameCatalogBehavior, "StukovMassiveShovePeriodicForce", "Modification.MoveSpeedMaximum", lp_playerIndex, 5.5, c_upgradeOperationAdd);

mods/heroesbrawlmods/brawlmapmods/coop/escapefrombraxis.stormmodbase.stormdata/LibPEB1.galaxy:700

    // Automatic Variable Declarations
    // Implementation
    PlayerAddTalent(lp_playerIndex, "DiabloTalentDominationOverpower");
    if ((libPVEB_gf_PVEDifficultyValueInt(0, 1) == 1)) {
        CatalogFieldValueModifyFixed(c_gameCatalogEffect, "DiabloLightningBreathOffsetPersistent", "PeriodicOffsetArray[" + IntToString(0) + "]", lp_playerIndex, 2.25, c_upgradeOperationSubtract);

mods/heroesbrawlmods/brawlmapmods/coop/escapefrombraxis.stormmodbase.stormdata/LibPEB1.galaxy:757


    if ((libPVEB_gf_PVEDifficultyValueInt(0, 1) == 1)) {
        PlayerAddTalent(lp_playerIndex, "StitchesMasteryShishKabobHook");
    }

mods/heroesbrawlmods/brawlmapmods/coop/escapefrombraxis.stormmodbase.stormdata/LibPEB1.galaxy:775

    // Implementation
    if ((libPVEB_gf_PVEDifficultyValueInt(0, 1) == 1)) {
        PlayerAddTalent(lp_playerIndex, "StukovPushComesToShove");
        CatalogFieldValueModifyFixed(c_gameCatalogBehavior, "StukovMassiveShovePeriodicForce", "Modification.MoveSpeedMinimum", lp_playerIndex, 5.5, c_upgradeOperationAdd);
        CatalogFieldValueModifyFixed(c_gameCatalogBehavior, "StukovMassiveShovePeriodicForce", "Modification.MoveSpeedMaximum", lp_playerIndex, 5.5, c_upgradeOperationAdd);

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

    StatEventAddDataString(StatEventLastCreated(), "PurchaseName", (libGame_gv_talents_TalentChoices[lp_player][lp_tierIndex].lv_talentData[lp_buttonIndex].lv_talentCatalogLink));
    StatEventSend(StatEventLastCreated());
    PlayerAddTalent(lp_player, libGame_gv_talents_TalentChoices[lp_player][lp_tierIndex].lv_talentData[lp_buttonIndex].lv_talentCatalogLink);
    TalentTreeSetSelectedHeroTalent(lp_player, lp_tierIndex, lp_buttonIndex);
    libGame_gf_TalentsUpdateChoicePanelForPlayer(lp_player);

mods/warcoop/warcoopdata.sc2modbase.sc2data/TriggerLibs/WarCoopData.galaxy:1638

    // Implementation
    if ((CatalogEntryIsValid(c_gameCatalogTalent, lp_talent) == true)) {
        PlayerAddTalent(lp_player, lp_talent);
        lv_abilLink = (CatalogFieldValueGet(c_gameCatalogTalent, lp_talent, "Abil", c_playerAny));
        if ((CatalogEntryIsValid(c_gameCatalogAbil, lv_abilLink) == true)) {