Algumas coisas que podem ajudar:
local totalArmor = 0
local maxDamage = 0
local skillByWeapon = nil
local function getItemArmor(uid)
if type(uid) == 'number' then
return getItemAttribute(uid,'armor')
else
return getItemInfo(uid.itemid).armor
end
end
end
local function isArmor(uid) -- Function by Mock the bear.
if (getItemInfo(uid.itemid).armor ~= 0) and (getItemWeaponType(uid.uid) == 0) then
return true
end
return false
end
local function isWeapon(uid) -- Function by Mock the bear.
uid = uid or 0
local f = getItemWeaponType(uid)
if f == 1 or f == 2 or f == 3 then
return true
end
return false
end
local function isShield(uid) -- Function by Mock the bear.
uid = uid or 0
if getItemWeaponType(uid) == 4 then
return true
end
return false
end
local function isBow(uid) -- Function by Mock the bear.
uid = uid or 0
if getItemWeaponType(uid) == 5 then
return true
end
return false
end
local function isWand(uid) -- Function by Uissu.
uid = uid or 0
if getItemWeaponType(uid) == 6 then
return true
end
return false
end
for x=CONST_SLOT_FIRST,CONST_SLOT_LAST do
item = getPlayerSlotItem(cid, x)
if item.itemid > 0 then
if isArmor(item.uid) then
totalArmor = totalArmor + getItemArmor(item.uid)
elseif isWeapon(item.uid) then
w = getItemWeaponType(item.uid)
skillByWeapon = w == 1 and CONST_SKILL_SWORD or w == 2 and CONST_SKILL_CLUB or w == 3 and CONST_SKILL_AXE or nil
baseAttack = getItemInfo(item.itemid).attack
totalDefense = totalDefense + getItemInfo(item.itemid).defense
elseif isShield(item.uid) then
totalDefense = totalDefense + getItemInfo(item.itemid).defense
end
end
end
if skillByWeapon ~= nil then
maxDamage = baseAttack + (baseAttack*5/100*skillByWeapon) -- segundo um site que eu pesquisei ai
end
armorProtection = totalArmor..'%'
local attackSpeed = getVocationInfo(getPlayerVocation(cid)).attackspeed/1000 -- em segundos.
local walkSpeed = getCreatureBaseSpeed(cid)..'(+'..getCreatureSpeed(cid)-getCreatureBaseSpeed(cid)..')'
local text = '
-- Informaçoes gerais do seu personagem --\n
Proteçao da armadura: '..armorProtection..'\n
Defesa maxima: '..totalDefense..'\n
Dano maximo (fisico): '..maxDamage..'\n
Velocidade de ataque: '..attackSpeed..' (em segundos)\n
Velocidade de movimento: '..walkSpeed..'\n
Honra: em construçao.\n
Patente: nao tenho nem ideia.\n
Dinheiro no banco: '..getPlayerBalance(cid)..'\n
Dinheiro total: '..getPlayerBalance(cid)+getPlayerMoney(cid)..'\n
Sua guild nao esta em guerra (nao existe um script, so coloquei por colocar)\n\n'
doSendTextDialog(cid, getItemIdByName('spellbook'), text)
Nao garanto que nada funcione, mas to dando uma base.
Ex: Colaborador de Scripting
Contato: bepokemon@hotmail.com