Ir para conteúdo

Featured Replies

Postado

Olá King Tibianos,
 

Estava sem fazer nada esses dias (como sempre) e de repente veio uma ideia de uma Task que a meu ver ficou bem legal e seria muito bom e um servidor RPG.
Eu particularmente gosto muito de quests e missões com muito RPG e se depender de mim haverá muitos scripts de quests e missões com um bom RPG, sem mais delongas vou explicar a Task e depois os scripts.

 

-- Explicando Task --

Em busca da corda - Primeira Parte
Primeiramente você irá falar com o NPC Heron, ele irá dizer que emprestou sua corda ao seu vizinho que mora mais ao sul e ele esqueceu de devolver (como sempre vizinho nunca te devolve nada, desde o café emprestado atá a xícara), então ele pede para você ir buscar.
 
Provando sua Bravura - Segunda Parte
Chegando em seu vizinho Vence você irá pedir a corda para ele e ele nada folgado falará pra você "provar sua bravura" descobrindo que tipo de criatura está em seu porão, ele te dará uma presa e pedirá que você vá até o professor local e pergunte que tipo de criatura teria uma presa daquela.
Ao encontrar o professor ele pegará a preza e dirá que tipo de criatura é aquela.
Você volta no Vence e diz a ele que criatura é, ele dirá que não faz a mínima ideia de que criatura é aquela então nada folgado2 pedirá que você vá até o porão dele e mate para ele 5 dessas criaturas e volte perguntando sobre o Heron.
Matando as 5 criaturas você volta e fala sobre Heron (seu vizinho) e ele te dará a corda e mais uma recompensa por ter limpado o porão dele.
 
Devolvendo a Corda - Última Parte
Voltando ao Heron você falará com ele sobre a corda e ele te dará uma recompensa. Mas não é qualquer corda que é aceita na quest, ele só aceita a corda dele.

Como ele sabe qual é a corda dele?

Simples quando Vence devolve a corda de Heron, ele coloca um ActionID que o Heron checará quando você for devolver, se não for a corda dele, ele não aceitará.
 
Transições


Heron

-- Pedindo a Tarefa --
Heron: Hello, Player! Would you like to do a task for me?
Player: task
Heron: Great, I need to that seeks my rope in my neighbor's house Vence, he asked me while ago and forgot to return. I would go get it for me?
Player: yes
Heron: Cool. When you arrive at his house says something about the rope...
Heron: To get to his house you just follow the trail to the south...
Heron: When you get my rope, back here with her and I'll give you your prize.
Player: bye
Heron: Bye bye!

 

-- Entregando a Corda --

Heron: Hello, Player! Would you like to do a task for me?

Player: rope

Heron: That's good, do not know if it's too but here's 2 crystal coins and 10,000 experience.

Player: bye

Heron: Bye bye!

 

Vence

-- Pedindo a corda do Heron --

Vence: Oh! What have we here? Want something?

Player: rope

Vence: Rope? Hum... Oh! Yes the rope from my neighbor Heron right?

Player: yes

Vence: Only one problem, you will first need to prove your bravery, you accept the test?

Player: yes

Vence: Liked you, without even knowing which test would, just accepted...

Vence: Without further ado, the basement of my house is infested with creatures and I don't know its origin ...

Vence: Find Professor Darwin and ask him what kind of creature is a fang this...

Vence: The teacher is a little crazy, I think he studied creatures too and ended up with a bit of fear, then will be a bit hard to find it...

Vence: Rumors say he hides in a hole near the shop magician Kirn, if finding it says something about fang. Good luck!

Player: bye
Vence: Bye bye!

 

-- Após descobrir a origem da criatura --

Vence: Oh! What have we here? Want something?

Player: carrion worm

Vence: I have no idea what is this creature, can come down and kill for me?

Player: yes

Vence: Scroll down to the basement and kill 5 these such carrion worm, when finish remember me of return the Heron.

 

-- Pedindo a corda novamente --

Vence: Oh! What have we here? Want something?

Player: Heron

Vence: Okay, here's the rope it, and for helping me with the infestation here you are 2 crystal coins.

Player: bye
Vence: Bye bye!

 

Darwin

-- Descobrindo a origem da criatura --

Darwin: Oh! Who are you? How'd you find me? What do you want?

Player: fang

Darwin: Let me see what you got there...

Darwin: Ours is a fang and so much... Looks like you\'re with some infestations {carrion worm}. Finish with them as soon as possible.

Player: bye

Darwin: Bye bye!

 

-- Scripts NPC --

Heron

Crie um arquivo chamado Heron.lua na pasta data/npc/scripts e cole isto

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
 
-- Confg
local cfg = {
           itemReward = 2160, -- Item de recompensa
           countItem = 2, -- Quantidade do item de recompensa
           countExp = 10000 -- Quantidade de experiencia de recompensa
}
-- Fim Config
 
function creatureSayCallback(cid, type, msg)
          if(not npcHandler:isFocused(cid)) then
                    return false
          end
          local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
 
         if msgcontains(msg, 'task') then
                   if getPlayerStorageValue(cid, 40000) == -1 then
                             if getPlayerStorageValue(cid, 40001) == -1 then
                                       selfSay('Great, I need to that seeks my rope in my neighbor\'s house Vence, he asked me while ago and forgot to return. I would go get it for me?', cid)
                                       talkState[talkUser] = 1
                             else
                                       selfSay('You have this task open.', cid)
                             end
                   else
                             selfSay('You already have made ​​this task.', cid)
                   end
         elseif talkState[talkUser] == 1 then
                   if msgcontains(msg, 'yes') then
                             selfSay('Cool. When you arrive at his house says something about the {rope}...', cid)
                             selfSay('To get to his house you just follow the trail to the south...', cid)
                             selfSay('When you get my rope, back here with her and I\'ll give you your prize.', cid)
                             setPlayerStorageValue(cid, 40001, 1)
                             talkState[talkUser] = 2
                   elseif msgcontains(msg, 'no') then
                             selfSay('Then, GET OUT IMMEDIATELY', cid)
                   end
         elseif getPlayerStorageValue(cid, 40004) == 1 then
                   if msgcontains(msg, 'rope') then
                             local rope = getPlayerItemById(cid, true, 2120)
                             if rope.actionid == 6587 then
                                       doPlayerRemoveItem(cid, 2120, 1)
                                       doPlayerAddItem(cid, cfg.itemReward, cfg.countItem)
                                       doPlayerAddExp(cid, cfg.countExp)
                                       selfSay('That\'s good, do not know if it\'s too but here\'s '.. cfg.countItem ..' '.. getItemNameById(cfg.itemReward) ..' and '.. cfg.countExp ..' experience.', cid)
                                       talkState[talkUser] = 0
                             else
                                       selfSay('This is not my rope.', cid)
                             end
                   end
         end
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Crie um arquivo chamado Heron.xml na pasta data/npc e cole isto

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Heron" script="data/npc/scripts/Heron.lua" walkinterval="25" floorchange="0" access="5" level="1" maglevel="1">
          <health now="150" max="150"/>
          <look type="128" head="114" body="12" legs="57" feet="114" addons="0" />
          <parameters>
                    <parameter key="message_greet" value="Hello, |PLAYERNAME|! Would you like to do a {task} for me?"/>
                    <parameter key="message_walkaway" value="Hey Hey, where you go ?"/>
                    <parameter key="message_farewell" value="Bye bye!"/>
          </parameters>
</npc>

 

Vence

Crie um arquivo chamado Vence.lua na pasta data/npc/scripts e cole isto

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
 
-- Config
local cfg = {
          reward = 2160 -- Item de recompensa
          count = 2 -- Quantidade do item de recompensa
}
local pos = {x=1062, y=1047, z=7} -- Coordenadas do efeito para mostrar aonde o player tem que descer para matar os carrion worm
-- Fim Config
 
function creatureSayCallback(cid, type, msg)
          if(not npcHandler:isFocused(cid)) then
                    return false
          end
          local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
 
          if msgcontains(msg, 'rope') then
                    if getPlayerStorageValue(cid, 40001) == 1 then
                              selfSay('Rope? Hum... Oh! Yes the rope from my neighbor Heron right?', cid)
                              talkState[talkUser] = 1
                              setPlayerStorageValue(cid, 40001, 2)
                    else
                              selfSay('Rope? What rope?', cid)
                    end
          elseif talkState[talkUser] == 1 then
                    if msgcontains(msg, 'yes') then
                              selfSay('Only one problem, youwill first need to prove your bravery, you accept the test?', cid)
                              talkState[talkUser] = 2
                    elseif msgcontains(msg, 'no') then
                              selfSay('Then, GET OUT IMMEDIATELY', cid)
                    end
          elseif talkState[talkUser] == 2 then
                    if msgcontains(msg, 'yes') then
                              selfSay('Liked you, without even knowing which test would, just accepted...', cid)
                              selfSay('Without further ado, the basement of my house is infested with creatures and I don\'t know its origin ...', cid)
                              selfSay('Find Professor Darwin and ask him what kind of creature is a fang this...', cid)
                              selfSay('The teacher is a little crazy, I think he studied creatures too and ended up with a bit of fear, then will be a bit hard to find it...', cid)
                              selfSay('Rumors say he hides in a hole near the shop magician Kirn, if finding it says something about {fang}. Good luck!', cid)
                              doPlayerAddItem(cid, 11192, 1)
                              setPlayerStorageValue(cid, 40002, 1)
                              talkState[talkUser] = 3
                    elseif msgcontains(msg, 'no') then
                              selfSay('Then, GET OUT IMMEDIATELY', cid)
                    end
          elseif talkState[talkUser] == 3 then
                    if getPlayerStorageValue(cid, 40003) == 1 then
                              if msgcontains(msg, 'carrion worm') then
                                        selfSay('I have no idea what is this creature, can come down and kill for me?', cid)
                                        talkState[talkUser] = 4
                              end
                    end
          elseif talkState[talkUser] == 4 then
                    if msgcontains(msg, 'yes') then
                              selfSay('Scroll down to the basement andkill 5 these such carrion worm, when finish remember me of return the {Heron}.', cid)
                              setPlayerStorageValue(cid, 40500, 1)
                              talkState[talkUser] = 5
                              doSendMagicEffect(pos, 56)
                              doSendMagicEffect(pos, 55)
                    elseif msgcontains(msg, 'no') then
                              selfSay('Then, GET OUT IMMEDIATELY', cid)
                    end
          elseif talkState[talkUser] == 5 then
                    if msgcontains(msg, 'Heron') then
                              if getPlayerStorageValue(cid, 40501) >= 5 then
                                        local item = doPlayerAddItem(cid, 2120, 1)
                                        doSetItemActionId(item, 6587)
                                        doPlayerAddItem(cid, cfg.reward, cfg.count)
                                        selfSay('Okay, here\'s the rope it, and for helping me with the infestation here you are '.. cfg.count ..' '.. getItemNameById(cfg.reward) ..'.', cid)
                                        setPlayerStorageValue(cid, 40004, 1)
                                        talkState[talkUser] = 0
                              else
                                        selfSay('You didn\'t kll the carrion worm my basement.', cid)
                              end
                    end
          end
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Crie um arquivo chamado Vence.xml na pasta data/npc e cole isto

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Vence" script="data/npc/scripts/Vence.lua" walkinterval="25" floorchange="0" access="5" level="1" maglevel="1">
          <health now="150" max="150"/>
          <look type="128" head="114" body="128" legs="128" feet="114" addons="0" />
          <parameters>
                    <parameter key="message_greet" value="Oh! What have we here? Want something?"/>
                    <parameter key="message_walkaway" value="Hey Hey, where you go ?"/>
                    <parameter key="message_farewell" value="Bye bye!"/>
          </parameters>
</npc>

 

Darwin


Crie um arquivo chamado Darwin.lua na pasta data/npc/scripts e cole isto
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
 
function creatureSayCallback(cid, type, msg)
          if(not npcHandler:isFocused(cid)) then
                    return false
          end
          local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
 
          if msgcontains(msg, 'fang') then
                    if getPlayerStorageValue(cid, 40002) == 1 then
                              if getPlayerItemCount(cid, 11192) >= 1 then
                                        selfSay('Let me see what you got there...', cid)
                                        selfSay('Ours is a fang and so much... Looks like you\'re with some infestations {carrion worm}. Finish with them as soon as possible.', cid)
                                        doPlayerRemoveItem(cid, 11192, 1)
                                        setPlayerStorageValue(cid, 40003, 1)
                              else
                                        selfSay('Fang? What fang? You have nothing.', cid)
                              end
                    else
                              selfSay('Who sent you?', cid)
                    end
          end
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Crie um arquivo chamado Darwin.xml na pasta data/npc e cole isto

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Darwin" script="data/npc/scripts/Darwin.lua" walkinterval="25" floorchange="0" access="5" level="1" maglevel="1">
          <health now="150" max="150"/>
          <look type="328" head="114" body="0" legs="0" feet="0" addons="0" />
          <parameters>
                    <parameter key="message_greet" value="Oh! Who are you? How'd you find me? What do you want?"/>
                    <parameter key="message_walkaway" value="Hey Hey, where you go ?"/>
                    <parameter key="message_farewell" value="Bye bye!"/>
          </parameters>
</npc>

 

-- Scripts --

Crie um arquivo chamado stair.lua na pasta data/movements/scripts e cole isso

function onStepIn(cid, item, position, fromPosition)
          if getPlayerStorageValue(cid, 40500) == 1 then
                    return true
          else
                    doTeleportThing(cid, fromPosition)
                    doPlayerSendTextMessage(cid, 18, 'You don\'t have access on the area')
          end
end

Adicione a seguinte linha no arquivo movements.xml que se encontra na pasta data/movements

<movevent type="AddItem" uniqueid="6587" event="script" value="stair.lua"/>

Na pasta mods crie um arquivo chamado TaskVence.xml e cole isso

 
<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Kill Carrion Worm" version="1.0" enabled="yes">
          <config name="KillM_func"><![CDATA[
                    tsk = {
                              storages = {40501,40500},
                              task = {"carrion worm", 5}
                    }
          ]]></config>
          <event type="login" name="AreKill" event="script"><![CDATA[
                    function onLogin(cid)
                    registerCreatureEvent(cid, "CountTask")
                    return true
          end]]>
          </event>
          <event type="kill" name="CountTask" event="script"><![CDATA[
                    domodlib('KillM_func')
                    function onKill(cid, target)
                    if isMonster(target) then
                              local n = string.lower(getCreatureName(target))
                              if n == tsk.task[1] and getPlayerStorageValue(cid, tsk.storages[2]) >= 1 then
                                        local contagem = getPlayerStorageValue(cid, tsk.storages[1])
                                        if (contagem == -1) then
                                                  contagem = 1
                                        end
                                        if not tonumber(contagem) then
                                                  return true
                                        end
                                        if contagem > tsk.task[2] then
                                                  return true
                                        end
                                        setPlayerStorageValue(cid, tsk.storages[1], contagem+1)
                                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,""..(contagem == tsk.task[2] and "Congratulations! You finished the task of "..n.."." or "defeated. Total [" .. contagem .. "/" .. tsk.task[2] .. "] " .. n .. ".").."")
                              end
                    end
                    return true
          end]]>
          </event>
</mod>

Testado e está 100% funcional

Dúvidas? Me avise.

 

Att.

Giovani Rodrigo

Editado por GiovaniRodrigo (veja o histórico de edições)

Spoiler

local config = {
	delrey = getPlayerCarValue(cid, DELREY),
	cigarro = getPlayerCancer(cid, DERBY),
	prostituta = getPlayerAIDS(cid, cracuda),
	tresOitao = getPlayerRevorvi(cid, 38)
}

if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end

 

  • 3 weeks later...
  • Respostas 7
  • Visualizações 4.4k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Postado
  • Autor

No meu server o NPC Vence esta com erro...

Diga o erro que está dando que poderei dar suporte.

 

Att.

Giovani Rodrigo

Spoiler

local config = {
	delrey = getPlayerCarValue(cid, DELREY),
	cigarro = getPlayerCancer(cid, DERBY),
	prostituta = getPlayerAIDS(cid, cracuda),
	tresOitao = getPlayerRevorvi(cid, 38)
}

if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end

 

  • 7 months later...
Postado

Ola Excelente Script, me ajudou muito, parabéns, só citando  um pequeno erro.

 

""Na pasta mods crie um arquivo chamado TaskVence.lua e cole isso" 

cmomo  colocada acima

 

salvar assim

Na pasta mods crie um arquivo chamado TaskVence.xml e cole isso"

dai  funciona

meus  rep+ para voce Gionani por este script.

  • 1 year later...
Postado

tbm estou com o mesmo erro do amigo ai
alguem pode ajudar ?

O npc Vence n&atilde;o da a rope pra entregar pro Heron

Citar

03:08 Vence: You didn't kll the carrion worm my basement.

só que eu matei tudo

Editado por subhe (veja o histórico de edições)

n35408.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.7k

Informação Importante

Confirmação de Termo