ae galera do :XTibia_smile: to com um problema com um npc gym (ja devem saber pelo titulo do tópico )
é assim, o npc gym invoca um pokemon e quando acaba de matar ele nao faz nada, nao invoca o proximo(onix) nem da os premios, e se tentar duelar com ele denovo ele nao atende e manda ...,queria q ele joga-se(aceita-se o duel) até o player ganhar dele e invocar os pokemons(todos,max6),se possivel mudar para ele só dar dinheiro(20dl ta bom ;x), e invocar 6 pokemons, dps edito quais ele vai invocar, desde ja agradeço
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 getUidsInContainer(containeruid) -- By MatheusMkalo local dat = {} for i = 0, (getContainerSize(containeruid)-1) do local item = getContainerItem(containeruid, i) if isContainer(item.uid) then local items = getUidsInContainer(item.uid) for i = 0, #items do table.insert(dat, items[i]) end else table.insert(dat, item.uid) end end return dat end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end if getPlayerStorageValue(cid, 64999) == 1 then selfSay('Eu vou vencê-lo mais tarde, {!exit}.', cid) npcHandler:ResetNpc() end if msgcontains(msg:lower(), "duelo") then selfSay('Eu sou o Líder do Ginásio de Pewter, meu nome é Brock e eu uso Pokémons do tipo Pedra, você quer batalhar comigo?{sim} ou {nao}? ', cid) talk_state = 1 elseif msgcontains(msg:lower(), "sim") and talk_state == 1 then if getPlayerStorageValue(cid,987876) ~= 1 then if getPlayerStorageValue(cid,574225) ~= 1 then selfSay('Preparesse, vai, Geodude', cid) doCreateMonster("Geodude", getCreaturePosition(getNpcId())) doSendMagicEffect(getCreaturePosition(getNpcId()) , 10) setPlayerStorageValue(cid, 574225, 1) else selfSay('...', cid) end else if getPlayerStorageValue(cid, 987877) ~= 1 and getPlayerStorageValue(cid,574225) == 1 then if getPlayerStorageValue(cid,574226) ~= 1 then selfSay('Go, Onix', cid) doCreateMonster("Onix", getCreaturePosition(getNpcId())) doSendMagicEffect(getCreaturePosition(getNpcId()) , 10) talk_state = 2 setPlayerStorageValue(cid, 574226, 1) else selfSay('...', cid) end else if getPlayerStorageValue(cid, 63768) ~= 1 and getPlayerStorageValue(cid,574226) == 1 and getPlayerStorageValue(cid,987877) == 1 then selfSay('Parabéns, você me venceu com seu carisma e estilo. Aqui está sua recompensa...', cid) doTransformItem(getUidsInContainer(getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid)[7], 2555) doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Você ganhou do Líder de Ginásio de Pewter (Brock), você ganhou a Boulder Badge!") setPlayerStorageValue(cid, 63768, 1) else selfSay('Você conseguiu... me venceu.', cid) end end end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
conclusao:
1ºinvocar 6 pokemons
2ºduelar contra o player até ele ganhar, dps nao duelar mais
3ºdar 20dl para o player.
4ºsomentes jogadores do lvl 100 mais podem duelar, lvls 99- o npc pode falar, vc é muito fraco |PLAYERNAME|!.
5ºse possivel nao deixar dead
6º :weight_lift: