hi,
is there a way to combine in the same line
create item for unit and set charge in created item.?
or even better create unit and add item in same line + charge if possible ?
[Jass=]
call CreateUnitAtLoc( Player(PLAYER_NEUTRAL_AGGRESSIVE), 'u001', udg_Loc, bj_UNIT_FACING )
call UnitAddItemById( GetLastCreatedUnit(), 'I0AG' )
call SetItemCharges( GetLastCreatedItem(), GetRandomInt(1, 5) )
[/code]
for example:
[Jass=]
call UnitAddItemById( CreateUnitAtLoc( Player(PLAYER_NEUTRAL_AGGRESSIVE), 'u001', udg_Loc, bj_UNIT_FACING ), 'I0AG' )
[/code]
is this ok?
[Jass=]
call SetItemCharges( UnitAddItemById( CreateUnitAtLoc( Player(PLAYER_NEUTRAL_AGGRESSIVE), 'u001', udg_Loc, bj_UNIT_FACING ), 'I0AG' ), GetRandomInt(1, 5) )
[/code]
what about this?
is there a way to combine in the same line
create item for unit and set charge in created item.?
or even better create unit and add item in same line + charge if possible ?
[Jass=]
call CreateUnitAtLoc( Player(PLAYER_NEUTRAL_AGGRESSIVE), 'u001', udg_Loc, bj_UNIT_FACING )
call UnitAddItemById( GetLastCreatedUnit(), 'I0AG' )
call SetItemCharges( GetLastCreatedItem(), GetRandomInt(1, 5) )
[/code]
for example:
[Jass=]
call UnitAddItemById( CreateUnitAtLoc( Player(PLAYER_NEUTRAL_AGGRESSIVE), 'u001', udg_Loc, bj_UNIT_FACING ), 'I0AG' )
[/code]
is this ok?
[Jass=]
call SetItemCharges( UnitAddItemById( CreateUnitAtLoc( Player(PLAYER_NEUTRAL_AGGRESSIVE), 'u001', udg_Loc, bj_UNIT_FACING ), 'I0AG' ), GetRandomInt(1, 5) )
[/code]
what about this?