Ir para conteúdo

Featured Replies

Postado

@bpm91 Perdão, confundi as linhas e acabei me enbanando, segue aí:

Citar

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

local storages = 8888888
function phoenix(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
        if getPlayerStorageValue(cid,storages) == 1 then
            npcHandler:say('So receive the blessing of the life-giving earth, pilgrim!', cid)
            doSendMagicEffect(getCreaturePos(cid), 12)
            setPlayerStorageValue(cid,storages, 0)
        end
    if getPlayerStorageValue(cid,storages) >= 0 then
    npcHandler:say('You already have this blessing.', cid)
    end
 end
keywordHandler:addKeyword({'bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Here you may receive the blessing {Spark of The Phoenix}'})

local node1 = keywordHandler:addKeyword({'phoenix'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'The Spark of the Phoenix is given by name and by the great pyromancer in the nearby fire temple. Do you wish to receive my part of the Spark if the Phoenix?'})
    node1:addChildKeyword({'yes'}, phoenix, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then.', reset = true})
    
    
npcHandler:addModule(FocusModule:new())

 

                                     

Citar

                               "Sábio é aquele que conhece os limites da própria ignorância."

                                    Sócrates

                                                          tenor.gif.b8aeb876d96198271bdf7891a50ce718.gif

  • Respostas 14
  • Visualizações 516
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Posted Images

Postado
  • Autor

@iHolloway dai vou colocar o npc da bless assim

 

local storages = 8888888
function bless(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
        if getPlayerStorageValue(cid,storages) == 1 then
            npcHandler:say('So receive the blessing of the life-giving earth, pilgrim!', cid)
            doSendMagicEffect(getCreaturePos(cid), 12)
            setPlayerStorageValue(cid,storages, 0)
        end
    if getPlayerStorageValue(cid,storages) >= 2 then
    npcHandler:say('You already have this blessing.', cid)
    end
 end
keywordHandler:addKeyword({'bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Here you may receive the blessing {Spark of The Phoenix}'})

local node1 = keywordHandler:addKeyword({'phoenix'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'The Spark of the Phoenix is given by name and by the great pyromancer in the nearby fire temple. Do you wish to receive my part of the Spark if the Phoenix for 10000 gold?'})
    node1:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 2, premium = true, baseCost = 10000, levelCost = 0, startLevel = 10, endLevel = 120})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Oh. You do not have enough money.'})
    
    
npcHandler:addModule(FocusModule:new())

porém o q ta acontecendo é, q eu n to conseguindo remover o storage sacas vou testar aki

Postado
Agora, bpm91 disse:

@iHolloway dai vou colocar o npc da bless assim

 

local storages = 8888888
function bless(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
        if getPlayerStorageValue(cid,storages) == 1 then
            npcHandler:say('So receive the blessing of the life-giving earth, pilgrim!', cid)
            doSendMagicEffect(getCreaturePos(cid), 12)
            setPlayerStorageValue(cid,storages, 0)
        end
    if getPlayerStorageValue(cid,storages) >= 2 then
    npcHandler:say('You already have this blessing.', cid)
    end
 end
keywordHandler:addKeyword({'bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Here you may receive the blessing {Spark of The Phoenix}'})

local node1 = keywordHandler:addKeyword({'phoenix'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'The Spark of the Phoenix is given by name and by the great pyromancer in the nearby fire temple. Do you wish to receive my part of the Spark if the Phoenix for 10000 gold?'})
    node1:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 2, premium = true, baseCost = 10000, levelCost = 0, startLevel = 10, endLevel = 120})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Oh. You do not have enough money.'})
    
    
npcHandler:addModule(FocusModule:new())

porém o q ta acontecendo é, q eu n to conseguindo remover o storage sacas vou testar aki

 

Você testou com o script que te mandei?

                                     

Citar

                               "Sábio é aquele que conhece os limites da própria ignorância."

                                    Sócrates

                                                          tenor.gif.b8aeb876d96198271bdf7891a50ce718.gif

Postado

Não entendi bem, mas acho que você pode se encontrar se eu deixar o código de remover storages aqui, pega ele e muda no local certo que ja era.

setPlayerStorageValue(cid, STORAGE, -1)

 

                                     

Citar

                               "Sábio é aquele que conhece os limites da própria ignorância."

                                    Sócrates

                                                          tenor.gif.b8aeb876d96198271bdf7891a50ce718.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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo