1local foods = {
2 [2362] = {5, "Crunch."}, -- carrot
3 [2666] = {15, "Munch."}, -- meat
4 [2667] = {12, "Munch."}, -- fish
5 [2668] = {10, "Mmmm."}, -- salmon
6 [2669] = {17, "Munch."}, -- northern pike
7 [2670] = {4, "Gulp."}, -- shrimp
8 [2671] = {30, "Chomp."}, -- ham
9 [2672] = {60, "Chomp."}, -- dragon ham
10 [2673] = {5, "Yum."}, -- pear
11 [2674] = {6, "Yum."}, -- red apple
12 [2675] = {13, "Yum."}, -- orange
13 [2676] = {8, "Yum."}, -- banana
14 [2677] = {1, "Yum."}, -- blueberry
15 [2678] = {18, "Slurp."}, -- coconut
16 [2679] = {1, "Yum."}, -- cherry
17 [2680] = {2, "Yum."}, -- strawberry
18 [2681] = {9, "Yum."}, -- grapes
19 [2682] = {20, "Yum."}, -- melon
20 [2683] = {17, "Munch."}, -- pumpkin
21 [2684] = {5, "Crunch."}, -- carrot
22 [2685] = {6, "Munch."}, -- tomato
23 [2686] = {9, "Crunch."}, -- corncob
24 [2687] = {2, "Crunch."}, -- cookie
25 [2688] = {2, "Munch."}, -- candy cane
26 [2689] = {10, "Crunch."}, -- bread
27 [2690] = {3, "Crunch."}, -- roll
28 [2691] = {8, "Crunch."}, -- brown bread
29 [2695] = {6, "Gulp."}, -- egg
30 [2696] = {9, "Smack."}, -- cheese
31 [2787] = {9, "Munch."}, -- white mushroom
32 [2788] = {4, "Munch."}, -- red mushroom
33 [2789] = {22, "Munch."}, -- brown mushroom
34 [2790] = {30, "Munch."}, -- orange mushroom
35 [2791] = {9, "Munch."}, -- wood mushroom
36 [2792] = {6, "Munch."}, -- dark mushroom
37 [2793] = {12, "Munch."}, -- some mushrooms
38 [2794] = {3, "Munch."}, -- some mushrooms
39 [2795] = {36, "Munch."}, -- fire mushroom
40 [2796] = {5, "Munch."}, -- green mushroom
41 [5097] = {4, "Yum."}, -- mango
42 [5678] = {8, "Gulp."}, -- tortoise egg
43 [6125] = {8, "Gulp."}, -- tortoise egg from Nargor
44 [6278] = {10, "Mmmm."}, -- cake
45 [6279] = {15, "Mmmm."}, -- decorated cake
46 [6393] = {12, "Mmmm."}, -- valentine's cake
47 [6394] = {15, "Mmmm."}, -- cream cake
48 [6501] = {20, "Mmmm."}, -- gingerbread man
49 [6541] = {6, "Gulp."}, -- coloured egg (yellow)
50 [6542] = {6, "Gulp."}, -- coloured egg (red)
51 [6543] = {6, "Gulp."}, -- coloured egg (blue)
52 [6544] = {6, "Gulp."}, -- coloured egg (green)
53 [6545] = {6, "Gulp."}, -- coloured egg (purple)
54 [6569] = {1, "Mmmm."}, -- candy
55 [6574] = {5, "Mmmm."}, -- bar of chocolate
56 [7158] = {15, "Munch."}, -- rainbow trout
57 [7159] = {13, "Munch."}, -- green perch
58 [7372] = {2, "Yum."}, -- ice cream cone (crispy chocolate chips)
59 [7373] = {2, "Yum."}, -- ice cream cone (velvet vanilla)
60 [7374] = {2, "Yum."}, -- ice cream cone (sweet strawberry)
61 [7375] = {2, "Yum."}, -- ice cream cone (chilly cherry)
62 [7376] = {2, "Yum."}, -- ice cream cone (mellow melon)
63 [7377] = {2, "Yum."}, -- ice cream cone (blue-barian)
64 [7909] = {4, "Crunch."}, -- walnut
65 [7910] = {4, "Crunch."}, -- peanut
66 [7963] = {60, "Munch."}, -- marlin
67 [8112] = {9, "Urgh."}, -- scarab cheese
68 [8838] = {10, "Gulp."}, -- potato
69 [8839] = {5, "Yum."}, -- plum
70 [8840] = {1, "Yum."}, -- raspberry
71 [8841] = {1, "Urgh."}, -- lemon
72 [8842] = {7, "Munch."}, -- cucumber
73 [8843] = {5, "Crunch."}, -- onion
74 [8844] = {1, "Gulp."}, -- jalapeño pepper
75 [8845] = {5, "Munch."}, -- beetroot
76 [8847] = {11, "Yum."}, -- chocolate cake
77 [9005] = {7, "Slurp."}, -- yummy gummy worm
78 [9114] = {5, "Crunch."}, -- bulb of garlic
79 [9996] = {0, "Slurp."}, -- banana chocolate shake
80 [10454] = {0, "Your head begins to feel better."}, -- headache pill
81 [11246] = {15, "Yum."}, -- rice ball
82 [11370] = {3, "Urgh."}, -- terramite eggs
83 [11429] = {10, "Mmmm."}, -- crocodile steak
84 [12415] = {20, "Yum."}, -- pineapple
85 [12416] = {10, "Munch."}, -- aubergine
86 [12417] = {8, "Crunch."}, -- broccoli
87 [12418] = {9, "Crunch."}, -- cauliflower
88 [12637] = {55, "Gulp."}, -- ectoplasmic sushi
89 [12638] = {18, "Yum."}, -- dragonfruit
90 [12639] = {2, "Munch."}, -- peas
91 [13297] = {20, "Crunch."}, -- haunch of boar
92 [15405] = {55, "Munch."}, -- sandfish
93 [15487] = {14, "Urgh."}, -- larvae
94 [15488] = {15, "Munch."}, -- deepling filet
95 [16014] = {60, "Mmmm."}, -- anniversary cake
96 [18397] = {33, "Munch."}, -- mushroom pie
97 [19737] = {10, "Urgh."}, -- insectoid eggs
98 [20100] = {15, "Smack."}, -- soft cheese
99 [20101] = {12, "Smack."}, -- rat cheese
100 [23514] = {15, "Munch."}, -- glooth sandwich
101 [23515] = {7, "Slurp."}, -- bowl of glooth soup
102 [23516] = {6, "Burp."}, -- bottle of glooth wine
103 [23517] = {25, "Chomp."}, -- glooth steak
104 [24841] = {12, "Yum."}, -- prickly pear
105 [24843] = {60, "Chomp."}, -- roasted meat
106 [26191] = {25, "Mmmm."}, -- energy bar
107 [26201] = {15, "Mmmm."} -- energy drink
108}
109
110function onUse(player, item, fromPosition, target, toPosition, isHotkey)
111 local food = foods[item.itemid]
112 if not food then
113 return false
114 end
115
116 local condition = player:getCondition(CONDITION_REGENERATION, CONDITIONID_DEFAULT)
117 if condition and math.floor(condition:getTicks() / 1000 + (food[1] * 12)) >= 1200 then
118 player:sendTextMessage(MESSAGE_STATUS_SMALL, "You are full.")
119 else
120 player:feed(food[1] * 12)
121 player:say(food[2], TALKTYPE_MONSTER_SAY)
122 item:remove(1)
123 end
124 return true
125end
126