Ir para conteúdo

Featured Replies

  • Respostas 12
  • Visualizações 1.3k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Skydangerous
    Skydangerous

    Ai amigo é meio chatinho de fazer, o jeito que eu sei é assim. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHa

  • Skydangerous
    Skydangerous

    nas spells.xml vai tar assm needlearn="0" troca para needlearn="1"

Postado
26 minutos atrás, Rafaelizzidoro disse:

Legal @Subyth, obrigado, mas dai como ficaria a questão se o player tentar comprar a mesma magia ? 

O principal eu esqueci né kkkk OMG viajei rsrs

 

Tenta esse

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


-- OTServ event handling functions start
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
-- OTServ event handling functions end

-- Function to selftsay
function creatureSayCallback(cid, type, msg)

    if(npcHandler.focus ~= cid) then
        return false
    end
    
    if msgcontains(msg,'spells') then
        if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 then -- edit this vocation number
            selfSay('For which level would you like to learn spells 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 35, 37, 38, 41, 45, 55, 60?')
        else
            selfSay('Sorry, I only sell spells to sorcerers.') -- edit this name of vocation
        end
		    selfSay('You alread the spell!', cid) -- bad inglish HEUHEUEH
    end
return 1
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
-- End Function to selftsay


local node1 = keywordHandler:addKeyword({'light healing'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn light healing for 170 gp?'})
node1:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'light healing', vocation = 2, price = 170, level = 9})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


npcHandler:addModule(FocusModule:new())

 

Postado

Blz @Subyth , estou no trabalho, mas assim que chegar em casa vou realizar o teste.

 

Ali na hora de comprar a spell, pra eu informar que o player comprou a spell, eu adiciono "text = 'Você comprou a magia Exori Flam.'})" ?

 

Ficando assim "

 

node1:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'light healing', vocation = 2, price = 170, level = 9 text = 'Você comprou a magia light healing.'}) "

 

Desculpe, não manjo muito dessas coisas rsrs

 

aproveitando já, para adicionar outras magias é só ali no lugar de "node1:" colocar node2, node3, node4, node5 e assim por diante, certo?

 

Editado por Rafaelizzidoro (veja o histórico de ediçõ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.6k

Informação Importante

Confirmação de Termo