Mensaje de Bienvenida¶
Saluda a los jugadores cuando inician sesión y opcionalmente otorga recompensas de inicio de sesión.
Bienvenida 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)
Bienvenida con Mensaje Basado en Clase¶
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)
Bienvenida con Recompensa de Gremory al Iniciar Sesión¶
Warning
NO otorgues items de Gremory en OnCharacterEntry — los datos de Gremory aún no se han cargado. Usa OnGremoryCaseReady en su lugar.
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)