[ Fechado ] Como Fazer Um Npc Chamado Cityguard:)

braz456
em Lixeira Pública

braz456

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 16/01/09Posts: 20Char no Tibia: dark nettow

Olá vamos aprender como fazer um npc chamado city guard xD

Vá em data/npc/renomeio qual quer um arquivo para cityguard apague tudo e cole issu

 

 

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Cityguard" script="data/npc/scripts/cityguard.lua" walkinterval="0" floorchange="0" speed="900">
<health now="150" max="150"/>
<look type="131" head="116" body="94" legs="78" feet="19"/>

 <interaction range="3" idletime="60">

<interact keywords="hi" focus="1">
  <keywords>hello</keywords>

  <response text="Nothing to see here, move along.">
	<action name="idle" value="1"/>
  </response>
</interact>

<interact keywords="bye" focus="0">
  <keywords>farewell</keywords>

  <response text="Good bye."/>
</interact>
 </interaction>

</npc>

Agora va em data/npc/scripts renomeie qualquer arquivo para City guard apague tudo e coloque issu

 

 

[code] 

local target = 0
local prevTarget = 0
local maxChaseDistance = 20
local origPos = 0
local lastAttack = 0
local followTimeout = 10

local function isSkulled(cid)
if(getPlayerSkullType(cid) >= 3 and isPlayerPzLocked(cid) == TRUE) then
 return true
end

return false
end

local function goToOrigPos()
target = 0
lastAttack  = 0
selfFollow(0)
doTeleportThing(getNpcCid(), origPos)
end

local function updateTarget()
if(isPlayer(target) == FALSE) then
 goToOrigPos()
elseif(not isSkulled(target)) then
 selfSay("Now, behave in the future.")
 goToOrigPos()
end

if(target == 0) then
 local list = getSpectators(getNpcPos(), 9, 9, false)
 for i = 1, table.getn(list) do
  local _target = list[i]
  if(_target ~= 0) then
if(isPlayer(_target) == TRUE and isSkulled(_target)) then
 if(getTilePzInfo(getCreaturePosition(_target)) == FALSE) then
  if(selfFollow(_target)) then
   target = _target
   if(target ~= prevTarget) then
	selfSay("We do not tolerate people like you here!")
   end

   prevTarget = target
   break
  end
 end
end
  end
 end
end
end

function onCreatureAppear(cid)
if(cid == getNpcCid()) then
 origPos = getNpcPos()
end
end

function onCreatureDisappear(cid)
if(cid == target) then
 goToOrigPos()
end
end

function onCreatureMove(creature, oldPos, newPos)
--
end

function onThink()
updateTarget()

if(target == 0) then
 return
end

local playerPos = getCreaturePosition(target)
local myPos = getNpcPos()

if(myPos.z ~= playerPos.z) then
 goToOrigPos()
 return
end

if(math.abs(myPos.x - origPos.x) > maxChaseDistance or math.abs(myPos.y - origPos.y) > maxChaseDistance) then
 selfSay("I'll catch you next time.")
 goToOrigPos()
 return
end

if(lastAttack == 0) then
 lastAttack = os.clock()
end

if(os.clock() - lastAttack > followTimeout) then
 selfSay("You got me this time, but just wait.")
 goToOrigPos()
 return
end

if((math.abs(playerPos.x - myPos.x) <= 1) and (math.abs(playerPos.y - myPos.y) <= 1)) then
 doTargetCombatHealth(getNpcCid(), target, COMBAT_LIFEDRAIN, -100000, -200000, CONST_ME_EXPLOSIONAREA)
 lastAttack = os.clock()
end
end
this to the colour of the text that shows the damage when the creature gets hit
------------------end of config------------------ 
local check_clock = os.clock() ----- leave this
local focus = 0 ----- leave this 
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)
health = getPlayerHealth(cid) - health_left
if ((string.find(msg, '(%a*)hi(%a*)'))) and getDistanceToCreature(cid) < 4 then 
selfSay('Hello ' .. creatureGetName(cid) .. '! I am a defender of '..town_name..'.') 
doNpcSetCreatureFocus(cid) 
focus = 0
end
if msgcontains(msg, 'time') then
selfSay('The time is ' .. getWorldTime() .. '.')
end
if messageIsInArray(swear_words, msg) then
if Attack_swearers == TRUE then
selfSay('' .. swear_message ..' ') 
doPlayerAddHealth(cid,-health)
doSendMagicEffect(getThingPos(cid),17) 
doSendAnimatedText(getThingPos(cid),health,180)
doNpcSetCreatureFocus(cid) 
focus = 0 
end
end
end 

function getMonstersfromArea(pos, radiusx, radiusy, stack)
local monsters = { } 
local starting = {x = (pos.x - radiusx), y = (pos.y - radiusy), z = pos.z, stackpos = stack} 
local ending = {x = (pos.x + radiusx), y = (pos.y + radiusy), z = pos.z, stackpos = stack} 
local checking = {x = starting.x, y = starting.y, z = starting.z, stackpos = starting.stackpos} 
repeat 
creature = getThingfromPos(checking) 
if creature.itemid > 0 then 
if isCreature(creature.uid) == TRUE then
if isPlayer(creature.uid) == FALSE then
if Attack_monsters == TRUE then
table.insert (monsters, creature.uid) 
check_clock = os.clock()
end
elseif isPlayer(creature.uid) == TRUE then 
if Attack_pkers == TRUE then
if getPlayerSkull(creature.uid) > 0 then
table.insert (monsters, creature.uid) 
check_clock = os.clock() 
end
end
end 
end 
end 
if checking.x == pos.x-1 and checking.y == pos.y then 
checking.x = checking.x+2 
else 
checking.x = checking.x+1 
end 
if checking.x > ending.x then 
checking.x = starting.x 
checking.y = checking.y+1 
end 
until checking.y > ending.y 
return monsters 
end 

function onThink() 
if (Attack_monsters == TRUE and Attack_pkers == TRUE) or (Attack_monsters == TRUE and Attack_pkers == FALSE) or (Attack_monsters == FALSE and Attack_pkers == TRUE) then
if (os.clock() - check_clock) > check_interval then 
monster_table = getMonstersfromArea(getCreaturePosition(getNpcCid( )), radiusx, radiusy, 253) 
if #monster_table >= 1 then
selfSay('' .. Attack_message ..' ') 
for i = 1, #monster_table do 
doNpcSetCreatureFocus(monster_table[i]) 
local damage_min = (level * 2 + maglevel * 3) * min_multiplier 
local damage_max = (level * 2 + maglevel * 3) * max_multiplier 
local damage_formula = math.random(damage_min,damage_max) 
doSendMagicEffect(getThingPos(monster_table[i]),17)
doCreatureAddHealth(monster_table[i],-damage_formula) doSendMagicEffect(getThingPos(monster_table[i]),hit_effect)
doSendAnimatedText(getThingPos(monster_table[i]),damage_formula,damage_colour) 
check_clock = os.clock() 
focus = 0 
end 
elseif table.getn(monster_table) < 1 then 
focus = 0 
check_clock = os.clock() 
end 
end
end
focus = 0
end

Agora feche salve é ligue seu ot e fale /n cityguard

Hail

 

Visite meu ot otyour.servegame.com

 

Descubra oq tem aki \/

Da mas 3 click

Mas 2 click

Mas 1 clikc plxx

Parabens vc deu 3 Click

Bernardo

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 23/11/07Posts: 1523Gênero: Masculino

Usuário banido, tópico fechado.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ou não

Ou sim

 

 

Reportado :lol²:

casaadordirati

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 14/08/09Posts: 4Char no Tibia: casador di rati

valeu cara, você salvou a minha vida, sem esta ajuda eu iria morrer amanhã, muito obrigado, merece fixo, você merece uma área só de pornô e de tutoriais no xistibia, valeu mesmo

.:.Motivo da minha retirada.:.


Flws para vocês seus merdas, já tô cansado dessa porra toda, ficar tomando xingamento sem sentido e críticas idiotas, ainda mais com essa merda de 60 segundos para postar, sim, foda-se, eu xingo muito, e daí? Eu só tô defendendo quem está sendo injustiçado, não por causa de merdinhas que ficam xingando o cara sem sentido, ah, que se foda, não acesso mais essa merda também não, vocês não percebem que essa porra toda só tá acabando, não é? Olhe um dos membros que já tá vazando: JVChequer - Se os otários não percebem que ele tá saindo se liga.. Também já tá cansado dessa merda toda, se fosse para eu ser algum membro idiota sem graça seria random ou então, seria troll tentando falar qualquer coisa que ficasse fora do padrão de um bom usuário, ah, que porra, isso tá chato demais, ainda mais que precisa esperar 60 segundos para postar?
Fala sério.

Flws para vocês, os únicos caras legais que eu encontrei nessa merda toda foram:
DanielOliveira(Nem tanto, mas fez bobagens também)
Guimanucci(O único cara que não era mais um idiota qualquer, foi até amigo)
LordZ(Antes de sair falei um pouco com ele)
Pedro(Não era um otário)
Bernardo(Conhecí um pouco, mas me xingou algumas vezes, rs)
Rodrigo(Não sei falar nada)
DarkK(Amigo.)
Vilden(Quando jogava tibia gostava de seus ot's, rs)
e qualquer um que eu lembrar, depois edito esse negócio, ou não.


Maiores cusões:
Powerzete(Nick atual)
Kakilo
Slipknotshadow

Dark Kninght

Pseudo Manjador das Interwebs
avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 28/07/06Posts: 178Gênero: Masculino

algum moderador por favor suspende a conta desse cara

ele deve ser débil mental ou sofrer de qualquer outro disturbio

signxt.png

 

"Manjo das putaria tudo" since 2006

antoniojun

Ex- Imprensa |~
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 20/11/07Posts: 359

NOOSSA, QUE MASSA, TA NO MEU OT.

Powerzone

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/08/09Posts: 29

ele ta fazendo de sacanagem cara.. vocês não perceberam isso ainda?

 

alguém bane esse cara, pelo amor de deus

INDIE VI@do

bachiegao

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 25/06/09Posts: 26

eu sei de um jeito muito + facil

pegue qualquer npc e mude seu nome pra City Guard

 

pronto

agora vc ja tem um npc com o nome de City Guard

< vendo 2 plate leg, 1 kanait axe, 12 ham verde e 3 chai amor >

inteersados mandar pm

DaNDaNrOxX

oi mosso
avatar
Marquês
Marquês

INFOS

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

Ahhhhhhhhhh brother

você ta de bricadeira em...

Já é a terceira ou quarta vez que posta este tipo de conteúdo no barzinho cara! Po, já não te suspendi, mas se você fizer isto mais uma vez não terei outra escolha.

 

Alertado em 10%,

:button_cancel: Tópico Fechado

 

 

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.