murequire("Define") murequire("System.ScriptCore") -- Painel F1 do MunRaR. Usa os mesmos elementos visuais do Jewel Bank. -- Reutiliza os IDs fixos do Jewel Bank. IDs 6000..8915 pertencem aos frames -- giratorios dos 81 itens e nao podem ser usados pelos elementos do painel F1. local TEX_LEFT = 4988 local TEX_LEFT_HOVER = 4989 local TEX_LEFT_DISABLED = 4990 local TEX_RIGHT = 4991 local TEX_RIGHT_HOVER = 4992 local TEX_RIGHT_DISABLED = 4993 local TEX_CLOSE = 4994 local TEX_CLOSE_HOVER = 4995 local TEX_TAB_LINE = 4999 local TEX_BOARD = 5001 local TEX_ROW = 5002 local PANEL = { x = 100, y = 40, w = 435, h = 352, visible = false, view = "events", pageEvents = 1, pageCommands = 1, dragging = false, dragDX = 0, dragDY = 0, } local ROWS_PER_PAGE = 14 local inputBlocked = false local f1WasDown = false local lastNextEventKey = "" -- Somente comandos de jogador encontrados nos arquivos atuais do servidor. -- Comandos de GM/ADM (Authority 32) foram propositalmente excluidos. local COMMANDS = { { cmd = "/move mapa", desc = "move para um mapa", access = "FREE" }, { cmd = "/post texto", desc = "mensagem global", access = "FREE" }, { cmd = "/addstr pts [auto]", desc = "adiciona forca", access = "FREE" }, { cmd = "/addagi pts [auto]", desc = "adiciona agilidade", access = "FREE" }, { cmd = "/addvit pts [auto]", desc = "adiciona vitalidade", access = "FREE" }, { cmd = "/addene pts [auto]", desc = "adiciona energia", access = "FREE" }, { cmd = "/addcmd pts [auto]", desc = "adiciona comando", access = "FREE" }, { cmd = "/ware 0-4", desc = "troca o bau", access = "FREE" }, { cmd = "/clearinv", desc = "limpa o inventario", access = "FREE" }, { cmd = "/debuff", desc = "remove efeitos negativos", access = "FREE" }, { cmd = "/rename nome", desc = "altera o nome", access = "FREE" }, { cmd = "/war guild", desc = "desafia uma guild", access = "FREE" }, { cmd = "/soccer guild", desc = "desafia para futebol", access = "FREE" }, { cmd = "/re on|off|auto", desc = "pedidos recebidos", access = "FREE" }, { cmd = "/store ruud|wcc", desc = "abre loja pessoal", access = "FREE" }, { cmd = "/offstore", desc = "loja pessoal offline", access = "FREE" }, { cmd = "/attack", desc = "ataque automatico", access = "FREE" }, { cmd = "/offattack", desc = "ataque automatico offline", access = "FREE" }, { cmd = "/pack", desc = "empacota joias", access = "FREE" }, { cmd = "/unpack", desc = "desempacota joias", access = "FREE" }, { cmd = "/coint", desc = "consulta moedas", access = "FREE" }, { cmd = "/openware", desc = "abre o bau", access = "FREE" }, { cmd = "/pktime", desc = "consulta tempo de PK", access = "FREE" }, { cmd = "/eventinfo", desc = "eventos ativos/proximos", access = "FREE" }, { cmd = "/invinfo", desc = "status das invasoes", access = "FREE" }, { cmd = "/bossheartinfo", desc = "status dos bosses Heart", access = "FREE" }, { cmd = "/bank", desc = "ajuda e lista de IDs", access = "FREE" }, { cmd = "/bank saldo", desc = "mostra os saldos", access = "FREE" }, { cmd = "/bank guardar", desc = "guarda todos os itens aceitos", access = "FREE" }, { cmd = "/bank sacar ID qtd", desc = "use o ID mostrado no F4", access = "FREE" }, { cmd = "/bank on|off", desc = "auto-deposito ao coletar", access = "FREE" }, { cmd = "/pkclear", desc = "limpa PK", access = "VIP" }, { cmd = "/clearextinv", desc = "limpa inventario extra", access = "VIP" }, { cmd = "/clearinvmuun", desc = "limpa inventario Muun", access = "VIP" }, { cmd = "/cleareventinv", desc = "limpa inventario de evento", access = "VIP" }, } local EVENTS = { { name = "Underworld", city = "Lorencia/Noria", times = {"13:10", "20:05", "23:10"} }, { name = "Red Dragon", city = "Lorencia", times = {"12:15", "20:45"} }, { name = "Golden Dragon", city = "Lorencia", times = {"14:45", "23:15"} }, { name = "Golden", city = "Varios mapas", times = {"12:25", "18:25"} }, { name = "White Wizard", city = "Lor/Dev/Noria", times = {"15:50", "23:40"} }, { name = "Summer", city = "Varios mapas", times = {"14:25", "22:50"} }, { name = "Medusa", city = "Swamp", times = {"05:00"} }, { name = "Summon", city = "Varios mapas", times = {"16:55", "23:55"} }, { name = "Egg", city = "Varios mapas", times = {"13:50", "21:50"} }, { name = "Chicken Invasion", city = "Lorencia", times = {"11:00", "15:15", "18:00", "22:05"} }, { name = "Snake Invasion", city = "Lorencia", times = {"00:15", "04:15", "08:15", "12:00", "16:15", "21:30"} }, { name = "Monkey Invasion", city = "Lorencia", times = {"02:15", "06:15", "10:15", "14:05", "17:15", "22:20"} }, { name = "Evento Drop", city = "Lorencia", times = {"14:10", "16:10", "18:10", "20:00", "22:10"} }, { name = "Golden Kundun", city = "Lorencia", times = {"07:30", "12:40"} }, { name = "Deep Dungeon Gorgon", city = "Deep Dungeon 5", times = {"08:30", "18:50"} }, { name = "Frost Warden", city = "Raklion", times = {"08:00", "19:50"} }, { name = "Ice Queen", city = "Devias", times = {"00:40", "05:30"} }, { name = "Gorgon", city = "Dungeon", times = {"03:40", "06:00", "19:40"} }, { name = "Hydra", city = "Atlans", times = {"07:00"} }, { name = "Zaikan", city = "Tarkan", times = {"09:40", "16:40"} }, { name = "Balrog", city = "Lost Tower", times = {"06:30", "13:40", "22:40"} }, { name = "Invasao de Acheron", city = "Acheron", times = {"08:45", "12:45", "21:45"} }, { name = "HL Kundun", city = "Heart of Love", times = {"09:00", "17:35"} }, { name = "HL Medusa", city = "Heart of Love", times = {"09:15", "17:55"} }, { name = "HL Gaton", city = "Heart of Love", times = {"09:30", "18:15"} }, { name = "HL Selupan", city = "Heart of Love", times = {"09:45", "18:35"} }, { name = "HL DD Gorgon", city = "Heart of Love", times = {"10:00", "18:55"} }, { name = "HL Silvester", city = "Heart of Love", times = {"10:15", "19:15"} }, { name = "HL Atlantes", city = "Heart of Love", times = {"10:30", "19:35"} }, { name = "HL Lord Ferea", city = "Heart of Love", times = {"10:45", "19:55"} }, { name = "HL Nix", city = "Heart of Love", times = {"11:00", "20:15"} }, { name = "HL God Dark", city = "Heart of Love", times = {"11:15", "20:35"} }, { name = "HL Gold Kundun", city = "Heart of Love", times = {"11:30", "20:55"} }, { name = "HL Frost", city = "Heart of Love", times = {"11:45", "21:15"} }, } local function OnLoadInterface_F1Panel() LoadBitmap("Custom\\JewelBank\\Board.tga", TEX_BOARD, GL_LINEAR, GL_REPEAT, false, false) LoadBitmap("Custom\\JewelBank\\jewel-bg.tga", TEX_ROW, GL_LINEAR, GL_REPEAT, false, false) LoadBitmap("Custom\\JewelBank\\btn-close.tga", TEX_CLOSE, GL_LINEAR, GL_REPEAT, false, false) LoadBitmap("Custom\\JewelBank\\btn-close-hover.tga", TEX_CLOSE_HOVER, GL_LINEAR, GL_REPEAT, false, false) LoadBitmap("Custom\\JewelBank\\btn-left.tga", TEX_LEFT, GL_LINEAR, GL_CLAMP, false, false) LoadBitmap("Custom\\JewelBank\\btn-left-hover.tga", TEX_LEFT_HOVER, GL_LINEAR, GL_CLAMP, false, false) LoadBitmap("Custom\\JewelBank\\btn-left-disabled.tga", TEX_LEFT_DISABLED, GL_LINEAR, GL_CLAMP, false, false) LoadBitmap("Custom\\JewelBank\\btn-right.tga", TEX_RIGHT, GL_LINEAR, GL_CLAMP, false, false) LoadBitmap("Custom\\JewelBank\\btn-right-hover.tga", TEX_RIGHT_HOVER, GL_LINEAR, GL_CLAMP, false, false) LoadBitmap("Custom\\JewelBank\\btn-right-disabled.tga", TEX_RIGHT_DISABLED, GL_LINEAR, GL_CLAMP, false, false) LoadBitmap("Custom\\JewelBank\\btn-minus-hover.tga", TEX_TAB_LINE, GL_LINEAR, GL_CLAMP, false, false) end local function SetPanelInputBlocked(block) if inputBlocked ~= block then SetBlockInput(block) inputBlocked = block end end local function IsWriting() return type(IsWriteInterfaceOpen) == "function" and IsWriteInterfaceOpen() end local function DrawText(x, y, text, width, align, r, g, b, bold) UIRenderText_SetFont(bold and g_hFontBold or g_hFont) UIRenderText_SetTextColor(r, g, b, 255) UIRenderText_SetBgColor(0, 0, 0, 0) UIRenderText_RenderText(x, y, text, width or 0, 0, align or 0) end local function ClockText() local now = os.date("*t") return string.format("%02d:%02d:%02d", now.hour, now.min, now.sec) end local function BuildUpcomingEvents() local now = os.date("*t") local current = now.hour * 3600 + now.min * 60 + now.sec local list = {} for _, event in ipairs(EVENTS) do for _, value in ipairs(event.times) do local h, m, s = string.match(value, "(%d+):(%d+):?(%d*)") h, m, s = tonumber(h) or 0, tonumber(m) or 0, tonumber(s) or 0 local diff = h * 3600 + m * 60 + s - current if diff < 0 then diff = diff + 86400 end table.insert(list, { name = event.name, city = event.city, time = value, left = diff }) end end table.sort(list, function(a, b) return a.left < b.left end) return list end local function DrawTabs(isClick) local y = PANEL.y + 32 local eventX = PANEL.x + 121 local commandX = PANEL.x + 226 local eventHover = CheckMouseIn(eventX, y, 88, 17) local commandHover = CheckMouseIn(commandX, y, 88, 17) DrawText(eventX, y + 2, "HORARIOS", 88, 1, PANEL.view == "events" and 255 or 190, PANEL.view == "events" and 215 or 190, PANEL.view == "events" and 0 or 190, true) DrawText(commandX, y + 2, "COMANDOS", 88, 1, PANEL.view == "commands" and 255 or 190, PANEL.view == "commands" and 215 or 190, PANEL.view == "commands" and 0 or 190, true) -- Marcador dourado da aba ativa, usando a mesma arte do Jewel Bank. local lineX = PANEL.view == "events" and eventX or commandX RenderImage(TEX_TAB_LINE, lineX + 6, y + 17, 76, 2) if isClick and eventHover then PANEL.view = "events" end if isClick and commandHover then PANEL.view = "commands" end end local function DrawCell(x, y, firstLine, secondLine, accent) RenderImage(TEX_ROW, x, y, 193, 32) DrawText(x + 9, y + 6, firstLine, 176, 0, accent and 255 or 245, accent and 215 or 245, accent and 0 or 245, true) DrawText(x + 9, y + 18, secondLine, 176, 0, 175, 190, 220, false) end local function DrawPagination(page, pages, isClick) local y = PANEL.y + PANEL.h - 24 local prevX = PANEL.x + 190 local nextX = PANEL.x + 233 local size = 12 if page > 1 then local hover = CheckMouseIn(prevX, y, size, size) RenderImage(hover and TEX_LEFT_HOVER or TEX_LEFT, prevX, y, size, size) if hover and isClick then page = page - 1 end else RenderImage(TEX_LEFT_DISABLED, prevX, y, size, size) end DrawText(PANEL.x + 203, y + 1, string.format("%d/%d", page, pages), 30, 1, 255, 215, 0, true) if page < pages then local hover = CheckMouseIn(nextX, y, size, size) RenderImage(hover and TEX_RIGHT_HOVER or TEX_RIGHT, nextX, y, size, size) if hover and isClick then page = page + 1 end else RenderImage(TEX_RIGHT_DISABLED, nextX, y, size, size) end return page end local function DrawEvents(isClick) local items = BuildUpcomingEvents() local pages = math.max(1, math.ceil(#items / ROWS_PER_PAGE)) if #items > 0 then local nextKey = items[1].name .. "@" .. items[1].time if lastNextEventKey ~= "" and nextKey ~= lastNextEventKey then PANEL.pageEvents = 1 end lastNextEventKey = nextKey end if PANEL.pageEvents > pages then PANEL.pageEvents = pages end local first = (PANEL.pageEvents - 1) * ROWS_PER_PAGE + 1 for slot = 0, ROWS_PER_PAGE - 1 do local item = items[first + slot] if item then local col = slot % 2 local row = math.floor(slot / 2) local x = PANEL.x + 18 + col * 206 local y = PANEL.y + 54 + row * 36 local leftH = math.floor(item.left / 3600) local leftM = math.floor((item.left % 3600) / 60) local leftS = item.left % 60 local queueNumber = first + slot local title if queueNumber == 1 then title = "#01 PROXIMO: " .. item.name .. " - " .. item.time else title = string.format("#%02d %s - %s", queueNumber, item.name, item.time) end DrawCell(x, y, title, string.format("%s | falta %02d:%02d:%02d", item.city, leftH, leftM, leftS), queueNumber == 1) end end PANEL.pageEvents = DrawPagination(PANEL.pageEvents, pages, isClick) end local function DrawCommands(isClick) local pages = math.max(1, math.ceil(#COMMANDS / ROWS_PER_PAGE)) if PANEL.pageCommands > pages then PANEL.pageCommands = pages end local first = (PANEL.pageCommands - 1) * ROWS_PER_PAGE + 1 for slot = 0, ROWS_PER_PAGE - 1 do local item = COMMANDS[first + slot] if item then local col = slot % 2 local row = math.floor(slot / 2) local x = PANEL.x + 18 + col * 206 local y = PANEL.y + 54 + row * 36 DrawCell(x, y, item.cmd, "[" .. item.access .. "] " .. item.desc, item.access == "VIP") end end PANEL.pageCommands = DrawPagination(PANEL.pageCommands, pages, isClick) end local function OnInterfaceRender_F1Panel() if not PANEL.visible or IsWriting() then SetPanelInputBlocked(false) return end local isClick = IsMouseClicked() local overPanel = CheckMouseIn(PANEL.x, PANEL.y, PANEL.w, PANEL.h) SetPanelInputBlocked(overPanel or PANEL.dragging) if isClick and CheckMouseIn(PANEL.x, PANEL.y, PANEL.w - 32, 30) then PANEL.dragging = true PANEL.dragDX = MouseX - PANEL.x PANEL.dragDY = MouseY - PANEL.y end if PANEL.dragging then if IsMouseHeld() then PANEL.x = MouseX - PANEL.dragDX PANEL.y = MouseY - PANEL.dragDY else PANEL.dragging = false end end RenderImage(TEX_BOARD, PANEL.x, PANEL.y, PANEL.w, PANEL.h) DrawText(PANEL.x + 155, PANEL.y + 13, "MUNRAR - INFORMACOES", 125, 1, 212, 181, 22, true) local closeX = PANEL.x + PANEL.w - 28 local closeY = PANEL.y + 10 local closeHover = CheckMouseIn(closeX, closeY, 12, 12) RenderImage(closeHover and TEX_CLOSE_HOVER or TEX_CLOSE, closeX, closeY, 12, 12) if closeHover and isClick then PANEL.visible = false PANEL.dragging = false SetPanelInputBlocked(false) return end DrawTabs(isClick) if PANEL.view == "commands" then DrawCommands(isClick) else DrawEvents(isClick) end DrawText(PANEL.x + 18, PANEL.y + PANEL.h - 23, "Hora: " .. ClockText(), 100, 0, 180, 205, 255, true) DrawText(PANEL.x + PANEL.w - 118, PANEL.y + PANEL.h - 23, "F1: abrir/fechar", 100, 2, 180, 205, 255, false) end local function OnTimerThread_F1Panel() if IsWriting() then return end local down = SEASON3B_IsPress(VK_F1) if down and not f1WasDown then PANEL.visible = not PANEL.visible PANEL.dragging = false if not PANEL.visible then SetPanelInputBlocked(false) end end f1WasDown = down end local function OnInterfaceActive_F1Panel() return PANEL.visible and 1 or 0 end local function OnInterfaceActiveZone_F1Panel() if PANEL.visible and CheckMouseIn(PANEL.x, PANEL.y, PANEL.w, PANEL.h) then return 1 end return 0 end BridgeFunctionAttach("OnLoadInterface", OnLoadInterface_F1Panel) BridgeFunctionAttach("OnInterfaceRender", OnInterfaceRender_F1Panel) BridgeFunctionAttach("OnTimerThread", OnTimerThread_F1Panel) BridgeFunctionAttach("OnInterfaceActive", OnInterfaceActive_F1Panel) BridgeFunctionAttach("OnInterfaceActiveZone", OnInterfaceActiveZone_F1Panel)