Ir para conteúdo

Featured Replies

Postado

Tipo, pra entrar em meriana/goroma precisa de uma missão, e eu preciso liberar pra o player ir direto do npc pra meriana/goroma sem ter feito a missão, onde eu mudo isso?

Editado por arthur122222 (veja o histórico de edições)

Resolvido por Wakon

Ir para solução
  • Respostas 8
  • Visualizações 1.6k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Vá em "Data/npc/scripts" procure por Captain Waverider.lua e troque por esse: Ai é só o player chegar e falar hi - peg leg - yes.

  • XML dos Npc's fica em "Data/npc" e os arquivos .LUA fica em "Data/npc/scripts"...   Em "Data/npc/scripts" troque o Jack Fate.lua por esse: Agora ainda em "Data/npc/scripts" troque o Jack Fat

Postado
  • Solução

Vá em "Data/npc/scripts" procure por Captain Waverider.lua e troque por esse:

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

function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    
    local player = Player(cid)

    if(msgcontains(msg, "peg leg")) then
            npcHandler:say("Ohhhh. So... <lowers his voice> you know who sent you so I sail you to you know where. <wink> <wink> It will cost 50 gold to cover my expenses. Is it that what you wish?", cid)
            npcHandler.topic[cid] = 1
    elseif(msgcontains(msg, "passage")) then
        if isPlayer(cid) then
            npcHandler:say("<sigh> I knew someone else would claim all the treasure someday. But at least it will be you and not some greedy and selfish person. For a small fee of 200 gold pieces I will sail you to your rendezvous with fate. Do we have a deal?", cid)
            npcHandler.topic[cid] = 2
        elseif(getPlayerStorageValue(cid, 28901) == 4) then
            npcHandler:say("I have to admit this leaves me a bit puzzled.", cid)
            npcHandler.topic[cid] = 0
        end
    elseif(msgcontains(msg, "yes")) then
        if(npcHandler.topic[cid] == 1) then
                if player:getMoney() >= 50 then
                player:removeMoney(50)
                npcHandler:say("And there we go!", cid)
                doTeleportThing(cid, {x = 32346, y = 32625, z = 7})
                player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
                npcHandler.topic[cid] = 0
        else
                npcHandler:say("You don't have enough money.", cid)
                npcHandler.topic[cid] = 0
            end
        elseif(npcHandler.topic[cid] == 2) then
            if player:getMoney() >= 200 then
                player:removeMoney(200)
                npcHandler:say("And there we go!", cid)
                doTeleportThing(cid, {x = 32131, y = 32913, z = 7})
                player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
                npcHandler.topic[cid] = 0
            else
                npcHandler:say("You don't have enough money.", cid)
                npcHandler.topic[cid] = 0
            end
        end
    end
    return true
end

npcHandler:setMessage(MESSAGE_GREET, "Greetings, daring adventurer. If you need a {passage}, let me know.")
npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Oh well.")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Ai é só o player chegar e falar hi - peg leg - yes.

Postado

Deu o seguinte erro:

 

[ERRO - NPC : :loadfromxmll failed to load data/npc/captain waverider.xml: error

parsing element attribute

Tenta trocar seu XML:

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Captain Waverider" script="Captain Waverider.lua" walkinterval="2000" speechbubble="1" floorchange="0">
<health now="100" max="100"/>
<look type="96" head="0" body="0" legs="0" feet="0" addons="0"/>
</npc>

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