Ir para conteúdo
  • 0

carlinhoo0ww

Pergunta

I ae Galerinha Do xT de Boa??

galera Adicionei Um NPC De Missao Em Meu OT So Que ele so fala

(Storkus Missao: Welcome, Nasda! I have been expecting you.) Quando O Player Da Hi Ja tentei Mudar e nada Sempre buga o NPC

como posso por em xml para ele falar?

Esse è o Script dele.
 

Spoiler

 

<?xml version="1.0"?>

<npc name="Ministro Da Defesa" script="data/npc/scripts/rainbowtask.lua" access="3" lookdir="2" walkinterval="2000">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="193" head="79" body="94" legs="114" feet="77" addons="3"/>
</npc>

 

 

Spoiler

  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 tokenid = 12429
        local storage = 90218
        local getstorage = getPlayerStorageValue(cid, storage)
        local sorrymessage = "Cara Voce Acha Que Estou De Brincadeira Va Embora E Me Traga O Que Pedi!..."
        local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
        if msgcontains(msg, 'missao') then
                if getstorage == 6 then
                        npcHandler:say("Cara Obrigado Voce Me Ajudou A Salvar As Magias Do Nosso Mundo.", cid)
                elseif getstorage < 6 then
                        npcHandler:say("Me Passa Logo O Que Lhe Pedi, Que O Mundo Da Magia Esta Por Um Triz.", cid)
                        talkState[talkUser] = 1
                end
        elseif msgcontains(msg, 'Items') then
                if getstorage < 1 then
                        npcHandler:say("Voce Ainda Esta No Primeiro Item Que é 5 Legionnaire Flags.", cid)
                elseif getstorage == 1 then
                        npcHandler:say("Voce Esta No Segundo Item Que è 10 Dragon Priest Wandtip.", cid)
                elseif getstorage == 2 then
                        npcHandler:say("Voce Esta No Terceiro Item Que sao 15 High Guard Shoulderplates.", cid)
                elseif getstorage == 3 then
                        npcHandler:say("Voce Esta No Quarto Item, Traga 20 High Guard Flag.", cid)
                elseif getstorage == 4 then
                        npcHandler:say("Voce Esta No Quinto Item Que é 20 Cursed Shoulder Spikes..", cid)
                elseif getstorage == 5 then
                        npcHandler:say("Voce Esta No Sexto Item. Traga 10 Corrupted Flag.", cid)
                elseif getstorage == 6 then
                        npcHandler:say("Voce Ja Nos Ajudou e Muito. Obrigado..", cid)
                end
        elseif msgcontains(msg, 'yes') then
                if talkState[talkUser] == 1 then
                        if getstorage < 0 then
                                if doPlayerRemoveItem(cid, 11328, 5) == TRUE then
                                        npcHandler:say("Estou Precisando De 10 Dragon Prist Wandtip Para Dar Continuidade A Magia.'.", cid)
                                        setPlayerStorageValue(cid, storage, 1)
                                        doPlayerAddExp(cid, 100000)
                                        doPlayerAddItem(cid, 12427, 4)
                                        talkState[talkUser] = 0
                                elseif doPlayerRemoveItem(cid, 11328, 5) == FALSE then
                                        npcHandler:say(sorrymessage, cid)
                                        talkState[talkUser] = 0
                                end
                        elseif getstorage == 1 then
                                if doPlayerRemoveItem(cid, 11355, 10) == TRUE then
                                        npcHandler:say("Me Traga 10 High Guard Shoulderplates Para Voce Poder Se Salvar Dos Lizards Tambem.'.", cid)
                                        setPlayerStorageValue(cid, storage, 2)
                                        doPlayerAddExp(cid, 200000)
                                        doPlayerAddItem(cid, 11328, 15)
                                        talkState[talkUser] = 0
                                elseif doPlayerRemoveItem(cid, 11355, 10) == FALSE then
                                        npcHandler:say(sorrymessage, cid)
                                        talkState[talkUser] = 0
                                end
                        elseif getstorage == 2 then
                                if doPlayerRemoveItem(cid, 11327, 15) == TRUE then
                                        npcHandler:say("Preciso De 15 High Guard Flag Estamos Quase Com Todos Os Items.'.", cid)
                                        setPlayerStorageValue(cid, storage, 3)
                                        doPlayerAddExp(cid, 300000)
                                        doPlayerAddItem(cid, 12373, 25)
                                        talkState[talkUser] = 0
                                elseif doPlayerRemoveItem(cid, 11327, 15) == FALSE then
                                        npcHandler:say(sorrymessage, cid)
                                        talkState[talkUser] = 0
                                end
                        elseif getstorage == 3 then
                                if doPlayerRemoveItem(cid, 11326, 20) == TRUE then
                                        npcHandler:say("Cara Chegamos Nos Mais Dificeis Temos Que Ter 20 Cursed Shoulder Spikes.'.", cid)
                                        setPlayerStorageValue(cid, storage, 4)
                                        doPlayerAddExp(cid, 400000)
                                        doPlayerAddItem(cid, 2816, 6)
                                        talkState[talkUser] = 0
                                elseif doPlayerRemoveItem(cid, 11326, 20) == FALSE then
                                        npcHandler:say(sorrymessage, cid)
                                        talkState[talkUser] = 0
                                end
                        elseif getstorage == 4 then
                                if doPlayerRemoveItem(cid, 11321, 20) == TRUE then
                                        npcHandler:say("Precisamos De um Item Muito Raro Do Mestre Dos lizards Que é o ultimo Item Que Falta 10 Corrupted Flag.'.", cid)
                                        setPlayerStorageValue(cid, storage, 5)
                                        doPlayerAddExp(cid, 500000)
                                        doPlayerAddItem(cid,
0, 5)
                                        talkState[talkUser] = 0
                                elseif doPlayerRemoveItem(cid, 11321, 20) == FALSE then
                                        npcHandler:say(sorrymessage, cid)
                                        talkState[talkUser] = 0
                                end
                        elseif getstorage == 5 then
                                if doPlayerRemoveItem(cid, 11320, 10) == TRUE then
                                        npcHandler:say("Muito Obrigado, Muito Obrigado, Voce Me Ajudou Muito e o Mundo Da Magia Esta Salvo Graças a Voce.'.", cid)
                                        setPlayerStorageValue(cid, storage, 6)
                                        doPlayerAddExp(cid, 600000)
                                        doPlayerAddItem(cid, 8300, 3)
                                        talkState[talkUser] = 0
                                elseif doPlayerRemoveItem(cid, 11320, 10) == FALSE then
                                        npcHandler:say(sorrymessage, cid)
                                        talkState[talkUser] = 0
                                end
                        end
                end
        elseif(msgcontains(msg, 'no') and talkState[talkUser] == 1) then
                npcHandler:say("Cade O Que Lhe Pedi?.", cid)
                talkState[talkUser] = 0
        end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

Alguem Pode Me ajudar Com Isso PF?

Dou REP++++

Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts Recomendados

  • 0

@carlinhoo0ww, a tag pro xml que faz o npc dar uma mensagem de "boas vindas" é essa:

<parameter key="message_greet" value="MENSAGEM AQUI!!!!!!!!!"/>


Exemplo de uso:

 <?xml version="1.0"?>

<npc name="Ministro Da Defesa" script="data/npc/scripts/rainbowtask.lua" access="3" lookdir="2" walkinterval="2000">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="193" head="79" body="94" legs="114" feet="77" addons="3"/>

<parameters>
  <parameter key="message_greet" value="MENSAGEM AQUI!!!!!!!!!"/>
</parameters>
  
</npc> 

 

Link para o comentário
Compartilhar em outros sites

  • 0
3 horas atrás, Danihcv disse:

@carlinhoo0ww, a tag pro xml que faz o npc dar uma mensagem de "boas vindas" é essa:


<parameter key="message_greet" value="MENSAGEM AQUI!!!!!!!!!"/>


Exemplo de uso:


 <?xml version="1.0"?>

<npc name="Ministro Da Defesa" script="data/npc/scripts/rainbowtask.lua" access="3" lookdir="2" walkinterval="2000">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="193" head="79" body="94" legs="114" feet="77" addons="3"/>

<parameters>
  <parameter key="message_greet" value="MENSAGEM AQUI!!!!!!!!!"/>
</parameters>
  
</npc> 

 

ja tentei fazer isso, n vai nem fudendo.

Editado por carlinhoo0ww
Link para o comentário
Compartilhar em outros sites

  • 0

@carlinhoo0ww, tente mudar o aqruivo .lua desse npc pro seguinte:

Citar

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 mensagemOLA = "MENSAGEM AQUI!!!!!!!!!!!!!!" --aqui você põe a msg de boas vindas do npc

function greetCallback(cid)
    npcHandler:say(mensagemOLA, cid)
    npcHandler:addFocus(cid)
    return true
end


function creatureSayCallback(cid, type, msg)
        if(not npcHandler:isFocused(cid)) then
                return false
        end
        local tokenid = 12429
        local storage = 90218
        local getstorage = getPlayerStorageValue(cid, storage)
        local sorrymessage = "Cara Voce Acha Que Estou De Brincadeira Va Embora E Me Traga O Que Pedi!..."
        local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
        if msgcontains(msg, 'missao') then
                if getstorage == 6 then
                        npcHandler:say("Cara Obrigado Voce Me Ajudou A Salvar As Magias Do Nosso Mundo.", cid)
                elseif getstorage < 6 then
                        npcHandler:say("Me Passa Logo O Que Lhe Pedi, Que O Mundo Da Magia Esta Por Um Triz.", cid)
                        talkState[talkUser] = 1
                end
        elseif msgcontains(msg, 'Items') then
                if getstorage < 1 then
                        npcHandler:say("Voce Ainda Esta No Primeiro Item Que é 5 Legionnaire Flags.", cid)
                elseif getstorage == 1 then
                        npcHandler:say("Voce Esta No Segundo Item Que è 10 Dragon Priest Wandtip.", cid)
                elseif getstorage == 2 then
                        npcHandler:say("Voce Esta No Terceiro Item Que sao 15 High Guard Shoulderplates.", cid)
                elseif getstorage == 3 then
                        npcHandler:say("Voce Esta No Quarto Item, Traga 20 High Guard Flag.", cid)
                elseif getstorage == 4 then
                        npcHandler:say("Voce Esta No Quinto Item Que é 20 Cursed Shoulder Spikes..", cid)
                elseif getstorage == 5 then
                        npcHandler:say("Voce Esta No Sexto Item. Traga 10 Corrupted Flag.", cid)
                elseif getstorage == 6 then
                        npcHandler:say("Voce Ja Nos Ajudou e Muito. Obrigado..", cid)
                end
        elseif msgcontains(msg, 'yes') then
                if talkState[talkUser] == 1 then
                        if getstorage < 0 then
                                if doPlayerRemoveItem(cid, 11328, 5) == TRUE then
                                        npcHandler:say("Estou Precisando De 10 Dragon Prist Wandtip Para Dar Continuidade A Magia.'.", cid)
                                        setPlayerStorageValue(cid, storage, 1)
                                        doPlayerAddExp(cid, 100000)
                                        doPlayerAddItem(cid, 12427, 4)
                                        talkState[talkUser] = 0
                                elseif doPlayerRemoveItem(cid, 11328, 5) == FALSE then
                                        npcHandler:say(sorrymessage, cid)
                                        talkState[talkUser] = 0
                                end
                        elseif getstorage == 1 then
                                if doPlayerRemoveItem(cid, 11355, 10) == TRUE then
                                        npcHandler:say("Me Traga 10 High Guard Shoulderplates Para Voce Poder Se Salvar Dos Lizards Tambem.'.", cid)
                                        setPlayerStorageValue(cid, storage, 2)
                                        doPlayerAddExp(cid, 200000)
                                        doPlayerAddItem(cid, 11328, 15)
                                        talkState[talkUser] = 0
                                elseif doPlayerRemoveItem(cid, 11355, 10) == FALSE then
                                        npcHandler:say(sorrymessage, cid)
                                        talkState[talkUser] = 0
                                end
                        elseif getstorage == 2 then
                                if doPlayerRemoveItem(cid, 11327, 15) == TRUE then
                                        npcHandler:say("Preciso De 15 High Guard Flag Estamos Quase Com Todos Os Items.'.", cid)
                                        setPlayerStorageValue(cid, storage, 3)
                                        doPlayerAddExp(cid, 300000)
                                        doPlayerAddItem(cid, 12373, 25)
                                        talkState[talkUser] = 0
                                elseif doPlayerRemoveItem(cid, 11327, 15) == FALSE then
                                        npcHandler:say(sorrymessage, cid)
                                        talkState[talkUser] = 0
                                end
                        elseif getstorage == 3 then
                                if doPlayerRemoveItem(cid, 11326, 20) == TRUE then
                                        npcHandler:say("Cara Chegamos Nos Mais Dificeis Temos Que Ter 20 Cursed Shoulder Spikes.'.", cid)
                                        setPlayerStorageValue(cid, storage, 4)
                                        doPlayerAddExp(cid, 400000)
                                        doPlayerAddItem(cid, 2816, 6)
                                        talkState[talkUser] = 0
                                elseif doPlayerRemoveItem(cid, 11326, 20) == FALSE then
                                        npcHandler:say(sorrymessage, cid)
                                        talkState[talkUser] = 0
                                end
                        elseif getstorage == 4 then
                                if doPlayerRemoveItem(cid, 11321, 20) == TRUE then
                                        npcHandler:say("Precisamos De um Item Muito Raro Do Mestre Dos lizards Que é o ultimo Item Que Falta 10 Corrupted Flag.'.", cid)
                                        setPlayerStorageValue(cid, storage, 5)
                                        doPlayerAddExp(cid, 500000)
                                        doPlayerAddItem(cid,
0, 5)
                                        talkState[talkUser] = 0
                                elseif doPlayerRemoveItem(cid, 11321, 20) == FALSE then
                                        npcHandler:say(sorrymessage, cid)
                                        talkState[talkUser] = 0
                                end
                        elseif getstorage == 5 then
                                if doPlayerRemoveItem(cid, 11320, 10) == TRUE then
                                        npcHandler:say("Muito Obrigado, Muito Obrigado, Voce Me Ajudou Muito e o Mundo Da Magia Esta Salvo Graças a Voce.'.", cid)
                                        setPlayerStorageValue(cid, storage, 6)
                                        doPlayerAddExp(cid, 600000)
                                        doPlayerAddItem(cid, 8300, 3)
                                        talkState[talkUser] = 0
                                elseif doPlayerRemoveItem(cid, 11320, 10) == FALSE then
                                        npcHandler:say(sorrymessage, cid)
                                        talkState[talkUser] = 0
                                end
                        end
                end
        elseif(msgcontains(msg, 'no') and talkState[talkUser] == 1) then
                npcHandler:say("Cade O Que Lhe Pedi?.", cid)
                talkState[talkUser] = 0
        end
return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

A parte em vermelho é a parte pra vc configurar a mensagem de boas vindas do npc. As partes em verde são o que eu adicionei.

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...