function UToInt takes unit foo returns integer
return foo
return 0
endfunction
function condPNumbEqual takes integer pnumber returns boolean
if ( not ( GetPlayerController(ConvertedPlayer(pnumber)) == MAP_CONTROL_USER ) ) then
return false
endif
if ( not ( GetPlayerSlotState(ConvertedPlayer(pnumber)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction
function SetWolf takes nothing returns nothing
local integer pnumber
loop
set pnumber = GetRandomInt(1, 11)
exitwhen condPNumbEqual(pnumber)
endloop
set udg_werewolf_int = pnumber
endfunction
function infestHuman takes unit wolf, unit prey returns nothing
local unit wolf2
local unit prey2
local real SleepTime
set prey2 = prey
set wolf2 = wolf
call IssueImmediateOrderBJ( wolf2, "stop" )
call SetUnitUserData( prey2, 1 )
call UnitAddAbilityBJ( 'A005', prey2 )
call IssueTargetOrderBJ( prey2, "sleep", prey2 )
call TriggerSleepAction( 0.10 )
call UnitRemoveAbilityBJ( 'A005', prey2 )
call PauseUnitBJ( true, prey2 )
if ( GetTimeOfDay() >= 18.00 ) then
set SleepTime = ( ( ( ( 30.00 - GetTimeOfDay() ) * 20.00 ) * GetTimeOfDayScalePercentBJ() ) )
else
set SleepTime = ( ( ( ( 6.00 - GetTimeOfDay() ) * 20.00 ) * GetTimeOfDayScalePercentBJ() ) )
endif
set SleepTime = SleepTime - 0.20
loop
if ( IsUnitPausedBJ(prey2) == true ) then
call PauseUnitBJ( false, prey2 )
call UnitAddAbilityBJ( 'A005', prey2 )
call IssueTargetOrderBJ( prey2, "sleep", prey2 )
call TriggerSleepAction( 0.10 )
call UnitRemoveAbilityBJ( 'A005', prey2 )
call PauseUnitBJ( true, prey2 )
else
endif
call TriggerSleepAction( 4.90 )
set SleepTime = SleepTime - 5.00
exitwhen SleepTime <= 0
exitwhen IsUnitPausedBJ(prey2) == false
endloop
if ( IsUnitPausedBJ(prey2) == true ) then
call PauseUnitBJ( false, prey2 )
else
endif
endfunction
Name | Type | is_array | initial_value |
frostbite_doDmg | boolean | No | true |
frostbite_tmp_dmg | real | No | |
frostbite_tmp_unit | unit | No | |
sfx_sleep | effect | Yes | |
tmp_boolean | boolean | No | |
tmp_integer | integer | No | |
tmp_String | string | No | |
werewolf_b | boolean | Yes | |
werewolf_int | integer | No | |
werewolf_name | string | No |