• 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!

Need Oracle and IoD Npcs

dualshock3

New Member
Joined
May 14, 2010
Messages
89
Reaction score
3
here is my request (NPCs Request):
need Oracle: Teleports you to Island Of Destiny,Sets your town id(island of vocation id) and its needed lvl 8.
need Knight Hykrion: Sets your vocation to Knight.
need Druid Yandur: Sets your vocation to Druid
need Sorcerer Estrella: Sets your vocation to Sorcerer
need Paladin Narai: Sets your vocation to Paladin
need Raffael: Sells Basic Equipment
need Captain Kurt: Player choose his town (set town id) and (tp to city boat)
 
http://otland.net/f83/oracle-44113/#post445656

Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local Topic, Town = {}, {}

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 thinkCallback(cid)
	if math.random(300) == 1 then
		npcHandler:say("Harr! Wanna go off this island? Need me an' my ship!")
	end
	return true
end

function creatureSayCallback(cid, type, msg)
	if (msgcontains(msg, "hello") or msgcontains(msg, "hi")) and (not npcHandler:isFocused(cid)) then
		local v, k = getPlayerVocation(cid), getCreatureName(cid)
		if v == 0 then
			npcHandler:say(getPlayerSex(cid) == 0 and "Well hello there, lovely lady! Can't sail you anywhere without a {vocation}, though. Y'should talk to the four vocation {masters} first, " .. k .. "." or "How cute, a freshly hatched newcomer. Harr. Can't leave this island without a {vocation}, y'know? Y'should talk to the four vocation {masters} first, " .. k.. ".", cid)
			Topic[cid] = 0
		else
			npcHandler:say("Harrr, a new " .. getVocationInfo(v).name .. "! Can't wait to get off this lousy island and head for adventure, eh? Want me to bring ya somewhere nice, " .. k .. "?", cid)
			Topic[cid] = 1
		end
		Town[cid] = nil
		npcHandler:addFocus(cid)
	elseif(not npcHandler:isFocused(cid)) then
		return false
	elseif msgcontains(msg, "bye") or msgcontains(msg, "farewell") then
		npcHandler:say("Hrrrm. Better y'stay here for a bit, aight.", cid, TRUE)
		Topic[cid] = nil
		Town[cid] = nil
		npcHandler:releaseFocus(cid)
	elseif Topic[cid] == 1 then
		if msgcontains(msg, "yes") then
			npcHandler:say("Take a hint from old Cap'n Kurt. Make sure y'dun leave here before yer equipped well. Ya went for rob- err, shopping and got stuff like rope, armor, and weap'n?", cid)
			Topic[cid] = 2
		elseif msgcontains(msg, "no") then
			npcHandler:say("Then what'd ya want? Learn about the main Tibian cities?", cid)
			Topic[cid] = 3
		else
			npcHandler:say("Kid, one thing y'should learn. Answer with {yes} or {no} and ya'll get much farther than with random babbling.", cid)
			Topic[cid] = 1
		end
	elseif Topic[cid] == 2 then
		if msgcontains(msg, "yes") then
			npcHandler:say("Harrharr. Good answer. Wanna know somethin' about the main Tibian cities before you choose yer new home?", cid)
			Topic[cid] = 3
		elseif msgcontains(msg, "no") then
			npcHandler:say("Then prepare yourself and come back later, eh?", cid)
			npcHandler:releaseFocus(cid)
			Topic[cid] = nil
		end
	elseif Topic[cid] == 3 then
		if msgcontains(msg, "yes") then
			npcHandler:say("Aye. Wanna know about {Ab'Dendriel}, {Ankrahmun}, {Carlin}, {Darashia}, {Edron}, {Kazordoon}, {Liberty} {Bay}, {Port} {Hope}, {Svargrond}, {Thais}, {Venore} or {Yalahar}?", cid)
			Topic[cid] = 0
		elseif msgcontains(msg, "no") then
			npcHandler:say(isPremium(cid) and "So ya know it all, eh? Where'd ya want me to bring ya then, kid? {Ab'Dendriel}, {Ankrahmun}, {Carlin}, {Darashia}, {Edron}, {Liberty Bay}, {Port Hope}, {Thais} or {Venore}?" or "So ya know it all, eh? Where'd ya want me to bring ya then, kid? {Ab'Dendriel}, {Carlin}, {Thais} or {Venore}?", cid)
			Topic[cid] = 4
		end
	elseif Topic[cid] == 4 then
		if msgcontains(msg, "ab'dendriel") then
			npcHandler:say("So it's Ab'Dendriel y'wanna live in? What y'say, {yes} or {no}?", cid)
			Topic[cid] = 5
			Town[cid] = "Ab'Dendriel"
		elseif msgcontains(msg, "ankrahmun") then
			if isPremium(cid) then
				npcHandler:say("So it's Ankrahmun y'wanna live in? What y'say, {yes} or {no}?", cid)
				Topic[cid] = 5
				Town[cid] = 'Ankrahmun'
			else
				npcHandler:say("Nope, can't bring y'there without a premium account. Y'should be glad you get to travel by ship, usually a premium service, too, y'know.", cid)
				Topic[cid] = 0
			end
		elseif msgcontains(msg, "carlin") then
			npcHandler:say("So it's Carlin y'wanna live in? What y'say, {yes} or {no}?", cid)
			Topic[cid] = 5
			Town[cid] = 'Carlin'
		elseif msgcontains(msg, "darashia") then
			if isPremium(cid) then
				npcHandler:say("So it's Darashia y'wanna live in? What y'say, {yes} or {no}?", cid)
				Topic[cid] = 5
				Town[cid] = 'Darashia'
			else
				npcHandler:say("Nope, can't bring y'there without a premium account. Y'should be glad you get to travel by ship, usually a premium service, too, y'know.", cid)
				Topic[cid] = 0
			end
		elseif msgcontains(msg, "edron") then
			if isPremium(cid) then
				npcHandler:say("So it's Edron y'wanna live in? What y'say, {yes} or {no}?", cid)
				Topic[cid] = 5
				Town[cid] = 'Edron'
			else
				npcHandler:say("Nope, can't bring y'there without a premium account. Y'should be glad you get to travel by ship, usually a premium service, too, y'know.", cid)
				Topic[cid] = 0
			end
		elseif msgcontains(msg, "liberty") and msgcontains(msg, "bay") then
			if isPremium(cid) then
				npcHandler:say("So it's Liberty Bay y'wanna live in? What y'say, {yes} or {no}?", cid)
				Topic[cid] = 5
				Town[cid] = 'Liberty Bay'
			else
				npcHandler:say("Nope, can't bring y'there without a premium account. Y'should be glad you get to travel by ship, usually a premium service, too, y'know.", cid)
				Topic[cid] = 0
			end
		elseif msgcontains(msg, "port") and msgcontains(msg, "hope") then
			if isPremium(cid) then
				npcHandler:say("So it's Port Hope y'wanna live in? What y'say, {yes} or {no}?", cid)
				Topic[cid] = 5
				Town[cid] = 'Port Hope'
			else
				npcHandler:say("Nope, can't bring y'there without a premium account. Y'should be glad you get to travel by ship, usually a premium service, too, y'know.", cid)
				Topic[cid] = 0
			end
		elseif msgcontains(msg, "thais") then
			npcHandler:say("So it's Thais y'wanna live in? What y'say, {yes} or {no}?", cid)
			Topic[cid] = 5
			Town[cid] = 'Thais'
		elseif msgcontains(msg, "venore") then
			npcHandler:say("So it's Venore y'wanna live in? What y'say, {yes} or {no}?", cid)
			Topic[cid] = 5
			Town[cid] = 'Venore'
		else
			npcHandler:say("Nope, wha'ever that is, I dun sail there. ".. isPremium(cid) and "{Ab'Dendriel}, {Ankrahmun}, {Carlin}, {Darashia}, {Edron}, {Liberty Bay}, {Port Hope}, {Thais} or {Venore}" or "{Ab'Dendriel}, {Carlin}, {Thais} or {Venore}" .."?", cid)
			Topic[cid] = 5
		end
	elseif msgcontains(msg, "passage") or msgcontains(msg, "sail") or msgcontains(msg, "travel") then
		if getPlayerVocation(cid) == 0 then
			npcHandler:say("Nope, yer not going anywhere. Can't transport ya without a {vocation}, y'know?", cid)
			Topic[cid] = 0
		else
			npcHandler:say("So, y'chose your new home city? Which one's it gonna be?", cid)
			Topic[cid] = 4
		end
	elseif Topic[cid] == 5 then
		if msgcontains(msg, 'yes') then
			npcHandler:say("And off we go! If yer lost, dun forget t'talk to the guide on the ship!", cid)
			local v = getTownId(Town[cid])
			npcHandler:releaseFocus(cid)
			doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
			doTeleportThing(cid, getTownTemplePosition(v))
			doSendMagicEffect(getTownTemplePosition(v), CONST_ME_TELEPORT)
			doPlayerSetTown(cid, v)
			Topic[cid] = nil
		else
			npcHandler:say("Changed yer mind? What city d'ya wanna head to, {Ab'Dendriel}, {Ankrahmun}, {Carlin}, {Darashia}, {Edron}, {Liberty Bay}, {Port Hope}, {Thais} or {Venore}?", cid)
			Topic[cid] = 4
		end
		Town[cid] = nil
	elseif msgcontains(msg, "ab'dendriel") then
		npcHandler:say("Ab... Den... wha'ever, I never get that spelling right. Main city of the elves, lots of trees 'n stuff. Very cosy and safe I guess if yer fond of nature. I can {sail} there if ya like.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "ankrahmun") then
		npcHandler:say("Only for {premium} travellers! Desert pyramid city close to the ocean, far too hot and dry for my taste. But word is there are good hunting grounds nearby. I can {sail} there if ya like.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "carlin") then
		npcHandler:say("A city ruled by crazy amazon women! Blimey! Depends on yer taste whether ya think that's good or not. Harr. I can {sail} there if ya like.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "darashia") then
		npcHandler:say("Only for {premium} travellers! One of the two desert cities. Built around an oasis. Decent location for a newcomer. I can {sail} there if ya like.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "edron") then
		npcHandler:say("Only for {premium} travellers! Quiet little castle city on an island in the north-eastern part of Tibia. Good place for starters, really. I can {sail} there if ya like.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "kazordoon") then
		npcHandler:say("The underground dwarven city. Doesn't have a real harbour, so I can't bring ya there, y'know.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "liberty") and msgcontains(msg, "bay") then
		npcHandler:say("Only for {premium} travellers! Liberty Bay is on an island group in the South Seas. Pirates 'n stuff, y'know. Gotta be careful, but good hunting location. I can {sail} there if ya like.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "port") and msgcontains(msg, "hope") then
		npcHandler:say("Only for {premium} travellers! Port Hope is an outpost right in the middle of the jungle. Who'd want to go there?? Except for really crazy adventurers? I can {sail} there if ya like.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "svargrond") then
		npcHandler:say("Nah, can't bring ya there. Those nordic barbarians have their own rules of who they wanna let live in their city. But go there sometime, heard it's quite interesting.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "thais") then
		npcHandler:say("Old-school city. Actually the oldest main city in Tibia. Be careful on those streets, there're bandits everywhere. I can {sail} there if ya like.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "venore") then
		npcHandler:say("Harrr, one of the richest cities, filled with merchants. Dunno though why they built it over a stinking swamp. Go there if ya have a good sense of orientation. I can {sail} there if ya like.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "yalahar") then
		npcHandler:say("Now that must be one o' the biggest cities I've ever seen. Might be not cosy for a newcomer like yerself though. And I can't sail there anyway... they don't let everyone enter their fine pretty harbour, y'know.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "rookgaard") then
		npcHandler:say("Nah, y'dun wanna go back there.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "main") then
		npcHandler:say("The main continent can be dangerous. Other fellas can kill ya, y'know? So be careful! Wanna go there, ask fo' a {passage}.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "master") then
		npcHandler:say("Lemme get this right, ahum. {Estrella}, {Hykrion}, {Narai} and {Yandur}. Aye, that's it.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "estrella") then
		npcHandler:say("Scary lady. Makes me feel sorta stupid at times. Talk t'her for {sorcerer} info.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "hykrion") then
		npcHandler:say("Harr. My training partner, aye. Talk t'him for {knight} info.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "narai") then
		npcHandler:say("Harrrrrrrrrr. Nuff said. Talk t'her for {paladin} info.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "raffael") then
		npcHandler:say("A shop without rum or beer ain't a good shop. Just my opinion, man.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "kurt") then
		npcHandler:say("Hrm?", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "yandur") then
		npcHandler:say("Can be nice t'have a healer around. Talk t'him for {druid} info.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "knight") then
		npcHandler:say("Rock solid vocation. Easy t'play, hard t'master.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "sorcerer") then
		npcHandler:say("Turns out pretty powerful in the end.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "druid") then
		npcHandler:say("Decent vocation. Healing's always nice.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "paladin") then
		npcHandler:say("I prefer t'have my enemies closer to my face than those distance fighters. Harrr.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "vocation") then
		npcHandler:say("Ya must have one if ya wanna leave here. Need some power before going to the {main} continent, aye!", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "ship") then
		npcHandler:say("She's pretty, ain't she? Will bring ya almost anywhere and even fo' free. Just once though! Gotta ask fo' a {passage}.", cid)
		Topic[cid] = 0
	elseif msgcontains(msg, "premium") then
		npcHandler:say("Some regions in the world can't be accessed by everyone. Gotta pay, y'know? If y'spend some real cash fo' premium time, I can bring ya t'much cooler locations.", cid)
		Topic[cid] = 0
	end
	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:setMessage(MESSAGE_WALKAWAY, "Hrrrrm. And a good day to you, too!")
npcHandler:setCallback(CALLBACK_ONTHINK, thinkCallback)
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local Topic = {}

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 thinkCallback(cid)
	local rand = math.random(300)
	if rand == 1 then
		npcHandler:say("Are you injured? Come and get a free healing at my little hut.")
	elseif rand == 2 then
		npcHandler:say("If you like to choose a druid's way of life, talk to me.")
	elseif rand == 3 then
		npcHandler:say("Follow your instincts and let nature guide you.")
	elseif rand == 4 then
		npcHandler:say("Sometimes it's not the loudest voice which has the most valuable information to give.")
	end
	return true
end

function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		if msgcontains(msg, "hello") or msgcontains(msg, "hi") then
			local voc = getPlayerVocation(cid)
			if voc == 0 then
				npcHandler:say("Welcome to my humble hut, "..getCreatureName(cid).."! Are you interested in learning something about the druid vocation?", cid)
				Topic[cid] = 1
			elseif isDruid(cid) then
				npcHandler:say("Be greeted again, fellow druid "..getCreatureName(cid).."! If you require {information}, I will assist you.", cid)
			else
				npcHandler:say("Have a good day, "..getCreatureName(cid).."! Although you chose to be a ".. (isSorcerer(cid) and "sorcerer" or isPaladin(cid) and "paladin" or isKnight(cid) and "knight")..", you are still always welcome here. I can also {heal} you if you're injured.", cid)
				Topic[cid] = 0
			end
			npcHandler:addFocus(cid)
		else
			return false
		end
	elseif msgcontains(msg, "bye") or msgcontains(msg, "farewell") then
		npcHandler:say("Farewell "..getCreatureName(cid)..", may you always have friends in your company.", cid)
		Topic[cid] = 0
		npcHandler:releaseFocus(cid)
	elseif Topic[cid] == 1 then
		if msgcontains(msg, "yes") then
			npcHandler:say("I'm happy to hear that, dear "..getCreatureName(cid)..". I'll gladly give you some {information} or help you to become a {druid} right away. What would you prefer?", cid)
		elseif msgcontains(msg, "no") then
			npcHandler:say("That's sad, but maybe you just lack some {information} about our beautiful vocation?", cid)
		else
			npcHandler:say("I'm not quite sure if I understand you, but maybe you'd like some {information} about druids in general?", cid)
		end
		Topic[cid] = 2
	elseif Topic[cid] == 2 then
		if msgcontains(msg, "yes") or msgcontains(msg, "info") then
			npcHandler:say("Depending on how much time you have, I can either give you the {short} or the {detailed} version. Choose whatever suits you most!", cid)
			Topic[cid] = 3
		else
			npcHandler:say("No, no, you are given the choice between receiving {information} or becoming a {druid} if you've already made up your mind.", cid)
			Topic[cid] = 2
		end
	elseif Topic[cid] == 3 then
		if msgcontains(msg, "short") then
			npcHandler:say("In short: Druids are focused on ice, earth and healing magic. We use runes, spells and rods to hunt our enemies and usually try to avoid body contact. Easy, right?", cid)
			Topic[cid] = 4
		elseif msgcontains(msg, "detail") then
			npcHandler:say("That's wonderful. As a druid, your spirit is close to nature and its powers. Your aim is also to protect your friends with powerful healing magic. Can you follow me so far?", cid)
			Topic[cid] = 8
		else
			npcHandler:say("That's not an option, my impatient young student. Would you like to listen to the {short} version or to the {detailed} version of my druid lecture?", cid)
			Topic[cid] = 3
		end
	elseif Topic[cid] == 4 then
		npcHandler:say("Well, anyway "..getCreatureName(cid)..", after having learnt a few basic things about druids, do you think that vocation would be fine for you?", cid)
		Topic[cid] = 5
	elseif Topic[cid] == 5 then
		if msgcontains(msg, "yes") then
			npcHandler:say("That's good to hear, "..getCreatureName(cid)..". Since this is such an important decision, I have to ask you, though, whether you have gotten all the information that you need?", cid)
			Topic[cid] = 6
		elseif msgcontains(msg, "no") then
			npcHandler:say("Well, the other vocations have their own advantages and disadvantages. Maybe you will find something more suitable for you by talking to {Hykrion}, {Estrella} and {Narai}. Come and talk to me anytime!", cid)
			Topic[cid] = 0
		else
			npcHandler:say("<ahem> This is the point of the conversation where you answer with {'yes'} or {'no'}.", cid)
			Topic[cid] = 5
		end
	elseif Topic[cid] == 6 then
		if msgcontains(msg, "yes") then
			npcHandler:say("Be aware that this decision is final, "..getCreatureName(cid).."! Step in front of me and announce it proudly: DO YOU WANT TO BE A DRUID?", cid)
			Topic[cid] = 7
		elseif msgcontains(msg, "no") then
			npcHandler:say("Well, the other vocations have their own advantages and disadvantages. Maybe you will find something more suitable for you by talking to {Hykrion}, {Estrella} and {Narai}. Come and talk to me anytime!", cid)
			Topic[cid] = 0
		else
			npcHandler:say("That's an important question which you should answer with {'yes'} or {'no'}.", cid)
			Topic[cid] = 6
		end
	elseif Topic[cid] == 7 then
		if msgcontains(msg, "yes") then
			npcHandler:say("SO BE IT! Let the energy of nature fill you, druid "..getCreatureName(cid).."! Learn the words of your first spell: 'UTEVO LUX'! This spell will provide light to you in dark locations and hours. ...", cid)
			npcHandler:say("You may cast it by saying the magic words 'UTEVO LUX' while you have 20 mana or more. Also, you have earned the right to enter the cellar of this house. What your will find inside the chests there is yours to take. ...", cid)
			npcHandler:say("Equip yourself well and gather some experience in the caves below. You may stay there for a while, but you should leave for the main continent soon. ...", cid)
			npcHandler:say("The captain on the ship to the north will bring you to a city of your choice when you are prepared. Farewell, young druid, and don't hesitate to ask me if you have any questions.", cid)
		else
			npcHandler:say("Well, maybe you need some more time. Just make sure you choose the right vocation for you, no matter if it's the druid profession or something else. Talk to the other vocation masters, too, and take care!", cid)
		end
		Topic[cid] = nil
		npcHandler:releaseFocus(cid)
	elseif Topic[cid] == 8 then
		if msgcontains(msg, "yes") then
			npcHandler:say("Good. Don't assume that druids are weak and can't defend themselves. Our magic is as strong as that of sorcerers, just in a different way. Do you understand that so far?", cid)
			Topic[cid] = 9
		else
			npcHandler:say("Well, in short, druids use nature spells and healing magic. Can you follow me so far?", cid)
			Topic[cid] = 8
		end
	elseif Topic[cid] == 9 then
		if msgcontains(msg, "yes") then
			npcHandler:say("Good. Whereas sorcerers call forth hellfire and death itself, druids ask nature for assistance to conjure powerful ice storms and rock showers. Can you follow me so far?", cid)
			Topic[cid] = 10
		else
			npcHandler:say("To say it in easy words: Druids and sorcerers have similar powers, but different types of spells. Do you understand that so far?", cid)
			Topic[cid] = 9
		end
	elseif Topic[cid] == 10 then
		if msgcontains(msg, "yes") then
			npcHandler:say("Good. Like all mages, we do not have that much health and should be careful when fighting strong monsters, but we can easily keep our distance and deal great damage anyway. Do you understand?", cid)
			Topic[cid] = 11
		else
			npcHandler:say("I said, the difference between sorcerer and druid spells is the focus. Sorcerers use black magic and druids white magic, so to speak. Can you follow me so far?", cid)
			Topic[cid] = 10
		end
	elseif Topic[cid] == 11 then
		if msgcontains(msg, "yes") then
			npcHandler:say("Good. Last but not least, we can create runes storing magic power and enchant gems at elemental shrines to be used in weapons. Do you understand that so far?", cid)
			Topic[cid] = 12
		else
			npcHandler:say("To put this differently: Don't get hit by monsters. Rather shoot spells on them from a distance as  druids don't have a lot of hit points. Do you understand?", cid)
			Topic[cid] = 11
		end
	elseif Topic[cid] == 12 then
		if msgcontains(msg, "yes") then
			npcHandler:say("Once a druid reaches character level 20, he or she can receive a vocation promotion and become an elder druid. Did you listen to everything I told you?", cid)
			Topic[cid] = 13
		else
			npcHandler:say("Well, I just said that druids can create runes and enchant gems which are used in weapons. Do you understand that so far?", cid)
			Topic[cid] = 12
		end
	elseif Topic[cid] == 13 then
		if msgcontains(msg, "yes") then
			npcHandler:say("So, dear "..getCreatureName(cid)..", let's test your newly gained knowledge! Let me ask you: How is a promoted druid called? {Master Druid}, {Elder Druid} or {Royal Druid}?", cid)
			Topic[cid] = 14
		else
			npcHandler:say("Again, at level 20 a druid can be promoted to an elder druid. Did understand everything I told you?", cid)
			Topic[cid] = 13
		end
	elseif Topic[cid] == 14 then
		if msgcontains(msg, "master") then
			npcHandler:say("I'm sorry "..getCreatureName(cid)..", but the sorcerers are the ones which gain a 'Master' title. We druids will become 'Elder'. Another question for you: Name one of the elements which we mastered - is it {ice}, {holy} or {fire}?", cid)
			Topic[cid] = 15
		else
			npcHandler:say("This isn't an answer to my question, "..getCreatureName(cid)..". Please think again: how is a promoted druid called? {Master Druid}, {Elder Druid} or {Royal Druid}?", cid)
			Topic[cid] = 14
		end
	elseif Topic[cid] == 15 then
		if msgcontains(msg, "ice") then
			npcHandler:say("Very good "..getCreatureName(cid)..", you remembered that detail about the ice storms. Next question: Where are magically enchanted gems used? In {weapons}, as {decoration} or as {food}?", cid)
			Topic[cid] = 16
		else
			npcHandler:say("What element is this supposed to be? I know only {earth}, {fire}, {ice}, {energy}, {death} and {holy}.", cid)
			Topic[cid] = 15
		end
	elseif Topic[cid] == 16 then
		if msgcontains(msg, "weapon") then
			npcHandler:say("Right, enchanted gems add elemental damage to weapons. I have one last question for you, "..getCreatureName(cid)..". What do you think a druid will spend most of his money on - buying {runes} or buying {weapons}?", cid)
			Topic[cid] = 17
		else
			npcHandler:say("That wasn't among the allowed answers. The question was whether magical gems are used for {weapons}, as {decoration} or as {food}?", cid)
			Topic[cid] = 16
		end
	elseif Topic[cid] == 17 then
		if msgcontains(msg, "rune") then
			npcHandler:say("Right, although we need of course some basic equipment, most of our money is spent on buying new runes and mana potions. That was easy, don't you think?", cid)
			Topic[cid] = 4
		else
			npcHandler:say("Please try giving a clear answer - what does a druid spend a lot of money on, rather on {runes} or on {weapons}?", cid)
			Topic[cid] = 17
		end
	end
	return true
end

npcHandler:setMessage(MESSAGE_WALKAWAY, "Leaving without a friendly word... what a pity.")
npcHandler:setCallback(CALLBACK_ONTHINK, thinkCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
 
Last edited:
thats rlly nice cykotitan, really full
but i just need this
Player: hi
Druid Yandur: Hello player, Do you want to become a Druid?
Player: yes
Druid Yandur: Say it Proudly "Yes, I Want to Become a Druid!"
Player: Druid
Druid Yandur: Congratulations now you are Druid, Go to the dungeon and take your items and hunt.

and i edit to rest of voactions

Thanks in Advance
 
Last edited:
Cykotitan or anyone tell me if these scripts are right.
Druid Yandur.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Druid Yandur" script="data/npc/scripts/ioddruid.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="144" head="115" body="115" legs="132" feet="115" addons="3"/>
    	<parameters>
		<parameter key="message_greet" value="Hi |PLAYERNAME|. are you interested in druid vocation?."/>
	</parameters>
</npc>

ioddruid.lua
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

item = 'You do not have the required Level.'
done = 'Congratulations now you are Druid, Go to the dungeon and take your items and hunt.'

function creatureSayCallback(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then
		return false
	end
	
		if msgcontains(msg, 'yes') then
		selfSay('Do you Want to become a Druid?', cid)

			elseif msgcontains(msg, 'yes') then
			if(getPlayerLevel(cid) < 8) then
				selfSay('Say it Proudly: Yes, I Want to Become a Druid!', cid)
				talk_state = 1
			else
				selfSay('You do not have the required Level.', cid)
				talk_state = 0
			end

			elseif msgcontains(msg, 'druid') and talk_state == 1 then
			talk_state = 0
			if(getPlayerLevel(cid) < 8) == TRUE then
							selfSay(done, cid)
			doPlayerSetVocation(cid, druid)
			end
			else
				selfSay(item, cid)
			end

        elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
            selfSay('Ok than.')
            talk_state = 0
        end

    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Back
Top