• 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 to npc help

Slepy

New Member
Joined
May 14, 2009
Messages
111
Reaction score
1
stigma 8.5
Hello all i must please for help
Edit ALL THIS QUEST PLAYER CAN TAKE ONE TIME
who can make npc:

1 hi, 1 mission, npc says: you must..., yes then
2 player must go to other npc and say him hi,mission,yes then
3 npc give him 50 exp then
4 and npc say wanna next mission? then
5 player say 2 mission then
6 npc is give him new mission he must give npc 10 wolf paw then
7 npc give him 3000 exp
please help me
 
resresh
1 hi, mission npc: musisz..., tak wtedy
2 player musi isc do innego npc i napisac hi,mission,tak then
3 npc daje mu 50 gp wtedy
4 npc pisze nastepna misje?
5 player pisze mission wtedy
6 npc daje nowa misje przyniesienie 10 wolf paw
7 npc daje my 3000 gp
 
XML:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Henrick" script="qgiverhenrick.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="338" head="17" body="54" legs="114" feet="0" addons="2"/>
	<parameters>
		<parameter key="message_greet" value="Hello |PLAYERNAME|, you want to do a {mission}?"/>
	</parameters>
</npc>
XML:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Eric" script="qgivereric.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="338" head="17" body="54" legs="114" feet="0" addons="2"/>
	<parameters>
		<parameter key="message_greet" value="Hello |PLAYERNAME|, do you want {information} about a quest?"/>
	</parameters>
</npc>

qgiverhenrick:
Lua:
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 storage = 89906
local storageeric = 89907
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid 

    if(msgcontains(msg, 'mission')) then
		if getPlayerStorageValue(cid, storage) == -1 then
				selfSay('You must go to Eric and speak to him. Accept the quest?', cid)
				talkState[talkUser] = 1 
        elseif (getPlayerStorageValue(cid, storage) == 2) then 
                selfSay('I see that you have\'nt got the informations from Eric, go to eric for more mission information.', cid) 
                talkState[talkUser] = 1
        elseif (getPlayerStorageValue(cid, storage) == 3) then 
                selfSay('I don\'t have any missions for you.', cid) 
                talkState[talkUser] = 1 
        end
        --------------------------------------- 
        elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1 and getPlayerStorageValue(cid,storage) == -1) then 
			selfSay('Great! Go and get informations from Eric.', cid) 
			doPlayerAddMoney(cid, 50)
			setPlayerStorageValue(cid, storage,2)
			setPlayerStorageValue(cid, storageeric, 1)
            talkState[talkUser] = 0 
        --------------------------------------- 
	end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) 
npcHandler:addModule(FocusModule:new())

qgivereric:
Lua:
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 storage = 89907
local storagehenrick = 89906
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid 

    if(msgcontains(msg, 'information')) then
		if getPlayerStorageValue(cid, storage) == 1 then
				selfSay('Oh, I see that you are one of Henricks buddy. Bring me {10 wolf paws}... Could you do that?', cid)
				talkState[talkUser] = 1 
		elseif getPlayerStorageValue(cid, storage) == 2 then
				selfSay('You\'ve helped me enought. Thanks.', cid)
				talkState[talkUser] = 1 
		elseif getPlayerStorageValue(cid, storage) == 4 then
				selfSay('You have my 10 wolf paws?', cid)
				talkState[talkUser] = 1
			else
				selfSay('Speak to Henrick for more information about the quest.', cid)
	end
        --------------------------------------- 
        elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1 and getPlayerStorageValue(cid,storage) == 1) then 
			selfSay('Great! Go get them now.', cid) 
			setPlayerStorageValue(cid, storage,4)
            talkState[talkUser] = 0
        elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1 and getPlayerStorageValue(cid,storage) == 4) then 
			if getPlayerItemCount(cid, 5897) >= 10 then
				doPlayerRemoveItem(cid, 5897, 10)
                selfSay('Great! here are your reward. [QUEST END]', cid) 
				setPlayerStorageValue(cid, storage, 2)
				setPlayerStorageValue(cid, storagehenrick, 3) 
				doPlayerAddMoney(cid, 3000)
            talkState[talkUser] = 0
			else
				selfSay('You don\'t have my 10 wolf paws...', cid)
			end
        --------------------------------------- 
	end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) 
npcHandler:addModule(FocusModule:new())
 
Last edited:
Back
Top