# Power Is Provided By
Grammar — Power is provided for inPlayer at inPosition with inType by inSource, with inMinLevel
Flags —Native
|Function
Returns true if power is provided to a point by a specific unit. Note: The Minimum Power parameter should not be set past 1, unless you have custom units that provide more than a single power level.
# Arguments
int
— Playerpoint
— Positionstring
— Typeunit
— Sourceint
— Minimum Level
Returns — bool
native bool PowerIsProvidedBy(
int inPlayer,
point inPos,
string inLink,
unit inSource,
int inMinLevel,
);
# Related
Category: Environment / Creep And Power
- Set Creep Speed —
void
— CreepSetSpeed - Modify Creep —
void
— CreepModify - Creep Is Present —
bool
— CreepIsPresent - Creep Adjacent —
int
— CreepAdjacent - FunctionDef/Name/lib_Ntve_00000250 —
int
— PowerLevel - Power Level —
int
— PowerLevel - FunctionDef/Name/lib_Ntve_00000251 —
bool
— PowerIsProvidedBy - Power Is Provided By —
bool
— PowerIsProvidedBy
# Examples
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/paiur05.sc2map/MapScript.galaxy:724
Wait(0.5, c_timeAI);
}
while ((libVCMI_gf_GameIsOver() == false) && (PowerIsProvidedBy(lp_player, lp_targetLoc, "PowerSource", lv_warpPrismUnit, 1) == false)) {
UnitIssueOrder(lv_warpPrismUnit, Order(AbilityCommand("PhasingMode", 0)), c_orderQueueReplace);
Wait(0.5, c_timeAI);
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/paiur05.sc2map — MapScript.galaxy:724
Wait(0.5, c_timeAI);
}
while ((libVCMI_gf_GameIsOver() == false) && (PowerIsProvidedBy(lp_player, lp_targetLoc, "PowerSource", lv_warpPrismUnit, 1) == false)) {
UnitIssueOrder(lv_warpPrismUnit, Order(AbilityCommand("PhasingMode", 0)), c_orderQueueReplace);
Wait(0.5, c_timeAI);