Bỏ qua

Tin nhắn chào mừng

Chào người chơi khi họ đăng nhập và tùy chọn tặng phần thưởng đăng nhập.

Chào mừng cơ bản

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)

Chào mừng theo lớp nhân vật

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)

Chào mừng với phần thưởng đăng nhập Gremory

Warning

KHÔNG tặng vật phẩm Gremory trong OnCharacterEntry — dữ liệu Gremory chưa được tải xong. Hãy sử dụng OnGremoryCaseReady thay thế.

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

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

    -- Tặng Jewel of Bless hàng ngày vào 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)