Ir para conteúdo

Rookgaard - Amber


Poccnn

Posts Recomendados

Amber.xml

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Amber" script="data/npc/scripts/Rookgaard/Amber.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="136" head="58" body="113" legs="113" feet="95" addons="1"/>	
    <parameters>
        <parameter key="message_greet" value="Oh hello, nice to see you |PLAYERNAME| Are you here to hear some stories of my {adventures} or do you need {help}"/>
        <parameter key="message_farewell" value="See you later, |PLAYERNAME|."/>
        <parameter key="module_keywords" value="1" />
		
        <parameter key="keywords" value="How are you;job;adventure;sea;explore;tibia;time;dungeon;sewer;king;rookgaard;academy;help;information;destiny;thais;main;castle;magic;weapon;monsters;orcs;cyclops;minotaur;dragon;premium;bank;food;tools;rope;shovel;torch;raft;mission;quest;Al Dee;Amber;Billy;Cipfried;Dallheim;Dixi;Hyacinth;Lily;Loui;Norma;Obi;Paulie;Santiago;Seymour;The Oracle;Tom;Willie;Zerbrus;Zirella" />
        <parameter key="keyword_reply1" value="I'm recovering from a sea passage." />
        <parameter key="keyword_reply2" value="I'm an explorer who seeks adventures." />
        <parameter key="keyword_reply3" value=" I fought fierce monsters, climbed the highest mountains, explored the deepest dungeons and crossed the sea on a raft." />
        <parameter key="keyword_reply4" value="My voyage on the sea was exhausting. The weather was bad, the waves high and my raft quite simple. There's a certain excitement to it, though." />
        <parameter key="keyword_reply5" value="I've been almost everywhere in Tibia." />
        <parameter key="keyword_reply6" value="I'm trying to explore each spot of Tibia, and one day I'll have seen it all." />
        <parameter key="keyword_reply7" value="Sorry, I lost my watch in a storm." />
        <parameter key="keyword_reply8" value="I had no time to explore the dungeons of this isle yet, but I've seen two big caves in the East, and there is a ruined tower to the north-west. Oh, and there're the sewers" />		
        <parameter key="keyword_reply9" value="I like sewers. I made my very first battle experience in the sewers below Thais. The small sewer system of Rookgaard has some nasty rats to fight." />		
        <parameter key="keyword_reply10" value="King Tibianus is the ruler of Thais. The island of Rookgaard belongs to his kingdom." />		
        <parameter key="keyword_reply11" value="It's a nice little island on which you can learn how to fight. I can see it in your eyes - you want to become a famous adventurer and explorer just like me!" />		
        <parameter key="keyword_reply12" value="A fine institution, but it needs definitely more funds from the king." />		
        <parameter key="keyword_reply13" value="Well, I can give you general hints or tell you about my adventures and many other topics. Oh, and if you are bored, I might have a small quest for you." />
        <parameter key="keyword_reply14" value="Well, I can give you general hints or tell you about my adventures and many other topics. Oh, and if you are bored, I might have a small quest for you." />		
        <parameter key="keyword_reply15" value="You will find your destiny. I'm sure it's something big and important." />		
        <parameter key="keyword_reply16" value="A fine city, but the king has some problems enforcing the law." />		
        <parameter key="keyword_reply17" value="You'll be surprised once you leave this island. The world outside there is gigantic." />		
        <parameter key="keyword_reply18" value="If you travel to Thais, you really should visit the marvellous castle there." />		
        <parameter key="keyword_reply19" value="Spells are only taught in the guildhalls of the mainland." />		
<parameter key="keyword_reply20" value="The best weapons on this isle are just toothpicks, compared with the weapons warriors of the mainland wield." />	
        <parameter key="keyword_reply21" value="Oh, I fought orcs, cyclopses, minotaurs, even dragons, and many other creatures." />		
        <parameter key="keyword_reply22" value="Not the nicest guys you can encounter. I had some clashes with them and finally ended up being their prisoner for a few months." />
        <parameter key="keyword_reply23" value="I don't like the way they look at you. Their eye seems to pierce right through you. Creepy!" />
		<parameter key="keyword_reply24" value="They are nasty monsters, particularly as they have distance fighters and mages in their clans. My backpack is handmade from minotaur leather." />		
        <parameter key="keyword_reply25" value="Their breath is so hot! I had to cut my hair after my last encounter with a dragon because the ends were all burnt. That's what you gotta deal with as a female adventurer!" />		
        <parameter key="keyword_reply26" value="I wouldn't want to miss being a premium adventurer. Everything is so much easier!" />		
        <parameter key="keyword_reply27" value="I have almost no money with me anyway, so no need to deposit any at the bank." />		
        <parameter key="keyword_reply28" value="My favourite dish is salmon. Oh please, bring me some." />
        <parameter key="keyword_reply29" value="The most important tools you need are a rope, a shovel and maybe a torch." />		
        <parameter key="keyword_reply30" value="One day I fell into a hole without having a rope. I was yelling for help for three whole days! Eventually a fisherman passed by and pulled me out with his own rope, lucky me." />		
        <parameter key="keyword_reply31" value="Sometimes I have the strong urge to use it to knock someone out." />		
        <parameter key="keyword_reply32" value="You know, on mainland you will be able to cast magic spells which provide you with light. You won't really need torches anymore." />		
        <parameter key="keyword_reply33" value="I left my raft at the south-eastern shore. I forgot my private notebook on it. If you could return it to me, I would be very grateful." />		
        <parameter key="keyword_reply34" value="I left my raft at the south-eastern shore. I forgot my private notebook on it. If you could return it to me, I would be very grateful." />
        <parameter key="keyword_reply35" value="I left my raft at the south-eastern shore. I forgot my private notebook on it. If you could return it to me, I would be very grateful." />		
        <parameter key="keyword_reply36" value="I don't have much to say about him. I think he sells tools." />		
        <parameter key="keyword_reply37" value="Did you know my name is also the name of a gem?" />		
        <parameter key="keyword_reply38" value="He brought me some of his famous rat stew. I really didn't want to insult him, but I simply can't eat something like that. So I told him I'm a vegetarian and I only eat fish." />		
        <parameter key="keyword_reply39" value="A gentle person. You should visit him if you have questions or need healing." />		
        <parameter key="keyword_reply40" value="An extraordinary warrior. He's the first and last line of defence of Rookgaard." />		
        <parameter key="keyword_reply41" value="I don't really know her, but she seems to be a nice girl." />		
        <parameter key="keyword_reply42" value="Hyacinth is a great healer. He lives somewhere hidden on this isle." />		
        <parameter key="keyword_reply43" value="Hm, I think I haven't met her yet." />		
        <parameter key="keyword_reply44" value="Never seen him around." />		
        <parameter key="keyword_reply45" value="She has changed a lot since I last saw her." />		
        <parameter key="keyword_reply46" value="He's a funny little man." />
        <parameter key="keyword_reply47" value="No, I didn't go to the bank yet." />
        <parameter key="keyword_reply48" value="He promised to repair my raft." />
        <parameter key="keyword_reply49" value="I think this poor guy was a bad choice as head of the academy." />
        <parameter key="keyword_reply50" value="The oracle is said to show you your destiny once you are level 8." />
        <parameter key="keyword_reply51" value="To me he seems a bit rude, but maybe that's just my impression." />
        <parameter key="keyword_reply52" value="He's funny in his own way." />
        <parameter key="keyword_reply53" value="An extraordinary warrior. He's the first and last line of defence of Rookgaard." />
        <parameter key="keyword_reply54" value="She seriously asked me if she could have the remains of my raft as fire wood! Can you imagine that??" />
    </parameters>
</npc>

 

Amber.lua

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local orcish = {
["Charach"] 		= "Hi",
["Futchi"]		= "Bye",
["Mok"]			= "Yes",
["Burp"]			= "No",
["Ikem goshak"] = "Offer",
["Goshak"]		= "Buy",
["Porak"]			= "Weapon",
["Bata"]			= "Armor or Helmet",
["Dora"]			= "Shield",
["Burka Bata"]	= "Sword",
["Charcha"]		= "Sabre",
["Hakhak"]		= "Hatchet",
["Burka"]			= "Short Sword",
["Batuk"]			= "Bow",
["Pixo"]			= "Arrows",
["Tulak Bora"]	= "Studded Armor",
["Aka Bora"]		= "Leather Armor",
["Donga"]			= "Brass Shield",
["Grofa"]			= "Studded Helmet",
["Humak"]			= "Human",
["Minotaur"]		= "Minotaur",
["Ork"]			= "Orcs",
["Arash"]			= "Have",
["Ba"] 			= "Which",
["Bana"]			= "Slave",
["Bata"]			= "Long/Longer",
["Batash"]		= "Here",
["Booz"]			= "More",
["Buta"]			= "Damn(ed)/Stupid",
["Ferut"]			= "Come",
["Gort"]			= "People",
["Ikem"]			= "I/me",
["Karak"]			= "Dominate",
["Karakim"]		= "Dominate",
["Karek"]			= "Dominate",
["Kiskesh"]		= "All",
["Klamuk"]		= "Paleskin",
["Maruk"]			= "You/Your",
["Mora"]			= "Before",
["Omark"]			= "Must",
["Ouk"]			= "We",
["Pashak"]		= "Sell",
["Ta"]				= "That/It",
["Taka"]			= "What",
["Tefar"]			= "Want",
["Ul"]				= "For/To",
["Utash"]			= "Gosh",
["Nixda"]			= "Money",
}

function onCreatureAppear(cid)				npcHandler:onCreatureAppear(cid)			end
function onCreatureDisappear(cid) 			npcHandler:onCreatureDisappear(cid)			end
function onCreatureSay(cid, type, msg)			npcHandler:onCreatureSay(cid, type, msg)		end
function onThink()					npcHandler:onThink()					end
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

function creatureSayCallback(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then		return false	end
	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
    if msgcontains(msg, 'orcish') or msgcontains(msg, 'prisoner') then
		npcHandler:say("I speak some Orcish words, not many though, just a few basics like 'yes' and 'no'.", cid)
		talkState[talkUser] = 1
	elseif msgcontains(msg, 'salmon') then
		npcHandler:say("Yeah! If you give me some salmon, I'll tell you another Orcish word. Okay?", cid)
		talkState[talkUser] = 2
	elseif msgcontains(msg, 'notebook') then
		npcHandler:say("Do you bring me my notebook?", cid)
		talkState[talkUser] = 3
	elseif msgcontains(msg, 'addon') then
		if(getPlayerStorageValue(cid, 91361) > 1 and getPlayerStorageValue(cid, 91361) < os.time())then
			npcHandler:say("Just in time! Your backpack is finished. Here you go, I hope you like it..", cid)
			doPlayerAddOutfit(cid,136,1) 
			doPlayerAddOutfit(cid,128,1)
			doPlayerSetStorageValue(cid, 91361, 1)
		elseif(getPlayerStorageValue(cid, 91361) > os.time())then
			npcHandler:say("it is not ready yet.", cid)
		elseif(getPlayerStorageValue(cid, 91361) == 1)then
			npcHandler:say("You already have a accessory like mine.", cid)
		else
			npcHandler:say("Ah, you noticed my new accessory? Sorry, this one is not for sale. It's handmade from rare {minotaur leather}.", cid)
		end
	elseif msgcontains(msg, 'minotaur leather') then
		npcHandler:say("Well, if you really like this backpack, I could make one for you, but minotaur leather is hard to come by these days. Are you willing to put some work into this?", cid)
		talkState[talkUser] = 4
	elseif msgcontains(msg, 'backpack') then
		npcHandler:say("Ah, right, almost forgot about the backpack! Have you brought me 100 pieces of minotaur leather as requested?", cid)
		talkState[talkUser] = 5
	elseif(talkState[talkUser] == 1)then
		if(msgcontains(msg,'yes'))then
			npcHandler:say("It's 'mok' in Orcish. I tell you more if you bring me some food.", cid)
		else
			npcHandler:say("In Orcish that's 'burp'. I tell you more if you bring me some food.",cid)
		end	
		talkState[talkUser] = 0
	elseif(talkState[talkUser] == 2)then
		if(msgcontains(msg,'yes'))then
			if(doPlayerRemoveItem(cid,2668,1))then
				for k,v in pairs(orcish[math.random(1,orcish.len())]) do
					npcHandler:say(k.." means "..v, cid)
					break
				end
			else
				npcHandler:say("You don't have any salmon!", cid)
			end
		else
			npcHandler:say("Ok, then I won't tell you another Orcish word.",cid)
		end	
		talkState[talkUser] = 0
	elseif(talkState[talkUser] == 3)then
		if(msgcontains(msg,'yes'))then
			if(doPlayerRemoveItem(cid,1972,1))then
				npcHandler:say("thank you.", cid)				
			else
				npcHandler:say("Mhm, whatever you have there, it is not my notebook.", cid)
			end
		else
			npcHandler:say("Too bad.",cid)
		end	
		talkState[talkUser] = 0
	elseif(talkState[talkUser] == 4)then
		if(msgcontains(msg,'yes'))then
			npcHandler:say("Alright then, if you bring me 100 pieces of fine minotaur leather I will see what I can do for you. You probably have to kill really many minotaurs though... so good luck!", cid)				
		else
			npcHandler:say("Ok.",cid)
		end	
		talkState[talkUser] = 0
	elseif(talkState[talkUser] == 5)then
		if(msgcontains(msg,'yes'))then
			if(doPlayerRemoveItem(cid,5878,100))then
				npcHandler:say("Great! Alright, I need a while to finish this backpack for you. Come ask me later, okay?.", cid)	
				setPlayerStorageValue(cid, 91361,os.time()+(60*60*2))
			else
				npcHandler:say("I need 100 minotaur leather.", cid)
			end
		else
			npcHandler:say("Too bad.",cid)
		end	
		talkState[talkUser] = 0
	elseif not(foodSayString(msg))then
		npcHandler:say('sorry but I do not know what they wanted.', cid)
	end
	return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

Editado por Poccnn
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...