Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Galera TK,

 

Estou com um problema na minha distro conforme abaixo;

 

58b426dd92039_Semttulo.png.368623603f3e809554cb94ce2d49224e.png

 

Bom, conforme o erro, o item "1747" é uma chest conforme a imagem abaixo;

 

58b429398cd5a_Semttulo2.png.b4d83aa5beab0b269c890715d8177675.png

 

action/actions.xml

    <action fromaid="30009" toaid="30011" script="quests/system.lua"/>

 

actions/scripts/quests

 

local specialQuests = {

	[30002] = 30002, --Annih

	[30009] = 1010, --Svargrond

	[30010] = 1011, --Svargrond

	[30011] = 1012, --Svargrond

	[30039] = 1022,

	[31248] = 1079 --Dreamer Challenge Quest

}



local quests = {

	[31286] = {storageKey = 2012, storageValue = 2}, -- Postman mission 8

	[31287] = {storageKey = 2013, storageValue = 2}, -- Postman mission 9

	[31289] = {storageKey = 2009, storageValue = 2} -- Postman mission 5

}



function onUse(player, item, fromPosition, target, toPosition, isHotkey)

	local storage = specialQuests[item.actionid]

	if not storage then

		storage = item.uid

		if storage > 65535 then

			return false

		end

	end



	if player:getStorageValue(storage) > 0 then

		player:sendTextMessage(MESSAGE_INFO_DESCR, 'The ' .. ItemType(item.itemid):getName() .. ' is empty.')

		return true

	end



	local targetItem = item

	local items = {}

	local reward = nil



	local size = targetItem:isContainer() and Container(item.uid):getSize() or 0

	if size == 0 then

		reward = targetItem:clone()

	else

		local container = Container(item.uid)

		for i = 0, container:getSize() - 1 do

			items[#items + 1] = container:getItem(i):clone()

		end

	end



	size = #items

	if size == 1 then

		reward = items[1]:clone()

	end



	local result = ''

	local weight = 0

	if reward then

		local ret = ItemType(reward:getId())

		if ret:isRune() then

			result = ret:getArticle() .. ' ' ..  ret:getName() .. ' (' .. reward:getSubType() .. ' charges)'

		elseif ret:isStackable() and reward:getCount() > 1 then

			result = reward:getCount() .. ' ' .. ret:getPluralName()

		else

			result = ret:getArticle() .. ' ' .. ret:getName()

		end

		weight = weight + ret:getWeight(reward:getCount())

	else

		if size > 20 then

			reward = Game.createItem(item.itemid, 1)

		elseif size > 8 then

			reward = Game.createItem(1988, 1)

		else

			reward = Game.createItem(1987, 1)

		end



		for i = 1, size do

			local tmp = items[i]

			if reward:addItemEx(tmp) ~= RETURNVALUE_NOERROR then

				print('[Warning] QuestSystem:', 'Could not add quest reward to container')

			else

				local ret = ', '

				if i == size then

					ret = ' and '

				elseif i == 1 then

					ret = ''

				end

				result = result .. ret



				local ret = ItemType(tmp:getId())

				if ret:isRune() then

					result = result .. ret:getArticle() .. ' ' .. ret:getName() .. ' (' .. tmp:getSubType() .. ' charges)'

				elseif ret:isStackable() and tmp:getCount() > 1 then

					result = result .. tmp:getCount() .. ' ' .. ret:getPluralName()

				else

					result = result .. ret:getArticle() .. ' ' .. ret:getName()

				end

				weight = weight + ret:getWeight(tmp:getCount())

			end

		end

		weight = weight + ItemType(reward:getId()):getWeight()

	end



	if player:addItemEx(reward) ~= RETURNVALUE_NOERROR then

		local weight = reward:getWeight()

		if player:getFreeCapacity() < weight then

			player:sendCancelMessage(string.format('You have found %s weighing %.2f oz. You have no capacity.', result, (weight / 100)))

		else

			player:sendCancelMessage('You have found ' .. result .. ', but you have no room to take it.')

		end

		return true

	end



	local targetTable = quests[item.uid]

	if targetTable then

		player:setStorageValue(targetTable.storageKey, targetTable.storageValue)

	end			 



	player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found ' .. result .. '.')

	player:setStorageValue(storage, 1)

	return true

end

 

 

 

 

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por Jaurez
      .
    • Por Cat
      Em alguns casos, o tibia 8.60 comum não abre de jeito nenhum no map editor, mesmo desmarcando check file signatures e configurando o path corretamente.
       
      Este é o client 8.60 adaptado para o Remere's Map Editor. Resolvi postar já que ele foi removido do site oficial do RME. (ficou apenas a versão para linux lá)
      Se estiver tendo problemas para abrir a versão 8.60, tente utilizar este.
                                                                                                                     
      Baixar o Tibia Client 8.60 que funciona no Remere’s Map Editor
      Essa versão do Tibia 8.60 client resolve o erro unsupported client version ou Could not locate tibia.dat and/or tibia.spr, please navigate to your tibia 8.60 installation folder.
       
      Downloads
      https://tibiaking.com/applications/core/interface/file/attachment.php?id=47333

      Scan: https://www.virustotal.com/gui/file/333e172ac49ba2028db9eb5889994509e7d2de28ebccfa428c04e86defbe15cc
       
    • Por danilo belato
      Fala Galera To Com um problema aki 
       
      quero exporta umas sprites de um server para colocar em outro 
       
      eu clico na sprites ai aparece tds a forma delas do lado de la >>
       
      ai eu clico nela e ponho a opiçao de export mais quando salvo a sprite ela n abri 
       
      aparece isso quando tento vê-la 
       
      visualização não disponível ( no formatos png e bitmap)
       
      Agora no formato idc fala que o paint n pode ler 
       
      me ajudem ae...
    • Por Vitor Bicaleto
      Galera to com o script do addon doll aqui, quando eu digito apenas "!addon" ele aparece assim: Digite novamente, algo está errado!"
      quando digito por exemplo: "!addon citizen" ele não funciona e não da nenhum erro
       
      mesma coisa acontece com o mount doll.. 
    • Por Ayron5
      Substitui uma stone no serve, deu tudo certo fora  esse  erro ajudem  Valendo  Rep+  Grato  

      Erro: data/actions/scripts/boost.lua:557: table index is nil
       [Warning - Event::loadScript] Cannot load script (data/actions/scripts/boost.lua)

      Script:
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo