Blind Man Quest By Colex

colex
Por colex
em NPCs, monsters e raids

colex

Serviços Prestados a Comunidade
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 03/10/05Posts: 301Gênero: Masculino

Ola, (só faltava eu postar um NPC meu mesmu) xD

Agora vou postar uma "compilação" e um NPC feito por mim e uma action tbm feita por mim =P

Em que consiste a Blind Man Quest?

A Blind Man Quest consiste em uma quest em que voce fala com um homem cego que esta dentro de uma cave (ou otro lugar qualquer), depois voce pede ajuda pra ele e ele vai te pedir umas 3 coisas em trocas (money, 1 bread e holy scarab), depois de voce dar as 3 coisas voce podera controlar ele, (se vc naum tiver tudo pra dar pra ele na hora, vc podi dar uma coisa de cada vez) vc só vai poder controlar ele até vc passar u teleport, dps de passar u teleport ele ja naum te ajuda mais.

Qual teleport?

Teleport são 3 tiles no chão, 2 para 2 players e um para o NPC, voce tem que CONTROLAR o NPC até o tile dele.

Como controlar o NPC?

Primeiro negocie com ele e diz pra ele up (cima), down (baixo), left (esquerda) e right (direita) e ele se movimentaram, mas lembrando que ele é cego e pode tropeçar muitas vezes (complicando as coisas) e se voce ficar muito tempo sem falar com ele, ele vai voltar para o inicio.

comeceremos pelo npc

na pasta data/npc/scripts crie um arquivo com nome blind.lua e adicione o seguinte dentro dele:

 

----------Blind Man Quest by Colex-------------focus = 0talk_start = 0target = 0following = falseattacking = falseox = 540  ----posição X dele oy = 518  ----posição Y deleoz = 7    ----posição Z delemax = 500 dealing = 0money = 100 ---Dinheiro necessario para pagar pro blind manfunction onThingMove(creature, thing, oldpos, oldstackpos)endfunction onCreatureAppear(creature)endfunction onCreatureDisappear(cid, pos) 	 if focus == cid then          selfSay('Good bye then.')          focus = 0          talk_start = 0 	 endendfunction onCreatureTurn(creature)endfunction msgcontains(txt, str) 	 return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))endfunction onCreatureSay(cid, type, msg) 	 msg = string.lower(msg) 	 if (msgcontains(msg, 'hi') or msgcontains(msg, 'hello')) and (focus == 0) and getDistanceToCreature(cid) < 6 and getPlayerStorageValue(cid,1430) < 3 then  selfSay('Hello foreigner, i have some secrets of this room my friend.')    focus = cid    talk_start = os.clock() 	 elseif (msgcontains(msg, 'hi') or msgcontains(msg, 'hello')) and (focus == 0) and getDistanceToCreature(cid) < 6 and getPlayerStorageValue(cid,1430) >= 3 then  selfSay('Go away dude, I have already helped you.')    focus = 0 	 elseif (msgcontains(msg, 'hi') or msgcontains(msg, 'hello')) and (focus ~= cid) and getDistanceToCreature(cid) < 6 then    selfSay('So you are not alone!')	elseif (msgcontains(msg, 'secret') or msgcontains(msg, 'secrets')) and (focus == cid) and getDistanceToCreature(cid) < 6 then  selfSay('WEll well well, so the outsider want to know my secrets, Ok! In this room you can find a quest,but you only can do it with my help, because i have the key.')  talk_start = os.clock()	elseif (msgcontains(msg, 'quest') or msgcontains(msg, 'help') or msgcontains(msg, 'mission')) and (focus == cid) and getDistanceToCreature(cid) < 6 then  if getPlayerStorageValue(cid,1430) == 2 then 	 selfSay('I\'m already on your comand, say up, down, left, right to movement me!') 	 talk_start = os.clock() 	 dealing = 0	  elseif getPlayerStorageValue(cid,1430) < 2 then	 	 selfSay('I help you, but first you have to give me a bread beacause im hungry, pay me ' .. money .. ' gps because i need to live and give me a holy scarab beacause we need it to make the quest, Deal?') 	 talk_start = os.clock() 	 dealing = 1  end	elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sure')) and (focus == cid) and getPlayerStorageValue(cid,1430) < 2 and dealing == 1 then  talk_start = os.clock()  if getPlayerStorageValue(cid,1430) == -1 then 	 if pay(cid,money) then    selfSay('Now give me the bread')    setPlayerStorageValue(cid,1430,0) 	 else    selfSay('Are you kiding me? Give me the money.') 	 end  elseif getPlayerStorageValue(cid,1430) > 2 then 	 selfSay('You have already paid me, now give me the rest, bread and holy scarab.')  elseif getPlayerStorageValue(cid,1430) == 2 then	 	 selfSay('I am already on your command!')  end	elseif getPlayerStorageValue(cid,1430) == 0 and msgcontains(msg, 'bread') and (focus == cid) then  if doPlayerRemoveItem(cid,2689) > -1 then 	 selfSay('Hummm, Oh My God, so gooood, thanks, now i want the holy scarab.') 	 setPlayerStorageValue(cid,1430,1)	  else 	 selfSay('Stop your jokes and give me the bread, im fuckin hungry!')  end	elseif getPlayerStorageValue(cid,1430) == 1 and msgcontains(msg, 'holy scarab') and (focus == cid) then  if doPlayerRemoveItem(cid,2140) > -1 then 	 selfSay('Right, now we can make the quest, say: up, down, right, left, so i can walk beacause i am blind.') 	 setPlayerStorageValue(cid,1430,2)  else 	 selfSay('I WANT THE HOLY SCARAB!!!!')  end   	 	elseif msgcontains(msg, 'no') and (focus == cid) then  selfSay('Ok outsider, I wish you know what you are doing!')  talk_start = os.clock()	end  if getPlayerStorageValue(cid,1430) == 2 and (focus == cid) then 	 if msgcontains(msg, 'right') then    selfMove(1)    moveQuest(ox, oy, max)    talk_start = os.clock() 	 elseif msgcontains(msg, 'up') then    selfMove(2)    moveQuest(ox, oy, max)    talk_start = os.clock() 	 elseif msgcontains(msg, 'left') then    selfMove(3)    moveQuest(ox, oy, max)    talk_start = os.clock() 	 elseif msgcontains(msg, 'down') then    selfMove(0)    moveQuest(ox, oy, max)    talk_start = os.clock() 	 end  end		if (msgcontains(msg, 'bye') or msgcontains(msg, 'good bye')) and (focus == cid) and getDistanceToCreature(cid) < 6 then  selfSay('Good bye outsider!')  focus = 0  talk_start = 0  dealing = 0	endendfunction onCreatureChangeOutfit(creature)endfunction onThink()	if focus <= 0 then  moveToPosition(ox, oy, oz)	end 	 if (os.clock() - talk_start) > 30 then    if focus > 0 then   	 selfSay('Holy ######, that foreigner left me alone.') 	 dealing = 0    end    focus = 0 	 end  if focus ~= 0 then 	 if getDistanceToCreature(focus) > 6 then    selfSay('Where are you, i can\'t hear your voice.')    focus = 0 	 dealing = 0 	 end  endend

 

agora na pasta data/npc/scripts/lib abre o arquivo npc.lua e adiciona as seguintes linhas:

 

function moveQuest(ox,oy,max)maxx = ox + maxmaxy = oy + maxminx = ox - maxminy = oy - maxcx, cy, cz = selfGetPosition()randmove = math.random(1,6)falas = math.random(1,7)if randmove == 1 thennx = cx + 1ny = cyendif randmove == 2 thennx = cx - 1ny = cyendif randmove == 3 thenny = cy + 1nx = cxendif randmove == 4 thenny = cy - 1nx = cxendif randmove >= 5 thennx = cxny = cyendif((nx < maxx) and (ny < maxy) and (nx > minx) and (ny > miny)) thenmoveToPosition(nx, ny, cz)  if (nx ~= cx) or (ny ~= cy) then    if falas == 1 then      selfSay('Ouch')    elseif falas == 2 then      selfSay('Holy ######, My Feet, fuckin stone!!!')    elseif falas == 3 then      selfSay('Hey, Where are you, say something.')    elseif falas == 4 then      selfSay('Shit, I think i\'m lost.')    elseif falas == 5 then      selfSay('Wow, with this luck i\'ll fall.')    elseif falas == 6 or falas == 7 then      return 1    end  endelsemoveToPosition(ox, oy, cz)endend

 

e último passo na parte do NPC, na pasta data/npc cria um arquivo nomeado por Blind Man.xml e dentro dele adicione:

 

<?xml version="1.0"?><npc name="Blind Man" script="data/npc/scripts/blind.lua" access="3">  <look type="129" head="114" body="119" legs="114" feet="114"/></npc>

 

Agora vamos para as Actions

faça um novo documento com nome blind.lua na pasta data/actions/scripts e adicione o seguinte code:

 

-----Blind Man Quest by colex-----function onUse(cid, item, frompos, item2, topos)pos1 = {x=546, y=518, z=7, stackpos=253} --coordenadas de onde o player 1 te ke ficarplayer1 = getThingfromPos(pos1)pos2 = {x=546, y=520, z=7, stackpos=253} --cordenadas de onde o player 2 tem ke ficarplayer2 = getThingfromPos(pos2)npcpos = {x=551, y=518, z=7, stackpos=253} --cordenadas de onde o npc tem que ficarnpc = getThingfromPos(npcpos)   final1 = {x=548, y=520, z=7} ----para onde sera teleportado o player 1final2 = {x=548, y=521, z=7} ----para onde sera teleportado o player 2           if item.itemid == 1945 and item.uid == 5996 then  if player1.itemid == cid then    if player2.itemid == cid then      if getPlayerStorageValue(player2.uid,1430) <= 2 and getPlayerStorageValue(player1.uid,1430) <= 2 then        if npc.itemid == cid then          if getPlayerAccess(npc.uid) >= 0  then            doPlayerSendCancel(cid,"That person does not have the key.")          else            doTeleportThing(player1.uid,final1)            doTeleportThing(player2.uid,final2)            doPlayerSendTextMessage(player1.uid,22,"You were teleported with the help of Blind Man.")            doPlayerSendTextMessage(player2.uid,22,"You were teleported with the help of Blind Man.")            doTransformItem(item.uid,item.itemid+1)             setPlayerStorageValue(player1.uid,1430,3)            setPlayerStorageValue(player2.uid,1430,3)          end        else          doPlayerSendCancel(cid,"You are missing one person.")        end      else          doPlayerSendCancel(cid,"One or both of you have already made the quest, so he cannot continue.")      end    else      doPlayerSendCancel(cid,"You are missing one person.")    end  else    doPlayerSendCancel(cid,"You are not in the right place.")  endelseif item.itemid == 1946 and item.uid == 5996 thendoTransformItem(item.uid,item.itemid-1)endreturn 1end

 

na pasta data/actions no arquivo actions.xml adicione a seguinte tag:

 

<action uniqueid="5996" script="blind.lua" />

 

Imagem Para Um Melhor Entendimento

blindquest8va.png

Alguma Duvida?

Algum Comentario bom, mau, péssimo?

Críticas construtivas?

Clique no botão que se encontra no canto inferior direito Responder

e escreva algo do genero "és o maior, tens prai 5 metros!"

=P

va flw

postem u ke kiserem, com criticas construtivas, to aceitando tudo xD

aproveitem...

cya~~

bizugo

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 27/10/05Posts: 71

Muito Massa

0.o

realmente ta muito rox essa quest em

PQP PAREM DE MANDA SPAMM EM PM OU PEDINDO CHEAT MEU! CHEAT É ILEGAL! QUEM QUISER PROCURE! NÃO AQU!

High

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/12/05Posts: 20

Mais uma vez o Colex ajudando milhares e milhares de pessoas com suas actions ;P.Muito criativo de tua parte Colex, muito mesmo.

Alguem já encontrou alguma falha em suas actions??Acho que não :S

Fui!

Abraços,

High

Se você é meu fan, use:
user posted image


Sou fan de:
user posted image
user posted image
user posted image

user posted image

~º^* Presentes *^º~
Rotciv


Metas:
__aprender action(mesmo não sendo profissional) (X)__
__10 posts(X)__
__20 posts(X)__
__50 posts(X)__
__70 posts( )__
__100 posts( )__
Vo atualizando enquanto o tempo passa.

colex

Serviços Prestados a Comunidade
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 03/10/05Posts: 301Gênero: Masculino
Mais uma vez o Colex ajudando milhares e milhares de pessoas com suas actions  ;P.Muito criativo de tua parte Colex, muito mesmo.

Alguem já encontrou alguma falha em suas actions??Acho que não :S

Fui!

Abraços,

High

 

 

 

desta vez a maior parte du Code é NPC

mas tem um pouco de action ke tbm ajuda :D

mas ja devem ter encontrado algum erro

afinal eu naum nasci sabendu

vlw pelo comment

cya~~ :bye:

Pich

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 09/01/06Posts: 44Char no Tibia: Ralls

Mto bom viu ^^

vlws assim meu ot fica 1 poco mais rpg fuiz

Pich



Presentes
Claw

esse topico Faiz você refletir >Click aqui<
meu msn
chris_taw@hotmail.com

lelozoin

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 17/10/05Posts: 3

qe rox vc q fez?

colex

Serviços Prestados a Comunidade
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 03/10/05Posts: 301Gênero: Masculino
qe rox vc q fez?

 

 

 

fui eu sim

naum costumo postar NPC'sm gosto de postar mais actions

mas ai eu tive esta idéia fiz e postei aqui

frerety

DVNO
avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 08/04/06Posts: 133

Kra... o.O nunk tinha vistu um npc assim... huHUHAUhaUhaU... e o modo como vc mesclou actions/npc desse jeito... aconselho td mundo a adicionar no server uma quest com esse npc... muito interessante... principalmente como o npc reage quando é arrastado... kra... nunk vi uma coisa parecida...

<melhor script do colex plz>

FlW

CyA!

It's the hunger; the hunger for an alternative and the refusal to accept a life of unhappiness.


ScarFace

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 30/04/06Posts: 51

Mt bom!!!

Aconselho geral usar esse npc

Mt interessante ^^

user posted image

 

[ASSINATURA EDITADA POR FAZER PROPAGANDAS. CASO CONTINUE SERÁ ALERTADO]

Zen

~Léozera~
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 15/01/06Posts: 37Char no Tibia: Zen Knight

Olá,

Muito Bom esse NPC

Ae Colex, você é muito bom em scripts!

The Best Scripter?

Abraços,

Zen

zenfanbar.jpg

zenhf.jpg

Dandilo

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 31/05/06Posts: 71

mano do ceu...

coloquei no meu serv isso...

AUSHUashuAHSUHaushuAHSUHaus

me caguei de ri

sASaisjiAJSIashuAHSUhasu

mto comedia mano!

vc se superando como sempre colex!!!!

sou seu fãn!

xD

Principal Sing





Vencedor do 2° Concurso de Mapping XTibia...
Sing do Campeão



Eu Sou...



gabiruskt

avatar
Banidos
Banidos

INFOS

Grupo: BanidosRegistrado: 12/03/06Posts: 100Char no Tibia: Gatinho

YhiuheiuAHEUIaheuaHEUaheiuaHEUIAEA

realmente mto massa velho

parabens e continua assim

auiehaiuehaiueae

Lucas Rap

Lucas Moreno
avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 19/11/05Posts: 168

cara q criatividade!

tu pod trabalhar pra cipsoft jah xDDDD

meu deus ce tah de parabéns meu como sempre se superando em suas actions e agora em npc!..

Parabéns e continue assim.

Abraços,

Lucas Rap

ESTOU DESATIVADO!
NÃO ME MANDEM MENSAGENS, POR FAVOR.
NÃO ENTENDO MAIS DESSE NOVO TIBIA 9.ALGUMA COISA...


ÚNICO CONTATO: lucasrap8@gmail.com

Sir Picaralhos

Lendário XTibiano =)
avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 08/10/05Posts: 114

Achei bem legal, você teve muita criatividade.

Tem como fazer algo deste tipo:

Assim caso o player não tenhaos itens necessários o NPC atacar o player, deixando-o com 1 de life?

;]

Abraços.

janniferjopeseo9.jpg

janniferjopesbarjd6.jpg

userbar172527ez3.gif

Demetrius

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 28/06/06Posts: 4

Otimo npc gostei ;D