Ir para conteúdo

Tryaron

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    Tryaron deu reputação a xWhiteWolf em (Resolvido)Combine com Mensagem no World   
    de acordo com oque eu pesquisei fica assim.. testa aí
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Awesome! Your " .. it:getName() .. " upgrade to +" .. nLevel .. " successfully!") if nLevel >= 7 then broadcastMessage("O jogador ".. getCreatureName(cid) .." combinou seu ".. it:getName() .." para +".. nLevel .." com sucesso", MESSAGE_STATUS_WARNING) end
  2. Gostei
    Tryaron deu reputação a psychonaut em (Resolvido)QuestLog   
    Muda o nome, não pode ser igual.
    <event type="kill" name="MonsterKillTest" script="monsterkill1.lua"/> player:registerEvent("MonsterKillTest")
  3. Gostei
    Tryaron deu reputação a psychonaut em (Resolvido)QuestLog   
    Beleza, a começar pelo quest log.
    A tag quests fecha por último:
    <?xml version="1.0" encoding="UTF-8"?> <quests> <quest name="Example Quest I" startstorageid="1001" startstoragevalue="1"> <mission name="Example Mission 1" storageid="1001" startvalue="1" endvalue="3"> <missionstate id="1" description="Example description 1"/> <missionstate id="2" description="Example description 2"/> <missionstate id="3" description="Example description 3"/> </mission> <mission name="Example Mission 2" storageid="1001" startvalue="4" endvalue="5"> <missionstate id="4" description="Example description 1"/> <missionstate id="5" description="Example description 2"/> </mission> </quest> <quest name="Tasks" startstorageid="76669" startstoragevalue="1"> <mission name="Task Dragoes" storageid="76669" startvalue="1" endvalue="4"> <missionstate id="1" description="Fale com o npc tal para aceitar a missao"/> <missionstate id="2" description="Mate 20 dragoes em tal montanha"/> <missionstate id="3" description="Volte ao npc tal para receber sua recompensa"/> <missionstate id="3" description="Voce ja fez a task dos dragoes"/> </mission> </quest> </quests> Bom, no login.lua o nome ta errado, mas vamos corrigir no creaturescripts.xml:
    <event type="kill" name="MonsterKill" script="monsterkill.lua"/> Bem, e o NPC ta sem dialogo inicial:
    <?xml version="1.0" encoding="UTF-8"?><npc name="Adam" script="task1.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100" /> <look type="132" head="115" body="0" legs="114" feet="0" addons="3" corpse="2212"/> <parameters>   <parameter key="message_greet" value="Oi, você pode me ajudar? Se puder, me avise que eu lhe falo sobre a {missao}. "/> </parameters> </npc> Pra mudar esse {missao}, que é a mensagem em azul, mude essa linha:
    elseif msgcontains(msg, "missao") then No script do npc

    Qualquer erro ou mal funcionamento é só postar.
  4. Gostei
    Tryaron deu reputação a Adriano SwaTT em [NPC] Bank (Igual Tibia Global)   
    Procurei aqui pelo forum, e não achei um NPC de Bank que fosse tão perfeito como este que estou postando...
    Eu mesmo havia postado há alguns dias atrás um NPC de Bank, mas não é tão bom quanto este...

    Detalhes do NPC:
    Executa as funções como do Tibia Global.
    Deposit, Transfer, Withdraw, Change Gold, Change Platinum, Change Crystal...

    Funcionando perfeitamente...
    #Testado'

    Vamos ao que interessa.

    Crie um arquivo chamado "bank.xml" na pasta "data / npc"... Cole o código abaixo dentro do arquivo:
    <?xml version="1.0" encoding="UTF-8"?> <npc name="BankMan" script="data/npc/scripts/bank.lua" walkinterval="25" floorchange="0" access="5" > <health now="150" max="150"/> <look type="132" head="115" body="0" legs="114" feet="0" addons="3" corpse="2212"/> <parameters> <parameter key="message_greet" value="Welcome |PLAYERNAME|! Here, you can {deposit}, {withdraw} or {transfer} your money from your bank account. I can change your coins too."/> <parameter key="message_alreadyfocused" value="You are drunked ? I talk with you."/> <parameter key="message_farewell" value="Goodbye. I wanna see your money... oh you again."/> </parameters> </npc> Salve e feche o arquivo.

    Agora vá na pasta Scripts e crie um arquivo chamado "bank.lua" e cole o código abaixo dentro do mesmo:
     
    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 --------------------MESSAGES------------------------------------------------------------------------------ if msgcontains(msg, 'deposit') then selfSay('Please tell me how much gold it is you would like to deposit.', cid) talkState[talkUser] = 1 elseif msgcontains(msg, 'withdraw') then selfSay('Please tell me how much gold you would like to withdraw.', cid) talkState[talkUser] = 3 elseif msgcontains(msg, 'transfer') then selfSay('Please tell me the amount of gold coins you would like to transfer.', cid) talkState[talkUser] = 5 elseif msgcontains(msg, 'change gold') then selfSay('How many platinum coins do you want to get?', cid) talkState[talkUser] = 8 elseif msgcontains(msg, 'change platinum') then selfSay('Do you want to change your platinum coins to gold or crystal?', cid) talkState[talkUser] = 10 elseif msgcontains(msg, 'change crystal') then selfSay('How many crystal coins do you want to change to platinum?', cid) talkState[talkUser] = 15 elseif msgcontains(msg, 'balance') then n = getPlayerBalance(cid) selfSay('Your balance are '..n..' golds.', cid) talkState[talkUser] = 0 ----------------------DEPOSIT------------------------------------------------------- elseif talkState[talkUser] == 1 then if msgcontains(msg, 'all') then n = getPlayerMoney(cid) selfSay('Do you want deposit '..n..' golds ?', cid) talkState[talkUser] = 2 else n = getNumber(msg) selfSay('Do you want deposit '..n..' golds ?', cid) talkState[talkUser] = 2 end elseif talkState[talkUser] == 2 then if msgcontains(msg, 'yes') then if getPlayerMoney(cid) >= n then doPlayerDepositMoney(cid,n) selfSay('Sucessfull. Now your balance account is ' ..getPlayerBalance(cid)..' golds.', cid) talkState[talkUser] = 0 else selfSay('You don\'t have money.', cid) end else selfSay('Ok then', cid) end ----------------------WITHDRAW------------------------------------------------------------------------------------- elseif talkState[talkUser] == 3 then if msgcontains(msg, 'all') then n = getPlayerBalance(cid) selfSay('Do you want withdraw '..n..' golds ?', cid) talkState[talkUser] = 4 else n = getNumber(msg) selfSay('Do you want withdraw '..n..' golds ?', cid) talkState[talkUser] = 4 end elseif talkState[talkUser] == 4 then if msgcontains(msg, 'yes') then if getPlayerBalance(cid) >= n then doPlayerWithdrawMoney(cid, n) selfSay('Here you are, '..n..' gold. Now your balance account is ' ..getPlayerBalance(cid)..' golds.', cid) talkState[talkUser] = 0 else selfSay('There is not enough gold on your account', cid) end else selfSay('Ok then', cid) end ----------------------TRANSFER---------------------------------------------------------------------------------------- elseif talkState[talkUser] == 5 then if msgcontains(msg, 'all') then n = getPlayerBalance(cid) selfSay('Who would you like transfer '..n..' gold to?', cid) talkState[talkUser] = 6 else n = getNumber(msg) selfSay('Who would you like transfer '..n..' gold to?', cid) talkState[talkUser] = 6 end elseif talkState[talkUser] == 6 then p = msg selfSay('So you would like to transfer '..n..' gold to '..p..'?', cid) talkState[talkUser] = 7 elseif talkState[talkUser] == 7 then if msgcontains(msg, 'yes') then if getPlayerBalance(cid) >= n then if doPlayerTransferMoneyTo(cid, p, n) == TRUE then selfSay('You have transferred '..n..' gold to '..p..' and your account balance is '..getPlayerBalance(cid)..' golds.', cid) talkState[talkUser] = 0 else selfSay('This player does not exist. Please tell me a valid name!', cid) talkState[talkUser] = 0 end else selfSay('There is not enough gold on your account', cid) talkState[talkUser] = 0 end else selfSay('Ok then', cid) talkState[talkUser] = 0 end ----------------------CHANGE GOLD--------------------------------------------------------------------------------- elseif talkState[talkUser] == 8 then n = getNumber(msg) b = n * 100 selfSay('So I should change '..b..' of your gold coins to '..n..' platinum coins for you?', cid) talkState[talkUser] = 9 elseif talkState[talkUser] == 9 then if msgcontains(msg, 'yes') then if doPlayerRemoveItem(cid, 2148, b) == TRUE then doPlayerAddItem(cid, 2152, n) talkState[talkUser] = 0 else selfSay('You don\'t have money.', cid) talkState[talkUser] = 0 end else selfSay('Ok. We cancel.', cid) talkState[talkUser] = 0 end ---------------------CHANGE PLATINUM------------------------------------------------------------------------- elseif talkState[talkUser] == 10 then if msgcontains(msg, 'gold') then selfSay('How many platinum coins do you want to change to gold?', cid) talkState[talkUser] = 11 elseif msgcontains(msg, 'crystal') then selfSay('How many crystal coins do you want to get?', cid) talkState[talkUser] = 13 end elseif talkState[talkUser] == 11 then n = getNumber(msg) b = n * 100 selfSay('So I should change '..n..' of your platinum coins to '..b..' gold coins for you?', cid) talkState[talkUser] = 12 elseif talkState[talkUser] == 12 then if msgcontains(msg, 'yes') then if doPlayerRemoveItem(cid, 2152, n) == TRUE then doPlayerAddItem(cid, 2148, b) talkState[talkUser] = 0 else selfSay('You don\'t have money.', cid) talkState[talkUser] = 0 end else selfSay('Ok. We cancel.', cid) talkState[talkUser] = 0 end elseif talkState[talkUser] == 13 then n = getNumber(msg) b = n * 100 selfSay('So I should change '..b..' of your platinum coins to '..n..' crystal coins for you?', cid) talkState[talkUser] = 14 elseif talkState[talkUser] == 14 then if msgcontains(msg, 'yes') then if doPlayerRemoveItem(cid, 2152, b) == TRUE then doPlayerAddItem(cid, 2160, n) talkState[talkUser] = 0 else selfSay('You don\'t have money.', cid) talkState[talkUser] = 0 end else selfSay('Ok. We cancel.', cid) talkState[talkUser] = 0 end ---------------------CHANGE CRYSTAL------------------------------------------------------------------------------- elseif talkState[talkUser] == 15 then n = getNumber(msg) b = n * 100 selfSay('So I should change '..n..' of your crystal coins to '..b..' platinum coins for you?', cid) talkState[talkUser] = 16 elseif talkState[talkUser] == 16 then if msgcontains(msg, 'yes') then if doPlayerRemoveItem(cid, 2160, n) == TRUE then doPlayerAddItem(cid, 2152, b) talkState[talkUser] = 0 else selfSay('You don\'t have money.', cid) talkState[talkUser] = 0 end else selfSay('Ok. We cancel.', cid) talkState[talkUser] = 0 end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) -- function maded by Gesior-- function getNumber(txt) --return number if its number and is > 0, else return 0 x = string.gsub(txt,"%a","") x = tonumber(x) if x ~= nill and x > 0 then return x else return 0 end end  
     
     

    Salve o arquivo e feche-o.

    Agora seu NPC está pronto, basta adicioná-lo ao seu mapa usando o Map Editor.
    Espero que seja de utilidade de alguém...

    Créditos: Tibiaa4e (outro forum)
    Pequeno Tuto: Adriano Swatt
     
    Testado em:
    Versões do Client: 8.54 e 8.60.
    Versões da Distro: TFS 3.4.5, TFS 0.4 e Alissow 0.4.1.

    Espero que seja útil.


    Abraços'
  5. Gostei
    Tryaron recebeu reputação de Tricoder em (Resolvido)Remeres nao encontra instalaçao do Tibia   
    Verdade irmao, brigado, reputado!
  6. Gostei
    Tryaron deu reputação a Tricoder em (Resolvido)Remeres nao encontra instalaçao do Tibia   
    É assim mesmo, parece que não tem arquivo nenhum, mas é só você clicar na pasta que está o Tibia e abrir. 
  7. Gostei
    Tryaron deu reputação a zipter98 em Npc dando itens a x vocation   
    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())  
  8. Gostei
    Tryaron deu reputação a joadson em Npc dando itens a x vocation   
    Aqui...
    vá em npcs/scripts e crie um arquivo chamado Delivery Itens.lua e coloque isso dentro
    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 if msgcontains(msg, 'reward') or msgcontains(msg, 'REWARD') and getPlayerStorageValue(cid, 22123) == 0 then if getPlayerVocation(cid) == 1 and getPlayerStorageValue(cid, 22123) == 0 then doPlayerAddItem(cid, 2160, 100) --2160 é o ID do item nesse caso é crystal coins e 100 é a quantidade setPlayerStorageValue(cid, 22123, 1) doPlayerSendTextMessage(cid,22,"Você pegou os itens de Sorcerer.") elseif getPlayerVocation(cid) == 2 and getPlayerStorageValue(cid, 22123) == 0 then doPlayerAddItem(cid, 2160, 100) setPlayerStorageValue(cid, 22123, 1) doPlayerSendTextMessage(cid,22,"Você pegou os itens de Druid.") elseif getPlayerVocation(cid) == 3 and getPlayerStorageValue(cid, 22123) == 0 then doPlayerAddItem(cid, 2160, 100) setPlayerStorageValue(cid, 22123, 1) doPlayerSendTextMessage(cid,22,"Você pegou os itens de Paladin.") elseif getPlayerVocation(cid) == 4 and getPlayerStorageValue(cid, 22123) == 0 then doPlayerAddItem(cid, 2160, 100) setPlayerStorageValue(cid, 22123, 1) doPlayerSendTextMessage(cid,22,"Você pegou os itens de Knight.") return true end if msgcontains(msg, 'reward') or msgcontains(msg, 'REWARD') and getPlayerStorageValue(cid, 22123) == 1 then end npcHandler:say('Você já pegou os seus itens.', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) e depois volte para pasta NPCs e crie um arquivo chamado Delivery Itens.xml e coloque isso dentro.
    <?xml version="1.0" encoding="UTF-8"?> <npc name="Delivery Itens" script="data/npc/scripts/Delivery Itens.lua" walkinterval="0" floorchange="0"> <health now="150" max="150"/> <look type="131" head="95" body="95" legs="95" feet="95" corpse="6080"/> </npc> Agora vá em creaturescript/script e abra o login.lua e coloque isso em algum lugar
    if getPlayerStorageValue(cid, 22123) == -1 then setPlayerStorageValue(cid, 22123, 0) end Depois disso é só adicionar no RME ou usar o comando /n Delivery Itens e fazer os testes.
  9. Gostei
    Tryaron deu reputação a xBen em Regen sem food   
    Claro que é, só criar uma função que fica adicionando hp ou mana x tempo no login

    fiz uma funçãozinha aqui simples, tu adiciona na LIB e coloca no login tipo

    regen(cid, 100, 5) -- vai adicionar 100 de mana e hp a cada 5 segundos , se ajudei rep+

     
    function regen(cid, percent, time) if not isCreature(cid) then return true end doCreatureAddHealth(cid, percent) doCreatureAddMana(cid, percent addEvent(regen, time*1000, cid, percent, time) end
  10. Gostei
    Tryaron recebeu reputação de joaotmed em [Resolvido] Sobre dedicado   
    João para abrir essa área remota é só ir em iniciar depois executar e escrever "mstsc" sem as aspas, que abrirá uma janela,
    daí só entrar com os dados do host.. 
     
    Sear me desculpe, mas duvido muito que houve essa ''falha deles'', sou cliente deles e o suporte é demais.. Provavelmente
    o João nem entrou em contato, ou se entrou fez o tópico no mesmo instante sem aguardar a resposta.. Pois sempre tive
    minhas perguntas respondidas em menos de 1 hora (todas, até de madrugada), e só tenho pontos bons à falar, não é atoa
    que indico p/ o pessoal.
     
    E como a galera disse aí em cima também, é interessante dar uma pesquisada a mais fera, tanto no site deles vc encontra
    essas informações básicas.. 
     
    Abraço!
  11. Gostei
    Tryaron recebeu reputação de joaotmed em [Resolvido] Sobre dedicado   
    hehe ah sim =D.
    qualquer duvida posta aí que tamo ae

Informação Importante

Confirmação de Termo