I have 8.0 distroCan't you just use "buy with backpack" option? Then it will add manafluids/runes to backpacks?
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.gforgottenserver/data/npc/scripts/runes.lua at master · otland/forgottenserver
A free and open-source MMORPG server emulator written in C++ - otland/forgottenservergithub.com
Default runes NPC script already does that
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')
shopModule:addBuyableItemContainer({'lifefluid'}, 2000, 2006, 45, 2, 'backpack of vial of lifefluid')
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,Try it. Example:
Lua:shopModule:addBuyableItemContainer({'lifefluid'}, 2000, 2006, 45, 2, 'backpack of vial of lifefluid')
backpack id, vial id, gold coins cost, charges
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,
<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')
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 2006ID 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.
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