Ir para conteúdo

zipter98

Membro
  • Registro em

  • Última visita

Tudo que zipter98 postou

  1. zipter98 postou uma resposta no tópico em Suporte Tibia OTServer
    Qual a base que você está utilizando? PDA?
  2. Este servidor possui alguma função que altere o nome do monstro/summon in-game?
  3. Posta o codigo da funcao getPlayerDesc (data/lib/some functions.lua, se nao me engano).
  4. Qual base voce esta utilizando?
  5. Na verdade, eu fiz a minha versao, e o Suicide fez a dele. A que me refiro e a unica que enviei. Ela arredonda tanto para baixo quanto para cima (nao fiz nada a respeito quanto a numeros decimais pois era apenas um rascunho demonstrativo).
  6. zipter98 postou uma resposta no tópico em Suporte Tibia OTServer
    O math.random estava retornando apenas o ultimo elemento da tabela, ou um outro elemento distinto? De qualquer maneira, aplique o math.random da seguinte maneira e veja se o erro persiste: roupas[math.random(1, #roupas)]
  7. A que eu mandei no skype arredonda pra baixo tambem.
  8. No seu servidor ha algum script com callback onKill que esteja funcionando? E, abaixo de function onKill(cid, target), coloque a seguinte linha, para confirmarmos se o script esta pelo menos sendo executado: print("script sendo executado")Informe se a mensagem acima e imprimida no console.
  9. Estranho, eu havia testado meu codigo e ele funcionou perfeitamente. Voce o instalou corretamente? Se sim, remova a seguinte parte do script e relate se ele continua nao funcional: and isMonster(target)
  10. Talkaction: Tag: <talkaction words="/eventbag;/bag;/enceventbag" event="script" value="nome_do_arquivo.lua"/> Código: local config = { tp = { pos = {x = x, y = y, z = z}, --Onde o teleporte será criado. toPos = {x = x, y = y, z = z}, --Para onde jogador será teleportado ao usar o comando /bag. tpId = 1328, --Id do teleporte. aid = 91801, }, storages = { event_storage = 8591, storage = 9591, }, groupId = 6, --Group ID mínimo para abrir o evento. } function onSay(cid, words) if words == "/eventbag" then if getPlayerGroupId(cid) < config.groupId then return false elseif getGlobalStorageValue(config.storages.event_storage) > -1 then return doPlayerSendCancel(cid, "The event is already openned.") end setGlobalStorageValue(config.storages.event_storage, 1) local item = doCreateItem(config.tp.tpId, 1, config.tp.pos) doItemSetAttribute(item, "aid", config.tp.aid) broadcastMessage("The bag event is open! You can enter only 1 time, then good luck!") elseif words == "/bag" then if getPlayerStorageValue(cid, config.storages.storage) > -1 then return doPlayerSendCancel(cid, "You already got into the event.") elseif getGlobalStorageValue(config.storages.event_storage) < 1 then return doPlayerSendCancel(cid, "The event isn't open.") end doPlayerSendTextMessage(cid, 27, "You were teleported to the event.") doTeleportThing(cid, config.tp.toPos) setPlayerStorageValue(cid, config.storages.storage, 1) elseif words == "/enceventbag" then if getPlayerGroupId(cid) < config.groupId then return false elseif getGlobalStorageValue(config.storages.event_storage) < 1 then return doPlayerSendCancel(cid, "The event isn't open.") end local teleport = getTileItemById(config.tp.pos, config.tp.tpId).uid if teleport and teleport > 0 then doRemoveItem(teleport) end for _, pid in pairs(getPlayersOnline()) do if getPlayerStorageValue(pid, config.storages.storage) > -1 then setPlayerStorageValue(pid, config.storages.storage, -1) end end db.executeQuery("UPDATE player_storage SET value = -1 WHERE key = "..config.storages.storage.." AND value > -1") setGlobalStorageValue(config.storages.event_storage, -1) broadcastMessage("The bag event is closed!") end return true end Movement: Tag: <movevent type="StepIn" actionid="91801" event="script" value="nome_do_arquivo.lua"/> Código: local config = { toPos = {x = x, y = y, z = z}, --Para onde o teleporte levará. event_storage = 8591, storage = 9591, } function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return true elseif getGlobalStorageValue(config.event_storage) < 1 then return doPlayerSendCancel(cid, "The event is closed.") and doTeleportThing(cid, fromPosition) elseif getPlayerStorageValue(cid, config.storage) > -1 then return doPlayerSendCancel(cid, "You can't go to the event.") and doTeleportThing(cid, fromPosition) end doTeleportThing(cid, config.toPos) doPlayerSendTextMessage(cid, 27, "You were teleported to the event.") setPlayerStorageValue(cid, config.storage, 1) return true end
  11. ^ local config = { chance = 10, -- chance de acontecer effect = 11, -- efeito ao acontecer message = "DOUBLE", -- e mensagem color = 120, -- cor da mensagem storage = 1010, -- storage usada } function onCombat(cid, target) registerCreatureEvent(target, "DoubleAttack") return true end function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS and isPlayer(attacker) then if getPlayerStorageValue(cid, config.storage) == 1 then if math.random(100) <= config.chance then addEvent(function() if isCreature(attacker) and isCreature(cid) then doTargetCombatHealth(attacker, cid, type, -value, -value, config.effect) doSendAnimatedText(getThingPos(cid), config.message, config.color) end end, 100) end end end return true end
  12. ^ Zeto é o mesmo cara que fez um tópico recrutando mapper pra pxg. Como aquele tópico era verídico, muito provavelmente esse também é.
  13. O erro estava na cor da mensagem. Script alterado e testado. Basta substituir seu código antigo pelo novo, encontrado no meu comentário anterior. PS: A cor da mensagem é laranja.
  14. Dafuq? @script O erro está sendo causado pois você não possui a função getItemNameById(itemid). Use este script: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local config = { storage = 9671, items = { --[vocation_id] = {itemid, count}, [1] = {2160, 100}, --Exemplo. }, } if msgcontains(msg:lower(), "reward") then if getPlayerStorageValue(cid, config.storage) > -1 then selfSay("You already got your reward.", cid) return true elseif not config.items[getPlayerVocation(cid)] then selfSay("No rewards for your vocation.", cid) return true end local item, count = config.items[getPlayerVocation(cid)][1], config.items[getPlayerVocation(cid)][2] setPlayerStorageValue(cid, config.storage, 1) doPlayerAddItem(cid, item, count) selfSay("You received {"..count.."x} "..getItemInfo(item).name..(count > 1 and "s" or "")..".", cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  15. Ué, que estranho. Apenas para confirmar uma coisa, coloque, abaixo de: if #getCreatureSummons(cid) > 0 then --Linha 293. isso: print(#getCreatureSummons(cid)) E poste o que for imprimido no console.
  16. Calma aí, se o jogador for Volcanic e digitar o comando, aparece a mensagem [Clan] Você nao tem Clan!? Se for isso, basta mudar: if getPlayerStorageValue(cid, 86228) == 1 then return doPlayerSendTextMessage(cid, 27, "[Clan] Você nao tem Clan!") end para: if getPlayerStorageValue(cid, 86228) < 1 then return doPlayerSendTextMessage(cid, 27, "[Clan] Você nao tem Clan!") end Já que o valor da storage 86228 referente ao clan Volcanic é 1, a checagem de o jogador ter ou não clan está sendo feita de maneira errada.
  17. Testei o script aqui e funcionou perfeitamente. Aparece algum erro no console? E você pode postar seu código configurado?
  18. Faz o seguinte: acima de: local levels = ta[(getPlayerStorageValue(cid, 862281) + 1)] coloca: print(getPlayerStorageValue(cid, 862281)) E envia o que for imprimido na distro. Ah, também coloca isso: if getPlayerStorageValue(cid, 86228) == 1 then return doPlayerSendTextMessage(cid, 27, "[Clan] Você nao tem Clan!") end acima disso: if param == "" then return doPlayerSendTextMessage(cid, 19, "[Clan] Digita o Numero ex: !rankclan 1!") end
  19. data/talkactions/scripts
  20. Talvez o problema do debug seja na cor da mensagem (acho MUITO improvável, mas é sempre bom testar). Troque todos os: doPlayerSendTextMessage(cid,22, por: doPlayerSendTextMessage(cid, 27, E veja se o erro continua.
  21. local config = { storage = 9017, model = "%s [%d]: %s", --Modelo da mensagem. Está configurado para ser o seguinte -> nome_do_jogador [level]: mensagem id = xxx, --ID do canal (você pode conferi-lo em data/XML/channels.xml). groupId = 4, --A partir de qual group id a mensagem aparecerá no canal configurado acima. exhaust = 30, --Tempo para enviar outra mensagem. Se não quiser que tenha exhaust, basta colocar false. } local function getModsOnline() local mods = {} for _, cid in pairs(getPlayersOnline()) do if getPlayerGroupId(cid) >= config.groupId then table.insert(mods, cid) end end return #mods > 0 and mods or false end function onSay(cid, words, param) if config.exhaust and getPlayerStorageValue(cid, config.storage) > os.time() then return doPlayerSendCancel(cid, "Wait "..getPlayerStorageValue(cid, config.storage) - os.time().." second(s) to use this command again.") elseif not getModsOnline() then return doPlayerSendCancel(cid, "Unfortunately, there's no mods online at the moment.") end local msg = config.model:format(getCreatureName(cid), getPlayerLevel(cid), param) for i = 1, #getModsOnline() do local mod = getModsOnline()[i] doPlayerSendChannelMessage(mod, "", msg, TALKTYPE_CHANNEL_O, config.id) end if config.exhaust then setPlayerStorageValue(cid, config.storage, os.time() + config.exhaust) end return true end
  22. Se não se importa, fiz minha própria versão do código: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local config = { storage = 9671, items = { --[vocation_id] = {itemid, count}, [1] = {2160, 100}, --Exemplo. }, } if msgcontains(msg:lower(), "reward") then if getPlayerStorageValue(cid, config.storage) > -1 then selfSay("You already got your reward.", cid) return true elseif not config.items[getPlayerVocation(cid)] then selfSay("No rewards for your vocation.", cid) return true end local item, count = config.items[getPlayerVocation(cid)][1], config.items[getPlayerVocation(cid)][2] setPlayerStorageValue(cid, config.storage, 1) doPlayerAddItem(cid, item, count) selfSay("You received {"..count.."x} "..getItemNameById(item)..(count > 1 and "s" or "")..".", cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  23. ^ function onDeath(cid, corpse, deathList) if not isPlayer(cid) then return true end local killer = deathList[1] if isMonster(killer) then doBroadcastMessage(getCreatureName(cid).." [Level: "..getPlayerLevel(cid).."] foi morto pelo monstro "..getCreatureName(killer).."." , MESSAGE_STATUS_CONSOLE_RED) elseif isPlayer(killer) then doBroadcastMessage(getCreatureName(cid).." [Level: "..getPlayerLevel(cid).."] foi morto por "..getCreatureName(killer).." [Level: "..getPlayerLevel(killer).."].", MESSAGE_STATUS_CONSOLE_RED) end return true end
  24. Mude para este:
  25. Tags: <event type="kill" name="alootGold" script="getgold.lua"/> <event type="login" name="alootLogin" event="script" value="getgold.lua"/> Código: local gold = 2170 --ID do gold coin. function getGold(cid, target, pos) local count = 0 local items = {} if not isPlayer(cid) then return true end for i = getTileInfo(pos).items, 1, -1 do pos.stackpos = i table.insert(items, getThingFromPos(pos)) end if #items == 0 then return true end local corpse = -1 for _, item in ipairs(items) do local name = getItemName(item.uid):lower() if name:find(target:lower()) then corpse = item.uid break end end if not isContainer(corpse) then return true end for i = 0, getContainerSize(corpse) - 1 do local item = getContainerItem(corpse, i) if item.itemid == gold then count = item.type doRemoveItem(item.uid) break end end if count ~= 0 then local player_gold = getPlayerItemCount(cid, gold) local soma = count + player_gold if soma <= 100 then doPlayerRemoveItem(cid, gold, player_gold) doPlayerAddItem(cid, gold, soma) else local s = soma - 100 doPlayerRemoveItem(cid, gold, player_gold) doPlayerAddItem(cid, gold, s) doPlayerAddItem(cid, gold, 100) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Looted "..count.." "..getItemNameById(gold)..(count > 1 and "s" or "")..".") end end function onKill(cid, target) if isPlayer(cid) and isMonster(target) then addEvent(getGold, 5, cid, getCreatureName(target), getThingPos(target)) end return true end function onLogin(cid) registerCreatureEvent(cid, "alootGold") return true end

Informação Importante

Confirmação de Termo