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

[Request] Aruda & Towncryer

I fell asleep xD
but I guess this is Aruda?
Lua:
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

function creatureSayCallback(cid, type, msg)
    -- 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.
    if(npcHandler.focus ~= cid) then
        return false
    end

        if msgcontains(msg, 'magic sword') then
            npcHandler:say('Yes, Isn\'t that a beautiful sword?', cid)
			talk_state = 1
			elseif msgcontains(msg, 'yes') and talk_state == 1 then
				if getPlayerItemCount(cid,2148) >= 1 then
					doPlayerTakeItem(cid,2148,10)
					npcHandler:say('Oh, sorry, I was distracted, what did you say?', cid)
					talk_state = 0
					else
						npcHandler:say('Oh, I just remember I have some work to do, sorry. Bye!', cid)
						talk_state = 0
					end
				elseif msgcontains(msg, 'no') and talk_state == 1 then
					npcHandler:say('Ok Bye!', cid)
					talk_state = 0
				end
				return true
			end

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

dunno if it works do

EDIT;
here's towncryer, I think he works
Lua:
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

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

function onThink()
talk = math.random(1,100)
	if talk == 1 then
		doCreatureSay(getNpcCid(), "Hear me! Hear me! The mage Wyrdin in the Edron academy is looking for brave adventurers to undertake a task!", TALKTYPE_YELL)
	elseif talk == 50 then
		doCreatureSay(getNpcCid(), "Hear me! Hear me! The postmaster's guild has open spots for aspiring postmen! Contact Kevin Postner at the post office in the plains south of Kazordoon!", TALKTYPE_YELL)
	elseif talk == 100 then
		doCreatureSay(getNpcCid(), "Hear me! Hear me! The inquisition is looking for daring people to fight evil! Apply at the inquisition headquarters next to the Thaian jail!", TALKTYPE_YELL)
	end
	npcHandler:onThink()
end

EDIT2;
Here's Noodles, I think he works too
Lua:
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

function creatureSayCallback(cid, type, msg)
    -- 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.
    if(npcHandler.focus ~= cid) then
        return false
    end
	
	local PostmanStorage = XXXX -- change this to the storage you want for the quest
	
        if msgcontains(msg, 'sniff banana skin') then
			if getPlayerItemCount(cid,2219) >= 1 then
				npcHandler:say('<sniff><sniff>', cid)
				talk_state = 1
			elseif msgcontains(msg, 'do you like that?') and talk_state == 1 then
				npcHandler:say('Woof!', cid)
				talk_state = 1
			elseif msgcontains(msg, 'sniff dirty fur') then
				if getPlayerItemCoutn(cid,2220) >= 1 then
					npcHandler:say('<sniff><sniff>', cid)
					talk_state = 2
				elseif msgcontains(msg, 'do you like that?') and talk_state == 2 then
					npcHandler:say('Woof!', cid)
					talk_state = 2
				elseif msgcontains(msg, 'sniff moldy cheese') then
					if getPlayerItemCount(cid,2235) >= 1 then
						npcHandler:say('Woof!', cid)
						talk_state = 3
					elseif msgcontains(msg, 'do you like that?') and talk_state == 3 then
						npcHandler:say('Meeep! Grrrrr! <spits>', cid)
						setPlayerStorageValue(cid, PostmanStorage,1)
						talk_state = 3
					end
					return true
				end
			end
		end
	end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Last edited:
Towncryer, should work
Lua:
 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

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

function onThink()
talk = math.random(1,100)
        if talk == 1 then
                doCreatureSay(getNpcCid(), "Hear me! Hear me! The mage Wyrdin in the Edron academy is looking for brave adventurers to undertake a task!", TALKTYPE_YELL)
        elseif talk == 50 then
                doCreatureSay(getNpcCid(), "Hear me! Hear me! The postmaster's guild has open spots for aspiring postmen! Contact Kevin Postner at the post office in the plains south of Kazordoon!", TALKTYPE_YELL)
        elseif talk == 100 then
                doCreatureSay(getNpcCid(), "Hear me! Hear me! The inquisition is looking for daring people to fight evil! Apply at the inquisition headquarters next to the Thaian jail!", TALKTYPE_YELL)
        end
        npcHandler:onThink()
end 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
In tibia you can talk to Noodles.
I don't know how to make so they can't talk xD

EDIT; here's Noodles.xml I don't have the others :p
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Noodles" script="data/npc/scripts/thais/noodles.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="32" head="20" body="30" legs="40" feet="50" corpse="5971"/>
	<parameters>
		<parameter key="message_greet" value="sniff Woof! sniff"/>
		<parameter key="message_farewell" value="woof!"/>
	</parameters>
</npc>
 
Back
Top