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

[NPCs] How to denny default message (solved)

StormRusher

New Member
Joined
Dec 23, 2009
Messages
138
Reaction score
0
Hi

I wanna know how to denny the default greetings message of the npc, the message when you say "hi", the npc send a message in default and private(npc channel). Want only the message in private..

ah, REQUEST[2]:
i need that the npc answer questions in default too, not only in private

hope its possible, thanks
 
Last edited:
REQUEST[1]: Remove self:say(msg) from npchandler.lua:346 in function NpcHandler:greet(cid):
Code:
	-- Greets a new player.
	function NpcHandler:greet(cid)
		if(cid ~= 0) then
			local callback = self:getCallback(CALLBACK_GREET)
			if(callback == nil or callback(cid)) then
				if(self:processModuleCallback(CALLBACK_GREET, cid)) then
					local msg = self:getMessage(MESSAGE_GREET)
					local parseInfo = { [TAG_PLAYERNAME] = getCreatureName(cid) }
					msg = self:parseMessage(msg, parseInfo)

[B][COLOR="Red"]					self:say(msg)[/COLOR][/B]
					self:addFocus(cid)
					self:say(msg, cid)
				end
			end
		end
	end
REQUEST[2]: What do you mean?
 
REQUEST[2]: What do you mean?

i want that the npc "answer questions", like "trade" also in default, cause it only answer in npc channel.

example:
[Default Channel] Player: hi
[Default Channel] Player: trade
then the npc open the trade window

Normaly the npc only will open the trade window if the player say "trade" in npc channel
 
i want that the npc "answer questions", like "trade" also in default, cause it only answer in npc channel.

example:
[Default Channel] Player: hi
[Default Channel] Player: trade
then the npc open the trade window

Normaly the npc only will open the trade window if the player say "trade" in npc channel
Ohh, just as I thought D:

  • REQUEST[2]:

Replace this part in npchandler.lua (lines 376 - 408) with this:
Code:
	-- Handles onCreatureSay events. If you with to handle this yourself, please use the CALLBACK_CREATURE_SAY callback.
	function NpcHandler:onCreatureSay(cid, class, msg)
		local callback = self:getCallback(CALLBACK_CREATURE_SAY)
		if(callback == nil or callback(cid, class, msg)) then
			if(self:processModuleCallback(CALLBACK_CREATURE_SAY, cid, class, msg)) then
				if(not self:isInRange(cid)) then
					return
				end

				if(self.keywordHandler ~= nil) then
					local ret = self.keywordHandler:processMessage(cid, msg)
					if(not ret) then
						local callback = self:getCallback(CALLBACK_MESSAGE_DEFAULT)
						if(callback ~= nil and callback(cid, class, msg)) then
							if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then
								self.talkStart[cid] = os.time()
							else
								self.talkStart = os.time()
							end
						end
					else
						if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then
							self.talkStart[cid] = os.time()
						else
							self.talkStart = os.time()
						end
					end
				end
			end
		end
	end
 
firs one is damn old bug in npcsystem, and second is cip-made bug, I managed to fix first, but for second you deserved for rep
but ofc this rep system dont think so -.-
 
Back
Top