Ir para conteúdo

Rookgaard - Seymour


Poccnn

Posts Recomendados

Seymour.xml

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Seymour" script="data/npc/scripts/default.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!" />	
        <parameter key="module_keywords" value="1" />
		
        <parameter key="keywords" value="Billy;Norma;Willie;job;name;Sir;information;lesson;this;Rookgaard;village;island;Thais;Tibia;temple;shop;farm;dungeon;Main;fight;skill;level;equip;premium;potion;antidote;food;weapon;armor;shield;rope;shovel;torch;legs;helmet;shoe;trade;citizen;merchant;king;monster;rat;sewer;troll;money;loot;corpse;Obi;Dixi;Amber;Norma;Willie;Billy;Lily;Lee'Delle;Hyacinth;Tom;academy;train;library;bank;deposit;The Oracle;oracle;vocation;knight;paladin;druid;sorcerer;" />
        <parameter key="keyword_reply1" value="Billy is {Willie}\'s cousin, but he has his farm on the {premium} side of the village." />
        <parameter key="keyword_reply2" value="Norma has recently opened a bar here meaning she sells drinks and snacks. Nothing of importance to you, young student." />
        <parameter key="keyword_reply3" value="Willie is a fine farmer, although he is short-tempered. He sells and buys {food}." />
        <parameter key="keyword_reply4" value="I'm the master of this fine {academy}, giving {lessons} to my students." />
        <parameter key="keyword_reply5" value="My name is Seymour, but for you I am 'Sir' Seymour." />
        <parameter key="keyword_reply6" value="At least you know how to address a man of my importance." />
        <parameter key="keyword_reply7" value="Well, I could give you valuable {lessons} or some general {hints} about the game, or a small {quest} if you're interested." />
        <parameter key="keyword_reply8" value="Oh, which lesson did you want to attend again? Was it {Rookgaard}, {fighting}, {equipment}, {citizens}, the {academy} or the {oracle}?" />		
        <parameter key="keyword_reply9" value="Yes, you got it. Ask me for a {lesson} anytime.?" />		
        <parameter key="keyword_reply10" value="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}." />		
        <parameter key="keyword_reply11" value="The most important places in this village are the {temple}, the different {shops}, the {academy} and the {bridges}." />		
        <parameter key="keyword_reply12" value="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." />		
        <parameter key="keyword_reply13" value="The city of Thais is reigned by King Tibianus. Of course, there are many other cities but you will learn about them later." />
        <parameter key="keyword_reply14" value="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!" />		
        <parameter key="keyword_reply15" value="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." />		
        <parameter key="keyword_reply16" value="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}." />		
        <parameter key="keyword_reply17" value="The farms are west of here. You can buy and sell {food} there which you need to regain {health}." />		
        <parameter key="keyword_reply18" value="You should not descend into dungeons without proper {equipment}. Once you are all prepared, ask the bridge {guards} for suitable {monsters}." />		
        <parameter key="keyword_reply19" value="You can leave for mainland once you are level 8. To do so talk to the {oracle}." />		
		<parameter key="keyword_reply20" value="You have to fight {monsters} to train your {skills} and {level}. If you lose {health}, eat {food} to regain it or use a {potion}." />	
		<parameter key="keyword_reply21" value="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}." />	
		<parameter key="keyword_reply22" value="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." />	
		<parameter key="keyword_reply23" value="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}." />	
		<parameter key="keyword_reply24" value="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." />	
		<parameter key="keyword_reply25" value="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." />	
		<parameter key="keyword_reply26" value="Some monsters poison you. To heal poison, use an antidote potion on yourself. Buy them at {Lily}'s store." />	
		<parameter key="keyword_reply27" value="Many monsters, such as rabbits or deer, are excellent food providers. You can also buy food from {Willie} or {Billy}, the farmers." />	
		<parameter key="keyword_reply28" value="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}." />	
		<parameter key="keyword_reply29" value="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}." />	
		<parameter key="keyword_reply30" value="I fear you have to buy your first shield by yourself. A wooden shield from {Dixi} or {Lee'Delle} is a good choice." />	
		<parameter key="keyword_reply31" value="You definitely need a rope to progress in dungeons, else you might end up stuck. Buy one from {Al Dee} or {Lee'Delle}." />	
		<parameter key="keyword_reply32" value="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." />	
		<parameter key="keyword_reply33" value="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}." />	
		<parameter key="keyword_reply34" value="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}." />	
		<parameter key="keyword_reply35" value="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}." />	
		<parameter key="keyword_reply36" value="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}." />	
		<parameter key="keyword_reply37" value="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." />	
		<parameter key="keyword_reply38" value="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." />	
		<parameter key="keyword_reply39" value="Merchants buy and sell goods. Just ask them for a {trade} to see what they offer or buy from you." />	
		<parameter key="keyword_reply40" value="Hail to King Tibianus! Long live our king! Not that he cares for an old veteran who is stuck on this godforsaken island..." />	
		<parameter key="keyword_reply41" value="Good monsters to start hunting are {rats}. They live in the {sewers} below the village." />	
		<parameter key="keyword_reply42" value="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}." />	
		<parameter key="keyword_reply43" value="One entrance to the sewers is south of this {academy}. Look for a sewer grate, then use it to climb down." />	
		<parameter key="keyword_reply44" value="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!" />	
		<parameter key="keyword_reply45" value="Make money by killing {monsters} and picking up their {loot}. You can sell many of the things they carry." />	
		<parameter key="keyword_reply46" value="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}." />	
		<parameter key="keyword_reply47" value="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}." />	
		<parameter key="keyword_reply48" value="Obi sells and buys {weapons}. You can find his shop south of the academy." />	
		<parameter key="keyword_reply49" value="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." />	
		<parameter key="keyword_reply50" value="A traveller from the {main} continent. I wonder what brought her here. No one comes here of his own free will." />	
		<parameter key="keyword_reply51" value="Norma has recently opened a bar here meaning she sells drinks and snacks. Nothing of importance to you, young student." />	
		<parameter key="keyword_reply52" value="Willie is a fine farmer, although he is short-tempered. He sells and buys {food}." />	
		<parameter key="keyword_reply53" value="Billy is {Willie}'s cousin, but he has his farm on the {premium} side of the village." />	
		<parameter key="keyword_reply54" value="In the southern part of town, Lily sells {potions} which might come in handy once you are deep in a dungeon and need {health}." />	
		<parameter key="keyword_reply55" value="Lee'Delle's shop is in the western part of town, on the {premium} side. She sells everything cheaper." />	
		<parameter key="keyword_reply56" value="A mysterious druid who lives somewhere in the wilderness. He sells small health {potions} just like {Lily}." />	
		<parameter key="keyword_reply57" value="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." />	
		<parameter key="keyword_reply58" value="The academy is the building you are standing in. We have a {library}, a {training} centre, a {bank} and the room of the {oracle}." />	
		<parameter key="keyword_reply59" value="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!" />	
		<parameter key="keyword_reply60" value="There are many books in the bookcases around you, unless some naughty kids stole them again. Read them for more and detailed information." />	
		<parameter key="keyword_reply61" value="In a bank you can deposit your earned gold coins safely. Just go downstairs to {Paulie} and ask him to {deposit} your money." />	
		<parameter key="keyword_reply62" value="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." />	
		<parameter key="keyword_reply63" value="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." />	
		<parameter key="keyword_reply64" value="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." />	
		<parameter key="keyword_reply65" value="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}." />	
		<parameter key="keyword_reply66" value="Knights are strong melee fighters. You will learn all about them once you are level 8 and reached the Island of {Destiny}." />	
		<parameter key="keyword_reply67" value="Paladins are swift distance fighters. You will learn all about them once you are level 8 and reached the Island of {Destiny}." />	
		<parameter key="keyword_reply68" value="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}." />	
		<parameter key="keyword_reply69" value="Sorcerers are talented elemental magicians. You will learn all about them once you are level 8 and reached the Island of {Destiny}." />	
	</parameters>
</npc>

Seymour.lua

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, "time") then
		npcHandler:say("It's "..getTibianTime()..", so you are late. Hurry!", cid)
		Topic[talkUser] = 0
	elseif Topic[talkUser] == 1 then
		npcHandler:say("Only nonsense on your mind, eh?", 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, "present 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:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...