kamilcioo
Veteran OT User
- Joined
- Jul 25, 2008
- Messages
- 979
- Solutions
- 1
- Reaction score
- 291
Can someone edit my rune lever coz my rune lever do runes with normal rune charge. I want 50 all charge.
Code:
local config = {
[6008] = {potion = 2286, cost = 30000, backpack_id = 1991, charges = 50},
[6009] = {potion = 2313, cost = 60000, backpack_id = 1994, charges = 50},
[6010] = {potion = 2305, cost = 30000, backpack_id = 1993, charges = 50},
[6011] = {potion = 2293, cost = 60000, backpack_id = 1992, charges = 50},
[6012] = {potion = 2273, cost = 80000, backpack_id = 1995, charges = 50},
[6013] = {potion = 2268, cost = 110000, backpack_id = 1996, charges = 50},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local potion = config[item.uid]
if isInArray({1945, 1946}, item.itemid) ~= TRUE then
return TRUE
end
if doPlayerBuyItemContainer(cid, potion.backpack_id, potion.potion, 1, potion.cost, potion.charges) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You bought a bag "..getItemNameById(potion.potion).." for "..potion.cost.." gold coins.")
doSendAnimatedText(fromPosition, "Purchased", math.random(1,215))
doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need "..potion.cost.." gold coins for a bag "..getItemNameById(potion.potion)..".")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
return TRUE
end