Witajcie potrzebuje skryptu na to zeby NPC mowil 2 razy pod rzad dam wam przyklad mojego skryptu
Moglby ktos jeszce zeedytowac mi ten skrypt? Mecze sie juz od wczoraj i nie wiem co jest zle :/
Code:
elseif msgcontains(msg, 'task') then
if getPlayerStorageValue(cid, 10) < 3 then
selfSay("Listen, my next task for you is not exactly easy either.")
selfSay("Listen, my next task for you is not exactly easy eitherr.")
talkState = 6
end
Moglby ktos jeszce zeedytowac mi ten skrypt? Mecze sie juz od wczoraj i nie wiem co jest zle :/
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
keywordHandler:addKeyword({'offers'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Eu compro/vendo Pearls, Gems e vendo jewelry.'})
keywordHandler:addKeyword({'pearls'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Eu compro/vendo Black Pearl (280gp/560gp) e White Pearl (160gp/320gp).'})
keywordHandler:addKeyword({'gems'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Eu compro/vendo Small Diamond (300gp/600gp), Small Sapphire (250gp/500gp), Small Ruby (250gp/500gp), Small Emerald (250gp/500gp) e Small Amethyst (200gp/400gp).'})
keywordHandler:addKeyword({'jewelry'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Eu vendo Wedding Ring (990gp), Golden Amulet (6600gp) e Ruby Necklace (3560gp).'})
function creatureSayCallback(cid, type, msg)
part = getPlayerStorageValue(cid, 7512)
addon = getPlayerStorageValue(cid, 7513)
sex = getPlayerSex(cid)
pos = getCreaturePosition(cid)
if msgcontains(msg, 'outfit') then
if getPlayerStorageValue(cid, 10) < 1 then
selfSay("What are you thinking! I would never allow you to slay my beloved friends for the sake of your narcism. Only Faolan can grant you a fur like this one.")
talkState = 1
end
elseif msgcontains(msg, 'faolan') then
if talkState == 1 then
selfSay('I know where the great wolf mother lives, but I will not tell that to just anyone. You have to earn my respect first. Are you willing to help me?')
talkState = 2
end
elseif msgcontains(msg, 'yes') then
if talkState == 2 then
selfSay('I heard of a flower which is currently unique in Tibia and can survive at only one place. I would love to have a sample of its blossom, but the problem is that it seldom actually blooms.I cannot afford to travel there each day just to check whether the time has already come.I would be deeply grateful if you could support me in this matter and collect a sample of the blooming Griffinclaw for me.Have you understood everything I told you and will fulfil this task for me?')
talkState = 3
elseif talkState == 3 then
selfSay('Alright then. Take this botanist\'s container and return to me once you were able to retrieve a sample. Don\'t lose patience!')
setPlayerStorageValue(cid, 10, 2)
talkState = 4
elseif talkState == 6 then
selfSay('Great! Here, take my waterskin and try to fill it with water from this special trickle. Don\'t lose my waterskin, I will not accept some random dirty waterskin.')
setPlayerStorageValue(cid, 10, 4)
talkState = 7
elseif talkState == 9 then
selfSay('Good! I will eagerly await your return.')
setPlayerStorageValue(cid, 10, 7)
talkState = 10
elseif talkState == 8 then
if getPlayerItemCount(cid,5939) >= 1 then
if doPlayerTakeItem(cid,5939,1) then
selfSay('Good work, Player! This water looks indeed extremely clear. I will examine it right away. If you are ready to help me again, just ask me for a task.')
setPlayerStorageValue(cid, 1010, 1)
end
else
selfSay('Sorry, you don\' have Water Skin.')
end
talk_state = 0
elseif talkState == 5 then
if getPlayerItemCount(cid,7249) >= 1 then
if doPlayerTakeItem(cid,7249,1) then
selfSay('Crunor be praised! The Griffinclaw really exists! Now, I will make sure that it will not become extinct. If you are ready to help me again, just ask me for a task.')
setPlayerStorageValue(cid, 200, 1)
end
else
selfSay('Sorry, you don\' have Sample Griffinclaw Flower.')
end
talk_state = 0
end
elseif talkState == 11 then
if getPlayerItemCount(cid,5906) >= 100 then
if doPlayerTakeItem(cid,5906,10) then
selfSay('I\'m very impressed. With this task you have proven that you are on the right side and are powerful as well. If you are ready to help me again, just ask me for a task.')
setPlayerStorageValue(cid, 10, 8)
end
else
selfSay('Sorry, you don\' have 100 Demon Dust.')
end
talk_state = 0
elseif msgcontains(msg, 'griffinclaw') and npcHandler.focus == cid then
selfSay('Were you able to obtain a sample of the Griffinclaw?')
talkState = 5
--------------------------------------Gryffinclaw--------------------------------------------
elseif msgcontains(msg, 'task') then
if getPlayerStorageValue(cid, 200, 1) then
selfSay("Listen, my next task for you is not exactly easy either.")
talkState = 6
end
elseif getPlayerStorageValue(cid, 1010, 1) then
selfSay("I'm glad that you are still with me, Player. Especially because my next task might require even more patience from your side than the ones before.")
talkState = 9
elseif msgcontains(msg, 'water skin') and npcHandler.focus == cid then
selfSay('Did you bring me a sample of water from the hydra cave?')
talkState = 8
-----------------------------------Water SKin----------------------------------------------
elseif msgcontains(msg, 'demon dust') and npcHandler.focus == cid then
selfSay('Were you really able to collect 100 ounces of demon dust?')
talkState = 11
elseif msgcontains(msg, 'no') and (talkState >= 1 and talkState <= 15) then
selfSay('Ok.')
talkState = 0
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Last edited: