local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
for i = 0, 4 do
doPlayerSetLossPercent(cid, i, 0)
end
[Error - CreatureScript Interface]
data/creaturescripts/scripts/login.lua:onLogin
Description:
data/creaturescripts/scripts/login.lua:10: attempt to perform arithmetic on global 'loss' (a nil value)
stack traceback:
data/creaturescripts/scripts/login.lua:10: in function <data/creaturescripts/scripts/login.lua:6>
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
function onLogin(cid)
for i = 0, 4 do
doPlayerSetLossPercent(cid, i, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doPlayerAddPremiumDays(cid, 2)
end
local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local mapMark = {x=1010, y=1015, z=6}
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
setPlayerStorageValue(cid,10010,0)
doPlayerSendCancel(cid,"Your Killstreaks Have Been Reset")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
if getPlayerLevel(cid) < 80 then
doPlayerAddExp(cid,4000000)
end
else
doPlayerPopupFYI(cid,"Welcome to AOD War OT")
doPlayerPopupFYI(cid,"After you choose your outfit and set your hotkeys..")
doPlayerPopupFYI(cid,"Create Your Guild, Get Rady, Go For The Strike!")
doPlayerAddMapMark(cid,mapMark,2,"TELEPORTER")
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
if getPlayerLevel(cid) < 80 then
doPlayerAddExp(cid,4000000)
end
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, "Advance")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "zombieevent")
registerCreatureEvent(cid, "VipCheck")
registerCreatureEvent(cid, "TempleTeleporter")
registerCreatureEvent(cid, "extraExp")
registerCreatureEvent(cid, "forever amulet")
registerCreatureEvent(cid, "skull amulet")
registerCreatureEvent(cid, "charge amulet")
registerCreatureEvent(cid,'SpellUp')
registerCreatureEvent(cid, "ondeath")
registerCreatureEvent(cid, "onPrepareDeath")
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
return true
end
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
function onLogin(cid)
for i = 0, 4 do
doPlayerSetLossPercent(cid, i, 0)
end
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doPlayerAddPremiumDays(cid, 2)
local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local mapMark = {x=1010, y=1015, z=6}
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
setPlayerStorageValue(cid,10010,0)
doPlayerSendCancel(cid,"Your Killstreaks Have Been Reset")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
if getPlayerLevel(cid) < 80 then
doPlayerAddExp(cid,4000000)
end
else
doPlayerPopupFYI(cid,"Welcome to AOD War OT")
doPlayerPopupFYI(cid,"After you choose your outfit and set your hotkeys..")
doPlayerPopupFYI(cid,"Create Your Guild, Get Rady, Go For The Strike!")
doPlayerAddMapMark(cid,mapMark,2,"TELEPORTER")
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
if getPlayerLevel(cid) < 80 then
doPlayerAddExp(cid,4000000)
end
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, "Advance")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "zombieevent")
registerCreatureEvent(cid, "VipCheck")
registerCreatureEvent(cid, "TempleTeleporter")
registerCreatureEvent(cid, "extraExp")
registerCreatureEvent(cid, "forever amulet")
registerCreatureEvent(cid, "skull amulet")
registerCreatureEvent(cid, "charge amulet")
registerCreatureEvent(cid,'SpellUp')
registerCreatureEvent(cid, "ondeath")
registerCreatureEvent(cid, "onPrepareDeath")
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
return true
end
local loginMessage = getConfigValue('loginMessage')
function onLogin(cid)
for i = 0, 4 do
doPlayerSetLossPercent(cid, i, 0)
[B][COLOR="red"]doPlayerAddBlessing(cid, i + 1)[/COLOR][/B]
end
doPlayerAddPremiumDays(cid, 2)
local accountManager = getPlayerAccountManager(cid)
if accountManager == MANAGER_NONE then
local lastLogin, str = getPlayerLastLoginSaved(cid), loginMessage
if lastLogin ~= 0 then
setPlayerStorageValue(cid, 10010, 0)
doPlayerSendCancel(cid, 'Your Killstreaks Have Been Reset')
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = 'Your last visit was on ' .. os.date('%a %b %d %X %Y', lastLogin) .. '.'
else
doPlayerPopupFYI(cid, 'Welcome to AOD War OT')
doPlayerPopupFYI(cid, 'After you choose your outfit and set your hotkeys..')
doPlayerPopupFYI(cid, 'Create Your Guild, Get Rady, Go For The Strike!')
doPlayerAddMapMark(cid, {x=1010, y=1015, z=6}, 2, 'TELEPORTER')
str = str .. ' Please choose your outfit.'
doPlayerSendOutfitWindow(cid)
end
if getPlayerLevel(cid) < 80 then
doPlayerAddExp(cid, 4000000)
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, 'Advance')
registerCreatureEvent(cid, 'ReportBug')
registerCreatureEvent(cid, 'AdvanceSave')
registerCreatureEvent(cid, 'ReportBug')
registerCreatureEvent(cid, 'AdvanceSave')
registerCreatureEvent(cid, 'zombieevent')
registerCreatureEvent(cid, 'VipCheck')
registerCreatureEvent(cid, 'TempleTeleporter')
registerCreatureEvent(cid, 'extraExp')
registerCreatureEvent(cid, 'forever amulet')
registerCreatureEvent(cid, 'skull amulet')
registerCreatureEvent(cid, 'charge amulet')
registerCreatureEvent(cid, 'SpellUp')
registerCreatureEvent(cid, 'ondeath')
registerCreatureEvent(cid, 'onPrepareDeath')
registerCreatureEvent(cid, 'Idle')
registerCreatureEvent(cid, 'SkullCheck')
return true
end