local loginMessage = getConfigValue('loginMessage')
local exhaust = createConditionObject(CONDITION_INFIGHT)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 5000)
local t = {
voc = {
{ -- SORC
{2190}, -- wand of vortex
{2175}, -- spellbook
{8820}, -- mage hat
{8819} -- mage robe
},
{ -- DRUID
{2182}, -- snakebite rod
{2175}, -- spellbook
{8820}, -- mage hat
{8819} -- mage robe
},
{ -- PALADIN
{2389}, -- spear
{2530}, -- copper shield
{2457}, -- legion helmet
{2660} -- chain armor
},
{ -- KNIGHT
{2409}, -- serpent sword
{2530}, -- copper shield
{2457}, -- legion helmet
{2465} -- chain armor
}
},
all = {
{2478}, -- brass legs
{2643} -- leather boots
},
extra = {
{2789, 15},
{2160, 2},
{2120},
{5710}
},
knight = {
{2429}, -- clerical mace
{2423} -- barbarian axe
}
}
function onLogin(cid)
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 100)
doAddCondition(cid, exhaust)
if isPlayerGhost(cid) == false then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
local lastLogin, str = getPlayerLastLoginSaved(cid), loginMessage
if lastLogin == 0 then
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
if getPlayerGroupId(cid) < 3 then
for _, v in ipairs(t.voc[getPlayerVocation(cid)]) do
doPlayerAddItem(cid, v[1], v[2] or 1)
end
for _, v in ipairs(t.all) do
doPlayerAddItem(cid, v[1], v[2] or 1)
end
local bp = doPlayerAddItem(cid, 1988, 1)
for _, v in ipairs(t.extra) do
doAddContainerItem(bp, v[1], v[2] or 1)
end
if isKnight(cid) then
for _, w in ipairs(t.knight) do
doAddContainerItem(bp, w[1], w[2] or 1)
end
end
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "Idle")
registerCreatureEvent(cid, "Forever Aol")
--registerCreatureEvent(cid, "pacmanhandle")
registerCreatureEvent(cid, "zombieevent")
registerCreatureEvent(cid, "DeathBroadcast")
registerCreatureEvent(cid, "buffout")
registerCreatureEvent(cid, "inquisitionPortals")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "ArenaKill")
registerCreatureEvent(cid, "reward")
registerCreatureEvent(cid, "PythiusTheRotten")
registerCreatureEvent(cid, "BossKill")
registerCreatureEvent(cid, "ArenaDeath")
registerCreatureEvent(cid, "KillingInTheNameOf")
registerCreatureEvent(cid, "pointsforlvl")
registerCreatureEvent(cid, "Elemental")
registerCreatureEvent(cid, "Antibot")
doCreatureSetStorage(cid, 50300)
doCreatureSetStorage(cid, 77700)
for i = 1, 3 do
if getCreatureStorage(cid, 42300 + i * 10 - 1) < 1 then
for j = 0, 9 do
doCreatureSetStorage(cid, 42290 + i * 10 + j)
end
end
end
doCreatureSetStorage(cid, 42350) -- time to kick 0
doCreatureSetStorage(cid, 42352) -- is not in arena
return true
end