Ir para conteúdo

Featured Replies

Postado

@, amigo, por favor, não atualize o tópico fazendo um novo pedido, pois este já tem respostas sobre um outro pedido. Então crie um novo tópico fazendo seu novo pedido.

Te ajudei?? REP + e ficamos quites... <ahttp://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'>

Atenciosamente,

Daniel.

Abraços!

  • Respostas 11
  • Visualizações 428
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • O xWhiteWolf arrumou esse bug ai, testa o script dele: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkS

  • local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid)

  • npc blessings : local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(ci

Postado

npc blessings :

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

    if msgcontains(msg:lower(), "bless") or msgcontains(msg:lower(), "blessing") then
        selfSay("you are sure?", cid)
        talkState[talkUser] = 1
    end

    if msgcontains(msg:lower(), "yes") and talkState[talkUser] == 1 then
        for b = 1, 5 do
            if not getPlayerBlessing(cid, b) then
                doPlayerAddBlessing(cid, b)
                selfSay("you just received the bless!!", cid)
                doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA)
                talkState[talkUser] = 0
            else
                selfSay("you have all blessings.", cod)
                talkState[talkUser] = 0
            end
        end
    elseif msgcontains(msg:lower(), "no") and talkState[talkUser] == 1 then
        selfSay("Bye!!", cid)
        talkState[talkUser] = 0
    end

    return true
end

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

se não souber fazer o arquivo.xml só falar.

 

abrçs

EQD4Qy4.gif

Postado
  • Autor

npc blessings :

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

    if msgcontains(msg:lower(), "bless") or msgcontains(msg:lower(), "blessing") then
        selfSay("you are sure?", cid)
        talkState[talkUser] = 1
    end

    if msgcontains(msg:lower(), "yes") and talkState[talkUser] == 1 then
        for b = 1, 5 do
            if not getPlayerBlessing(cid, b) then
                doPlayerAddBlessing(cid, b)
                selfSay("you just received the bless!!", cid)
                doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA)
                talkState[talkUser] = 0
            else
                selfSay("you have all blessings.", cod)
                talkState[talkUser] = 0
            end
        end
    elseif msgcontains(msg:lower(), "no") and talkState[talkUser] == 1 then
        selfSay("Bye!!", cid)
        talkState[talkUser] = 0
    end

    return true
end

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

se não souber fazer o arquivo.xml só falar.

 

abrçs

Amigo Obrigador por tentar mas pelo oque eu vi ai tem apenas uma bless que vende!

 

Caso Ainda queira Ajuda segui o outro tópico que criei!

 

http://www.tibiaking.com/forum/topic/53848-npc-bless-system-pedido/

wq3bBzt.png
Pokémon Dust Evolution
 
É aonde começa sua nova aventura!! 

 

Facebook

 
Verifique Atualizações

 

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.7k

Informação Importante

Confirmação de Termo