local emptyflask = {7634,7635,7636,}
local targetIdList = {
--health potions casks
[28555] = {itemId = 7634, transform = 7618}, [28579] = {itemId = 7634, transform = 7618}, -- Health Potion --
[28556] = {itemId = 7634, transform = 7588}, [28580] = {itemId = 7634, transform = 7588}, -- Strong Health --
[28557] = {itemId = 7635, transform = 7591}, [28581] = {itemId = 7635, transform = 7591}, -- Great Health --
[28558] = {itemId = 7635, transform = 8473}, [28582] = {itemId = 7635, transform = 8473}, -- Ultimate Health --
[28559] = {itemId = 7635, transform = 26031}, [28583] = {itemId = 7635, transform = 26031}, -- Supreme Health --
--mana potions casks
[28565] = {itemId = 7636, transform = 7620}, [28584] = {itemId = 7636, transform = 7620}, -- Mana Potion --
[28566] = {itemId = 7634, transform = 7589}, [28585] = {itemId = 7634, transform = 7589}, -- Strong Mana --
[28567] = {itemId = 7635, transform = 7590}, [28586] = {itemId = 7635, transform = 7590}, -- Great Mana --
[28568] = {itemId = 7635, transform = 26029}, [28587] = {itemId = 7635, transform = 26029}, -- Ultimate Mana --
--spirit potions caks
[28575] = {itemId = 7635, transform = 8472}, [28589] = {itemId = 7635, transform = 8472}, -- Great Spirit --
[28576] = {itemId = 7635, transform = 26030}, [28590] = {itemId = 7635, transform = 26030}, --Ultimate Spirit --
}
someone can help config scrips
Code:local emptyflask = {7634,7635,7636,} local targetIdList = { --health potions casks [28555] = {itemId = 7634, transform = 7618}, [28579] = {itemId = 7634, transform = 7618}, -- Health Potion -- [28556] = {itemId = 7634, transform = 7588}, [28580] = {itemId = 7634, transform = 7588}, -- Strong Health -- [28557] = {itemId = 7635, transform = 7591}, [28581] = {itemId = 7635, transform = 7591}, -- Great Health -- [28558] = {itemId = 7635, transform = 8473}, [28582] = {itemId = 7635, transform = 8473}, -- Ultimate Health -- [28559] = {itemId = 7635, transform = 26031}, [28583] = {itemId = 7635, transform = 26031}, -- Supreme Health -- --mana potions casks [28565] = {itemId = 7636, transform = 7620}, [28584] = {itemId = 7636, transform = 7620}, -- Mana Potion -- [28566] = {itemId = 7634, transform = 7589}, [28585] = {itemId = 7634, transform = 7589}, -- Strong Mana -- [28567] = {itemId = 7635, transform = 7590}, [28586] = {itemId = 7635, transform = 7590}, -- Great Mana -- [28568] = {itemId = 7635, transform = 26029}, [28587] = {itemId = 7635, transform = 26029}, -- Ultimate Mana -- --spirit potions caks [28575] = {itemId = 7635, transform = 8472}, [28589] = {itemId = 7635, transform = 8472}, -- Great Spirit -- [28576] = {itemId = 7635, transform = 26030}, [28590] = {itemId = 7635, transform = 26030}, --Ultimate Spirit -- }
I want the item id to read from--- local emptyflask = {7634,7635,7636,}
in this place--- itemId = 7634
local emptyFlask = {7634, 7635, 7636}
local targetIdList = {
--health potions casks
[28555] = {itemId = emptyFlask[1], transform = 7618}, [28579] = {itemId = emptyFlask[1], transform = 7618}, -- Health Potion --
[28556] = {itemId = emptyFlask[1], transform = 7588}, [28580] = {itemId = emptyFlask[1], transform = 7588}, -- Strong Health --
[28557] = {itemId = emptyFlask[2], transform = 7591}, [28581] = {itemId = emptyFlask[2], transform = 7591}, -- Great Health --
[28558] = {itemId = emptyFlask[2], transform = 8473}, [28582] = {itemId = emptyFlask[2], transform = 8473}, -- Ultimate Health --
[28559] = {itemId = emptyFlask[2], transform = 26031}, [28583] = {itemId = emptyFlask[2], transform = 26031}, -- Supreme Health --
--mana potions casks
[28565] = {itemId = emptyFlask[3], transform = 7620}, [28584] = {itemId = emptyFlask[3], transform = 7620}, -- Mana Potion --
[28566] = {itemId = emptyFlask[1], transform = 7589}, [28585] = {itemId = emptyFlask[1], transform = 7589}, -- Strong Mana --
[28567] = {itemId = emptyFlask[2], transform = 7590}, [28586] = {itemId = emptyFlask[2], transform = 7590}, -- Great Mana --
[28568] = {itemId = emptyFlask[2], transform = 26029}, [28587] = {itemId = emptyFlask[2], transform = 26029}, -- Ultimate Mana --
--spirit potions caks
[28575] = {itemId = emptyFlask[2], transform = 8472}, [28589] = {itemId = emptyFlask[2], transform = 8472}, -- Great Spirit --
[28576] = {itemId = emptyFlask[2], transform = 26030}, [28590] = {itemId = emptyFlask[2], transform = 26030}, --Ultimate Spirit --
}
local emptyflask = {7634,7635,7636,}
local targetIdList = {
--health potions casks
[28555] = {itemId = 7636, transform = 7618}, [28579] = {itemId = 7636, transform = 7618}, -- Health Potion --
[28556] = {itemId = 7634, transform = 7588}, [28580] = {itemId = 7634, transform = 7588}, -- Strong Health --
[28557] = {itemId = 7635, transform = 7591}, [28581] = {itemId = 7635, transform = 7591}, -- Great Health --
[28558] = {itemId = 7635, transform = 8473}, [28582] = {itemId = 7635, transform = 8473}, -- Ultimate Health --
[28559] = {itemId = 7635, transform = 26031}, [28583] = {itemId = 7635, transform = 26031}, -- Supreme Health --
--mana potions casks
[28565] = {itemId = 7636, transform = 7620}, [28584] = {itemId = 7636, transform = 7620}, -- Mana Potion --
[28566] = {itemId = 7634, transform = 7589}, [28585] = {itemId = 7634, transform = 7589}, -- Strong Mana --
[28567] = {itemId = 7635, transform = 7590}, [28586] = {itemId = 7635, transform = 7590}, -- Great Mana --
[28568] = {itemId = 7635, transform = 26029}, [28587] = {itemId = 7635, transform = 26029}, -- Ultimate Mana --
--spirit potions caks
[28575] = {itemId = 7635, transform = 8472}, [28589] = {itemId = 7635, transform = 8472}, -- Great Spirit --
[28576] = {itemId = 7635, transform = 26030}, [28590] = {itemId = 7635, transform = 26030}, --Ultimate Spirit --
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if target:getId() >= 28535 and target:getId() <= 28590 then
local house = player:getTile():getHouse()
if house and house:canEditAccessList(SUBOWNER_LIST, player) and house:canEditAccessList(doorId, player) or target:getId() >= 28579 then
elseif target:getId() >= 28535 and target:getId() < 28579 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Sorry, casks only can be useds inside house.')
return false
else
return false
end
if target then
local charges = target:getCharges()
if item:getCount() > charges then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format('Sorry, only Remaining %s charges.', charges))
return false
end
local targetId = targetIdList[target:getId()]
if targetId then
if item:getId() == targetId.itemId then
item:transform(targetId.transform)
charges = charges - item:getCount()
target:transform(target:getId(), charges)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format('Remaining %s charges.', charges))
if charges == 0 then
target:remove()
end
end
end
end
return true
end
end
<item id="28565" article="a" name="mana potion cask">
<attribute key="wrapableTo" value="26054" />
<attribute key="charges" value="1000" />
<attribute key="description" value="This cask can be used to refill mana potions." />
<attribute key="weight" value="200000" />
</item>
You see a health potion keg.
It weighs 125.00 oz.
This keg can be used to refill health potions.
It has 500 refillings left.
Item ID: 28579
You see an Ultimate health potion cask.
Wrap it in your own house to create a <decoration kit>.
It has 1000 refillings left.
Item ID: 28558, Action ID: 28558
-- If offer is Stackable.
elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_STACKABLE then
local function isKegItem(itemId)
return itemId>=ITEM_KEG_START and itemId <= ITEM_KEG_END
end
if(isKegItem(offer.thingId)) and player:getFreeCapacity() < ItemType(offer.thingId):getWeight(1) then
return addPlayerEvent(sendStoreError, 250, playerId, GameStore.StoreErrors.STORE_ERROR_NETWORK, "Please make sure you have free capacity to hold this item.")
elseif player:getFreeCapacity() < ItemType(offer.thingId):getWeight(1) then
return addPlayerEvent(sendStoreError, 250, playerId, GameStore.StoreErrors.STORE_ERROR_NETWORK, "Please make sure you have free capacity to hold this item.")
end
local inbox = player:getSlotItem(CONST_SLOT_STORE_INBOX)
if inbox and inbox:getEmptySlots() > 0 then
if(isKegItem(offer.thingId)) then
if(offer.count >= 500) then
local parcel = Item(inbox:addItem(2596, 1):getUniqueId())
local function changeParcel(parcel)
local packagename = ''.. offer.count..'x '.. offer.name ..' package.'
if parcel then
parcel:setAttribute(ITEM_ATTRIBUTE_NAME, packagename)
local pendingCount= offer.count
while(pendingCount>0) do
local pack
if(pendingCount>500) then
pack = 500
else
pack = pendingCount
end
local kegItem = parcel:addItem(offer.thingId, 1)
kegItem:setAttribute(ITEM_ATTRIBUTE_CHARGES, pack)
pendingCount=pendingCount-pack
end
end
end
addEvent(function() changeParcel(parcel) end, 250)
else
local kegItem = inbox:addItem(offer.thingId,1)
kegItem:setAttribute(ITEM_ATTRIBUTE_CHARGES, offer.count)
end
elseif offer.thingId == 32384 or offer.thingId == 32385 or offer.thingId == 32386 or offer.thingId == 32387 or offer.thingId == 32388 or offer.thingId == 32389 then
local exerciseItem = inbox:addItem(offer.thingId,1)
exerciseItem:setAttribute(ITEM_ATTRIBUTE_CHARGES, offer.count)
elseif (offer.count > 100) then
local parcel = Item(inbox:addItem(2596, 1):getUniqueId())
local function changeParcel(parcel)
local packagename = ''.. offer.count..'x '.. offer.name ..' package.'
if parcel then
parcel:setAttribute(ITEM_ATTRIBUTE_NAME, packagename)
local pendingCount= offer.count
while(pendingCount>0) do
local pack
if(pendingCount>100) then
pack = 100
else
pack = pendingCount
end
parcel:addItem(offer.thingId, pack)
pendingCount=pendingCount-pack
end
end
end
addEvent(function() changeParcel(parcel) end, 250)
else
inbox:addItem(offer.thingId, offer.count)
end
else
return addPlayerEvent(sendStoreError, 250, playerId, GameStore.StoreErrors.STORE_ERROR_NETWORK, "Please make sure you have free slots in your store inbox.")
end
elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_HOUSE then
local function isCaskItem(itemId)
return (itemId >= ITEM_HEALTH_CASK_START and itemId <= ITEM_HEALTH_CASK_END) or
(itemId >= ITEM_MANA_CASK_START and itemId <= ITEM_MANA_CASK_END) or
(itemId >= ITEM_SPIRIT_CASK_START and itemId <= ITEM_SPIRIT_CASK_END)
end
local inbox = player:getSlotItem(CONST_SLOT_STORE_INBOX)
if inbox and inbox:getEmptySlots() > 0 then
local decoKit = inbox:addItem(26054, 1)
local function changeKit(kit)
local decoItemName = ItemType(offer.thingId):getName()
if kit then
kit:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "You bought this item in the Store.\nUnwrap it in your own house to create a " ..decoItemName..".")
kit:setActionId(offer.thingId)
if isCaskItem(offer.thingId) then
kit:setAttribute(ITEM_ATTRIBUTE_DATE, offer.count)
end
end
end
addEvent(function() changeKit(decoKit) end, 250)
else
return addPlayerEvent(sendStoreError, 250, playerId, GameStore.StoreErrors.STORE_ERROR_NETWORK, "Please make sure you have free slots in your store inbox.")
end
{
name = "Kegs Potion",
state = GameStore.States.STATE_NONE,
description = "You can use refill empty flask",
icons = {"mana_keg.png"},
rookgaard = true,
offers = {
{name = "Health Keg", thingId = 28579, count = 500, type = GameStore.OfferTypes.OFFER_TYPE_STACKABLE, price = 4, icons = {"health_keg.png"}},
{name = "Strong Health Keg", thingId = 28580, count = 500, type = GameStore.OfferTypes.OFFER_TYPE_STACKABLE, price = 8, icons = {"strong_health_keg.png"}},
{name = "Great Health Keg", thingId = 28581, count = 500, type = GameStore.OfferTypes.OFFER_TYPE_STACKABLE, price = 36, icons = {"great_health_keg.png"}},
{name = "Ultimate Health Keg", thingId = 28582, count = 500, type = GameStore.OfferTypes.OFFER_TYPE_STACKABLE, price = 58, icons = {"ultimate_health_keg.png"}},
{name = "Supreme Health Keg", thingId = 28583, count = 500, type = GameStore.OfferTypes.OFFER_TYPE_STACKABLE, price = 94, icons = {"supreme_health_keg.png"}},
{name = "Mana Keg", thingId = 28584, count = 500, type = GameStore.OfferTypes.OFFER_TYPE_STACKABLE, price = 4, icons = {"mana_keg.png"}},
{name = "Strong Mana Keg", thingId = 28585, count = 500, type = GameStore.OfferTypes.OFFER_TYPE_STACKABLE, price = 8, icons = {"strong_mana_keg.png"}},
{name = "Great Mana Keg", thingId = 28586, count = 500, type = GameStore.OfferTypes.OFFER_TYPE_STACKABLE, price = 36, icons = {"great_mana_keg.png"}},
{name = "Ultimate Mana Keg", thingId = 28587, count = 500, type = GameStore.OfferTypes.OFFER_TYPE_STACKABLE, price = 66, icons = {"ultimate_mana_keg.png"}},
{name = "Great Spirit Potion Keg", thingId = 28589, count = 500, type = GameStore.OfferTypes.OFFER_TYPE_STACKABLE, price = 36, icons = {"great_spirit_keg.png"}},
{name = "Ultimate Spirit Potion Keg", thingId = 28590, count = 500, type = GameStore.OfferTypes.OFFER_TYPE_STACKABLE, price = 66, icons = {"ultimate_spirit_keg.png"}},
},
},