Postado Fevereiro 14, 2019 6 anos Galera, estou com um script que faz um efeito x se determinado item dropar do monstro, porém o effect está saindo ao lado esquerdo do meu pokémon, onde deveria sair em cima do corpse, alguém poderia me ajuda? Mostrar conteúdo oculto local stone_effects = { --[itemid] = effect, --Ex.: [11447] = 297, [11442] = 298, } local function sendEffStone(cid, pos, stones) if not isCreature(cid) then return true end for i = 1, 255 do pos.stackpos = i local item = getTileThingByPos(pos) if item.uid ~= 0 then if isContainer(item.uid) then if isContainer(item.uid) and getContainerSize(item.uid) > 0 then for slot=0, (getContainerSize(item.uid)-1) do local stone = getContainerItem(item.uid, slot) if isInArray(stones, stone.itemid) and stone_effects[stone.itemid] then doSendMagicEffect(getThingPos(cid), stone_effects[stone.itemid]) end end end end end end end function onKill(cid, target) local stones = {11453, 11441, 11442, 11443, 11444, 11445, 11446, 11447, 11448, 11449, 11450, 11451, 11452, 11454, 12244, 12232, 12242, 12417, 12419, 12245, 12401, 12402, 12403, 12404, 12405, 12406, 12407, 12408, 12409, 12410, 12411, 12412, 12413, 12414} --id de todas as stones if ehMonstro(target) and isPlayer(cid) then local pos = getThingPos(target) local pid = getCreatureSummons(cid)[1] addEvent(sendEffStone, 150, pid, pos, stones) end return true end @Dwarfer @Storm
Postado Fevereiro 14, 2019 6 anos local stone_effects = { --[itemid] = effect, --Ex.: [11447] = 297, [11442] = 298, } local function sendEffStone(cid, pos, stones) if not isCreature(cid) then return true end for i = 1, 255 do pos.stackpos = i local item = getTileThingByPos(pos) if item.uid ~= 0 then if isContainer(item.uid) then if isContainer(item.uid) and getContainerSize(item.uid) > 0 then for slot=0, (getContainerSize(item.uid)-1) do local stone = getContainerItem(item.uid, slot) if isInArray(stones, stone.itemid) and stone_effects[stone.itemid] then doSendMagicEffect(pos, stone_effects[stone.itemid]) end end end end end end end function onKill(cid, target) local stones = {11453, 11441, 11442, 11443, 11444, 11445, 11446, 11447, 11448, 11449, 11450, 11451, 11452, 11454, 12244, 12232, 12242, 12417, 12419, 12245, 12401, 12402, 12403, 12404, 12405, 12406, 12407, 12408, 12409, 12410, 12411, 12412, 12413, 12414} --id de todas as stones if ehMonstro(target) and isPlayer(cid) then local pos = getThingPos(target) local pid = getCreatureSummons(cid)[1] addEvent(sendEffStone, 150, pid, pos, stones) end return true end [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Fevereiro 14, 2019 6 anos Autor Em 14/02/2019 em 17:49, Vodkart disse: local stone_effects = { --[itemid] = effect, --Ex.: [11447] = 297, [11442] = 298, } local function sendEffStone(cid, pos, stones) if not isCreature(cid) then return true end for i = 1, 255 do pos.stackpos = i local item = getTileThingByPos(pos) if item.uid ~= 0 then if isContainer(item.uid) then if isContainer(item.uid) and getContainerSize(item.uid) > 0 then for slot=0, (getContainerSize(item.uid)-1) do local stone = getContainerItem(item.uid, slot) if isInArray(stones, stone.itemid) and stone_effects[stone.itemid] then doSendMagicEffect(pos, stone_effects[stone.itemid]) end end end end end end end function onKill(cid, target) local stones = {11453, 11441, 11442, 11443, 11444, 11445, 11446, 11447, 11448, 11449, 11450, 11451, 11452, 11454, 12244, 12232, 12242, 12417, 12419, 12245, 12401, 12402, 12403, 12404, 12405, 12406, 12407, 12408, 12409, 12410, 12411, 12412, 12413, 12414} --id de todas as stones if ehMonstro(target) and isPlayer(cid) then local pos = getThingPos(target) local pid = getCreatureSummons(cid)[1] addEvent(sendEffStone, 150, pid, pos, stones) end return true end testando, qualquer coisa edito @Vodkart funcionou em partes! O Effect está indo para o corpse, porém, a esquerda dele! Editado Fevereiro 14, 2019 6 anos por Yamborghini (veja o histórico de edições)
Postado Fevereiro 14, 2019 6 anos Solução @Yamborghini local stone_effects = { --[itemid] = effect, --Ex.: [11447] = 297, [11442] = 298, } local function sendEffStone(cid, pos, stones) if not isCreature(cid) then return true end for i = 1, 255 do pos.stackpos = i local item = getTileThingByPos(pos) if item.uid ~= 0 then if isContainer(item.uid) then if isContainer(item.uid) and getContainerSize(item.uid) > 0 then for slot=0, (getContainerSize(item.uid)-1) do local stone = getContainerItem(item.uid, slot) if isInArray(stones, stone.itemid) and stone_effects[stone.itemid] then doSendMagicEffect({x= pos.x+1, y= pos.y, z= pos.z}, stone_effects[stone.itemid]) end end end end end end end function onKill(cid, target) local stones = {11453, 11441, 11442, 11443, 11444, 11445, 11446, 11447, 11448, 11449, 11450, 11451, 11452, 11454, 12244, 12232, 12242, 12417, 12419, 12245, 12401, 12402, 12403, 12404, 12405, 12406, 12407, 12408, 12409, 12410, 12411, 12412, 12413, 12414} --id de todas as stones if ehMonstro(target) and isPlayer(cid) then local pos = getThingPos(target) local pid = getCreatureSummons(cid)[1] addEvent(sendEffStone, 150, pid, pos, stones) end return true end [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Fevereiro 14, 2019 6 anos Autor Perfeito, @Vodkart! Obrigado, inclusive, ainda estou esperando aquele sistema de recompensa diario que voce falou que iria fazer se tivesse tempo kkkkk
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.