Postado Novembro 26, 2018 6 anos @edustyle local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function doChangeWeapon(cid, message, keywords, parameters, node) -- by vodka if(not npcHandler:isFocused(cid)) then return false end if (isPlayerPremiumCallback == nil or isPlayerPremiumCallback(cid) == true or parameters.premium == false) then if(parameters.level ~= nil and getPlayerLevel(cid) < parameters.level) then npcHandler:say('Desculpe, voce precisa ter level ' .. parameters.level .. ' ou mais para forjar este item.', cid) elseif not doRemoveItemsFromList(cid,parameters.items) then npcHandler:say('Desculpe, mas voce nao tem '..getItemsFromList(parameters.items)..' para forjar este item!', cid) else local r = parameters.chance local v = math.random(1, 100) if r > v then npcHandler:say('Sucesso! Aqui esta seu item.', cid) local iname = getItemNameById(parameters.give) doBroadcastMessage("[Sistema de Forja]\nO jogador "..getCreatureName(cid).." acabou de forjar o item "..iname..".", 22) doPlayerAddItem(cid,parameters.give,1) doSendMagicEffect(getPlayerPosition(cid), math.random(28,30)) else npcHandler:say('Desculpe, mas seu item falho na forja!', cid) doSendMagicEffect(getPlayerPosition(cid), 2) end npcHandler:resetNpc() end else npcHandler:say('Desculpe, mas apenas forjo esse item para jogadores premium account.', cid) end npcHandler:resetNpc() return true end local list = { {"broken sword", items = {{12766,100}}, item_give = 12756, chance = 100, level = 8, premium = false}, {"broken axe", items = {{12766,100}}, item_give = 12759, chance = 100, level = 8, premium = false}, {"broken club", items = {{12766,100}}, item_give = 12758, chance = 100, level = 8, premium = false}, {"broken staff", items = {{12766,100}}, item_give = 12757, chance = 100, level = 8, premium = false}, {"broken spear", items = {{12766,100}}, item_give = 12760, chance = 100, level = 8, premium = false}, {"noob sword", items = {{12756,1},{12761,100}}, item_give = 12733, chance = 100, level = 8, premium = false}, {"noob axe", items = {{12759,1},{12761,100}}, item_give = 12731, chance = 100, level = 8, premium = false}, {"noob club", items = {{12758,1},{12761,100}}, item_give = 12732, chance = 100, level = 8, premium = false}, {"noob staff", items = {{12757,1},{12761,100}}, item_give = 12734, chance = 100, level = 8, premium = false}, {"noob star", items = {{12760,1},{12761,100}}, item_give = 12735, chance = 100, level = 8, premium = false}, {"elite sword", items = {{12733,1},{12762,200}}, item_give = 12728, chance = 100, level = 8, premium = false}, {"elite axe", items = {{12731,1},{12762,200}}, item_give = 12726, chance = 100, level = 8, premium = false}, {"elite club", items = {{12732,1},{12762,200}}, item_give = 12727, chance = 100, level = 8, premium = false}, {"elite staff", items = {{12734,1},{12762,200}}, item_give = 12729, chance = 100, level = 8, premium = false}, {"elite star", items = {{12735,1},{12762,200}}, item_give = 12730, chance = 100, level = 8, premium = false}, {"epic sword", items = {{12728,1},{12763,300}}, item_give = 12723, chance = 100, level = 8, premium = false}, {"epic axe", items = {{12726,1},{12763,300}}, item_give = 12721, chance = 100, level = 8, premium = false}, {"epic club", items = {{12727,1},{12763,300}}, item_give = 12722, chance = 100, level = 8, premium = false}, {"epic staff", items = {{12729,1},{12763,300}}, item_give = 12724, chance = 100, level = 8, premium = false}, {"epic crossbow", items = {{12730,1},{12763,300}}, item_give = 12725, chance = 100, level = 8, premium = false}, {"legendary sword", items = {{12723,1},{12764,400}}, item_give = 12718, chance = 100, level = 8, premium = false}, {"legendary axe", items = {{12721,1},{12764,400}}, item_give = 12716, chance = 100, level = 8, premium = false}, {"legendary club", items = {{12722,1},{12764,400}}, item_give = 12717, chance = 100, level = 8, premium = false}, {"legendary staff", items = {{12724,1},{12764,400}}, item_give = 12719, chance = 100, level = 8, premium = false}, {"legendary crossbow", items = {{12725,1},{12764,400}}, item_give = 12720, chance = 100, level = 8, premium = false}, {"ultimate sword", items = {{12718,1},{12765,500}}, item_give = 12668, chance = 100, level = 8, premium = false}, {"ultimate axe", items = {{12716,1},{12765,500}}, item_give = 12666, chance = 100, level = 8, premium = false}, {"ultimate club", items = {{12717,1},{12765,500}}, item_give = 12667, chance = 100, level = 8, premium = false}, {"ultimate staff", items = {{12719,1},{12765,500}}, item_give = 12669, chance = 100, level = 8, premium = false}, {"ultimate crossbow", items = {{12720,1},{12765,500}}, item_give = 12670, chance = 100, level = 8, premium = false}, {"itens", text = "Eu posso forjar alguns itens como: {broken sword},{broken axe},{broken club},{broken staff},{broken spear},{noob sword},{noob axe},{noob club},{noob staff},{noob star},{elite sword},{elite axe},{elite club},{elite staff},{elite star},{epic sword},{epic axe},{epic club},{epic staff},{epic crossbow},{legendary sword},{legendary axe},{legendary club},{legendary staff},{legendary crossbow},{ultimate sword},{ultimate axe},{ultimate club},{ultimate staff} ou {ultimate crossbow}!"} } for i = 1, #list do local get = list if type(get.items) == "table" then local node = keywordHandler:addKeyword({get[1]}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Para forjar o item " .. get[1] .. " e necessario "..getItemsFromList(get.items)..". Voce tem tudo isso para me dar?"}) node:addChildKeyword({"yes"}, doChangeWeapon, {items = get.items, give = get.item_give, chance = get.chance, level = get.level, premium = get.premium}) node:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "tudo bem entao.", reset = true}) else keywordHandler:addKeyword({get[1]}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = get.text}) end end mounts = nil npcHandler:addModule(FocusModule:new())
Postado Novembro 26, 2018 6 anos Autor 13 minutos atrás, DukeeH disse: @edustyle local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function doChangeWeapon(cid, message, keywords, parameters, node) -- by vodka if(not npcHandler:isFocused(cid)) then return false end if (isPlayerPremiumCallback == nil or isPlayerPremiumCallback(cid) == true or parameters.premium == false) then if(parameters.level ~= nil and getPlayerLevel(cid) < parameters.level) then npcHandler:say('Desculpe, voce precisa ter level ' .. parameters.level .. ' ou mais para forjar este item.', cid) elseif not doRemoveItemsFromList(cid,parameters.items) then npcHandler:say('Desculpe, mas voce nao tem '..getItemsFromList(parameters.items)..' para forjar este item!', cid) else local r = parameters.chance local v = math.random(1, 100) if r > v then npcHandler:say('Sucesso! Aqui esta seu item.', cid) local iname = getItemNameById(parameters.give) doBroadcastMessage("[Sistema de Forja]\nO jogador "..getCreatureName(cid).." acabou de forjar o item "..iname..".", 22) doPlayerAddItem(cid,parameters.give,1) doSendMagicEffect(getPlayerPosition(cid), math.random(28,30)) else npcHandler:say('Desculpe, mas seu item falho na forja!', cid) doSendMagicEffect(getPlayerPosition(cid), 2) end npcHandler:resetNpc() end else npcHandler:say('Desculpe, mas apenas forjo esse item para jogadores premium account.', cid) end npcHandler:resetNpc() return true end local list = { {"broken sword", items = {{12766,100}}, item_give = 12756, chance = 100, level = 8, premium = false}, {"broken axe", items = {{12766,100}}, item_give = 12759, chance = 100, level = 8, premium = false}, {"broken club", items = {{12766,100}}, item_give = 12758, chance = 100, level = 8, premium = false}, {"broken staff", items = {{12766,100}}, item_give = 12757, chance = 100, level = 8, premium = false}, {"broken spear", items = {{12766,100}}, item_give = 12760, chance = 100, level = 8, premium = false}, {"noob sword", items = {{12756,1},{12761,100}}, item_give = 12733, chance = 100, level = 8, premium = false}, {"noob axe", items = {{12759,1},{12761,100}}, item_give = 12731, chance = 100, level = 8, premium = false}, {"noob club", items = {{12758,1},{12761,100}}, item_give = 12732, chance = 100, level = 8, premium = false}, {"noob staff", items = {{12757,1},{12761,100}}, item_give = 12734, chance = 100, level = 8, premium = false}, {"noob star", items = {{12760,1},{12761,100}}, item_give = 12735, chance = 100, level = 8, premium = false}, {"elite sword", items = {{12733,1},{12762,200}}, item_give = 12728, chance = 100, level = 8, premium = false}, {"elite axe", items = {{12731,1},{12762,200}}, item_give = 12726, chance = 100, level = 8, premium = false}, {"elite club", items = {{12732,1},{12762,200}}, item_give = 12727, chance = 100, level = 8, premium = false}, {"elite staff", items = {{12734,1},{12762,200}}, item_give = 12729, chance = 100, level = 8, premium = false}, {"elite star", items = {{12735,1},{12762,200}}, item_give = 12730, chance = 100, level = 8, premium = false}, {"epic sword", items = {{12728,1},{12763,300}}, item_give = 12723, chance = 100, level = 8, premium = false}, {"epic axe", items = {{12726,1},{12763,300}}, item_give = 12721, chance = 100, level = 8, premium = false}, {"epic club", items = {{12727,1},{12763,300}}, item_give = 12722, chance = 100, level = 8, premium = false}, {"epic staff", items = {{12729,1},{12763,300}}, item_give = 12724, chance = 100, level = 8, premium = false}, {"epic crossbow", items = {{12730,1},{12763,300}}, item_give = 12725, chance = 100, level = 8, premium = false}, {"legendary sword", items = {{12723,1},{12764,400}}, item_give = 12718, chance = 100, level = 8, premium = false}, {"legendary axe", items = {{12721,1},{12764,400}}, item_give = 12716, chance = 100, level = 8, premium = false}, {"legendary club", items = {{12722,1},{12764,400}}, item_give = 12717, chance = 100, level = 8, premium = false}, {"legendary staff", items = {{12724,1},{12764,400}}, item_give = 12719, chance = 100, level = 8, premium = false}, {"legendary crossbow", items = {{12725,1},{12764,400}}, item_give = 12720, chance = 100, level = 8, premium = false}, {"ultimate sword", items = {{12718,1},{12765,500}}, item_give = 12668, chance = 100, level = 8, premium = false}, {"ultimate axe", items = {{12716,1},{12765,500}}, item_give = 12666, chance = 100, level = 8, premium = false}, {"ultimate club", items = {{12717,1},{12765,500}}, item_give = 12667, chance = 100, level = 8, premium = false}, {"ultimate staff", items = {{12719,1},{12765,500}}, item_give = 12669, chance = 100, level = 8, premium = false}, {"ultimate crossbow", items = {{12720,1},{12765,500}}, item_give = 12670, chance = 100, level = 8, premium = false}, {"itens", text = "Eu posso forjar alguns itens como: {broken sword},{broken axe},{broken club},{broken staff},{broken spear},{noob sword},{noob axe},{noob club},{noob staff},{noob star},{elite sword},{elite axe},{elite club},{elite staff},{elite star},{epic sword},{epic axe},{epic club},{epic staff},{epic crossbow},{legendary sword},{legendary axe},{legendary club},{legendary staff},{legendary crossbow},{ultimate sword},{ultimate axe},{ultimate club},{ultimate staff} ou {ultimate crossbow}!"} } for i = 1, #list do local get = list if type(get.items) == "table" then local node = keywordHandler:addKeyword({get[1]}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Para forjar o item " .. get[1] .. " e necessario "..getItemsFromList(get.items)..". Voce tem tudo isso para me dar?"}) node:addChildKeyword({"yes"}, doChangeWeapon, {items = get.items, give = get.item_give, chance = get.chance, level = get.level, premium = get.premium}) node:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "tudo bem entao.", reset = true}) else keywordHandler:addKeyword({get[1]}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = get.text}) end end mounts = nil npcHandler:addModule(FocusModule:new()) Agora quando falo itens com o NPC da o seguinte erro: OBS: A script estava funcionando 100% só falta a parte do broadcast. Tem noção do que pode ser? 2 minutos atrás, edustyle disse: Agora quando falo itens com o NPC da o seguinte erro: OBS: A script estava funcionando 100% só falta a parte do broadcast. Tem noção do que pode ser? Consegui resolver faltava um lá no final!! deu certo. REP!!!
Postado Novembro 26, 2018 6 anos 6 minutos atrás, edustyle disse: Agora quando falo itens com o NPC da o seguinte erro: OBS: A script estava funcionando 100% só falta a parte do broadcast. Tem noção do que pode ser? Consegui resolver faltava um lá no final!! deu certo. REP!!! Se quiser trocar pra vermelho no centro da tela, tira o ,22 no final da linha.
Postado Novembro 26, 2018 6 anos Autor 23 minutos atrás, DukeeH disse: @edustyle local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function doChangeWeapon(cid, message, keywords, parameters, node) -- by vodka if(not npcHandler:isFocused(cid)) then return false end if (isPlayerPremiumCallback == nil or isPlayerPremiumCallback(cid) == true or parameters.premium == false) then if(parameters.level ~= nil and getPlayerLevel(cid) < parameters.level) then npcHandler:say('Desculpe, voce precisa ter level ' .. parameters.level .. ' ou mais para forjar este item.', cid) elseif not doRemoveItemsFromList(cid,parameters.items) then npcHandler:say('Desculpe, mas voce nao tem '..getItemsFromList(parameters.items)..' para forjar este item!', cid) else local r = parameters.chance local v = math.random(1, 100) if r > v then npcHandler:say('Sucesso! Aqui esta seu item.', cid) local iname = getItemNameById(parameters.give) doBroadcastMessage("[Sistema de Forja]\nO jogador "..getCreatureName(cid).." acabou de forjar o item "..iname..".", 22) doPlayerAddItem(cid,parameters.give,1) doSendMagicEffect(getPlayerPosition(cid), math.random(28,30)) else npcHandler:say('Desculpe, mas seu item falho na forja!', cid) doSendMagicEffect(getPlayerPosition(cid), 2) end npcHandler:resetNpc() end else npcHandler:say('Desculpe, mas apenas forjo esse item para jogadores premium account.', cid) end npcHandler:resetNpc() return true end local list = { {"broken sword", items = {{12766,100}}, item_give = 12756, chance = 100, level = 8, premium = false}, {"broken axe", items = {{12766,100}}, item_give = 12759, chance = 100, level = 8, premium = false}, {"broken club", items = {{12766,100}}, item_give = 12758, chance = 100, level = 8, premium = false}, {"broken staff", items = {{12766,100}}, item_give = 12757, chance = 100, level = 8, premium = false}, {"broken spear", items = {{12766,100}}, item_give = 12760, chance = 100, level = 8, premium = false}, {"noob sword", items = {{12756,1},{12761,100}}, item_give = 12733, chance = 100, level = 8, premium = false}, {"noob axe", items = {{12759,1},{12761,100}}, item_give = 12731, chance = 100, level = 8, premium = false}, {"noob club", items = {{12758,1},{12761,100}}, item_give = 12732, chance = 100, level = 8, premium = false}, {"noob staff", items = {{12757,1},{12761,100}}, item_give = 12734, chance = 100, level = 8, premium = false}, {"noob star", items = {{12760,1},{12761,100}}, item_give = 12735, chance = 100, level = 8, premium = false}, {"elite sword", items = {{12733,1},{12762,200}}, item_give = 12728, chance = 100, level = 8, premium = false}, {"elite axe", items = {{12731,1},{12762,200}}, item_give = 12726, chance = 100, level = 8, premium = false}, {"elite club", items = {{12732,1},{12762,200}}, item_give = 12727, chance = 100, level = 8, premium = false}, {"elite staff", items = {{12734,1},{12762,200}}, item_give = 12729, chance = 100, level = 8, premium = false}, {"elite star", items = {{12735,1},{12762,200}}, item_give = 12730, chance = 100, level = 8, premium = false}, {"epic sword", items = {{12728,1},{12763,300}}, item_give = 12723, chance = 100, level = 8, premium = false}, {"epic axe", items = {{12726,1},{12763,300}}, item_give = 12721, chance = 100, level = 8, premium = false}, {"epic club", items = {{12727,1},{12763,300}}, item_give = 12722, chance = 100, level = 8, premium = false}, {"epic staff", items = {{12729,1},{12763,300}}, item_give = 12724, chance = 100, level = 8, premium = false}, {"epic crossbow", items = {{12730,1},{12763,300}}, item_give = 12725, chance = 100, level = 8, premium = false}, {"legendary sword", items = {{12723,1},{12764,400}}, item_give = 12718, chance = 100, level = 8, premium = false}, {"legendary axe", items = {{12721,1},{12764,400}}, item_give = 12716, chance = 100, level = 8, premium = false}, {"legendary club", items = {{12722,1},{12764,400}}, item_give = 12717, chance = 100, level = 8, premium = false}, {"legendary staff", items = {{12724,1},{12764,400}}, item_give = 12719, chance = 100, level = 8, premium = false}, {"legendary crossbow", items = {{12725,1},{12764,400}}, item_give = 12720, chance = 100, level = 8, premium = false}, {"ultimate sword", items = {{12718,1},{12765,500}}, item_give = 12668, chance = 100, level = 8, premium = false}, {"ultimate axe", items = {{12716,1},{12765,500}}, item_give = 12666, chance = 100, level = 8, premium = false}, {"ultimate club", items = {{12717,1},{12765,500}}, item_give = 12667, chance = 100, level = 8, premium = false}, {"ultimate staff", items = {{12719,1},{12765,500}}, item_give = 12669, chance = 100, level = 8, premium = false}, {"ultimate crossbow", items = {{12720,1},{12765,500}}, item_give = 12670, chance = 100, level = 8, premium = false}, {"itens", text = "Eu posso forjar alguns itens como: {broken sword},{broken axe},{broken club},{broken staff},{broken spear},{noob sword},{noob axe},{noob club},{noob staff},{noob star},{elite sword},{elite axe},{elite club},{elite staff},{elite star},{epic sword},{epic axe},{epic club},{epic staff},{epic crossbow},{legendary sword},{legendary axe},{legendary club},{legendary staff},{legendary crossbow},{ultimate sword},{ultimate axe},{ultimate club},{ultimate staff} ou {ultimate crossbow}!"} } for i = 1, #list do local get = list if type(get.items) == "table" then local node = keywordHandler:addKeyword({get[1]}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Para forjar o item " .. get[1] .. " e necessario "..getItemsFromList(get.items)..". Voce tem tudo isso para me dar?"}) node:addChildKeyword({"yes"}, doChangeWeapon, {items = get.items, give = get.item_give, chance = get.chance, level = get.level, premium = get.premium}) node:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "tudo bem entao.", reset = true}) else keywordHandler:addKeyword({get[1]}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = get.text}) end end mounts = nil npcHandler:addModule(FocusModule:new()) Duke, a mensagem fica no meio da tela em branco, é dificil colocar ela no topo em vermelho?? Para não atrapalhar a jogabilidade??
Postado Novembro 27, 2018 6 anos Solução 4 horas atrás, edustyle disse: Duke, a mensagem fica no meio da tela em branco, é dificil colocar ela no topo em vermelho?? Para não atrapalhar a jogabilidade?? Topo em vermelho não é uma opção, só centro da tela em vermelho, pois são usados os tipos de broadcast do tibia, como eu falei no post acima, pra deixar em vermelho, tira o ,12 no final da linha. Mas infelizmente não é possível mudar a posição, apenas cor/estilo.
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.