Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 onPlayerCloseChannel(cid) npcHandler:onPlayerCloseChannel(cid) end
- local node1 = keywordHandler:addKeyword({'magia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Me fale agora qual é a sua vocação.'})
- local node2 = keywordHandler:addKeyword({'sorcerer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja aprender a magia de "Conjurar Almas" por 480 gps?'})
- node2:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'Conjurar Almas', vocation = 1, price = 170, level = 10})
- node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Volte em breve.', reset = true})
- local node3 = keywordHandler:addKeyword({'master sorcerer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja aprender a magia de "Conjurar Almas" por 480 gps?'})
- node3:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'Conjurar Almas', vocation = 5, price = 170, level = 10})
- node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Volte em breve.', reset = true})
- local node12 = keywordHandler:addKeyword({'infernalist'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja aprender a magia de "Conjurar Almas" por 480 gps?'})
- node12:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'Conjurar Almas', vocation = 11, price = 170, level = 10})
- node12:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Volte em breve.', reset = true})
- local node13 = keywordHandler:addKeyword({'master infernalist'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja aprender a magia de "Conjurar Almas" por 480 gps?'})
- node13:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'Conjurar Almas', vocation = 12, price = 170, level = 10})
- node13:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Volte em breve.', reset = true})
- local node4 = keywordHandler:addKeyword({'druid'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja aprender a magia de "Conjurar Almas" por 480 gps?'})
- node4:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'Conjurar Almas', vocation = 2, price = 170, level = 10})
- node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Volte em breve.', reset = true})
- local node5 = keywordHandler:addKeyword({'elder druid'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja aprender a magia de "Conjurar Almas" por 480 gps?'})
- node5:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'Conjurar Almas', vocation = 6, price = 170, level = 10})
- node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Volte em breve.', reset = true})
- local node6 = keywordHandler:addKeyword({'paladin'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja aprender a magia de "Conjurar Almas" por 480 gps?'})
- node6:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'Conjurar Almas', vocation = 3, price = 170, level = 10})
- node6:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Volte em breve.', reset = true})
- local node7 = keywordHandler:addKeyword({'royal paladin'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja aprender a magia de "Conjurar Almas" por 480 gps?'})
- node7:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'Conjurar Almas', vocation = 7, price = 170, level = 10})
- node7:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Volte em breve.', reset = true})
- local node8 = keywordHandler:addKeyword({'knight'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Desculpe, eu não tenho nenhuma magia para sua vocação no momento.'})
- local node9 = keywordHandler:addKeyword({'elite knight'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Desculpe, eu não tenho nenhuma magia para sua vocação no momento.'})
- local node10 = keywordHandler:addKeyword({'drunou'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Desculpe, eu não tenho nenhuma magia para sua vocação no momento.'})
- local node11 = keywordHandler:addKeyword({'lord drunou'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Desculpe, eu não tenho nenhuma magia para sua vocação no momento.'})
- npcHandler:addModule(FocusModule:new())
- -------
- function getPlayerMoney(cid)
- gold = getPlayerItemCount(cid,2148)
- plat = getPlayerItemCount(cid,2152)*100
- crys = getPlayerItemCount(cid,2160)*10000
- money = gold + plat + crys
- return money
- end
- 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 onPlayerEndTrade(cid) npcHandler:onPlayerEndTrade(cid) end
- function creatureSayCallback(cid, type, msg)
- if(not npcHandler:isFocused(cid)) then
- return false
- end
- if(msgcontains(msg:lower(), "ceremonial ankh") or msgcontains(msg:lower(), "ceremonial") or msgcontains(msg:lower(), "ankh")) then
- selfSay('Você quer comprar um ceremonial ankh por 3700gps?', cid)
- conversazodon = 1
- return true
- elseif(msgcontains(msg:lower(), "sim") or msgcontains(msg:lower(), "yes")) and conversazodon == 1 then
- if(getPlayerMoney(cid) >= 3700) then
- doPlayerRemoveMoney(cid,3700)
- doPlayerAddItem(cid, 6561, 1)
- selfSay('Aqui está.', cid)
- else
- selfSay('Você não tem gps suficientes, é necessário 3700 gps.', cid)
- end
- conversazodon = 0
- return true
- ------------------------------------------------
- ---------------- LUCAS CP EDIT -----------------
- ------------------------------------------------
- elseif(msgcontains(msg:lower(), "lottery ticket") or msgcontains(msg:lower(), "lottery") or msgcontains(msg:lower(), "ticket")) then
- selfSay('Você quer trocar 100 frascos de mana {médio} vazios, ou 70 frascos de mana {grandes} vazios, ou 50 frascos de mana {gigantes} vazios por 1 lottery ticket?', cid)
- conversaTicket = 1
- return true
- elseif(msgcontains(msg:lower(), "médios") or msgcontains(msg:lower(), "medios") or msgcontains(msg:lower(), "médio") or msgcontains(msg:lower(), "medio")) and conversaTicket == 1 then
- if(getPlayerItemCount(cid, 7636) >= 100) then
- doPlayerRemoveItem(cid,7636, 100)
- doPlayerAddItem(cid, 5957, 1)
- selfSay('Aqui está.', cid)
- else
- selfSay('Você não tem frascos suficientes.', cid)
- end
- conversaTicket = 0
- return true
- elseif(msgcontains(msg:lower(), "grande") or msgcontains(msg:lower(), "grandes")) and conversaTicket == 1 then
- if(getPlayerItemCount(cid, 7634) >= 70) then
- doPlayerRemoveItem(cid,7634, 70)
- doPlayerAddItem(cid, 5957, 1)
- selfSay('Aqui está.', cid)
- else
- selfSay('Você não tem frascos suficientes.', cid)
- end
- conversaTicket = 0
- return true
- elseif(msgcontains(msg:lower(), "gigantes") or msgcontains(msg:lower(), "gigante")) and conversaTicket == 1 then
- if(getPlayerItemCount(cid, 7635) >= 50) then
- doPlayerRemoveItem(cid,7635, 50)
- doPlayerAddItem(cid, 5957, 1)
- selfSay('Aqui está.', cid)
- else
- selfSay('Você não tem frascos suficientes.', cid)
- end
- conversaTicket = 0
- return true
- elseif(msgcontains(msg:lower(), "nao") or msgcontains(msg:lower(), "não") or msgcontains(msg:lower(), "no")) and (conversaTicket == 1 or conversazodon == 0) then
- selfSay('Tudo bem, volte quando estiver interessado.', cid)
- conversaTicket = 0
- conversazodon = 0
- return true
- --------------------------------------------------------------------------
- --------------------------------- FIM EDIÇÃO LUCAS CP ---------------------
- ----------------------------------------------------------------------------
- end
- end
- npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
- npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement