STORAGE = 100010 -- Não Mecha
ITEM = 2160 -- Item a ser adicionado para completar a quest
QUANT = 100 -- Quantidade de items a ser adicionado
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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 santaNPC(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if (parameters.present == true) then
if (getPlayerStorageValue(cid, STORAGE) < 1) and getPlayerSoul(cid) >= 50 then
doPlayerAddItem(cid, ITEM, QUANT)
doPlayerAddSoul(cid,-50)
setPlayerStorageValue(cid, STORAGE, 1)
npcHandler:say('Tome seus 1kk!', cid)
else
npcHandler:say('Voce ja fez essa quest ou nao tem 50 soul.',cid)
end
end
npcHandler:resetNpc()
return true
end
npcHandler:setMessage(MESSAGE_GREET, "Olá |PLAYERNAME|. Fale {soul} para pegar a sua recompensa.")
local noNode = KeywordNode:new({'no'}, santaNPC, {present = false})
local yesNode = KeywordNode:new({'yes'}, santaNPC, {present = true})
local node = keywordHandler:addKeyword({'sou'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce tem 50 de soul?'})
node:addChildKeywordNode(yesNode)
node:addChildKeywordNode(noNode)
npcHandler:addModule(FocusModule:new())
@edit
Sim ai você pode o storage da roupa



info
Grupo: Campones
Registrado: 27/09/12
Posts: 69
Reputação: +1
ola gente queria o npc q visse quanto de Soul o player tem para lher da uma grana e uma storage..
dialogo:
Player: hi
Npc: Ola vc ja tem 50 soul?
Player: yes
Npc: ok aki esta 1kk e a roupa quem vc merece
se o player n tiver os 50 de soul..
Player: yes
Npc: vc n tem 50 de soul
valendo REP+
Editado Novembro 29 por loucodemais