Ir para conteúdo

Alimentar o pokemon de longe com shot effect


valakas

Posts Recomendados

Galera é o seguinte queria um modo de effect para alimentar o pokemon de longe, no action eu adicionei allowfaruse="5"

até ai beleza da para alimentar de longe

agora para por um effeito para geral das comida eu faço como?

Script food.lua

local FOODS =
{
	[2666] = {15, "Munch."},
	[2667] = {12, "Munch."},
	[2668] = {10, "Mmmm."},
	[2669] = {17, "Munch."},
	[2670] = {4, "Gulp."},
	[2671] = {30, "Chomp."},
	[2672] = {60, "Chomp."},
	[2673] = {5, "Yum."},
	[2674] = {6, "Yum."},
	[2675] = {13, "Yum."},
	[2676] = {8, "Yum."},
	[2678] = {18, "Slurp."},
	[2679] = {1, "Yum."},
	[2680] = {2, "Yum."},
	[2681] = {9, "Yum."},
	[2683] = {17, "Munch."},
	[2684] = {8, "Crunch."},
	[2685] = {6, "Munch."},
	[2686] = {9, "Crunch."},
	[2688] = {9, "Munch."},
	[2689] = {10, "Crunch."},
	[2690] = {3, "Crunch."},
	[2691] = {8, "Crunch."},
	[2793] = {9, "Munch."},
	[2695] = {6, "Gulp."},
	[2696] = {9, "Smack."},
	[2792] = {6, "Munch."},
	[2794] = {3, "Munch."},
	[2795] = {36, "Munch."},
	[2796] = {5, "Munch."},	
	[5097] = {4, "Yum."},
	[6278] = {10, "Mmmm."},
	[6279] = {15, "Mmmm."},
	[6393] = {12, "Mmmm."},
	[6394] = {15, "Mmmm."},
	[6501] = {20, "Mmmm."},
	[6541] = {6, "Gulp."},
	[6542] = {6, "Gulp."},
	[6543] = {6, "Gulp."},
	[6544] = {6, "Gulp."},
	[6545] = {6, "Gulp."},
	[6569] = {1, "Mmmm."},
	[7158] = {15, "Munch."},
	[7159] = {13, "Munch."},
	[7372] = {7, "Yum."},
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local food = FOODS[item.itemid]
	if(not food) then
		return false
	end
	
	if #getCreatureSummons(cid) <= 0 then
		if((getPlayerFood(cid) + food[1]) >= 400) then
			doPlayerSendCancel(cid, "You are full.")
			return true
		end

		doPlayerFeed(cid, food[1] * 4)
		doCreatureSay(cid, food[2], TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
		return true
	elseif #getCreatureSummons(cid) >= 1 then
		fome = getPlayerStorageValue(getCreatureSummons(cid)[1], 66604)
		if fome<= 250 then
			doCreatureSay(getCreatureSummons(cid)[1], food[2], TALKTYPE_ORANGE_1)
			doRemoveItem(item.uid, 1)
			setPlayerStorageValue(getCreatureSummons(cid)[1], 66604, (fome + (food[1]*4)))
			return true
		else
			doPlayerSendCancel(cid, "Seu pokémon não está com fome.")
			getHappinesStatus(getCreatureSummons(cid)[1], true)
			return true
		end	
	end
end
Link para o comentário
Compartilhar em outros sites

 

local FOODS =
{
[2666] = {15, "Munch."},
[2667] = {12, "Munch."},
[2668] = {10, "Mmmm."},
[2669] = {17, "Munch."},
[2670] = {4, "Gulp."},
[2671] = {30, "Chomp."},
[2672] = {60, "Chomp."},
[2673] = {5, "Yum."},
[2674] = {6, "Yum."},
[2675] = {13, "Yum."},
[2676] = {8, "Yum."},
[2678] = {18, "Slurp."},
[2679] = {1, "Yum."},
[2680] = {2, "Yum."},
[2681] = {9, "Yum."},
[2683] = {17, "Munch."},
[2684] = {8, "Crunch."},
[2685] = {6, "Munch."},
[2686] = {9, "Crunch."},
[2688] = {9, "Munch."},
[2689] = {10, "Crunch."},
[2690] = {3, "Crunch."},
[2691] = {8, "Crunch."},
[2793] = {9, "Munch."},
[2695] = {6, "Gulp."},
[2696] = {9, "Smack."},
[2792] = {6, "Munch."},
[2794] = {3, "Munch."},
[2795] = {36, "Munch."},
[2796] = {5, "Munch."},
[5097] = {4, "Yum."},
[6278] = {10, "Mmmm."},
[6279] = {15, "Mmmm."},
[6393] = {12, "Mmmm."},
[6394] = {15, "Mmmm."},
[6501] = {20, "Mmmm."},
[6541] = {6, "Gulp."},
[6542] = {6, "Gulp."},
[6543] = {6, "Gulp."},
[6544] = {6, "Gulp."},
[6545] = {6, "Gulp."},
[6569] = {1, "Mmmm."},
[7158] = {15, "Munch."},
[7159] = {13, "Munch."},
[7372] = {7, "Yum."},
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
local efeito = 15 ---- coloca o id efeito
local food = FOODS[item.itemid]
if(not food) then
return false
end

if #getCreatureSummons(cid) <= 0 then
if((getPlayerFood(cid) + food[1]) >= 400) then
doPlayerSendCancel(cid, "You are full.")
return true
end

doPlayerFeed(cid, food[1] * 4)
doCreatureSay(cid, food[2], TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
return true
elseif #getCreatureSummons(cid) >= 1 then
fome = getPlayerStorageValue(getCreatureSummons(cid)[1], 66604)
if fome<= 250 then
doSendDistanceShoot(getThingPos(cid), topos, efeito) ---- Edited
doCreatureSay(getCreatureSummons(cid)[1], food[2], TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
setPlayerStorageValue(getCreatureSummons(cid)[1], 66604, (fome + (food[1]*4)))
return true
else
doPlayerSendCancel(cid, "Seu pokémon não está com fome.")
getHappinesStatus(getCreatureSummons(cid)[1], true)
return true
end
end
end

 

Link para o comentário
Compartilhar em outros sites

 

@Edit -Postei o meu que estava configurado no lib ou seja ...
Segue o Next..

 

 

 

 

local FOODS =

{

[2666] = {15, "Munch."},

[2667] = {12, "Munch."},

[2668] = {10, "Mmmm."},

[2669] = {17, "Munch."},

[2670] = {4, "Gulp."},

[2671] = {30, "Chomp."},

[2672] = {60, "Chomp."},

[2673] = {5, "Yum."},

[2674] = {6, "Yum."},

[2675] = {13, "Yum."},

[2676] = {8, "Yum."},

[2678] = {18, "Slurp."},

[2679] = {1, "Yum."},

[2680] = {2, "Yum."},

[2681] = {9, "Yum."},

[2683] = {17, "Munch."},

[2684] = {8, "Crunch."},

[2685] = {6, "Munch."},

[2686] = {9, "Crunch."},

[2688] = {9, "Munch."},

[2689] = {10, "Crunch."},

[2690] = {3, "Crunch."},

[2691] = {8, "Crunch."},

[2793] = {9, "Munch."},

[2695] = {6, "Gulp."},

[2696] = {9, "Smack."},

[2792] = {6, "Munch."},

[2794] = {3, "Munch."},

[2795] = {36, "Munch."},

[2796] = {5, "Munch."},

[5097] = {4, "Yum."},

[6278] = {10, "Mmmm."},

[6279] = {15, "Mmmm."},

[6393] = {12, "Mmmm."},

[6394] = {15, "Mmmm."},

[6501] = {20, "Mmmm."},

[6541] = {6, "Gulp."},

[6542] = {6, "Gulp."},

[6543] = {6, "Gulp."},

[6544] = {6, "Gulp."},

[6545] = {6, "Gulp."},

[6569] = {1, "Mmmm."},

[7158] = {15, "Munch."},

[7159] = {13, "Munch."},

[7372] = {7, "Yum."},

}

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local efeito = 15 ---- coloca o id efeito

local food = FOODS[item.itemid]

if(not food) then

return false

end

 

if #getCreatureSummons(cid) <= 0 then

if((getPlayerFood(cid) + food[1]) >= 400) then

doPlayerSendCancel(cid, "You are full.")

return true

end

 

doPlayerFeed(cid, food[1] * 4)

doCreatureSay(cid, food[2], TALKTYPE_ORANGE_1)

doRemoveItem(item.uid, 1)

return true

elseif #getCreatureSummons(cid) >= 1 then

fome = getPlayerStorageValue(getCreatureSummons(cid)[1], 66604)

if fome<= 250 then

doSendDistanceShoot(getThingPos(cid), topos, efeito) ---- Edited

doCreatureSay(getCreatureSummons(cid)[1], food[2], TALKTYPE_ORANGE_1)

doRemoveItem(item.uid, 1)

setPlayerStorageValue(getCreatureSummons(cid)[1], 66604, (fome + (food[1]*4)))

return true

else

doPlayerSendCancel(cid, "Seu pokémon não está com fome.")

getHappinesStatus(getCreatureSummons(cid)[1], true)

return true

end

end

end

 

agradeço aos 2 ja dei o rep ^^

Link para o comentário
Compartilhar em outros sites

infelizmente deu nisso

[02/06/2015 12:49:05] [Error - Action Interface]
[02/06/2015 12:49:05] data/actions/scripts/other/food.lua:onUse
[02/06/2015 12:49:05] Description:
[02/06/2015 12:49:05] attempt to index a nil value
[02/06/2015 12:49:05] stack traceback:
[02/06/2015 12:49:05] [C]: in function 'doSendDistanceShoot'
[02/06/2015 12:49:05] data/actions/scripts/other/food.lua:70: in function <data/actions/scripts/other/food.lua:50>
tive que fazer do meu geito
local z = getCreatureSummons(cid)[1]
doSendDistanceShoot(getPlayerPosition(cid), getCreaturePosition(z), 3)
Editado por valakas
Link para o comentário
Compartilhar em outros sites

  • 1 month later...

O tópico foi fechado e movido para lixeira por estar inativo a mais de 10 dias. Caso seja preciso reabrir o mesmo, favor entrar em contato com a equipe.

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...