Ir para conteúdo

Alencar123

Membro
  • Registro em

  • Última visita

Tudo que Alencar123 postou

  1. Alencar123 postou uma resposta no tópico em Suporte Tibia OTServer
    o Dano é no configuration, acredito que o efeito da spell(a imagem como você disse) deve ser editada no script em data/spells.
  2. Tenta: if getPlayerLevel(cid) <= 340 and isKnight(cid) then local tempo = 0.9 --- de quanto em quanto segundos ele solta o efeito function loop (cid) local pos = getCreaturePosition(cid) local effects = math.random (30,35) local effectPositions = { {x = pos.x, y = pos.y - 1, z = pos.z}, {x = pos.x, y = pos.y + 1, z = pos.z}, {x = pos.x - 1, y = pos.y, z = pos.z}, {x = pos.x + 1, y = pos.y, z = pos.z}, {x = pos.x - 1, y = pos.y + 1, z = pos.z}, {x = pos.x - 1, y = pos.y - 1, z = pos.z}, {x = pos.x + 1, y = pos.y - 1, z = pos.z}, {x = pos.x + 1, y = pos.y + 1, z = pos.z} } doSendMagicEffect(effectPositions[math.random(1, #effectPositions)], effects) addEvent(function() if isCreature(cid) then loop(cid) end end, 1000 * tempo) return true end loop(cid) end return true end
  3. Onde você colocou isso? E como assim upou level, esse script e pra acontecer quando o player logar. Você registrou a tag no creaturescripts.xml?
  4. Seria melhor criar 1 ou quantos arquivos.lua você quiser em data/creaturescripts/scripts Não é preciso registrar no login.lua.
  5. Manda assim as infos: armor = id botas = id etc...
  6. Explique melhor, irá ser enviada uma mensagem no default dele ou será um animated text?
  7. function onLogin(cid) local LVL = 340 -- level mínimo local VOC = 0 -- Número que define a vocação local effects = 35 ----- Efetio para a vocaçao if getPlayerLevel(cid) >= LVL and getPlayerVocation(cid) == VOC then local tempo = 0.6 --- de quanto em quanto segundos ele solta o efeito function loop (cid) local pos = getCreaturePosition(cid) local effectPositions = { {x = pos.x, y = pos.y - 1, z = pos.z}, {x = pos.x, y = pos.y + 1, z = pos.z}, {x = pos.x - 1, y = pos.y, z = pos.z}, {x = pos.x + 1, y = pos.y, z = pos.z}, {x = pos.x - 1, y = pos.y + 1, z = pos.z}, {x = pos.x - 1, y = pos.y - 1, z = pos.z}, {x = pos.x + 1, y = pos.y - 1, z = pos.z}, {x = pos.x + 1, y = pos.y + 1, z = pos.z} } doSendMagicEffect(effectPositions[math.random(1, #effectPositions)], effects) addEvent(function() if isCreature(cid) then loop(cid) end end, 1000 * tempo) return true end loop(cid) end
  8. Vai em data/xml Abre o arquivo chamado groups.xml Tira isso dos cargos que vc não quer que de ban: violationReasons="10" nameViolationFlags="2" statementViolationFlags="63" Exemplo Como está: <group id="4" name="Gamemaster" flags="3808558964575" customFlags="257215" access="3" violationReasons="19" nameViolationFlags="10" statementViolationFlags="69" depotLimit="3000" maxVips="300" outfit="295"/> Como irá ficar: <group id="4" name="Gamemaster" flags="3808558964575" customFlags="257215" access="3" depotLimit="3000" maxVips="300" outfit="295"/>
  9. Poderia postar a resolução para resolver dúvidas futuras e a do amigo ali em cima?
  10. Se não der certo tenta esse: 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 shopModule = ShopModule:new() npcHandler:addModule(shopModule) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local X = STORAGE if(msgcontains(msg, 'trade')) then if getPlayerStorageValue(cid, X) ~= 1 selfSay('Você precisar ter a storage "..X..".', cid) talkState[talkUser] = 1 else shopModule:addBuyableItem({'nome do item'}, id, quantoiragastar, 'nome do item') shopModule:addBuyableItem({'speed boots'}, 2525, 50000, 'speed boots') shopModule:addBuyableItem({'chakra boots'}, 7417, 95000, 'chakra boots') shopModule:addBuyableItem({'elite kunai'}, 2416, 610, 'elite kunai') shopModule:addBuyableItem({'taijutsu glove'}, 2380, 545, 'taijutsu glove') shopModule:addBuyableItem({'katana imperium'}, 2376, 50000, 'katana imperium') shopModule:addBuyableItem({'sound glove'}, 2435, 50000, 'sound glove') shopModule:addBuyableItem({'chakra armor'}, 2397, 5000, 'chakra armor') shopModule:addBuyableItem({'jounin armor'}, 2400, 25000, 'jounin armor') shopModule:addBuyableItem({'kankuru hat'}, 7438, 2000, 'kankuru hat') shopModule:addBuyableItem({'leaft jounin protector'}, 7427, 50000, 'leaft jounin protector') end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  11. Peguei 1 npc de nto aqui e dei uma editada, não testei e não mecho muito com npcs, acho que meu script possa estar errado. 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 local shopModule = ShopModule:new() npcHandler:addModule(shopModule) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local X = STORAGE if(msgcontains(msg, 'trade')) then if getPlayerStorageValue(cid, X) ~= 1 selfSay('Você precisar ter a storage "..X..".', cid) talkState[talkUser] = 1 else shopModule:addBuyableItem({'nome do item'}, id, quantoiragastar, 'nome do item') shopModule:addBuyableItem({'speed boots'}, 2525, 50000, 'speed boots') shopModule:addBuyableItem({'chakra boots'}, 7417, 95000, 'chakra boots') shopModule:addBuyableItem({'elite kunai'}, 2416, 610, 'elite kunai') shopModule:addBuyableItem({'taijutsu glove'}, 2380, 545, 'taijutsu glove') shopModule:addBuyableItem({'katana imperium'}, 2376, 50000, 'katana imperium') shopModule:addBuyableItem({'sound glove'}, 2435, 50000, 'sound glove') shopModule:addBuyableItem({'chakra armor'}, 2397, 5000, 'chakra armor') shopModule:addBuyableItem({'jounin armor'}, 2400, 25000, 'jounin armor') shopModule:addBuyableItem({'kankuru hat'}, 7438, 2000, 'kankuru hat') shopModule:addBuyableItem({'leaft jounin protector'}, 7427, 50000, 'leaft jounin protector') end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Editei umas 5x porque vi umas coisas erradas. '-'
  12. 1 pergunta, qual seria sua função?
  13. Coloque-o em data/creaturescripts/scripts ----------------------------------------------------------- Em data/creaturescripts Em creaturescripts.xml: <event type="death" name="Spread" event="script" value="nomedoarquivo.lua"/> data/creaturescripts/scripts Em login.lua: registerCreatureEvent(cid, "Spread")
  14. local function doSpreadLoot(fromPosition, toPosition, container) for slot = (getContainerSize(container.uid) - 1), 0, -1 do local item = getContainerItem(container.uid, slot) if not isContainer(item.uid) then local position = { x = math.random(fromPosition.x, toPosition.x), y = math.random(fromPosition.y, toPosition.y), z = fromPosition.z, } local itemEx = doCreateItemEx(item.itemid, item.type) if doTileAddItemEx(position, itemEx) then doRemoveItem(item.uid) end else doSpreadLoot(fromPosition, toPosition, item) doRemoveItem(item.uid) end end return true end function onKill(cid, target) if(isMonster(target) == TRUE) and getCreatureName(target) == 'NOMEDOMONSTROAQUI' then local position = getCreaturePosition(target) local name = getCreatureName(target) local fromPosition = {x = position.x - 1, y = position.y - 1, z = position.z} local toPosition = {x = position.x + 1, y = position.y + 1, z = position.z} addEvent(function() local container = getTileItemById(position, getMonsterInfo(name).lookCorpse) if container.uid > 0 then doSpreadLoot(fromPosition, toPosition, container) end end, 100) end return true end
  15. Tipo ai se tu usa a de 5 vai ter que esperar 5 segundos para usar a de 15 também, e se você usa a de 15 vai ter que esperar 15 na de 5 segundos.
  16. Para adicionar cooldown primeiramente adicione estes locais no script: local tempo = 900 -- Tempo para usar novamente (em segundos) local storage = 23585 -- storage pra verificar se o player já pode usar novamente Depois disso, adicione isso a seguir depois da linha function: if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Mensagem dizendo ao player que ele tem que esperar") return true end Agora você adiciona isso junto da função principal do script: exhaustion.set(cid, storage, tempo) Exemplo: function onSay(cid, words, param) local storage = 23585 local tempo = 3600 local cidade = getPlayerTown(cid) local pos = getTownTemplePosition(cidade) if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, 22, "Você não tem dinheiro suficiente, espere passar o tempo de 1 hora depois da ultima vez que você usou para usar novamente!") return true end doTeleportThing(cid, pos) exhaustion.set(cid, storage, tempo) doSendAnimatedText(getThingPosWithDebug(cid), "Desbugado!", COLOR_BURN) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Voce sera kikado!") addEvent(doRemoveCreature, 2500, cid) end @Deu um erro aqui e publicou dois posts mals ai.
  17. Para adicionar cooldown primeiramente adicione estes locais no script: local tempo = 900 -- Tempo para usar novamente (em segundos) local storage = 23585 -- storage pra verificar se o player já pode usar novamente Depois disso, adicione isso a seguir depois da linha function: if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Mensagem dizendo ao player que ele tem que esperar") return true end Agora você adiciona isso junto da função principal do script: exhaustion.set(cid, storage, tempo)
  18. function onUse(cid, item, fromPosition, itemEx, toPosition) local waittime = 900 -- Tempo para se transformar novamente (em segundos) local tempodaoutfit = 15 -- em minutos local storage = 23585 local CustomOutfits = {lookType = 2} if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You can only transform each 15 minutes") return true end exhaustion.set(cid, storage, tempo) doSetCreatureOutfit(cid, CustomOutfits, tempodaoutfit * 60 * 1000) doSendMagicEffect(getCreaturePosition(cid), 30) doBroadcastMessage("Player "..getCreatureName(cid).." is a true warlord, and he is ready to kill more, fear him.", 22) end return true end
  19. Alencar123 postou uma resposta no tópico em Suporte Tibia OTServer
    Dá algum erro? @Meu script pode estar errado pois é a primeira vez que mecho com a função onAdvance.
  20. Alencar123 postou uma resposta no tópico em Suporte Tibia OTServer
    em creaturescripts.xml <event type="advance" name="Advance" event="script" value="advance.lua"/> em login.lua registerCreatureEvent(cid, "Advance") crie um arquivo advance.lua em data/creaturescripts/scripts function onAdvance(cid, skill, oldLevel, newLevel) doPlayerAddHeath(cid, getPlayerMaxHealth(cid)) doPlayerAddMana(cid, getPlayerMaxMana(cid)) end
  21. Alencar123 postou uma resposta no tópico em Suporte Tibia OTServer
    ----------------------------------- ---------SCRIPT por PC98------------ NAO REMOVA OS CREDITOS ----------------------------------- function onUse(cid, item, frompos, item2, topos) ------------------ Inicio das Config ------------ local castle_one_name = "Baiakuda" -- Nome do castelo 1 local storages = {154154,54321,123123} -- Storages ( se vc eh iniciante, deixe como está...) -------PREMIOs I N D I V I D U A L --------- local premio_por_vezes = 0 -- Premio por vezes de conquista de castelo. (1) = Ativo (0) = Desativa. local premio_vezes = 13 -- Caso ativo, a quantidade de conquista que o player tem, para ganhar PREMIO. local premio = 2160 -- ID do Premio local premio_cont = 1 -- Quantidade do Premio local premio_reset = 1 -- Resetar o contador do premio depois que atingir a meta?? (1) = SIM (0) = NAO -------Verificação de exhaust --------- local storageexhaust = 23564 local tempo = 900 -- tempo em segundos ----------------- FIM DAS CONFIG ----------------- local sto_ativ = getGlobalStorageValue(storages[2]) position = getCreaturePosition(cid) if exhaustion.check(cid, storageexhaust) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde 15 minutos para usar novamente.") return true end if isPlayerGuild(cid) == TRUE then if sto_ativ == 1 or sto_ativ == -1 then guildname = getPlayerGuildName(cid) guild = getPlayerGuildId(cid) guild_sto = getGlobalStorageValue(storages[3]) if guild ~= guild_sto then setPlayerStorageValue(cid,guild_sto,guild) if getPlayerStorageValue(cid,storages[1]) == -1 then setPlayerStorageValue(cid,storages[1],0) end sto_vezes = getPlayerStorageValue(cid,storages[1]) setGlobalStorageValue(storages[3],getPlayerGuildId(cid)) setPlayerStorageValue(cid,storages[1], sto_vezes + 1) sto_vezes_total = getPlayerStorageValue(cid,storages[1]) doBroadcastMessage("O(a) "..getCreatureName(cid).." acabou de conquistar o castelo "..castle_one_name.." para a guild \""..guildname.."\" pela "..sto_vezes_total.."ª vez(s).", 22) doSendMagicEffect(position, 39) if premio_por_vezes == 1 then if getPlayerStorageValue(cid,storages[1]) == premio_vezes then if getItemWeightById(premio,1) <= getPlayerFreeCap(cid) then doBroadcastMessage("O "..getCreatureName(cid).." ganhou uma(o) "..getItemNameById(premio).." como recompensa das suas "..premio_vezes.." conquistas!", 21) doPlayerAddItem(cid, premio,premio_cont) doPlayerSendTextMessage(cid, 18, "Voce recebeu o(a) "..getItemNameById(premio).." como recompensa das suas "..premio_vezes.." conquistas!") ----------------------------------------------- -- if premio_reset == 1 then -- setPlayerStorageValue(cid,storages[1],0) -- Resetar a contagem end -- ----------------------------------------------- -- else doPlayerSendTextMessage(cid, 18, "Voce nao tem capacidade para ganhar o item. Vamos verificar novamente em 10 segundos!") addEvent(additem,10000,cid,premio,premio_cont,premio_reset) end end end else doPlayerSendCancel(cid,"Este castelo ja foi conquistado pela sua guild!") doSendMagicEffect(position, 2) end else doPlayerSendCancel(cid,"O sistema está desativado") end else doPlayerSendCancel(cid,"É nescessario ter guild para dominar o castelo!") doSendMagicEffect(position, 2) end end ------------------------- por pc98 function additem(cid,premio,premio_cont,premio_reset) if getItemWeightById(premio,1) <= getPlayerFreeCap(cid) then doPlayerAddItem(cid, premio,premio_cont) doPlayerSendTextMessage(cid, 18, "Voce recebeu o(a) "..getItemNameById(premio).." como recompensa das suas "..premio_vezes.." conquistas!") if premio_reset == 1 then setPlayerStorageValue(cid,storages[1],0) end stopEvent(additem) else doPlayerSendTextMessage(cid, 18, "Voce nao tem capacidade para ganhar o item. Verificando novamente em 10 segundos!") addEvent(additem,10000,cid) end end exhaustion.set(cid, storage, tempo) ------------------------- por pc98 function isPlayerGuild(cid) if getPlayerGuildName(cid) ~= "" then return TRUE else return FALSE end

Informação Importante

Confirmação de Termo