local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local think = os.clock()
function onCreatureAppear(cid)
npcHandler:onCreatureAppear(cid)
end
function onCreatureDisappear(cid)
npcHandler:onCreatureDisappear(cid)
end
function onCreatureSay(cid, type, msg)
npcHandler:onCreatureSay(cid, type, msg)
end
function onThink()
npcHandler:onThink()
local direction = getCreatureLookDirection(getNpcId())
if os.clock() > think then
doCreatureSetLookDirection(getNpcId(), (direction == 3 and 0 or (direction + 1)))
think = think + 2
end
end
npcHandler:addModule(FocusModule:new())
JU
dúvida
Como fazer para o Monstro/NPC ficar rodando?
Por juliok80, 10 de jan. de 2013 em Scripts
monstro
npc
rodar
4
1.2k
11 de janeiro de 2013 às 13:45
info
Grupo: Artesão
Registrado: 15/11/12
Posts: 120
Reputação: +17
Char no Tibia: Ba Rao

11 de janeiro de 2013 às 21:45
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local think = os.clock() function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() local direction = getCreatureLookDirection(getNpcId()) if os.clock() > think then doCreatureSetLookDirection(getNpcId(), (direction == 3 and 0 or (direction + 1))) think = think + 2 end end npcHandler:addModule(FocusModule:new())
MUITISSIMO OBRIGADO ONESHOT!
Você é foda...
Te quiero! ![]()
Pode fechar o tópico!





info
Grupo: Artesão
Registrado: 15/11/12
Posts: 120
Reputação: +17
Char no Tibia: Ba Rao
Galera, eu criei algumas quests de addons e para entrar na quest o player passa por uma sala onde existem os monstros vestidos com os addons. Gostaria de saber se é possível fazer o monstro ficar rodando no SQM.
Tentei utilizar o lookdir mas não consegui, alguém ai sabe como eu posso fazer isso?
lookdir 0 = /\ (para o norte)
lookdir 1 = > (para o leste)
lookdir 2 = \/ (para o sul)
lookdir 3 = < (para o oeste)
Queria que ele mudasse de posição a cada 2 segundos.
OBS: pode ser com monstro ou NPC, qualquer coisa eu altero os monstros para NPC, pois estes monstros só servem para indicar qual é o addon...
Obrigado!
Editado Janeiro 10 por juliok80