-- =========================================================================== -- SorteioPopup - pop-up no canto esquerdo enquanto o Sorteio esta com as inscricoes abertas (pedido do dono em -- 24/10/2026; no molde do contador do Leilao e do NPC Maluco). Quem manda e o servidor -- (Data/Script/Scripts/EventosPvP/SorteioPopup.lua): SO_Estado (aberto 0 ou 1, inscritos). Aqui so desenha. -- -- Sorteio aberto -- Participantes (07) -- -- Canto esquerdo, na altura do meio da tela: o alto da esquerda tem o nome do mapa, os avisos do sistema e o grupo, -- e o pe tem o chat. O fundo e o mesmo do contador do NPC Maluco (BancoJoias_Linha, 134 x 34). -- =========================================================================== local IMG_FUNDO = 40061 -- Custom\Interface\BancoJoias_Linha.tga (134 x 68: 2 estados de 34; usa o 1o) local LARG, ALT = 134, 34 local X, Y = 6, 200 local E = nil -- { n } enquanto o sorteio esta aberto local LerForma = nil local function LerDword(nome) local formas = { function() return GetDwordPacket(nome) end, function() return GetDwordPacket(nome, -1) end } if LerForma then local ok, v = pcall(formas[LerForma]); if ok then return tonumber(v) end end for i, f in ipairs(formas) do local ok, v = pcall(f) if ok and tonumber(v) then LerForma = i; return tonumber(v) end end return nil end local function Pot2(n) local p = 1 while p < n do p = p * 2 end return p end local function Protocolo(head, nome) if nome ~= "SO_Estado" then return nil end local aberto, n = LerDword(nome) or 0, LerDword(nome) or 0 pcall(ClearPacket, nome) E = (aberto == 1) and { n = n } or nil return true end ProtocolFunctions.ClientProtocol(Protocolo) function SorteioPopup_Desenhar() if not E then return end pcall(RenderImage2, IMG_FUNDO, X, Y, LARG, ALT, 0, 0, LARG / Pot2(LARG), ALT / Pot2(68), 1, 1, 1.0) SetFontType(1); SetTextBg(0, 0, 0, 0) SetTextColor(255, 189, 25, 255) RenderText5(X, Y + 5, "Sorteio aberto", LARG, 3) SetTextColor(255, 255, 255, 255) RenderText5(X, Y + 19, string.format("Participantes (%02d)", E.n), LARG, 3) end function SorteioPopup_Carregar() pcall(LoadBitmap, "Custom\\Interface\\BancoJoias_Linha.tga", IMG_FUNDO) end BridgeFunctionAttach('MainLoader', 'SorteioPopup_Carregar') BridgeFunctionAttach('MainInterfaceProcThread', 'SorteioPopup_Desenhar')