DR
sistema

Sistema de Atribuição de Pontos - By Draky Lucas

Por drakylucas, 12 de abr. de 2013 em Mods, funções e outros

script
5.0 (2)
34
9.5k
felipemuniz2013F
27 de dezembro de 2013 às 19:30

lucas tem como adaptar pro pokemon?

2 meses depois...
llucas75L
05 de fevereiro de 2014 às 16:37

Aqui esta dando um erro no login.lua!

Quando logo algum char aparece essa mensagem!!

[05/02/2014 16:34:45] Pedra has logged in.
[05/02/2014 16:34:45] [Error - CreatureScript Interface]
[05/02/2014 16:34:45] data/creaturescripts/scripts/login.lua:onLogin
[05/02/2014 16:34:45] Description:
[05/02/2014 16:34:45] data/creaturescripts/scripts/login.lua:56: attempt to index global 'storagesUtilizadas' (a nil value)
[05/02/2014 16:34:45] stack traceback:
[05/02/2014 16:34:45] data/creaturescripts/scripts/login.lua:56: in function <data/creaturescripts/scripts/login.lua:5>
[05/02/2014 16:34:45] Pedra has logged out.
Tibia 8.60!!
Meu login Lua VV
Sabe resolver??(se resolver é meu rep do dia :))

 

local config = {
loginMessage = getConfigValue('loginMessage')
}

function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end

local Subwat = getPlayerAccountManager(cid)
if(Subwat == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Seu ultimo login foi " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
str = str .. "The BEST"
doPlayerSendOutfitWindow(cid)
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(Subwat == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appearss that your character has been namelocked, what would you like as your new name?")
elseif(Subwat == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Ola, digite 'account' acessar sua conta ou digite 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Ola, digite 'account' Para criar uma conta no servidor ou 'recover' Para recuperar conta perdida.")
end

if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Bem vindo!")
registerCreatureEvent(cid, "Mail")
if getPlayerLevel(cid) < 717217 then
registerCreatureEvent(cid, "AdvanceTeleport")
end
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "Idle")
registerCreatureEvent(cid, "DeathBroadcast")
registerCreatureEvent(cid, "addons")
registerCreatureEvent(cid, "onPrepareDeath")
registerCreatureEvent(cid, "magebomb")
registerCreatureEvent(cid, "SkullCheck")
registerCreatureEvent(cid, "SkullAmulet")
registerCreatureEvent(cid, "killitem")
registerCreatureEvent(cid, "zombieevent")
registerCreatureEvent(cid, "huntdeath")
registerCreatureEvent(cid, "loguthunt")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "PointSystem")
registerCreatureEvent(cid, "AmoebaTask")
-- attribute system by draky lucas
if getPlayerStorageValue(cid,storagesUtilizadas.storageLevelJaPego) == -1 then
for i = storagesUtilizadas.storageLevelJaPego,storagesUtilizadas.storageMana do
setPlayerStorageValue(cid,i,0)
end
end
registerCreatureEvent(cid,"avancarGanharPontos")
--
return true
end

 

IncurI
05 de fevereiro de 2014 às 17:11

Adicione isso:

  local storagesUtilizadas = {
   storageLevelJaPego = 12448,
   storagePontos = 12449,
   storageFistPoints = 12450,
   storageClubPoints = 12451,
   storageSwordPoints = 12452,
   storageAxePoints = 12453,
   storageDistancePoints = 12454,
   storageShieldingPoints = 12455,
   storageMagicPoints = 12456,
   storageVitalityPoints = 12457,
   storageManaPoints = 12458,
   storageFist = 12459,
   storageClub = 12460,
   storageSword = 12461,
   storageAxe = 12462,
   storageDistance = 12463,
   storageShielding = 12464,
   storageMagic = 12465,
   storageVitality = 12466,
   storageMana = 12467,
  }

no começo do arquivo.. antes do "local config = {

loginMessage = getConfigValue('loginMessage')

}"

llucas75L
05 de fevereiro de 2014 às 18:14

Agora está logando, só que quando eu digo /atributos age como se não fosse um comando e da essa mensagem no console do server :

 

[05/02/2014 18:12:47] [Error - TalkAction Interface]

[05/02/2014 18:12:47] data/talkactions/scripts/drakylucas/atributos.lua:onSay

[05/02/2014 18:12:47] Description:

[05/02/2014 18:12:47] data/talkactions/scripts/drakylucas/atributos.lua:8: attempt to call global 'getPontos' (a nil value)

[05/02/2014 18:12:47] stack traceback:

[05/02/2014 18:12:47] data/talkactions/scripts/drakylucas/atributos.lua:8: in function <data/talkactions/scripts/drakylucas/atributos.lua:1>

 

Meu atributos.lua do talkactions VV

 

 

function onSay(cid, words, param)

local param = param:lower()

local op = string.explode(param, ",")

local text = ""

if param == nil or (op[1] ~= "reset" and op[1] ~= "add" and op[1] ~= "build") then

 

text = text ..

"Pontos: " .. getPontos(cid) ..

"\nSua vocação ganha: " .. vocationPoints[getPlayerVocation(cid)] .. " pontos por level" ..

"\n\nNome - Precisa - Ganha -- Para sua voc"

for i, x in pairs(skills) do

if isInArray(x.vocationNeeded,getPlayerVocation(cid)) then

text = text .. "\n"..i.. " - " ..x.neededPoints.. " - " .. x.quantoGanha .. ""

end

end

text = text .. "\n\nExemplos:\n/atributos add,mana\n/atributos add,vitality"

text = text .. "\nVoce pode resetar seus atributos: Digite /atributos reset (custa " .. resetPreco.."k)\nVeja sua build: /atributos build"

return doShowTextDialog(cid, 1976, text)

end

 

if op[1] == "reset" then

if getCreatureCondition(cid, CONDITION_INFIGHT) == true then

return doPlayerSendCancel(cid,"Voce tem que estar sem battle para resetar seus atributos")

end

 

if getPlayerMoney(cid) < (resetPreco*1000) then

return doPlayerSendCancel(cid,"Voce nao tem dinheiro suficiente para resetar seus atributos!")

end

 

doPlayerRemoveMoney(cid, resetPreco*1000)

return resetPontos(cid)

end

 

if op[1] == "add" then

if skills[op[2]] == nil then

return doPlayerSendTextMessage(cid,19,"atributo nao existente. Verifique sua ortografia!")

end

doPlayerSendTextMessage(cid,19,addSkill(cid,skills[op[2]].id,skills[op[2]].neededPoints,skills[op[2]].quantoGanha,skills[op[2]].vocationNeeded))

return true

end

 

if op[1] == "build" then

local atuais = {

hp = (getPlayerStorageValue(cid,storagesUtilizadas.storageVitality)),

mp = (getPlayerStorageValue(cid,storagesUtilizadas.storageMana)),

magic = (getPlayerStorageValue(cid,storagesUtilizadas.storageMagic)),

fist = (getPlayerStorageValue(cid,storagesUtilizadas.storageFist)),

club = (getPlayerStorageValue(cid,storagesUtilizadas.storageClub)),

sword = (getPlayerStorageValue(cid,storagesUtilizadas.storageSword)),

axe = (getPlayerStorageValue(cid,storagesUtilizadas.storageAxe)),

dist = (getPlayerStorageValue(cid,storagesUtilizadas.storageDistance)),

shield = (getPlayerStorageValue(cid,storagesUtilizadas.storageShielding)),

}

text = "Quantidades de atributos ja recebidos: \n" ..

"Vitality: "..atuais.hp.." \n" ..

"Mana: "..atuais.mp.." \n" ..

"Magic: "..atuais.magic.." \n" ..

"Fist: "..atuais.fist.." \n" ..

"Club: "..atuais.club.." \n" ..

"Sword: "..atuais.sword.." \n" ..

"Axe: "..atuais.axe.." \n" ..

"Distance: "..atuais.dist.." \n" ..

"Shielding: "..atuais.shield.." \n" ..

"Pontos restantes: " .. getPontos(cid)

 

doShowTextDialog(cid, 1976, text)

return true

end

return true

end

 

 

 

 

Resolvidooooo:(instalação mal feita, nao passei direito arquivo atributos.lua da lib pra lib :)) SO 1 bug quando evoluo ml upa so ate 99%

Editado Fevereiro 7 por llucas75