Npc Stan

Conde Sapo
em NPCs, monsters e raids

Conde Sapo

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 14/08/07Posts: 322Char no Tibia: Conde Sapo (Secura)

Exclusivo para XTibia

favor não postar em outro forum

 

Tive algumas barreiras.

Alguns outfits eu não tenho no meu Evolutions

 

data\npc\Stan.xml

local focus = 0
local talk_start = 0
local talk_state = 0
local target = 0
local following = false
local attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)
end

function onCreatureAppear(creature)
end

function onCreatureDisappear(cid, pos)
if focus == cid then
	selfSay('Good bye then.')
	focus = 0
	talk_start = 0
end
end

function onCreatureTurn(creature)
end

function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end

function onCreatureSay(cid, type, msg)
msg = string.lower(msg)

if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then
	selfSay('Hello ' .. creatureGetName(cid) .. '! I sell masquerade costumes.')
	focus = cid
	talk_start = os.clock()

elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
	selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

elseif focus == cid then
	talk_start = os.clock()

	if msgcontains(msg, 'deluxe costume') then
		selfSay('Do you want to buy deluxe costume for 1500 gps?')
		talk_state = 1

	elseif msgcontains(msg, 'uncommon costume') then
		selfSay('Do you want to buy uncommon costume for 1000 gps?')
		talk_state = 2

	elseif msgcontains(msg, 'common costume') then
		selfSay('Do you want to buy common costume for 500 gps?')
		talk_state = 3

	elseif msg == 'costume' or msg == 'costumes' then
		selfSay('I sell Deluxe Costume (1500gps), Uncommon Costume (1000 gps) and Commom Costume (500 gps)')
		selfSay('I sell also Party Hats (600gps) and Party Trumpets (80 gps)')
		talk_start = os.clock()

	elseif msgcontains(msg, 'party hat') then
		selfSay('Do you want to buy party hat for 600 gps?')
		talk_state = 4

	elseif msgcontains(msg, 'party trumpet') then
		selfSay('Do you want to buy party trumpet for 80 gps?')
		talk_state = 5

	elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
		selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
		focus = 0
		talk_start = 0
		talk_state = 0

	elseif msgcontains(msg, 'yes') and talk_state == 1 then
		if doPlayerRemoveMoney(cid,1500) == TRUE then
			bag = doPlayerAddItem(cid, 1997, 1)
			doSetItemActionId(bag,3001)
			talk_state = 0
			talk_start = os.clock()
		else
			selfSay('Sorry, you don\'t have money.')
		end
		talk_state = 0

	elseif msgcontains(msg, 'yes') and talk_state == 2 then
		if doPlayerRemoveMoney(cid,1000) == TRUE then
			bag = doPlayerAddItem(cid, 1996, 1)
			doSetItemActionId(bag,3002)
			talk_start = os.clock()
		else
			selfSay('Sorry, you don\'t have money.')
		end
		talk_state = 0

	elseif msgcontains(msg, 'yes') and talk_state == 3 then
		if doPlayerRemoveMoney(cid,500) == TRUE then
			bag = doPlayerAddItem(cid, 1994, 1)
			doSetItemActionId(bag,3003)
			talk_start = os.clock()
		else
			selfSay('Sorry, you don\'t have money.')
		end
		talk_state = 0

	elseif msgcontains(msg, 'yes') and talk_state == 4 then
		buy(cid,6578,1,600)
		talk_start = os.clock()
		talk_state = 0

	elseif msgcontains(msg, 'yes') and talk_state == 5 then
		buy(cid,6572,1,80)
		talk_start = os.clock()
		talk_state = 0
	end
end
end

function onCreatureChangeOutfit(creature)
end

function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 30 then
	if focus > 0 then
		selfSay('Next Please...')
	end
	focus = 0
end
if focus ~= 0 then
	if getDistanceToCreature(focus) > 5 then
		selfSay('Good bye then.')
		focus = 0
	end
end
end

 

 

Agora vem a AÇÂO de clicar na bag

 

data\actions\actions.xml

--  Bag de Carnaval - by Conde Sapo

function onUse(cid, item, frompos)
if frompos.x == 65535 then
	--  tah na BP
	if item.actionid == 3001 then
		-- Deluxe
		rand = math.random(1,5)
		if rand == 1 then
			outfit = {lookType = 220}  -- Serpent Spawn
		elseif rand == 2 then
			outfit = {lookType = 201}  -- Demon
		elseif rand == 3 then
			outfit = {lookType = 244}  -- Juggernaut
		elseif rand == 4 then
			outfit = {lookType = 55}   -- Behemoth
		elseif rand == 5 then
			outfit = {lookType = 91}   -- Rahemos  (Abrigado Claudioo pelo número do LookType)
		end

	elseif item.actionid == 3002 then
		-- UnCommon
		rand = math.random(1,5)
		if rand == 1 then
			outfit = {lookType = 47}   -- Quara Hydromancer
		elseif rand == 2 then
			outfit = {lookType = 237}  -- Diabolic Imp
		elseif rand == 3 then
			outfit = {lookType = 78}   -- Banshee
		elseif rand == 4 then
			outfit = {lookType = 257}  -- Frost Giant  (Abrigado Claudioo pelo número do LookType)
		elseif rand == 5 then
			outfit = {lookType = 99}   -- Lich
		end

	elseif item.actionid == 3003 then
		-- Common
		rand = math.random(1,5)
		if rand == 1 then
			outfit = {lookType = 7}    -- Orc Warrior
		elseif rand == 2 then
			outfit = {lookType = 96}   -- Pirate Cutthroat
		elseif rand == 3 then
			outfit = {lookType = 214}  -- Dworc Voodoomaster
		elseif rand == 4 then
			outfit = {lookType = 70}   -- Dwarf Guard
		elseif rand == 5 then
			outfit = {lookType = 23}   -- Minotaur Mage
		end
	end
	if doPlayerRemoveItem(cid,item.itemid,1) == TRUE then
		doPlayerSay(cid,"I\'m bad!",16)
	end

	doSetCreatureOutfit(cid, outfit, 600000 )
	doSendMagicEffect(frompos,12)
else
	doPlayerSendCancel(cid,"Carry with you first!")
end
return 1
end

 

 

Agradecimentos

 

outfit = {lookType = 91} -- Rahemos
outfit = {lookType = 257} -- Frost Giant

Claudioo

pelos códigos dos LookType

 

Eu não inventei nada

Isso vem do Tibia Global

Divirtam-se com as fantasias de Carnaval

:XTibia_smile:

-----------------------
-------------------------------


Encontro de Quake na minha Ex-LAN

odeio rapidshare

"Criticas enriquecem o trabalho dos inteligentes.
Os negligentes simplesmente as ignoram." - Conde Sapo

"A melhor recompensa do Mestre ,
é ver o Aluno superar as espectativas." - Conde Sapo



(finalmente me convenceram a fazer a Fan Bar)

Meus trabalhos :
\/------- Clicar

01 - Porta com chave numérica
02 - Efeito de MAR em movimento
03 - Fruta na Árvore (acrescentei arvore)
04 - NPC Messager
05 - Monstros Morrem Mas Nao Somem Do Mapa
06 - Simulando UnderWater
07 - SpellBook (Book 2175)
08 - CommandsSpellBook (Book 6120)
09 - Fixo: Tudo Sobre A Linguagem Lua
10 - Dice (Rolando os dados)
11 - Voodoo Skull (previsão da sorte do dia)
12 - Caça Niqueis
13 - Mapa-spawn.xml (Como funciona)
14 - Pendurando objetos na parede
15 - Santa Doll (Papai Noel)
16 - EuTeAmoVoce [Instant Spell]
17 - doSendAnimatedText (Todas as cores)
18 - NPC Banqueiro
19 - 8 Bichos (Massive Summon)
20 - Transformando Barril Simples em Barril de Mana Fluid
21 - Quebrando Itens Com Arma (Tirando BUG)
22 - Padre Marcelo (Totalmente REFEITO)
23 - Npc De Backpack ( Back Picka )
24 - Npc De Dolls ( Baby Doll )
25 - Fonte Da Juventude (Mana e Life)
26 - NPC que troca itens
27 - Removendo paredes com PAUSA, (efeito visual lindo)
28 - Halloween - Fazendo o PumpkinHead
29 - Halloween - Criando o monstro Halloween Hare
30 - Mapa pra fazer Testes (Sapo.otbm)
31 - Fishing Rod (Qualquer versão)
32 - Jungle Maw (planta que morde)
33 - Npc Stan (fantasias de Carnaval)
Clicar -------/\

Claudioo

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/01/07Posts: 62

Valeu pelo script! Perfeito...

 

 

Assim, ao inves de demon, pq eu também nao achei esse look, coloca de Ghaz~ que é: 12.

E os que vc precisa são esses:

 

outfit = {lookType = 91} -- Rahemos

outfit = {lookType = 257} -- Frost Giant

 

Ja testados ;)

 

Pra ficar melhor, bom, eu nao sei, nao sei como é no global, pq vc não coloca aquelas surprise bags no lugar de só bags, bom enfim, brigado pelo script.

exiva "assinatura.

Conde Sapo

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 14/08/07Posts: 322Char no Tibia: Conde Sapo (Secura)
Pra ficar melhor, bom, eu nao sei, nao sei como é no global,
no global é exatamente assim.

eu não inventei nada

 

 

pq vc não coloca aquelas surprise bags no lugar de só bags,
é facil

 

Basta trocar estas linhas

bag = doPlayerAddItem(cid, 1997, 1) <-- amarela

bag = doPlayerAddItem(cid, 1996, 1) <--- cinza

bag = doPlayerAddItem(cid, 1994, 1) <--- lilas

substitua pelo ID das suprise-bags

 

 

:XTibia_smile:

-----------------------
-------------------------------


Encontro de Quake na minha Ex-LAN

odeio rapidshare

"Criticas enriquecem o trabalho dos inteligentes.
Os negligentes simplesmente as ignoram." - Conde Sapo

"A melhor recompensa do Mestre ,
é ver o Aluno superar as espectativas." - Conde Sapo



(finalmente me convenceram a fazer a Fan Bar)

Meus trabalhos :
\/------- Clicar

01 - Porta com chave numérica
02 - Efeito de MAR em movimento
03 - Fruta na Árvore (acrescentei arvore)
04 - NPC Messager
05 - Monstros Morrem Mas Nao Somem Do Mapa
06 - Simulando UnderWater
07 - SpellBook (Book 2175)
08 - CommandsSpellBook (Book 6120)
09 - Fixo: Tudo Sobre A Linguagem Lua
10 - Dice (Rolando os dados)
11 - Voodoo Skull (previsão da sorte do dia)
12 - Caça Niqueis
13 - Mapa-spawn.xml (Como funciona)
14 - Pendurando objetos na parede
15 - Santa Doll (Papai Noel)
16 - EuTeAmoVoce [Instant Spell]
17 - doSendAnimatedText (Todas as cores)
18 - NPC Banqueiro
19 - 8 Bichos (Massive Summon)
20 - Transformando Barril Simples em Barril de Mana Fluid
21 - Quebrando Itens Com Arma (Tirando BUG)
22 - Padre Marcelo (Totalmente REFEITO)
23 - Npc De Backpack ( Back Picka )
24 - Npc De Dolls ( Baby Doll )
25 - Fonte Da Juventude (Mana e Life)
26 - NPC que troca itens
27 - Removendo paredes com PAUSA, (efeito visual lindo)
28 - Halloween - Fazendo o PumpkinHead
29 - Halloween - Criando o monstro Halloween Hare
30 - Mapa pra fazer Testes (Sapo.otbm)
31 - Fishing Rod (Qualquer versão)
32 - Jungle Maw (planta que morde)
33 - Npc Stan (fantasias de Carnaval)
Clicar -------/\

Dartilus

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 20/08/07Posts: 76Char no Tibia: Não jogo

Gostei cara, nunca tive vontade de ir até Venore (certo?) pegar uma =X.

Me responde uma coisa, quanto tempo fica a fantasia?Até o carnaval acabar?

 

Atenciosamente,

Dartilus


The Stalker, Lux Fero
Oh, trust in my, self-righteous suicide, I cry when angels deserve to die...



~ Wind Slayer ~
Open beta dia 4, não perca!
Caso você participe do jogo no dia 4, logo que criar seu char por favor vá até a lista de amigos, Mento e adicione o Fabbio, assim poderei ajuda-lo quando precisar.

Claudioo

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/01/07Posts: 62

Ah, eu sei que é fácil, só sugeri :(

até coloquei, mas ai fico zuado porque faltou uma (surprise só tem red e blue :/)

exiva "assinatura.

nextsky

Banido
avatar
Banidos
Banidos

INFOS

Grupo: BanidosRegistrado: 04/01/08Posts: 119Char no Tibia: Overlord'Titan

Aqui funcionou legal obrigada conde pelo tutorial ele vai ser bem utilizado nesse carnaval.

FAG10

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 17/12/07Posts: 169Char no Tibia: Fereu

Funfo mtu lokooo

flww ;D

By Fereu
XTibia @ 2009 ~

DaNDaNrOxX

oi mosso
avatar
Marquês
Marquês

INFOS

Grupo: MarquêsRegistrado: 18/01/08Posts: 1455Char no Tibia: Saint Claire

Puts muito bom como tudo que você faz né :D ja coloquei no meu ot e ficou muito bom! Obrigado!!!

 

 

Entrada na equipe: 23/10/2008 Cargo: Estagiário

Promoção: 25/11/2008 Cargo: Moderador

Promoção: 21/10/2009 Cargo: Coordenador

Remoção: 09/05/2010 Motivo: Estudos

Retorno: 15/11/2010 Cargo: Moderador

Remoção: 20/12/2012.

 

 

matheusbm

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 29/01/08Posts: 71Char no Tibia: Knight of Fortune

Onda cara valeu ai?

Gostou de min use meu fan bar


Meu Ot

ip:otbm.no-ip.org
rate:1000
skill:1000
mana:1000


Minhas metas


[x]1post
[x]5 posts SERVO
[x]10 posts CAMPONÊS
[x]25 posts CAÇADOR
[x]50 posts CAVALEIRO
[x]100 posts BARONETE
[ ]200 posts BARÃO
[ ]300 posts VISCONDE
[ ]400 posts DUQUE
[ ]600 posts ARQUEDUQUE
[ ]800 posts ARISTOCRATA
[ ]1000 posts REGENTE
[ ]1400 posts SÁBIO
[ ]1800 posts SACERDOTE
[ ]2500 posts PRÍNCIPE


Meus trabalhos

DevilManCray

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 22/04/08Posts: 15Char no Tibia: Evil Man Cray

Cara sempre fui teu fa tu se gasta muito faz coisas impossiveis

segue assim e eu serei seu fa

 

 

Sou Fan de :

ixijs0.jpg

 

mybar992as3.png

 

dandan983lw2.gif

 

condesapofan2sz1.gif

Meu novo Xtibia: Mats Rulez



E meu fan ? te ajudei ? use minha fan bar!





Avatars Masculinos:











Avatars Femininos:










Sou Fan de:


















Orange

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 20/04/08Posts: 71Char no Tibia: Maskonic

xD

Orange Serv


Server em desenvolvimento
Aguarde um dos melhores servidores de tibia.

~~GM Waleker~~

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/01/07Posts: 736

@Orange

 

Alertado por flood.

Ththt

?
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 26/07/07Posts: 540Char no Tibia: Keni Daro

muito bom =D

achei bem criativo

Olá XTibiano:

Sua assinatura estava com um problema na TAG SPOILER e foi movida para a parte "Sobre mim".
Agradecemos a sua compreensão.

Atenciosamente,
JV Chequer

favelado

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/10/05Posts: 77

Me lembro ate hj quando eu vi isso pela primera vez, eu saindo de Thais vi um cara de Demon! lol

Foi muito comedia..

 

@topic.

Muito bom! =P

"E quando alguém o abraçar, não seja você o primeiro a soltar os braços."

"É facil para os inocentes falar de justiça. Eles raramente sentem sua terrivel força".

"Mil poderão cair ao teu lado,e dez mil à tua direita.Mas tu nunca serás atingido."


newcomer_sorceress.jpg

vitiman

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 04/04/07Posts: 100

Bem nao intendi direito mas o q ele faz afinal

eu vi que veio do global mas o q ele , faz?