Ir para conteúdo

Featured Replies

  • Respostas 9
  • Visualizações 1.4k
  • Created
  • Última resposta

Top Posters In This Topic

Postado

@Zazeros  Acho que é isso.

 

NPC Lumper Men

 

<?xml version="1.0"?>
<npc name="Lumper Men" script="data/npc/scripts/lumptroca.lua" access="3" lookdir="2" walkinterval="2000">
   <mana now="800" max="800"/>
   <health now="200" max="200"/>
<look type="99" head="115" body="76" legs="35" feet="117" addons="1" corpse="6080"/>
<parameters>
 <parameter key="message_greet" value="Olá |PLAYERNAME|, tenho uma quest pra voce que voce tem que entregar 20 lump of dirty kk {entregar}"/>
   </parameters>
</npc>

Script lumptroca.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 talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid

if(msgcontains(msg, 'lump of dirty') or msgcontains(msg, 'entregar')) then
selfSay('Deseja entregar ? {sim}', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'sim') and talkState[talkUser] == 1) then
if(getPlayerItemCount(cid, Y) >= 20) then -- Y = ID ITEM LUMP OF DITY, QUANTIDADE NECESSARIA
doPlayerRemoveItem(cid, Y, 20)  -- Y = ID ITEM LUMP OF DIRTY, QUANTIDADE REMOVIDA
doPlayerAddItem(cid, 2160, 1) -- Dinheiro Recompensa
doPlayerAddExp(cid, 500000) -- Exp Recompensa
setPlayerStorageValue(cid,X,1) -- X = Storage que ganha
selfSay('Obrigado, aqui esta sua recompensa.', cid)
else
selfSay('Voce nao tem Lump Of Dirty suficiene, va derrotar rotworms e somente retorne com a quantidade necessaria.', cid)
end
talkState[talkUser] = 0


end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

Postado

@Zazeros 

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, 'lump of dirty') or msgcontains(msg, 'entregar')) then
selfSay('Deseja entregar ? {sim}', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'sim') and talkState[talkUser] == 1) then
if(getPlayerItemCount(cid, Y) >= 20) and getPlayerStorageValue(cid, 858520) < 1 then -- Y = ID ITEM LUMP OF DITY, QUANTIDADE NECESSARIA
doPlayerRemoveItem(cid, Y, 20)  -- Y = ID ITEM LUMP OF DIRTY, QUANTIDADE REMOVIDA
doPlayerAddItem(cid, 2160, 1) -- Dinheiro Recompensa
doPlayerAddExp(cid, 500000) -- Exp Recompensa
setPlayerStorageValue(cid,858520,1) -- X = Storage que ganha
selfSay('Obrigado, aqui esta sua recompensa.', cid)
else
selfSay('Voce nao tem Lump Of Dirty suficiene ou ja completou essa missao.', cid)
end
talkState[talkUser] = 0


end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo