local boosts = {
[1] = {name = "boostEXP"},
[2] = {name = "stunReduction"},
[3] = {name = "dodge"},
[4] = {name = "magicFind"}
}
local skill_points = {
[1] = {name = "healing"},
[2] = {name = "spellDamage"},
[3] = {name = "defence"}
}
local acts = {
[1] = {name = "Act I"},
[2] = {name = "Act II"},
[3] = {name = "Act III"},
[4] = {name = "Act IV"},
[5] = {name = "Act V"}
}
local heritage = {
[0] = {name = "Lack of"},
[1] = {name = "Elvish"},
[2] = {name = "Orcish"},
[3] = {name = "Someother"}
}
function onLogin(player)
plyr = Player(player)
if not plyr then return false end
local text = ""
local HERIT = heritage[getPlayerHeritage(plyr)]
local guild = "needs fixed"
local rank = "This part too"
local equipment_boost = "N/A"
if plyr:getSex() == 1 then
text = text.." He has a "..HERIT.name.." heritage.\n"
text = text.."He belongs to the guild ["..guild.."] with the ranking ["..rank.."]\n"
else
text = text.." She has a "..heritage.." heritage.\n"
text = text.."She belongs to the guild ["..guild.."] with the ranking ["..rank.."]\n"
end
text = text.."Equipment Boost:"..equipment_boost..""
local count = 0
for i = 1, #skill_points do
if getPlayerSkillPoints(plyr, skill_points[i].name) > 0 then
if count == 0 then
text = text.."\nSkill points: ["..getPlayerSkillPoints(plyr, skill_points[i].name).." "..skill_points[i].name.."] "
count = count + 1
else
text = text.."["..getPlayerSkillPoints(plyr, skill_points[i].name).." "..skill_points[i].name.."] "
end
end
end
local count2 = 0
for i = 1, #boosts do
if getPlayerBoosts(plyr, boosts[i].name) > 0 then
if count2 == 0 then
text = text.."\nBoosts: ["..getPlayerBoosts(plyr, boosts[i].name).." "..boosts[i].name.."] "
count2 = count2 + 1
else
text = text.."["..getPlayerBoosts(plyr, boosts[i].name).." "..boost[i].name.."]"
end
end
end
local count3 = 0
for i = 1, #acts do
if getPlayerActCompletion(plyr, acts[i].name) > 0 then
if count3 == 0 then
text = text.."\nAct completions: ["..getPlayerActCompletion(plyr, acts[i].name).." "..acts[i].name.."] "
count3 = count3 + 1
else
text = text.."["..getPlayerActCompletion(plyr, acts[i].name).." "..acts[i].name.."]"
end
end
end
description = string.format("%s", description, text)
return true
end
function getPlayerSkillPoints(player, skillType)
local resultr, ret = db.storeQuery("SELECT `"..skillType.."` FROM `players` WHERE `id` = "..player:getAccountId()..";")
ret = result.getDataInt(resultr,skillType)
result.free(resultr)
return ret
end
function getPlayerBoosts(player, boostType)
local resultr, ret = db.storeQuery("SELECT `"..boostType.."` FROM `players` WHERE `id` = "..player:getAccountId()..";")
ret = result.getDataInt(resultr,bostType)
result.free(resultr)
return ret
end
function getPlayerHeritage(player)
local resultr, ret = db.storeQuery("SELECT `heritage` FROM `players` WHERE `id` = "..player:getAccountId()..";")
ret = result.getDataInt(resultr,"heritage")
result.free(resultr)
return ret
end
function getPlayerActCompletion(player, act)
local resultr, ret = db.storeQuery("SELECT `"..act.."` FROM `players` WHERE `id` = "..player:getAccountId()..";")
ret = result.getDataInt(resultr,act)
result.free(resultr)
return ret
end