Ir para conteúdo

Wakon

Héroi
  • Registro em

  • Última visita

Solutions

  1. Wakon's post in (Resolvido)Promotion para free accounts!(King Tbianus) was marked as the answer   
    Tenta assim:


  2. Wakon's post in (Resolvido)Clicar no item trocar vocation was marked as the answer   
    Aqui está:
    local t = { checkStorage = 0092, -- Não altere mesmo que faça outro script para outra vocation!!! vocStorage = 0091, -- Mesma coisa da checkStorage. maxLevel = 10, -- Level máximo para usar. table = { [2456] = {voc = 6}, [2457] = {voc = 7}, [2458] = {voc = 8} }, } function onUse(cid, item) for k, v in pairs(t.table) do if item.itemid == k then if getPlayerLevel(cid) <= t.maxLevel then doPlayerSetVocation(cid, v.voc) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua vocação foi alterada para ".. (getVocationInfo(v.voc).name) ..".") setPlayerStorageValue(cid, t.vocStorage, v.voc) setPlayerStorageValue(cid, t.checkStorage, 1) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_GREEN) doRemoveItem(item.uid, 1) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Apenas jogadores com level inferior a ".. t.maxLevel .." podem utilizar este item.") end end end return true end <action itemid="2456;2457;2458" event="script" value="changeVoc.lua"/> Adicione os itens no script e na tag, como no exemplo.
    O creaturescripts, use o mesmo!
  3. Wakon's post in (Resolvido)NPC Travel TFS 1.0 was marked as the answer   
    Tenta assim:
    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 local cfg = { toPos = {x=964, y=1025, z=14}, level = 1, Storage = 25747, temploPos = {x = 444, y = 444, z = 7} } function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local player = Player(cid) if msgcontains(msg, 'bosses') then selfSay('There are some undead below, you agree to be teleported there?', cid) talkState[talkUser] = 1 elseif talkState[talkUser] == 1 then if msgcontains(msg, 'yes') then if player:getStorageValue(cfg.Storage) > 0 then selfSay('You\'ve done it.', cid) return FALSE end if getPlayerLevel(cid) >= cfg.level then doTeleportThing(cid, cfg.toPos) talkState[talkUser] = 0 else selfSay('Only players level ' ..cfg.level.. ' can pass.', cid) end end if msgcontains(msg, 'no') and talkState[talkUser] == 1 then selfSay('Okay, you\'re a smart and probably know the face of danger that exists there.', cid) talkState[talkUser] = 0 end elseif msgcontains(msg, 'back') then doTeleportThing(cid, cfg.temploPos) end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  4. Wakon's post in (Resolvido)ESTOU COM ESSE ERRO NO SCRIPT was marked as the answer   
    Quase todas as funções estão erradas, arrumei as funções, testa ai:



  5. Wakon's post in (Resolvido)Ajuda nesse NPC was marked as the answer   
    Fiz um aqui pra você, veja se lhe serve:
    local t = { storage = 60080, -- Storage. reward = {5908, 1}, -- Reward e quantia. (Só funciona com agrupavel!) ineed = {5944, 2} -- Item necessário e quantia. } 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 msg = msg:lower(); local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'help') then if getPlayerStorageValue(cid, t.storage) <= 0 then selfSay('Meu irmao que se perdeu, pode encontra-lo e trazer alguma informaçao para mim?', cid) talkState[talkUser] = 1 elseif getPlayerStorageValue(cid, t.storage) == 2 then selfSay('Obrigado, mas você já me ajudou.', cid) elseif getPlayerStorageValue(cid, t.storage) == 1 then selfSay('Voce trouxe alguma informaçao dele?', cid) talkState[talkUser] = 2 end elseif msgcontains(msg, 'yes') then if talkState[talkUser] == 1 then selfSay('Obrigada, você estará fazendo um grande favor.', cid) setPlayerStorageValue(cid, t.storage, 1) talkState[talkUser] = 0 elseif talkState[talkUser] == 2 then if getPlayerStorageValue(cid, t.storage) == 1 then if doPlayerRemoveItem(cid, t.ineed[1], t.ineed[2]) then selfSay('Obrigado, ja fazia ideia de que isso iria acontecer. Pegue isso em forma de gratidao!', cid) doPlayerAddItem(cid, t.reward[1], t.reward[2]) setPlayerStorageValue(cid, t.storage, 2) talkState[talkUser] = 0 else selfSay('Você não tem nada sobre meu irmão, não brinque comigo!', cid) talkState[talkUser] = 0 end else selfSay('Obrigado, mas você já me ajudou.', cid) talkState[talkUser] = 0 end end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  6. Wakon's post in (Resolvido){Pedido} Tile para castle24h was marked as the answer   
    Testei agora e está funcionando:
    function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return true end local g_storage = getGlobalStorageValue(123123) if g_storage ~= getPlayerGuildId(cid) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você foi teleportado ao templo, parece que outra guild dominou o castelo.") end end Se der problema, avise.
  7. Wakon's post in (Resolvido)[DUVIDA] TÍTULO DO CLIENTE OTSERVER was marked as the answer   
    Baixe o XVI32 e siga os passos abaixo.
    1 - Clique em File>Open... e seleciona o seu cliente.
    2 - Aperte CTRL+F, selecione Text string e digite "Tibia".
    3 - Aperte a tecla Insert do teclado e digite por cima da palavra o nome do seu servidor, o título pode ter no máximo 7 letras.
     
    Você pode ir alterando e procurando o certo, faça o processo, salve e teste, caso não funcione basta digitar Tibia no lugar.
    Lembre-se, não delete NADA com backspace, se quiser deixar algo em branco, utilizando a tecla Insert aperte a barra de espaço.
  8. Wakon's post in (Resolvido)Onde mudo o locar que o player aparece enquanto esta criando conta was marked as the answer   
    Abre sua database, vá em Players, selecione o account manager e altere a posição dele.

    O tópico foi movido para a área correta, preste mais atenção da próxima vez!
    Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680

    Este tópico foi movido:
    De: "OTServ → Scripting → Geral"
    Para: "OTServ → Suporte OTServ → Suporte de OTServ Geral"
  9. Wakon's post in (Resolvido)NPC para entrega de itens was marked as the answer   
    Não está muito bom, mas acho que vai lhe servir.
    Em "Data/npc/scripts", anciao.lua:



    Em "Data/npc", anciao.xml:
    <?xml version="1.0" encoding="UTF-8"?> <npc name="Anciao" script="data/npc/scripts/anciao.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="309" head="57" body="59" legs="40" feet="76" addons="0"/> <parameters> <parameter key="message_greet" value="Olá |PLAYERNAME|. Em que posso lhe ajudar?"/> </parameters> </npc>
  10. Wakon's post in (Resolvido)Sistema !b com a mesma função de /b pagando 100K p/ players was marked as the answer   
    Em "Data/talkactions/scripts", broadcastPlayer.lua:
    local t = { coolDown = 5, -- Tempo para usar novamente em minutos. storage = 59555, -- Só mexa se necessário. level = 100, -- Level necessário. price = 100000 -- Preço para usar. } function onSay(cid, words, param) local message = getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param if param == '' then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite sua mensagem.") return true end if getPlayerStorageValue(cid, t.storage) - os.time() >= 1 then doPlayerSendCancel(cid, "Você precisa esperar ".. math.ceil((getPlayerStorageValue(cid, t.storage) - os.time())/60) .." minuto(s) para usar novamente.") return true end if getPlayerLevel(cid) >= t.level then if doPlayerRemoveMoney(cid, t.price) then setPlayerStorageValue(cid, t.storage, t.coolDown * 60 + os.time()) doBroadcastMessage(message, MESSAGE_EVENT_ADVANCE) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Mensagem enviada..") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa de ".. t.price .." gold coins para utilizar este comando.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa ser level ".. t.level .." para utilizar este comando.") end return true end Em "Data/talkactions", no arquivo talkactions.xml:
    <talkaction words="!message" event="script" value="broadcastPlayer.lua"/> Caso dê algum problema, me avise.
  11. Wakon's post in (Resolvido)Script Puxe All - Narutiba 8.54 was marked as the answer   
    Em "Data/globalevents/scripts", pushAll.lua:
    local t = { timePush = "15:30", msg = "Todos os players foram puxados á sala.", pos = {x = 160, y = 54, z = 7} } function onThink(interval, lastExecution) hours = tostring(os.date("%X")):sub(1, 5) for _, pid in ipairs(getPlayersOnline()) do if hours == t.timePush then doTeleportThing(pid, t.pos) doBroadcastMessage(t.msg) end end return true end Em "Data/globalevents", no arquivo globalevents.xml:
    <globalevent name="pushAll" interval="60" event="script" value="pushAll.lua"/> Caso dê bug e fique executando varias vezes, altere o interval para 60000.
  12. Wakon's post in (Resolvido)Como colocar potion infinito 10.76 was marked as the answer   
    Vai em "Data/actions/scripts/others", abre o arquivo potions.lua e remove as linhas:
    Item(item.uid):remove(1) doPlayerAddItem(cid,potion.emptyId, 1)
  13. Wakon's post in (Resolvido)Como Fazer Evento Boss was marked as the answer   
    Em "Data/talkactions/scripts", bossEvent.lua:
    local t = { msgActive = "Preparem-se ninjas de Konoha, Gakure está vindo para destruir a vila de Konoha.", msgSpawn = "Rapido ninjas, o boss está na frente do templo, protejam a vila.", coolDown = 5, -- Tempo para nascer após usar o comando. boss = "rat", -- Nome do boss. pos = {x = 157, y = 58, z = 7} -- Posição em que o boss irá nascer. } function onSay(cid, words) local function summonBoss() doSendMagicEffect(t.pos, CONST_ME_TELEPORT) doCreateMonster(t.boss, t.pos) doBroadcastMessage(t.msgSpawn) end doBroadcastMessage(t.msgActive) addEvent(summonBoss, t.coolDown * 60) return true end Em "Data/talkactions", no arquivo talkactions.xml:
    <talkaction log="yes" words="/bossevent" access="5" event="script" value="bossEvent.lua"/>
  14. Wakon's post in (Resolvido)Como Criar Evento Por Comando was marked as the answer   
    Em "Data/talkactions/scripts", copie dois arquivos.lua e renomei-os para enterevent.lua e openevent.lua, apague tudo neles e cole:
    No arquivo enterevent.lua:
    local t = { gStorage = 25252, -- Só mexa se necessário. msgoff = "O evento de backpack não está aberto no momento.", -- Mensagem caso não esteja aberto. effect = CONST_ME_TELEPORT, -- Efeito ao teleportar. pos = {x = 160, y = 54, z = 7} -- Posição que o comando irá levar. } function onSay(cid, words, param) if getGlobalStorageValue(t.gStorage) >= 1 then if getCreatureCondition(cid, CONDITION_INFIGHT) == false then if getTilePzInfo(getPlayerPosition(cid)) == true then doTeleportThing(cid, t.pos) doSendMagicEffect(getPlayerPosition(cid), t.effect) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Vá até uma zona de proteção para usar o comando.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode usar o comando em batalha.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, t.msgoff) end return true end No arquivo openevent.lua:
    local t = { gStorage = 25252, msgoff = "O evento de backpack terminou.", msg = "O evento backpack foi aberto, para entrar digite !evento em uma zona de proteção!" } function onSay(cid, words, param) if param == nil then return doPlayerSendCancel(cid, "Commands param required.") end if param == "open" then if getGlobalStorageValue(t.gStorage) <= 0 then setGlobalStorageValue(t.gStorage, 1) doBroadcastMessage(t.msg) else doPlayerSendCancel(cid, "O evento já está aberto.") end elseif param == "close" then if getGlobalStorageValue(t.gStorage) >= 1 then setGlobalStorageValue(t.gStorage, 0) doBroadcastMessage(t.msgoff) else doPlayerSendCancel(cid, "O evento não está aberto.") end end return true end Agora em "Data/talkactions", abra o arquivo talkactions.xml e adicione:
    <talkaction words="!evento" event="script" value="enterevent.lua"/> <talkaction log="yes" words="/event" access="5" event="script" value="openevent.lua"/> Comandos: /event open | /event close | !evento
     

    O tópico foi movido para a área correta, preste mais atenção da próxima vez!
    Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680

    Este tópico foi movido:
    De: "OTServ → Scripting → Tutoriais de Scripting"
    Para: "OTServ → Suporte OTServ → Suporte de Scripts"
  15. Wakon's post in (Resolvido)[Pedido] NPC que vende itens em troca de diamond Poketibia was marked as the answer   
    Em "Data/npc/scripts", arquivo.lua:


    Em "Data/npc", nome_do_npc.xml:
    Está configurado para Tibia, mas basta você modificar os id's/nomes ao seu gosto!
     
    Créditos: Adriano SwaTT
  16. Wakon's post in (Resolvido)NPC teleportar player was marked as the answer   
    Em "Data/npc/scripts", monge.lua:
    local t = { pos = {x = 160, y = 57, z = 7}, keys = {"travel", "sail", "teleport"} } 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 msg = msg:lower(); local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if isInArray(t.keys, msg) then selfSay("Deseja ir até LOCAL?", cid) talkState[talkUser] = 1 elseif msgcontains(msg, "yes") then if talkState[talkUser] == 1 then doTeleportThing(cid, t.pos) end elseif msgcontains(msg, "no") then if talkState[talkUser] == 1 then selfSay('Ok, até mais.', cid) talkState[talkUser] = 0 end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Em "Data/npc", monge.xml:
    <?xml version="1.0" encoding="UTF-8"?> <npc name="Monge" script="data/npc/scripts/traveltwo.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="300" head="57" body="59" legs="40" feet="76" addons="0"/> <parameters> <parameter key="message_greet" value="Olá |PLAYERNAME|. Posso te levar até LOCAL, diga {travel}."/> </parameters> </npc>
  17. Wakon's post in (Resolvido)Problema com Dat Editor (Sprites que e exportada n abri) was marked as the answer   
    Usa o Object Builder é bem mais fácil de mexer e tem menos chances de dar erros.
  18. Wakon's post in (Resolvido)Problema com servidor was marked as the answer   
    "Se for TFS 1.x, já mudou o account type para 5?"
  19. Wakon's post in (Resolvido)(Ajuda) Mudar mensagem was marked as the answer   
    doBroadcastMessage não funciona com "cid", teria que ser doPlayerBroadcastMessage e acho que não dá para colocar no default com broadcast.
     
    Veja se é assim que você quer:
    function onUse(cid, item) local price = 1000000 -- Preço do item local it = 7435 -- ID do item local count = 1 -- Quantia do item if not doPlayerRemoveMoney(cid, price) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa ter (1kk) para comprar "..count.."x "..getItemNameById(it)..".") return true end doPlayerAddItem(cid, it, count) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você comprou "..count.."x "..getItemNameById(it).." por 1kk.") return true end
  20. Wakon's post in (Resolvido)Aviso se está com bless ou não was marked as the answer   
    http://www.tibiaking.com/forum/topic/60016-tfs-04036-aviso-de-bless-ao-sair-da-zona-de-prote%C3%A7%C3%A3o/
  21. Wakon's post in (Resolvido)Runa não funciona was marked as the answer   
    Script:
    local healMana = {25000, 30000} local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE) setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, TRUE) function onCastSpell(cid, var) doCreatureAddMana(cid, math.random(healMana[1], healMana[2])) doCreatureSay(cid,"Aaaah...", TALKTYPE_ORANGE_1) return doCombat(cid, combat, var) end  TAG:
    <rune name="Mana Rune" id="2276" allowfaruse="1" charges="1" lvl="15000" maglv="1" exhaustion="1000" aggressive="0" needtarget="1" blocktype="solid" event="script" value="healing/WR.lua"/>
  22. Wakon's post in (Resolvido)Quando o pokemon morre n abre portal was marked as the answer   
    Em "Data/creaturescripts/scripts", copie e cole um arquivo.lua e renomeie para deathTP.lua, apague tudo e cole:
    local t = { tpId = 1387, -- ID do teleport. tpNew = {x = 1057, y = 1057, z = 7}, -- Local onde irá aparecer o teleport. tpPos = {x = 1059, y = 1059, z = 7}, -- Local para onde o teleport irá levar. monster = "rattata", -- Nome do monstro(pokémon/normal), coloque em letra minúscula. timeRemove = 5 -- Tempo para remover o teleport em segundos. } function onKill(cid, target) local function removeTeleport(position) position.stackpos = 1 if (getThingfromPos(position).itemid == t.tpId) then doRemoveItem(getThingfromPos(position).uid) doSendMagicEffect(t.tpNew, 13) end return true end if (ehMonstro(target) and string.lower(getCreatureName(target)) == t.monster) then doCreateTeleport(t.tpId, t.tpPos, t.tpNew) doCreatureSay(target, "Você tem ".. t.timeRemove .." segundos para entrar no teleport.", TALKTYPE_ORANGE_1, 0, 0, t.tpNew) addEvent(removeTeleport, t.timeRemove * 1000, t.tpNew) end return true end Agora em "Data/creaturescripts", abra o arquivo creaturescripts.xml e adicione a tag:
    <event type="kill" name="deathTP" script="deathTP.lua"/> Novamente em "Data/creaturescripts/scripts", abra o arquivo login.lua e registre:
    registerCreatureEvent(cid, "deathTP")   Configure ao seu gosto, se der algum problema, me avise!
  23. Wakon's post in (Resolvido)[AJUDA] Script capreset was marked as the answer   
    local t = { level = 10, pz = true, battle = true } function onSay(cid, words) if t.pz == true and getTilePzInfo(getCreaturePosition(cid)) == false then doPlayerSendCancel(cid, "Você não pode usar fora da zona de proteção.") return true end if t.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == true then doPlayerSendCancel(cid, "Você não pode utilizar em batalha.") return true end if getPlayerLevel(cid) >= t.level then doPlayerSetMaxCapacity(cid, 1000) doRemoveCreature(cid) else doPlayerSendCancel(cid, "Você não pode utilizar este comando!") end return true end
  24. Wakon's post in (Resolvido)Script que mude o ID do item was marked as the answer   
    Siga esse tutorial:http://www.tibiaking.com/forum/topic/15337-criando-dois-items-com-a-mesma-sprite/
    E sim, pode entrar normalmente com o cliente padrão do Tibia, irá mudar o ID mas irá usar a mesma sprite, então não tem problema .
     

    O tópico foi movido para a área correta, preste mais atenção da próxima vez!
    Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680

    Este tópico foi movido:
    De: "OTServ → Suporte OTServ → Suporte de Scripts"
    Para: "OTServ → Suporte OTServ → Suporte de OTServ Geral"
  25. Wakon's post in (Resolvido)[Ajuda]Talkaction parecida com /goto was marked as the answer   
    Olha, fiz um novo aqui pra você ( se não se importar ), testei ele aqui na base de testes e está normal conforme meus testes, caso apresente algum erro, me avise!
    http://hastebin.com/etegodexun.coffee
     
    Troquei as config para testar, ai você altera do jeito que você quiser .

Informação Importante

Confirmação de Termo