# Cost Of Ability

GrammarcostType|Cost Type cost of ability
FlagsFunction

Returns one of the costs of an ability. Use catalog lookup functions to retrieve a data value or other information from the game data.

# Arguments

  • string<gamelink::Abil> — Ability
  • string<preset::CostType> — CostType

Returns — fixed

fixed libNtve_gf_CostOfAbility(
	string lp_ability,
	string lp_costType,
);

Category: Catalog / Lookup

# Examples

campaigns/swarmstory.sc2campaignbase.sc2data/TriggerLibs/SwarmCampaignDataHelperLib.galaxy:23

    libSCDH_InitVariables_completed = true;

    libSCDH_gv_kerriganPsiStrikeEnergyCost = libNtve_gf_CostOfAbility("PsiStrikeBlink", "Energy");
}

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/sc2epilogue02.sc2map/MapScript.galaxy:577

    // Implementation
    lv_friendlyGroup7 = UnitGroupAlliance(UnitGetOwner(lp_zagara), c_unitAllianceAlly, RegionCircle(UnitGetPosition(lp_zagara), 7.0), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterInvulnerable - 32))), 0);
    if ((UnitAbilityCheck(lp_zagara, "Transfusion", true) == true) && (UnitCheckAbilCmdState(lp_zagara, AbilityCommand("Transfusion", 0), c_cmdStateCooldown) == false) && (UnitGetPropertyFixed(lp_zagara, c_unitPropEnergy, c_unitPropCurrent) >= libNtve_gf_CostOfAbility("Transfusion", "Energy")) && (UnitGroupCount(lv_friendlyGroup7, c_unitCountAlive) > 0)) {
        lv_target = null;
        lv_mostDamage = 50.0;

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/sc2epilogue02.sc2mapMapScript.galaxy:577

    // Implementation
    lv_friendlyGroup7 = UnitGroupAlliance(UnitGetOwner(lp_zagara), c_unitAllianceAlly, RegionCircle(UnitGetPosition(lp_zagara), 7.0), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterInvulnerable - 32))), 0);
    if ((UnitAbilityCheck(lp_zagara, "Transfusion", true) == true) && (UnitCheckAbilCmdState(lp_zagara, AbilityCommand("Transfusion", 0), c_cmdStateCooldown) == false) && (UnitGetPropertyFixed(lp_zagara, c_unitPropEnergy, c_unitPropCurrent) >= libNtve_gf_CostOfAbility("Transfusion", "Energy")) && (UnitGroupCount(lv_friendlyGroup7, c_unitCountAlive) > 0)) {
        lv_target = null;
        lv_mostDamage = 50.0;

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:41

    libVCMI_gv_soA_TargetingMode_Timer = TimerCreate();
    libVCMI_gv_sOA_TimeFreezeUI = c_invalidDialogId;
    libVCMI_gv_fenixChargeEnergyCost = libNtve_gf_CostOfAbility("FenixCharge", "Energy");
    libVCMI_gv_kerriganPsiStrikeEnergyCost = libNtve_gf_CostOfAbility("PsiStrikeBlink", "Energy");
    libVCMI_gv_kerriganAstralShiftEnergyCost = libNtve_gf_CostOfAbility("KerriganEpilogue03LineDashAttack", "Energy");

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:42

    libVCMI_gv_sOA_TimeFreezeUI = c_invalidDialogId;
    libVCMI_gv_fenixChargeEnergyCost = libNtve_gf_CostOfAbility("FenixCharge", "Energy");
    libVCMI_gv_kerriganPsiStrikeEnergyCost = libNtve_gf_CostOfAbility("PsiStrikeBlink", "Energy");
    libVCMI_gv_kerriganAstralShiftEnergyCost = libNtve_gf_CostOfAbility("KerriganEpilogue03LineDashAttack", "Energy");
    libVCMI_gv_pM_GameCheat_DialogWidth = 300;

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:43

    libVCMI_gv_fenixChargeEnergyCost = libNtve_gf_CostOfAbility("FenixCharge", "Energy");
    libVCMI_gv_kerriganPsiStrikeEnergyCost = libNtve_gf_CostOfAbility("PsiStrikeBlink", "Energy");
    libVCMI_gv_kerriganAstralShiftEnergyCost = libNtve_gf_CostOfAbility("KerriganEpilogue03LineDashAttack", "Energy");
    libVCMI_gv_pM_GameCheat_DialogWidth = 300;
    libVCMI_gv_pM_GameCheat_DialogHeight = 400;

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:101

    // Implementation
    lv_enemyGroup7 = libVCMI_gf_AITacticalEnemiesWithinRange(lp_darkArchon, 7.0, UnitFilter(0, 0, (1 << c_targetFilterStructure) | (1 << c_targetFilterHeroic) | (1 << c_targetFilterMissile) | (1 << c_targetFilterUncommandable), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterInvulnerable - 32))));
    if ((UnitGroupCount(lv_enemyGroup7, c_unitCountAlive) > 0) && (UnitGetPropertyFixed(lp_darkArchon, c_unitPropEnergy, c_unitPropCurrent) >= libNtve_gf_CostOfAbility("DarkArchonMindControl", "Energy")) && (UnitAbilityCheck(lp_darkArchon, "DarkArchonMindControl", true) == true) && (UnitCheckAbilCmdState(lp_darkArchon, AbilityCommand("DarkArchonMindControl", 0), c_cmdStateCooldown) == false)) {
        auto07EB9AE6_g = lv_enemyGroup7;
        auto07EB9AE6_u = UnitGroupCount(auto07EB9AE6_g, c_unitCountAll);

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:132

    lv_enemyGroup7 = libVCMI_gf_AITacticalEnemiesWithinRange(lp_darkArchon, 7.0, UnitFilter(0, 0, (1 << c_targetFilterStructure) | (1 << c_targetFilterHeroic) | (1 << c_targetFilterMissile) | (1 << c_targetFilterUncommandable), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterInvulnerable - 32))));
    UnitGroupRemoveUnitGroup(lv_enemyGroup7, libVCMI_gf_AITacticalEnemiesWithinRange(lp_darkArchon, 1.5, UnitFilter(0, 0, (1 << c_targetFilterStructure) | (1 << c_targetFilterHeroic) | (1 << c_targetFilterMissile) | (1 << c_targetFilterUncommandable), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterInvulnerable - 32)))));
    if ((UnitGroupCount(lv_enemyGroup7, c_unitCountAlive) > 0) && (UnitGetPropertyFixed(lp_darkArchon, c_unitPropEnergy, c_unitPropCurrent) >= libNtve_gf_CostOfAbility("DarkArchonConfusion", "Energy")) && (UnitAbilityCheck(lp_darkArchon, "DarkArchonConfusion", true) == true) && (UnitCheckAbilCmdState(lp_darkArchon, AbilityCommand("DarkArchonConfusion", 0), c_cmdStateCooldown) == false)) {
        autoC5AF83C6_g = lv_enemyGroup7;
        autoC5AF83C6_u = UnitGroupCount(autoC5AF83C6_g, c_unitCountAll);

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:170

    // Implementation
    lv_enemyGroup10 = libVCMI_gf_AITacticalEnemiesWithinRange(lp_highTemplarTaldarim, 10.0, UnitFilter(0, 0, (1 << c_targetFilterStructure) | (1 << c_targetFilterMissile) | (1 << c_targetFilterUncommandable), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterInvulnerable - 32))));
    if ((UnitGroupCount(lv_enemyGroup10, c_unitCountAlive) > 0) && (UnitGetPropertyFixed(lp_highTemplarTaldarim, c_unitPropEnergy, c_unitPropCurrent) >= libNtve_gf_CostOfAbility("VoidHighTemplarMindBlast", "Energy")) && (UnitAbilityCheck(lp_highTemplarTaldarim, "VoidHighTemplarMindBlast", true) == true) && (UnitCheckAbilCmdState(lp_highTemplarTaldarim, AbilityCommand("VoidHighTemplarMindBlast", 0), c_cmdStateCooldown) == false)) {
        if ((UnitGetPropertyFixed(lp_highTemplarTaldarim, c_unitPropShields, c_unitPropCurrent) == 0.0)) {
            lv_target = UnitGroupClosestToPoint(lv_enemyGroup10, UnitGetPosition(lp_highTemplarTaldarim));

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:197


    lv_enemyGroup10 = libVCMI_gf_AITacticalEnemiesWithinRange(lp_highTemplarTaldarim, 10.0, UnitFilter(0, 0, (1 << c_targetFilterStructure) | (1 << c_targetFilterMissile) | (1 << c_targetFilterUncommandable), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterInvulnerable - 32))));
    if ((UnitGroupCount(lv_enemyGroup10, c_unitCountAlive) > 0) && (UnitGetPropertyFixed(lp_highTemplarTaldarim, c_unitPropEnergy, c_unitPropCurrent) >= libNtve_gf_CostOfAbility("VoidHighTemplarPsiOrb", "Energy")) && (UnitAbilityCheck(lp_highTemplarTaldarim, "VoidHighTemplarPsiOrb", true) == true) && (UnitCheckAbilCmdState(lp_highTemplarTaldarim, AbilityCommand("VoidHighTemplarPsiOrb", 0), c_cmdStateCooldown) == false)) {
        if ((UnitGetPropertyFixed(lp_highTemplarTaldarim, c_unitPropShields, c_unitPropCurrent) == 0.0)) {
            lv_target = UnitGroupClosestToPoint(lv_enemyGroup10, UnitGetPosition(lp_highTemplarTaldarim));

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:4800

    if (((libVCMI_gv_pM_SoATargetingChargesSpent == 0) || (libVCMI_gf_PM_SoATargetingPauseEnabled() == true))) {
        libNtve_gf_UnitAbilityRemoveCooldown(libVCMI_gv_sOA_CasterUnit, libVCMI_gv_pM_SoATargetingActivateAbility, libVCMI_gv_pM_SoATargetingCooldown);
        UnitSetPropertyFixed(libVCMI_gv_sOA_CasterUnit, c_unitPropEnergy, (UnitGetPropertyFixed(libVCMI_gv_sOA_CasterUnit, c_unitPropEnergy, c_unitPropCurrent) + libNtve_gf_CostOfAbility(libVCMI_gv_pM_SoATargetingActivateAbility, "Energy")));
    }

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNCMI.galaxy:50

    libNCMI_gv_nM_ScreenMode = c_uiModeConsole;
    libNCMI_gv_nM_CreditsCutscene = c_cutsceneNone;
    libNCMI_gv_kerriganPsiStrikeEnergyCost = libNtve_gf_CostOfAbility("NovaPsiStrike", "Energy");
    libNCMI_gv_nM_NovaNukesUnitGroup = UnitGroupEmpty();
    libNCMI_gv_NM_GameCheat_DialogWidth = 300;

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNCMI.galaxy:1369

    libNCMI_gf_StealthAISetStealthAIUnitCasting(lp_ghostUnit, libNCMI_ge_StealthAIUnitCasting_Casting);
    Wait(libLotv_gf_DifficultyValueFixed2(4.0, 4.0, 3.0, 2.0), c_timeAI);
    if ((UnitIsAlive(lp_ghostUnit) == true) && (UnitIsAlive(lp_snipeTargetUnit) == true) && (libNtve_gf_UnitIsVisibleToPlayer(lp_snipeTargetUnit, UnitGetOwner(lp_ghostUnit)) == true) && (UnitGetPropertyFixed(lp_ghostUnit, c_unitPropEnergy, c_unitPropCurrent) >= libNtve_gf_CostOfAbility("Snipe", "Energy")) && (TimerGetRemaining(libNCMI_gv_nM_StealthAIGhostSnipeGlobalCooldownTimer) == 0.0)) {
        TimerStart(libNCMI_gv_nM_StealthAIGhostSnipeGlobalCooldownTimer, libNCMI_gv_nM_StealthAIGhostSnipeGlobalCooldown, false, c_timeAI);
        UnitIssueOrder(lp_ghostUnit, OrderTargetingUnit(AbilityCommand("Snipe", 0), lp_snipeTargetUnit), c_orderQueueReplace);

mods/novastoryassets.sc2modbase.sc2maps/maps/campaign/nova/nova03.sc2map/MapScript.galaxy:4930

    TriggerEnable(gt_S2NovaKillsUnitInTutorialRoom, true);
    TriggerEnable(gt_S2NovaSkipsSwordTutorialTransmissionQ, true);
    if ((UnitGetPropertyFixed(gv_zeratul, c_unitPropEnergy, c_unitPropCurrent) < libNtve_gf_CostOfAbility("NovaPsiStrike", "Energy"))) {
        UnitSetPropertyFixed(gv_zeratul, c_unitPropEnergy, libNtve_gf_CostOfAbility("NovaPsiStrike", "Energy"));
    }

mods/novastoryassets.sc2modbase.sc2maps/maps/campaign/nova/nova03.sc2map/MapScript.galaxy:4931

    TriggerEnable(gt_S2NovaSkipsSwordTutorialTransmissionQ, true);
    if ((UnitGetPropertyFixed(gv_zeratul, c_unitPropEnergy, c_unitPropCurrent) < libNtve_gf_CostOfAbility("NovaPsiStrike", "Energy"))) {
        UnitSetPropertyFixed(gv_zeratul, c_unitPropEnergy, libNtve_gf_CostOfAbility("NovaPsiStrike", "Energy"));
    }

mods/novastoryassets.sc2mod/base.sc2maps/maps/campaign/nova/nova03.sc2mapMapScript.galaxy:4930

    TriggerEnable(gt_S2NovaKillsUnitInTutorialRoom, true);
    TriggerEnable(gt_S2NovaSkipsSwordTutorialTransmissionQ, true);
    if ((UnitGetPropertyFixed(gv_zeratul, c_unitPropEnergy, c_unitPropCurrent) < libNtve_gf_CostOfAbility("NovaPsiStrike", "Energy"))) {
        UnitSetPropertyFixed(gv_zeratul, c_unitPropEnergy, libNtve_gf_CostOfAbility("NovaPsiStrike", "Energy"));
    }

mods/novastoryassets.sc2mod/base.sc2maps/maps/campaign/nova/nova03.sc2mapMapScript.galaxy:4931

    TriggerEnable(gt_S2NovaSkipsSwordTutorialTransmissionQ, true);
    if ((UnitGetPropertyFixed(gv_zeratul, c_unitPropEnergy, c_unitPropCurrent) < libNtve_gf_CostOfAbility("NovaPsiStrike", "Energy"))) {
        UnitSetPropertyFixed(gv_zeratul, c_unitPropEnergy, libNtve_gf_CostOfAbility("NovaPsiStrike", "Energy"));
    }

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

        libCOMI_gv_cM_Horner_BomberPlatforms_Ready[init_i] = UnitGroupEmpty();
    }
    libCOMI_gv_kerriganPsiStrikeEnergyCost = libNtve_gf_CostOfAbility("PsiStrikeBlink", "Energy");
    for (init_i = 0; init_i <= libCOOC_gv_cCC_MAXPLAYERS; init_i += 1) {
        libCOMI_gv_cM_LaserDrillUnitGroup[init_i] = UnitGroupEmpty();

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

        libCOMI_gv_cM_NovaGriffinGroundUnitsTransportGroupGround[init_i] = UnitGroupEmpty();
    }
    libCOMI_gv_NovaPsiStrikeEnergyCost = libNtve_gf_CostOfAbility("NovaPsiStrike", "Energy");
    for (init_i = 0; init_i <= libCOOC_gv_cCC_MAXPLAYERS; init_i += 1) {
        libCOMI_gv_cM_Stukov_HordeGroup[init_i] = UnitGroupEmpty();

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

    // Variable Initialization
    lv_ragemultiplier = UserDataGetFixed("CoopAbilityTychusRageEffects", lp_rageEffect, "Rage Bonus Multiplier", 1);
    lv_ragecost = libNtve_gf_CostOfAbility(UserDataGetGameLink("CoopAbilityTychusRageEffects", lp_rageEffect, "Rage Ability", 1), "Energy");
    lv_extrarage = UnitGetPropertyFixed(lp_tychusUnit, c_unitPropEnergy, c_unitPropCurrent);
    lv_replacementeffect = UserDataGetGameLink("CoopAbilityTychusRageEffects", lp_rageEffect, "Replacement Effect", 1);