• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

NPC Rookgard NPC's 100% real. (will be updated)

QuaS

Cykotitan Pwned =/
Joined
Sep 11, 2008
Messages
838
Reaction score
28
Location
Poland/ Wroclaw
Hello. I would like to relase you my work. This time this are NPC's from rookgard. I decided to relase it cuz i have written funny php script that convert normal tibia conversation to lua script. I hope that they Are 100% real. If not then "ALMOST".

Now will post 2 npc's. In future will be updated by rest of them.

First of ALL: This is 0.3.5 System!

Lets Start by Seymour:
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Seymour" script="seymour.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
<look type="128" head="116" body="69" legs="87" feet="20" addons="0"/>
	<parameters>
	<parameter key="message_greet" value="Hello |PLAYERNAME|. Welcome to the Academy of Rookgaard. May I sign you up as a {student}?" />
        <parameter key="message_farewell" value="Good bye, |PLAYERNAME|! And remember: No running up and down in the academy!" />
	<parameter key="message_walkaway" value="Good bye, |PLAYERNAME|! And remember: No running up and down in the academy!" />
	<parameter key="message_idletimeout" value="Good bye, |PLAYERNAME|! And remember: No running up and down in the academy!" />
	</parameters>
</npc>

seymour.lua:
Lua:
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
	
if (msgcontains(msg,'yes') or msgcontains(msg,'student')) and talkState[talkUser] ~= 1 and talkState[talkUser] ~= 4 and talkState[talkUser] ~= 5 and talkState[talkUser] ~= 6 and talkState[talkUser] ~= 8 then
selfSay('Brilliant! We need fine adventurers like you! If you are ready to learn, just ask me for a {lesson}. You can always ask for the differently coloured words - such as {this} one - to continue the lesson.', cid)
talkState[talkUser] = 3

elseif msgcontains(msg,'this') and talkState[talkUser] == 3 then
selfSay('Yes, you got it. Ask me for a {lesson} anytime.', cid)

elseif msgcontains(msg,'lesson') and talkState[talkUser] == 3 then
selfSay('Oh, which lesson did you want to attend again? Was it {Rookgaard}, {fighting}, {equipment}, {citizens}, the {academy} or the {oracle}?', cid)
talkState[talkUser] = 1

elseif msgcontains(msg,'rookgaard') and talkState[talkUser] == 1 then
selfSay('Rookgaard is the name of this {village} as well as of the whole {island}. It belongs to the kingdom of {Thais}, in our world which is called {Tibia}.', cid)

elseif msgcontains(msg,'fighting') and talkState[talkUser] == 1 then
selfSay('You have to fight {monsters} to train your {skills} and {level}. If you lose {health}, eat {food} to regain it or use a {potion}.', cid)

if msgcontains(msg,' billy') then
selfSay('Billy is {Willie}\'s cousin, but he has his farm on the {premium} side of the village.', cid)

elseif msgcontains(msg,'norma') then
selfSay('Norma has recently opened a bar here meaning she sells drinks and snacks. Nothing of importance to you, young student.', cid)

elseif msgcontains(msg,'willie') then
selfSay('Willie is a fine farmer, although he is short-tempered. He sells and buys {food}.', cid)

elseif msgcontains(msg,'food') and talkState[talkUser] == 1 then
selfSay('Many monsters, such as rabbits or deer, are excellent food providers. You can also buy food from {Willie} or {Billy}, the farmers.', cid)

elseif msgcontains(msg,'tibia') and talkState[talkUser] == 1 then
selfSay('The world of Tibia is very large with tons of places to explore. Vast deserts, Caribbean islands, deep jungles, green meadows and jagged mountains await you!', cid)

elseif msgcontains(msg,'thais') and talkState[talkUser] == 1 then
selfSay('The city of Thais is reigned by King Tibianus. Of course, there are many other cities but you will learn about them later.', cid)

elseif msgcontains(msg,'oracle') and talkState[talkUser] == 1 then
selfSay('The oracle is a mysterious being just upstairs. It will bring you to the {Island} {of} {Destiny} to choose your {vocation} once you are level 8.', cid)

elseif msgcontains(msg,'vocation') and talkState[talkUser] == 1 then
selfSay('{knights}, {paladins}, {sorcerers} and {druids}. You can choose your vocation once you are level 8 and have talked to the {oracle}.', cid)

elseif msgcontains(msg,'citizens') and talkState[talkUser] == 1 then
selfSay('Most of the citizens here are {merchants}. You can give me the name of any non-player character and I will tell you something about him or her.', cid)

elseif msgcontains(msg,'merchants') and talkState[talkUser] == 1 then
selfSay('Merchants buy and sell goods. Just ask them for a {trade} to see what they offer or buy from you.', cid)

elseif msgcontains(msg,'trade') and talkState[talkUser] == 1 then
selfSay('I personally don\'t have anything to trade, but you can ask {merchants} for a trade. That will open a window where you can see their offers and the things they buy from you.', cid)

elseif msgcontains(msg,'knights') and talkState[talkUser] == 1 then
selfSay('Knights are strong melee fighters. You will learn all about them once you are level 8 and reached the Island of {Destiny}.', cid)

elseif msgcontains(msg,'destiny') then
if getPlayerStorageValue(cid,48990) < 1 then
selfSay('Shall I try and take a guess at your destiny?', cid)
talkState[talkUser] = 4
elseif getPlayerStorageValue(cid,48990) == 1 then
selfSay('Well, like I told you before, I really think you got that spirit of a druid in you. But of course it\'s completely up to you!', cid)
talkState[talkUser] = 1
elseif getPlayerStorageValue(cid,48990) == 2 then
selfSay('Well, like I told you before, I really think you got that spirit of a sorcerer in you. But of course it\'s completely up to you!', cid)
talkState[talkUser] = 1
elseif getPlayerStorageValue(cid,48990) == 3 then
selfSay('Well, like I told you before, I really think you got that spirit of a knight in you. But of course it\'s completely up to you!', cid)
talkState[talkUser] = 1
elseif getPlayerStorageValue(cid,48990) == 4 then
selfSay('Well, like I told you before, I really think you got that spirit of a paladin in you. But of course it\'s completely up to you!', cid)
talkState[talkUser] = 1
end

elseif msgcontains(msg,'yes') and talkState[talkUser] == 4 then
local voa = math.random(1,4)
if voa == 1 then
selfSay('Hmmm, let me look at you. You have an aura of great wisdom and may have healing hands as well as a sense for the powers of nature - I think you\'re a natural born druid!', cid)
elseif voa == 2 then
selfSay('Hmmm, let me look at you. You got that intelligent sparkle in your eyes and you\'d love to handle great power - that must be a future sorcerer!', cid)
elseif voa == 3 then
selfSay('Hmmm, let me look at you. Strong and sturdy, with a determined look in your eyes - no doubt the knight profession would be suited for you!', cid)
elseif voa == 4 then
selfSay('Hmmm, let me look at you. Such a lean and swift fighter you are - I can imagine you really well with a bow - I think you\'d make a tremendous paladin!', cid)
end
talkState[talkUser] = 1
setPlayerStorageValue(cid, 48990,voa)

elseif msgcontains(msg,'paladins') and talkState[talkUser] == 1 then
selfSay('Paladins are swift distance fighters. You will learn all about them once you are level 8 and reached the Island of {Destiny}.', cid)

elseif msgcontains(msg,'sorcerers') and talkState[talkUser] == 1 then
selfSay('Sorcerers are talented elemental magicians. You will learn all about them once you are level 8 and reached the Island of {Destiny}.', cid)

elseif msgcontains(msg,'druids') and talkState[talkUser] == 1 then
selfSay('Druids are nature magic users and great healers. You will learn all about them once you are level 8 and reached the Island of {Destiny}.', cid)

elseif msgcontains(msg,'monsters') and talkState[talkUser] == 1 then
selfSay('Good monsters to start hunting are {rats}. They live in the {sewers} below the village.', cid)

elseif msgcontains(msg,'rats') and talkState[talkUser] == 1 then
selfSay('To attack a rat, simply click on it in your battle list. Make sure that you have proper {equipment}, though! Also, I give you 2 gold coins for each {dead} {rat}.', cid)

elseif msgcontains(msg,'sewers') and talkState[talkUser] == 1 then
selfSay('One entrance to the sewers is south of this {academy}. Look for a sewer grate, then use it to climb down.', cid)

elseif msgcontains(msg,'academy') and talkState[talkUser] == 1 then
selfSay('The academy is the building you are standing in. We have a {library}, a {training} centre, a {bank} and the room of the {oracle}.', cid)

elseif msgcontains(msg,'library') and talkState[talkUser] == 1 then
selfSay('There are many books in the bookcases around you, unless some naughty kids stole them again. Read them for more and detailed information.', cid)

elseif msgcontains(msg,'training') and talkState[talkUser] == 1 then
selfSay('When you have the time, please visit our training centre downstairs. \'Look\' at the blackboards to read some important advice. Oh, you need a {key} for that!', cid)

elseif msgcontains(msg,'bank') and talkState[talkUser] == 1 then
selfSay('In a bank you can deposit your earned gold coins safely. Just go downstairs to {Paulie} and ask him to {deposit} your money.', cid)

elseif msgcontains(msg,'paulie') and talkState[talkUser] == 1 then
selfSay('Yes, Paulie is very important. He is the local {bank} clerk.', cid)

elseif msgcontains(msg,'deposit') and talkState[talkUser] == 1 then
selfSay('Yes, depositing your money will keep it safe, so it is a good idea to store it in the bank. Of course, you can always withdraw it again.', cid)

elseif msgcontains(msg,'equipment') and talkState[talkUser] == 1 then
selfSay('Don\'t go hunting without proper equipment. You need at least a suitable {weapon}, {armor}, {shield}, {rope} and {shovel}. A {torch} is also good as well as {legs}, a {helmet} and {shoes}.', cid)

elseif msgcontains(msg,'weapon') and talkState[talkUser] == 1 then
selfSay('The starter weapon, a club, won\'t get you far. You should earn some {money} and buy a better weapon such as a sabre from {Obi}\'s or {Lee\'Delle}\'s shop. Simply ask for a {trade}.', cid)

elseif msgcontains(msg,'money') and talkState[talkUser] == 1 then
selfSay('Make money by killing {monsters} and picking up their {loot}. You can sell many of the things they carry.', cid)

elseif msgcontains(msg,'loot') and talkState[talkUser] == 1 then
selfSay('Once a monster is dead, you can select \'Open\' on the {corpse} to check what\'s inside. Sometimes they carry {money} or other items which you can sell to {merchants}.', cid)

elseif msgcontains(msg,'corpse') and talkState[talkUser] == 1 then
selfSay('You can even sell some corpses! For example, you can sell fresh dead rats to {Tom} the tanner or me. He also buys other dead creatures, just ask him for a {trade}.', cid)

elseif msgcontains(msg,'tom') and talkState[talkUser] == 1 then
selfSay('Tom the tanner buys fresh {corpses}, minotaur leather and paws. Always good to make some {money} if you can carry the corpses there fast enough.', cid)

elseif msgcontains(msg,'obi') and talkState[talkUser] == 1 then
selfSay('Obi sells and buys {weapons}. You can find his shop south of the academy.', cid)

elseif msgcontains(msg,'lee\'delle') and talkState[talkUser] == 1 then
selfSay('Lee\'Delle\'s shop is in the western part of town, on the {premium} side. She sells everything cheaper.', cid)

elseif msgcontains(msg,'premium') and talkState[talkUser] == 1 then
selfSay('Paying for your Tibia account will turn it into a premium account. This means access to more areas and functions of the game as well as other neat features.', cid)

elseif msgcontains(msg,'dead rat') then
selfSay('Have you brought at least a one dead rat to me to pick up your reward?', cid)
talkState[talkUser] = 6

elseif msgcontains(msg,'no') and talkState[talkUser] == 6 then
selfSay('Go and find some rats to kill!', cid)
talkState[talkUser] = 0

elseif msgcontains(msg,'yes') and talkState[talkUser] == 6 then
if getPlayerItemCount(cid, 2813) >= 1 then
local coin = getPlayerItemCount(cid, 2813) * 2
selfSay('Thank you! Here is your reward.', cid)
doPlayerRemoveItem(cid, 2813, getPlayerItemCount(cid, 2813))
doPlayerAddItem(cid,2148,coin)
talkState[talkUser] = 0
else
selfSay('HEY! You don\'t have one! Stop playing tricks on me or I\'ll give you some extra work!', cid)
talkState[talkUser] = 0
end

elseif msgcontains(msg,'armor') and talkState[talkUser] == 1 then
selfSay('The starter armor, a coat, does not protect you well. First of all, earn some money and try to get a sturdy leather armor from {Dixi}\'s or {Lee\'Delle}\'s shop. Simply ask for a {trade}.', cid)

elseif msgcontains(msg,'dixi') and talkState[talkUser] == 1 then
selfSay('Dixi sells and buys {armors}, {shields}, {helmets} and {legs}. You can find her shop south of the academy, just go up the stairs in {Obi}\'s shop.', cid)

elseif msgcontains(msg,'shield') and talkState[talkUser] == 1 then
selfSay('I fear you have to buy your first shield by yourself. A wooden shield from {Dixi} or {Lee\'Delle} is a good choice.', cid)

elseif msgcontains(msg,'shields') and talkState[talkUser] == 1 then
selfSay('I fear you have to buy your first shield by yourself. A wooden shield from {Dixi} or {Lee\'Delle} is a good choice.', cid)

elseif msgcontains(msg,'weapons') and talkState[talkUser] == 1 then
selfSay('The starter weapon, a club, won\'t get you far. You should earn some {money} and buy a better weapon such as a sabre from {Obi}\'s or {Lee\'Delle}\'s shop. Simply ask for a {trade}.', cid)

elseif msgcontains(msg,'armors') and talkState[talkUser] == 1 then
selfSay('The starter armor, a coat, does not protect you well. First of all, earn some money and try to get a sturdy leather armor from {Dixi}\'s or {Lee\'Delle}\'s shop. Simply ask for a {trade}.', cid)

elseif msgcontains(msg,'helmet') and talkState[talkUser] == 1 then
selfSay('A sturdy leather helmet is a good choice for a beginner. You can either buy it from {Dixi} and {Lee\'Delle}, or, once you are strong enough, {loot} them from {trolls}.', cid)

elseif msgcontains(msg,'helmets') and talkState[talkUser] == 1 then
selfSay('A sturdy leather helmet is a good choice for a beginner. You can either buy it from {Dixi} and {Lee\'Delle}, or, once you are strong enough, {loot} them from {trolls}.', cid)

elseif msgcontains(msg,'legs') and talkState[talkUser] == 1 then
selfSay('Leather legs might be a good basic protection. You can buy them from {Dixi} or {Lee\'Delle}. Or, once you are strong enough, hunt {trolls}. They sometimes carry them in their {loot}.', cid)

elseif msgcontains(msg,'shoes') and talkState[talkUser] == 1 then
selfSay('Leather boots are basic shoes which will protect you well. You can either buy them from {Dixi} and {Lee\'Delle}, or, once you are strong enough, {loot} them from {trolls}.', cid)

elseif msgcontains(msg,'torch') and talkState[talkUser] == 1 then
selfSay('A torch will provide you with light in dark {dungeons}. \'Use\' it to light it. You can buy them from {Al} {Dee} or {Lee\'Delle}.', cid)

elseif msgcontains(msg,'rope') and talkState[talkUser] == 1 then
selfSay('You definitely need a rope to progress in dungeons, else you might end up stuck. Buy one from {Al} {Dee} or {Lee\'Delle}.', cid)

elseif msgcontains(msg,'shovel') and talkState[talkUser] == 1 then
selfSay('A shovel is needed to dig some {dungeon} entrances open. \'Use\' it on a loose stone pile to make a hole large enough to enter.', cid)

elseif msgcontains(msg,'dungeon') and talkState[talkUser] == 1 then
selfSay('You should not descend into dungeons without proper {equipment}. Once you are all prepared, ask the bridge {guards} for suitable {monsters}.', cid)

elseif msgcontains(msg,'guards') and talkState[talkUser] == 1 then
selfSay('The guards {Dallheim} and {Zerbrus} protect our village from {monsters} trying to enter. They also mark useful {dungeon} locations on your map.', cid)

elseif msgcontains(msg,'dallheim') then
talkState[talkUser] = 1
selfSay('He\'s the guard on the north {bridge} and a great fighter. He can show you {monster} locations. Just ask him about monsters!', cid)

elseif msgcontains(msg,'bridge') and talkState[talkUser] == 1 then
selfSay('There is a bridge to the north and one to the west which lead outside the village. You should only leave once you are well {equipped} and at least level 2.', cid)

elseif msgcontains(msg,'equipped') and talkState[talkUser] == 1 then
selfSay('Don\'t go hunting without proper equipment. You need at least a suitable {weapon}, {armor}, {shield}, {rope} and {shovel}. A {torch} is also good as well as {legs}, a {helmet} and {shoes}.', cid)

elseif msgcontains(msg,'zerbrus') and talkState[talkUser] == 1 then
selfSay('He\'s the guard on the west {bridge} and a great fighter. He can show you {monster} locations. Just ask him about monsters!', cid)

elseif msgcontains(msg,'trolls') and talkState[talkUser] == 1 then
selfSay('Trolls are quite nasty monsters which you shouldn\'t face before level 3 or 4 depending on your {equipment}. Ask the bridge {guards} for their locations!', cid)

elseif msgcontains(msg,'corpses') and talkState[talkUser] == 1 then
selfSay('You can even sell some corpses! For example, you can sell fresh dead rats to {Tom} the tanner or me. He also buys other dead creatures, just ask him for a {trade}.', cid)

elseif msgcontains(msg,'skills') and talkState[talkUser] == 1 then
selfSay('The more you fight with a weapon, the better will be your skill handling this weapon. Don\'t worry about that right now though, this will become important once you have a {vocation}.', cid)

elseif msgcontains(msg,'level') and talkState[talkUser] == 1 then
selfSay('Once you gained enough experience for a level, you will advance. This means - among other things - more {health} points, a faster walking speed and more strength to carry things.', cid)

elseif msgcontains(msg,'health') and talkState[talkUser] == 1 then
selfSay('Your current health is shown by the red bar on the right side. {Death} awaits you if it goes down to zero.', cid)

elseif msgcontains(msg,'death') and talkState[talkUser] == 1 then
selfSay('Dying in Tibia is painful, so try to avoid it. You will lose part of your {experience} points and also equipment. Make sure your {health} always stays up!', cid)

elseif msgcontains(msg,'experience') and talkState[talkUser] == 1 then
selfSay('You gain experience when fighting {monsters}. You can take a look at your skill window to check your progress.', cid)

elseif msgcontains(msg,'academy') then
talkState[talkUser] = 1
selfSay('The academy is the building you are standing in. We have a {library}, a {training} centre, a {bank} and the room of the {oracle}.', cid)

elseif msgcontains(msg,'fuck') then
if getPlayerSex(cid)== 0 then
selfSay('For this remark I will wash your mouth with soap, young lady!', cid)
doSendMagicEffect(getCreaturePosition(cid),7)
else
doSendMagicEffect(getCreaturePosition(cid),7)
selfSay('For this remark I will wash your mouth with soap, young man!', cid)
end

elseif msgcontains(msg,'student') and talkState[talkUser] == 1 then
selfSay('Well, I could give you valuable {lessons} or some general {hints} about the game, or a small {quest} if you\'re interested.', cid)

elseif msgcontains(msg,'island of destiny') then
selfSay('This is an island with vocation teachers. You can learn all about the different {vocations} there once you are level 8.', cid)

elseif msgcontains(msg,'quest') or msgcontains(msg,'mission') then
if getPlayerLevel(cid) > 3 then
selfSay('Well, I would like to send our king a little present but I do not have a suitable {box}. If you find a nice box, please bring it to me.', cid)
elseif getPlayerLevel(cid) < 4 then
selfSay('You are pretty inexperienced. I think killing rats is a suitable challenge for you. For each fresh {dead rat} I will give you two shiny coins of gold.', cid)
end

elseif msgcontains(msg,'job') and talkState[talkUser] == 1 then
selfSay('I\'m the master of this fine {academy}, giving {lessons} to my students.', cid)

elseif msgcontains(msg,'hints') and talkState[talkUser] == 1 then
selfSay('If you don\'t know the meaning of an icon on the right side, move the mouse cursor on it and wait a moment.', cid)

elseif msgcontains(msg,'amber') then
talkState[talkUser] = 1
selfSay('A traveller from the {main} continent. I wonder what brought her here. No one comes here of his own free will.', cid)

elseif msgcontains(msg,'main') and talkState[talkUser] == 1 then
selfSay('You can leave for mainland once you are level 8. To do so talk to the {oracle}.', cid)

elseif msgcontains(msg,'al dee') then
talkState[talkUser] = 1
selfSay('Al Dee has a general {equipment} store in the north-western part of the village. He sells useful stuff such as {ropes}.', cid)

elseif msgcontains(msg,'ropes') and talkState[talkUser] == 1 then
selfSay('You definitely need a rope to progress in dungeons, else you might end up stuck. Buy one from {Al} {Dee} or {Lee\'Delle}.', cid)

elseif msgcontains(msg,'box') and talkState[talkUser] == 1 then
selfSay('Do you have a suitable present box for me?', cid)
talkState[talkUser] = 8

elseif msgcontains(msg,'no') and talkState[talkUser] == 8 then
selfSay('HEY! You don\'t have one! Stop playing tricks on me or I\'ll give you some extra work!', cid)
talkState[talkUser] = 0

elseif msgcontains(msg,'yes') and talkState[talkUser] == 8 then
if getPlayerItemCount(cid, 1990) >= 1 then
selfSay('THANK YOU! Here is a helmet that will serve you well.', cid)
doPlayerAddItem(cid,2480,1)
doPlayerRemoveItem(cid, 1990, 1)
else
selfSay('HEY! You don\'t have one! Stop playing tricks on me or I\'ll give you some extra work!', cid)
end


elseif msgcontains(msg,'key') then
selfSay('Do you want to buy the Key to Adventure for 5 gold coins?', cid)
talkState[talkUser] = 5

elseif msgcontains(msg,'no') and talkState[talkUser] == 5 then
selfSay('As you wish.', cid)
talkState[talkUser] = 0

elseif msgcontains(msg,'yes') and talkState[talkUser] == 5 then
if getPlayerMoney(cid) >= 5 then
doPlayerRemoveMoney(cid, 5)
local key = doCreateItemEx(2088)
doSetItemActionId(key, 4601)
doPlayerAddItemEx(cid,key)
selfSay('Here you are.', cid)
talkState[talkUser] = 0
else
selfSay('You don\'t have enough money.', cid)
talkState[talkUser] = 0
end
else
selfSay('Only nonsense on your mind, eh?', cid)
talkState[talkUser] = 1
end

return TRUE
end

function thinkCallback()
talk = math.random(1,200)
	if talk == 1 then
		doCreatureSay(getNpcCid(), "Feeling lost? Ask me for help!", TALKTYPE_YELL)
	elseif talk == 2 then
		doCreatureSay(getNpcCid(), "Newcomers - visit me! I'll answer your questions!", TALKTYPE_YELL)
	elseif talk == 3 then
		doCreatureSay(getNpcCid(), "Get some training in the academy!", TALKTYPE_YELL)
	end
return TRUE
end

npcHandler:setCallback(CALLBACK_ONTHINK, thinkCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

so now Tom
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Tom" script="tom.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="144" head="113" body="115" legs="58" feet="115" addons="1"/>
    <parameters>
        <parameter key="message_greet" value="Hey there, |PLAYERNAME|. I'm Tom the tanner. If you have fresh corpses, leather or paws, trade with me."/>
        <parameter key="message_farewell" value="Good bye."/>
		<parameter key="message_walkaway" value="D'oh?"/>
		<parameter key="message_idletimeout" value="D'oh?"/>
		<parameter key="message_sendtrade" value="Sure, check what I buy."/>
        <parameter key="module_shop" value="1"/>
        <parameter key="shop_sellable" value="bear paw,5896,10;dead rabbit,2992,2;dead rat,2813,2;dead wolf,2826,5;minotaur leather,5878,12;wolf paw,5897,7" />
    </parameters>
</npc>

and tom.lua
Lua:
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

if msgcontains(msg,'oracle') then
selfSay('It\'s in the academy, just above {Seymour}. Go there once you are level 8 to leave this place.', cid)

elseif msgcontains(msg,'seymour') then
selfSay('He sticks his nose too much in books.', cid)

elseif msgcontains(msg,'cipfried') then
selfSay('I\'m not what you\'d call a \'believer\'.', cid)

elseif msgcontains(msg,'tom') then
selfSay('Yep.', cid)

elseif msgcontains(msg,'tanner') then
selfSay('That\'s my job. It can be dirty at times but it provides enough income for my living.', cid)

elseif msgcontains(msg,'corpses') then
selfSay('I\'m buying fresh {corpses} of rats, rabbits and wolves. I don\'t buy half-decayed ones. If you have any for sale, {trade} with me.', cid)

elseif msgcontains(msg,'monster') then
selfSay('Good monsters to start with are rats. They live in the {sewers} under the village of {Rookgaard}.', cid)

elseif msgcontains(msg,'sewers') then
selfSay('The nearest sewer entrance is just to the right of this building.', cid)

elseif msgcontains(msg,'corpse') then
selfSay('I\'m buying fresh {corpses} of rats, rabbits and wolves. I don\'t buy half-decayed ones. If you have any for sale, {trade} with me.', cid)

elseif msgcontains(msg,'sewer') then
selfSay('The nearest sewer entrance is just to the right of this building.', cid)

elseif msgcontains(msg,'troll') then
selfSay('Troll leather stinks. Can\'t use it.', cid)

elseif msgcontains(msg,'orc') then
selfSay('I don\'t buy orcs. Their skin is too scratchy.', cid)

elseif msgcontains(msg,'dallheim') then
selfSay('He\'s okay.', cid)

elseif msgcontains(msg,'Amber') then
selfSay('Now that\'s an interesting woman.', cid)

elseif msgcontains(msg,'rookgaard') then
selfSay('This island has its own problems, but all in all it\'s a decent place to live.', cid)

elseif msgcontains(msg,'main') then
selfSay('You can go there once you are level 8 and have talked to the {oracle}.', cid)

elseif msgcontains(msg,'mainland') then
selfSay('You can go there once you are level 8 and have talked to the {oracle}.', cid)

elseif msgcontains(msg,'obi') then
selfSay('He is such a hypocrite.', cid)

elseif msgcontains(msg,'dixi') then
selfSay('She buys my fine leather clothes.', cid)

elseif msgcontains(msg,'lily') then
selfSay('She always comes and preaches about how one should not wear animal skin.', cid)

elseif msgcontains(msg,'al dee') then
selfSay('He\'s an apple polisher.', cid)

elseif msgcontains(msg,'wares') then
selfSay('I\'m buying fresh {corpses} of rats, rabbits and wolves. I don\'t buy half-decayed ones. If you have any for sale, {trade} with me.', cid)

elseif msgcontains(msg,'job') then
selfSay('I\'m the local {tanner}. I buy fresh animal {corpses}, tan them, and convert them into fine leather clothes which I then sell to {merchants}.', cid)

elseif msgcontains(msg,'merchant') then
selfSay('{Dixi} and {Lee\'Delle} sell my leather clothes in their shops.', cid)

elseif msgcontains(msg,'merchants') then
selfSay('{Dixi} and {Lee\'Delle} sell my leather clothes in their shops.', cid)

elseif msgcontains(msg,'lee\'delle') then
selfSay('Her nose is a little high in the air, I think. She never shakes my hand.', cid)

elseif msgcontains(msg,'weapon') then
selfSay('Nope, sorry, don\'t sell that. Ask {Obi} or {Lee\'Delle}.', cid)

elseif msgcontains(msg,'shields') then
selfSay('Nope, sorry, don\'t sell that. Ask {Dixi} or {Lee\'Delle}.', cid)

elseif msgcontains(msg,'willie') then
selfSay('I kinda like him. At least he says what he thinks.', cid)

elseif msgcontains(msg,'billy') then
selfSay('He\'s a better cook than his cousin {Willie}, actually.', cid)

elseif msgcontains(msg,'trade') then
selfSay('Sure, check what I buy.', cid)

elseif msgcontains(msg,'norma') then
selfSay('I like her beer.', cid)

elseif msgcontains(msg,'human') then
selfSay('Are you crazy?!', cid)
npcHandler:releaseFocus(cid)

end
return TRUE
end

function thinkCallback()
talk = math.random(1,200)
	if talk == 1 then
		doCreatureSay(getNpcCid(), "Oh yeah, I'm also interested in wolf paws and bear paws.", TALKTYPE_YELL)
	elseif talk == 2 then
		doCreatureSay(getNpcCid(), "Also buying minotaur leather.", TALKTYPE_YELL)
	elseif talk == 3 then
		doCreatureSay(getNpcCid(), "Buying fresh corpses of rats, rabbits and wolves.", TALKTYPE_YELL)
	end
return TRUE
end

npcHandler:setCallback(CALLBACK_ONTHINK, thinkCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Atm. it is all but will be updated :) Keep Looking!

//QuaS~
 
Last edited:
Thanks for these Quas, btw sorry for all the hard times a while ago.
I hope we can put all of that behind us.

Good release, rep++ :thumbup:
(You have new Bar woot)
 
So:

Code:
[24/10/2009 14:42:41] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/seymour.lua
[24/10/2009 14:42:41] data/npc/scripts/seymour.lua:371: 'end' expected (to close 'function' at line 12) near '<eof>'


Look over the script!

Im Damson 0.3.5 pl1
For your information: TOM script works perfect! Thanks for the release
 
You've gotta change line 35:
if msgcontains(msg,' billy') then
selfSay('Billy is {Willie}\'s cousin, but he has his farm on the {premium} side of the village.', cid)

to

elseif msgcontains(msg,' billy') then
selfSay('Billy is {Willie}\'s cousin, but he has his farm on the {premium} side of the village.', cid)

and change line 341:
doSetItemActionId(key, 4601)

to

doSetItemActionId(key, 4600)
'couse Key 4601 is cooper key, bear room

I'm searching for Amber script with Addon ability (Citizen) and Blind Orc script.
 
Last edited:
Hahah, nice but check out my Seymour.lua:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local Topic = {}
local count = {}
local destiny = {"Hmmm, let me look at you. You got that intelligent sparkle in your eyes and you'd love to handle great power - that must be a future sorcerer!","Hmmm, let me look at you. You have an aura of great wisdom and may have healing hands as well as a sense for the powers of nature - I think you're a natural born druid!","Hmmm, let me look at you. Such a lean and swift fighter you are - I can imagine you really well with a bow - I think you'd make a tremendous paladin!","Hmmm, let me look at you. Strong and sturdy, with a determined look in your eyes - no doubt the knight profession would be suited for you!"}

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 greetCallback(cid)
	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	Topic[talkUser] = 1
	count[talkUser] = 0
	return true
end

function thinkCallback(cid)
	local rand = math.random(250)
	if rand == 1 then
		selfSay("Get some training in the academy!")
	elseif rand == 2 then
		selfSay("Feeling lost? Ask me for help!")
	elseif rand == 3 then
		selfSay("Newcomers - visit me! I'll answer your questions!")
	end
	return true
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
	if msgcontains(msg, "how") and msgcontains(msg, "are") and msgcontains(msg, "you") then
		npcHandler:say("Well, the {king} doesn't send troops anymore, the {academy} is dreadfully low on money, and the end of the world is pretty nigh. Apart from that I'm reasonably fine, I suppose.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "fuck") then
		npcHandler:say("For this remark I will wash your mouth with soap, young " .. (getPlayerSex(cid) == 0 and "lady!" or "man!"), cid)
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_YELLOW_RINGS)
		Topic[talkUser] = 0
	elseif (msgcontains(msg, "yes") or msgcontains(msg, "student")) and Topic[talkUser] == 1 then
		npcHandler:say("Brilliant! We need fine adventurers like you! If you are ready to learn, just ask me for a {lesson}. You can always ask for the differently coloured words - such as {this} one - to continue the lesson.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "al") and msgcontains(msg, "dee") then
		npcHandler:say("Al Dee has a general {equipment} store in the north-western part of the village. He sells useful stuff such as {ropes}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "island") and msgcontains(msg, "destiny") then
		npcHandler:say("This is an island with {vocation} teachers. You can learn all about the different vocations there once you are level 8.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "hint") then
		if getPlayerStorageValue(cid, 6079) == -1 then
			setPlayerStorageValue(cid, 6079, 1)
		end
		local str = getPlayerStorageValue(cid, 6079)
		npcHandler:say(hints[str], cid)
		setPlayerStorageValue(cid, 6079, str == 28 and 0 or str + 1)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "mission") or msgcontains(msg, "quest") then
		npcHandler:say(getPlayerLevel(cid) < 4 and "You are pretty inexperienced. I think killing rats is a suitable challenge for you. For each fresh {dead rat} I will give you two shiny coins of gold." or "Well I would like to send our king a little present, but I do not have a suitable box. If you find a nice box, please bring it to me.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "destiny") then
		if getPlayerStorageValue(cid, 6080) <= 0 then
			npcHandler:say("Shall I try and take a guess at your destiny?", cid)
			Topic[talkUser] = 5
		else
			local destiny = {[1] = "Well, like I told you before, I really think you got that spirit of a sorcerer in you. But of course it's completely up to you!", [2] = "Well, like I told you before, I really think you got that spirit of a druid in you. But of course it's completely up to you!", [3] = "Well, like I told you before, I really think you got that spirit of a paladin in you. But of course it's completely up to you!", [4] = "Well, like I told you before, I really think you got that spirit of a knight in you. But of course it's completely up to you!"}
			npcHandler:say("" .. destiny[getPlayerStorageValue(cid,6080)] .. "", cid)
		end
	elseif msgcontains(msg, "dead") and msgcontains(msg, "rat") then
		if getCount(msg) ~= -1 and 1 < getCount(msg) then
			count[cid] = getCount(msg)
			npcHandler:say("Have you brought " .. count[cid] .. " dead rats to me to pick up your reward?", cid)
		else
			count[cid] = 1
			npcHandler:say("Have you brought a dead rat to me to pick up your reward?", cid)
		end
		Topic[talkUser] = 2
	elseif msgcontains(msg, "yes") and Topic[talkUser] == 5 then
		local rand = math.random(4)
		npcHandler:say(destiny[rand], cid)
		setPlayerStorageValue(cid, 6080, rand)
		Topic[talkUser] = 0
	elseif Topic[talkUser] == 2 and msgcontains(msg, "yes") then
		if getPlayerItemCount(cid, 2813) >= count[cid] then
			npcHandler:say("Thank you! Here is your reward.", cid)
			doPlayerRemoveItem(cid, 2813, count[cid])
			doPlayerAddMoney(cid, count[cid] * 2)
		else
			npcHandler:say(count[cid] > 1 and "HEY! You do not have so many!" or "HEY! You don't have one! Stop playing tricks on fooling me or I will give you some extra work!", cid)
		end
		Topic[talkUser] = 0
	elseif Topic[talkUser] == 2 then
		npcHandler:say("Go and find some rats to kill!", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "job") then
		npcHandler:say("I'm the master of this fine {academy}, giving {lessons} to my students.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "time") then
		npcHandler:say("It's "..getTibianTime()..", so you are late. Hurry!", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "name") then
		npcHandler:say("My name is Seymour, but for you I am 'Sir' Seymour.", cid)
	elseif msgcontains(msg, "sir") then
		npcHandler:say("At least you know how to address a man of my importance.", cid)
		Topic[talkUser] = 0
	elseif Topic[talkUser] == 1 then
		npcHandler:say("Only nonsense on your mind, eh?", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "information") then
		npcHandler:say("Well, I could give you valuable {lessons} or some general {hints} about the game, or a small {quest} if you're interested.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "lesson") then
		npcHandler:say("Oh, which lesson did you want to attend again? Was it {Rookgaard}, {fighting}, {equipment}, {citizens}, the {academy} or the {oracle}?", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "this") then
		npcHandler:say("Yes, you got it. Ask me for a {lesson} anytime.?", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "rookgaard") then
		npcHandler:say("Rookgaard is the name of this {village} as well as of the whole {island}. It belongs to the kingdom of {Thais}, in our world which is called {Tibia}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "village") then
		npcHandler:say("The most important places in this village are the {temple}, the different {shops}, the {academy} and the {bridges}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "island") then
		npcHandler:say("The island is separated into a {premium} side and a non-premium side. On both sides you will find {dungeons}, but the premium side tends to be a little less crowded with other players.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "thais") then
		npcHandler:say("The city of Thais is reigned by King Tibianus. Of course, there are many other cities but you will learn about them later.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "tibia") then
		npcHandler:say("The world of Tibia is very large with tons of places to explore. Vast deserts, Caribbean islands, deep jungles, green meadows and jagged mountains await you!", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "temple") then
		npcHandler:say("The temple is the place to go when you are very low on {health} or poisoned. Ask {Cipfried} for a heal - he usually notices emergencies by himself.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "shop") then
		npcHandler:say("We have a {weapon} and an {armor} shop south of the academy. {Equipment} such as {ropes} are sold to the north-west. {Potions} can be bought to the south. And then there are the {farms}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "bridge") then
		npcHandler:say("There is a bridge to the north and one to the west which lead outside the village. You should only leave once you are well {equipped} and at least level 2.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "farm") then
		npcHandler:say("The farms are west of here. You can buy and sell {food} there which you need to regain {health}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "dungeon") then
		npcHandler:say("You should not descend into dungeons without proper {equipment}. Once you are all prepared, ask the bridge {guards} for suitable {monsters}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "main") then
		npcHandler:say("You can leave for mainland once you are level 8. To do so talk to the {oracle}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "fight") then
		npcHandler:say("You have to fight {monsters} to train your {skills} and {level}. If you lose {health}, eat {food} to regain it or use a {potion}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "skill") then
		npcHandler:say("The more you fight with a weapon, the better will be your skill handling this weapon. Don't worry about that right now though, this will become important once you have a {vocation}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "level") then
		npcHandler:say("Once you gained enough experience for a level, you will advance. This means - among other things - more {health} points, a faster walking speed and more strength to carry things.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "equip") then
		npcHandler:say("Don't go hunting without proper equipment. You need at least a suitable {weapon}, {armor}, {shield}, {rope} and {shovel}. A {torch} is also good as well as {legs}, a {helmet} and {shoes}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "premium") then
		npcHandler:say("Paying for your Tibia account will turn it into a premium account. This means access to more areas and functions of the game as well as other neat features.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "potion") then
		npcHandler:say("Use a small health potion in case of emergencies to fill up around 75 health points. You can buy them at {Lily}'s shop. She also has {antidote} potions.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "antidote") then
		npcHandler:say("Some monsters poison you. To heal poison, use an antidote potion on yourself. Buy them at {Lily}'s store.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "food") then
		npcHandler:say("Many monsters, such as rabbits or deer, are excellent food providers. You can also buy food from {Willie} or {Billy}, the farmers.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "weapon") then
		npcHandler:say("The starter weapon, a club, won't get you far. You should earn some {money} and buy a better weapon such as a sabre from {Obi}'s or {Lee'Delle}'s shop. Simply ask for a {trade}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "armor") then
		npcHandler:say("The starter armor, a coat, does not protect you well. First of all, earn some money and try to get a sturdy leather armor from {Dixi}'s  or {Lee'Delle}'s shop. Simply ask for a {trade}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "shield") then
		npcHandler:say("I fear you have to buy your first shield by yourself. A wooden shield from {Dixi} or {Lee'Delle} is a good choice.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "rope") then
		npcHandler:say("You definitely need a rope to progress in dungeons, else you might end up stuck. Buy one from {Al Dee} or {Lee'Delle}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "shovel") then
		npcHandler:say("A shovel is needed to dig some {dungeon} entrances open. 'Use' it on a loose stone pile to make a hole large enough to enter.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "torch") then
		npcHandler:say("A torch will provide you with light in dark {dungeons}. 'Use' it to light it. You can buy them from {Al Dee} or {Lee'Delle}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "legs") then
		npcHandler:say("Leather legs might be a good basic protection. You can buy them from {Dixi} or {Lee'Delle}. Or, once you are strong enough, hunt {trolls}. They sometimes carry them in their {loot}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "helmet") then
		npcHandler:say("A sturdy leather helmet is a good choice for a beginner. You can either buy it from {Dixi} and {Lee'Delle}, or, once you are strong enough, {loot} them from {trolls}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "shoe") then
		npcHandler:say("Leather boots are basic shoes which will protect you well. You can either buy them from {Dixi} and {Lee'Delle}, or, once you are strong enough, {loot} them from {trolls}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "trade") then
		npcHandler:say("I personally don't have anything to trade, but you can ask {merchants} for a trade. That will open a window where you can see their offers and the things they buy from you.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "citizen") then
		npcHandler:say("Most of the citizens here are {merchants}. You can give me the name of any non-player character and I will tell you something about him or her.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "merchant") then
		npcHandler:say("Merchants buy and sell goods. Just ask them for a {trade} to see what they offer or buy from you.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "king") then
		npcHandler:say("Hail to King Tibianus! Long live our king! Not that he cares for an old veteran who is stuck on this godforsaken island...", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "guard") then
		npcHandler:say("The guards {Dallheim} and {Zerbrus} protect our village from {monsters} trying to enter. They also mark useful {dungeon} locations on your map.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "monster") then
		npcHandler:say("Good monsters to start hunting are {rats}. They live in the {sewers} below the village.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "rat") then
		npcHandler:say("To attack a rat, simply click on it in your battle list. Make sure that you have proper {equipment}, though! Also, I give you 2 gold coins for each {dead rat}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "sewer") then
		npcHandler:say("One entrance to the sewers is south of this {academy}. Look for a sewer grate, then use it to climb down.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "troll") then
		npcHandler:say("Trolls are quite nasty monsters which you shouldn't face before level 3 or 4 depending on your {equipment}. Ask the bridge {guards} for their locations!", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "money") then
		npcHandler:say("Make money by killing {monsters} and picking up their {loot}. You can sell many of the things they carry.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "loot") then
		npcHandler:say("Once a monster is dead, you can select 'Open' on the {corpse} to check what's inside. Sometimes they carry {money} or other items which you can sell to {merchants}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "corpse") then
		npcHandler:say("You can even sell some corpses! For example, you can sell fresh dead rats to {Tom} the tanner or me. He also buys other dead creatures, just ask him for a {trade}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "obi") then
		npcHandler:say("Obi sells and buys {weapons}. You can find his shop south of the academy.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "dixi") then
		npcHandler:say("Dixi sells and buys {armors}, {shields}, {helmets} and {legs}. You can find her shop south of the academy, just go up the stairs in {Obi}'s shop.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "dallheim") then
		npcHandler:say("He's the guard on the north {bridge} and a great fighter. He can show you {monster} locations. Just ask him about monsters!", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "zerbrus") then
		npcHandler:say("He's the guard on the west {bridge} and a great fighter. He can show you {monster} locations. Just ask him about monsters!!", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "amber") then
		npcHandler:say("A traveller from the {main} continent. I wonder what brought her here. No one comes here of his own free will.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "norma") then
		npcHandler:say("Norma has recently opened a bar here meaning she sells drinks and snacks. Nothing of importance to you, young student.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "willie") then
		npcHandler:say("Willie is a fine farmer, although he is short-tempered. He sells and buys {food}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "billy") then
		npcHandler:say("Billy is {Willie}'s cousin, but he has his farm on the {premium} side of the village.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "lily") then
		npcHandler:say("In the southern part of town, Lily sells {potions} which might come in handy once you are deep in a dungeon and need {health}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "lee'delle") then
		npcHandler:say("Lee'Delle's shop is in the western part of town, on the {premium} side. She sells everything cheaper.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "hyacinth") then
		npcHandler:say("A mysterious druid who lives somewhere in the wilderness. He sells small health {potions} just like {Lily}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "tom") then
		npcHandler:say("Tom the tanner buys fresh {corpses}, minotaur leather and paws. Always good to make some {money} if you can carry the corpses there fast enough.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "loui") then
		npcHandler:say("Oh, let's not talk about Loui.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "santiago") then
		npcHandler:say("A fine and helpful man. Without him, many new adventurers would be quite clueless.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "zirella") then
		npcHandler:say("This is Tom the tanner's mother. Other than that, I don't think she is of importance.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "paulie") then
		npcHandler:say("Yes, Paulie is very important. He is the local {bank} clerk.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "academy") then
		npcHandler:say("The academy is the building you are standing in. We have a {library}, a {training} centre, a {bank} and the room of the {oracle}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "train") then
		npcHandler:say("When you have the time, please visit our training centre downstairs. 'Look' at the blackboards to read some important advice. Oh, you need a {key} for that!", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "library") then
		npcHandler:say("There are many books in the bookcases around you, unless some naughty kids stole them again. Read them for more and detailed information.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "bank") then
		npcHandler:say("In a bank you can deposit your earned gold coins safely. Just go downstairs to {Paulie} and ask him to {deposit} your money.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "deposit") then
		npcHandler:say("Yes, depositing your money will keep it safe, so it is a good idea to store it in the bank. Of course, you can always withdraw it again.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "key") then
		npcHandler:say("Do you want to buy the Key to Adventure for 5 gold coins?", cid)
		Topic[talkUser] = 4
	elseif Topic[talkUser] == 4 then
		if msgcontains(msg, "yes") then
			if getPlayerMoney(cid) >= 5 then
				npcHandler:say("Here you are.", cid)
				doPlayerRemoveMoney(cid, 5)
				local key = doCreateItemEx(2088, 1)
				doSetItemActionId(key, 4600)
				doPlayerAddItemEx(cid, key, 1)
			else
				npcHandler:say("You don't have enough money.", cid)
			end
		elseif msgcontains(msg, "no") then
			npcHandler:say("As you wish.", cid)
		else
			npcHandler:say("Only nonsense on your mind, eh?", cid)
		end
		Topic[talkUser] = 0
	elseif msgcontains(msg, "oracle") then
		npcHandler:say("The oracle is a mysterious being just upstairs. It will bring you to the {Island of Destiny} to choose your {vocation} once you are level 8.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "vocation") then
		npcHandler:say("There are four vocations: {knights}, {paladins}, {sorcerers} and {druids}. You can choose your vocation once you are level 8 and have talked to the {oracle}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "knight") then
		npcHandler:say("Knights are strong melee fighters. You will learn all about them once you are level 8 and reached the Island of {Destiny}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "paladin") then
		npcHandler:say("Paladins are swift distance fighters. You will learn all about them once you are level 8 and reached the Island of {Destiny}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "druid") then
		npcHandler:say("Druids are nature magic users and great healers. You will learn all about them once you are level 8 and reached the Island of {Destiny}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "sorcerer") then
		npcHandler:say("Sorcerers are talented elemental magicians. You will learn all about them once you are level 8 and reached the Island of {Destiny}.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "box") then
		npcHandler:say("Do you have a suitable present box for me?", cid)
		Topic[talkUser] = 3
	elseif Topic[talkUser] == 3 then
		if msgcontains(msg, "yes") then
			if getPlayerItemCount(cid, 1990) >= 1 then
				npcHandler:say("THANK YOU! Here is a helmet that will serve you well.", cid)
				doPlayerRemoveItem(cid, 1990, 1)
				doPlayerAddItem(cid, 2480, 1)
			else
				npcHandler:say("HEY! You don't have one! Stop playing tricks on me or I'll give you some extra work!", cid)
			end
		else
			npcHandler:say("HEY! You don't have one! Stop playing tricks on me or I will give some extra work!", cid)
		end
		Topic[talkUser] = 0
	end
	return TRUE
end

npcHandler:setMessage(MESSAGE_GREET, "Hello, |PLAYERNAME|. Welcome to the Academy of Rookgaard. May I sign you up as a {student}?")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Good bye! And remember: No running up and down in the academy!")
npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye, |PLAYERNAME|! And remember: No running up and down in the academy!")
npcHandler:setCallback(CALLBACK_ONTHINK, thinkCallback)
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
I've made sure that the order of keywords is correct.
Cipsoft's NPC system parses "IFs" (if I may call them like that) that have the most conditions first, so you you say "al dee job", he will reply with the response for keywords "al","dee" instead.
 
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local Topic = {}
local Amount = {}
local Price = {}
local Type = {}

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)
	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	if msgcontains(msg, "charach") and (not npcHandler:isFocused(cid)) then
		selfSay("Ikem Charach maruk.", cid, TRUE)
		npcHandler:addFocus(cid)
		Topic[talkUser] = 0
		Amount[talkUser] = 0
		Price[talkUser] = 0
		Type[talkUser] = 0
		return true
	elseif (not npcHandler:isFocused(cid)) then
		npcHandler:say("Buta humak!", cid, TRUE)
	elseif msgcontains(msg, "futchi") then
		selfSay("Futchi.", cid, TRUE)
		npcHandler:releaseFocus(cid)
		Topic[talkUser] = 0
		Amount[talkUser] = 0
		Price[talkUser] = 0
		Type[talkUser] = 0
	elseif msgcontains(msg, "ikem") and msgcontains(msg, "goshak") then
		npcHandler:say("Ikem pashak porak, bata, dora. Ba goshak maruk?", cid)
		Topic[talkUser] = 0
		Amount[talkUser] = 0
		Price[talkUser] = 0
		Type[talkUser] = 0
	elseif msgcontains(msg, "goshak") and msgcontains(msg, "porak") then
		npcHandler:say("Ikem pashak charcha, burka, burka bata, hakhak. Ba goshak maruk?", cid)
		Topic[talkUser] = 0
		Amount[talkUser] = 0
		Price[talkUser] = 0
		Type[talkUser] = 0
	elseif msgcontains(msg, "goshak") and msgcontains(msg, "charcha") then
		npcHandler:say("Maruk goshak ta?", cid)
		Topic[talkUser] = 1
		Amount[talkUser] = 1
		Price[talkUser] = 25
		Type[talkUser] = 2385
	elseif msgcontains(msg, "goshak") and msgcontains(msg, "burka") and msgcontains(msg, "bata") then
		npcHandler:say("Maruk goshak ta?", cid)
		Topic[talkUser] = 1
		Amount[talkUser] = 1
		Price[talkUser] = 85
		Type[talkUser] = 2376
	elseif msgcontains(msg, "goshak") and msgcontains(msg, "burka") then
		npcHandler:say("Maruk goshak ta?", cid)
		Topic[talkUser] = 1
		Amount[talkUser] = 1
		Price[talkUser] = 30
		Type[talkUser] = 2406
	elseif msgcontains(msg, "goshak") and msgcontains(msg, "hakhak") then
		npcHandler:say("Maruk goshak ta?", cid)
		Topic[talkUser] = 1
		Amount[talkUser] = 1
		Price[talkUser] = 85
		Type[talkUser] = 2388
	elseif msgcontains(msg, "goshak") and msgcontains(msg, "bata") then
		npcHandler:say("Ikem pashak aka bora, tulak bora, grofa. Ba goshak maruk?", cid)
		Topic[talkUser] = 0
		Amount[talkUser] = 0
		Price[talkUser] = 0
		Type[talkUser] = 0
	elseif msgcontains(msg, "goshak") and msgcontains(msg, "tulak") and msgcontains(msg, "bora") then
		npcHandler:say("Maruk goshak ta?", cid)
		Topic[talkUser] = 1
		Amount[talkUser] = 1
		Price[talkUser] = 90
		Type[talkUser] = 2484
	elseif msgcontains(msg, "goshak") and msgcontains(msg, "bora") then
		npcHandler:say("Maruk goshak ta?", cid)
		Topic[talkUser] = 1
		Amount[talkUser] = 1
		Price[talkUser] = 25
		Type[talkUser] = 2467
	elseif msgcontains(msg, "goshak") and msgcontains(msg, "grofa") then
		npcHandler:say("Maruk goshak ta?", cid)
		Topic[talkUser] = 1
		Amount[talkUser] = 1
		Price[talkUser] = 60
		Type[talkUser] = 2482
	elseif msgcontains(msg, "goshak") and msgcontains(msg, "dora") then
		npcHandler:say("Ikem pashak donga. Ba goshak maruk?", cid)
		Topic[talkUser] = 0
		Amount[talkUser] = 0
		Price[talkUser] = 0
		Type[talkUser] = 0
	elseif msgcontains(msg, "goshak") and msgcontains(msg, "donga") then
		npcHandler:say("Maruk goshak ta?", cid)
		Topic[talkUser] = 1
		Amount[talkUser] = 1
		Price[talkUser] = 65
		Type[talkUser] = 2511
	elseif msgcontains(msg, "goshak") and msgcontains(msg, "batuk") then
		npcHandler:say("Ahhhh, maruk goshak batuk?", cid)
		Topic[talkUser] = 1
		Amount[talkUser] = 1
		Price[talkUser] = 400
		Type[talkUser] = 2456
	elseif msgcontains(msg, "goshak") and msgcontains(msg, "pixo") then
		npcHandler:say("Maruk goshak tefar pixo ul batuk?", cid)
		Topic[talkUser] = 1
		Amount[talkUser] = 10
		Price[talkUser] = 30
		Type[talkUser] = 2544
	elseif Topic[talkUser] == 1 then
		if msgcontains(msg, "mok") then
			if getPlayerMoney(cid) >= Price[talkUser] then
				npcHandler:say("Maruk rambo zambo!", cid)
				doPlayerRemoveMoney(cid, Price[talkUser])
				doPlayerAddItem(cid, Type[talkUser], Amount[talkUser])
				Topic[talkUser] = 0
				Amount[talkUser] = 0
				Price[talkUser] = 0
				Type[talkUser] = 0
			else
				npcHandler:say("Maruk nixda!", cid)
				Topic[talkUser] = 0
				Amount[talkUser] = 0
				Price[talkUser] = 0
				Type[talkUser] = 0
			end
		else
			npcHandler:say("Buta maruk klamuk!", cid)
			Topic[talkUser] = 0
			Amount[talkUser] = 0
			Price[talkUser] = 0
			Type[talkUser] = 0
		end
	elseif msgcontains(msg, "trade") then
		npcHandler:say("Uh?", cid)
		Topic[talkUser] = 0
		Amount[talkUser] = 0
		Price[talkUser] = 0
		Type[talkUser] = 0
	end
	return TRUE
end

npcHandler:setMessage(MESSAGE_WALKAWAY, "Futchi.")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
 
THX Cykotitan.

:thumbup: THX Cykotian.

Can you for example put all rookgaard NPC (xml and lua) files and host it. You're Npcs' working perfect.
NPC NAMEs
Al Dee
Amber
Billy
Blind Orc
Cipfried
Dallheim
Dixi
Hyacinth
Lee'Delle
Lily
Loui
Norma
Obi
Seymour
The Gatekeeper - premium oracle
The Oracle
Tom
Willie
Zerbrus

THX once again a lot Cykotitan. Rep for You

Btw if you say to Seymour hi and then key he'll respnond
Only nonsense on your mind, eh?
you've got to ask him again about the key and then he'll say
Do you want to buy the Key to Adventure for 5 gold coins?
It is normal?:confused:
 
:thumbup: THX Cykotian.

Can you for example put all rookgaard NPC (xml and lua) files and host it. You're Npcs' working perfect.


THX once again a lot Cykotitan. Rep for You

Btw if you say to Seymour hi and then key he'll respnond you've got to ask him again about the key and then he'll say It is normal?:confused:
Yes, that's exactly the way it works in Cipbia. If you don't trust me, create a new character on Rookgaard and see for yourself.

I have all the Rookgaard NPCs.. I also have the full conversation for them, except for NPCs that are located on the premium side (Lee'Delle, Loui, Zerbrus, Billy)
Note that The Gatekeeper was removed in Update 8.2
 
I have all the Rookgaard NPCs.. I also have the full conversation for them, except for NPCs that are located on the premium side (Lee'Delle, Loui, Zerbrus, Billy)
Note that The Gatekeeper was removed in Update 8.2

Can you host it or put it here.

Believe me all will be appreciate.:)

Thanx anyway for info about The Gatekeeper.:thumbup:

Your Blind Orc script rox :D
 
Last edited:
Can you host it or put it here.

Believe me all will be appreciate.:)

Thanx anyway for info about The Gatekeeper.:thumbup:

Your Blind Orc script rox :D
Sorry, I can't. I need it for something else so I can't make it public, too.
 
Sorry, I can't. I need it for something else so I can't make it public, too.

Sad.

Ok now it's something from me.

I think i made it good.

My english grammar isn't as good as it should but I've tried as much as i could.

NORMA
say "order" to buy drinks
say "trade" to buy food (only food)
say addon for first citizen outfit

norma.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Norma" script="norma.lua" walkinterval="1000" floorchange="0">
    <health now="100" max="100"/>
    <look type="136" head="78" body="76" legs="72" feet="96" addons="2"/>
    <parameters>
        
        <parameter key="message_greet" value="Welcome, welcome! Have a seat! If you like a drink, just {order} it. If you want something to eat, just ask me for a {trade}!" />
		<parameter key="message_walkaway" value="Come back soon!"/>
		<parameter key="message_farewell" value="Good bye, |PLAYERNAME|! And remember: don't eat to much 'couse you'll get stomach ache and please don't get drunk again!" />
		<parameter key="message_idletimeout" value="Good bye, |PLAYERNAME|! And remember: don't eat to much 'couse you'll get stomach ache and please don't get drunk again!" />
        <parameter key="message_sendtrade" value="Take all the time you need to decide what you want!"/>
        <parameter key="module_keywords" value="1" />
        <parameter key="keywords" value="name;Norma;buy;sell;food;order;buy food;" />
        <parameter key="keyword_reply1" value="Well, my name is {Norma}." />
        <parameter key="keyword_reply2" value="I hate that name, it sounds so boring. Almost like 'normal'. I think I should change my name to something more exciting. Like... Marylin! Oh, what a glamorous sound!" />
        <parameter key="keyword_reply3" value="Oh, would you like something to eat or drink? Ask me for a {trade} to see my food offers or {order} something to drink!" />
        <parameter key="keyword_reply4" value="Oh, would you like something to eat or drink? Ask me for a {trade} to see my food offers or {order} something to drink!" />
        <parameter key="keyword_reply5" value="Oh, would you like something to eat or drink? Ask me for a {trade} to see my food offers or {order} something to drink!" />
		<parameter key="keyword_reply6" value="May I suggest something to you? My offer: {beer}, {wine}, {milk}, {lemonade}, {water}. You have selected something already?" />
        <parameter key="keyword_reply7" value="If you want something to eat, just ask me for a {trade}!" />
		<parameter key="module_shop" value="1"/>
        <parameter key="shop_buyable" value="bread,2689,3;cheese,2696,5;egg,2695,2;party cake,6280,50;" />
        <parameter key="shop_sellable" value="" />
    </parameters>
</npc>

norma.lua
Code:
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
	if(msgcontains(msg, 'beer')) then
		selfSay('Do you want to buy beer? Will pay only 2gp!', cid)
		talkState[talkUser] = 1
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
		if(doPlayerRemoveMoney(cid, 2) == TRUE) then
			doPlayerAddItem(cid, 2006, 3)
				selfSay('Here you are, this is you beer. You can also {order} something else or {buy} food.', cid)
			else
				selfSay('Sorry, you don\'t have enough gold.', cid)
             end
	elseif(msgcontains(msg, 'no') and talkState[talkUser] == 1) then
				selfSay('Ok then, maybe you want to {order} different drink or {buy} something to eat?', cid)
				talkState[talkUser] = 0
			     		 
return true
end
----------------------------------------
	if(msgcontains(msg, 'wine')) then
		selfSay('Do you want to buy wine? Will pay only 3gp!', cid)
		talkState[talkUser] = 2
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 2) then
		if(doPlayerRemoveMoney(cid, 3) == TRUE) then
			doPlayerAddItem(cid, 2006, 15)
				selfSay('Here you are, this is you wine. You can also {order} something else or {buy} food.', cid)
			else
				selfSay('Sorry, you don\'t have enough gold.', cid)
		     end
	elseif(msgcontains(msg, 'no') and talkState[talkUser] == 2) then
				selfSay('Ok then, maybe you want to {order} different drink or {buy} something to eat?', cid)
				talkState[talkUser] = 0	     
return true
end
----------------------------------------
	if(msgcontains(msg, 'milk')) then
		selfSay('Do you want to buy milk? Will pay only 4gp!', cid)
		talkState[talkUser] = 3
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 3) then
		if(doPlayerRemoveMoney(cid, 4) == TRUE) then
			doPlayerAddItem(cid, 2006, 6)
				selfSay('Here you are, this is you milk. You can also {order} something else or {buy} food.', cid)
			else
				selfSay('Sorry, you don\'t have enough gold.', cid)
		    end
	elseif(msgcontains(msg, 'no') and talkState[talkUser] == 3) then
				selfSay('Ok then, maybe you want to {order} different drink or {buy} something to eat?', cid)
				talkState[talkUser] = 0		
return true
end
----------------------------------------
	if(msgcontains(msg, 'lemonade')) then
		selfSay('Do you want to buy lemonade? Will pay only 2gp!', cid)
		talkState[talkUser] = 4
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 4) then
		if(doPlayerRemoveMoney(cid, 2) == TRUE) then
			doPlayerAddItem(cid, 2006, 5)
				selfSay('Here you are, this is you lemonade. You can also {order} something else or {buy} food.', cid)
			else
				selfSay('Sorry, you don\'t have enough gold.', cid)
		     end
	elseif(msgcontains(msg, 'no') and talkState[talkUser] == 4) then
			selfSay('Ok then, maybe you want to {order} different drink or {buy} something to eat?', cid)
			talkState[talkUser] = 0
return true
end
----------------------------------------
	if(msgcontains(msg, 'water')) then
		selfSay('Do you want to buy water? Will pay only 1gp!', cid)
		talkState[talkUser] = 5
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 5) then
		if(doPlayerRemoveMoney(cid, 1) == TRUE) then
			doPlayerAddItem(cid, 2006, 1)
				selfSay('Here you are, this is you water. You can also {order} something else or {buy} food.', cid)
			else
				selfSay('Sorry, you don\'t have enough gold.', cid)
		end
	elseif(msgcontains(msg, 'no') and talkState[talkUser] == 5) then
			selfSay('Ok then, maybe you want to {order} different drink or {buy} something to eat?', cid)
			talkState[talkUser] = 0
	     end
return true
end
-- Storage IDs --
local citizen     = 22011


local newaddon    = 'Here you are, enjoy your brand new addon!'
local noitems        = 'You do not have all the required items.'
local noitems2    = 'You do not have all the required items or you do not have the first addon, which by the way, is a requirement for this addon.'
local already        = 'It seems you already have this addon, don\'t you try to mock me son!'
        
-- CITIZEN START --
function CitizenSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,citizen+1)
    if addon == -1 then
        if getPlayerItemCount(cid,5890) >= 100 and getPlayerItemCount(cid,5902) >= 50 and getPlayerItemCount(cid,2480) >= 1 then
        if doPlayerRemoveItem(cid,5890,100) and doPlayerRemoveItem(cid,5902,50) and doPlayerRemoveItem(cid,2480,1) then
            npcHandler:say('Here you are, enjoy your brand new addon!', cid)
             
            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 128, 2)
            doPlayerAddOutfit(cid, 136, 2)
            setPlayerStorageValue(cid,citizen+1,1)
        end
        else
            npcHandler:say('You do not have all the required items.', cid)
        end
    else
        npcHandler:say('It seems you already have this addon, don\'t you try to mock me son!', cid)
    end
    end

end

keywordHandler:addKeyword({'addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Ask about {Outfit}."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "What you do is that you type 'first citizen addon'. Assuming that you already collected all the required pieces, say 'yes' and voíla - you got yourself an addon!"})

local node1 = keywordHandler:addKeyword({'outfit'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Pretty, isn`t it? My friend Hanna taught me how to make it,\nbut I could help you with one if you like. What do you say?'})
    node1:addChildKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Okay, here we go, listen closely! I need a few things.., a basic {hat} of course,\nmaybe a legion helmet would do. Then about 100 chicken feathers... and 50 honeycombs as glue.\nThat`s it, come back to me once you gathered it!', reset = true})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items. Meanwhile you maybe want to {order} some drink or {buy} food?', reset = true})
local node2 = keywordHandler:addKeyword({'hat'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Oh, you`re back already? Did you bring a legion helmet, 100 chicken feathers and 50 honeycombs?'})
    node2:addChildKeyword({'yes'}, CitizenSecond, {npcHandler = npcHandler, onlyFocus = true, text = 'Great job! That must have taken a lot of work. Okay, you put it like this... then glue like this... here!', reset = true})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})
	
	


npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Last edited:
More rookgaard npc's plx?

Anyone have a healer.lua script working for 0.3.5+?
 
lol all you do is ask people for shit. Do it yourself, would take you an hour at most to get 80% rook npcs.
 
lol all you do is ask people for shit. Do it yourself, would take you an hour at most to get 80% rook npcs.

Naw, are you still crying over your true tibia shit? Get a life, and stop follow me around this forum.


@Ontopic

I would appreciate someone posting a healer.lua file

Edit:

Found this one

healer.lua

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


-------------------------------------Healing Part------------------------------
function healCreature(cid, message, keywords, parameters)
	if(getCreatureHealth(cid) < parameters.maxheal) then
		position = getCreaturePosition(npcHandler.focus)
		doSendMagicEffect(position, 12)
		local healHP = parameters.maxheal - getCreatureHealth(cid)
		doCreatureAddHealth(npcHandler.focus,healHP)
		selfSay('You are looking really bad. Let me heal your wounds.')
	else
		selfSay('You aren\'t looking really bad, ' .. getCreatureName(cid) .. '. I only help in cases of real emergencies. Raise your health simply by eating food.')
	end	
	return true
end

function healCreatureNoMsg(cid, maxheal)
	if(getCreatureHealth(cid) < maxheal) then
		position = getCreaturePosition(npcHandler.focus)
		doSendMagicEffect(position, 12)
		local healHP = maxheal - getCreatureHealth(cid)
		doCreatureAddHealth(npcHandler.focus,healHP)
		selfSay('Hello, ' .. getCreatureName(cid) .. '! You are looking really bad. Let me heal your wounds.')
	end	
	return true
end

function tradeItem(cid, message, keywords, parameters)     return npcHandler:defaultTradeHandler(cid, message, keywords, parameters) end
function confirmAction(cid, message, keywords, parameters) return npcHandler:defaultConfirmHandler(cid, message, keywords, parameters) end
function sayMessage(cid, message, keywords, parameters)     return npcHandler:defaultMessageHandler(cid, message, keywords, parameters) end
function greet(cid, message, keywords, parameters)       
    if (npcHandler.focus > 0 or not(npcHandler.queue:isEmpty()) and npcHandler.focus ~= cid) then
        selfSay('Please, ' .. creatureGetName(cid) .. '. Wait for your turn!.')
        if(not npcHandler.queue:isInQueue(cid)) then
            npcHandler.queue:pushBack(cid)
        end
    elseif(npcHandler.focus == 0) and (npcHandler.queue:isEmpty()) then
        npcHandler.focus = cid
        npcHandler.talkStart = os.clock()
		if(getCreatureHealth(cid) >= 200) then
			selfSay('Hello, ' .. creatureGetName(cid) .. '! I will heal you if you are injured. Feel free to ask me for help.')
		else
			healCreatureNoMsg(npcHandler.focus, 60)
		end		
    end
    
    return true
end

function farewell(cid, message, keywords, parameters)         return npcHandler:defaultFarewellHandler(cid, message, keywords, parameters) end

keywordHandler:addKeyword({'heal'},     healCreature, {maxheal = 60})
keywordHandler:addKeyword({'help'},     healCreature, {maxheal = 60})

keywordHandler:addKeyword({'yes'}, confirmAction, nil)
keywordHandler:addKeyword({'no'}, confirmAction, nil)

npcHandler:addModule(FocusModule:new())
 
Does anyone happen to have the complete coding Al Dee? (Especially for the small axe quest)
Also, does anyone know what to write in order to make the blind orc open up the NPC-chat-window once u talk to him?
He's working fine with the above code but it'd be even better if talking to him triggered the NPC-window to open.
 
Back
Top