Ir para conteúdo

Featured Replies

  • Respostas 15
  • Visualizações 1.6k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Postado
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

if msgcontains(msg, 'present') and getPlayerVocation(cid) == 1 and

getPlayerStorageValue(cid, 21718) < 1 then

setPlayerStorageValue(cid, 21718, 1)

doPlayerAddItem(cid,2160,1)

selfSay("Pegue este item.", cid)

if msgcontains(msg, 'present') and getPlayerVocation(cid) == 2 and

getPlayerStorageValue(cid, 21718) < 1 then

setPlayerStorageValue(cid, 21718, 1)

doPlayerAddItem(cid,2160,1)

selfSay("Pegue este item.", cid)

if msgcontains(msg, 'present') and getPlayerVocation(cid) == 3 and

getPlayerStorageValue(cid, 21718) < 1 then

setPlayerStorageValue(cid, 21718, 1)

doPlayerAddItem(cid,2160,1)

selfSay("Pegue este item.", cid)

if msgcontains(msg, 'present') and getPlayerVocation(cid) == 4 and

getPlayerStorageValue(cid, 21718) < 1 then

setPlayerStorageValue(cid, 21718, 1)

doPlayerAddItem(cid,2160,1)

selfSay("Pegue este item.", cid)

end

end

end

end

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

Testa ai.

Onde ta verde vc poe ID do item.

Vermelho o ID da vocaçao

Postado
  • Autor

@roriscrave não funcionou, veja se meu npc esta certo. o Arquivo LUA esta!

<?xml version="1.0" encoding="UTF-8"?>

<npc name="Santa Claus" script="data/npc/scripts/present.lua" floorchange="0" access="5" level="1" maglevel="1">

<health now="150" max="150"/>

<look type="152" head="0" body="113" legs="113" feet="0" addons="2"/>

<parameters>

<parameter key="module_shop" value="1" />

<parameter key="message_greet" value="Hello |PLAYERNAME|. Bem Vindo ao Server tenha um ótimo Natal, diga Hi e depois Present e Yes" />

</parameters>

</npc>

Não da nenhum erro, mais quando fala "Present" e "Yes" ele não entrega o item.

Editado por jNo (veja o histórico de edições)

(1º) | [8.60] - Galaxy Server - Download

(2º) | [8.60] - Glorious Server - Download

(3º) | [8.60] - Epic Server - Download

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.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo