Fiz dois npc's em portugues que funcionaram perfeitamente em forgotten server e usam o Jiddo's system.
O primeiro é um npc guarda, que tem a capacidade de atacar players que falam palavrões, além de curar as pessoas até um máximo de 65.
Novos palavrões e a cura dele é facilmente configurável.
Esse segundo npc é o famoso Silvio Santos, adaptado para funcionar em forgotten.
O prêmio dele está em 1milhão de gps, mas isso também é facilmente configurável.
O primeiro é um npc guarda, que tem a capacidade de atacar players que falam palavrões, além de curar as pessoas até um máximo de 65.
Novos palavrões e a cura dele é facilmente configurável.
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local fire = createConditionObject(CONDITION_FIRE)
addDamageCondition(fire, 4, 6000, -20)
addDamageCondition(fire, 4, 6000, -10)
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()
falar = math.random(1,40)
if falar == 1 then
selfSay("Longa vida ao rei!")
end
end
function creatureSayCallback(cid, type, msg)
if(npcHandler.focus ~= cid) then
return FALSE
end
if msgcontains(msg, 'job') then
selfSay("Meu dever e proteger essa cidade da invasao de monstros selvagens.")
elseif msgcontains(msg, 'rei') then
selfSay("Eu protegeria o rei com minha propria vida!")
elseif msgcontains(msg, 'merda') or msgcontains(msg, 'porra') or msgcontains(msg, 'craw') or msgcontains(msg, 'fuck') then
selfSay("Tome isso!")
doCreatureSay(cid, "Ouch!", TALKTYPE_ORANGE_1)
doTargetCombatCondition(0, cid, fire, CONST_ME_NONE)
elseif msgcontains(msg, 'heal') and getCreatureHealth(cid) < 65 then
selfSay("Voce esta machucado, deixe-me cura-lo.")
heal = 65 - getCreatureHealth(cid)
doCreatureAddHealth(cid, heal)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
elseif msgcontains(msg, 'heal') and getCreatureHealth(cid) >= 65 then
selfSay("Voce nao precisa ser curado.")
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
O prêmio dele está em 1milhão de gps, mas isso também é facilmente configurável.
Code:
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 creatureSayCallback(cid, type, msg)
if(npcHandler.focus ~= cid) then
return FALSE
end
if msgcontains(msg, 'jogar') then
jogar = getPlayerStorageValue(cid,3333)
if jogar == -1 then
selfSay('Ma, oe! Podemos começar?')
talk_state = 0
setPlayerStorageValue(cid,3333,1)
elseif jogar == 1 then
selfSay('Infelizmente voce nao pode jogar mais de uma vez')
end
pergunta = 0
elseif msgcontains(msg, 'sim') and pergunta == 0 then
selfSay('Vamos lá! Primeira Pergunta: Em qual destas cidades tem Demon? 1-Edron, 2-Carlin, 3-Darashia, 4-Thais')
pergunta = 1
elseif msgcontains(msg, 'carlin') and pergunta == 1 then
selfSay('Que pena, que pena, a resposta esta errada! ih ih')
pergunta = 0
elseif msgcontains(msg, 'darashia') and pergunta == 1 then
selfSay('Que pena, que pena, a resposta esta errada! ih ih')
pergunta = 0
elseif msgcontains(msg, 'thais') and pergunta == 1 then
selfSay('Que pena, que pena, a resposta esta errada! ih ih')
pergunta = 0
elseif msgcontains(msg, 'edron') and pergunta == 1 then
selfSay('Certa resposta! Vamos la! Segunda Pergunta: Quantos tipos de troll existem? 1-Um, 2-Cinco, 3-Quatro, 4-Três.')
pergunta = 2
elseif msgcontains(msg, 'um') and pergunta == 2 then
selfSay('Que pena, que pena, a resposta esta errada! ih ih')
pergunta = 0
elseif msgcontains(msg, 'quatro') and pergunta == 2 then
selfSay('Que pena, que pena, a resposta esta errada! ih ih')
pergunta = 0
elseif msgcontains(msg, 'cinco') and pergunta == 2 then
selfSay('Que pena, que pena, a resposta esta errada! ih ih')
pergunta = 0
elseif msgcontains(msg, 'tres') and pergunta == 2 then
selfSay('Certa resposta! Terceira Pergunta: Qual o nome do continente desertico do Tibia? 1-Darashia, 2-Darama, 3-Edron, 4-Ankrahmun.')
pergunta = 3
elseif msgcontains(msg, 'darashia') and pergunta == 3 then
selfSay('A resposta esta errada, que pena!')
pergunta = 0
elseif msgcontains(msg, 'edron') and pergunta == 3 then
selfSay('A resposta esta errada, que pena!')
pergunta = 0
elseif msgcontains(msg, 'ankrahmun') and pergunta == 3 then
selfSay('A resposta esta errada, que pena!')
pergunta = 0
elseif msgcontains(msg, 'darama') and pergunta == 3 then
selfSay('Certa resposta mmm! Quarta Pergunta: Qual o nome do esconderijo dos warlocks? 1-Demonia, 2-Demon Land, 3-Warlocklandia, 4-Demona.')
pergunta = 4
elseif msgcontains(msg, 'demonia') and pergunta == 4 then
selfSay('Que pena, voce errou.')
pergunta = 0
elseif msgcontains(msg, 'demon land') and pergunta == 4 then
selfSay('Que pena, voce errou.')
pergunta = 0
elseif msgcontains(msg, 'warlocklandia') and pergunta == 4 then
selfSay('Que pena, voce errou.')
pergunta = 0
elseif msgcontains(msg, 'demona') and pergunta == 4 then
selfSay('Certa resposta! Vamos la, valendo um milhao em moedas de ouro, qual era o nome de meu pai, 1-Clark Kent, 2-Jose, 3-Manuel, 4-Jaco?')
pergunta = 5
elseif msgcontains(msg, 'clark kent') and pergunta == 5 then
selfSay('Errado! Voce perdeu a grande chance, que pena!')
pergunta = 0
elseif msgcontains(msg, 'jose') and pergunta == 5 then
selfSay('Errado! Voce perdeu a grande chance, que pena!')
pergunta = 0
elseif msgcontains(msg, 'manuel') and pergunta == 5 then
selfSay('Errado! Voce perdeu a grande chance, que pena!')
pergunta = 0
elseif msgcontains(msg, 'jaco') and pergunta == 5 then
selfSay('Certa resposta! Voce ganhou um milhao! Parabens!')
pergunta = 0
doPlayerAddItem(cid,2160,100)
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())