bem que poderia por pra recarregar tb a fire boots.
- Fórum
- OTServ
- Recursos
- Scripting
- NPCs, monsters e raids
- [NPC] Npc Roy , Recarrega Soft Boots
[NPC] Npc Roy , Recarrega Soft Boots
Por LorD Sybian, 17 de mai. de 2009 em NPCs, monsters e raids
info
Grupo: Conde
Registrado: 07/05/08
Posts: 612
Reputação: +12
Char no Tibia: leviana luciferiana

bom cara eu não sei pq mas no meu ot 8.40 eu coloquei ele e tudo falo ( hi) com ele, ele me responde mas depois ele não responde mas nada que eu falo , sera que vc pode me ajuda ?
info
Grupo: Visconde
Registrado: 03/02/09
Posts: 361
Reputação: +200
Char no Tibia: Fearless Man

aki também n funcionou (TFS 0.3.4) mas eu peguei o script e mexi nele agora funciona vê aí:
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
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
if msgcontains(msg, 'worn soft boots') or msgcontains(msg, 'recharge') or msgcontains(msg, 'soft boots') then
selfSay('Yes, my fathers was a great one blacksmith, it was a wise person , but when he decided to teach me he dies and i just learn about the lovely boots. So, did you bring me some boots? which one?', cid)
talk_state = 1
elseif msgcontains(msg, 'yes') and talk_state == 1 then
if getPlayerItemCount(cid,6530) >=1 and getPlayertemCount(cid,2160) >= 1 then
if doPlayerRemoveMoney(cid,10000) and doPlayerTakeItem(cid,6530,1) then
selfSay('Here you are.', cid)
doPlayerAddItem(cid,2358,1)
end
else
selfSay('Sorry, you don\'t have the item.', cid)
talk_state = 0
end
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
selfSay('Ok then.', cid)
talk_state = 0
end
--Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
usa o mesmo xml do esk~ e a recarga custa 10k
nem vo por creditos pq n fui eu quem fiz, só arrumei pra funcionar em 8.4 e 8.42
edited:
trokei o doPlayerTakeItem(cid,2160,1) por doPlayerRemoveMoney(cid,10000)
Editado Julho 20 por apocarai
info
Grupo: Conde
Registrado: 07/05/08
Posts: 612
Reputação: +12
Char no Tibia: leviana luciferiana

erros dos dois scripts. esk~ e apocarai.
esk~
getPlayerItemCount(cid,2152) >= 1
apocarai
getPlayerItemCount(cid,2160) >= 1
se voces poem pra ele verificar id de moedas e a pessoa nao ter o id de tal moedas vai dar erro.
2152 = platinum coin se nao tiver platinum o npc nao fala (por erro no script)
2160 = se nao tiver da o mesmo erro do script do "esk~" (suspeito).
info
Grupo: Visconde
Registrado: 03/02/09
Posts: 361
Reputação: +200
Char no Tibia: Fearless Man

Não da erro proprieamente dito. ele fala "Sorry, you don't have the item" e o "suspeito" que vc colocou depois do meu nome ali é porque ta suspeito de ter copiado o script?? se for, eu copiei sim, porém alterei as falas e os talk_state porque em ot 8.4 e 8.42 vc falava hi ele falava "i've been specting you" e n falava mais nada. e eu coloquei embaixo da minha resposta que eu n ia colocar creditos pq n fui eu quem fiz, só alterei.
vlws
info
Grupo: Conde
Registrado: 07/05/08
Posts: 612
Reputação: +12
Char no Tibia: leviana luciferiana

o erro esta aqui no elseif.
o certo seria usar if e nao elseif
elseif msgcontains(msg, 'yes') and talk_state == 1 thenif getPlayerItemCount(cid,6530) >= 1 and getPlayerItemCount(cid,2152) >= 100 then
if doPlayerTakeItem(cid,6530,1) and doPlayerTakeItem(cid,2152,100) == 0 then
selfSay('Here you are.')
doPlayerAddItem(cid,2358,1)
end
else
selfSay('Sorry, you don\'t have the item.')
end
Editado Julho 20 por Marcryzius




info
Grupo: Campones
Registrado: 14/05/09
Posts: 92
Reputação: +1
Aew galera vomos lá esté e o NPC Roy ele recarrega a bota para você...
Vomos lá...
vá em data/npc/script e crie um arquivo xml. com o nome roy depois apague tudo que estiver nele e coloque isso :
~~ Salve e fexe o arquivo ~~
Parte 2
Abra a pasta data/npc/script
Copie um arquivo
abra ele, selecione tudo
e cole isso lá dentro:
Depois coloque o nome dele de shoes , e pronto seu npc que regarrega boots está pronto !!!