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

wand sell items

Elgenady

Veteran OT User
Joined
Aug 5, 2011
Messages
1,638
Solutions
35
Reaction score
352
Hello
i need help in script that help me sell items by wand when use wand on x items its disappear and give me money like i sell with rashid
i use 8.60
tfs 0.4-dev
sorry for my english
Id of items.. same id in rashid script
 
zaoan robe,11350,10000;terra rod,2181,5000;zaoan helmet,11296,50000;zaoan legs,11298,14000;divine plate,8885,100000;crown shield,2519,8000;fire sword,2392,4000;underworld rod,8910,12000;focus cape,8871,8000;giant sword,2393,20000;zaoan armor,11295,10000;drakinata,11299,10000;tower shield,2528,10000;boots of haste,2195,40000;dragon shield,2516,4000;royal helmet,2498,40000;dragon scale mail,2492,45000;blue robe,2656,12000;mastermind shield,2514,60000;magic plate armor,2472,150000;demon shield,2520,50000;golden legs,2470,50000;dwarven armor,2503,50000;glacier robe,7897,11000;golden armor,2466,20000;hibiscus dress,8873,3000;leopard armor,3968,1000;glacier robe
 
Code:
local items = {
   [11350] = 10000,
   [2181] = 5000,
   [11296] = 50000,
   [11298] = 14000,
   [8885] = 100000,
   [2519] = 8000,
   [2392] = 4000,
   [8910] = 12000,
   [8871] = 8000,
   [2393] = 20000,
   [11295] = 10000,
   [11299] = 10000,
   [2528] = 10000,
   [2195] = 40000,
   [2516] = 4000,
   [2498] = 40000,
   [2492] = 45000,
   [2656] = 12000,
   [2514] = 60000,
   [2472] = 150000,
   [2520] = 50000,
   [2470] = 50000,
   [2503] = 50000,
   [7897] = 11000,
   [2466] = 20000,
   [8873] = 3000,
   [3968] = 1000
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

     local x = items[itemEx.itemid]
     if x then
         doRemoveItem(itemEx.uid, 1)
         doPlayerAddMoney(cid, x)
         local info = getItemInfo(itemEx.itemid)
         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You sold "..info.article.." "..info.name.." for "..x.." gold.")
         doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_YELLOW)
     else
         doPlayerSendCancel(cid, "You can't sell this item.")
         doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
     end
     return true
end
If there need to be more added let me know.
 
thx its work fine :D u are good man
i can chnage it for flam seller like when throw the items in flam"tp" it disapper and give money?
 
Last edited:
movements.xml
Code:
<movevent type="AddItem" itemid="11350;2181;11295-11299;8885;2519;2392;8910;8871;2393;2528;2195;2516;2498;2492;2656;2514;2472;2520;2470;2503;7897;2466;8873;3968" event="script" value="sellfire.lua"/>

sellfire.lua
Code:
local items = {
   [11350] = 10000,
   [2181] = 5000,
   [11296] = 50000,
   [11298] = 14000,
   [8885] = 100000,
   [2519] = 8000,
   [2392] = 4000,
   [8910] = 12000,
   [8871] = 8000,
   [2393] = 20000,
   [11295] = 10000,
   [11299] = 10000,
   [2528] = 10000,
   [2195] = 40000,
   [2516] = 4000,
   [2498] = 40000,
   [2492] = 45000,
   [2656] = 12000,
   [2514] = 60000,
   [2472] = 150000,
   [2520] = 50000,
   [2470] = 50000,
   [2503] = 50000,
   [7897] = 11000,
   [2466] = 20000,
   [8873] = 3000,
   [3968] = 1000
}

function onAddItem(moveItem, tileItem, position, cid)

     local x = items[moveItem.itemid]
     if x then
         if getThingfromPos(position).actionid == 8001 then
             doRemoveItem(moveItem.uid, 1)
             doPlayerAddMoney(cid, x)
             local info = getItemInfo(moveItem.itemid)
             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You sold "..info.article.." "..info.name.." for "..x.." gold.")
             doSendMagicEffect(position, CONST_ME_FIREAREA)
         end
     end
     return true
end

Add actionid 8001 to the ground under the sellfire.
 
if i throw backpack with full items its don't sell i must sell items one by one.
i need it when u throw bp with items its sell items and back bp and money for player.
same in wand when use wand on bp i can sell items in bp
 
Sellwand with items backback
Code:
local items = {
   [11350] = 10000,
   [2181] = 5000,
   [11296] = 50000,
   [11298] = 14000,
   [8885] = 100000,
   [2519] = 8000,
   [2392] = 4000,
   [8910] = 12000,
   [8871] = 8000,
   [2393] = 20000,
   [11295] = 10000,
   [11299] = 10000,
   [2528] = 10000,
   [2195] = 40000,
   [2516] = 4000,
   [2498] = 40000,
   [2492] = 45000,
   [2656] = 12000,
   [2514] = 60000,
   [2472] = 150000,
   [2520] = 50000,
   [2470] = 50000,
   [2503] = 50000,
   [7897] = 11000,
   [2466] = 20000,
   [8873] = 3000,
   [3968] = 1000
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

     local x = items[itemEx.itemid]
     if x then
         doRemoveItem(itemEx.uid, 1)
         doPlayerAddMoney(cid, x)
         local info = getItemInfo(itemEx.itemid)
         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You sold "..info.article.." "..info.name.." for "..x.." gold.")
         doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_YELLOW)
     elseif isContainer(itemEx.uid) then
         local m, size, t = 0, getContainerSize(itemEx.uid), {}
         if size == 0 then
             return doPlayerSendCancel(cid, "This container is empty.")
         end
         for s = 0, size do
             local citem = getContainerItem(itemEx.uid, s)
             local cx = items[citem.itemid]
             if cx then
                 table.insert(t, citem)
             end
         end
         for r = 1, #t do
             doRemoveItem(t[r].uid, 1)
             m = m + items[t[r].itemid]
         end
         if m > 0 then
             doPlayerAddMoney(cid, m)
             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You sold your items for "..m.." gold.")
             doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_YELLOW)
         else
             doPlayerSendCancel(cid, "There is nothing in this container that is sellable.")
             doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
         end         
     else
         doPlayerSendCancel(cid, "You can't sell this item.")
         doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
     end
     return true
end
 
What did you had in mind exactly? Should it work with both items and items in a backpack, and should it work with all backpacks or specific ones and what should happen with the backpack?
 
Back
Top