• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Quest npc

Status
Not open for further replies.

beatshif

chojrak doSzkoly
Joined
Oct 3, 2009
Messages
144
Reaction score
0
A więc tak mam mały problem, mógłby mi ktoś wytłumaczyć lub zaznaczyć w tym skrypcie LUA bo nie mogę za "huja" znaleźć
linijki z przedmiotem który trzeba zdobyć, widzę tylko rewards (nagrody które się otrzymuje po zaliczeniu questa)

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)
	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	--[[
	REMEMBER TO SET YOUR STORAGE AS YOURSTORAGE!
	]]--
	local storage = 50001
	if(msgcontains(msg, 'quest') or msgcontains(msg, 'halberd')) then
		if(getPlayerStorageValue(cid, storage) < 1) then
			npcHandler:say("Hey, dear friend. I have found the dusty {Halberd}?", cid)
			setPlayerStorageValue(cid, storage, 1)
			setPlayerStorageValue(cid, 50000, 2)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Quest Completed: Halberd Quest")
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "New Quest: Len\'s Favor")
			doPlayerAddExp(cid, 200)
			doPlayerAddItem(cid, 2152, 35)
			doPlayerAddItem(cid, 2457, 1)
		elseif(getPlayerStorageValue(cid, storage) == 1) then
			npcHandler:say("Do you have the Halberd??", cid)
			talkState[talkUser] = 1
		elseif(getPlayerStorageValue(cid, storage) == 2) then
			npcHandler:say("What are you doing? You\'ve finished the favor.", cid)
		end
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
		if(doPlayerRemoveMoney(cid, 100000) == TRUE) then
			npcHandler:say("Thanks, sometimes I think I\'m too lazy but who gives a damn. Anyway, here is your reward! By the way, you might want to consider heading over to the merchants to the north and south to see what they have.", cid)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Quest Completed: Len\'s Favor")
			doPlayerAddExp(cid, 250)
			doPlayerAddItem(cid, 2152, 2)
			setPlayerStorageValue(cid, storage, 2)
			talkState[talkUser] = 0
		else
			npcHandler:say("It seems you don\'t have enough legs gathered.", cid)
			talkState[talkUser] = 0
		end
	elseif(msgcontains(msg, 'no') and talkState[talkUser] > 0) then
		npcHandler:say("Oh well then.", cid)
		talkState[talkUser] = 0
	end
	return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Za jakościową pomoc należy się rep ++ :peace:
 
Tak, tylko nie wiem co zrobić żeby zamiast kasy był np halberd.
 
Code:
if (doPlayerRemoveItem(cid, itemid, count) == TRUE) then
 
Code:
if(doPlayerRemoveItem(cid, itemid, count)) then


true brzydko wyglada nie sadzisz?!?!?!?!!?
 
Dzięki za pomoc, tak myślalem ale chciałem was zapytać, dostajecie reputy :)
 
Status
Not open for further replies.
Back
Top