Refiz o script pois estava mt bagunçado..
XML
<?xml version="1.0" encoding="UTF-8"?><npc name="NPC_NAME" script="LUA_NAME" walkinterval="350000" floorchange="0" speed="0" lookdir="2"> <health now="150" max="150"/> <look type="640" head="91" body="114" legs="86" feet="0"/> <parameters> <parameter key="message_greet" value="Olá |PLAYERNAME|. Existe um pokemon muito raro chamado Aerodactyl esse pokemon apos sua morte ele se cristaliza em um fossil chamado Old Amber essa pedra refinada se transforma em um Egg Aerodactyl se voce tem esse fossil diga {quest}"/> </parameters></npc>
LUA
local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)local talkState = {}function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endSTORAGE = 10018 -- Não MechaOLD = 12581 -- Item a ser removido para completar a questDQUANT = 1 -- Quantidade de items a ser removidoEGG = 17121 -- Item a ser adicionado para completar a questUNIT = 1 -- Quantidade de items a ser adicionadofunction creatureSayCallback(cid, type, msg)if(not npcHandler:isFocused(cid)) thenreturn falseendlocal talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(string.lower(msg), 'quest') then selfSay("Preciso da Old Amber para ti entregar o Aerodactyl Egg, voce a trouxe ? se sim Diga {yes}...", cid) talkState[talkUser] = 1 elseif (msgcontains(string.lower(msg), 'yes') or msgcontains(string.lower(msg), 'sim')) and talkState[talkUser] == 1 then if (getPlayerStorageValue(cid, STORAGE) < 1 and getPlayerItemCount(cid, OLD) >= 1) then doPlayerRemoveItem(cid,OLD,DQUANT) doPlayerAddItem(cid,EGG,UNIT) setPlayerStorageValue(cid, STORAGE, 1) selfSay("Pronto agora va falar com o Prof. Marlon e entregar o Aerodactyl Egg...", cid) talkState[talkUser] = 0 elseif (getPlayerStorageValue(cid, STORAGE) < 1 and getPlayerItemCount(cid, OLD) < 1) then selfSay("Voce nao possui Old Amber...", cid) return true else selfSay("Voce ja completou a quest Aerodactyl Egg...", cid) return true end endreturn trueendnpcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new())
Não esqueça de mudar o look type e talz...






info
Grupo: Campones
Registrado: 13/07/15
Posts: 77
Reputação: +2
Olá boa noite estou criando um script de quest porem estou com um problema quando o player pega a quest ele nao retira o item ex: se o player esta com o item para ser retira ele retira e entrega nessa função
queria saber como faço para colocar uma verificação no doPlayerRemoveItem(cid,OLD,DQUANT) para quando o player falar com o npc ele dizer que não tem o item (x) e assim só adicionar o outro item (y) para o player se ele tiver o item (x)
id item x = 12581
id do item y = 17121
Espero que algum me ajude