local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
function onLogin(cid)
local a = 0
local limitAM = 20
if getCreatureName(cid):lower() == "account manager" then
for _, pid in ipairs(getPlayersOnline()) do
if getCreatureName(pid):lower() == "account manager" and pid ~= cid then
a = a + 1
end
end
if a >= limitAM then
return false
end
return true
end
if (getCreatureName(cid) == "Account Manager") then
return doRemoveCreature(cid, true)
end
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doCreatureSetDropLoot(cid, false)
doChangeSpeed(cid, 999)
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
doPlayerSendTextMessage(cid, 21, "Welcome Back To Volentera!")
end
local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
end
local rates = {
[1] = {rate = 10.0},
[2] = {rate = 9.75},
[3] = {rate = 9.5},
[4] = {rate = 9.25},
[5] = {rate = 9.0},
[6] = {rate = 8.75}
}
for i,v in pairs(rates) do
if getPlayerRebirth(cid) == i then
doPlayerSetRate(cid, SKILL__LEVEL, v.rates)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(accountManager == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(accountManager == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
end
if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "Rebirth")
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
return true
end