• 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 quest >Help

Elexonic

Well-Known Member
Joined
Jun 18, 2008
Messages
1,920
Reaction score
59
What I need is an npc for a mission .. and when you complete a prize you more experience and can use only one you see therefore that of a storage ..
What I want to say is

Player - Hi
Npc - Hello blabla help me?
player - mission or yes
npc - Ok you need to get me through blah blah ..

when you bring me the item to npc
hi
mission
the npc I remove the item and give me my other items (2160) and 300 experience



.------------------

And the other training npc sword that you upload a prize.
hi
mission
.
if you have sword 50, the award will>> (2160 x 5)
if you have sword 70, the award will>> (2160 x 10)
if you have sword 90, the award will>> (2160 x 15)
sword if you have 100, give you award>> (2160 x 20)

I hope someone knows how to do
thanks
 
Last edited:
first one
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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
		return false
	end
	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	if msgcontains(msg, 'mission') or msgcontains(msg, 'yes') and getPlayerItemCount(cid, xxxx) >= 1 then
		doPlayerRemoveItem(cid, xxxx, 1)
		doPlayerAddItem(cid, zzzz, 1)
		doPlayerAddExp(cid, 300)
		npcHandler:say('Thank you.', cid)
	else
		npcHandler:say('Bring me bla bla bla.', cid)
	end
	return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
I have to add in npc?
I put another NPC who had but I get errors: S

What happens is that you say
hi
mission
but always gives you the reward and experience but do not remove the item: S

Can you tell me that I put in NPC?
can you add to a storage value and Asin will give me the item only once oO
Thanks for answering:)
 
should work
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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
		return false
	end
	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	if msgcontains(msg, 'mission') or msgcontains(msg, 'yes') then if
		getPlayerStorageValue(cid, 13565) == -1 and
		doPlayerRemoveItem(cid, xxxx, 1) then
		doPlayerAddExp(cid, 300)
		doPlayerAddItem(cid, yyyy, 1)
		setPlayerStorageValue(cid, 13565, 1)
		npcHandler:say('Thank you.', cid)
	else
		if getPlayerStorageValue(cid, 13565) == 1 then
		npcHandler:say('You already recieved your reward.', cid)
	else
		npcHandler:say('Bring me bla bla bla', cid)
	end
	return true
end
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Last edited:
Back
Top Bottom