• 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!

Manafluid/potion

Hookah

Member
Joined
Jan 20, 2023
Messages
49
Reaction score
7
Hello guys, wondering if there is any way to make manafluids work as runes, like I can shoot them and run they work 9 of 10 times, they seems to "seek" the player and fluids are most likely going to floor 50-70% of the cases if you're running
local drunk = Condition(CONDITION_DRUNK)
drunk:setParameter(CONDITION_PARAM_TICKS, 60000)

local poison = Condition(CONDITION_POISON)
poison:setTiming(100)

local messages = {
[FLUID_WATER] = "Gulp.",
[FLUID_WINE] = "Aah...",
[FLUID_BEER] = "Aah...",
[FLUID_MUD] = "Gulp.",
[FLUID_BLOOD] = "Gulp.",
[FLUID_SLIME] = "Urgh!",
[FLUID_OIL] = "Gulp.",
[FLUID_URINE] = "Urgh!",
[FLUID_MILK] = "Mmmh.",
[FLUID_MANAFLUID] = "Aaaah...",
[FLUID_LIFEFLUID] = "Aaaah...",
[FLUID_LEMONADE] = "Mmmh.",
[FLUID_RUM] = "Aah...",
[FLUID_COCONUTMILK] = "Mmmh.",
[FLUID_FRUITJUICE] = "Mmmh.",
[FLUID_MEAD] = "Aah...",
[FLUID_TEA] = "Gulp.",
}

function onUse(player, item, fromPosition, target, toPosition)
local targetItemType = ItemType(target:getId())
if targetItemType and targetItemType:isFluidContainer() then
if target:getFluidType() == 0 and item:getFluidType() ~= 0 then
target:transform(target:getId(), item:getFluidType())
item:transform(item:getId(), 0)
return true
elseif target:getFluidType() ~= 0 and item:getFluidType() == 0 then
player:sendCancelMessage("You cannot use this object.")
return true
end
end

if target:isCreature() and target:getPlayer() ~= nil then
if item:getFluidType() == FLUID_NONE then
player:sendCancelMessage("It is empty.")
else
local self = target == player
if self and item:getFluidType() == FLUID_BEER or item:getFluidType() == FLUID_WINE or item:getFluidType() == FLUID_RUM or item:getFluidType() == FLUID_MEAD then
player:addCondition(drunk)
elseif self and item:getFluidType() == FLUID_SLIME then
player:addCondition(poison)
elseif item:getFluidType() == FLUID_MANAFLUID then
target:addMana(math.random(50, 100))
target:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
elseif item:getFluidType() == FLUID_LIFEFLUID then
target:addHealth(math.random(25, 50))
target:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
end

if not self then
if item:getFluidType() ~= FLUID_MANAFLUID and item:getFluidType() ~= FLUID_LIFEFLUID then
if toPosition.x == CONTAINER_POSITION then
toPosition = player:getPosition()
end
Game.createItem(2886, item:getFluidType(), toPosition):decay()
return true
end
end

local message = messages[item:getFluidType()]
if message then
target:say(message, TALKTYPE_MONSTER_SAY)
else
target:say("Gulp.", TALKTYPE_MONSTER_SAY)
end

if player:getStorageValue(17742) ~= 1 then
item:transform(item:getId(), FLUID_NONE)
else
item:remove()
end
end
else
if toPosition.x == CONTAINER_POSITION then
toPosition = player:getPosition()
end

local tile = Tile(toPosition)
if not tile then
return false
end

if item:getFluidType() ~= FLUID_NONE and tile:hasFlag(TILESTATE_IMMOVABLEBLOCKSOLID) then
return false
end

local fluidSource = targetItemType and targetItemType:getFluidSource() or FLUID_NONE
if fluidSource ~= FLUID_NONE then
item:transform(item:getId(), fluidSource)
elseif item:getFluidType() == FLUID_NONE then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "It is empty.")
else
if item:getFluidType() == FLUID_BLOOD and target:getActionId() == 17639 then
doRelocate({x = 32791, y = 32334, z = 09}, {x = 32791, y = 32332, z = 10})
Position({x = 32791, y = 32332, z = 10}):sendMonsterSay("Muahahahaha...")
end

Game.createItem(2886, item.type, toPosition):decay()
item:transform(item:getId(), 0)
end
end
return true
end
 
in actions.xml add allowfaruse="1" to all the potion items

example from fishing rod
<action itemid="2580" script="tools/fishing.lua" allowfaruse="1"/>
 
Worked like charm! thank you xikini =]
For some reason in GM character it works 25% way better than normal character(even with insane speed)
Yeah from 70~ missing before to 0% missing with GM and normal character miss 20-25% of vials running.
Completely way better just wondering why?
 
Last edited:
Worked like charm! thank you xikini =]
For some reason in GM character it works 25% way better than normal character(even with insane speed)
Yeah from 70~ missing before to 0% missing with GM and normal character miss 20-25% of vials running.
Completely way better just wondering why?
Well, it makes the potions useable from a distance, like runes..

Idk why it would ever miss the target tho. xD
Unless someone has bad aim..

But that would be solved via battle window..
So idk. 🤷‍♂️
 
Worked like charm! thank you xikini =]
For some reason in GM character it works 25% way better than normal character(even with insane speed)
Yeah from 70~ missing before to 0% missing with GM and normal character miss 20-25% of vials running.
Completely way better just wondering why?
It is a generally known thing that you have to briefly pause in between movement commands to 100% get your pot through. (This is true for 8.6 at least)
 
but you realize you can now manas from far? u can manas other player from like 5 sqm

otclient would fix your troubles as it targets the player somehow
 
Back
Top