function goldMineIncomeCB takes nothing returns nothing
call SaveReal(udg_goldMineHash, GetHandleId(GetEnumUnit()), 1, LoadReal(udg_goldMineHash, GetHandleId(GetEnumUnit()), 1) - 1.00)
if LoadReal(udg_goldMineHash, GetHandleId(GetEnumUnit()), 1) <= 0 then
call SaveReal(udg_goldMineHash, GetHandleId(GetEnumUnit()), 1, 30.00)
call SetPlayerState(GetOwningPlayer(GetEnumUnit()), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(GetOwningPlayer(GetEnumUnit()), PLAYER_STATE_RESOURCE_GOLD) + GetUnitPointValue(GetEnumUnit()))
call SetTextTagText(udg_goldTextTag[GetHandleId(GetEnumUnit())], I2S(GetUnitPointValue(GetEnumUnit())), 0.023)
call SetTextTagPos(udg_goldTextTag[GetHandleId(GetEnumUnit())], GetUnitX(GetEnumUnit()), GetUnitY(GetEnumUnit()) - 128.00, 128.00)
call SetTextTagColor(udg_goldTextTag[GetHandleId(GetEnumUnit())], 255, 204, 0, 255)
call SetTextTagVisibility(udg_goldTextTag[GetHandleId(GetEnumUnit())], true)
endif
endfunction
function goldMineIncome takes nothing returns nothing
call ForGroup(udg_playerGoldMines[1], function goldMineIncomeCB)
call ForGroup(udg_playerGoldMines[9], function goldMineIncomeCB)
endfunction
//===========================================================================
function InitTrig_goldMineIncome takes nothing returns nothing
set gg_trg_goldMineIncome = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_goldMineIncome, 1.00 )
call TriggerAddAction( gg_trg_goldMineIncome, function goldMineIncome )
endfunction