Ir para conteúdo

Posts Recomendados

Npc que teleporta para o templo!

 

Na pasta Data~>npc copie qualquer outro Npc e renomeie para Templer abra e modifique para:

<npc name="Templer" script="data/npc/scripts/templo.lua" autowalk="25" floorchange="0" access="5" level="1" maglevel="1">

<health now="150" max="150"/>

<look type="129" head="114" body="119" legs="114" feet="114" corpse="2212"/>

<parameters>

 

</parameters>

</npc>

 

Na pasta Data~>npc~>scripts copie qualquer outro Script e renomeie para Templo abra e modifique para:

local focus = 0

local talk_start = 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('Oi ' .. creatureGetName(cid) .. 'Diga >Templo< para voltar para o templo!')

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, 'templo') then

if pay(cid,0) then

selfSay('Vaii!')

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

focus = 0

talk_start = 0

else

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

end

 

elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then

selfSay('Faloww, ' .. creatureGetName(cid) .. '!')

focus = 0

talk_start = 0

end

end

end

 

 

function onCreatureChangeOutfit(creature)

 

end

 

 

function onThink()

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

if focus > 0 then

selfSay('Próximo por favor')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Faloowws.')

focus = 0

end

end

end

 

Este NPC teleporta o player GRATUITAMENTE mas se quiser aumentar o preço mude onde esta vermelho!

Caso as coordenadas de seu templo seja diferente, altere onde está em aZul!

 

 

Dicas aonde colocar este NPC:

No final de uma quest, onde os teleports ficam feio.

No meu ot coloquei na area VIP, ficou bem legal!

 

Se você tiver mais algumas idéias poste que eu editO!

Link para o comentário
https://xtibia.com/forum/topic/91317-npc-templer/
Compartilhar em outros sites

×
×
  • Criar Novo...