Ir para conteúdo
  • Cadastre-se

(Resolvido)[ERRO] Effect ao item dropar de um monstro!


Ir para solução Resolvido por Vodkart,

Posts Recomendados

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?

 

Spoiler

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

tumblr_o70wteR8521r9n6kzo1_400.gif

Link para o post
Compartilhar em outros sites
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

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
28 minutos atrás, 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 por Yamborghini (veja o histórico de edições)

tumblr_o70wteR8521r9n6kzo1_400.gif

Link para o post
Compartilhar em outros sites
  • 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

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites

Perfeito, @Vodkart!

Obrigado, inclusive, ainda estou esperando aquele sistema de recompensa diario que voce falou que iria fazer se tivesse tempo kkkkk

 

tumblr_o70wteR8521r9n6kzo1_400.gif

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo