Postado Fevereiro 14, 2015 10 anos 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 if not npcHandler:isFocused(cid) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local config = { strg1 = 200201, -- storage começando a task strg2 = 91001, -- storage finalizou a task (ganha qnd matar os monstros) idiom = 8971 } if msgcontains(msg:lower(),'task') then if getPlayerStorageValue(cid, config.strg2) < 1 then if getPlayerStorageValue(cid, config.strg1) < 1 then if getPlayerStorageValue(cid, config.idiom) == 1 then selfSay('Good one more coming soul of {portal}! Welcome, I hope you can help!', cid) talkState[talkUser] = 1 elseif getPlayerStorageValue(cid, config.idiom) == 2 then selfSay('Que bom mais uma alma vinda do {portal}! Seja bem vindo, espero que possa nos ajudar!.', cid) talkState[talkUser] = 1 end else selfSay('you have to finish the task', cid) talkState[talkUser] = 0 end else selfSay('Voce concluiu a missao, tome aqui um Sabre, use ele ate chegar no nivel 8 e fale com o Oraculo no templo!', cid) selfSay('Ele ira te mandar para Aurea, la fale com !', cid) doPlayerAddItem(cid, 2385, 1) talkState[talkUser] = 0 end elseif msgcontains(msg:lower(), 'portal') and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, config.idiom) == 1 then selfSay('Crystal angel one came down here and Aurea and opened a portal of humans who comes from another dimension for us {save}.', cid) talkState[talkUser] = 2 elseif getPlayerStorageValue(cid, config.idiom) == 2 then selfSay('Crystal uma anja desceu até aqui e em Aurea e abriu um portal de humanos que vem de outra dimensão para nós {salvar}.', cid) talkState[talkUser] = 2 end elseif msgcontains(msg:lower(), 'salvar') or msgcontains(msg:lower(), 'save') and talkState[talkUser] == 2 then if getPlayerStorageValue(cid, config.idiom) == 1 then selfSay('We are in an apocalyptic world, at war with several races. And you can be! {the chosen}', cid) talkState[talkUser] = 3 elseif getPlayerStorageValue(cid, config.idiom) == 2 then selfSay('Estamos em um mundo apocalíptico, em guerra com varias raças. E voce pode ser o {escolhido}!', cid) talkState[talkUser] = 3 end elseif msgcontains(msg:lower(), 'escolhido') or msgcontains(msg:lower(), 'the chosen') and talkState[talkUser] == 3 then if getPlayerStorageValue(cid, config.idiom) == 1 then selfSay('Congratulations, now with permission.', cid) selfSay('Such as our plague of {rats} in the city that are climbing down the drain!', cid) talkState[talkUser] = 4 elseif getPlayerStorageValue(cid, config.idiom) == 2 then selfSay('Calma primeiro precisamos treinar, voce deve nos ajudar com coisas {simples}, ate estar bem treinado!', cid) selfSay('Como por exemplo a nossa praga de {rats} na cidade que estão subindo pelos bueiros!', cid) talkState[talkUser] = 4 end elseif msgcontains(msg:lower(), 'rats') and talkState[talkUser] == 4 then if getPlayerStorageValue(cid, config.idiom) == 1 then selfSay('Okay, so help us get this over with and kill 10 rats in the gutter in front here.', cid) setPlayerStorageValue(cid, strg1, 1) talkState[talkUser] = 0 elseif getPlayerStorageValue(cid, config.idiom) == 2 then selfSay('Ok, então ajuda-nos a acabar com isso e mate 10 ratos no bueiro aqui na frente.', cid) setPlayerStorageValue(cid, strg1, 1) talkState[talkUser] = 0 end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Editado Fevereiro 14, 2015 10 anos por Summ (veja o histórico de edições)
Postado Fevereiro 14, 2015 10 anos se não der tenta isso 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 if not npcHandler:isFocused(cid) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local config = { strg1 = 200201, -- storage começando a task strg2 = 91001, -- storage finalizou a task (ganha qnd matar os monstros) idiom = 8971 } if msgcontains(msg:lower(),'task') or msgcontains(msg:lower(),'hi') then if getPlayerStorageValue(cid, config.strg2) < 1 then if getPlayerStorageValue(cid, config.strg1) < 1 then if getPlayerStorageValue(cid, config.idiom) == 1 then selfSay('Good one more coming soul of {portal}! Welcome, I hope you can help!', cid) talkState[talkUser] = 1 elseif getPlayerStorageValue(cid, config.idiom) == 2 then selfSay('Que bom mais uma alma vinda do {portal}! Seja bem vindo, espero que possa nos ajudar!.', cid) talkState[talkUser] = 1 end else selfSay('you have to finish the task', cid) talkState[talkUser] = 0 end else selfSay('Voce concluiu a missao, tome aqui um Sabre, use ele ate chegar no nivel 8 e fale com o Oraculo no templo!', cid) selfSay('Ele ira te mandar para Aurea, la fale com !', cid) doPlayerAddItem(cid, 2385, 1) talkState[talkUser] = 0 end elseif msgcontains(msg:lower(), 'portal') and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, config.idiom) == 1 then selfSay('Crystal angel one came down here and Aurea and opened a portal of humans who comes from another dimension for us {save}.', cid) talkState[talkUser] = 2 elseif getPlayerStorageValue(cid, config.idiom) == 2 then selfSay('Crystal uma anja desceu até aqui e em Aurea e abriu um portal de humanos que vem de outra dimensão para nós {salvar}.', cid) talkState[talkUser] = 2 end elseif msgcontains(msg:lower(), 'salvar') or msgcontains(msg:lower(), 'save') and talkState[talkUser] == 2 then if getPlayerStorageValue(cid, config.idiom) == 1 then selfSay('We are in an apocalyptic world, at war with several races. And you can be! {the chosen}', cid) talkState[talkUser] = 3 elseif getPlayerStorageValue(cid, config.idiom) == 2 then selfSay('Estamos em um mundo apocalíptico, em guerra com varias raças. E voce pode ser o {escolhido}!', cid) talkState[talkUser] = 3 end elseif msgcontains(msg:lower(), 'escolhido') or msgcontains(msg:lower(), 'the chosen') and talkState[talkUser] == 3 then if getPlayerStorageValue(cid, config.idiom) == 1 then selfSay('Congratulations, now with permission.', cid) selfSay('Such as our plague of {rats} in the city that are climbing down the drain!', cid) talkState[talkUser] = 4 elseif getPlayerStorageValue(cid, config.idiom) == 2 then selfSay('Calma primeiro precisamos treinar, voce deve nos ajudar com coisas {simples}, ate estar bem treinado!', cid) selfSay('Como por exemplo a nossa praga de {rats} na cidade que estão subindo pelos bueiros!', cid) talkState[talkUser] = 4 end elseif msgcontains(msg:lower, 'rats') and talkState[talkUser] == 4 then if getPlayerStorageValue(cid, config.idiom) == 1 then selfSay('Okay, so help us get this over with and kill 10 rats in the gutter in front here.', cid) setPlayerStorageValue(cid, strg1, 1) talkState[talkUser] = 0 elseif getPlayerStorageValue(cid, config.idiom) == 2 then selfSay('Ok, então ajuda-nos a acabar com isso e mate 10 ratos no bueiro aqui na frente.', cid) setPlayerStorageValue(cid, strg1, 1) talkState[talkUser] = 0 end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
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.