Legal Mas esse Sccript Ja Tem Em Quase Todos os OTS !
5
2.8k
2 meses depois...
info
Grupo: Marquês
Registrado: 25/09/10
Posts: 1.3k
Reputação: +446
Gênero: Masculino

08 de junho de 2011 às 17:16
Editado Junho 11 por Krhiegen
2 semanas depois...
19 de junho de 2011 às 15:37
Bom , em subwat não tem , vou pegar para colocar no meu , brigadao REP + ![]()
info
Grupo: Conde
Registrado: 16/06/08
Posts: 998
Reputação: +185
Gênero: Masculino

19 de junho de 2011 às 16:07
Os créditos são da TFS, o script é o mesmo do cityguard.
Apenas as falas e o .xml que muda.
Compare:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Cityguard" script="cityguard.lua" walkinterval="0" floorchange="0" speed="900">
<health now="150" max="150"/>
<look type="131" head="19" body="19" legs="19" 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>
local target = 0
local prevTarget = 0
local maxChaseDistance = 20
local origPos = 0
local lastAttack = 0
local followTimeout = 10
local function isSkulled(cid)
if(getCreatureSkullType(cid) >= SKULL_WHITE and isPlayerPzLocked(cid)) then
return true
end
return false
end
local function goToOrigPos()
target = 0
lastAttack = 0
selfFollow(0)
doTeleportThing(getNpcCid(), origPos)
end
local function updateTarget()
if(not isPlayer(target)) 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) and isSkulled(_target)) then
if(not getTilePzInfo(getCreaturePosition(_target))) 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, -200, -300, CONST_ME_BLOCKHIT)
lastAttack = os.clock()
end
end
Editado Junho 19 por fireelement
6 meses depois...
info
Grupo: Campones
Registrado: 01/02/11
Posts: 17
Reputação: +2
Char no Tibia: Polokinho

24 de dezembro de 2011 às 14:59
eu so quero saber como adicionar esse npc no mapa, porque ele nao aparece no meu map editor, e sempre q abvro o serv tenho q summonalo, é que eu abri um test server e estou editando, moderador me desculpe por reavivar o topico vim como ninja ![]()





info
Grupo: Visconde
Registrado: 06/04/11
Posts: 350
Reputação: +8
Char no Tibia: Mulekepirado
Olá galera
vim trazer para vocês um npc polical que mata pks, menas conversa e mais ação.
primeiro você vai na pasta do se ot data/npc ai você cria um arquivo xml o coloca isso dentro:
ai em seguida voce vai na pasta do seu ot data/npc/scripts você copia um arquivo lua e adiciona isso dentro:
local target = 0 local prevTarget = 0 local maxChaseDistance = 1000 --aqui é a distancia que ele vai correr atraz do pk no caso 1000 vai ser 1000 sqm local origPos = 0 local lastAttack = 0 local followTimeout = 100000 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("Vou te Pegar!! Algum Dia...") 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("Hahahah Seu Verme , é Hora de Morrer!") 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("Voce Esta Esgotando Meu Tempo Voce Vai Morrer!") 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, -2600, -5000, 9) --aqui e o dano que ele vai acertar no pk lastAttack = os.clock() end endbom galera e isso ae, qualquer duvida so postar que eu respondo suas presses :smile_positivo:
sou novo aqui e estou mim esforçando :weight_lift: ao maximo para poder ajudar a todos
flw :smile_positivo:
Editado Abril 6 por nbb147