- Joined
- Aug 8, 2009
- Messages
- 5
Could someone help me why this script is not working
Thank You in advance
JASS:
function GetSTD takes integer b, integer ex returns integer
local integer count = 1
local integer result = b
if (ex==0) then
return 1
endif
if (ex==1) then
return 2
endif
loop
exitwhen (count==ex)
set result = result * b
set count = count + 1
endloop
return result
endfunction
function Trig_Generator_Func009Func001Func001C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A000', GetEnumUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Generator_Func009Func001A takes nothing returns nothing
local integer tempint
if ( Trig_Generator_Func009Func001Func001C() ) then
set tempint = 5 * GetSTD(2,GetUnitAbilityLevelSwapped('A004', GetEnumUnit()))
call AdjustPlayerStateBJ( (tempint), GetOwningPlayer(GetEnumUnit()), PLAYER_STATE_RESOURCE_GOLD )
call CreateTextTagUnitBJ( ( "+" + I2S((tempint))), GetEnumUnit(), 0, 10, 100, 100, 0.00, 0 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 1.00 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 100.00, 90 )
else
call DoNothing( )
endif
endfunction
function Trig_Generator_Func009A takes nothing returns nothing
call ForGroupBJ( udg_FarmGroup, function Trig_Generator_Func009Func001A )
call GroupClear( udg_FarmGroup )
endfunction
function Trig_Generator_Actions takes nothing returns nothing
// Add Farm1, Farm2 and Farm3 into one unit group
set udg_FarmGroup = GetUnitsOfTypeIdAll('h002')
set udg_FarmGroupTemp = GetUnitsOfTypeIdAll('h003')
call GroupAddGroup( udg_FarmGroupTemp, udg_FarmGroup )
call GroupClear( udg_FarmGroupTemp )
set udg_FarmGroupTemp = GetUnitsOfTypeIdAll('h004')
call GroupAddGroup( udg_FarmGroupTemp, udg_FarmGroup )
call GroupClear( udg_FarmGroupTemp )
call ForForce( udg_RoadRunners, function Trig_Generator_Func009A )
endfunction
//===========================================================================
function InitTrig_Generator takes nothing returns nothing
set gg_trg_Generator = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Generator, 1.00 )
call TriggerAddAction( gg_trg_Generator, function Trig_Generator_Actions )
endfunction