Full Distribution

This commit is contained in:
rasanpedromujica
2019-01-16 17:16:38 -05:00
commit 009a571331
1258 changed files with 185603 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
function onUse(player, item, fromPosition, target, toPosition)
local itemType = ItemType(item:getId())
local condition = player:getCondition(CONDITION_REGENERATION, CONDITIONID_DEFAULT)
if condition and math.floor(condition:getTicks() / 1000 + (itemType:getNutrition() * 12)) >= 1200 then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "You are full.")
else
player:feed(itemType:getNutrition() * 12)
item:remove(1)
end
return true
end