q tal muda o nome la na tabela.. de Junior pra Agatha? ;/
- Fórum
- OTServ
- Suporte
- Tópicos Sem Resposta
- [Encerrado] Ajuda NPC Agatha
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

info
Grupo: Cavaleiro
Registrado: 18/11/12
Posts: 197
Reputação: +24
Gênero: Masculino
Char no Tibia: HouseKkeper

AEOKAEPKAPEOKAEPOK OK!TESTANDO!
[11/01/2013 22:58:07] [Error - LuaScriptInterface::loadFile] data/npc/scripts/Agatha.lua:16: '=' expected near 'task'
[11/01/2013 22:58:07] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/Agatha.lua
[11/01/2013 22:58:07] data/npc/scripts/Agatha.lua:16: '=' expected near 'task'
erro ![]()
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
Agatha task = {
["Agatha"] = {{"Shiny Abra", 200}},
}
if msgcontains(msg, 'task') or msgcontains(msg, 'Task') then
if isMyTaskComplete(cid, getNpcCid()) then
selfSay("Wow you have already complete my task! Ok then, take your reward!", cid)
doPlayerAddItem(cid, 2160, 50)
doPlayerAddItem(cid, 11482, 5) --premio
doPlayerAddExp(cid, 200000)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
talkState[talkUser] = 0
return true
else
selfSay("Then, is a simple task, i want to you kill {200 Shiny Abra}, you accept the task?", cid)
talkState[talkUser] = 2
end
elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'Yes')) and talkState[talkUser] == 2 then
if getMyTaskSto(cid, getNpcCid()) ~= -1 then
selfSay("You are already doing my task! go end it!", cid)
talkState[talkUser] = 0
return true
end
local sto = getFreeTaskStorage(cid)
if sto == -1 then
selfSay("You can't catch more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
selfSay("OK then... Go kill your targets!", cid)
setStorageArray(cid, sto, task)
talkState[talkUser] = 0
return true
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
ja mudado ![]()
vem arrumei trokei
Agatha task ={
por
Local task ={ ![]()
mas ta o bug eu mato e o nego n entrega reward ![]()
funcionou thhanks aki podem mover ![]()
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

intendi nd.. mas blz
sanado, movido
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.



info
Grupo: Cavaleiro
Registrado: 18/11/12
Posts: 197
Reputação: +24
Gênero: Masculino
Char no Tibia: HouseKkeper
bem fiz o npc agatha quest aki o script dele
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
local task = {
["Junior"] = {{"Shiny Abra", 200}},
}
if msgcontains(msg, 'task') or msgcontains(msg, 'Task') then
if isMyTaskComplete(cid, getNpcCid()) then
selfSay("Wow you have already complete my task! Ok then, take your reward!", cid)
doPlayerAddItem(cid, 2160, 50)
doPlayerAddItem(cid, 11482, 5) --premio
doPlayerAddExp(cid, 200000)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
talkState[talkUser] = 0
return true
else
selfSay("Then, is a simple task, i want to you kill {200 Shiny Abra}, you accept the task?", cid)
talkState[talkUser] = 2
end
elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'Yes')) and talkState[talkUser] == 2 then
if getMyTaskSto(cid, getNpcCid()) ~= -1 then
selfSay("You are already doing my task! go end it!", cid)
talkState[talkUser] = 0
return true
end
local sto = getFreeTaskStorage(cid)
if sto == -1 then
selfSay("You can't catch more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
selfSay("OK then... Go kill your targets!", cid)
setStorageArray(cid, sto, task)
talkState[talkUser] = 0
return true
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Agatha" script="Agatha.lua" walkinterval="350000" floorchange="0" speed="0" lookdir="2">
<health now="150" max="150"/>
<look type="881" head="10" body="15" legs="20" feet="25"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|, i have some {task} for you... Are you interested?"/>
</parameters>
</npc>
e quando eu mato os 200 D,A e vo recebe reward ela fala isso
Agatha: OK then... Go kill your targets!
e n ganho o reward alguem ajda ????