Ir para conteúdo

Featured Replies

Postado
--[[
  
      Basta editar os ["town1"], colocando o nome da cidade e a pos dela logo a frente...
      abrçs

]]--

local free = {
		
        ["town1"] = {x= ,y= ,z= },
	["town2"] = {x= ,y= ,z= },
	["town3"] = {x= ,y= ,z= },
	["town4"] = {x= ,y= ,z= },
	["town5"] = {x= ,y= ,z= },
	["town6"] = {x= ,y= ,z= },
	["town7"] = {x= ,y= ,z= }
}
local vip = {
     	
        ["town1"] = {x= ,y= ,z= },
     	["town2"] = {x= ,y= ,z= },
     	["town3"] = {x= ,y= ,z= }
}
local cost = 300

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
npcHandler.topic = {}

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
	
       for city, tp in pairs(free) do
           if msgcontains(msg, city) then
              npcHandler:say('you are sure?', cid)
              npcHandler.topic[cid] = 1
           elseif msgcontains(msg, 'yes') and npcHandler.topic[cid] == 1 then
              if doPlayerRemoveMoney(cid, cost) then
                 doTeleportThing(cid, tp)
                 npcHandler:say('Let\'s GO', cid)
                 npcHandler.topic[cid] = 0
              else
                  npcHandler:say('Sorry, you don\'t have enough money', cid)
                  npcHandler.topic[cid] = 0
              end
           end
       end
       
       
       for citys, tps in pairs(vip) do
           if msgcontains(msg, citys) then
              npcHandler:say('you are sure?', cid)
              npcHandler.topic[cid] = 2
           elseif msgcontains(msg, 'yes') and npcHandler.topic[cid] == 2 then
              if getPlayerPremiumDays(cid) > 0 then
                 if doPlayerRemoveMoney(cid, cost) then
                    doTeleportThing(cid, tps)
                    npcHandler:say('Let\'s GO', cid)
                    npcHandler.topic[cid] = 0 
                 else
                    npcHandler:say('Sorry, you don\'t have enough money', cid)
                    npcHandler.topic[cid] = 0   
                 end
              else
                  npcHandler:say('Você não tem VIP!', cid)
                  npcHandler.topic[cid] = 0
              end
           end
       end
       
       if msgcontains(msg, 'no') then
          npcHandler:say('Bye!', cid)
          npcHandler.topic[cid] = 0
       end
                       
	return true
end
					
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())	
<?xml version="1.0" encoding="UTF-8"?>
<npc name="EDITEAQUI" script="NOMEDOARQUIVO.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="152" head="95" body="95" legs="29" feet="56" addons="2" corpse="6080"/>
	<parameters>
	<parameter key="message_greet" value="Sejá Bem-Vindo ao Barco, |PLAYERNAME|.Quer viajar para {town1}, {town2}, {town3}, {town4}, {town5}, {town6} dps edita aqui..." /> 
	</parameters>
</npc>
  • Respostas 34
  • Visualizações 1.5k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • No caso do NPC Chat, o probema é simples: Pegue por exemplo essa fala de seu NPC: selfSay("Sorry, you don\'t have enough money.") Agora pegue como exemplo essa outra mensagem: selfSay('Sorry, you

  • O primeiro erro eu arrumei... já o segundo, não tenho idéia, porque no meu ot 10.35 funciona normal e é script de 8.60... tenta agora e ve se da erro.  

  • Flavio S. Cabral
    Flavio S. Cabral

    isso é minha assinatura se não percebeu rsrsrs

Postado

Tem esse meu também, é de fácil configuração.

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 costfree = 100  -- preço do teleport free
    local costvip = 50     -- preço do teleport vip
    
    local position = {
    pos1 = {x = 160, y = 54, z = 7},  -- posição da 1° cidade e assim sucessivamente....
    pos2 = {x = 160, y = 54, z = 7},
    pos3 = {x = 160, y = 54, z = 7},
    pos4 = {x = 160, y = 54, z = 7},
    pos5 = {x = 160, y = 54, z = 7},
    pos6 = {x = 160, y = 54, z = 7},
    pos7 = {x = 160, y = 54, z = 7},
    pos8 = {x = 160, y = 54, z = 7},
    pos9 = {x = 160, y = 54, z = 7},
    pos10 = {x = 160, y = 54, z = 7},
    }
    
    local cidades = {    
    cidade1 = "demon",  -- nomes das cidades.
    cidade2 = "hydra", -- OBS:  onde tiver elseif msgcontains(msg, 'demon') , mude o demon para o mesmo nome da cidade, caso contrario o player ficará perdido
    cidade3 = "drag",
    cidade4 = "bug",
    cidade5 = "wasp",
    cidade6 = "ferumbras",
    cidade7 = "dragon lord",
    cidade8 = "morgaroth",
    cidade9 = "rot",
    cidade10 = "tibia"
    }
     
    if msgcontains(msg, 'travel') or msgcontains(msg, 'TRAVEL') then
    npcHandler:say('Eu posso te levar para '.. cidades.cidade1 .. ' , '.. cidades.cidade2 .. ' , '.. cidades.cidade3 .. ' , '.. cidades.cidade4 .. ' ,'.. cidades.cidade5 .. ' , '.. cidades.cidade6 .. ' , '.. cidades.cidade7 .. ' , '.. cidades.cidade8 .. ' , '.. cidades.cidade9 .. ' , e '.. cidades.cidade10 .. ' por um pequeno custo.', cid)
    elseif msgcontains(msg, 'demon') then
    npcHandler:say('Eu posso te levar para '.. cidades.cidade1 .. ', por uma quantia de '.. costfree .. ' golds.', cid)
    elseif msgcontains(msg, 'yes') or msgcontains(msg, 'yes') then
    if doPlayerRemoveMoney(cid, costfree) == TRUE then
    doPlayerRemoveMoney(cid, costfree)
    doTeleportThing(cid, position.pos1)
    else
    npcHandler:say('Desculpe, você não tem o dinheiro para viajar.', cid)
    end
        
    elseif msgcontains(msg, 'hydra') then
    npcHandler:say('Eu posso te levar para '.. cidades.cidade2 .. ', por uma quantia de '.. costfree .. ' golds.', cid)
    elseif msgcontains(msg, 'yes') or msgcontains(msg, 'yes') then
    if doPlayerRemoveMoney(cid, costfree) == TRUE then
    doPlayerRemoveMoney(cid, costfree)
    doTeleportThing(cid, position.pos2)
    else
    npcHandler:say('Desculpe, você não tem o dinheiro para viajar.', cid)
    end
    
    
    elseif msgcontains(msg, 'drag') then
    npcHandler:say('Eu posso te levar para '.. cidades.cidade3 .. ', por uma quantia de '.. costfree .. ' golds.', cid)
    elseif msgcontains(msg, 'yes') or msgcontains(msg, 'yes') then
    if doPlayerRemoveMoney(cid, costfree) == TRUE then
    doPlayerRemoveMoney(cid, costfree)
    doTeleportThing(cid, position.pos3)
    else
    npcHandler:say('Desculpe, você não tem o dinheiro para viajar.', cid)
    end
    
    elseif msgcontains(msg, 'bug') then
    npcHandler:say('Eu posso te levar para '.. cidades.cidade4 .. ', por uma quantia de '.. costfree .. ' golds.', cid)
    elseif msgcontains(msg, 'yes') or msgcontains(msg, 'yes') then
    if doPlayerRemoveMoney(cid, costfree) == TRUE then
    doPlayerRemoveMoney(cid, costfree)
    doTeleportThing(cid, position.pos4)
    else
    npcHandler:say('Desculpe, você não tem o dinheiro para viajar.', cid)
    end
    
    elseif msgcontains(msg, 'wasp') then
    npcHandler:say('Eu posso te levar para '.. cidades.cidade5 .. ', por uma quantia de '.. costfree .. ' golds.', cid)
    elseif msgcontains(msg, 'yes') or msgcontains(msg, 'yes') then
    if doPlayerRemoveMoney(cid, costfree) == TRUE then
    doPlayerRemoveMoney(cid, costfree)
    doTeleportThing(cid, position.pos5)
    else
    npcHandler:say('Desculpe, você não tem o dinheiro para viajar.', cid)
    end
    
    elseif msgcontains(msg, 'ferumbras') then
    npcHandler:say('Eu posso te levar para '.. cidades.cidade6 .. ', por uma quantia de '.. costfree .. ' golds.', cid)
    elseif msgcontains(msg, 'yes') or msgcontains(msg, 'yes') then
    if doPlayerRemoveMoney(cid, costfree) == TRUE then
    doPlayerRemoveMoney(cid, costfree)
    doTeleportThing(cid, position.pos6)
    else
    npcHandler:say('Desculpe, você não tem o dinheiro para viajar.', cid)
    end
    
    elseif msgcontains(msg, 'dragon lord') then
    npcHandler:say('Eu posso te levar para '.. cidades.cidade7 .. ', por uma quantia de '.. costfree .. ' golds.', cid)
    elseif msgcontains(msg, 'yes') or msgcontains(msg, 'yes') then
    if doPlayerRemoveMoney(cid, costfree) == TRUE then
    doPlayerRemoveMoney(cid, costfree)
    doTeleportThing(cid, position.pos7)
    else
    npcHandler:say('Desculpe, você não tem o dinheiro para viajar.', cid)
    end
    
    elseif msgcontains(msg, 'morgaroth') then
    npcHandler:say('Eu posso te levar para '.. cidades.cidade8 .. ', por uma quantia de '.. costvip .. ' golds.', cid)
    elseif msgcontains(msg, 'yes') or msgcontains(msg, 'yes') then
    if doPlayerRemoveMoney(cid, costvip) == TRUE then
    doPlayerRemoveMoney(cid, costvip)
    doTeleportThing(cid, position.pos8)
    else
    npcHandler:say('Desculpe, você não tem o dinheiro para viajar.', cid)
    end
    
    elseif msgcontains(msg, 'rot') then
    npcHandler:say('Eu posso te levar para '.. cidades.cidade9 .. ', por uma quantia de '.. costvip .. ' golds.', cid)
    elseif msgcontains(msg, 'yes') or msgcontains(msg, 'yes') then
    if doPlayerRemoveMoney(cid, costvip) == TRUE then
    doPlayerRemoveMoney(cid, costvip)
    doTeleportThing(cid, position.pos9)
    else
    npcHandler:say('Desculpe, você não tem o dinheiro para viajar.', cid)
    end
    
    elseif msgcontains(msg, 'tibia') then
    npcHandler:say('Eu posso te levar para '.. cidades.cidade10 .. ', por uma quantia de '.. costvip .. ' golds.', cid)
    elseif msgcontains(msg, 'yes') or msgcontains(msg, 'yes') then
    if doPlayerRemoveMoney(cid, costvip) == TRUE then
    doPlayerRemoveMoney(cid, costvip)
    doTeleportThing(cid, position.pos10)
    else
    npcHandler:say('Desculpe, você não tem o dinheiro para viajar.', cid)
    end
    
    return true
        end
        end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Testado em um servidor 8.60 e funcionou perfeitamente.

Te ajudei?
Se você achar que eu mereço, me dê uma "rep+" e selecione meu post como "melhor resposta"

 

Skype: JoadsonAion

Postado

No caso do NPC Chat, o probema é simples:

Pegue por exemplo essa fala de seu NPC:

selfSay("Sorry, you don\'t have enough money.")

Agora pegue como exemplo essa outra mensagem:

selfSay('Sorry, you don\'t have enough money.', cid)

Percebeu alguma diferença?

O cid no final faz com que o NPC fale as falas dele no NPC Chat, se não tiver o cid, ele fala no default.

cms1-pr%C3%AAmio.png

Postado
  • Autor

 

 

function onLove()

    if getPlayerTrueLove(cid, girlfriend) then

        doPlayerBeHappy(cid, true)

        if not getPlayerNerdStyle(cid) then

            doRemoveVirginity(cid, girlfriend)

            doAddSkillTry(cid, SKILL_FUCK, 1)

        else

            doSendCancel(cid,"you need to change your outfit, nerds don't fuck!")

        end

    else

        doSendCancel(cid,"you do not know how good it feels to be loved")

    end

end

 

 

essa parte eu coloco ond ?

n35408.gif

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo