• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[TFS 1.0] I cant Potion other persons

Techrlz

System Manager & Programmer
Premium User
Joined
Feb 20, 2014
Messages
1,073
Solutions
4
Reaction score
177
In tfs 1.0 i can't potion others characters, is bug in tfs or in potion script?
 
my fluids.lua:
Code:
-- TODO: Rewrite this script using fluidtypes from LIQUIDS doc-file,
--        and correct itemid's to recieve the liquids.

local drunk = createConditionObject(CONDITION_DRUNK)
setConditionParam(drunk, CONDITION_PARAM_TICKS, 60000)

local poison = createConditionObject(CONDITION_POISON)
addDamageCondition(poison, 2, 6000, -5)
addDamageCondition(poison, 3, 6000, -4)
addDamageCondition(poison, 5, 6000, -3)
addDamageCondition(poison, 10, 6000, -2)
addDamageCondition(poison, 20, 6000, -1)

local fluidType = {3, 4, 5, 7, 10, 11, 13, 15, 19}
local fluidMessage = {"Aah...", "Urgh!", "Mmmh.", "Aaaah...", "Aaaah...", "Urgh!", "Urgh!", "Aah...", "Urgh!"}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if itemEx.itemid == 1 then
        if item.type == 0 then
            doPlayerSendCancel(cid, "It is empty.")
        elseif itemEx.uid == cid then
            doChangeTypeItem(item.uid, 0)
            if item.type == 3 or item.type == 15 then
                doTargetCombatCondition(0, cid, drunk, CONST_ME_NONE)
            elseif item.type == 4 then
                doTargetCombatCondition(0, cid, poison, CONST_ME_NONE)
            elseif item.type == 7 then
                doPlayerAddMana(cid, math.random(50, 150))
                doSendMagicEffect(fromPosition, CONST_ME_MAGIC_BLUE)
            elseif item.type == 10 then
                doCreatureAddHealth(cid, 60)
                doSendMagicEffect(fromPosition, CONST_ME_MAGIC_BLUE)
            end
            for i = 0, table.maxn(fluidType) do
                if item.type == fluidType[i] then
                    doCreatureSay(cid, fluidMessage[i], TALKTYPE_ORANGE_1)
                    return TRUE
                end
            end
            doCreatureSay(cid, "Gulp.", TALKTYPE_ORANGE_1)
        else
            local splash = doCreateItem(2025, item.type, toPosition)
            doChangeTypeItem(item.uid, 0)
            doDecayItem(splash)
        end
    else
        local fluidSource = getFluidSourceType(itemEx.itemid)
        if fluidSource ~= 0 then
            doChangeTypeItem(item.uid, fluidSource)
        elseif item.type == 0 then
            doPlayerSendCancel(cid, "It is empty.")
        else
            if toPosition.x == CONTAINER_POSITION then
                toPosition = getCreaturePosition(cid)
            end
            splash = doCreateItem(2025, item.type, toPosition)
            doChangeTypeItem(item.uid, 0)
            doDecayItem(splash)
        end
    end
    return TRUE
end
 
Back
Top