• 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 Aruda (Solved)

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,857
Reaction score
96
Location
Brazil
I was trying to make NPC Aruda, it's not easy to make(to me :(). Can someone post here the script of it?

Warning: Be careful! If Aruda is close by (within 4 squares) of an NPC and you say hi, she will still steal your gold!



And Noodles.
 
Last edited:
well, you're lucky today
LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local Topic, Price = {}, {}

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)
	if getPlayerSex(cid) == 0 then
		npcHandler:setMessage(MESSAGE_GREET, "Oh, hello |PLAYERNAME|, your hair looks great! Who did it for you?")
		Topic[cid] = 1
	else
		npcHandler:setMessage(MESSAGE_GREET, "Oh, hello, handsome! It's a pleasure to meet you |PLAYERNAME|.")
		Topic[cid] = nil
	end
	Price[cid] = nil
	return true
end

function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	elseif Topic[cid] == 1 then
		npcHandler:say("I would never have guessed that.", cid)
		Topic[cid] = nil
	elseif Topic[cid] == 2 then
		if doPlayerRemoveMoney(cid, Price[cid]) then
			npcHandler:say("Oh, sorry, I was distracted, what did you say?", cid)
		else
			npcHandler:say("Oh, I just remember I have some work to do, sorry. Bye!", cid)
			npcHandler:releaseFocus(cid)
		end
		Topic[cid] = nil
		Price[cid] = nil
	elseif Topic[cid] == 3 and doPlayerRemoveItem(cid, 2036, 1) then
		npcHandler:say("Take some time to talk to me!", cid)
		Topic[cid] = nil
	elseif Topic[cid] == 4 and (msgcontains(msg, "spouse") or msgcontains(msg, "girlfriend")) then
		npcHandler:say("Well ... I  might have known him a little .. but there was nothing serious.", cid)
		Topic[cid] = 5
	elseif Topic[cid] == 5 and msgcontains(msg, "fruit") then
		npcHandler:say("I remember that grapes were his favourites. He was almost addicted to them.", cid)
		Topic[cid] = nil
	elseif msgcontains(msg, "how") and msgcontains(msg, "are") and msgcontains(msg, "you") then
		npcHandler:say("Thank you very much. How kind of you to care about me. I am fine, thank you.", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "sell") then
		npcHandler:say("Sorry, I have nothing to sell.", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "job") then
		npcHandler:say("I do some work now and then. Nothing unusual, though.", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "news") then
		npcHandler:say("You should ask Oswald about news. He loves them.", cid)
	elseif msgcontains(msg, "name") then
		if getPlayerSex(cid) == 0 then
			npcHandler:say("I am Aruda.", cid)
		else
			npcHandler:say("I am a little sad, that you seem to have forgotten me, handsome. I am Aruda.", cid)
		end
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "aruda") then
		if getPlayerSex(cid) == 0 then
			npcHandler:say("Yes, that's me!", cid)
		else
			npcHandler:say("Oh, I like it, how you say my name.", cid)
		end
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "time") then
		npcHandler:say("Please don't be so rude to look for the time if you are talking to me.", cid)
		Topic[cid] = 3
	elseif msgcontains(msg, "help") then
		npcHandler:say("I am deeply sorry, I can't help you.", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "monster") or msgcontains(msg, "dungeon") then
		npcHandler:say("UH! What a terrifying topic. Please let us speak about something more pleasant, I am a weak and small woman after all.", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "sewer") then
		npcHandler:say("What gives you the impression, I am the kind of women, you find in sewers?", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "god") then
		npcHandler:say("You should ask about that in one of the temples.", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "king") then
		npcHandler:say("The king, that lives in this fascinating castle? I think he does look kind of cute in his luxurious robes, doesn't he?", cid)
		Topic[cid] = 2
		Price[cid] = 10
	elseif msgcontains(msg, "sam") then
		if getPlayerSex(cid) == 0 then
			npcHandler:say("He is soooo strong! What muscles! What a body! Did you ask him for a date?", cid)
		else
			npcHandler:say("He is soooo strong! What muscles! What a body! On the other hand, compared to you he looks quite puny.", cid)
		end
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "benjamin") then
		npcHandler:say("He is a little simple minded but always nice and well dressed.", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "gorn") then
		npcHandler:say("He should really sell some stylish gowns or something like that. We Tibians never get some clothing of the latest fashion. It's a shame.", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "quentin") then
		npcHandler:say("I don't understand this lonely monks. I love company too much to become one. He, he, he!", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "bozo") then
		npcHandler:say("Oh, isn't he funny? I could listen to him the whole day.", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "oswald") then
		npcHandler:say("As far as I know, he is working in the castle.", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "rumour") or msgcontains(msg, "rumor") or msgcontains(msg, "gossip") then
		npcHandler:say("I am a little shy and so don't hear many rumors.", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "fuck") then
		if getPlayerSex(cid) == 0 then
			npcHandler:say("Uhm, let us change the subject, please.", cid)
		else
			npcHandler:say("Oh, you little devil, stop talking like that! <blush>", cid)
		end
		Topic[cid] = 2
		Price[cid] = 20
	elseif msgcontains(msg, "kiss") and getPlayerSex(cid) == 1 then
		npcHandler:say("Oh, you little devil, stop talking like that! <blush>", cid)
		Topic[cid] = 2
		Price[cid] = 20
	elseif msgcontains(msg, "weapon") then
		npcHandler:say("I know so little about weapons, so tell me something about weapons, please.", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "magic") then
		npcHandler:say("I believe that love is stronger then all magic, don't you agree?", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "thief") or msgcontains(msg, "theft") then
		npcHandler:say("Oh, sorry, I have to hurry, bye!", cid)
		Topic[cid] = nil
		Price[cid] = nil
		npcHandler:releaseFocus(cid)
	elseif msgcontains(msg, "tibia") then
		npcHandler:say("I would like to visit the beach more often, but I guess it's too dangerous.", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "castle") then
		npcHandler:say("I love this castle! It's so beautiful.", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "muriel") then
		npcHandler:say("Powerful sorcerers frighten me a little.", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "elane") then
		npcHandler:say("I personally think it's inappropriate for a woman to become a warrior, what do you think about that?", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "marvik") then
		npcHandler:say("Druids seldom visit a town, what do you know about druids?", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "gregor") then
		npcHandler:say("I like brave fighters like him.", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "noodles") then
		npcHandler:say("Oh, he is sooooo cute!", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "dog") or msgcontains(msg, "poodle") then
		npcHandler:say("I like dogs, the little ones at least. Do you like dogs, too?", cid)
		Topic[cid] = 2
		Price[cid] = 5
	elseif msgcontains(msg, "excalibug") then
		npcHandler:say("Oh, I am just a girl and know nothing about magic swords and such things.", cid)
		Topic[cid] = 2
		Price[cid] = 10
	elseif msgcontains(msg, "partos") then
		npcHandler:say("I ... don't know someone named like that.", cid)
		Topic[cid] = 4
		Price[cid] = nil
	elseif msgcontains(msg, "yenny") then
		npcHandler:say("Yenny? I know no Yenny, nor have I ever used that name! You have mistook me with someone else.", cid)
		Topic[cid] = nil
		Price[cid] = nil
		npcHandler:releaseFocus(cid)
	end
	return true
end

npcHandler:setMessage(MESSAGE_WALKAWAY, "I hope to see you soon.")
npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye. I really hope we'll talk again soon.")

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local Topic = {}
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)
	if not npcHandler:isFocused(cid) then
		if msgcontains(msg, "hi") or msgcontains(msg, "hello") then
			npcHandler:say("<sniff> Woof! <sniff>", cid)
			npcHandler:addFocus(cid)
		else
			npcHandler:say("Grrrr!", cid)
		end
		Topic[cid] = nil
		Type[cid] = nil
	elseif msgcontains(msg, "bye") or msgcontains(msg, "farewell") then
		npcHandler:say("Woof! <wiggle>", cid)
		npcHandler:releaseFocus(cid)
		Topic[cid] = nil
		Type[cid] = nil
	elseif (msgcontains(msg, "how") and msgcontains(msg, "are") and msgcontains(msg, "you")) or msgcontains(msg, "king") or msgcontains(msg, "tibianus") then
		npcHandler:say("Wooooof! <wiggle> <wiggle> <wiggle>", cid)
		Topic[cid] = nil
	elseif msgcontains(msg, "cat") or msgcontains(msg, "queen") or msgcontains(msg, "eloise") then
		npcHandler:say("GRRRRRRR! WOOOOOOF! WOOOOOF! WOOOOOF!", cid)
		Topic[cid] = nil
	elseif msgcontains(msg, "pork") and doPlayerRemoveItem(cid, 2666, 1) then
		npcHandler:say("Woof! Woof! <wiggle> <drool> <sniff> <gnaw>", cid)
		Topic[cid] = nil

	-- for Postman Missions Quest, Mission 6 - New Uniforms
	--[[
	elseif msgcontains(msg, "sniff") and msgcontains(msg, "banana") then
		if getCreatureStorage(cid, 233) ~= 7 then
			npcHandler:say("Woof!", cid)
			npcHandler:releaseFocus(cid)
			Topic[cid] = nil
			Type[cid] = 0
		elseif getCreatureStorage(cid, 233) == 7 and getCreatureStorage(cid, 251) == 1 then
			npcHandler:say("<sniff> <sniff>", cid)
			Topic[cid] = 2
			Type[cid] = 2219
		elseif getCreatureStorage(cid, 233) == 7 and getCreatureStorage(cid, 251) == 2 then
			npcHandler:say("<sniff> <sniff>", cid)
			Topic[cid] = 2
			Type[cid] = 2219
		elseif getCreatureStorage(cid, 233) == 7 and getCreatureStorage(cid, 251) == 3 then
			npcHandler:say("<sniff> <sniff>", cid)
			Topic[cid] = 3
			Type[cid] = 2219
		end
	elseif msgcontains(msg, "sniff") and msgcontains(msg, "fur") then
		if getCreatureStorage(cid, 233) ~= 7 then
			npcHandler:say("Woof!", cid)
			npcHandler:releaseFocus(cid)
			Topic[cid] = nil
			Type[cid] = 0
		elseif getCreatureStorage(cid, 233) == 7 and getCreatureStorage(cid, 251) == 1 then
			npcHandler:say("<sniff> <sniff>", cid)
			Topic[cid] = 2
			Type[cid] = 2220
		elseif getCreatureStorage(cid, 233) == 7 and getCreatureStorage(cid, 251) == 2 then
			npcHandler:say("<sniff> <sniff>", cid)
			Topic[cid] = 3
			Type[cid] = 2220
		elseif getCreatureStorage(cid, 233) == 7 and getCreatureStorage(cid, 251) == 3 then
			npcHandler:say("<sniff> <sniff>", cid)
			Topic[cid] = 2
			Type[cid] = 2220
		end
	elseif msgcontains(msg, "sniff") and msgcontains(msg, "cheese") then
		if getCreatureStorage(cid, 233) ~= 7 then
			npcHandler:say("Woof!", cid)
			npcHandler:releaseFocus(cid)
			Topic[cid] = nil
			Type[cid] = 0
		elseif getCreatureStorage(cid, 233) == 7 and getCreatureStorage(cid, 251) == 1 then
			npcHandler:say("<sniff> <sniff>", cid)
			Topic[cid] = 3
			Type[cid] = 2235
		elseif getCreatureStorage(cid, 233) == 7 and getCreatureStorage(cid, 251) == 2 then
			npcHandler:say("<sniff> <sniff>", cid)
			Topic[cid] = 2
			Type[cid] = 2235
		elseif getCreatureStorage(cid, 233) == 7 and getCreatureStorage(cid, 251) == 3 then
			npcHandler:say("<sniff> <sniff>", cid)
			Topic[cid] = 2
			Type[cid] = 2235
		end
	elseif Topic[cid] == 2 and (msgcontains(msg, "like") and msgcontains(msg, "that")) and getPlayerItemCount(cid, Type[cid]) ~= 0 then
		npcHandler:say("Woof!", cid)
	elseif Topic[cid] == 2 and (msgcontains(msg, "like") and msgcontains(msg, "that")) and getPlayerItemCount(cid, Type[cid]) ~= 0 then
		npcHandler:say("Meeep! Grrrrr! <spits>", cid)
		setPlayerStorageValue(cid, 233, 8)
		npcHandler:releaseFocus(cid)
		Topic[cid] = nil
	]]--

	elseif msgcontains(msg, "ferumbras") then
		npcHandler:say("Meeep! Meeep!", cid)
		npcHandler:releaseFocus(cid)
		Topic[cid] = nil
	elseif msgcontains(msg, "th") then
		npcHandler:say("<sniff>", cid)
		Topic[cid] = nil
	elseif msgcontains(msg, "ar") then
		npcHandler:say("Woof!", cid)
		Topic[cid] = nil
	elseif msgcontains(msg, "bo") then
		npcHandler:say("<wiggle>", cid)
		Topic[cid] = nil
	elseif msgcontains(msg, "an") then
		npcHandler:say("Grrrr!", cid)
		Topic[cid] = nil
	elseif msgcontains(msg, "go") then
		npcHandler:say("Woof! Woof!", cid)
		Topic[cid] = nil
	end
	return true
end

npcHandler:setMessage(MESSAGE_WALKAWAY, "Woof?? <sniff> <sniff>")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
 
Back
Top