Ir para conteúdo

Featured Replies

Postado

mudei la porem ainda sim o erro continua.. segue erro

 

 

 


[4:37:46.895] > Loading Loot Ring.xml...[Error - LuaInterface::loadBuffer] [stri
ng "LuaInterface::loadBuffer"]:56: ')' expected (to close '(' at line 55) near '
local'
[4:37:46.896] [Error - Event::checkScript] Cannot load script (local lvls = { --
 [level] = rate de drop que vai multiplicar a rate antiga.
[4:37:46.898] --[[ ╔ DE SUMA IMPORTANCIA QUE VOC╩ SEMPRE
[4:37:46.899] SIGA A ORDEM NA HORA DE CRIAR NOVOS LEVEIS.
[4:37:46.901] NADA DE COLOCAR [0], [1], E [5].
[4:37:46.902] TEM QUE SEGUIR DE 0 A 5 SEM PULAR NADA!
[4:37:46.903] ]]
[4:37:46.904]   [0] = 1,
[4:37:46.906]   [1] = 1.5,
[4:37:46.907]   [2] = 1.8,
[4:37:46.908] }

[4:37:46.910] local storage = 19456 -- storage que armazena o level do player
[4:37:46.911] local rate = getConfigInfo('rateLoot')

[4:37:46.913] function getContentDescription(uid, comma)
[4:37:46.915]   local ret, i, containers = '', 0, {}
[4:37:46.916]   while i < getContainerSize(uid) do
[4:37:46.917]           local v, s = getContainerItem(uid, i), ''
[4:37:46.919]           local k = getItemInfo(v.itemid)
[4:37:46.920]           if k.name ~= '' then
[4:37:46.921]                   if v.type > 1 and k.stackable and k.showCount th
en
[4:37:46.922]                           s = v.type .. ' ' .. getItemInfo(v.itemi
d).plural
[4:37:46.924]                   else
[4:37:46.925]                           local article = k.article
[4:37:46.926]                           s = (article == '' and '' or article ..
' ') .. k.name
[4:37:46.927]                   end
[4:37:46.928]                   ret = ret .. (i == 0 and not comma and '' or ',
') .. s
[4:37:46.930]                   if isContainer(v.uid) and getContainerSize(v.uid
) > 0 then
[4:37:46.931]                           table.insert(containers, v.uid)
[4:37:46.933]                   end
[4:37:46.934]           else
[4:37:46.935]                   ret = ret .. (i == 0 and not comma and '' or ',
') .. 'an item of type ' .. v.itemid .. ', please report it to gamemaster'
[4:37:46.937]           end
[4:37:46.938]           i = i + 1
[4:37:46.939]   end
[4:37:46.941]   for i = 1, #containers do
[4:37:46.942]           ret = ret .. getContentDescription(containers, true)
[4:37:46.943]   end
[4:37:46.944]   return ret
[4:37:46.945] end

[4:37:46.947] local function send(cid, pos, corpseid, monster, party)
[4:37:46.949]   local corpse = getTileItemById(pos, corpseid).uid
[4:37:46.950]   local ret = isContainer(corpse) and getContentDescription(corpse
)
[4:37:46.951]   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Loot of ' .. m
onster .. ': ' .. (ret ~= '' and ret or 'nothing'))
[4:37:46.953]   if party then
[4:37:46.954]           for _, pid in ipairs(getPartyMembers(party)) do
[4:37:46.956]                   doPlayerSendChannelMessage(pid, '', 'Loot of ' .
. monster .. ': ' .. (ret ~= '' and ret or 'nothing'), TALKTYPE_CHANNEL_W, CHANN
EL_PARTY)
[4:37:46.957]           end
[4:37:46.958]   end
[4:37:46.959] end

[4:37:46.961] local function createLoot(i, ext)
[4:37:46.962]   local item = type(i.id) == 'table' and i.id[math.random(#i.id)]
or i.id
[4:37:46.963]   local random = math.ceil(math.random(100000) / ((ext and lvls[ex
t]) and rate * lvls[ext] or print("algo deu muito errado, chame o lobo.\n"))
[4:37:46.965]   local tmpItem = false

[4:37:46.967]   if random < i.chance then
[4:37:46.969]           tmpItem = doCreateItemEx(item, getItemInfo(item).stackab
le and random % i.count + 1 or 1)
[4:37:46.970]   end
[4:37:46.971]   if not tmpItem then
[4:37:46.972]           return false
[4:37:46.973]   end
[4:37:46.975]   if i.subType ~= -1 then
[4:37:46.976]           doItemSetAttribute(tmpItem, 'subType', i.subType)
[4:37:46.977]   end
[4:37:46.978]   if i.actionId ~= -1 then
[4:37:46.979]           doItemSetAttribute(tmpItem, 'aid', i.actionId)
[4:37:46.981]   end
[4:37:46.983]   if i.uniqueId ~= -1 then
[4:37:46.984]           doItemSetAttribute(tmpItem, 'uid', i.uniqueId)
[4:37:46.985]   end
[4:37:46.986]   if i.text ~= '' then
[4:37:46.987]           doItemSetAttribute(tmpItem, 'text', i.text)
[4:37:46.989]   end
[4:37:46.990]   return tmpItem
[4:37:46.991] end

[4:37:46.993] local function createChildLoot(parent, i, ext)
[4:37:46.994]   if #i == 0 then
[4:37:46.996]           return true
[4:37:46.997]   end

[4:37:46.999]   local size, cap = 0, getContainerCap(parent)
[4:37:47.000]   for k = 1, #i do
[4:37:47.001]           if size == cap then
[4:37:47.003]                   break
[4:37:47.004]           end
[4:37:47.005]           local tmp = createLoot(i[k], ext)
[4:37:47.006]           if tmp then
[4:37:47.008]                   if isContainer(tmp) then
[4:37:47.009]                           if createChildLoot(tmp, i[k].child, ext)
 then
[4:37:47.010]                                   doAddContainerItemEx(parent, tmp
)
[4:37:47.011]                                   size = size + 1
[4:37:47.013]                           else
[4:37:47.014]                                   doRemoveItem(tmp)
[4:37:47.016]                           end
[4:37:47.017]                   else
[4:37:47.018]                           doAddContainerItemEx(parent, tmp)
[4:37:47.019]                           size = size + 1
[4:37:47.021]                   end
[4:37:47.022]           end
[4:37:47.023]   end

[4:37:47.025]   return size > 0
[4:37:47.026] end

[4:37:47.028] local function dropLoot(pos, v, ext)
[4:37:47.029]   local corpse = getTileItemById(pos, v.lookCorpse).uid
[4:37:47.030]   if isContainer(corpse) then
[4:37:47.032]           for i = 1, getContainerSize(corpse) do
[4:37:47.033]                   doRemoveItem(getContainerItem(corpse, 0).uid)
[4:37:47.035]           end
[4:37:47.036]           local size, cap = 0, getContainerCap(corpse)
[4:37:47.037]           for i = 1, #v.loot do
[4:37:47.038]                   if size == cap then
[4:37:47.040]                           break
[4:37:47.041]                   end
[4:37:47.042]                   local tmp = createLoot(v.loot, ext)
[4:37:47.043]                   if tmp then
[4:37:47.044]                           if isContainer(tmp) then
[4:37:47.046]                                   if createChildLoot(tmp, v.loot[i
].child, ext) then
[4:37:47.047]                                           doAddContainerItemEx(cor
pse, tmp)
[4:37:47.049]                                           size = size + 1
[4:37:47.050]                                   else
[4:37:47.051]                                           doRemoveItem(tmp)
[4:37:47.053]                                   end
[4:37:47.054]                           else
[4:37:47.055]                                   doAddContainerItemEx(corpse, tmp
)
[4:37:47.056]                                   size = size + 1
[4:37:47.057]                           end
[4:37:47.059]                   end
[4:37:47.060]           end
[4:37:47.061]   end
[4:37:47.062] end

[4:37:47.064] function onKill(cid, target, lastHit)
[4:37:47.066]   if lastHit and isMonster(target) then
[4:37:47.067]           local v = getMonsterInfo(getCreatureName(target))
[4:37:47.068]           if v.lookCorpse > 0 then
[4:37:47.070]                   local master = getCreatureMaster(target)
[4:37:47.071]                   if not master or master == target then
[4:37:47.072]                           local level = math.min(math.max(getPlaye
rStorageValue(cid, storage), 0), #lvls) -- usei essa formula pra garantir que o
storage vai estar entre 0 e o tamanho do vetor 'lvls'
[4:37:47.073]                           addEvent(dropLoot, 0, getThingPos(target
), v, level)
[4:37:47.075]                   end
[4:37:47.076]                   addEvent(send, 100, cid, getThingPos(target), v.
lookCorpse, v.description, getPlayerParty(cid))
[4:37:47.077]           end
[4:37:47.078]   end
[4:37:47.080]   return true
[4:37:47.081] end
[4:37:47.082] )
[4:37:47.084] [string "LuaInterface::loadBuffer"]:56: ')' expected (to close '('
 at line 55) near 'local'
 

 

 

e o NPC que vc falou eu não encontrei nenhum que serviu. pensei em colocar algum que venda tal storage por (premium points), removendo  os pontos diretamente da conta ou então removendo um item (Gold Bar) que em meu servidor (Gold bar = ao dar use em cada ganha 1 ponto no site)

 

se puder me ajudar amigo.

 

Editado por brufds (veja o histórico de edições)

  • Respostas 20
  • Visualizações 829
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • xWhiteWolf
    xWhiteWolf

    pro primeiro pesquisa sobre um ring que aumenta a chance de drop aqui no TK. Pro segundo, na hora de invocar o monstro edite tudo que você conseguir dele pra deixar mais forte usando as funções. As

Postado
16 hours ago, brufds said:

mudei la porem ainda sim o erro continua.. segue erro

 

  Hide contents

 


[4:37:46.895] > Loading Loot Ring.xml...[Error - LuaInterface::loadBuffer] [stri
ng "LuaInterface::loadBuffer"]:56: ')' expected (to close '(' at line 55) near '
local'
[4:37:46.896] [Error - Event::checkScript] Cannot load script (local lvls = { --
 [level] = rate de drop que vai multiplicar a rate antiga.
[4:37:46.898] --[[ ╔ DE SUMA IMPORTANCIA QUE VOC╩ SEMPRE
[4:37:46.899] SIGA A ORDEM NA HORA DE CRIAR NOVOS LEVEIS.
[4:37:46.901] NADA DE COLOCAR [0], [1], E [5].
[4:37:46.902] TEM QUE SEGUIR DE 0 A 5 SEM PULAR NADA!
[4:37:46.903] ]]
[4:37:46.904]   [0] = 1,
[4:37:46.906]   [1] = 1.5,
[4:37:46.907]   [2] = 1.8,
[4:37:46.908] }

[4:37:46.910] local storage = 19456 -- storage que armazena o level do player
[4:37:46.911] local rate = getConfigInfo('rateLoot')

[4:37:46.913] function getContentDescription(uid, comma)
[4:37:46.915]   local ret, i, containers = '', 0, {}
[4:37:46.916]   while i < getContainerSize(uid) do
[4:37:46.917]           local v, s = getContainerItem(uid, i), ''
[4:37:46.919]           local k = getItemInfo(v.itemid)
[4:37:46.920]           if k.name ~= '' then
[4:37:46.921]                   if v.type > 1 and k.stackable and k.showCount th
en
[4:37:46.922]                           s = v.type .. ' ' .. getItemInfo(v.itemi
d).plural
[4:37:46.924]                   else
[4:37:46.925]                           local article = k.article
[4:37:46.926]                           s = (article == '' and '' or article ..
' ') .. k.name
[4:37:46.927]                   end
[4:37:46.928]                   ret = ret .. (i == 0 and not comma and '' or ',
') .. s
[4:37:46.930]                   if isContainer(v.uid) and getContainerSize(v.uid
) > 0 then
[4:37:46.931]                           table.insert(containers, v.uid)
[4:37:46.933]                   end
[4:37:46.934]           else
[4:37:46.935]                   ret = ret .. (i == 0 and not comma and '' or ',
') .. 'an item of type ' .. v.itemid .. ', please report it to gamemaster'
[4:37:46.937]           end
[4:37:46.938]           i = i + 1
[4:37:46.939]   end
[4:37:46.941]   for i = 1, #containers do
[4:37:46.942]           ret = ret .. getContentDescription(containers, true)
[4:37:46.943]   end
[4:37:46.944]   return ret
[4:37:46.945] end

[4:37:46.947] local function send(cid, pos, corpseid, monster, party)
[4:37:46.949]   local corpse = getTileItemById(pos, corpseid).uid
[4:37:46.950]   local ret = isContainer(corpse) and getContentDescription(corpse
)
[4:37:46.951]   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Loot of ' .. m
onster .. ': ' .. (ret ~= '' and ret or 'nothing'))
[4:37:46.953]   if party then
[4:37:46.954]           for _, pid in ipairs(getPartyMembers(party)) do
[4:37:46.956]                   doPlayerSendChannelMessage(pid, '', 'Loot of ' .
. monster .. ': ' .. (ret ~= '' and ret or 'nothing'), TALKTYPE_CHANNEL_W, CHANN
EL_PARTY)
[4:37:46.957]           end
[4:37:46.958]   end
[4:37:46.959] end

[4:37:46.961] local function createLoot(i, ext)
[4:37:46.962]   local item = type(i.id) == 'table' and i.id[math.random(#i.id)]
or i.id
[4:37:46.963]   local random = math.ceil(math.random(100000) / ((ext and lvls[ex
t]) and rate * lvls[ext] or print("algo deu muito errado, chame o lobo.\n"))
[4:37:46.965]   local tmpItem = false

[4:37:46.967]   if random < i.chance then
[4:37:46.969]           tmpItem = doCreateItemEx(item, getItemInfo(item).stackab
le and random % i.count + 1 or 1)
[4:37:46.970]   end
[4:37:46.971]   if not tmpItem then
[4:37:46.972]           return false
[4:37:46.973]   end
[4:37:46.975]   if i.subType ~= -1 then
[4:37:46.976]           doItemSetAttribute(tmpItem, 'subType', i.subType)
[4:37:46.977]   end
[4:37:46.978]   if i.actionId ~= -1 then
[4:37:46.979]           doItemSetAttribute(tmpItem, 'aid', i.actionId)
[4:37:46.981]   end
[4:37:46.983]   if i.uniqueId ~= -1 then
[4:37:46.984]           doItemSetAttribute(tmpItem, 'uid', i.uniqueId)
[4:37:46.985]   end
[4:37:46.986]   if i.text ~= '' then
[4:37:46.987]           doItemSetAttribute(tmpItem, 'text', i.text)
[4:37:46.989]   end
[4:37:46.990]   return tmpItem
[4:37:46.991] end

[4:37:46.993] local function createChildLoot(parent, i, ext)
[4:37:46.994]   if #i == 0 then
[4:37:46.996]           return true
[4:37:46.997]   end

[4:37:46.999]   local size, cap = 0, getContainerCap(parent)
[4:37:47.000]   for k = 1, #i do
[4:37:47.001]           if size == cap then
[4:37:47.003]                   break
[4:37:47.004]           end
[4:37:47.005]           local tmp = createLoot(i[k], ext)
[4:37:47.006]           if tmp then
[4:37:47.008]                   if isContainer(tmp) then
[4:37:47.009]                           if createChildLoot(tmp, i[k].child, ext)
 then
[4:37:47.010]                                   doAddContainerItemEx(parent, tmp
)
[4:37:47.011]                                   size = size + 1
[4:37:47.013]                           else
[4:37:47.014]                                   doRemoveItem(tmp)
[4:37:47.016]                           end
[4:37:47.017]                   else
[4:37:47.018]                           doAddContainerItemEx(parent, tmp)
[4:37:47.019]                           size = size + 1
[4:37:47.021]                   end
[4:37:47.022]           end
[4:37:47.023]   end

[4:37:47.025]   return size > 0
[4:37:47.026] end

[4:37:47.028] local function dropLoot(pos, v, ext)
[4:37:47.029]   local corpse = getTileItemById(pos, v.lookCorpse).uid
[4:37:47.030]   if isContainer(corpse) then
[4:37:47.032]           for i = 1, getContainerSize(corpse) do
[4:37:47.033]                   doRemoveItem(getContainerItem(corpse, 0).uid)
[4:37:47.035]           end
[4:37:47.036]           local size, cap = 0, getContainerCap(corpse)
[4:37:47.037]           for i = 1, #v.loot do
[4:37:47.038]                   if size == cap then
[4:37:47.040]                           break
[4:37:47.041]                   end
[4:37:47.042]                   local tmp = createLoot(v.loot, ext)
[4:37:47.043]                   if tmp then
[4:37:47.044]                           if isContainer(tmp) then
[4:37:47.046]                                   if createChildLoot(tmp, v.loot[i
].child, ext) then
[4:37:47.047]                                           doAddContainerItemEx(cor
pse, tmp)
[4:37:47.049]                                           size = size + 1
[4:37:47.050]                                   else
[4:37:47.051]                                           doRemoveItem(tmp)
[4:37:47.053]                                   end
[4:37:47.054]                           else
[4:37:47.055]                                   doAddContainerItemEx(corpse, tmp
)
[4:37:47.056]                                   size = size + 1
[4:37:47.057]                           end
[4:37:47.059]                   end
[4:37:47.060]           end
[4:37:47.061]   end
[4:37:47.062] end

[4:37:47.064] function onKill(cid, target, lastHit)
[4:37:47.066]   if lastHit and isMonster(target) then
[4:37:47.067]           local v = getMonsterInfo(getCreatureName(target))
[4:37:47.068]           if v.lookCorpse > 0 then
[4:37:47.070]                   local master = getCreatureMaster(target)
[4:37:47.071]                   if not master or master == target then
[4:37:47.072]                           local level = math.min(math.max(getPlaye
rStorageValue(cid, storage), 0), #lvls) -- usei essa formula pra garantir que o
storage vai estar entre 0 e o tamanho do vetor 'lvls'
[4:37:47.073]                           addEvent(dropLoot, 0, getThingPos(target
), v, level)
[4:37:47.075]                   end
[4:37:47.076]                   addEvent(send, 100, cid, getThingPos(target), v.
lookCorpse, v.description, getPlayerParty(cid))
[4:37:47.077]           end
[4:37:47.078]   end
[4:37:47.080]   return true
[4:37:47.081] end
[4:37:47.082] )
[4:37:47.084] [string "LuaInterface::loadBuffer"]:56: ')' expected (to close '('
 at line 55) near 'local'
 

 

 

e o NPC que vc falou eu não encontrei nenhum que serviu. pensei em colocar algum que venda tal storage por (premium points), removendo  os pontos diretamente da conta ou então removendo um item (Gold Bar) que em meu servidor (Gold bar = ao dar use em cada ganha 1 ponto no site)

 

se puder me ajudar amigo.

 

local random = math.ceil(math.random(100000) / ((ext and lvls[ex
t]) and rate * lvls[ext] or print("algo deu muito errado, chame o lobo.\n"))

essa linha aqui, tá faltando um ) no final dela.

Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá!

"Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

Postado

arrumei, nao era no final era aqui

  ((ext and lvls[ext]) <<<<

 

Obrigado xWhiteWolf você é o cara, só mais uma duvida, você não poderia me ajudar com esse npc para poder vender essas storages ? por algum item ou por  points ?

não conseguir achar nenhum para encaixar... too procurando direto em vários forums. ou se for algo muito dificil e vc nao puder ajudar então ve se consegue me da uma mãozinha nesse meu outro problema aqui mano.

http://www.tibiaking.com/forum/forums/topic/80272-ao-usar-spell-erros-no-tfs/#comment-452313

Postado
2 hours ago, brufds said:

arrumei, nao era no final era aqui

  ((ext and lvls[ext]) <<<<

 

Obrigado xWhiteWolf você é o cara, só mais uma duvida, você não poderia me ajudar com esse npc para poder vender essas storages ? por algum item ou por  points ?

não conseguir achar nenhum para encaixar... too procurando direto em vários forums. ou se for algo muito dificil e vc nao puder ajudar então ve se consegue me da uma mãozinha nesse meu outro problema aqui mano.

http://www.tibiaking.com/forum/forums/topic/80272-ao-usar-spell-erros-no-tfs/#comment-452313

não cara, é realmente no final...

está assim: local random = math.ceil(math.random(100000) / ((ext and lvls[ext]) and rate * lvls[ext] or print("algo deu muito errado, chame o lobo.\n"))

tem que ficar assim:

local random = math.ceil(math.random(100000) / ((ext and lvls[ext]) and rate * lvls[ext] or print("algo deu muito errado, chame o lobo.\n")))

Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá!

"Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

Postado
Em 2017-5-10 ás 21:24, xWhiteWolf disse:

não cara, é realmente no final...

está assim: local random = math.ceil(math.random(100000) / ((ext and lvls[ext]) and rate * lvls[ext] or print("algo deu muito errado, chame o lobo.\n"))

tem que ficar assim:

local random = math.ceil(math.random(100000) / ((ext and lvls[ext]) and rate * lvls[ext] or print("algo deu muito errado, chame o lobo.\n")))

 

não, aqui quando eu coloquei do jeito que vc citou ai continuou com o mesmo erro, so arrumou quando eu mudei assim 

 

local random = math.ceil(math.random(100000) / ((ext and lvls[ext])) and rate * lvls[ext] or print("algo deu muito errado, chame o lobo.\n"))

 

sera que vai dar algum problema, se não der ta de boa... 

 

estou precisando de ajuda agora com o NPC ou com o outro post 

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo