Postado Janeiro 14, 2018 7 anos Quero uma quest que o player tenha que chegar a tal lugar, mas pra ele ter acesso a esse lugar ele tem que clikar em 8 corpos que estão espalhados por uma ilha. ID DO CORPO: 3058
Postado Janeiro 15, 2018 7 anos @WorkedBox Em actions/scripts crie um arquivo.lua: Mostrar conteúdo oculto local t = { -- coloque aqui as posições dos corpos [1] = {x = 1, y = 1, z = 1}, [2] = {x = 1, y = 1, z = 1}, [3] = {x = 1, y = 1, z = 1}, [4] = {x = 1, y = 1, z = 1}, [5] = {x = 1, y = 1, z = 1}, [6] = {x = 1, y = 1, z = 1}, [7] = {x = 1, y = 1, z = 1}, [8] = {x = 1, y = 1, z = 1} } local storage_to_enter = 87431 -- storage que o player receberá após encontrar todos os corpos function onUse(cid, item, fromPosition, itemEx, toPosition) local placeid, p = getPlaceId(toPosition), getPlayerPosition(cid) if getPlayerStorageValue(cid, storage_to_enter) ~= -1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have already found all the mysterious corpses.") doSendMagicEffect(p, CONST_ME_POFF) return true end if not isInArrayStorage(cid, 87430, placeid) then doCreatureSay(cid, "You have found something mysterious inside this corpse!", TALKTYPE_MONSTER) doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED) setPlayerArrayStorage(cid, 87430, placeid) local tab = string.explode(getPlayerStorageValue(cid, 87430):gsub("'",""), ",") if #tab == #t then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have found the mysterious corpses, now you are allowed to enter in Kazordoon.") doSendMagicEffect(p, CONST_ME_MAGIC_GREEN) setPlayerStorageValue(cid, storage_to_enter, 1) end else doCreatureSay(cid, "Nothing special was found.", TALKTYPE_MONSTER) doSendMagicEffect(toPosition, CONST_ME_POFF) end return true end function setPlayerArrayStorage(cid, storage, value) local array = getPlayerStorageValue(cid, storage) ~= -1 and getPlayerStorageValue(cid, storage) or "" local newstring = array..(array:len() ~= 0 and "," or "").."'"..value.."'" setPlayerStorageValue(cid, storage, tostring(newstring)) end function isInArrayStorage(cid, storage, value) local array = getPlayerStorageValue(cid, storage) ~= -1 and getPlayerStorageValue(cid, storage) or "" if isInArray(string.explode(array:gsub("'",""), ","), tostring(value)) then return true end return false end function getPlaceId(positionEx) for id, pos in pairs(t) do if doComparePositions(pos, positionEx) then return id end end end No actions.xml, adicione a tag: <action actionid="ACTION_ID_DOS_CORPOS" script="NOMEDOARQUIVO.lua" /> Depois, é só colocar para verificar o storage do player, por exemplo, em um piso, em uma porta ou um NPC (tais scripts você encontra aqui no fórum) que dá acesso ao local desejado. No exemplo, coloquei o storage 87431, mas você pode alterar caso queira. Contato: Email: dwarfer@sapo.pt Discord: Dwarfer#2715
Postado Junho 6, 2018 6 anos Autor OI, desculpa ta revivendo, mas fui ver a resposta hoje Cara, se puder ajudar ainda... não funcionou aqui não. no actions coloquei assim <action actionid="3058" script="questcorpo.lua" /> no script só coloquei as pos, mas n acontece nada quando clico nos corpos
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.