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)
Za jakościową pomoc należy się rep ++
eace:
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 ++