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

I need script for OTSERV! Buy rune, potion etc.

ximishe

New Member
Joined
Mar 23, 2010
Messages
49
Reaction score
1
Hello i changed engine from evo to otserv 8.7 and i need following script:
I have rune on table and the upest is "Spark" - i making action id on this spark, then if you use this it buy example 100x Gfb for 2k.

Can someone make me that script?
 
Can someone edit this for me? To Work?

<?xml version="1.0" encoding="UTF-8"?>
<mod name="Buy item by lever" version="1.0" author="Darkhaos" contact="otland.net" enabled="yes">
<config name="switch_items"><![CDATA[
uid = {
[5556] = {item = 2273, count = 1, charges = 2, cost = 50, backpack = false, backpackID = 0, backpackCount = 0, cap = true},
[5557] = {item = 2313, count = 1, charges = 3, cost = 200, backpack = false, backpackID = 0, backpackCount = 0, cap = true},
[5558] = {item = 2268, count = 1, charges = 3, cost = 250, backpack = false, backpackID = 0, backpackCount = 0, cap = true},
[5559] = {item = 2293, count = 1, charges = 3, cost = 200, backpack = false, backpackID = 0, backpackCount = 0, cap = true},
[5560] = {item = 2311, count = 1, charges = 10, cost = 75, backpack = false, backpackID = 0, backpackCount = 0, cap = true},
[5561] = {item = 2304, count = 1, charges = 4, cost = 150, backpack = false, backpackID = 0, backpackCount = 0, cap = true},
[5562] = {item = 2006, count = 1, charges = 7, cost = 110, backpack = false, backpackID = 0, backpackCount = 0, cap = true},
[5563] = {item = 7620, count = 20, charges = 1, cost = 1000, backpack = true, backpackID = 2001, backpackCount = 1, cap = true},
[5564] = {item = 2273, count = 20, charges = 2, cost = 1000, backpack = true, backpackID = 2002, backpackCount = 1, cap = true},
[5565] = {item = 2268, count = 20, charges = 3, cost = 5000, backpack = true, backpackID = 2003, backpackCount = 1, cap = true},
[5566] = {item = 2293, count = 20, charges = 3, cost = 4000, backpack = true, backpackID = 1999, backpackCount = 1, cap = true},
[5567] = {item = 2311, count = 20, charges = 10, cost = 1500, backpack = true, backpackID = 2001, backpackCount = 1, cap = true},
[5568] = {item = 2313, count = 20, charges = 3, cost = 4000, backpack = true, backpackID = 2001, backpackCount = 1, cap = true},
[5569] = {item = 2304, count = 20, charges = 4, cost = 3000, backpack = true, backpackID = 2000, backpackCount = 1, cap = true},
[5570] = {item = 3940, count = 1, charges = 1, cost = 20, backpack = false, backpackID = 0, backpackCount = 0, cap = true},
[5571] = {item = 2006, count = 1, charges = 7, cost = 110, backpack = false, backpackID = 0, backpackCount = 0, cap = true},
[5572] = {item = 2006, count = 1, charges = 7, cost = 110, backpack = false, backpackID = 0, backpackCount = 0, cap = true}
}

levers = {
1945,
1946
}
]]></config>
<action fromuid="5556" touid="5572" event="buffer"><![CDATA[
domodlib('switch_items')

doTransformItem(item.uid, levers[item.itemid == levers[1] and 2 or 1])

local item = uid[item.uid]
if item then
if item.backpack then
if getPlayerMoney(cid) < item.cost then
doPlayerSendCancel(cid, "You need " .. item.cost .. " gold coins to buy a backpack of " .. getItemNameById(item.item) .. ".")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return true
end

if item.cap and getPlayerFreeCap(cid) < (getItemWeightById(item.backpackID, item.backpackCount) + getItemWeightById(item.item, item.count)) then
doPlayerSendCancel(cid, "You don't have enough cap.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return true
end

local container = doPlayerAddItem(cid, item.backpackID, item.backpackCount)
for i = 1, item.count do
doAddContainerItem(container, item.item, item.charges)
end
doPlayerRemoveMoney(cid, item.cost)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Bought " .. item.count .. "x " .. getItemNameById(item.item) .. ".")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
else
if getPlayerMoney(cid) < item.cost then
doPlayerSendCancel(cid, "You need " .. item.cost .. " gold coins to buy " .. getItemArticleById(item.item) .. " " .. getItemNameById(item.item) .. ".")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return true
end

if item.cap and getPlayerFreeCap(cid) < getItemWeightById(item.item, item.count) then
doPlayerSendCancel(cid, "You don't have enough cap.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return true
end

for i = 1, item.count do
doPlayerAddItem(cid, item.item, item.charges)
end
doPlayerRemoveMoney(cid, item.cost)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Bought " .. item.count .. "x " .. getItemNameById(item.item) .. ".")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
end
end
]]></action>
</mod
 
Back
Top