mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-11-28 07:36:50 +01:00
implement juice squeezer and few new 781 items
This commit is contained in:
@@ -176,6 +176,7 @@
|
||||
<action itemid="3457" script="misc/shovel.lua" />
|
||||
<action itemid="5710" script="misc/shovel.lua" />
|
||||
<action itemid="3483" allowfaruse="1" script="misc/fishing_rod.lua" />
|
||||
<action itemid="5865" script="misc/juice_squeezer.lua" />
|
||||
|
||||
<!-- Miscellaneous -->
|
||||
<action itemid="4867" script="misc/botanist_container.lua" />
|
||||
@@ -214,6 +215,7 @@
|
||||
<action itemid="2524" script="misc/fluids.lua" />
|
||||
<action itemid="2873" script="misc/fluids.lua" />
|
||||
<action itemid="2874" script="misc/fluids.lua" />
|
||||
<action itemid="2875" script="misc/fluids.lua" />
|
||||
<action itemid="2876" script="misc/fluids.lua" />
|
||||
<action itemid="2877" script="misc/fluids.lua" />
|
||||
<action itemid="2879" script="misc/fluids.lua" />
|
||||
|
||||
@@ -23,7 +23,8 @@ local messages = {
|
||||
[FLUID_LIFEFLUID] = "Aaaah...",
|
||||
[FLUID_LEMONADE] = "Mmmh.",
|
||||
[FLUID_RUM] = "Aah...",
|
||||
[FLUID_COCONUTMILK] = "Mmmh."
|
||||
[FLUID_COCONUTMILK] = "Mmmh.",
|
||||
[FLUID_FRUITJUICE] = "Mmmh."
|
||||
}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
@@ -34,8 +35,7 @@ function onUse(player, item, fromPosition, target, toPosition)
|
||||
item:transform(item:getId(), 0)
|
||||
return true
|
||||
elseif target:getFluidType() ~= 0 and item:getFluidType() == 0 then
|
||||
target:transform(target:getId(), 0)
|
||||
item:transform(item:getId(), target:getFluidType())
|
||||
player:sendCancelMessage("You cannot use this object.")
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
9
data/actions/scripts/misc/juice_squeezer.lua
Normal file
9
data/actions/scripts/misc/juice_squeezer.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
local fruits = {3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3595, 3596, 5096}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
||||
if isInArray(fruits, target.itemid) and player:removeItem(2874, 1, 0) then
|
||||
target:remove(1)
|
||||
player:addItem(2874, target.itemid == 3589 and 14 or 15)
|
||||
return true
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user