Name | Type | is_array | initial_value |
Draw_Color_B | real | No | |
Draw_Color_G | real | No | |
Draw_Color_R | real | No | |
Draw_Draw | boolean | No | |
Draw_Erase | boolean | No | |
Draw_Level | integer | No | |
Draw_LPress | integer | No | |
Draw_Mode | integer | No | |
Draw_NewLine | boolean | No | |
Draw_NPress | boolean | No | |
Draw_Player | player | No | |
Draw_Size | real | No | |
Draw_Unit | unit | No | |
Draw_X | real | No | |
Draw_X_Line | real | No | |
Draw_X_Old | real | No | |
Draw_Y | real | No | |
Draw_Y_Line | real | No | |
Draw_Y_Old | real | No | |
G_DrawersLeft | force | No | |
G_GAMEOVER | boolean | No | |
G_GO_Timer | timer | No | |
G_HiddenEnteringE | string | No | |
G_HiddenEnteringW | string | No | |
G_Hint | string | No | |
G_HintStage | integer | No | |
G_Host | player | No | |
G_Multiboard | multiboard | No | |
G_PlayerNames | string | Yes | |
G_PlayerScore | integer | Yes | |
G_ScoreToWin | integer | No | |
G_Timer_Guess | timer | No | |
G_Timer_Hint | timer | No | |
G_Winner | player | No | |
G_Winners | force | No | |
G_Word | string | No | |
G_WordNeeded | boolean | No | |
PlayerColorString | string | Yes | |
S_GuessTime | real | No | |
S_HintTime | real | No | |
TempInt | integer | Yes | |
TempPoint | location | Yes | |
TempReal | real | Yes | |
TempString | string | Yes | |
TempUG | group | Yes |
function Trig_GetHost_Actions takes nothing returns nothing
local integer loopInt = 0
local integer loopMax = 23
loop
exitwhen loopInt > loopMax
if GetPlayerController(Player(loopInt)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(loopInt)) == PLAYER_SLOT_STATE_PLAYING then
if udg_G_Host != Player(loopInt) then
set udg_G_Host = Player(loopInt)
call DisplayTimedTextToForce( GetPlayersAll(), 30, "|cffffff00" + GetPlayerName(Player(loopInt)) + " as been selected as the host|r." )
endif
set loopInt = 99
endif
set loopInt = loopInt + 1
endloop
set loopInt = 0
set loopMax = 0
endfunction
//===========================================================================
function InitTrig_GetHost takes nothing returns nothing
set gg_trg_GetHost = CreateTrigger( )
call TriggerAddAction( gg_trg_GetHost, function Trig_GetHost_Actions )
endfunction
function Trig_Pic_Sec2String_Actions takes nothing returns nothing
local integer timeSec = udg_TempInt[1]
local integer timeMin = 0
local string timeString = ""
set timeMin = timeSec / 60
set timeSec = timeSec - (timeMin * 60)
if timeMin < 10 then
set timeString = "0" + I2S(timeMin) + ":"
else
set timeString = I2S(timeMin) + ":"
endif
if timeSec < 10 then
set timeString = timeString + "0" + I2S(timeSec)
else
set timeString = timeString + I2S(timeSec)
endif
set udg_TempString[1] = timeString
set timeSec = 0
set timeMin = 0
set timeString = null
endfunction
//===========================================================================
function InitTrig_Func_Sec2String takes nothing returns nothing
set gg_trg_Func_Sec2String = CreateTrigger( )
call TriggerAddAction( gg_trg_Func_Sec2String, function Trig_Pic_Sec2String_Actions )
endfunction
function Trig_Draw_SetCustomColor_Conditions takes nothing returns boolean
if ( not ( udg_Draw_Player == GetTriggerPlayer() ) ) then
return false
endif
return true
endfunction
function Trig_Draw_SetCustomColor_Func002C takes nothing returns boolean
if ( not ( SubStringBJ(GetEventPlayerChatString(), 1, 3) == "-c " ) ) then
return false
endif
return true
endfunction
function GetHexSignValue takes string sign returns integer
if sign == "a" or sign == "A" then
return 10
endif
if sign == "b" or sign == "B" then
return 11
endif
if sign == "c" or sign == "C" then
return 12
endif
if sign == "d" or sign == "D" then
return 13
endif
if sign == "e" or sign == "E" then
return 14
endif
if sign == "f" or sign == "F" then
return 15
endif
return S2I(sign)
endfunction
function Trig_Draw_SetCustomColor_Actions takes nothing returns nothing
if ( Trig_Draw_SetCustomColor_Func002C() ) then
set udg_Draw_Color_R = I2R(GetHexSignValue(SubStringBJ(GetEventPlayerChatString(), 4, 4)) * 16 + GetHexSignValue(SubStringBJ(GetEventPlayerChatString(), 5, 5))) / 255.0 * 100.0
set udg_Draw_Color_G = I2R(GetHexSignValue(SubStringBJ(GetEventPlayerChatString(), 6, 6)) * 16 + GetHexSignValue(SubStringBJ(GetEventPlayerChatString(), 7, 7))) / 255.0 * 100.0
set udg_Draw_Color_B = I2R(GetHexSignValue(SubStringBJ(GetEventPlayerChatString(), 8, 8)) * 16 + GetHexSignValue(SubStringBJ(GetEventPlayerChatString(), 9, 9))) / 255.0 * 100.0
endif
endfunction
//===========================================================================
function InitTrig_Draw_SetCustomColor takes nothing returns nothing
set gg_trg_Draw_SetCustomColor = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(0), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(1), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(2), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(3), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(4), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(5), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(6), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(7), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(8), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(9), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(10), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(11), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(12), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(13), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(14), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(15), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(16), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(17), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(18), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(19), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(20), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(21), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(22), "", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Draw_SetCustomColor, Player(23), "", false )
call TriggerAddCondition( gg_trg_Draw_SetCustomColor, Condition( function Trig_Draw_SetCustomColor_Conditions ) )
call TriggerAddAction( gg_trg_Draw_SetCustomColor, function Trig_Draw_SetCustomColor_Actions )
endfunction
function DoesIntArrayContainInt takes integer i, integer as returns boolean
local integer loopInt = 0
loop
exitwhen loopInt > as
if i == udg_TempInt[loopInt] then
set loopInt = 0
return false
endif
set loopInt = loopInt + 1
endloop
set loopInt = 0
return true
endfunction
function GetHintWithLetters takes real percentToShow returns string
local integer loopInt = 0
local integer loopMax = 0
local integer tempInt
local integer array wordLocations
local integer pickedLettersSize = 0
local integer wordLocationsSize = 0
local string tempS = "|cff00ff00[No Hint Yet]|r"
set loopInt = 1
set loopMax = StringLength(udg_G_Word)
set wordLocationsSize = loopMax - 1
loop
exitwhen loopInt > loopMax
set wordLocations[loopInt - 1] = loopInt
set loopInt = loopInt + 1
endloop
//pick random locations in the string
set loopInt = 0
set loopMax = R2I(I2R(StringLength(udg_G_Word)) * percentToShow)
set pickedLettersSize = 0
loop
exitwhen loopInt >= loopMax
set tempInt = GetRandomInt(0,wordLocationsSize)//get a random location
set udg_TempInt[pickedLettersSize] = wordLocations[tempInt]
set wordLocations[tempInt] = wordLocations[wordLocationsSize]
set wordLocations[wordLocationsSize] = 0
set pickedLettersSize = pickedLettersSize + 1
set wordLocationsSize = wordLocationsSize - 1
set loopInt = loopInt + 1
endloop
//display picked Words
set loopInt = 0
loop
exitwhen loopInt >= pickedLettersSize
set loopInt = loopInt + 1
endloop
//build the word
set loopInt = 1
set loopMax = StringLength(udg_G_Word)
set tempS = ""
loop
exitwhen loopInt > loopMax
if DoesIntArrayContainInt(loopInt, pickedLettersSize) then
set tempS = tempS + " _"
else
set tempS = tempS + " " + SubStringBJ(udg_G_Word,loopInt,loopInt)
endif
set loopInt = loopInt + 1
endloop
set loopInt = 0
set loopMax = 0
set tempInt = 0
set pickedLettersSize = 0
set wordLocationsSize = 0
return tempS
endfunction
function Trig_Pic_Update_Hint_Actions takes nothing returns nothing
local integer loopInt = 0
local integer loopMax = 0
local string tempS = "|cff00ff00[No Hint Yet]|r"
if udg_G_HintStage == 1 then //sets the hint to show the number of letters of the word
set tempS = ""
set loopInt = 1
set loopMax = StringLength(udg_G_Word)
loop
exitwhen loopInt > loopMax
set tempS = tempS + " _"
set loopInt = loopInt + 1
endloop
set tempS = "|cff00ff00" + tempS + "|r"
endif
if udg_G_HintStage == 2 then//shows 50% of the words letters
set tempS = "|cff00ff00" + GetHintWithLetters(0.5) + "|r"
endif
set udg_G_Hint = tempS
set loopInt = 0
set loopMax = 0
endfunction
//===========================================================================
function InitTrig_Pic_Update_Hint takes nothing returns nothing
set gg_trg_Pic_Update_Hint = CreateTrigger( )
//call TriggerRegisterPlayerEventEndCinematic( gg_trg_Pic_Update_Hint, Player(0) )
call TriggerAddAction( gg_trg_Pic_Update_Hint, function Trig_Pic_Update_Hint_Actions )
endfunction