president vankk
Web Developer & AuraOT Owner
- Joined
- Jul 10, 2009
- Messages
- 5,719
- Solutions
- 9
- Reaction score
- 339
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="action-shop" version="1.0" author="slawkens" contact="[email protected]" enabled="yes">
<config name="action-shop-config"><![CDATA[
items = {
-- health potions
[3001] = {itemid = 7591, cost = 3900, backpack = 2000, name = "backpack of great health potions"},
[3002] = {itemid = 8473, cost = 6300, backpack = 2000, name = "backpack of ultimate health potions"},
[3003] = {itemid = 7588, cost = 2300, backpack = 2000, name = "backpack of strong health potion"}
-- runes
[3004] = {itemid = 2268, cost = 7100, backpack = 2003, name = "backpack of sudden death runes", charges = 75},
[3005] = {itemid = 2273, cost = 6100, backpack = 2002, name = "backpack of ultimate healing runes", charges = 75},
[3006] = {itemid = 2313, cost = 2450, backpack = 2001, name = "backpack of explosion rune", charges = 75},
[3007] = {itemid = 2293, cost = 2500, backpack = 2004, name = "backpack of magic wall", charges = 75}
-- other
[3008] = {itemid = 2268, cost = 500, name = "sudden death runes"},
[3009] = {itemid = 8473, cost = 500, name = "ultimate healing runes"},
[3010] = {itemid = 2278, cost = 800, name = "paralyse"},
[3011] = {itemid = 2305, cost = 500, name = "firebomb"},
[3012] = {itemid = 2274, cost = 500, name = "avalance"},
[3013] = {itemid = 2313, cost = 500, name = "explosion rune"},
[3014] = {itemid = 2293, cost = 500, name = "magic wall"}
}
]]></config>
<action fromaid="3001" toaid="3014" event="script"><![CDATA[
domodlib('action-shop-config')
local items = items
function onUse(cid, item, fromPosition, itemEx, toPosition)
local tmp = items[item.actionid]
if(not tmp) then
error('ERROR - action-shop mod: actionid is empty.')
return false
end
local count = (tmp.count ~= nil and tmp.count or 1)
local charges = (tmp.charges ~= nil and tmp.charges or 1)
if(tmp.backpack) then
if(doPlayerBuyItemContainer(cid, tmp.backpack, tmp.itemid, 1, tmp.cost, charges)) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought a " .. tmp.name .. ".")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have enought money. (" .. tmp.cost .. "gp)")
end
else
if(doPlayerBuyItem(cid, tmp.itemid, count, tmp.cost, charges)) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought " .. tmp.name .. ".")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have enought money. (" .. tmp.cost .. "gp)")
end
end
return true
end
]]></action>
</mod>
which fail ??