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

[TFS 1.5] Manas and Runes Question

Jpstafe

Well-Known Member
Joined
Aug 8, 2011
Messages
528
Reaction score
71
Hello otland community, I have downloaded this tfs 1.5:
[TFS 1.5] [7.4] RookieOTs (https://otland.net/threads/tfs-1-5-7-4-rookieots.289065/)
I would like to be able to change the mana and rune issues, I would like them both to be stackable, the manas fluids and the runes
I have tried to use Object Builder to compile them, but it doesn't work. Do I have to compile some part of the sources?
items:
Lua:
<item id="2260" article="a" name="blank rune">
        <attribute key="weight" value="120"/>
    </item>
fluids.lua
XML:
local drunk = Condition(CONDITION_DRUNK)
drunk:setParameter(CONDITION_PARAM_TICKS, 60000)

local poison = Condition(CONDITION_POISON)
poison:setParameter(CONDITION_PARAM_DELAYED, true)
poison:setParameter(CONDITION_PARAM_MINVALUE, -50)
poison:setParameter(CONDITION_PARAM_MAXVALUE, -120)
poison:setParameter(CONDITION_PARAM_STARTVALUE, -5)
poison:setParameter(CONDITION_PARAM_TICKINTERVAL, 4000)
poison:setParameter(CONDITION_PARAM_FORCEUPDATE, true)

local fluidMessage = {
    [FLUID_BEER] = "Aah...",
    [FLUID_SLIME] = "Urgh!",
    [FLUID_LEMONADE] = "Mmmh.",
    [FLUID_MANA] = "Aaaah...",
    [FLUID_LIFE] = "Aaaah...",
    [FLUID_OIL] = "Urgh!",
    [FLUID_URINE] = "Urgh!",
    [FLUID_WINE] = "Aah...",
    [FLUID_MUD] = "Urgh!",
    [FLUID_RUM] = "Aah...",
    [FLUID_MEAD] = "Aaaah..."
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local targetItemType = ItemType(target.itemid)
    if targetItemType and targetItemType:isFluidContainer() then
        if target.type == FLUID_NONE and item.type ~= FLUID_NONE then
            target:transform(target:getId(), item.type)
            item:transform(item:getId(), FLUID_NONE)
            return true
        elseif target.type ~= FLUID_NONE and item.type == FLUID_NONE then
            item:transform(item:getId(), target.type)
            target:transform(target:getId(), FLUID_NONE)
            return true
        end
    end

    if target.itemid == 1 then
        if item.type == FLUID_NONE then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, "It is empty.")
        elseif target.uid == player.uid then
            if table.contains({FLUID_BEER, FLUID_WINE, FLUID_MEAD}, item.type) then
                player:addCondition(drunk)
            elseif item.type == FLUID_SLIME then
                player:addCondition(poison)
            elseif item.type == FLUID_MANA then
                player:addMana(math.random(50, 150))
                fromPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
            elseif item.type == FLUID_LIFE then
                player:addHealth(60)
                fromPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
            end
            player:say(fluidMessage[item.type] or "Gulp.", TALKTYPE_MONSTER_SAY)
            item:transform(item:getId(), FLUID_NONE)
        else
            Game.createItem(2016, item.type, toPosition):decay()
            item:transform(item:getId(), FLUID_NONE)
        end
    else
        local fluidSource = targetItemType and targetItemType:getFluidSource() or FLUID_NONE
        if fluidSource ~= FLUID_NONE then
            item:transform(item:getId(), fluidSource)
        elseif table.contains(distillery, target.itemid) then
            local tmp = distillery[target.itemid]
            if tmp then
                item:transform(item:getId(), FLUID_NONE)
            else
                player:sendCancelMessage("You have to process the bunch into the distillery to get rum.")
            end
        elseif item.type == FLUID_NONE then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, "It is empty.")
        else
            if toPosition.x == CONTAINER_POSITION then
                toPosition = player:getPosition()
            end
            Game.createItem(2016, item.type, toPosition):decay()
            item:transform(item:getId(), FLUID_NONE)
        end
    end
    return true
end
 
You're supposed to use item editor and exchange the item.xml if you want to change to stackable.
in items.xml, for example, the blankrune to edit it, how should it be?


XML:
<item id="2260" article="a" name="blank rune">
  <attribute key="weight" value="120"/>
  </item>
How would I put it?
taking a reference item like ham that can be stacked.


XML:
<item id="2671" name="ham" plural="ham">
  <attribute key="weight" value="2000"/>
  <attribute key="showcount" value="0"/>
  </item>
 
With manas i recommend you to just create as new item.

1. Object builder
2. Item editor
3. Items.xml

Add new script for manas in actions with the new ID. Also if you want get vials stackable after u have too to add new item with empty vial and set it stackable in ob/ie and add to xml
 
With manas i recommend you to just create as new item.

1. Object builder
2. Item editor
3. Items.xml

Add new script for manas in actions with the new ID. Also if you want get vials stackable after u have too to add new item with empty vial and set it stackable in ob/ie and add to xml
Yes, I have done it in a tfs 1.2 but I had to make some changes in sources, I also did the manual thing as you explained to me... the only thing that is not clear to me in the items.xml... how do I have to put if it is in stack? value=stack?
 
Yes, I have done it in a tfs 1.2 but I had to make some changes in sources, I also did the manual thing as you explained to me... the only thing that is not clear to me in the items.xml... how do I have to put if it is in stack? value=stack?

Ok i'll give you full solution for mana potion.

Items.xml:
XML:
<item id="id from .otb" article="a" name="mana fluid">
        <attribute key="weight" value="180" />
        <attribute key="pickupable" value="1" />
</item>

Object Builder (remember it adds to client - save your client id after add new item)
1719593936941.png
1719593962034.png

Now ItemEditor to edit your items.otb:
1719594010072.png

Gz you add new item, stackable. Now u just need to assign your NEW ID MANAS to any potion script.
 
Ok i'll give you full solution for mana potion.

Items.xml:
XML:
<item id="id from .otb" article="a" name="mana fluid">
        <attribute key="weight" value="180" />
        <attribute key="pickupable" value="1" />
</item>

Object Builder (remember it adds to client - save your client id after add new item)
View attachment 85732
View attachment 85733

Now ItemEditor to edit your items.otb:
View attachment 85734

Gz you add new item, stackable. Now u just need to assign your NEW ID MANAS to any potion script.
Thanks, now I'll try it and tell you how it went, thanks for the images.
 
Ok i'll give you full solution for mana potion.

Items.xml:
XML:
<item id="id from .otb" article="a" name="mana fluid">
        <attribute key="weight" value="180" />
        <attribute key="pickupable" value="1" />
</item>

Object Builder (remember it adds to client - save your client id after add new item)
View attachment 85732
View attachment 85733

Now ItemEditor to edit your items.otb:
View attachment 85734

Gz you add new item, stackable. Now u just need to assign your NEW ID MANAS to any potion script.
bbbbbbbbbbbcweqweqwe.png
It worked perfect, I didn't have to compile anything
 
Back
Top