fix rum and coconut milk fluids drinking

This commit is contained in:
ErikasKontenis 2019-11-24 12:34:29 +02:00
parent c6c83bccea
commit 2911739928
3 changed files with 7 additions and 3 deletions

View File

@ -21,7 +21,9 @@ local messages = {
[FLUID_MILK] = "Mmmh.",
[FLUID_MANAFLUID] = "Aaaah...",
[FLUID_LIFEFLUID] = "Aaaah...",
[FLUID_LEMONADE] = "Mmmh."
[FLUID_LEMONADE] = "Mmmh.",
[FLUID_RUM] = "Aah...",
[FLUID_COCONUTMILK] = "Mmmh."
}
function onUse(player, item, fromPosition, target, toPosition)
@ -43,7 +45,7 @@ function onUse(player, item, fromPosition, target, toPosition)
player:sendCancelMessage("It is empty.")
else
local self = target == player
if self and item:getFluidType() == FLUID_BEER or item:getFluidType() == FLUID_WINE then
if self and item:getFluidType() == FLUID_BEER or item:getFluidType() == FLUID_WINE or item:getFluidType() == FLUID_RUM then
player:addCondition(drunk)
elseif self and item:getFluidType() == FLUID_SLIME then
player:addCondition(slime)

View File

@ -1408,6 +1408,7 @@ void LuaScriptInterface::registerFunctions()
registerEnum(FLUID_LIFEFLUID)
registerEnum(FLUID_LEMONADE)
registerEnum(FLUID_RUM)
registerEnum(FLUID_COCONUTMILK)
registerEnum(TALKTYPE_SAY)
registerEnum(TALKTYPE_WHISPER)

View File

@ -720,7 +720,8 @@ FluidNames fluidNames[] = {
{"manafluid", FLUID_MANAFLUID},
{"lifefluid", FLUID_LIFEFLUID},
{"lemonade", FLUID_LEMONADE},
{"rum", FLUID_RUM}
{"rum", FLUID_RUM},
{"coconutmilk", FLUID_COCONUTMILK}
};
MagicEffectClasses getMagicEffect(const std::string& strValue)