local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local reinoOculto = {x = 123, y = 102, z = 7} -- Hidden Kingdom Coordinates
function onCreatureAppear(cid)
npcHandler:onCreatureAppear(cid)
end
function onCreatureDisappear(cid)
npcHandler:onCreatureDisappear(cid)
end
function onCreatureSay(cid, type, msg)
npcHandler:onCreatureSay(cid, type, msg:lower())
end
function onThink()
npcHandler:onThink()
end
local talkState = {}
function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
end
local talkUser = cid
if msgcontains(msg, 'skinning') and talkState[talkUser] ~= 1 then
selfSay("Beside those creatures that you see, you will be able to skin most creatures you face. When you skin creatures you have a chance to get some leather. Leather is very important to crafting. You need a backpack to carry things around and to craft a backpack you need to learn about skinning. Take this leather and make a backpack at the anvil to the left.", cid)
talkState[talkUser] = 1
elseif talkState[talkUser] == 1 and msgcontains(msg, 'skinning') then
doPlayerAddItem(cid, 27851, 5)
selfSay("You've already received the leather. Beside those creatures that you see, you will be able to skin most creatures you face. When you skin creatures you have a chance to get some leather. Leather is very important to crafting. You need a backpack to carry things around and to craft a backpack you need to learn about skinning.", cid)
elseif talkState[talkUser] == 1 and msgcontains(msg, 'craft') then
doPlayerAddItem(cid, 27871, 5)
doPlayerAddItem(cid, 11370, 10)
doPlayerAddItem(cid, 4843, 1)
selfSay('Everything can be done through crafting, but to craft you need materials that you can get by mining stones, chopping wood, refining materials, and skinning creatures. A crusader needs to learn to adapt, so you need to know how to use at least 9 types of weapons. Unfortunately, I only have materials for you to create either a sword, an axe, a dagger, or a club. Here are the materials for you to craft your weapon at the anvil to the left, and remember that you can always gather more materials and craft other types of weapons.', cid)
talkState[talkUser] = 2
elseif talkState[talkUser] == 2 and msgcontains(msg, 'cooking') then
doPlayerAddItem(cid, 27905, 2)
selfSay('You are immortal again, however, wounds don\'t heal by themselves; they need nutrients to heal and regenerate, just like for you to refill your mana. To cook meals, you can harvest plants, fish at any type of water, and combine them in the oven to have a decent meal. Here are the ingredients for you to make a meal at the oven to the south.', cid)
elseif talkState[talkUser] == 2 and msgcontains(msg, 'alchemy') then
doPlayerAddItem(cid, 27911, 2)
doPlayerAddItem(cid, 2670, 10)
selfSay('You won\'t survive long in your adventure just eating food. Strong creatures deal a lot of damage, and even though you are immortal, you can succumb and lose your consciousness. But with potions, you might survive. However, you need to know that the big potions store might not be the best place for you to get potions; their focus is money, so they create terrible potions and charge a lot of money. The best potions are the ones you create. Here are the ingredients for you to craft some potions. If you have a backpack, weapon, potion, and a meal, then we should go to our {NEXT} memory.', cid)
elseif talkState[talkUser] == 2 and msgcontains(msg, 'next') then
doTeleportThing(cid, reinoOculto)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
selfSay("You are getting the hang of this strange journey inside your own mind!", cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())