Ir para conteúdo

Task RPG - Monsters e NPCs


Posts Recomendados

-- Explicando a 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 falara para 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 presa 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 folgado² 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ê falara com ele sobre a corda e ele te dará uma recompensa.

 

 

-- 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 --

Heron

 

Vá em data/npc, crie uma arquivo XML com o nome de Heron adicione isso -

<?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>

 

Ainda na pasta NPC, vá na pasta scripts, crie um arquivo .lua com o nome de Heron e adicione 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

-- 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())

 

 

Vence

 

Vá em data/npc, crie uma arquivo XML com o nome de Vence adicione isso -

<?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>

 

Ainda na pasta NPC, vá na pasta scripts, crie um arquivo .lua com o nome de Vence e adicione 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

-- 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) >= 1 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())

 

 

Darwin

 

Vá em data/npc, crie uma arquivo XML com o nome de Darwin adicione isso -

<?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>

 

Ainda na pasta NPC, vá na pasta scripts, crie um arquivo .lua com o nome de Darwin e adicione 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

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())

 

 

Funcionando 100%

Créditos - Giovani Rodrigo

Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...
  • 3 months later...
×
×
  • Criar Novo...