Ir para o conteúdo

Mensagem de Boas-Vindas

Cumprimente jogadores quando fazem login e opcionalmente entregue recompensas de login.

Boas-Vindas Básica

local function OnPlayerLogin(aIndex)
    local player = GetUser(aIndex)
    if player == nil then return end

    GCNoticeSend(aIndex, 1, "Welcome to MuDevs, " .. player.Name .. "!")
    LogAdd(LOG_GREEN, "[Welcome] " .. player.Name .. " connected from " .. player.IpAddr)
end

BridgeFunctionAttach("OnCharacterEntry", OnPlayerLogin)

Boas-Vindas com Mensagem Baseada na Classe

local CLASS_NAMES = {
    [CLASS_DW] = "Dark Wizard",
    [CLASS_DK] = "Dark Knight",
    [CLASS_FE] = "Fairy Elf",
    [CLASS_MG] = "Magic Gladiator",
    [CLASS_DL] = "Dark Lord",
    [CLASS_SU] = "Summoner",
    [CLASS_RF] = "Rage Fighter",
}

local function OnPlayerLogin(aIndex)
    local player = GetUser(aIndex)
    if player == nil then return end

    local className = CLASS_NAMES[player.Class] or "Adventurer"
    GCNoticeSend(aIndex, 1, "Welcome, " .. className .. " " .. player.Name .. "!")
    GCNoticeSend(aIndex, 1, "Your level: " .. player.Level .. " | Resets: " .. player.Reset)
end

BridgeFunctionAttach("OnCharacterEntry", OnPlayerLogin)

Boas-Vindas com Recompensa de Login via Gremory

Warning

NÃO entregue itens do Gremory no OnCharacterEntry — os dados do Gremory ainda não foram carregados. Use OnGremoryCaseReady em vez disso.

local REWARD_ITEM = GET_ITEM(14, 13)  -- Jewel of Bless

local function OnGremoryCaseLoaded(aIndex)
    local player = GetUser(aIndex)
    if player == nil then return end

    -- Give a daily Jewel of Bless to Gremory Case
    GremoryGive(aIndex, REWARD_ITEM, 0, 0, 0, 0, 0, 0,
        GREMORY_CASE_CHARACTER, GREMORY_REWARD_EVENT, GREMORY_EXPIRE_7_DAYS)

    GCNoticeSend(aIndex, 1, "A login reward has been sent to your Gremory Case!")
end

BridgeFunctionAttach("OnGremoryCaseReady", OnGremoryCaseLoaded)