saindo do forno ![]()
data\npc\arquivo.xml
esse Aquivo.xml pode usa os 3 igual só .lua que não vai trocando os nomedonpc
<npc name="NOMEDONPC" script="data/npc/scripts/arquivo.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="134" head="78" body="88" legs="0" feet="88" addons="3"/>
<parameters>
<parameter key="message_greet" value="Ola. Para mais informacoes de meus servicos diga {go}." />
<parameter key="message_farewell" value="Tchau." />
<parameter key="message_walkaway" value="Tchau." />
</parameters>
</npc>
data\npc\scripts\arquivo.lua
Esse È De Paladin
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local pos = {x=160,y=54,z=7} -------------- Pos para onde o player sera levado
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() end
function creatureSayCallback(cid, type, msg)
if msgcontains(msg, 'go') then
if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 or getPlayerVocation(cid) == 11 then
selfSay("Boa viagem.", cid)
doTeleportThing(cid, pos)
else
selfSay("Eu Não Posso Te Teleporta só Fiel A Os Paladin. E Vc Não è UM", cid)
end
end
return TRUE
end -- By Notle
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
data\npc\scripts\arquivo.lua
Esse È De Knight
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local pos = {x=160,y=54,z=7} -------------- Pos para onde o player sera levado
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() end
function creatureSayCallback(cid, type, msg)
if msgcontains(msg, 'go') then
if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 or getPlayerVocation(cid) == 12 then
selfSay("Boa viagem.", cid)
doTeleportThing(cid, pos)
else
selfSay("Eu Não Posso Te Teleporta só Fiel A Os Kinght. E Vc Não è UM", cid)
end
end
return TRUE
end -- By Notle
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
data\npc\scripts\arquivo.lua
Esse È De mages e druids
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local pos = {x=160,y=54,z=7} -------------- Pos para onde o player sera levado
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() end
function creatureSayCallback(cid, type, msg)
if msgcontains(msg, 'go') then
if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 or getPlayerVocation(cid) == 9 or getPlayerVocation(cid) == 10 then
selfSay("Boa viagem.", cid)
doTeleportThing(cid, pos)
else
selfSay("Eu Não Posso Te Teleporta só Fiel A Os Druds E Magos E Vc Não è UM", cid)
end
end
return TRUE
end -- By Notle
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
no meu topico vc vai entende melhor link


info
Grupo: Marquês
Registrado: 06/11/11
Posts: 1.1k
Reputação: +109
Char no Tibia: Stroked
Bom, preciso de 3 npcs, 1 que permita viajar somente Druids, Elder Druids, Sorcerers e Master Sorcerers, outro que viaje somente knight e Elite knight, e outro que viaje somente Paladinos e Royal Paladinos....
Cada npc com seu nome, pode ser qualquer nome, valeu!!