function onLogin(cid)
doChangeSpeed(cid, 750)
doCreatureSay(cid, "Welcome!", 19)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
if getPlayerStorageValue(cid, 57928) == 1 then
doCreatureSay(cid, "Automaticly", TALKTYPE_MONSTER_SAY)
end
local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), getConfigValue('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
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, "onPrepareDeath")
registerCreatureEvent(cid, "ZombieEvent")
registerCreatureEvent(cid, "AutoBuyer")
registerCreatureEvent(cid, "skullsystem")
registerCreatureEvent(cid, "skulllvls")
registerCreatureEvent(cid, "BlockEffect")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "Idle")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
if(getBooleanFromString(getConfigValue('useFragHandler'))) then
registerCreatureEvent(cid, "SkullCheck")
end
print(getCreatureStorage(cid, storageItem), getPlayerBlessing(cid, 1))
if (getCreatureStorage(cid, storageItem) == 1 and getPlayerBlessing(cid, 1) == false) then
doPlayerAddItem(cid, idAol, 1)
doCreatureSay(cid,'Automaticly blessed and amulet of loss equiped!',TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPosition(cid), CONST_ME_HOLYAREA)
for i = 1,5 do
doPlayerAddBlessing(cid, i)
end
end
return true
end