Ir para conteúdo

Food System 4.0 8.31


tibiaa4e

Posts Recomendados

Aqui o novo Food System para 8.31

 

Como até o Eventide me lembro eu fiz um em vetores, porém ficou grande pois as comidas tem certas diferenças em falas

e em tempo de comer.

 

Ficou assim, substitua tudo o que você tem no other/food.lua por :

 

--Food system 340 by Ta4e (Soulblaster have some credits)--
--For tibia 8.31+--

local MAX_FOOD = 1200
local crunch = {2684,2687,2689,2690,2691,2787,2788,2789,2790,2791,2792,2793,2794,2795,2796}
local mmmm = {2668,2688,6501,6278,6279,6393,6394,6569,6574,8839,8840,8843,8845,8847}
local gulp = {2670,2695,5678,6541,6542,6543,6544,6545,7372,7373,7374,7375,7376,7377}
local yum = {2673,2674,2675,2676,2677,2679,2680,2681,2682,5097,8841,8842}
local munch = {2666,2667,2669,2683,2685,7158,7159,7909,7910,8838}
local chomp = {2671,2672}
local a0 = {2790,6393,6394,7372,7373,7374,7375,7376,7377}
local a12 = {2677,2679,6569,8840,8841,8844}
local a24 = {2680,2687,2688}
local a48 = {2670,2788,5097,7909,7910}
local a60 = {2673,2684,2796,6574,8839,8843,8845}
local a72 = {2674,2685,2690,2695,2792,2793,2794,6541,6542,6543,6544,6545}
local a96 = {2676,2691,5678}
local a108 = {2681,2686,2696,2787,2791}
local a120 = {2668,2689,6278,6279,8838,8847}
local a180 = {2666,7159}
local a240 = {2682,6501}

function onUse(cid, item, frompos, item2, topos)

if isInArray(munch, item.itemid) == TRUE then
	som = "munch."
elseif isInArray(mmm, item.itemid) == TRUE then
	som = "Mmmm."
elseif isInArray(gulp, item.itemid) == TRUE then
	som = "gulp."
elseif isInArray(chomp, item.itemid) == TRUE then
	som = "chomp."
elseif isInArray(yum, item.itemid) == TRUE then
	som = "Yum."
elseif isInArray(crunch, item.itemid) == TRUE then
	som = "crunch."
elseif item.itemid == 2696 then
	som = "smack."
elseif item.itemid == 8844 then
	som = "Ouch."
elseif item.itemid == 2678 then
	som = "slurp"
	food = 216
end

	if isInArray(a0, item.itemid) == TRUE then
		food = 0
	elseif isInArray(a12, item.itemid) == TRUE then
		food = 12
	elseif isInArray(a24, item.itemid) == TRUE then
		food = 24
	elseif isInArray(a48, item.itemid) == TRUE then
		food = 48
	elseif isInArray(a60, item.itemid) == TRUE then
		food = 60
	elseif isInArray(a72, item.itemid) == TRUE then
		food = 72
	elseif isInArray(a72, item.itemid) == TRUE then
		food = 96
	elseif isInArray(a108, item.itemid) == TRUE then
		food = 108
	elseif isInArray(a120, item.itemid) == TRUE then
		food = 120
	elseif isInArray(a180, item.itemid) == TRUE then
		food = 180
	elseif isInArray(a240, item.itemid) == TRUE then
		food = 240
	elseif item.itemid == 8842 then
		food = 84
	elseif item.itemid == 2667 then
		food = 144
	elseif item.itemid == 2675 then
		food = 156
	elseif item.itemid == 2683 then
		food = 204			
	elseif item.itemid == 2669 then
		food = 254
	elseif item.itemid == 2789 then
		food = 264
	elseif item.itemid == 7158 then
		food = 300
	elseif item.itemid == 2671 then
		food = 360
	elseif item.itemid == 2795 then
		food = 432
	elseif item.itemid == 2672 then
		food = 720
	end

		if getPlayerFood(cid) + food > MAX_FOOD then
			doPlayerSendCancel(cid, "You are full.")
		else
			doPlayerFeed(cid, food)
			doRemoveItem(item.uid,1)
			doCreatureSay(cid, som, TALKTYPE_ORANGE_1)
		end
return 1
end

 

E em actions.xml adicione :

 

<!-- Food -->
<action fromid="2362" toid="2363" script="other/food.lua"/>
<action fromid="2666" toid="2691" script="other/food.lua"/>
<action fromid="2695" toid="2696" script="other/food.lua"/>
<action fromid="2787" toid="2796" script="other/food.lua"/>
<action itemid="5097" script="other/food.lua"/>
<action itemid="6125" script="other/food.lua"/>
<action itemid="6278" script="other/food.lua"/>
<action itemid="6279" script="other/food.lua"/>
<action itemid="6394" script="other/food.lua"/>
<action itemid="6501" script="other/food.lua"/>
<action fromid="6541" toid="6545" script="other/food.lua"/>
<action itemid="6569" script="other/food.lua"/>
<action itemid="6574" script="other/food.lua"/>
<action itemid="7158" script="other/food.lua"/>
<action itemid="7159" script="other/food.lua"/>
<action itemid="7709" script="other/food.lua"/>
<action itemid="7710" script="other/food.lua"/>
<action fromid="7372" toid="7377" script="other/food.lua"/>
<action fromid="8838" toid="8845" script="other/food.lua"/>
<action itemid="8847" script="other/food.lua"/>

 

É isso ai

--edited--

 

auhahua agora vi um jeito mais facil de fazer ainda :p

 

Depois eu coloco aqui

Mais funciona do mesmo jeito

Só que é menor

Editado por tibiaa4e
Link para o comentário
Compartilhar em outros sites

  • 3 months later...

Erm...

local food =

{

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

[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."},

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

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

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

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

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

[2682] = {20, "Yum."},

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

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

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

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

[2687] = {2, "Crunch."},

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

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

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

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

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

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

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

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

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

[2788] = {4, "Munch."},

[2789] = {22, "Munch."},

[2790] = {30, "Munch."},

[2791] = {30, "Munch."},

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

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

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

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

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

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

[6125] = {8, "Gulp."},

[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."},

[6574] = {4, "Mmmm."},

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

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

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

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

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

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

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

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

}

function onUse(cid, item, frompos, item2, topos)

if(food[item.itemid] ~= nil) then

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

doPlayerSendCancel(cid, "You are full.")

else

doPlayerFeed(cid, food[item.itemid][1] * 4)

doCreatureSay(cid, food[item.itemid][2], TALKTYPE_ORANGE_1)

doRemoveItem(item.uid, 1)

end

return TRUE

end

return FALSE

end

Créditos TFS Team

Por que usar esse seu se o do TFS é menor? =D

 

Tprocheira

Link para o comentário
Compartilhar em outros sites

@up

 

eu so vi ele na 8.31

 

eu não uso scripts de outros quando tenhos os meus :p

 

E fora q o tfs usa meus scripts só que eles mete array e talz xD

(FIquei traumatizado com isso =/)

Link para o comentário
Compartilhar em outros sites

  • 4 weeks later...
×
×
  • Criar Novo...