local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')),
}
function onLogin(cid)
local bot_check = isBotter(cid)
local pa = isVIP(cid)
local woe = infoLua[2] == getPlayerGuildId(cid)
local nonwoe = infoLua[2] ~= getPlayerGuildId(cid)
local Guild_ID = getPlayerGuildId(cid)
dofile("./_woe.lua")
Woe.getInfo()
if pa == FALSE and bot_check == FALSE then
doPlayerSetExperienceRate(cid, 1)
elseif pa == FALSE and bot_check == TRUE and nonwoe then
doPlayerSetExperienceRate(cid, 0.85)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Você é BOTTER [-15% exp].")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Seu rate total de exp é: -15%.")
elseif pa == TRUE and bot_check == TRUE and nonwoe then
doPlayerSetExperienceRate(cid, 1.05)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Você é VIP [+20% exp].")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Você é BOTTER [-15% exp].")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Seu rate total de exp é: +5%.")
elseif pa == TRUE and bot_check == FALSE and nonwoe then
doPlayerSetExperienceRate(cid, 1.2)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Você é VIP [+20% exp].")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Seu rate total de exp é: +20%.")
elseif pa == FALSE and bot_check == TRUE and woe then
doPlayerSetExperienceRate(cid, 1.0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Você é BOTTER [-15% exp].")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Sua guild venceu o último War of Emperium [+15% exp].")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Seu rate total de exp é: +0%.")
elseif pa == TRUE and bot_check == TRUE and woe then
doPlayerSetExperienceRate(cid, 1.2)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Você é VIP [+20% exp].")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Você é BOTTER [-15% exp].")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Sua guild venceu o último War of Emperium [+15% exp].")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Seu rate total de exp é: +20%.")
elseif pa == TRUE and bot_check == FALSE and woe then
doPlayerSetExperienceRate(cid, 1.35)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Você é VIP [+20% exp].")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Sua guild venceu o último War of Emperium [+15% exp].")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Seu rate total de exp é: +35%.")
elseif pa == FALSE and bot_check == FALSE and woe then
doPlayerSetExperienceRate(cid, 1.15)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Sua guild venceu o último War of Emperium [+15% exp].")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Seu rate total de exp é: +15%.")
end
accountManager = "Account Manager"
managerCounter = 0
for i, player in ipairs(getOnlinePlayers()) do
if accountManager:lower() == player:lower() then
managerCounter = managerCounter + 1
end
end
if managerCounter >= 3 then
return false
end
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin == 0) and isSorcerer(cid) then
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
doPlayerSetStorageValue(cid, 64540, 1)
elseif(lastLogin == 0) and isDruid(cid) then
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
doPlayerSetStorageValue(cid, 64541, 1)
elseif(lastLogin == 0) and isPaladin(cid) then
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
doPlayerSetStorageValue(cid, 64542, 1)
elseif(lastLogin == 0) and isKnight(cid) then
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
doPlayerSetStorageValue(cid, 64543, 1)
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, "TradeMotd")
registerCreatureEvent(cid, "AntiBotMotd")
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
registerCreatureEvent(cid, "Grizzly_Adams")
registerCreatureEvent(cid, "MonsterLoot")
registerCreatureEvent(cid, "inquisition")
registerCreatureEvent(cid, "SpellUp")
registerCreatureEvent(cid, "Channel_Open")
registerCreatureEvent(cid, "Trophy")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "attackguild")
registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "SkullCheck")
registerCreatureEvent(cid, "demonOakLogout")
registerCreatureEvent(cid, "demonOakDeath")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "PlayerKill")
registerCreatureEvent(cid, "PythiusDead")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "TradeMotd")
registerCreatureEvent(cid, "Bossy")
registerCreatureEvent(cid, "VipCheck")
registerCreatureEvent(cid, "yakchal")
registerCreatureEvent(cid, "koshei")
registerCreatureEvent(cid, "renegade_orc")
registerCreatureEvent(cid, "pythius_the_rotten")
registerCreatureEvent(cid, "LevelReward")
registerCreatureEvent(cid, "Playerloook")
registerCreatureEvent(cid, "GM_Look")
registerCreatureEvent(cid, "tirecz")
registerCreatureEvent(cid, "orcus_the_cruel")
registerCreatureEvent(cid, "spirit_of_fire")
registerCreatureEvent(cid, "the_obliverator")
registerCreatureEvent(cid, "war")
registerCreatureEvent(cid, "war_login")
registerCreatureEvent(cid, "vocation_check")
if (InitArenaScript ~= 0) then
InitArenaScript = 1
for i = 42300, 42309 do
setGlobalStorageValue(i, 0)
setGlobalStorageValue(i+100, 0)
end
end
if getPlayerStorageValue(cid, 42309) < 1 then
for i = 42300, 42309 do
setPlayerStorageValue(cid, i, 0)
end
end
if getPlayerStorageValue(cid, 42319) < 1 then
for i = 42310, 42319 do
setPlayerStorageValue(cid, i, 0)
end
end
if getPlayerStorageValue(cid, 42329) < 1 then
for i = 42320, 42329 do
setPlayerStorageValue(cid, i, 0)
end
end
if getPlayerStorageValue(cid, 42355) == -1 then
setPlayerStorageValue(cid, 42355, 0)
end
setPlayerStorageValue(cid, 42350, 0)
setPlayerStorageValue(cid, 42352, 0)
return true
end