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

Lua TFS 1.2 Buy bp of manafluids/runes

Roni123

Hardstyle Never Die < 3 !!!
Joined
Aug 31, 2010
Messages
152
Solutions
1
Reaction score
18
Good Morning,

Dears,

Anyone has scirpt for NPC on TFS 1.2 what will sell manafluids and runes in backpacks ? I'm trying to find something but without effect :/

Thanks in advance !
 
Can't you just use "buy with backpack" option? Then it will add manafluids/runes to backpacks?
 
Can't you just use "buy with backpack" option? Then it will add manafluids/runes to backpacks?
I have 8.0 distro :)
Post automatically merged:


Default runes NPC script already does that
I have bro 8.0 distro, so there mana fluid have 2006,7 ID and I think this script willn't work fine cuz there are appropriate arrangement for "," e.g
ID Backpack, ID Potion, Price, Qty.
Lua:
shopModule:addBuyableItemContainer({'bp mp'}, 2001, 7620, 1000, 1, 'backpack of mana potions')
 
I have 8.0 distro :)
Post automatically merged:


I have bro 8.0 distro, so there mana fluid have 2006,7 ID and I think this script willn't work fine cuz there are appropriate arrangement for "," e.g
ID Backpack, ID Potion, Price, Qty.
Lua:
shopModule:addBuyableItemContainer({'bp mp'}, 2001, 7620, 1000, 1, 'backpack of mana potions')


Try it. Example:

Lua:
 shopModule:addBuyableItemContainer({'lifefluid'}, 2000, 2006, 45, 2, 'backpack of vial of lifefluid')

backpack id, vial id, gold coins cost, charges
 
Try it. Example:

Lua:
 shopModule:addBuyableItemContainer({'lifefluid'}, 2000, 2006, 45, 2, 'backpack of vial of lifefluid')

backpack id, vial id, gold coins cost, charges
Yes, bro I know but the ID of mana fluid are 2006,7 togather with "7", eg. mf 2006,7, lifefluid 2006,2. So maybe this will be fine ? I'm not able to check it right now cuz I'm out of home but I think this looking fine,
Lua:
shopModule:addBuyableItemContainer({'bp mana fluid', 'bp of mana fluid'}, 2001, 2006, 2000, 7, 'backpack of mana fluid')
 
Yes, bro I know but the ID of mana fluid are 2006,7 togather with "7", eg. mf 2006,7, lifefluid 2006,2. So maybe this will be fine ? I'm not able to check it right now cuz I'm out of home but I think this looking fine,

ID can't be 2006,7

XML:
 <item id="2006" article="a" name="vial">

Lua:
shopModule:addBuyableItemContainer({'bp mana fluid', 'bp of mana fluid'}, 2001, 2006, 2000, 7, 'backpack of mana fluid')

This would work for you but it will give you a backpack with 7x charges of mana fluids for 2,000 gold coins.
 
ID can't be 2006,7

XML:
 <item id="2006" article="a" name="vial">



This would work for you but it will give you a backpack with 7x charges of mana fluids for 2,000 gold coins.
Yes, ID can't be 2006,7 but while you want to create mana fluid u need to use /i 2006,7 because in 8.0 are script for fluid e.g like below cuz all vials have ID 2006

Lua:
local fluidType = {3, 4, 5, 7, 10, 11, 13, 15, 19 ,21 ,26 ,27 ,28 ,35}

local fluidMessage = {
    [2] = "Aaaah...",
    [3] = "Aah...",
    [4] = "Urgh!",
    [5] = "Mmmh.",
    [7] = "Aaaah...",
    [11] = "Urgh!",
    [13] = "Urgh!",
    [15] = "Aah...",
    [19] = "Urgh!",
    [21] = "Mmmh...",
    [26] = "Urgh!",
    [27] = "Urgh!",
    [28] = "Urgh!",
    [35] = "Mmmh."
}

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

    if target.itemid == 1 then
        if item.type == 0 then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, 'It is empty.')

        elseif target.uid == player.uid then
            if isInArray({3, 15, 27}, item.type) then
                player:addCondition(drunk)

            elseif item.type == 4 then
                player:addCondition(poison)

            elseif item.type == 7 then
                player:addMana(math.random(50, 150))
                doSendMagicEffect(toPosition,CONST_ME_MAGIC_BLUE)

            elseif item.type == 2 then
                player:addHealth(60)
                doSendMagicEffect(toPosition,CONST_ME_MAGIC_BLUE)
            end

            player:say(fluidMessage[item.type] or "Gulp.", TALKTYPE_MONSTER_SAY)
            item:transform(item.itemid, 0)
        else
            local pool = Game.createItem(2016, item.type, toPosition)
            if pool then
                pool:decay()
            end
            item:transform(item.itemid, 0)
        end
 
Back
Top