Hi everyone,
[Jass=]
if ( UnitHasItemOfTypeBJ(target, 'I0A8') == true ) then
set x = GetUnitX(target)
set y = GetUnitY(target)
set udg_Loc = GetUnitLoc(target)
set udg_TempGroup = GetUnitsInRangeOfLocMatching(300.00, udg_Loc, Condition(function Trig_Condition))
if ( IsUnitGroupEmptyBJ(udg_TempGroup) == false ) then
call RemoveItem( GetItemOfTypeFromUnitBJ(target, 'I0A8') )
call SetPlayerState(GetOwningPlayer(target), PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(GetOwningPlayer(target), PLAYER_STATE_RESOURCE_LUMBER) + -20)
call ReplaceUnitBJ( FirstOfGroup(udg_TempGroup), 'n01D', bj_UNIT_STATE_METHOD_RELATIVE )
call SetUnitOwner( GetLastReplacedUnitBJ(), GetOwningPlayer(target), true )
call DestroyGroup(udg_TempGroup)
call CreateItem( 'texp', x, y )
call CreateUnit( GetOwningPlayer(target), 'h02X', x, y, bj_UNIT_FACING )
call RemoveLocation(udg_Loc)
call UnitRemoveAbility( gg_unit_h00F_0043, 'A0HE' )
call SetUnitState( gg_unit_h00F_0043, UNIT_STATE_MANA, ( GetUnitState( gg_unit_h00F_0043, UNIT_STATE_MANA) + 1 ) )
endif
endif
[/code]
there are some function in red wich i don't know how to replace...
[Jass=]
if ( UnitHasItemOfTypeBJ(target, 'I0A8') == true ) then
set x = GetUnitX(target)
set y = GetUnitY(target)
set udg_Loc = GetUnitLoc(target)
set udg_TempGroup = GetUnitsInRangeOfLocMatching(300.00, udg_Loc, Condition(function Trig_Condition))
if ( IsUnitGroupEmptyBJ(udg_TempGroup) == false ) then
call RemoveItem( GetItemOfTypeFromUnitBJ(target, 'I0A8') )
call SetPlayerState(GetOwningPlayer(target), PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(GetOwningPlayer(target), PLAYER_STATE_RESOURCE_LUMBER) + -20)
call ReplaceUnitBJ( FirstOfGroup(udg_TempGroup), 'n01D', bj_UNIT_STATE_METHOD_RELATIVE )
call SetUnitOwner( GetLastReplacedUnitBJ(), GetOwningPlayer(target), true )
call DestroyGroup(udg_TempGroup)
call CreateItem( 'texp', x, y )
call CreateUnit( GetOwningPlayer(target), 'h02X', x, y, bj_UNIT_FACING )
call RemoveLocation(udg_Loc)
call UnitRemoveAbility( gg_unit_h00F_0043, 'A0HE' )
call SetUnitState( gg_unit_h00F_0043, UNIT_STATE_MANA, ( GetUnitState( gg_unit_h00F_0043, UNIT_STATE_MANA) + 1 ) )
endif
endif
[/code]
there are some function in red wich i don't know how to replace...