Como Mudar O Temple Do Personagem Por Npc

Tuco
Por Tuco
em Linguagens de Programação

Tuco

avatar
Campones
Campones

INFOS

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

bom isso é mtu facil de fazer mais tem muita gente q nao sabe

e isso tbm é pra vc n ter q fika editando o char do cara mudando o templw

ok:

crie um arqivo.lua na pasta data/npc/scrpits

pode ser qualquer nome eu uso por exemplo:temple_tiquanda_edron

ou sei la

dia abre ele e bota isso:

focus = 0

talk_start = 0

target = 0

following = false

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 ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 3 then

  selfSay('oi ' .. creatureGetName(cid) .. '! eu faço vc morar em edron (50gps) ou em tiquanda (50gps) vc ker??')

  focus = cid

  talk_start = os.clock()

  end

if string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 3 then

  selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

  end

  if msgcontains(msg, 'edron') and focus == cid then

  if pay(cid,50) then

  selfSay('Let\'s go!')

  setPlayerMasterPos(cid,238,155,8)

  selfSay('/send ' .. creatureGetName(cid) .. ', 238 155 8')

  focus = 0

  talk_start = 0

  else

  selfSay('Sorry, you don\'t have enough money.')

  talk_start = os.clock()

  end

  end

  if msgcontains(msg, 'tiquanda') and focus == cid then

  if pay(cid,50) then

  selfSay('Let\'s go!')

  setPlayerMasterPos(cid,160,54,7)

  selfSay('/send ' .. creatureGetName(cid) .. ', 160 54 7')

  focus = 0

  talk_start = 0

  else

  selfSay('Sorry, you don\'t have enough money.')

  talk_start = os.clock()

  end

  end

  if string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 then

  selfSay('Good bye, ' .. creatureGetName(cid) .. '!')

  focus = 0

  talk_start = 0

  end

end

function onCreatureChangeOutfit(creature)

end

function onThink()

  if (os.clock() - talk_start) > 30 then

  if focus > 0 then

    selfSay('Next Please...')

  end

    focus = 0

  end

end

resumindo:

if msgcontains(msg, 'tiquanda') and focus == cid then

if pay(cid,50) then

selfSay('Let\'s go!')

setPlayerMasterPos(cid,160,54,7)

selfSay('/send ' .. creatureGetName(cid) .. ', 160 54 7')

tiquanda oq o player fala

dai ali em setPlayerMasterPos(cid,160,54,7) seria a coordenada x y z

e no final

selfSay('/send ' .. creatureGetName(cid) .. ', 160 54 7')

enviar o player pra a coordenada xyz

iso vc muda de acordo com o seu gosto

dai é só faze o arquivo .xml du npc e talz

foi mal se fico mal explicado é q aki é ano novo e ta começando a festa aki em casa flws

QUOTE

Assinatura removida por estar fora das regras.

Xedegux.

efew

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 07/10/05Posts: 53

acho que isso nao é em programaçao se nao me engano, acho que é em tutorias ~.^

Fellipe-Chaos

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 02/12/05Posts: 5

Vc devia posta na seçao tutoriais :sleeping:

QUOTE
Assinatura removida por estar fora das regras.
Xedegux.

fabriciot

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/12/05Posts: 5

Muito criativo! Continue assim!!

FELIZ ANO NOVO P/ TODOS!! =***

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

Meu Server:

>>IP: saintseya.no-ip.info

>>site: http://saintseya.no-ip.info:8090

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

Dou Suporte Via MSN: fabricio_grunge@hotmail.com

Rotciv

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 14/10/05Posts: 423Char no Tibia: Rotciv

eh igualzinho a NPC de teleport, soh que com o PlayerMasterPosition! mto legal.

Acessando apenas para criticar (positivamente).

E-mail: rotciv@xtibia.com

Tuco

avatar
Campones
Campones

INFOS

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

ixi errei a seçao alguem pode move pra la?

QUOTE

Assinatura removida por estar fora das regras.

Xedegux.

Faua

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 07/05/06Posts: 11

Meu Deus, nem tenho palavras pra expressar minha gratidão, agora sim meu ot está super legal, em breve vou lançar pra todos jogarem. Continue assim e não ligue se o post estiver na sessão errada, o que importa é ajudar.

Atenciosamente,

Faua. :bye:

leandrocore

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 01/12/07Posts: 127Gênero: Masculino

muito bom mais lugar errado

:icon3:

 

 

By DaRk

 

 

:XTibia_smile: