Ir para conteúdo

Caronte

Membro
  • Registro em

  • Última visita

Solutions

  1. Caronte's post in (Resolvido)Npc de troca was marked as the answer   
    Opa, desculpa, burrice minha.
     
    Agora ambos estão configuráveis:
    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 talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local itemsp = { [1] = {2666, 2}, [2] = {2671, 2}, [3] = {2681, 2}, [4] = {2695, 2}, [5] = {2667, 2}, [6] = {2676, 2}, [7] = {2675, 2}, } -- os 7 items que precisam. s = "" for k, v in pairs(itemsp) do s = s.."{"..v[2].." ".. getItemNameById(v[1]) .."}".. (#itemsp ~= k and ", " or "") end function pegaritems() for k, v in pairs(itemsp) do doPlayerRemoveItem(cid, v[1], v[2]) end end function temitem() for k, v in pairs(itemsp) do if not (getPlayerItemCount(cid, v[1]) >= v[2]) then return false end end return true end local tab = { [2] = {7454, 1}, -- axe [3] = {2376, 1}, -- sword [4] = {2389, 1}, -- spear } if (msgcontains(msg, "troca") or msgcontains(msg, "trocar") or msgcontains(msg, "yes")) and talkState[talkUser] == nil then npcHandler:say("Ok, preciso de {7 items} em troca de: ("..getItemArticleById(tab[2][1]).." {"..getItemNameById(tab[2][1]).."} - ID: "..tab[2][1].."), ("..getItemArticleById(tab[3][1]).." {"..getItemNameById(tab[3][1]).."} - ID: "..tab[3][1]..") ou ("..getItemArticleById(tab[4][1]).." {"..getItemNameById(tab[4][1]).."} - ID: "..tab[4][1]..")", cid) talkState[talkUser] = 1 elseif (msgcontains(msg, tostring(getItemNameById(tab[2][1])))) and talkState[talkUser] == 1 then npcHandler:say("Voce quer trocar: ".. s .." por um {"..getItemNameById(tab[2][1]).."}?", cid) talkState[talkUser] = 2 elseif (msgcontains(msg, tostring(getItemNameById(tab[3][1])))) and talkState[talkUser] == 1 then npcHandler:say("Voce quer trocar: ".. s .." por uma {"..getItemNameById(tab[3][1]).."}?", cid) talkState[talkUser] = 3 elseif (msgcontains(msg, tostring(getItemNameById(tab[4][1])))) and talkState[talkUser] == 1 then npcHandler:say("Voce quer trocar: ".. s .." por uma {"..getItemNameById(tab[4][1]).."}?", cid) talkState[talkUser] = 4 elseif (msgcontains(msg, "yes")) and tab[talkState[talkUser]] then for k, v in pairs(itemsp) do if not temitem() then doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) npcHandler:say("Voce nao tem todos os items, desculpe, nada feito.", cid) npcHandler:onCreatureDisappear(cid) talkState[talkUser] = nil return true elseif temitem() then pegaritems() for i = 1, tab[talkState[talkUser]][2] do doPlayerAddItem(cid, tab[talkState[talkUser]][1]) end npcHandler:say("Uhuul, troca feita, obrigado.", cid) npcHandler:onCreatureDisappear(cid) talkState[talkUser] = nil return true end end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())  
  2. Caronte's post in (Resolvido)Tirar Nomes do teleport - valendo +rep was marked as the answer   
    poste os texto.lua, texto2.lua e texto.lua3
  3. Caronte's post in (Resolvido)[PEDIDO] Crystal pro castle was marked as the answer   
    Opa, erro meu.
     
     
    Substitua o seu Crystal.lua do creaturescripts/scripts
    function onKill(cid, target, lastHit) if not (isMonster(target) and getCreatureName(target) == "Crystal") then return true end ------------------ Inicio das config ------------ local castle_one_name = "Castle24h" -- Nome do castelo 1 local storages = {154154,54321,123123} -- Storages ( se vc eh iniciante, deixe como está ...) local monster_name = "Crystal" local monster_pos = {x = 100, y = 130, z = 7} -------PREMIOs I N D I V I D U A L --------- local premio_por_vezes = 1 -- Premio por vezes de conquista de castelo. (1) = Ativo (0) = Desativa. local premio_vezes = 15 -- Caso ativo, a quantidade de conquista que o player tem, para ganhar PREMIO. local premio = 5468 -- 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 -------FIM PREMIOs I N D I V I D U A L --------- ----------------- FIM DAS CONFIG ----------------- local sto_ativ = getGlobalStorageValue(storages[2]) position = getCreaturePosition(cid) 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 return addEvent( function() doCreateMonster(monster_name, monster_pos) end, 10) 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 ------------------------- por pc98 function isPlayerGuild(cid) if getPlayerGuildName(cid) ~= "" then return TRUE else return FALSE end end Eu não coloquei pros players da guild dominante não poder atacar...
    se não tiver, eles podem burlar, matando o bicho quando ele tiver pouca vida, aí vai renovar a vida, e eles vão poder monopolizar...

    Pera aí...
  4. Caronte's post in (Resolvido)AJUDA COM ESSE SCRIPT was marked as the answer   
    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 local choose = {} local cancel = {} local available = {} function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid if(msgcontains(msg, "info")) then selfSay("Olá "..getCreatureName(cid)..", Você quer trocar de vocação, digite o nome da sua proxima vocação. Naruto, Sasuke, Kisame, Neji, Nagato, Shikamaru, Hinata, Chouji, Obito, Kakashi, Jiraya, Rock Lee, Gaara, Anbu, Konan, killer bee, Kiba, Kimimaro, Shino, Sakura, Kabuto, Temari, Kakuzo, Hidan, Tenten, Kankuro Sai.", cid) talkState[talkUser] = 1 elseif msgcontains(msg, "naruto") or msgcontains(msg, "naruto") and talk_state == 1 then doPlayerSetVocation(cid, 1) selfSay("Parabéns, você virou um naruto", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "sasuke") or msgcontains(msg, "sasuke") and talk_state == 1 then doPlayerSetVocation(cid, 10) selfSay("Parabéns, você virou um sasuke", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "Kisame") or msgcontains(msg, "kisame") and talk_state == 1 then doPlayerSetVocation(cid, 40) selfSay("Parabéns, você virou um Kisame", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "neji") or msgcontains(msg, "neji") and talk_state == 1 then doPlayerSetVocation(cid, 60) selfSay("Parabéns, você virou um neji", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "nagato") or msgcontains(msg, "nagato") and talk_state == 1 then doPlayerSetVocation(cid, 70) selfSay("Parabéns, você virou um nagato", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "shikamaru") or msgcontains(msg, "shikamaru") and talk_state == 1 then doPlayerSetVocation(cid, 80) selfSay("Parabéns, você virou um shikamaru", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "hinata") or msgcontains(msg, "hinata") and talk_state == 1 then doPlayerSetVocation(cid, 90) selfSay("Parabéns, você virou um hinata", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "chouji") or msgcontains(msg, "chouji") and talk_state == 1 then doPlayerSetVocation(cid, 100) selfSay("Parabéns, você virou um chouji", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "obito") or msgcontains(msg, "obito") and talk_state == 1 then doPlayerSetVocation(cid, 110) selfSay("Parabéns, você virou um obito", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "kakashi") or msgcontains(msg, "kakashi") and talk_state == 1 then doPlayerSetVocation(cid, 130) selfSay("Parabéns, você virou um kakashi", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "jiraya") or msgcontains(msg, "jiraya") and talk_state == 1 then doPlayerSetVocation(cid, 140) selfSay("Parabéns, você virou um jiraya", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "rock lee") or msgcontains(msg, "rock lee") and talk_state == 1 then doPlayerSetVocation(cid, 200) selfSay("Parabéns, você virou um rock lee", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "gaara") or msgcontains(msg, "gaara") and talk_state == 1 then doPlayerSetVocation(cid, 210) selfSay("Parabéns, você virou um gaara", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "anbu") or msgcontains(msg, "anbu") and talk_state == 1 then doPlayerSetVocation(cid, 220) selfSay("Parabéns, você virou um anbu", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "konan") or msgcontains(msg, "konan") and talk_state == 1 then doPlayerSetVocation(cid, 230) selfSay("Parabéns, você virou um konan", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "killer bee") or msgcontains(msg, "killer bee") and talk_state == 1 then doPlayerSetVocation(cid, 240) selfSay("Parabéns, você virou um killer bee", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "kiba") or msgcontains(msg, "kiba") and talk_state == 1 then doPlayerSetVocation(cid, 250) selfSay("Parabéns, você virou um kiba", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "kimimaro") or msgcontains(msg, "kimimaro") and talk_state == 1 then doPlayerSetVocation(cid, 260) selfSay("Parabéns, você virou um kimimaru", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "shino") or msgcontains(msg, "shino") and talk_state == 1 then doPlayerSetVocation(cid, 270) selfSay("Parabéns, você virou um shino", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "sakura") or msgcontains(msg, "sakura") and talk_state == 1 then doPlayerSetVocation(cid, 280) selfSay("Parabéns, você virou um sakura", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "kabuto") or msgcontains(msg, "kabuto") and talk_state == 1 then doPlayerSetVocation(cid, 290) selfSay("Parabéns, você virou um kabuto", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "temari") or msgcontains(msg, "temari") and talk_state == 1 then doPlayerSetVocation(cid, 300) selfSay("Parabéns, você virou um temari", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "kakuzo") or msgcontains(msg, "kakuzo") and talk_state == 1 then doPlayerSetVocation(cid, 310) selfSay("Parabéns, você virou um kakuzo", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "hidan") or msgcontains(msg, "hidan") and talk_state == 1 then doPlayerSetVocation(cid, 330) selfSay("Parabéns, você virou um hidan", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "tenten") or msgcontains(msg, "tenten") and talk_state == 1 then doPlayerSetVocation(cid, 350) selfSay("Parabéns, você virou um tenten", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "kankuro") or msgcontains(msg, "kankuro") and talk_state == 1 then doPlayerSetVocation(cid, 360) selfSay("Parabéns, você virou um kankuro", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif msgcontains(msg, "Sai") or msgcontains(msg, "Sai") and talk_state == 1 then doPlayerSetVocation(cid, 370) selfSay("Parabéns, você virou um Sai", cid) doTeleportThing(cid, {x = 1020, y = 910, z = 4}) elseif(msgcontains(msg, "bye") or msgcontains(msg, "goodbye") or msgcontains(msg, "cya")) then selfSay("cya!", cid, TRUE) closeShopWindow(cid) removeFocus(cid) end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  5. Caronte's post in (Resolvido)Spell de Sacrificio was marked as the answer   
    Você precisa tirar o exhaust da tag do xml da spell, e configurar apenas o de dentro do script...

    local cooldown = 60 * 30 function onCastSpell(cid, var) if os.time() - getPlayerStorageValue(cid, 19329) >= cooldown then doPlayerSetStorageValue(cid, 19329, os.time()) local target = getCreatureTarget(cid) doCreatureAddHealth(cid, -getCreatureHealth(cid)) doCreatureAddHealth(target, -getCreatureHealth(target)) doCreatureSay(cid, "SUICIDE!!", 20) doSendMagicEffect(getPlayerPosition (cid), 0) doSendMagicEffect(getPlayerPosition (target), 0) else doPlayerSendCancel(cid, "Your skill is in cooldown, you can use it again after "..math.floor((cooldown - (os.time() - getPlayerStorageValue(cid, 19329)))/60).." minute(s).") end return true end
  6. Caronte's post in (Resolvido)Channel help GOD falar em vermelho SOMENTE no HELP was marked as the answer   
    Essas opções são de flags, e não custom flags, me passe o id das suas flags...

    Terá que mexer nas sources para ser vermelho, no help é orange...
  7. Caronte's post in (Resolvido)Amuleto com 1 charge- erro was marked as the answer   
    o certo é Suporte de Scripts, lá é para postar conteúdo, como npcs prontos, e não dúvidas, para entrar lá, é preciso criar um tópico na seção de aprovação.
     
     
    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 Scripts"


     
     
    Primeiro, você quer o npc ou o loot com 5 ou 1 de recarga?
     
     
    se for 5 charges no npc, poste o xml do npc, e o lua.
     
     
     
    veja o exemplo aqui:
    shopModule:addBuyableItem({'blank rune'}, 2260, 10, 1, 'blank rune') o npc dará 1 só runa, só não tenho certeza se é aplicável nas charges...
  8. Caronte's post in (Resolvido)ERRO NO REMERS (OLHEM PLX) was marked as the answer   
    Vá na pasta items do seu ot, pegue items.otb
    agora, vá na pasta do seu remere's, depois data, e procure pela sua versão, lá substitua o items.otb pelo seu do ot...
  9. Caronte's post in (Resolvido)[PEDIDO] Caldeirão acumulativo de items was marked as the answer   
    @andersonwill, Obrigado por relembrar eu tinha esquecido,
    porém isso é moderação secundária, se possível, pode me mandar PM ou para qualquer outro moderador. 
     
     
     
    @tibira, 
    <action itemid="5468" event="script" value="caldeirao.lua"/> mude o id do item loot 
    local t = { items_recompensa = { -- [id] = count, [2160] = 10, [2493] = 1, }, items_acumulados = 5, action_id = 4030, mensagem_global = "O Caldeirão foi cheio, e como recompensa, todos os players online ganharam os items: ", efeito_acumulando = 7, efeito_caldeirao_cheio = 29, } for lid, num in pairs(t.items_recompensa) do t.mensagem_global = t.mensagem_global.. (lid == #t.items_recompensa and (num .."x ".. getItemNameById(lid)) ..". " or (num .."x ".. getItemNameById(lid)) ..", ") end function onUse(cid, item, toPosition, itemEx, fromPosition) if itemEx.actionid == t.action_id then if getGlobalStorageValue("caldeirao") >= t.items_acumulados - 1 then doRemoveItem(item.uid, 1) for id, pid in pairs(getPlayersOnline()) do for id, count in pairs(t.items_recompensa) do doPlayerAddItem(pid, id, count) doSendMagicEffect(fromPosition, t.efeito_caldeirao_cheio) end end doCreatureSay(cid, "[".. t.items_acumulados .. "/".. getGlobalStorageValue("caldeirao") + 1 .. "] !!!" , TALKTYPE_MONSTER, true, 0, fromPosition) setGlobalStorageValue("caldeirao", 0) broadcastMessage(t.mensagem_global, 21) else setGlobalStorageValue("caldeirao", getGlobalStorageValue("caldeirao") + 1) doRemoveItem(item.uid, 1) doSendMagicEffect(fromPosition, t.efeito_acumulando) doCreatureSay(cid, "[".. t.items_acumulados .. "/".. getGlobalStorageValue("caldeirao") .. "]" , TALKTYPE_MONSTER, true, 0, fromPosition) end end return true end Qualquer item que você coloque actionID = 4030, será o caldeirão.
  10. Caronte's post in (Resolvido)[AJUDA] Ice rapier não quebra num hit was marked as the answer   
    Fica com 100, eu acho...
    Dá para criar só uma: /i 2396, 1
  11. Caronte's post in (Resolvido)[URGENTE] INVALID PASSWORD was marked as the answer   
    Você sabe compilar?
     
    é em protocolgame.cpp vá em:
    if(!IOLoginData::getInstance()->getPassword(id, hash, salt, character) || !encryptTest(salt + password, hash)) { ConnectionManager::getInstance()->addAttempt(getIP(), protocolId, false); disconnectClient(0x14, "Invalid password."); return false; } e apague tudo.
     
     
    pronto!, feche e compile.
  12. Caronte's post in (Resolvido)death cast was marked as the answer   
    acho que não.
     
     
    Aqui está o script
    http://www.tibiaking.com/forum/topic/51178-duvida-creaturescripts/#entry300683
  13. Caronte's post in (Resolvido)[PEDIDO] Nascer respawn com player na tela was marked as the answer   
    Você não alterou, 
    e precisa compilar...
     
    Tenta usar esse que eu compilei, coloquei para dar o mesmo efeito que o dos 10.+ , que é o teleport.

  14. Caronte's post in (Resolvido)[ERRO] Criando monstro was marked as the answer   
    é look typeex , e não somente typeex.
     
    ficaria assim: 



  15. Caronte's post in (Resolvido)Como deixar para usa potion com ou sem batlle was marked as the answer   
    Desatenção minha,
     
    use este:
    function doHealOverTime(cid, div, turn, effect) if not isCreature(cid) then return true end if turn <= 0 then return true end if getCreatureHealth(cid) == getCreatureMaxHealth(cid) then return true end local d = div / 10000 local amount = math.floor(getCreatureMaxHealth(cid) * d) doCreatureAddHealth(cid, amount) if math.floor(turn/10) == turn/10 then doSendMagicEffect(getThingPos(cid), effect) end addEvent(doHealOverTime, 100, cid, div, turn - 1, effect) end local potions = { [12346] = {effect = 12, div = 20}, [12347] = {effect = 13, div = 40}, [12348] = {effect = 13, div = 60}, [12345] = {effect = 14, div = 80}, [12343] = {effect = 12, div = 100}} function onUse(cid, item, frompos, item2, topos) if isPlayer(item2.uid) then return doPlayerSendCancel(cid, "You can only use potions on pokemons!") end if not isCreature(item2.uid) then return doPlayerSendCancel(cid, "You can only use potions on pokemons!") end if not isPlayer(getCreatureMaster(item2.uid)) then return doPlayerSendCancel(cid, "You cant use potions on wild pokemons.") end if getCreatureHealth(item2.uid) == getCreatureMaxHealth(item2.uid) then return doPlayerSendCancel(cid, "This pokemon is already at full health.") end doCreatureSay(cid, ""..getPlayerStorageValue(item2.uid, 1007)..", take this potion!", TALKTYPE_SAY) doSendMagicEffect(getThingPos(item2.uid), 172) doRemoveItem(item.uid, 1) local a = potions[item.itemid] doHealOverTime(item2.uid, a.div, 100, a.effect) return true end 
  16. Caronte's post in (Resolvido)Se tiver storages X ou Y não pode usar utana vid. was marked as the answer   
    local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_INVISIBLE) setConditionParam(condition, CONDITION_PARAM_TICKS, 200000) setCombatCondition(combat, condition) function onCastSpell(cid, var) for i = 4000, 4020 do if getPlayerStorageValue(cid, i) > -1 then doPlayerSendCancel(cid, "Essa magia não pode ser usada nesse evento.") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) return false end end return doCombat(cid, combat, var) end Poste a tag do outro script.
  17. Caronte's post in (Resolvido)Duvida[TalkState] was marked as the answer   
    O TalkState é para localizar o cid na conversa.

    Exemplo: Cid = 375727583 (número aleatório de um player qualquer)

    Ele armazena na tabela TalkState o cid, para identificar em que assunto o cid está, através de umas funções.

    Se eu não me engano, existe uma coisa assim

    TalkUser = cid. -- logo você pode usar cid direto como o índice do TalkState.

    Nesse caso a tabela fica se mudando de acordo com o que o player fala para o NPC.

    TalkState = { 1 = [375727583] } -- ao falar hi
    TalkState = { 2 = [375727583] } -- ao falar travel, o elemento do talkstate fica como 2, no índice com número do cid

    Isso é o que determina uma fala como "yes" ser diferente da mesma fala "yes" do player, o npc executa o "yes" de acordo com o TalkState, que deve ser configurado de acordo com a lógica que o npc foi programado para fazer.

    Exemplo:

    Npc disse: Quer 100 golds, yes or no?
    Npc disse: Essa rope é 100 golds, yes or no?

    Esse npc pode ser o mesmo, porém o caminho que o player precisa usar tem que ser diferente para não quebrar a lógica.

    Eu estou escrevendo pelo celular, espero que esteja claro.
  18. Caronte's post in (Resolvido)Como adicionar uma função na source? was marked as the answer   
    Poste ela,
    se eu não me engano, é só colocar na pasta lib (sou leigo em derivados).

    Eu vi em um tópico a seguinte função:
    function doReborn(cid, level, looktype, vocation) setGlobalStorageValue(1000,getPlayerGUID(cid)) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = " .. level .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";") db.executeQuery("UPDATE `players` SET `looktype` = " .. looktype .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";") db.executeQuery("UPDATE `players` SET `vocation` = " .. vocation .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";") return TRUE end Se for diferente por favor fale.
     
     
    No caso, é só adicionar essa função na primeira linha do arquivo 050-function.lua na pasta lib, e usar normalmente, em outros scripts.
    Exemplo: doReborn(cid, 150, 302, 4)
  19. Caronte's post in (Resolvido)Colocar exausted was marked as the answer   
    Você fez alguma coisa errada, ou não tem alguma função o sei lá...
    aqui está funcionando normalmente.
     
     
    Mande o erro todo.
     
    olhe:

  20. Caronte's post in (Resolvido)Magia de teleporte was marked as the answer   
    local tempo = 10 function onCastSpell(cid, var) if getPlayerStorageValue(cid, "kawari") - os.time() > 0 then doPlayerSendTextMessage(cid, 19, "You're exhausted, please wait "..getPlayerStorageValue(cid, "kawari") - os.time().." seconds." ) doSendMagicEffect( getThingPos(cid) , CONST_ME_POFF) return false end setPlayerStorageValue(cid, "kawari", os.time() + tempo) return true end Coloca 0 no XML.
  21. Caronte's post in (Resolvido)Pegar cor da Outfit was marked as the answer   
    function onUse(cid, item) local cidOutfit = getCreatureOutfit(cid) local outfitm = {lookType = 684, lookHead = cidOutfit.lookHead, lookLegs = cidOutfit.lookLegs, lookBody = cidOutfit.lookBody, lookFeet = cidOutfit.lookFeet} local outfitf = {lookType = 685, lookHead = cidOutfit.lookHead, lookLegs = cidOutfit.lookLegs, lookBody = cidOutfit.lookBody, lookFeet = cidOutfit.lookFeet} local exhaust = 120 -- Tempo para player poder usar o item novamente! (tempo em segundos) local time = 120 -- Tempo para ficar na montaria! (tempo em segundos) local speed = 200 -- Velocidade adicionada ao player após usar o item! (300 = velocidade, quanto maior mais rapido...) local mana = 0 -- Quantidade de mana que o player necessita para usar o sistema! local premium = "no" -- Apenas players premium accounts "yes" or "no"!? local storage = 9393 -- Não mexa aqui! if premium == "no" and not isPremium(cid) then return doPlayerSendTextMessage(cid, 23, "Sorry, only premium players.") end if (getPlayerStorageValue(cid, storage) <= os.time()) and getPlayerSex(cid) == 1 then doCreatureSay(cid, "Yeeeah!!!\nYou went up on his ride.", 19) doSetCreatureOutfit(cid, outfitm, time*1000) doChangeSpeed(cid, speed) doSendMagicEffect(getCreaturePosition(cid), 12) setPlayerStorageValue(cid, storage, os.time()+exhaust) addEvent(doChangeSpeed, time*1000+40, cid, -speed) else doPlayerSendCancel(cid, "Sorry, you only can again use this item after "..exhaust.." seconds.") end if (getPlayerStorageValue(cid, storage) <= os.time()) and getPlayerSex(cid) == 0 then doCreatureSay(cid, "Yeeeah!!!\nYou went up on his ride.", 19) doSetCreatureOutfit(cid, outfitf, time*1000) doChangeSpeed(cid, speed) doSendMagicEffect(getCreaturePosition(cid), 12) setPlayerStorageValue(cid, storage, os.time()+exhaust) addEvent(doChangeSpeed, time*1000+40, cid, -speed) else doPlayerSendCancel(cid, "Sorry, you only can again use this item after "..exhaust.." seconds.") end return true end
  22. Caronte's post in (Resolvido)Chars criados nascendo pelados was marked as the answer   
    local config = { [1] = { --equipment spellbook, wand of vortex, magician's robe, mage hat, studded legs, leather boots, scarf items = {{2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}}, --container rope, shovel, mana potion container = {{2120, 1}, {2554, 1}, {7620, 1}} }, [2] = { --equipment spellbook, snakebite rod, magician's robe, mage hat, studded legs, leather boots scarf items = {{2175, 1}, {2182, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}}, --container rope, shovel, mana potion container = {{2120, 1}, {2554, 1}, {7620, 1}} }, [3] = { --equipment dwrven shield, 5 spear, ranger's cloak, ranger legs scarf, legion helmet items = {{2525, 1}, {2389, 5}, {2660, 1}, {8923, 1}, {2643, 1}, {2661, 1}, {2480, 1}}, --container rope, shovel, health potion, bow, 50 arrow container = {{2120, 1}, {2554, 1}, {7618, 1}, {2456, 1}, {2544, 50}} }, [4] = { --equipment dwarven shield, steel axe, brass armor, brass helmet, brass legs scarf items = {{2525, 1}, {8601, 1}, {2465, 1}, {2460, 1}, {2478, 1}, {2643, 1}, {2661, 1}}, --container jagged sword, daramian mace, rope, shovel, health potion container = {{8602, 1}, {2439, 1}, {2120, 1}, {2554, 1}, {7618, 1}} } } function onLogin(cid) local player = Player(cid) local targetVocation = config[player:getVocation():getId()] if not targetVocation then return true end if player:getLastLoginSaved() ~= 0 then return true end for i = 1, #targetVocation.items do player:addItem(targetVocation.items[i][1], targetVocation.items[i][2]) end local backpack = player:addItem(1988) if not backpack then return true end for i = 1, #targetVocation.container do backpack:addItem(targetVocation.container[i][1], targetVocation.container[i][2]) end player:registerEvent("FirstItems") return true end
  23. Caronte's post in (Resolvido)Monstros RME was marked as the answer   
    Se você abrir o seu creatures.xml da pasta RME/data/versão 
    e colocar isso:
    <?xml version="1.0" encoding="UTF-8"?> <creatures> </creatures> Elimina, porém apresentará um erro, acho que tem que fazer isso em todas as versões inferiores, para eliminar o erro.
     
     
     
    Talvez você não consiga alterar o arquivo na pasta, para editar, puxe para o desktop, edite e salve, depois coloque no lugar certo.
  24. Caronte's post in (Resolvido)[SCRIPT] Porta após fazer quest! was marked as the answer   
    Não mexi na sua gambiarra:
    local str = 2215 -- storage function onUse(cid, item, frompos, item2, topos) local pos = getCreaturePosition(cid) if getPlayerStorageValue(cid, str) < 1 then return doPlayerSendCancel(cid, "Voce precisa terminar anihilator quest!") end if pos.x == topos.x then if pos.y < topos.y then pos.y = topos.y + 1 else pos.y = topos.y - 1 end elseif pos.y == topos.y then if pos.x < topos.x then pos.x = topos.x + 1 else pos.x = topos.x - 1 end else doPlayerSendCancel(cid, "Fique em frente a porta.") return true end doTeleportThing(cid, pos) doSendMagicEffect(topos, CONST_ME_MAGIC_BLUE) return true end
  25. Caronte's post in (Resolvido)[Pedido] Colocar pra quem tiver em Area PZ usar esse item was marked as the answer   
    local t = { delay = 5, -- Tempo em segundos para usar novamente. storage = 45555 -- Storage para utilizar. } function onUse(cid, item, fromPosition, itemEx, toPosition) if not getTileInfo(getThingPos(cid)).protection then return doPlayerSendCancel(cid, "This item works only in PZ") and doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) and false end if getPlayerStorageValue(cid, t.storage) < os.time() then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) setPlayerStorageValue(cid, t.storage, t.delay + os.time()) doRemoveItem(item.uid) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) doSendMagicEffect(fromPosition, CONST_ME_TELEPORT) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa aguardar ".. getPlayerStorageValue(cid, t.storage) - os.time() .." segundo(s) para usar novamente.") end return true end

Informação Importante

Confirmação de Termo