SetCarryItemDrink
Fills a tankard or a stein - what a sip from it gives and how many sips are left.
A player holding a tankard or a stein drinks from it with the left mouse button: the game’s drinking animation plays
on every screen and the sip is a use of item as the inventory’s would be - OnPlayerUseItem decides (false refuses
it), its alcohol and health apply, so a few sips of beer get the drinker drunk. One sip at a time - about five and a half
seconds apart, the drinking animation’s length; a press sooner does nothing. By default a tankard or a stein holds
4 sips of beer; any other carry item holds nothing and cannot be filled. sips -1 never empties, 0 is empty (the
player is told “It is empty.”); item "" takes the drink away. false for an entity that is no tankard or stein (a carry item
of the wooden_tankard or wooden_stein classes) or an item the catalogue does not know.
Syntax
Section titled “Syntax”SetCarryItemDrink(entityId, item, sips)| Parameter | Type | |
|---|---|---|
entityId |
number | the carry item |
item |
string | the drink - an item of the catalogue ("beer", "wine", "mead", a GUID); "" none |
sips |
number | the sips in it; -1 endless |
Returns
Section titled “Returns”boolean
Example
Section titled “Example”-- the tavern's tankards: mead, three sips eachlocal mug = CreateCarryItem("wooden_tankard", 512.4, 340.1, 31.2)SetCarryItemDrink(mug, "mead", 3)See also
Section titled “See also”GetCarryItemDrink · CreateCarryItem · OnPlayerUseItem · the Carry items group of the index
