Esse npc existe na pasta npc do ot??
- Fórum
- xTibia - Notícias e Suporte
- Soluções
- Archived
- [Ajuda] Me Ajudem Aqui Por Favorrr
Não, eu peguei um script aqui do XTibia ^^
Se voce ja tiver um pouco de conhecimento de scripts, abra os arquivos que voce baixou e tente encontrar o erro.
Se nao conseguir, posta aqui pra gente o script e dar uma olhada por favor.
Se voce renomeou o npc pode ser o erro, ai ele nao encontra.
Editado Julho 31 por Kmmy
info
Grupo: Campones
Registrado: 26/07/11
Posts: 12
Reputação: +13

Esse erro acontece quando o servidor não consegue encontrar a npc em seu respectivo diretório, verifique se não mudou o nome da npc ou algo do tipo.
Editado Julho 31 por Blazingfire
vou verificar tdo isso, ja edito aqui
@Edit
Verifiquei tdo
n achei nada de "Errado" em relação aos nomes dos arquivos. olhem os scripts aew:
Arquivo do NPC (Vocation.xml)
<?xml version="1.0" encoding="UTF-8"?>
<npc name="ZK Recruter" script="data/npc/scripts/vocation.lua" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="128" head="20" body="100" legs="50" feet="99" corpse="2212"/>
<parameters>
<parameter key="message_greet" value="Ola |PLAYERNAME|. voce gostaria de entrar para a guild {ZK} por 10 Gold Coins?" />
</parameters>
</npc>
Script do arquivo.lua (vocation.lua)
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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
local talkState = {}
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local cfg = {
itemid = 2157, --Substitua 'xxxx' pelo ID do item usado na Promotion
qnt = 10 --Substitua 'xx' pela quantidade do item requerido
}
if msgcontains(msg, "zk") then
selfSay("Voce realmente quer entrar na guild por 10 GC ({Gold Coins})?", cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, "yes") and talkState[talkUser] == 1)then
if doPlayerRemoveItem(cid, cfg.itemid, cfg.qnt) then
selfSay('From now, you are promoted!', cid)
setPlayerPromotionLevel(cid, 1)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
else
selfSay('voce nao possui '.. cfg.qnt ..' '.. getItemNameById(cfg.itemid) .. Mate mais zombies e volte a falar comigo., cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end
elseif msg == "no" and talkState[talkUser] == 1 then
selfSay("Okay, Volte se mudar de ideia. ", cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Acho que é isso
Editado Julho 31 por Exceed
Um dos problemas pode ser o seguinte:
Esse script é funcional apenas para algumas versões do Tibia. Se voce estiver tentando com alguma 8.54+ nao vai funcionar.
Em breve vou editar aqui com o Script para 8.54+
No vocation.lua, apague tudo e coloque:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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
npcHandler:setMessage(MESSAGE_GREET, "Ola |PLAYERNAME|. Voce gostaria de entrar para a guild {ZK} por 10 Gold Coins?")
local talkState = {}
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local cfg = {
itemid = 2157, --Substitua 'xxxx' pelo ID do item usado na Promotion
qnt = 10 --Substitua 'xx' pela quantidade do item requerido
}
if msgcontains(msg, "zk") then
selfSay("Voce realmente quer entrar na guild por 10 GC ({Gold Coins})?", cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, "yes") and talkState[talkUser] == 1)then
if doPlayerRemoveItem(cid, cfg.itemid, cfg.qnt) then
selfSay('From now, you are promoted!', cid)
setPlayerPromotionLevel(cid, 1)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
else
selfSay('voce nao possui '.. cfg.qnt ..' '.. getItemNameById(cfg.itemid) .. Mate mais zombies e volte a falar comigo., cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end
elseif msg == "no" and talkState[talkUser] == 1 then
selfSay("Okay, volte se mudar de ideia.", cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
E no Vocation.xml, apague tudo e coloque:
<?xml version="1.0"?> <npc name="ZK Recruter" script="data/npc/scripts/vocation.lua" walkinterval="2000"> <health now="100" max="100" /> <look type="128" head="20" body="100" legs="50" feet="99" addons="0"/> </npc>
Se a versão do OT for 8.54+ isso pode ser o sulficiente para resolver.
De uma lida e veja se voce quer modificar algo, mas eu ja ajustei para seu propósito.
Editado Julho 31 por Kmmy


info
Grupo: Campones
Registrado: 19/07/11
Posts: 14
Reputação: +1
Então galere, presiso de ajuda urgente :x tipo, eu estou fazendo um server de tibia com sprites editados e talz, sobre Zombies, tipo R.E, porem... como n ficaria legal usar uma voc como "Sorcerer ou Druid" em um server como esse, resolvi fazer as vocation baseadas em 2 "guilds". ou seja, vc fala com o npc "X" e ele te da a vocation "Y". Ja tentei varios scripts, so que quando tento "invocar" os Npc's no tibia aparece "There is not enough room" (In Game) e no EXE Aparece "LuaDoCreateNpc(). npc name(Vocation) not found" porem.. no map editor, quando tento "Importar" ele ele aparece normal '-'. Alguem me ajuda pf
Se estiver no lugar errado mova pf
Editado Julho 30 por Exceed