• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[TFS 0.4] Food system

elnelson

Lunaria World Dev
Joined
Jun 20, 2009
Messages
583
Solutions
2
Reaction score
60
Location
México
Hello, otlanders. im requesting a food system with these functions.

1-.when player eats blueberries, gain +5 mana regeneration for 60 seconds.
2-.when player eats dragon ham, gains +5 health regeneration for 60 seconds.
3-.when player eat fish gain +5 magic level (mages) or +5 melee/dist skill (no-mages) for 60 seconds.
4-.player can eat blueberries,dragon ham and fish to gain the 3 status but can not stack itself.

As title says, im using tfs 0.4 (rev3884)
 
Solution
You'd want to remove these items from the regular food script and/or actions.xml

Then create a new script for each one, and just set a 'buff' that gives those properties for 60 seconds.
Since buff's override themselves when your setting it to a sub id, the buff won't stack with itself or the other buffs.

for the vocation check, just do something like this
Lua:
local mages = {1,2,5,6}
if isInArray(mages, getPlayerVocation(cid)) then
    --mage
else
    -- anybody else
end
You'd want to remove these items from the regular food script and/or actions.xml

Then create a new script for each one, and just set a 'buff' that gives those properties for 60 seconds.
Since buff's override themselves when your setting it to a sub id, the buff won't stack with itself or the other buffs.

for the vocation check, just do something like this
Lua:
local mages = {1,2,5,6}
if isInArray(mages, getPlayerVocation(cid)) then
    --mage
else
    -- anybody else
end
 
Solution
Back
Top