Animera
* * * * *
Info:
I use these scripts in my server but because this is easy to create i decided to create it
so that people without scripting skills can use it.
I use this script it is bugfree on (the forgotten server 0.3.6 pl1/ 8.54).
So i am not sure this works on other distro's.
Mango tree:
Using the tree gives 2 to 5 mangos.
Items.xml
And
The fruit is growing on the tree every 24 hours in real life.
Actions.xml
Mangotree.lua
Orange Tree:
Using the tree gives 2 to 5 Oranges.
Items.xml
And
Actions.xml
Orangetree.lua
Food
Food wich gives instantly health and mana depends on how rare it is or how much it fills.
Here are 2 samples:
A simple apple.
A rare cake (+5k hp +5k M)
Food.lua (With a small bugfix thanks to cykotitan)
I use these scripts in my server but because this is easy to create i decided to create it
so that people without scripting skills can use it.
I use this script it is bugfree on (the forgotten server 0.3.6 pl1/ 8.54).
So i am not sure this works on other distro's.
Mango tree:
Using the tree gives 2 to 5 mangos.

Items.xml
Code:
<item id="5157" article="a" name="mango tree"/>
Code:
<item id="5156" article="a" name="empty mango tree">
<attribute key="decayTo" value="5157" />
<attribute key="duration" value="86400000"/>
</item>
Actions.xml
Code:
<action itemid="5157" event="script" value="other/mangotree.lua"/>
Mangotree.lua
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
doPlayerAddItem(cid, 5097, math.random(2, 5), fromPosition)
doTransformItem(item.uid, 5156)
doDecayItem(item.uid)
return true
end
Orange Tree:
Using the tree gives 2 to 5 Oranges.

Items.xml
Code:
<item id="4006" article="an" name="orange tree" />
Code:
<item id="4008" article="a" name="empty orange tree">
<attribute key="decayTo" value="5157" />
<attribute key="duration" value="86400000"/>
</item>
Actions.xml
Code:
<action itemid="4006" event="script" value="other/orangetree.lua"/>
Orangetree.lua
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
doPlayerAddItem(cid, 2675, math.random(2, 5), fromPosition)
doTransformItem(item.uid, 4008)
doDecayItem(item.uid)
return true
end
Food
Food wich gives instantly health and mana depends on how rare it is or how much it fills.
Here are 2 samples:
A simple apple.

A rare cake (+5k hp +5k M)

Food.lua (With a small bugfix thanks to cykotitan)
PHP:
local FOODS =
{
[2362] = {8, "Crunch.", {10, 25}, {25, 50}}, -- Carrots of doom
[2666] = {15, "Munch.", {5, 20}, {3, 10}}, -- Meat
[2667] = {12, "Munch.", {5, 25}, {5, 15}}, -- Fish
[2668] = {10, "Mmmm.", {3, 13}, {1, 9}}, -- Salmon
[2669] = {17, "Munch.", {10, 45}, {15, 50}}, -- Northern pikes (big fish)
[2670] = {4, "Gulp.", {1, 10}, {1, 10}}, -- Shrimps
[2671] = {30, "Chomp.", {20, 60}, {25, 45}}, -- Ham
[2672] = {60, "Chomp.", {30, 75}, {25, 65}}, -- Dragon ham
[2673] = {5, "Yum.", {1, 15}, {5, 35}}, -- Pears
[2674] = {6, "Yum.", {1, 10}, {10, 35}}, -- Red apple
[2675] = {13, "Yum.", {1, 7}, {15, 40}}, -- Orange
[2676] = {8, "Yum.", {5, 20}, {15, 30}}, -- Banana
[2677] = {1, "Yum.", {1, 5}, {1, 5}}, -- Blueberry
[2678] = {18, "Slurp.", {15, 50}, {30, 55}}, -- Coconut
[2679] = {1, "Yum.", {1, 7}, {1, 7}}, -- Cherry
[2680] = {2, "Yum.", {1, 10}, {2, 18}}, -- Strawberry
[2681] = {9, "Yum.", {10, 35}, {25, 25}}, -- Grapes
[2682] = {20, "Yum.", {20, 55}, {20, 55}}, -- Melon
[2683] = {17, "Munch.", {15, 50}, {15, 50}}, -- Pumpkin
[2684] = {8, "Crunch.", {10, 20}, {25, 45}}, -- Carrots
[2685] = {6, "Munch.", {5, 15}, {5, 10}}, -- Tomato
[2686] = {9, "Crunch.", {1, 15}, {1, 8}}, -- Corncobs
[2687] = {2, "Crunch.", {1, 3}, {1, 2}}, -- Cookies
[2688] = {9, "Munch.", {1, 5}, {1, 5}}, -- Candy canes
[2689] = {10, "Crunch.", {1, 15}, {5, 15}}, -- Bread
[2690] = {3, "Crunch.", {5, 20}, {5, 15}}, -- Rolls
[2691] = {8, "Crunch.", {10, 25}, {10, 15}}, -- Brown bread
[2792] = {6, "Munch.", {5, 15}, {5, 10}}, -- Dark mushrooms
[2793] = {9, "Munch.", {10, 30}, {15, 25}}, -- Mushrooms
[2695] = {6, "Gulp.", {10, 40}, {10, 40}}, -- Eggs
[2696] = {9, "Smack.", {10, 30}, {10, 25}}, -- Cheese
[2787] = {9, "Munch.", {10, 35}, {15, 30}}, -- White mushrooms
[2788] = {4, "Munch.", {10, 35}, {15, 50}}, -- Red mushrooms
[2789] = {22, "Munch.", {15, 55}, {15, 55}}, -- Brown mushrooms
[2790] = {30, "Munch.", {10, 35}, {15, 35}}, -- Orange mushrooms
[2791] = {30, "Munch.", {15, 35}, {15, 35}}, -- Wood mushrooms
[2794] = {3, "Munch.", {15, 35}, {15, 35}}, -- Mushrooms
[2795] = {36, "Munch.", {75, 150}, {80, 150}}, -- Fire mushrooms
[2796] = {5, "Munch.", {30, 125}, {40, 120}}, -- Green mushrooms
[5097] = {4, "Yum.", {10, 35}, {15, 35}}, -- Mango
[6125] = {8, "Gulp.", {15, 35}, {25, 30}}, -- Tortoise egg
[6278] = {10, "Mmmm.", {10, 20}, {15, 25}}, -- Cake
[6279] = {15, "Mmmm.", {7, 20}, {10, 25}}, -- Decorated cake
[6393] = {50, "The power of love!", {5000, 5000}, {5000, 5000}}, -- Valentine cake
[6394] = {15, "Mmmm.", {15, 25}, {15, 25}}, -- Cream cake
[6501] = {20, "Mmmm.", {10, 20}, {25, 40}}, -- gingerbread man
[6541] = {6, "Gulp.", {10, 25}, {15, 25}}, -- Yellow eggs
[6542] = {6, "Gulp.", {10, 25}, {15, 25}}, -- Red eggs
[6543] = {6, "Gulp.", {10, 25}, {15, 25}}, -- Blue eggs
[6544] = {6, "Gulp.", {10, 25}, {15, 25}}, -- Green eggs
[6545] = {6, "Gulp.", {10, 25}, {15, 25}}, -- Purple eggs
[6569] = {1, "Mmmm.", {5, 15}, {5, 15}}, -- Candy
[6574] = {4, "Mmmm.", {10, 20}, {5, 20}}, -- Chocolate
[7158] = {15, "Munch.", {55, 100}, {45, 105}}, -- Rainbow trouts (Fish)
[7159] = {13, "Munch.", {40, 75}, {35, 80}}, -- Green perches (Fish)
[7372] = {7, "Yum.", {25, 35}, {25, 50}}, -- Ice cream cone
[7373] = {7, "Yum.", {15, 25}, {25, 50}}, -- Yellow ice
[7374] = {7, "Yum.", {15, 25}, {25, 50}}, -- Red ice
[7375] = {7, "Yum.", {15, 25}, {25, 50}}, -- Purple ice
[7376] = {7, "Yum.", {15, 25}, {25, 50}}, -- Green ice
[7377] = {7, "Yum.", {15, 25}, {25, 50}}, -- Blue ice
[8838] = {7, "Gulp.", {15, 30}, {25, 30}}, -- Potato
[8839] = {5, "Yum.", {10, 25}, {15, 25}}, -- Plum
[8840] = {2, "Yum.", {5, 15}, {5, 10}}, -- Raspberry
[8841] = {3, "Urgh.", {1, 20}, {5, 30}}, -- Lemon
[8842] = {5, "Munch.", {5, 25}, {5, 25}}, -- Cucumber
[8843] = {3, "Crunch.", {1, 20}, {5, 20}}, -- Onion
[8844] = {3, "Gulp.", {25, 60}, {35, 70}}, -- Jalapeno peper
[8845] = {2, "Munch.", {10, 25}, {5, 20}}, -- Beetroot
[8847] = {11, "Yum.", {10, 25}, {20, 30}}, -- Chocolate cake
[7910] = {4, "Crunch.", {15, 25}, {25, 30}}, -- Peanut
[7909] = {4, "Crunch.", {15, 25}, {25, 30}}, -- Walnut
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local food = FOODS[item.itemid]
if(not food) then
return false
end
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)
doCreatureAddHealth(cid, math.random(food[3][1], food[3][2]))
doPlayerAddMana(cid, math.random(food[4][1], food[4][2]))
return true
end
Last edited: