# Target Item For Order
Grammar — Target item for o
Flags —Native
|Function
Returns the target for the order if the target is an item.
# Arguments
order
— Order
Returns — unit
native unit OrderGetTargetItem(order inOrder);
# Related
Category: Order / Order Properties
- Player For Order —
int
— OrderGetPlayer - Ability Command For Order —
abilcmd
— OrderGetAbilityCommand - Flag Is Enabled For Order —
bool
— OrderGetFlag - Target Item For Order —
unit
— OrderGetTargetItem - Target Point For Order —
point
— OrderGetTargetPoint - Target Position For Order —
point
— OrderGetTargetPosition - Target Type For Order —
int
<preset::OrderTargetType> — OrderGetTargetType - Target Unit For Order —
unit
— OrderGetTargetUnit - Order Is Valid —
bool
— UnitOrderIsValid - Order Set Flag —
void
— OrderSetFlag
# Examples
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:3152
else {
lv_autoAquired = true;
if ((UnitOrderCount(lv_rexxar) != 0) && (OrderGetAbilityCommand(UnitOrder(lv_rexxar, 0)) != AbilityCommand("RexxarSpiritSwoop", 0)) && (OrderGetAbilityCommand(UnitOrder(lv_rexxar, 0)) != AbilityCommand("RexxarUnleashTheBoars", 0)) && (UnitGetType(OrderGetTargetItem(UnitOrder(lv_rexxar, 0))) != "RexxarFlare") && (OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)) != Point(0.0, 0.0)) && (DistanceBetweenPoints(UnitGetPosition(lv_misha), UnitGetPosition(lv_rexxar)) <= 3.0) && ((OrderGetAbilityCommand(UnitOrder(lv_rexxar, 0)) != AbilityCommand("attack", 0)) || (UnitIsValid(OrderGetTargetUnit(UnitOrder(lv_rexxar, 0))) == false))) {
UnitAbilityEnable(lv_misha, "attack", true);
libGDHL_gf_HeroRexxarOrderMishaMoveNearPoint(lv_rexxar, lv_misha, OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)));